diff --git a/.gitignore b/.gitignore index ad3c707c0..5c58f453d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ config.prod.json storybook-static/ webcomponents/monaco-editor/workers + +canisters/canisters diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ce95bd7..5b592a029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ ### Providers - firebase: v4.1.3 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/providers/firebase/CHANGELOG.md)) -- ic: v7.1.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/main/providers/ic/CHANGELOG.md)) + +### Providers: Deprecated and integrated into `papyrs` + +- ic ### Web Components: New diff --git a/README.md b/README.md index f7b0b4a80..28d0c3bde 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,6 @@ If you like the project, you can become a sponsor at [Open Collective](https://o | **AWS (Backend)** | ![version](https://img.shields.io/static/v1.svg?label=production&message=v2.0.0&color=success) | [`README`](backend/README.md) | [`CHANGELOG`](backend/CHANGELOG.md) | | **AWS (Infra)** | ![version](https://img.shields.io/static/v1.svg?label=production&message=up&color=success) | [`README`](infra/README.md) | | | **Firebase (Cloud)** | ![version](https://img.shields.io/static/v1.svg?label=production&message=v2.2.1&color=success) | [`README`](cloud/README.md) | [`CHANGELOG`](cloud/CHANGELOG.md) | -| **Internet Computer** | ![version](https://img.shields.io/static/v1.svg?label=alpha&message=up&color=blueviolet) | [`README`](canisters/README.md) | [`CHANGELOG`](canisters/CHANGELOG.md) | ## Providers diff --git a/canisters/CHANGELOG.md b/canisters/CHANGELOG.md deleted file mode 100644 index b317670a2..000000000 --- a/canisters/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# 1.0.0 (2020-XX-YY) - -### Features - -- Hello World 👋 diff --git a/canisters/README.md b/canisters/README.md index 670a0ce9c..bf42a5136 100644 --- a/canisters/README.md +++ b/canisters/README.md @@ -5,7 +5,7 @@ # DeckDeckGo - Canisters -The canisters on the Internet Computer of [DeckDeckGo]. +Deploy script and environment variables of the (backend) canisters on the Internet Computer of [DeckDeckGo]. ## License diff --git a/canisters/scripts/ic.types.js b/canisters/scripts/ic.types.js index 4c7185589..44fa1bcd9 100644 --- a/canisters/scripts/ic.types.js +++ b/canisters/scripts/ic.types.js @@ -1,79 +1,10 @@ #!/usr/bin/env node -const prettier = require('prettier'); - -const {join, extname, basename} = require('path'); -const {existsSync, readdirSync, writeFileSync, lstatSync, copyFileSync, readFileSync} = require('fs'); - -const copyTypes = async ({src, dest = `./providers/ic/src/canisters`}) => { - const promises = readdirSync(src) - .filter((subFolder) => !['assets', 'idl'].includes(subFolder)) - .map( - (dirent) => - new Promise(async (resolve) => { - const [srcPath, destPath] = [src, dest].map((dirPath) => join(dirPath, dirent)); - - const stat = lstatSync(srcPath); - - if (stat.isDirectory()) { - await copyTypes({src: srcPath, dest: destPath}); - } else if (stat.isFile()) { - await copyFile({srcPath, destPath}); - } - - resolve(); - }) - ); - - await Promise.all(promises); -}; - -const copyFile = async ({srcPath, destPath}) => { - if (extname(srcPath) === '.wasm') { - return; - } - - if (basename(srcPath) === 'index.js') { - return; - } - - if (basename(srcPath).indexOf('.old.') > -1) { - return; - } - - if (['.did', '.most'].includes(extname(srcPath))) { - copyFileSync(srcPath, destPath); - return; - } - - if (extname(srcPath) === '.mjs') { - return; - } - - const buffer = readFileSync(srcPath); - const config = await prettier.resolveConfig('./prettierrc'); - const output = prettier.format(buffer.toString('utf-8'), {parser: 'babel', ...config}); - - writeFileSync(destPath.replace('.did.js', '.utils.did.js'), output); -}; +const {writeFileSync, readFileSync} = require('fs'); const copyAdminManagerMjs = ({src}) => { const buffer = readFileSync(`${src}manager/manager.did.js`); writeFileSync(`${src}manager/manager.did.mjs`, buffer.toString('utf-8')); }; -(async () => { - try { - if (existsSync('.dfx/local/canisters/')) { - await copyTypes({src: `.dfx/local/canisters/`}); - } else if (existsSync('.dfx/ic/canisters/')) { - await copyTypes({src: `.dfx/ic/canisters/`}); - } - - copyAdminManagerMjs({src: '.dfx/local/canisters/'}); - - console.log(`Internet Computer types declarations generated!`); - } catch (err) { - console.error(`Error while generating the types for the Internet Computer.`, err); - } -})(); +copyAdminManagerMjs({src: '.dfx/local/canisters/'}); diff --git a/canisters/src/data/data.filter.mo b/canisters/src/data/data.filter.mo deleted file mode 100644 index 8bc107464..000000000 --- a/canisters/src/data/data.filter.mo +++ /dev/null @@ -1,32 +0,0 @@ -import Text "mo:base/Text"; - -module { - - public type DataFilter = { - startsWith: ?Text; - notContains: ?Text; - }; - - public func startsWith(key: Text, startsWith: ?Text): Bool { - switch (startsWith) { - case null { - return true; - }; - case (?startsWith) { - return Text.startsWith(key, #text startsWith); - }; - }; - }; - - public func notContains(key: Text, notContains: ?Text): Bool { - switch (notContains) { - case null { - return true; - }; - case (?notContains) { - return not Text.contains(key, #text notContains); - }; - }; - }; - -} diff --git a/canisters/src/data/data.mo b/canisters/src/data/data.mo deleted file mode 100644 index cdc1f32e7..000000000 --- a/canisters/src/data/data.mo +++ /dev/null @@ -1,93 +0,0 @@ -import HashMap "mo:base/HashMap"; -import Text "mo:base/Text"; -import Iter "mo:base/Iter"; - -import Error "mo:base/Error"; - -import Types "../types/types"; -import DataTypes "./data.types"; - -import Filter "./data.filter"; - -import Utils "../utils/utils"; - -import WalletUtils "../utils/wallet.utils"; - -import DataStore "./data.store"; - -actor class DataBucket(owner: Types.UserId) = this { - - type UserId = Types.UserId; - - type Data = DataTypes.Data; - type DataFilter = Filter.DataFilter; - - private stable let user: Types.UserId = owner; - - private let walletUtils: WalletUtils.WalletUtils = WalletUtils.WalletUtils(); - - private let store: DataStore.DataStore = DataStore.DataStore(); - - // Preserve the application state on upgrades - private stable var entries : [(Text, Data)] = []; - - /** - * Data - */ - - public shared query({ caller }) func get(key: Text) : async (?Data) { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to get the data."); - }; - - let entry: ?Data = store.get(key); - return entry; - }; - - public shared query({ caller }) func list(filter: ?DataFilter) : async [(Text, Data)] { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to list the data."); - }; - - let results: [(Text, Data)] = store.entries(filter); - return results; - }; - - public shared({ caller }) func set(key: Text, data: Data) : async () { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to set data."); - }; - - store.put(key, data); - }; - - public shared({ caller }) func del(key: Text) : async () { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to delete the data."); - }; - - let entry: ?Data = store.del(key); - }; - - /** - * Canister mgmt - */ - - public shared({ caller }) func transferCycles(): async() { - if (not Utils.isManager(caller)) { - throw Error.reject("Unauthorized access. Caller is not a manager."); - }; - - await walletUtils.transferCycles(caller); - }; - - system func preupgrade() { - entries := Iter.toArray(store.preupgrade().entries()); - }; - - system func postupgrade() { - store.postupgrade(entries); - entries := []; - }; - -}; diff --git a/canisters/src/data/data.store.mo b/canisters/src/data/data.store.mo deleted file mode 100644 index 9b67185c6..000000000 --- a/canisters/src/data/data.store.mo +++ /dev/null @@ -1,69 +0,0 @@ -import Text "mo:base/Text"; -import HashMap "mo:base/HashMap"; -import Iter "mo:base/Iter"; -import Array "mo:base/Array"; - -import Filter "./data.filter"; - -module { - type DataFilter = Filter.DataFilter; - - public class DataStore() { - private var data: HashMap.HashMap = HashMap.HashMap(10, Text.equal, Text.hash); - - public func put(key: Text, value: T) { - data.put(key, value); - }; - - public func get(key: Text): ?T { - return data.get(key); - }; - - public func del(key: Text): ?T { - let entry: ?T = get(key); - - switch (entry) { - case (?entry) { - data.delete(key); - }; - case (null) {}; - }; - - return entry; - }; - - public func entries(filter: ?DataFilter): [(Text, T)] { - let entries: Iter.Iter<(Text, T)> = data.entries(); - - switch (filter) { - case null { - return Iter.toArray(entries); - }; - case (?filter) { - let keyValues: [(Text, T)] = Iter.toArray(entries); - - let {startsWith; notContains} = filter; - - let values: [(Text, T)] = Array.mapFilter<(Text, T), (Text, T)>(keyValues, func ((key: Text, value: T)) : ?(Text, T) { - if (Filter.startsWith(key, startsWith) and Filter.notContains(key, notContains)) { - return ?(key, value); - }; - - return null; - }); - - - return values; - }; - }; - }; - - public func preupgrade(): HashMap.HashMap { - return data; - }; - - public func postupgrade(stableData: [(Text, T)]) { - data := HashMap.fromIter(stableData.vals(), 10, Text.equal, Text.hash); - }; - } -} diff --git a/canisters/src/data/data.types.mo b/canisters/src/data/data.types.mo deleted file mode 100644 index fc2cacd2f..000000000 --- a/canisters/src/data/data.types.mo +++ /dev/null @@ -1,16 +0,0 @@ -import Text "mo:base/Text"; -import Time "mo:base/Time"; -import Blob "mo:base/Blob"; - -module { - - public type Data = { - id: Text; - - data: Blob; - - created_at: Time.Time; - updated_at: Time.Time; - }; - -} diff --git a/canisters/src/manager/bucket.store.mo b/canisters/src/manager/bucket.store.mo deleted file mode 100644 index 7d78e37ef..000000000 --- a/canisters/src/manager/bucket.store.mo +++ /dev/null @@ -1,145 +0,0 @@ -import Principal "mo:base/Principal"; -import HashMap "mo:base/HashMap"; -import Text "mo:base/Text"; -import Option "mo:base/Option"; -import Iter "mo:base/Iter"; -import Array "mo:base/Array"; -import Result "mo:base/Result"; -import Error "mo:base/Error"; - -import Types "../types/types"; -import BucketTypes "./bucket.types"; - -import Utils "../utils/utils"; -import CanisterUtils "../utils/canister.utils"; - -module { - private type UserId = Types.UserId; - - private type Bucket = BucketTypes.Bucket; - - public class BucketStore() { - private var buckets: HashMap.HashMap = HashMap.HashMap(10, Utils.isPrincipalEqual, Principal.hash); - - private let canisterUtils: CanisterUtils.CanisterUtils = CanisterUtils.CanisterUtils(); - - public func init(manager: Principal, user: UserId, initNewBucket: (manager: Principal, user: UserId) -> async (Principal)): async (Result.Result) { - let result: Result.Result = getBucket(user); - - switch (result) { - case (#err error) { - return #err error; - }; - case (#ok bucket) { - switch (bucket) { - case (?bucket) { - return #ok bucket; - }; - case null { - return await initBucket(manager, user, initNewBucket); - }; - } - }; - }; - }; - - private func initBucket(manager: Principal, user: UserId, initNewBucket: (manager: Principal, user: UserId) -> async (Principal)): async (Result.Result) { - initEmptyBucket(user); - - let newBucketResult: Result.Result = await createBucket(manager, user, initNewBucket); - - return newBucketResult; - }; - - // We add an entry in the list of bucket to know that we are creating a bucket for the user - // In the frontend, if we get an entry without bucket, we poll until we get it - // Doing so we aim to avoid issue if the user refresh is browser, for example, while the creation of the bucket is on going (can least up to 30s) - private func initEmptyBucket(user: UserId) { - let newDataBucket: BucketTypes.Bucket = { - bucketId = null; - owner = user; - }; - - buckets.put(user, newDataBucket); - }; - - private func createBucket(manager: Principal, user: UserId, initNewBucket: (manager: Principal, user: UserId) -> async (Principal)): async (Result.Result) { - try { - let newBucketId: Principal = await initNewBucket(manager, user); - - let newDataBucket: BucketTypes.Bucket = { - bucketId = ?newBucketId; - owner = user; - }; - - buckets.put(user, newDataBucket); - - return #ok newDataBucket; - } catch (error) { - // If it fails, remove the pending empty bucket entry from the list - buckets.delete(user); - - return #err ("Cannot create bucket." # Error.message(error)); - }; - }; - - public func getBucket(user: UserId): Result.Result { - let bucket: ?Bucket = buckets.get(user); - - switch bucket { - case (?{owner}) { - if (Utils.isPrincipalEqual(user, owner)) { - return #ok bucket; - }; - }; - case null { - return #ok null; - }; - }; - - return #err "User does not have the permission for the bucket."; - }; - - public func deleteBucket(user: UserId) : async (Result.Result) { - let bucket: Result.Result = getBucket(user); - - switch (bucket) { - case (#err error) { - return #err error; - }; - case (#ok bucket) { - switch (bucket) { - case (?{bucketId}) { - await canisterUtils.deleteCanister(bucketId); - - buckets.delete(user); - }; - case null {}; - }; - - return #ok bucket; - }; - }; - }; - - public func entries(): [Bucket] { - let entries: Iter.Iter<(UserId, Bucket)> = buckets.entries(); - let values: Iter.Iter = Iter.map(entries, func ((key: UserId, value: Bucket)) : Bucket { - { - bucketId = value.bucketId; - owner = value.owner; - }; - }); - return Iter.toArray(values); - }; - - public func preupgrade(): HashMap.HashMap { - return buckets; - }; - - public func postupgrade(stableBuckets: [(UserId, Bucket)]) { - buckets := HashMap.fromIter(stableBuckets.vals(), 10, Utils.isPrincipalEqual, Principal.hash); - }; - } - -} diff --git a/canisters/src/manager/bucket.types.mo b/canisters/src/manager/bucket.types.mo deleted file mode 100644 index ba05d9268..000000000 --- a/canisters/src/manager/bucket.types.mo +++ /dev/null @@ -1,13 +0,0 @@ -import Principal "mo:base/Principal"; - -import Types "../types/types"; -import IC "../types/ic.types"; - -module { - public type BucketId = IC.canister_id; - - public type Bucket = { - bucketId: ?BucketId; - owner: Types.UserId; - }; -}; diff --git a/canisters/src/manager/manager.mo b/canisters/src/manager/manager.mo deleted file mode 100644 index 7b5506b7d..000000000 --- a/canisters/src/manager/manager.mo +++ /dev/null @@ -1,206 +0,0 @@ -import Cycles "mo:base/ExperimentalCycles"; -import Error "mo:base/Error"; -import HashMap "mo:base/HashMap"; -import Iter "mo:base/Iter"; -import Option "mo:base/Option"; -import Principal "mo:base/Principal"; -import Text "mo:base/Text"; -import Result "mo:base/Result"; - -import Types "../types/types"; - -import CanisterUtils "../utils/canister.utils"; - -import BucketTypes "./bucket.types"; -import BucketStore "./bucket.store"; - -import DataBucket "../data/data"; -import StorageBucket "../storage/storage"; - -import Utils "../utils/utils"; - -actor Manager { - private type UserId = Types.UserId; - - private type DataBucket = DataBucket.DataBucket; - private type StorageBucket = StorageBucket.StorageBucket; - - private type Bucket = BucketTypes.Bucket; - - private let canisterUtils: CanisterUtils.CanisterUtils = CanisterUtils.CanisterUtils(); - - let dataStore: BucketStore.BucketStore = BucketStore.BucketStore(); - let storagesStore: BucketStore.BucketStore = BucketStore.BucketStore(); - - // Preserve the application state on upgrades - private stable var data : [(Principal, BucketTypes.Bucket)] = []; - private stable var storages : [(Principal, BucketTypes.Bucket)] = []; - - /** - * Data - */ - - public shared({ caller }) func initData(): async (Bucket) { - return await initBucket(caller, dataStore, initNewDataBucket); - }; - - private func initNewDataBucket(manager: Principal, user: UserId): async (Principal) { - Cycles.add(1_000_000_000_000); - let b: DataBucket = await DataBucket.DataBucket(user); - - let canisterId: Principal = Principal.fromActor(b); - - await canisterUtils.updateSettings(canisterId, manager); - - return canisterId; - }; - - public shared query({ caller }) func getData() : async ?Bucket { - let result: Result.Result = dataStore.getBucket(caller); - - switch (result) { - case (#err error) { - throw Error.reject(error); - }; - case (#ok bucket) { - switch (bucket) { - case (?bucket) { - return ?bucket; - }; - case null { - // We do not throw a "Not found error" here. - // For performance reason, in web app we first query if the bucket exists and then if not, we init it. - return null; - }; - }; - }; - }; - }; - - public shared({ caller }) func delData() : async (Bool) { - return await delBucket(caller, dataStore); - }; - - /** - * Storages - */ - - public shared({ caller }) func initStorage(): async (Bucket) { - return await initBucket(caller, storagesStore, initNewStorageBucket); - }; - - private func initNewStorageBucket(manager: Principal, user: UserId): async (Principal) { - Cycles.add(1_000_000_000_000); - let b: StorageBucket = await StorageBucket.StorageBucket(user); - - let canisterId: Principal = Principal.fromActor(b); - - await canisterUtils.updateSettings(canisterId, manager); - - return canisterId; - }; - - public shared query({ caller }) func getStorage() : async ?Bucket { - let result: Result.Result = storagesStore.getBucket(caller); - - switch (result) { - case (#err error) { - throw Error.reject(error); - }; - case (#ok bucket) { - switch (bucket) { - case (?bucket) { - return ?bucket; - }; - case null { - // We do not throw a "Not found error" here. - // For performance reason, in web app we first query if the bucket exists and then if not, we init it. - return null; - }; - }; - }; - }; - }; - - public shared({ caller }) func delStorage() : async (Bool) { - return await delBucket(caller, storagesStore); - }; - - /** - * Buckets - */ - - private func initBucket(caller: Principal, store: BucketStore.BucketStore, initNewBucket: (manager: Principal, user: UserId) -> async (Principal)): async (Bucket) { - let self: Principal = Principal.fromActor(Manager); - - let result: Result.Result = await store.init(self, caller, initNewBucket); - - switch (result) { - case (#err error) { - throw Error.reject(error); - }; - case (#ok bucket) { - return bucket; - }; - }; - }; - - private func delBucket(caller: Principal, store: BucketStore.BucketStore) : async (Bool) { - let result: Result.Result = await store.deleteBucket(caller); - - switch (result) { - case (#err error) { - throw Error.reject(error); - }; - case (#ok bucket) { - let exists: Bool = Option.isSome(bucket); - return exists; - }; - }; - }; - - /** - * Admin - */ - - public shared query({ caller }) func list(store: Text) : async [Bucket] { - if (not Utils.isAdmin(caller)) { - throw Error.reject("Unauthorized access. Caller is not an admin." # Principal.toText(caller)); - }; - - if (Text.equal(store, "data")) { - return dataStore.entries(); - }; - - if (Text.equal(store, "storage")) { - return storagesStore.entries(); - }; - - throw Error.reject("Type of store not supported"); - }; - - public shared({ caller }) func installCode(canisterId: Principal, owner: Blob, wasmModule: Blob): async() { - if (not Utils.isAdmin(caller)) { - throw Error.reject("Unauthorized access. Caller is not an admin."); - }; - - await canisterUtils.installCode(canisterId, owner, wasmModule); - }; - - /** - * Stable memory for upgrade - */ - - system func preupgrade() { - data := Iter.toArray(dataStore.preupgrade().entries()); - storages := Iter.toArray(storagesStore.preupgrade().entries()); - }; - - system func postupgrade() { - dataStore.postupgrade(data); - data := []; - - storagesStore.postupgrade(storages); - storages := []; - }; -} diff --git a/canisters/src/storage/storage.mo b/canisters/src/storage/storage.mo deleted file mode 100644 index 11c3644ce..000000000 --- a/canisters/src/storage/storage.mo +++ /dev/null @@ -1,247 +0,0 @@ -import Nat "mo:base/Nat"; -import Text "mo:base/Text"; -import HashMap "mo:base/HashMap"; -import Iter "mo:base/Iter"; -import Error "mo:base/Error"; -import Blob "mo:base/Blob"; -import Principal "mo:base/Principal"; - -import Result "mo:base/Result"; - -import Types "../types/types"; -import HTTP "../types/http.types"; - -import StorageTypes "./storage.types"; - -import Utils "../utils/utils"; - -import StorageStore "./storage.store"; - -import WalletUtils "../utils/wallet.utils"; - -actor class StorageBucket(owner: Types.UserId) = this { - - private let BATCH_EXPIRY_NANOS = 300_000_000_000; - - private type Asset = StorageTypes.Asset; - private type AssetKey = StorageTypes.AssetKey; - private type AssetEncoding = StorageTypes.AssetEncoding; - private type Chunk = StorageTypes.Chunk; - - private type HttpRequest = HTTP.HttpRequest; - private type HttpResponse = HTTP.HttpResponse; - private type HeaderField = HTTP.HeaderField; - private type StreamingCallbackHttpResponse = HTTP.StreamingCallbackHttpResponse; - private type StreamingCallbackToken = HTTP.StreamingCallbackToken; - private type StreamingStrategy = HTTP.StreamingStrategy; - - private let walletUtils: WalletUtils.WalletUtils = WalletUtils.WalletUtils(); - - private stable let user: Types.UserId = owner; - - // Preserve the application state on upgrades - private stable var entries : [(Text, Asset)] = []; - - let storageStore: StorageStore.StorageStore = StorageStore.StorageStore(); - - /** - * HTTP - */ - - public shared query({caller}) func http_request({method: Text; url: Text;} : HttpRequest) : async HttpResponse { - try { - if (Text.notEqual(method, "GET")) { - return { - body = Blob.toArray(Text.encodeUtf8("Method Not Allowed.")); - headers = []; - status_code = 405; - streaming_strategy = null; - }; - }; - - let result: Result.Result = storageStore.getAssetForUrl(url); - - switch (result) { - case (#ok {key: AssetKey; headers: [HeaderField]; encoding: AssetEncoding;}) { - return { - body = encoding.contentChunks[0]; - headers; - status_code = 200; - streaming_strategy = createStrategy(key, encoding, headers); - }; - }; - case (#err error) { - }; - }; - - return { - body = Blob.toArray(Text.encodeUtf8("Permission denied. Could not perform this operation.")); - headers = []; - status_code = 403; - streaming_strategy = null; - }; - } catch (err) { - return { - body = Blob.toArray(Text.encodeUtf8("Unexpected error: " # Error.message(err))); - headers = []; - status_code = 500; - streaming_strategy = null; - }; - } - }; - - public shared query({caller}) func http_request_streaming_callback(streamingToken: StreamingCallbackToken) : async StreamingCallbackHttpResponse { - let result: Result.Result = storageStore.getAsset(streamingToken.fullPath, streamingToken.token); - - switch (result) { - case (#ok {key: AssetKey; headers: [HeaderField]; encoding: AssetEncoding;}) { - return { - token = createToken(key, streamingToken.index, encoding, headers); - body = encoding.contentChunks[streamingToken.index]; - }; - }; - case (#err error) { - throw Error.reject("Streamed asset not found: " # error); - }; - }; - }; - - private func createStrategy(key: AssetKey, encoding: AssetEncoding, headers: [HeaderField]) : ?StreamingStrategy { - let streamingToken: ?StreamingCallbackToken = createToken(key, 0, encoding, headers); - - switch (streamingToken) { - case (null) { null }; - case (?streamingToken) { - // Hack: https://forum.dfinity.org/t/cryptic-error-from-icx-proxy/6944/8 - // Issue: https://github.com/dfinity/candid/issues/273 - - let self: Principal = Principal.fromActor(this); - let canisterId: Text = Principal.toText(self); - - let canister = actor (canisterId) : actor { http_request_streaming_callback : shared () -> async () }; - - return ?#Callback({ - token = streamingToken; - callback = canister.http_request_streaming_callback; - }); - }; - }; - }; - - private func createToken(key: AssetKey, chunkIndex: Nat, encoding: AssetEncoding, headers: [HeaderField]) : ?StreamingCallbackToken { - if (chunkIndex + 1 >= encoding.contentChunks.size()) { - return null; - }; - - let streamingToken: ?StreamingCallbackToken = ?{ - fullPath = key.fullPath; - token = key.token; - headers; - index = chunkIndex + 1; - sha256 = null; - }; - - return streamingToken; - }; - - /** - * Upload - */ - - public shared({caller}) func initUpload(key: AssetKey) : async ({batchId : Nat}) { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to upload data."); - }; - - let nextBatchID: Nat = storageStore.createBatch(key); - - return {batchId = nextBatchID}; - }; - - public shared({caller}) func uploadChunk(chunk: Chunk) : async ({chunkId : Nat}) { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to a upload any chunks of content."); - }; - - let (result: {#chunkId: Nat; #error: Text;}) = storageStore.createChunk(chunk); - - switch (result) { - case (#error error) { - throw Error.reject(error); - }; - case (#chunkId chunkId) { - return {chunkId}; - }; - }; - }; - - public shared({caller}) func commitUpload( - {batchId; chunkIds; headers;} : { - batchId: Nat; - headers: [HeaderField]; - chunkIds: [Nat]; - }, - ) : async () { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to commit an upload."); - }; - - let ({error}: {error: ?Text;}) = storageStore.commitBatch({batchId; headers; chunkIds;}); - - switch (error) { - case (?error) { - throw Error.reject(error); - }; - case null {}; - }; - }; - - /** - * List and delete - */ - - public shared query({ caller }) func list(folder: ?Text) : async [AssetKey] { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to list the assets."); - }; - - let keys: [AssetKey] = storageStore.getKeys(folder); - return keys; - }; - - public shared({ caller }) func del({fullPath; token;}: {fullPath: Text; token: ?Text;}) : async () { - if (Utils.isPrincipalNotEqual(caller, user)) { - throw Error.reject("User does not have the permission to delete an asset."); - }; - - let result: Result.Result = storageStore.deleteAsset(fullPath, token); - - switch (result) { - case (#ok asset) {}; - case (#err error) { - throw Error.reject("Asset cannot be deleted: " # error); - }; - }; - }; - - /** - * Canister mgmt - */ - - public shared({ caller }) func transferCycles(): async() { - if (not Utils.isManager(caller)) { - throw Error.reject("Unauthorized access. Caller is not a manager."); - }; - - await walletUtils.transferCycles(caller); - }; - - system func preupgrade() { - entries := Iter.toArray(storageStore.preupgrade().entries()); - }; - - system func postupgrade() { - storageStore.postupgrade(entries); - entries := []; - }; -} diff --git a/canisters/src/storage/storage.store.mo b/canisters/src/storage/storage.store.mo deleted file mode 100644 index d9f14d006..000000000 --- a/canisters/src/storage/storage.store.mo +++ /dev/null @@ -1,298 +0,0 @@ -import HashMap "mo:base/HashMap"; -import Nat "mo:base/Nat"; -import Text "mo:base/Text"; -import Time "mo:base/Time"; -import Hash "mo:base/Hash"; -import Array "mo:base/Array"; -import Iter "mo:base/Iter"; -import Result "mo:base/Result"; -import Buffer "mo:base/Buffer"; - -import StorageTypes "./storage.types"; - -module { - - type Chunk = StorageTypes.Chunk; - type Asset = StorageTypes.Asset; - type Batch = StorageTypes.Batch; - - type AssetKey = StorageTypes.AssetKey; - - public class StorageStore() { - - private let BATCH_EXPIRY_NANOS = 300_000_000_000; // 300 seconds, 5 minutes - - private let batches: HashMap.HashMap = HashMap.HashMap( - 10, Nat.equal, Hash.hash, - ); - - private let chunks: HashMap.HashMap = HashMap.HashMap( - 10, Nat.equal, Hash.hash, - ); - - private var assets: HashMap.HashMap = HashMap.HashMap( - 10, Text.equal, Text.hash, - ); - - private var nextBatchID: Nat = 0; - private var nextChunkID: Nat = 0; - - /** - * Getter, list and delete - */ - - public func getAssetForUrl(url: Text): Result.Result { - if (Text.size(url) == 0) { - return #err "No url provided."; - }; - - let split: [Text] = Iter.toArray(Text.split(url, #text "?token=")); - let fullPath: Text = "/" # Text.trimStart(split[0], #char '/'); - - // Token protected assets - if (split.size() > 1) { - let token: Text = split[1]; - return getAsset(fullPath, ?token); - }; - - // Map /index.html to / because we are using / as root - if (fullPath == "/index.html") { - return getAsset("/", null); - }; - - return getAsset(fullPath, null); - }; - - public func getAsset(fullPath: Text, token: ?Text): Result.Result { - let asset: ?Asset = assets.get(fullPath); - - switch (asset) { - case (?asset) { - switch (asset.key.token) { - case (?assetToken) { - return getProtectedAsset(asset, assetToken, token); - }; - case (null) { - return #ok asset; - }; - }; - }; - case null { - return #err "No asset."; - }; - }; - }; - - private func getProtectedAsset(asset: Asset, assetToken: Text, token: ?Text): Result.Result { - switch (token) { - case null { - return #err "No token provided."; - }; - case (?token) { - let compare: {#less; #equal; #greater} = Text.compare(token, assetToken); - - switch (compare) { - case (#equal equal) { - return #ok asset; - }; - case (#less less) { - return #err "Invalid token."; - }; - case (#greater greater) { - return #err "Invalid token."; - }; - }; - }; - }; - }; - - public func deleteAsset(fullPath: Text, token: ?Text): Result.Result { - let result: Result.Result = getAsset(fullPath, token); - - switch (result) { - case (#ok asset) { - assets.delete(fullPath); - }; - case (#err error) {}; - }; - - return result; - }; - - public func getKeys(folder: ?Text): [AssetKey] { - let entries: Iter.Iter<(Text, Asset)> = assets.entries(); - let keys: Iter.Iter = Iter.map(entries, func ((fullPath: Text, value: Asset)) : AssetKey { value.key }); - let allKeys: [AssetKey] = Iter.toArray(keys); - - switch (folder) { - case null { - return allKeys; - }; - case (?folder) { - let filteredKeys: [AssetKey] = Array.filter(allKeys, func (key: AssetKey) : Bool { Text.equal(key.folder, folder) }); - return filteredKeys; - }; - }; - }; - - /** - * Upload batch and chunks - */ - - public func createBatch(key: AssetKey) : (Nat) { - nextBatchID := nextBatchID + 1; - - let now: Time.Time = Time.now(); - - clearExpiredBatches(); - - batches.put(nextBatchID, { - key; - expiresAt = now + BATCH_EXPIRY_NANOS; - }); - - return nextBatchID; - }; - - public func createChunk({batchId: Nat; content: [Nat8];}: Chunk) : ({#chunkId: Nat; #error: Text;}) { - switch (batches.get(batchId)) { - case (null) { - return #error "Batch not found."; - }; - case (?batch) { - // Extend batch timeout - batches.put(batchId, { - key = batch.key; - expiresAt = Time.now() + BATCH_EXPIRY_NANOS; - }); - - nextChunkID := nextChunkID + 1; - - chunks.put(nextChunkID, { - batchId; - content; - }); - - return #chunkId nextChunkID; - }; - }; - }; - - public func commitBatch( - {batchId; chunkIds; headers} : { - batchId: Nat; - headers: [(Text, Text)]; - chunkIds: [Nat]; - }, - ) : ({error: ?Text;}) { - let batch: ?Batch = batches.get(batchId); - - switch (batch) { - case (null) { - return {error = ?"No batch to commit.";} - }; - case (?batch) { - let error: {error: ?Text} = commitChunks({batchId; batch; chunkIds; headers;}); - return error; - }; - }; - }; - - private func commitChunks( - {batchId; batch; chunkIds; headers} : { - batchId: Nat; - batch: Batch; - headers: [(Text, Text)]; - chunkIds: [Nat]; - } - ) : ({error: ?Text;}) { - // Test batch is not expired - let now: Time.Time = Time.now(); - if (now > batch.expiresAt) { - clearExpiredBatches(); - return {error = ?"Batch did not complete in time. Chunks cannot be commited."}; - }; - - let contentChunks: Buffer.Buffer<[Nat8]> = Buffer.Buffer(1); - - for (chunkId in chunkIds.vals()) { - let chunk: ?Chunk = chunks.get(chunkId); - - switch (chunk) { - case (?chunk) { - if (Nat.notEqual(batchId, chunk.batchId)) { - return {error = ?"Chunk not included in the provided batch"}; - }; - - contentChunks.add(chunk.content); - }; - case null { - return {error = ?"Chunk does not exist."}; - }; - }; - }; - - if (contentChunks.size() <= 0) { - return {error = ?"No chunk to commit."}; - }; - - var totalLength = 0; - for (chunk in contentChunks.vals()) { - totalLength += chunk.size(); - }; - - assets.put(batch.key.fullPath, { - key = batch.key; - headers; - encoding = { - modified = Time.now(); - contentChunks = contentChunks.toArray(); - totalLength - }; - }); - - clearBatch({batchId; chunkIds;}); - - return {error = null}; - }; - - private func clearBatch({batchId: Nat; chunkIds: [Nat];} : {batchId: Nat; chunkIds: [Nat];}) { - for (chunkId in chunkIds.vals()) { - chunks.delete(chunkId); - }; - - batches.delete(batchId); - }; - - private func clearExpiredBatches() { - let now: Time.Time = Time.now(); - - // Remove expired batches - let batchEntries: Iter.Iter<(Nat, Batch)> = batches.entries(); - for ((batchId: Nat, batch: Batch) in batchEntries) { - if (now > batch.expiresAt) { - batches.delete(batchId); - }; - }; - - // Remove chunk without existing batches (those we just deleted above) - for ((chunkId: Nat, chunk: Chunk) in chunks.entries()) { - switch (batches.get(chunk.batchId)) { - case (null) { - chunks.delete(chunkId); - }; - case (?batch) {}; - }; - }; - }; - - public func preupgrade(): HashMap.HashMap { - return assets; - }; - - public func postupgrade(stableAssets: [(Text, Asset)]) { - assets := HashMap.fromIter(stableAssets.vals(), 10, Text.equal, Text.hash); - }; - } - -} diff --git a/canisters/src/storage/storage.types.mo b/canisters/src/storage/storage.types.mo deleted file mode 100644 index d53069caf..000000000 --- a/canisters/src/storage/storage.types.mo +++ /dev/null @@ -1,32 +0,0 @@ -module { - - public type Chunk = { - batchId: Nat; - content: [Nat8]; - }; - - public type AssetEncoding = { - modified: Int; - contentChunks: [[Nat8]]; - totalLength: Nat; - }; - - public type AssetKey = { - name: Text; // myimage.jpg - folder: Text; // images - fullPath: Text; // /images/myimage.jpg - token: ?Text; // ?token=1223-3345-5564-3333 - }; - - public type Asset = { - key: AssetKey; - headers: [(Text, Text)]; - encoding: AssetEncoding; - }; - - public type Batch = { - key: AssetKey; - expiresAt: Int; - }; - -} diff --git a/canisters/src/types/http.types.mo b/canisters/src/types/http.types.mo deleted file mode 100644 index 41665d364..000000000 --- a/canisters/src/types/http.types.mo +++ /dev/null @@ -1,42 +0,0 @@ -import Text "mo:base/Text"; -import Nat8 "mo:base/Nat8"; -import Nat16 "mo:base/Nat16"; - -module { - public type HeaderField = (Text, Text); - - public type HttpRequest = { - url : Text; - method : Text; - body : [Nat8]; - headers : [HeaderField]; - }; - - public type HttpResponse = { - body : [Nat8]; - headers : [HeaderField]; - status_code : Nat16; - streaming_strategy : ?StreamingStrategy; - }; - - public type StreamingStrategy = { - #Callback : { - token : StreamingCallbackToken; - callback : shared () -> async (); - }; - }; - - public type StreamingCallbackToken = { - fullPath: Text; - token: ?Text; - headers : [HeaderField]; - sha256 : ?[Nat8]; - - index : Nat; - }; - - public type StreamingCallbackHttpResponse = { - body : [Nat8]; - token: ?StreamingCallbackToken; - }; -} diff --git a/canisters/src/types/ic.types.mo b/canisters/src/types/ic.types.mo deleted file mode 100644 index 336af437c..000000000 --- a/canisters/src/types/ic.types.mo +++ /dev/null @@ -1,59 +0,0 @@ -// Source: motoko playground -// https://github.com/dfinity/motoko-playground/blob/3cf294725acf2213ca5e7c01bc59115781ab8ac4/service/pool/IC.mo - -// Also update controllers instead of controller according doc https://sdk.dfinity.org/docs/interface-spec/index.html#ic-interface-overview - -module { - public type canister_id = Principal; - public type canister_settings = { - controllers : ?[Principal]; - freezing_threshold : ?Nat; - memory_allocation : ?Nat; - compute_allocation : ?Nat; - }; - public type definite_canister_settings = { - controllers : ?[Principal]; - freezing_threshold : Nat; - memory_allocation : Nat; - compute_allocation : Nat; - }; - public type user_id = Principal; - public type wasm_module = Blob; - - public type Self = actor { - canister_status : shared query { canister_id : canister_id } -> async { - status : { #stopped; #stopping; #running }; - memory_size : Nat; - cycles : Nat; - settings : definite_canister_settings; - module_hash : ?Blob; - }; - create_canister : shared { settings : ?canister_settings } -> async { - canister_id : canister_id; - }; - delete_canister : shared { canister_id : canister_id } -> async (); - deposit_cycles : shared { canister_id : canister_id } -> async (); - install_code : shared { - arg : Blob; - wasm_module : wasm_module; - mode : { #reinstall; #upgrade; #install }; - canister_id : canister_id; - } -> async (); - provisional_create_canister_with_cycles : shared { - settings : ?canister_settings; - amount : ?Nat; - } -> async { canister_id : canister_id }; - provisional_top_up_canister : shared { - canister_id : canister_id; - amount : Nat; - } -> async (); - raw_rand : shared () -> async Blob; - start_canister : shared { canister_id : canister_id } -> async (); - stop_canister : shared { canister_id : canister_id } -> async (); - uninstall_code : shared { canister_id : canister_id } -> async (); - update_settings : shared { - canister_id : Principal; - settings : canister_settings; - } -> async (); - }; -} diff --git a/canisters/src/types/types.mo b/canisters/src/types/types.mo deleted file mode 100644 index 0b0a2dff2..000000000 --- a/canisters/src/types/types.mo +++ /dev/null @@ -1,8 +0,0 @@ -import Text "mo:base/Text"; -import Principal "mo:base/Principal"; - -module { - - public type UserId = Principal; - -} diff --git a/canisters/src/utils/canister.utils.mo b/canisters/src/utils/canister.utils.mo deleted file mode 100644 index 76df21c62..000000000 --- a/canisters/src/utils/canister.utils.mo +++ /dev/null @@ -1,57 +0,0 @@ -import Principal "mo:base/Principal"; -import Blob "mo:base/Blob"; - -import Types "../types/types"; -import IC "../types/ic.types"; - -module { - - private type UserId = Types.UserId; - - private type CanisterId = IC.canister_id; - - public class CanisterUtils() { - - private let ic : IC.Self = actor "aaaaa-aa"; - - public func deleteCanister(canisterId: ?CanisterId): async() { - switch (canisterId) { - case (?canisterId) { - let deckBucket = actor(Principal.toText(canisterId)): actor { transferCycles: () -> async () }; - - await deckBucket.transferCycles(); - - await ic.stop_canister({ canister_id = canisterId }); - - await ic.delete_canister({ canister_id = canisterId }); - }; - case null {}; - } - }; - - public func updateSettings(canisterId: Principal, manager: Principal): async () { - let controllers: ?[Principal] = ?[canisterId, manager]; - - await ic.update_settings(({canister_id = canisterId; settings = { - controllers = controllers; - freezing_threshold = null; - memory_allocation = null; - compute_allocation = null; - }})); - }; - - /** - * owner: the owner as Principal encoded in Candid arguments. see actor Data and Storage, the Principal is the argument to create the canisters - */ - public func installCode(canisterId: Principal, owner: Blob, wasmModule: Blob): async() { - await ic.install_code({ - arg = owner; - wasm_module = wasmModule; - mode = #upgrade; - canister_id = canisterId; - }); - }; - - } - -} diff --git a/canisters/src/utils/utils.mo b/canisters/src/utils/utils.mo deleted file mode 100644 index ecbe473de..000000000 --- a/canisters/src/utils/utils.mo +++ /dev/null @@ -1,41 +0,0 @@ -import Principal "mo:base/Principal"; -import Array "mo:base/Array"; - -import Env "../env"; - -module { - public func isPrincipalEqual(x: Principal, y: Principal): Bool { x == y }; - - public func isPrincipalNotEqual(x: Principal, y: Principal): Bool { x != y }; - - public func isAdmin(caller: Principal): Bool { - hasPrivilege(caller, Env.admin); - }; - - public func isManager(caller: Principal): Bool { - hasPrivilege(caller, Env.manager); - }; - - private func hasPrivilege(caller: Principal, privileges: [Text]): Bool { - func toPrincipal(entry: Text) : Principal { - Principal.fromText(entry); - }; - - let principals: [Principal] = Array.map(privileges, toPrincipal); - - func filterAdmin(admin: Principal): Bool { - admin == caller - }; - - let admin: ?Principal = Array.find(principals, filterAdmin); - - switch (admin) { - case (null) { - return false; - }; - case (?admin) { - return true; - } - } - }; -} diff --git a/canisters/src/utils/wallet.utils.mo b/canisters/src/utils/wallet.utils.mo deleted file mode 100644 index 59a9a76de..000000000 --- a/canisters/src/utils/wallet.utils.mo +++ /dev/null @@ -1,26 +0,0 @@ -import Principal "mo:base/Principal"; -import Cycles "mo:base/ExperimentalCycles"; - -import IC "../types/ic.types"; - -module { - - public class WalletUtils() { - - private let ic : IC.Self = actor "aaaaa-aa"; - - public func transferCycles(caller: Principal): async () { - let balance: Nat = Cycles.balance(); - - // We have to retain some cycles to be able to transfer some - let cycles: Nat = balance - 4_100_000; - - if (cycles > 0) { - Cycles.add(cycles); - await ic.deposit_cycles({ canister_id = caller }); - }; - }; - - } - -} diff --git a/dfx.json b/dfx.json index 2fe74245d..55064a647 100644 --- a/dfx.json +++ b/dfx.json @@ -1,7 +1,7 @@ { "canisters": { "manager": { - "main": "canisters/src/manager/manager.mo", + "main": "canisters/canisters/src/manager/manager.mo", "type": "motoko" }, "assets": { diff --git a/ic.deploy.sh b/ic.deploy.sh new file mode 100755 index 000000000..b32173dfa --- /dev/null +++ b/ic.deploy.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +DOWNLOADS_DIR="$HOME/Downloads" +echo +read -rn 1 -p "What is your download dir? (default '$DOWNLOADS_DIR'): " ALT_DOWNLOADS_DIR +DOWNLOADS_DIR="${ALT_DOWNLOADS_DIR:-$DOWNLOADS_DIR}" +DOWNLOAD_PATH="$DOWNLOADS_DIR/canisters" + +rm -rf "$DOWNLOAD_PATH" +mkdir -p "$DOWNLOAD_PATH" + +curl -SL github.com/papyrs/canisters/archive/main.zip | tar -xf - -C "$DOWNLOAD_PATH" + +DEST_DIR="./canisters/canisters" + +rm -rf "$DEST_DIR" +mkdir -p "$DEST_DIR" + +cp -r "$DOWNLOAD_PATH/canisters-main/src" "$DEST_DIR" + +cp ./canisters/src/env.mo "$DEST_DIR/src" + +dfx deploy --network=ic --no-wallet diff --git a/package-lock.json b/package-lock.json index 88052e5d7..475d488f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -633,10 +633,6 @@ "resolved": "webcomponents/highlight-code", "link": true }, - "node_modules/@deckdeckgo/ic": { - "resolved": "providers/ic", - "link": true - }, "node_modules/@deckdeckgo/kit": { "resolved": "utils/kit", "link": true @@ -753,68 +749,6 @@ "resolved": "webcomponents/word-cloud", "link": true }, - "node_modules/@dfinity/agent": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.10.4.tgz", - "integrity": "sha512-/O1443GWkQ6GngrXos/ShAbnF9IgUlWclzaQn/qEsGJIey6S7tty+iOa5yZqOS1BtOTnDe+TYh8GeERZZn7vvg==", - "dependencies": { - "base64-arraybuffer": "^0.2.0", - "bignumber.js": "^9.0.0", - "borc": "^2.1.1", - "js-sha256": "0.9.0", - "simple-cbor": "^0.4.1" - }, - "peerDependencies": { - "@dfinity/candid": "^0.10.4", - "@dfinity/principal": "^0.10.4" - } - }, - "node_modules/@dfinity/auth-client": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/auth-client/-/auth-client-0.10.4.tgz", - "integrity": "sha512-SHWamx9PcD3vl21rmRCnWr4wk6Iotyd9h0UZOLFdKL0AruZ9m9BD7nxRs9u7dJ+FuRwZRkWjONaDuNZemMlQ8w==", - "peerDependencies": { - "@dfinity/agent": "^0.10.4", - "@dfinity/authentication": "^0.10.4", - "@dfinity/identity": "^0.10.4", - "@dfinity/principal": "^0.10.4" - } - }, - "node_modules/@dfinity/authentication": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/authentication/-/authentication-0.10.4.tgz", - "integrity": "sha512-IP1zepm9YnXATV6lXVMqObmETKuBtkDMbWW6rgUvEekulaxITTHJppgzdMD8E7Hh5SVajVHLJm14kDa3FXwMnA==", - "peerDependencies": { - "@dfinity/agent": "^0.10.4", - "@dfinity/identity": "^0.10.4", - "@dfinity/principal": "^0.10.4" - } - }, - "node_modules/@dfinity/candid": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.10.4.tgz", - "integrity": "sha512-Rd8uoo3jd4FLmGY9aBgTRdBCYVuG/Y7QmpDJB3eQvsU3WHhVZJWLMHcodnMIoy2bzqzCKeTdLkL565K7qx5H3Q==" - }, - "node_modules/@dfinity/identity": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-0.10.4.tgz", - "integrity": "sha512-b4WsaD70Ts75JlJcf4+E04B140hQN5u/GnCvjhaHqN2++bwWO56Paxtv0UfAc58LMwJZj4iOyZoahnT56LhC9A==", - "dependencies": { - "borc": "^2.1.1", - "js-sha256": "^0.9.0", - "secp256k1": "^4.0.2", - "tweetnacl": "^1.0.1" - }, - "peerDependencies": { - "@dfinity/agent": "^0.10.4", - "@dfinity/principal": "^0.10.4" - } - }, - "node_modules/@dfinity/principal": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.10.4.tgz", - "integrity": "sha512-qwzpmq5wfyeKMBspRZmuYvTxu1dqN+IY0ThACHTRh6D58QjnVQNCD3Hq9d5eEDu0qyNcY22cJEWwzrzZaaoVmw==" - }, "node_modules/@firebase/analytics": { "version": "0.6.18", "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.6.18.tgz", @@ -2661,18 +2595,11 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/base64-arraybuffer": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz", - "integrity": "sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ==", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, "funding": [ { "type": "github", @@ -2714,14 +2641,6 @@ "node": "*" } }, - "node_modules/bignumber.js": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", - "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==", - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -2753,23 +2672,6 @@ "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", "dev": true }, - "node_modules/borc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/borc/-/borc-2.1.2.tgz", - "integrity": "sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==", - "dependencies": { - "bignumber.js": "^9.0.0", - "buffer": "^5.5.0", - "commander": "^2.15.0", - "ieee754": "^1.1.13", - "iso-url": "~0.4.7", - "json-text-sequence": "~0.1.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2794,7 +2696,8 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true }, "node_modules/browser-process-hrtime": { "version": "1.0.0", @@ -2933,6 +2836,7 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, "funding": [ { "type": "github", @@ -3221,11 +3125,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, "node_modules/component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -3728,11 +3627,6 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, - "node_modules/delimit-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/delimit-stream/-/delimit-stream-0.1.0.tgz", - "integrity": "sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs=" - }, "node_modules/dependency-graph": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.9.0.tgz", @@ -3854,6 +3748,7 @@ "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -3867,7 +3762,8 @@ "node_modules/elliptic/node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/emittery": { "version": "0.8.1", @@ -5142,6 +5038,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -5151,6 +5048,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -5293,6 +5191,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, "funding": [ { "type": "github", @@ -5569,14 +5468,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/iso-url": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-0.4.7.tgz", - "integrity": "sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==", - "engines": { - "node": ">=10" - } - }, "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -7182,11 +7073,6 @@ "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, - "node_modules/js-sha256": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -7294,14 +7180,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "node_modules/json-text-sequence": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/json-text-sequence/-/json-text-sequence-0.1.1.tgz", - "integrity": "sha1-py8hfcSvxGKf/1/rME3BvVGi89I=", - "dependencies": { - "delimit-stream": "0.1.0" - } - }, "node_modules/json5": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", @@ -7733,15 +7611,6 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", "dev": true }, - "node_modules/magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "dependencies": { - "sourcemap-codec": "^1.4.4" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -7927,12 +7796,14 @@ "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true }, "node_modules/minimatch": { "version": "3.0.4", @@ -8063,11 +7934,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "node_modules/node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -8129,16 +7995,6 @@ "node": ">= 10.12.0" } }, - "node_modules/node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, "node_modules/node-gyp/node_modules/semver": { "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", @@ -9235,6 +9091,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -9419,24 +9276,6 @@ "inherits": "^2.0.1" } }, - "node_modules/rollup-plugin-inject": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", - "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", - "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.", - "dev": true, - "dependencies": { - "estree-walker": "^0.6.1", - "magic-string": "^0.25.3", - "rollup-pluginutils": "^2.8.1" - } - }, - "node_modules/rollup-plugin-inject/node_modules/estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - }, "node_modules/rollup-plugin-node-builtins": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz", @@ -9449,30 +9288,6 @@ "process-es6": "^0.11.2" } }, - "node_modules/rollup-plugin-node-polyfills": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", - "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", - "dev": true, - "dependencies": { - "rollup-plugin-inject": "^3.0.0" - } - }, - "node_modules/rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "dependencies": { - "estree-walker": "^0.6.1" - } - }, - "node_modules/rollup-pluginutils/node_modules/estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -9743,20 +9558,6 @@ "node": ">=0.8.0" } }, - "node_modules/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "hasInstallScript": true, - "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -9812,11 +9613,6 @@ "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, - "node_modules/simple-cbor": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/simple-cbor/-/simple-cbor-0.4.1.tgz", - "integrity": "sha512-rijcxtwx2b4Bje3sqeIqw5EeW7UlOIC4YfOdwqIKacpvRQ/D78bWg/4/0m5e0U91oKvlGh7LlJuZCu07ISCC7w==" - }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -9925,12 +9721,6 @@ "source-map": "^0.6.0" } }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -10055,6 +9845,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -10063,6 +9854,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -10395,11 +10187,6 @@ "node": "*" } }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" - }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -10492,7 +10279,8 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "node_modules/uuid": { "version": "3.4.0", @@ -10894,7 +10682,7 @@ }, "providers/firebase": { "name": "@deckdeckgo/firebase", - "version": "4.1.2", + "version": "4.1.3", "license": "AGPL-3.0-or-later", "dependencies": { "@deckdeckgo/api": "file:providers/api", @@ -10934,27 +10722,6 @@ "resolved": "https://registry.npmjs.org/@deckdeckgo/editor/-/editor-5.1.1.tgz", "integrity": "sha512-ZpQjE8E0pI9QYoA4O4VrWnMCLMUP/+baBB1lwMxeYrUnfrR9vUXc4HElSviB9qc/b4m1o3MStYw7+Tt2Fzrjvw==" }, - "providers/ic": { - "name": "@deckdeckgo/ic", - "version": "7.0.0", - "license": "AGPL-3.0-or-later", - "dependencies": { - "@deckdeckgo/editor": "^7.7.0", - "@dfinity/agent": "^0.10.4", - "@dfinity/auth-client": "^0.10.4", - "@dfinity/authentication": "^0.10.4", - "@dfinity/candid": "^0.10.4", - "@dfinity/identity": "^0.10.4", - "@dfinity/principal": "^0.10.4", - "idb-keyval": "^6.1.0", - "nanoid": "^3.3.1" - }, - "devDependencies": { - "@deckdeckgo/lazy-img": "^3.2.0", - "@deckdeckgo/slide-chart": "^2.5.0", - "rollup-plugin-node-polyfills": "^0.2.1" - } - }, "providers/offline": { "name": "@deckdeckgo/offline", "version": "0.0.6", @@ -12109,23 +11876,6 @@ "prismjs": "^1.27.0" } }, - "@deckdeckgo/ic": { - "version": "file:providers/ic", - "requires": { - "@deckdeckgo/editor": "^7.7.0", - "@deckdeckgo/lazy-img": "^3.2.0", - "@deckdeckgo/slide-chart": "^2.5.0", - "@dfinity/agent": "^0.10.4", - "@dfinity/auth-client": "^0.10.4", - "@dfinity/authentication": "^0.10.4", - "@dfinity/candid": "^0.10.4", - "@dfinity/identity": "^0.10.4", - "@dfinity/principal": "^0.10.4", - "idb-keyval": "^6.1.0", - "nanoid": "^3.3.1", - "rollup-plugin-node-polyfills": "^0.2.1" - } - }, "@deckdeckgo/kit": { "version": "file:utils/kit", "requires": { @@ -12442,51 +12192,6 @@ } } }, - "@dfinity/agent": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.10.4.tgz", - "integrity": "sha512-/O1443GWkQ6GngrXos/ShAbnF9IgUlWclzaQn/qEsGJIey6S7tty+iOa5yZqOS1BtOTnDe+TYh8GeERZZn7vvg==", - "requires": { - "base64-arraybuffer": "^0.2.0", - "bignumber.js": "^9.0.0", - "borc": "^2.1.1", - "js-sha256": "0.9.0", - "simple-cbor": "^0.4.1" - } - }, - "@dfinity/auth-client": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/auth-client/-/auth-client-0.10.4.tgz", - "integrity": "sha512-SHWamx9PcD3vl21rmRCnWr4wk6Iotyd9h0UZOLFdKL0AruZ9m9BD7nxRs9u7dJ+FuRwZRkWjONaDuNZemMlQ8w==", - "requires": {} - }, - "@dfinity/authentication": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/authentication/-/authentication-0.10.4.tgz", - "integrity": "sha512-IP1zepm9YnXATV6lXVMqObmETKuBtkDMbWW6rgUvEekulaxITTHJppgzdMD8E7Hh5SVajVHLJm14kDa3FXwMnA==", - "requires": {} - }, - "@dfinity/candid": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.10.4.tgz", - "integrity": "sha512-Rd8uoo3jd4FLmGY9aBgTRdBCYVuG/Y7QmpDJB3eQvsU3WHhVZJWLMHcodnMIoy2bzqzCKeTdLkL565K7qx5H3Q==" - }, - "@dfinity/identity": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-0.10.4.tgz", - "integrity": "sha512-b4WsaD70Ts75JlJcf4+E04B140hQN5u/GnCvjhaHqN2++bwWO56Paxtv0UfAc58LMwJZj4iOyZoahnT56LhC9A==", - "requires": { - "borc": "^2.1.1", - "js-sha256": "^0.9.0", - "secp256k1": "^4.0.2", - "tweetnacl": "^1.0.1" - } - }, - "@dfinity/principal": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.10.4.tgz", - "integrity": "sha512-qwzpmq5wfyeKMBspRZmuYvTxu1dqN+IY0ThACHTRh6D58QjnVQNCD3Hq9d5eEDu0qyNcY22cJEWwzrzZaaoVmw==" - }, "@firebase/analytics": { "version": "0.6.18", "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.6.18.tgz", @@ -14069,15 +13774,11 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "base64-arraybuffer": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz", - "integrity": "sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ==" - }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true }, "bcrypt-pbkdf": { "version": "1.0.2", @@ -14104,11 +13805,6 @@ "callsite": "1.0.0" } }, - "bignumber.js": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.2.tgz", - "integrity": "sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw==" - }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -14137,20 +13833,6 @@ "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", "dev": true }, - "borc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/borc/-/borc-2.1.2.tgz", - "integrity": "sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==", - "requires": { - "bignumber.js": "^9.0.0", - "buffer": "^5.5.0", - "commander": "^2.15.0", - "ieee754": "^1.1.13", - "iso-url": "~0.4.7", - "json-text-sequence": "~0.1.0", - "readable-stream": "^3.6.0" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -14172,7 +13854,8 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true }, "browser-process-hrtime": { "version": "1.0.0", @@ -14289,6 +13972,7 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -14501,11 +14185,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -14915,11 +14594,6 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, - "delimit-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/delimit-stream/-/delimit-stream-0.1.0.tgz", - "integrity": "sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs=" - }, "dependency-graph": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.9.0.tgz", @@ -15024,6 +14698,7 @@ "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, "requires": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -15037,7 +14712,8 @@ "bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true } } }, @@ -15985,6 +15661,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -15994,6 +15671,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -16104,7 +15782,8 @@ "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true }, "ignore": { "version": "5.1.9", @@ -16302,11 +15981,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "iso-url": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-0.4.7.tgz", - "integrity": "sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==" - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -17599,11 +17273,6 @@ "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, - "js-sha256": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -17691,14 +17360,6 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json-text-sequence": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/json-text-sequence/-/json-text-sequence-0.1.1.tgz", - "integrity": "sha1-py8hfcSvxGKf/1/rME3BvVGi89I=", - "requires": { - "delimit-stream": "0.1.0" - } - }, "json5": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", @@ -18084,15 +17745,6 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", "dev": true }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -18231,12 +17883,14 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true }, "minimatch": { "version": "3.0.4", @@ -18342,11 +17996,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -18393,11 +18042,6 @@ } } }, - "node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -19211,6 +18855,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -19353,25 +18998,6 @@ "inherits": "^2.0.1" } }, - "rollup-plugin-inject": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", - "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1", - "magic-string": "^0.25.3", - "rollup-pluginutils": "^2.8.1" - }, - "dependencies": { - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - } - } - }, "rollup-plugin-node-builtins": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz", @@ -19384,32 +19010,6 @@ "process-es6": "^0.11.2" } }, - "rollup-plugin-node-polyfills": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", - "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", - "dev": true, - "requires": { - "rollup-plugin-inject": "^3.0.0" - } - }, - "rollup-pluginutils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1" - }, - "dependencies": { - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - } - } - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -19631,16 +19231,6 @@ } } }, - "secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "requires": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -19684,11 +19274,6 @@ "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, - "simple-cbor": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/simple-cbor/-/simple-cbor-0.4.1.tgz", - "integrity": "sha512-rijcxtwx2b4Bje3sqeIqw5EeW7UlOIC4YfOdwqIKacpvRQ/D78bWg/4/0m5e0U91oKvlGh7LlJuZCu07ISCC7w==" - }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -19788,12 +19373,6 @@ "source-map": "^0.6.0" } }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -19911,6 +19490,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "requires": { "safe-buffer": "~5.2.0" }, @@ -19918,7 +19498,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true } } }, @@ -20169,11 +19750,6 @@ "safe-buffer": "^5.0.1" } }, - "tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -20244,7 +19820,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "uuid": { "version": "3.4.0", diff --git a/providers/ic/.prettierignore b/providers/ic/.prettierignore deleted file mode 100644 index ca1dd7298..000000000 --- a/providers/ic/.prettierignore +++ /dev/null @@ -1,5 +0,0 @@ -**/src/components.d.ts -dist -www -loader -.stencil diff --git a/providers/ic/CHANGELOG.md b/providers/ic/CHANGELOG.md deleted file mode 100644 index da11dc164..000000000 --- a/providers/ic/CHANGELOG.md +++ /dev/null @@ -1,213 +0,0 @@ -# 7.1.0 (2022-03-19) - -### Features - -- fallback author name for publish home - -# 7.0.0 (2022-03-19) - -### Features - -- get list of resources from kit in `build.json` - -# 6.3.1 (2022-03-19) - -### Features - -- log delete format - -# 6.3.0 (2022-03-19) - -### Features - -- sign in css and display button on error - -### Build - -# 6.2.0 (2022-03-18) - -### Features - -- new timer that checks if the identity delegation is valid - -# 6.1.2 (2022-03-15) - -### Fix - -- `docSelector` match only parent `deckgo-studio-doc` - -# 6.1.1 (2022-03-15) - -### Fix - -- use native `article` HTML element instead of `deckgo-doc` as container for publish - -# 6.1.0 (2022-03-15) - -### Features - -- `docSelector` match parent `deckgo-studio-doc > article.deckgo-doc` - -# 6.0.1 (2022-03-14) - -### Features - -- test delegation valid before sync - -### Fix - -- env `kitPath` is set only after init - -# 6.0.0 (2022-03-13) - -### Features - -- runtime variables replace static configuration: - -a. manager and (optional) identity canister IDs -b. kit path - -# 5.3.5 (2022-03-04) - -### Fix - -- prevent transforming chunk to arrayBuffer error - -# (5.3.3) 5.3.4 (2022-03-03) - -### Fix - -- `docSelector` match parent `deckgo-studio-doc` - -# 5.3.2 (2022-03-03) - -### Fix - -- snapshot published data not original data - -# 5.3.1 (2022-03-03) - -### Features - -- `onNext` of snapshots as promise - -# 5.3.0 (2022-03-02) - -### Features - -- use `ic0.app` as `host` for the agent in production (regardless if connection is on the window or web worker side) - -# 5.2.0 (2022-02-27) - -### Features - -- emit activity - -# 5.1.0 (2022-02-24) - -### Features - -- rename sign-in events for new login -- replace `uuid` with `nanoid` - -# 5.1.0 (2022-02-22) - -### Features - -- update `docSelector` for new `studio` component -- remove ionic peer dependency -- update sign-in component for Papyrs - -# 4.1.3 (2021-12-24) - -### Features - -- add an `
` around the published doc content -- emit doc and deck published once the overview has been updated too - -# 4.1.2 (2021-12-22) - -### Build - -- upgrade doc css resources - -# 4.1.1 (2021-12-21) - -### Fix - -- storage `fullPath` contains begin slash (avoid path like "...ic0.app//images/...") - -# 4.1.0 (2021-12-21) - -### Features - -- publish social images -- meta pathname fixed once content published -- handles delete storage without `downloadUrl` - -# 4.0.0 (2021-12-17) - -### Breaking Changes - -- `publish` becomes `deckPublish` and `docPublish` (which is not supported by this provider) -- `dist-custom-elements` replaces `dist-custom-elements-bundle` output target - -### Features - -- publish documents -- upload assets of flat paragraphs (`deckgo-lazy-img` as paragraph themselves) -- in case an asset "resource" is updated, update service worker too - -# 3.0.1 (2021-12-07) - -### Fix - -- URL token extraction to delete asset - -# 3.0.0 (2021-12-03) - -### Breaking Changes - -- better handle bucket creation ("pending bucket") - -### Features - -- publish overview -- templates support -- lower case and dashed filename for storage - -### Fix - -- expose doc providers - -# 2.1.0 (2021-11-28) - -### Features - -- publish overview (index.html) of all decks published - -### Fix - -- published decks attributes - -# 2.0.1 (2021-11-27) - -### Fix - -- expose docs and paragraphs providers - -# 2.0.0 (2021-11-27) - -### Features - -- one data canister per user for all decks and documents -- no more user canister -- storage enhanced with secret and public assets -- deck publish -- authentication reworked and delete user - -# 1.0.0 (2021-10-21) - -### Features - -- Hello World 👋 diff --git a/providers/ic/COPYING b/providers/ic/COPYING deleted file mode 100644 index 2976c0b93..000000000 --- a/providers/ic/COPYING +++ /dev/null @@ -1,15 +0,0 @@ -DeckDeckGo -Copyright (C) 2021 David Dal Busco and Nicolas Mattia - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . diff --git a/providers/ic/GNU-AGPL-3.0 b/providers/ic/GNU-AGPL-3.0 deleted file mode 100644 index d5445e7ac..000000000 --- a/providers/ic/GNU-AGPL-3.0 +++ /dev/null @@ -1,661 +0,0 @@ -GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/providers/ic/README.md b/providers/ic/README.md deleted file mode 100644 index 77053b9df..000000000 --- a/providers/ic/README.md +++ /dev/null @@ -1,17 +0,0 @@ -[![npm][npm-badge]][npm-badge-url] -[![license][npm-license]][npm-license-url] - -[npm-badge]: https://img.shields.io/npm/v/@deckdeckgo/ic -[npm-badge-url]: https://www.npmjs.com/package/@deckdeckgo/ic -[npm-license]: https://img.shields.io/npm/l/@deckdeckgo/ic -[npm-license-url]: https://github.com/deckgo/deckdeckgo/blob/main/providers/ic/LICENSE - -# DeckDeckGo - Internet Computer - -The Internet Computer connectors of the DeckDeckGo editor for slides. - -## License - -GNU Affero General Public License. Copyright [David Dal Busco](mailto:david.dalbusco@outlook.com) and [Nicolas Mattia](mailto:nicolas@nmattia.com), Zürich, Switzerland. See [COPYING](COPYING) for more details. - -[deckdeckgo]: https://deckdeckgo.com diff --git a/providers/ic/package.json b/providers/ic/package.json deleted file mode 100644 index 5f2e779da..000000000 --- a/providers/ic/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@deckdeckgo/ic", - "version": "7.1.0", - "description": "The Internet Computer connectors of the DeckDeckGo editor for slides", - "main": "dist/index.cjs.js", - "module": "dist/index.js", - "es2015": "dist/esm/index.js", - "es2017": "dist/esm/index.js", - "jsnext:main": "dist/esm/index.js", - "types": "dist/types/interface.d.ts", - "collection": "dist/collection/collection-manifest.json", - "collection:main": "dist/collection/index.js", - "unpkg": "dist/deckdeckgo-ic/deckdeckgo-ic.esm.js", - "files": [ - "dist/", - "README.md", - "COPYING", - "GNU-AGPL-3.0" - ], - "scripts": { - "build": "stencil build", - "start": "stencil build --dev --watch --serve", - "test": "stencil test --spec --e2e", - "test.watch": "stencil test --spec --e2e --watchAll", - "format": "prettier . --write" - }, - "devDependencies": { - "@deckdeckgo/lazy-img": "^3.2.0", - "@deckdeckgo/slide-chart": "^2.5.0", - "rollup-plugin-node-polyfills": "^0.2.1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/deckgo/deckdeckgo.git", - "directory": "providers/ic" - }, - "author": "David Dal Busco", - "license": "AGPL-3.0-or-later", - "bugs": { - "url": "https://github.com/deckgo/deckdeckgo" - }, - "homepage": "https://deckdeckgo.com", - "keywords": [ - "stencil", - "stenciljs", - "web components", - "pwa", - "progressive web app", - "presentation", - "slides", - "slideshow", - "talk", - "internet computer", - "dfinity", - "canister" - ], - "dependencies": { - "@deckdeckgo/editor": "^7.7.0", - "@dfinity/agent": "^0.10.4", - "@dfinity/auth-client": "^0.10.4", - "@dfinity/authentication": "^0.10.4", - "@dfinity/candid": "^0.10.4", - "@dfinity/identity": "^0.10.4", - "@dfinity/principal": "^0.10.4", - "idb-keyval": "^6.1.0", - "nanoid": "^3.3.1" - } -} diff --git a/providers/ic/src/canisters/data/data.did b/providers/ic/src/canisters/data/data.did deleted file mode 100644 index 22946c553..000000000 --- a/providers/ic/src/canisters/data/data.did +++ /dev/null @@ -1,26 +0,0 @@ -type UserId = principal; -type Time = int; -type DataFilter = - record { - notContains: opt text; - startsWith: opt text; - }; -type DataBucket = - service { - del: (text) -> (); - get: (text) -> (opt Data) query; - list: (opt DataFilter) -> (vec record { - text; - Data; - }) query; - set: (text, Data) -> (); - transferCycles: () -> (); - }; -type Data = - record { - created_at: Time; - data: blob; - id: text; - updated_at: Time; - }; -service : (UserId) -> DataBucket diff --git a/providers/ic/src/canisters/data/data.did.d.ts b/providers/ic/src/canisters/data/data.did.d.ts deleted file mode 100644 index fd908267d..000000000 --- a/providers/ic/src/canisters/data/data.did.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type {Principal} from '@dfinity/principal'; -export interface Data { - id: string; - updated_at: Time; - data: Array; - created_at: Time; -} -export interface DataBucket { - del: (arg_0: string) => Promise; - get: (arg_0: string) => Promise<[] | [Data]>; - list: (arg_0: [] | [DataFilter]) => Promise>; - set: (arg_0: string, arg_1: Data) => Promise; - transferCycles: () => Promise; -} -export interface DataFilter { - notContains: [] | [string]; - startsWith: [] | [string]; -} -export type Time = bigint; -export type UserId = Principal; -export interface _SERVICE extends DataBucket {} diff --git a/providers/ic/src/canisters/data/data.most b/providers/ic/src/canisters/data/data.most deleted file mode 100644 index 640203e3b..000000000 --- a/providers/ic/src/canisters/data/data.most +++ /dev/null @@ -1,5 +0,0 @@ -type Data/1 = Data; -actor { - stable var entries : [(Text, Data/1)]; - stable user : Principal -}; diff --git a/providers/ic/src/canisters/data/data.utils.did.js b/providers/ic/src/canisters/data/data.utils.did.js deleted file mode 100644 index eafe38a99..000000000 --- a/providers/ic/src/canisters/data/data.utils.did.js +++ /dev/null @@ -1,26 +0,0 @@ -export const idlFactory = ({IDL}) => { - const UserId = IDL.Principal; - const Time = IDL.Int; - const Data = IDL.Record({ - id: IDL.Text, - updated_at: Time, - data: IDL.Vec(IDL.Nat8), - created_at: Time - }); - const DataFilter = IDL.Record({ - notContains: IDL.Opt(IDL.Text), - startsWith: IDL.Opt(IDL.Text) - }); - const DataBucket = IDL.Service({ - del: IDL.Func([IDL.Text], [], []), - get: IDL.Func([IDL.Text], [IDL.Opt(Data)], ['query']), - list: IDL.Func([IDL.Opt(DataFilter)], [IDL.Vec(IDL.Tuple(IDL.Text, Data))], ['query']), - set: IDL.Func([IDL.Text, Data], [], []), - transferCycles: IDL.Func([], [], []) - }); - return DataBucket; -}; -export const init = ({IDL}) => { - const UserId = IDL.Principal; - return [UserId]; -}; diff --git a/providers/ic/src/canisters/manager/manager.did b/providers/ic/src/canisters/manager/manager.did deleted file mode 100644 index 487187b2d..000000000 --- a/providers/ic/src/canisters/manager/manager.did +++ /dev/null @@ -1,17 +0,0 @@ -type UserId = principal; -type BucketId = principal; -type Bucket = - record { - bucketId: opt BucketId; - owner: UserId; - }; -service : { - delData: () -> (bool); - delStorage: () -> (bool); - getData: () -> (opt Bucket) query; - getStorage: () -> (opt Bucket) query; - initData: () -> (Bucket); - initStorage: () -> (Bucket); - installCode: (principal, blob, blob) -> (); - list: (text) -> (vec Bucket) query; -} diff --git a/providers/ic/src/canisters/manager/manager.did.d.ts b/providers/ic/src/canisters/manager/manager.did.d.ts deleted file mode 100644 index c60762f5e..000000000 --- a/providers/ic/src/canisters/manager/manager.did.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type {Principal} from '@dfinity/principal'; -export interface Bucket { - owner: UserId; - bucketId: [] | [BucketId]; -} -export type BucketId = Principal; -export type UserId = Principal; -export interface _SERVICE { - delData: () => Promise; - delStorage: () => Promise; - getData: () => Promise<[] | [Bucket]>; - getStorage: () => Promise<[] | [Bucket]>; - initData: () => Promise; - initStorage: () => Promise; - installCode: (arg_0: Principal, arg_1: Array, arg_2: Array) => Promise; - list: (arg_0: string) => Promise>; -} diff --git a/providers/ic/src/canisters/manager/manager.most b/providers/ic/src/canisters/manager/manager.most deleted file mode 100644 index 4912722c0..000000000 --- a/providers/ic/src/canisters/manager/manager.most +++ /dev/null @@ -1,5 +0,0 @@ -type Bucket = {bucketId : ?BucketId; owner : UserId}; -actor { - stable var data : [(Principal, Bucket)]; - stable var storages : [(Principal, Bucket)] -}; diff --git a/providers/ic/src/canisters/manager/manager.utils.did.js b/providers/ic/src/canisters/manager/manager.utils.did.js deleted file mode 100644 index 411b88496..000000000 --- a/providers/ic/src/canisters/manager/manager.utils.did.js +++ /dev/null @@ -1,21 +0,0 @@ -export const idlFactory = ({IDL}) => { - const UserId = IDL.Principal; - const BucketId = IDL.Principal; - const Bucket = IDL.Record({ - owner: UserId, - bucketId: IDL.Opt(BucketId) - }); - return IDL.Service({ - delData: IDL.Func([], [IDL.Bool], []), - delStorage: IDL.Func([], [IDL.Bool], []), - getData: IDL.Func([], [IDL.Opt(Bucket)], ['query']), - getStorage: IDL.Func([], [IDL.Opt(Bucket)], ['query']), - initData: IDL.Func([], [Bucket], []), - initStorage: IDL.Func([], [Bucket], []), - installCode: IDL.Func([IDL.Principal, IDL.Vec(IDL.Nat8), IDL.Vec(IDL.Nat8)], [], []), - list: IDL.Func([IDL.Text], [IDL.Vec(Bucket)], ['query']) - }); -}; -export const init = ({IDL}) => { - return []; -}; diff --git a/providers/ic/src/canisters/storage/storage.did b/providers/ic/src/canisters/storage/storage.did deleted file mode 100644 index 8c91c70eb..000000000 --- a/providers/ic/src/canisters/storage/storage.did +++ /dev/null @@ -1,85 +0,0 @@ -type UserId = principal; -type StreamingStrategy = variant { - Callback: - record { - callback: func () -> (); - token: StreamingCallbackToken__1; - };}; -type StreamingCallbackToken__1 = - record { - fullPath: text; - headers: vec HeaderField; - index: nat; - sha256: opt vec nat8; - token: opt text; - }; -type StreamingCallbackToken = - record { - fullPath: text; - headers: vec HeaderField; - index: nat; - sha256: opt vec nat8; - token: opt text; - }; -type StreamingCallbackHttpResponse = - record { - body: vec nat8; - token: opt StreamingCallbackToken__1; - }; -type StorageBucket = - service { - commitUpload: - (record { - batchId: nat; - chunkIds: vec nat; - headers: vec HeaderField__1; - }) -> (); - del: (record { - fullPath: text; - token: opt text; - }) -> (); - http_request: (HttpRequest) -> (HttpResponse) query; - http_request_streaming_callback: (StreamingCallbackToken) -> - (StreamingCallbackHttpResponse) query; - initUpload: (AssetKey) -> (record {batchId: nat;}); - list: (opt text) -> (vec AssetKey) query; - transferCycles: () -> (); - uploadChunk: (Chunk) -> (record {chunkId: nat;}); - }; -type HttpResponse = - record { - body: vec nat8; - headers: vec HeaderField; - status_code: nat16; - streaming_strategy: opt StreamingStrategy; - }; -type HttpRequest = - record { - body: vec nat8; - headers: vec HeaderField; - method: text; - url: text; - }; -type HeaderField__1 = - record { - text; - text; - }; -type HeaderField = - record { - text; - text; - }; -type Chunk = - record { - batchId: nat; - content: vec nat8; - }; -type AssetKey = - record { - folder: text; - fullPath: text; - name: text; - token: opt text; - }; -service : (UserId) -> StorageBucket diff --git a/providers/ic/src/canisters/storage/storage.did.d.ts b/providers/ic/src/canisters/storage/storage.did.d.ts deleted file mode 100644 index d78969409..000000000 --- a/providers/ic/src/canisters/storage/storage.did.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type {Principal} from '@dfinity/principal'; -export interface AssetKey { - token: [] | [string]; - name: string; - fullPath: string; - folder: string; -} -export interface Chunk { - content: Array; - batchId: bigint; -} -export type HeaderField = [string, string]; -export type HeaderField__1 = [string, string]; -export interface HttpRequest { - url: string; - method: string; - body: Array; - headers: Array; -} -export interface HttpResponse { - body: Array; - headers: Array; - streaming_strategy: [] | [StreamingStrategy]; - status_code: number; -} -export interface StorageBucket { - commitUpload: (arg_0: {headers: Array; chunkIds: Array; batchId: bigint}) => Promise; - del: (arg_0: {token: [] | [string]; fullPath: string}) => Promise; - http_request: (arg_0: HttpRequest) => Promise; - http_request_streaming_callback: (arg_0: StreamingCallbackToken) => Promise; - initUpload: (arg_0: AssetKey) => Promise<{batchId: bigint}>; - list: (arg_0: [] | [string]) => Promise>; - transferCycles: () => Promise; - uploadChunk: (arg_0: Chunk) => Promise<{chunkId: bigint}>; -} -export interface StreamingCallbackHttpResponse { - token: [] | [StreamingCallbackToken__1]; - body: Array; -} -export interface StreamingCallbackToken { - token: [] | [string]; - sha256: [] | [Array]; - fullPath: string; - headers: Array; - index: bigint; -} -export interface StreamingCallbackToken__1 { - token: [] | [string]; - sha256: [] | [Array]; - fullPath: string; - headers: Array; - index: bigint; -} -export type StreamingStrategy = { - Callback: { - token: StreamingCallbackToken__1; - callback: [Principal, string]; - }; -}; -export type UserId = Principal; -export interface _SERVICE extends StorageBucket {} diff --git a/providers/ic/src/canisters/storage/storage.most b/providers/ic/src/canisters/storage/storage.most deleted file mode 100644 index 0be87ebb2..000000000 --- a/providers/ic/src/canisters/storage/storage.most +++ /dev/null @@ -1,5 +0,0 @@ -type Asset/2 = Asset; -actor { - stable var entries : [(Text, Asset/2)]; - stable user : Principal -}; diff --git a/providers/ic/src/canisters/storage/storage.utils.did.js b/providers/ic/src/canisters/storage/storage.utils.did.js deleted file mode 100644 index d7351113b..000000000 --- a/providers/ic/src/canisters/storage/storage.utils.did.js +++ /dev/null @@ -1,76 +0,0 @@ -export const idlFactory = ({IDL}) => { - const UserId = IDL.Principal; - const HeaderField__1 = IDL.Tuple(IDL.Text, IDL.Text); - const HeaderField = IDL.Tuple(IDL.Text, IDL.Text); - const HttpRequest = IDL.Record({ - url: IDL.Text, - method: IDL.Text, - body: IDL.Vec(IDL.Nat8), - headers: IDL.Vec(HeaderField) - }); - const StreamingCallbackToken__1 = IDL.Record({ - token: IDL.Opt(IDL.Text), - sha256: IDL.Opt(IDL.Vec(IDL.Nat8)), - fullPath: IDL.Text, - headers: IDL.Vec(HeaderField), - index: IDL.Nat - }); - const StreamingStrategy = IDL.Variant({ - Callback: IDL.Record({ - token: StreamingCallbackToken__1, - callback: IDL.Func([], [], []) - }) - }); - const HttpResponse = IDL.Record({ - body: IDL.Vec(IDL.Nat8), - headers: IDL.Vec(HeaderField), - streaming_strategy: IDL.Opt(StreamingStrategy), - status_code: IDL.Nat16 - }); - const StreamingCallbackToken = IDL.Record({ - token: IDL.Opt(IDL.Text), - sha256: IDL.Opt(IDL.Vec(IDL.Nat8)), - fullPath: IDL.Text, - headers: IDL.Vec(HeaderField), - index: IDL.Nat - }); - const StreamingCallbackHttpResponse = IDL.Record({ - token: IDL.Opt(StreamingCallbackToken__1), - body: IDL.Vec(IDL.Nat8) - }); - const AssetKey = IDL.Record({ - token: IDL.Opt(IDL.Text), - name: IDL.Text, - fullPath: IDL.Text, - folder: IDL.Text - }); - const Chunk = IDL.Record({ - content: IDL.Vec(IDL.Nat8), - batchId: IDL.Nat - }); - const StorageBucket = IDL.Service({ - commitUpload: IDL.Func( - [ - IDL.Record({ - headers: IDL.Vec(HeaderField__1), - chunkIds: IDL.Vec(IDL.Nat), - batchId: IDL.Nat - }) - ], - [], - [] - ), - del: IDL.Func([IDL.Record({token: IDL.Opt(IDL.Text), fullPath: IDL.Text})], [], []), - http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']), - http_request_streaming_callback: IDL.Func([StreamingCallbackToken], [StreamingCallbackHttpResponse], ['query']), - initUpload: IDL.Func([AssetKey], [IDL.Record({batchId: IDL.Nat})], []), - list: IDL.Func([IDL.Opt(IDL.Text)], [IDL.Vec(AssetKey)], ['query']), - transferCycles: IDL.Func([], [], []), - uploadChunk: IDL.Func([Chunk], [IDL.Record({chunkId: IDL.Nat})], []) - }); - return StorageBucket; -}; -export const init = ({IDL}) => { - const UserId = IDL.Principal; - return [UserId]; -}; diff --git a/providers/ic/src/components.d.ts b/providers/ic/src/components.d.ts deleted file mode 100644 index eca08b821..000000000 --- a/providers/ic/src/components.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* eslint-disable */ -/* tslint:disable */ -/** - * This is an autogenerated file created by the Stencil compiler. - * It contains typing information for all components that exist in this project. - */ -import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; -export namespace Components { - interface DeckgoIcSignin { - "config": Record; - "i18n": Record>; - "signInError": (err?: string) => void; - "signInSuccess": () => void; - } -} -declare global { - interface HTMLDeckgoIcSigninElement extends Components.DeckgoIcSignin, HTMLStencilElement { - } - var HTMLDeckgoIcSigninElement: { - prototype: HTMLDeckgoIcSigninElement; - new (): HTMLDeckgoIcSigninElement; - }; - interface HTMLElementTagNameMap { - "deckgo-ic-signin": HTMLDeckgoIcSigninElement; - } -} -declare namespace LocalJSX { - interface DeckgoIcSignin { - "config"?: Record; - "i18n"?: Record>; - "onDdgSignInError"?: (event: CustomEvent) => void; - "onDdgSignInSuccess"?: (event: CustomEvent) => void; - "onInProgress"?: (event: CustomEvent) => void; - "signInError"?: (err?: string) => void; - "signInSuccess"?: () => void; - } - interface IntrinsicElements { - "deckgo-ic-signin": DeckgoIcSignin; - } -} -export { LocalJSX as JSX }; -declare module "@stencil/core" { - export namespace JSX { - interface IntrinsicElements { - "deckgo-ic-signin": LocalJSX.DeckgoIcSignin & JSXBase.HTMLAttributes; - } - } -} diff --git a/providers/ic/src/components/icons/dfinity.tsx b/providers/ic/src/components/icons/dfinity.tsx deleted file mode 100644 index a3114b259..000000000 --- a/providers/ic/src/components/icons/dfinity.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import {FunctionalComponent, h} from '@stencil/core'; - -export const IconDfinity: FunctionalComponent = () => ( - - - - - - - - - - - - - - - - - - - - - -); diff --git a/providers/ic/src/components/signin/ic-signin.scss b/providers/ic/src/components/signin/ic-signin.scss deleted file mode 100644 index 0c0e22706..000000000 --- a/providers/ic/src/components/signin/ic-signin.scss +++ /dev/null @@ -1,22 +0,0 @@ -deckgo-ic-signin { - div.actions { - display: flex; - justify-content: center; - align-content: center; - - position: relative; - } - - p.terms { - max-width: 220px; - margin-left: auto; - margin-right: auto; - text-align: center; - font-size: var(--font-size-very-small, 10px); - padding: calc(var(--padding, 16px) / 2) 0; - } - - div.spinner.hidden { - display: none; - } -} diff --git a/providers/ic/src/components/signin/ic-signin.tsx b/providers/ic/src/components/signin/ic-signin.tsx deleted file mode 100644 index b0e96adc7..000000000 --- a/providers/ic/src/components/signin/ic-signin.tsx +++ /dev/null @@ -1,102 +0,0 @@ -import {Component, ComponentInterface, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core'; -import {signIn} from '../../providers/auth/auth.ic'; -import {IconDfinity} from '../icons/dfinity'; - -@Component({ - tag: 'deckgo-ic-signin', - styleUrl: 'ic-signin.scss' -}) -export class IcSignin implements ComponentInterface { - @Prop() - i18n: Record>; - - @Prop() - config: Record; - - @Prop() - signInSuccess: () => void; - - @Prop() - signInError: (err?: string) => void; - - @Event() - inProgress: EventEmitter; - - @State() - private signInInProgress: boolean = false; - - @Event() - ddgSignInSuccess: EventEmitter; - - @Event() - ddgSignInError: EventEmitter; - - private async signUserIn() { - this.inProgress.emit(true); - this.signInInProgress = true; - - const signInSuccess: () => void = this.signInSuccess || (() => this.ddgSignInSuccess.emit()); - const signInError: (err?: string) => void = this.signInError || ((err?: string) => this.ddgSignInError.emit(err)); - - await signIn({ - onSuccess: signInSuccess, - onError: (err?: string) => { - this.signInInProgress = false; - - signInError(err); - } - }); - } - - render() { - return ( - -
- {this.renderSpinner()} - {this.renderAction()} -
- - {this.renderTerms()} -
- ); - } - - private renderSpinner() { - return ( -
- -
- ); - } - - private renderAction() { - if (this.signInInProgress) { - return undefined; - } - - return ( - - ); - } - - private renderTerms() { - const {terms, privacy} = this.config || {}; - - return ( -

- By continuing, you are indicating that you accept our{' '} - - {this.i18n?.links.terms_of_use} - {' '} - and{' '} - - {this.i18n?.links.privacy_policy} - - . -

- ); - } -} diff --git a/providers/ic/src/index.html b/providers/ic/src/index.html deleted file mode 100644 index b460f7ac6..000000000 --- a/providers/ic/src/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - DeckDeckGo - - - - - - - - - - diff --git a/providers/ic/src/index.ts b/providers/ic/src/index.ts deleted file mode 100644 index 6d861df9d..000000000 --- a/providers/ic/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type {Components, JSX} from './components'; -export * from './providers/auth/auth.ic'; -export * from './providers/data/deck.ic'; -export * from './providers/data/doc.ic'; -export * from './providers/data/paragraph.ic'; -export * from './providers/data/slide.ic'; -export * from './providers/data/template.ic'; -export * from './providers/data/user.ic'; -export * from './providers/publish/publish.ic'; -export * from './providers/storage/storage.ic'; -export * from './providers/sync/sync.ic'; diff --git a/providers/ic/src/interface.d.ts b/providers/ic/src/interface.d.ts deleted file mode 100644 index 45da9335c..000000000 --- a/providers/ic/src/interface.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './components'; -export * from './providers/auth/auth.ic'; -export * from './providers/data/deck.ic'; -export * from './providers/data/doc.ic'; -export * from './providers/data/paragraph.ic'; -export * from './providers/data/slide.ic'; -export * from './providers/data/template.ic'; -export * from './providers/data/user.ic'; -export * from './providers/publish/publish.ic'; -export * from './providers/storage/storage.ic'; -export * from './providers/sync/sync.ic'; diff --git a/providers/ic/src/providers/auth/auth.ic.ts b/providers/ic/src/providers/auth/auth.ic.ts deleted file mode 100644 index 29c474885..000000000 --- a/providers/ic/src/providers/auth/auth.ic.ts +++ /dev/null @@ -1,118 +0,0 @@ -import {AuthUser, DeleteAuth, InitAuth, log, SignOut, User} from '@deckdeckgo/editor'; -import {Identity} from '@dfinity/agent'; -import {AuthClient} from '@dfinity/auth-client'; -import {_SERVICE as ManagerActor} from '../../canisters/manager/manager.did'; -import {EnvStore} from '../../stores/env.store'; -import {EnvironmentIC} from '../../types/env.types'; -import {InternetIdentityAuth} from '../../types/identity'; -import {SignOutWindow} from '../../types/sync.window'; -import {internetIdentityAuth} from '../../utils/identity.utils'; -import {createManagerActor} from '../../utils/manager.utils'; -import {startIdleTime, stopIdleTimer} from '../../workers/idle.ic.worker'; -import {initUserWorker} from '../../workers/user.ic.worker'; - -declare global { - interface Window { - authClient: AuthClient | undefined; - } -} - -let authClient: AuthClient | undefined; - -export const initAuth: InitAuth = async ({ - config, - success -}: { - config: Record; - success: ({authUser, user}: {authUser: AuthUser | null; user: User | undefined}) => Promise; - reset: () => Promise; -}) => { - EnvStore.getInstance().set(config as EnvironmentIC); - - authClient = await AuthClient.create(); - - const isAuthenticated: boolean = (await authClient?.isAuthenticated()) || false; - - if (!isAuthenticated) { - return; - } - - const internetIdentity: InternetIdentityAuth = await internetIdentityAuth(); - - await initUser({success}); - - const onInitUserSuccess: (user: User) => Promise = async (user: User) => await authenticatedUser({user, success}); - - await initUserWorker({internetIdentity, env: EnvStore.getInstance().get()}, onInitUserSuccess, log); - - const onSignOut: SignOutWindow = (): void => { - const $event: CustomEvent = new CustomEvent('ddgSignOut', {bubbles: true}); - document.dispatchEvent($event); - }; - - await startIdleTime({internetIdentity}, onSignOut); -}; - -// If first sign-in, initializing the canister can take a while therefore we already emit a not fully authenticated user -const initUser = async ({success}: {success: ({authUser, user}: {authUser: AuthUser | null; user: User | undefined}) => Promise}) => { - const authUser: AuthUser = { - state: 'initialization' - } as AuthUser; - - await success({authUser, user: undefined}); -}; - -const authenticatedUser = async ({ - user, - success -}: { - user: User; - success: ({authUser, user}: {authUser: AuthUser | null; user: User | undefined}) => Promise; -}) => { - const {id, data} = user; - - const {name, email, photo_url} = data; - - const authUser: AuthUser = { - uid: id, - state: 'authenticated', - name, - email, - photo_url - } as AuthUser; - - await success({authUser, user}); -}; - -export const signOut: SignOut = async (): Promise => { - await stopIdleTimer(); - - await authClient?.logout(); -}; - -export const signIn = async ({onSuccess, onError}: {onSuccess: () => void; onError: (err?: string) => void}) => { - authClient = authClient || (await AuthClient.create()); - - await authClient.login({ - onSuccess, - onError, - ...(EnvStore.getInstance().localIdentity() && { - identityProvider: `http://localhost:8000?canisterId=${EnvStore.getInstance().get().localIdentityCanisterId}#authorize` - }) - }); -}; - -export const deleteAuth: DeleteAuth = async (_auth: {user: User; config}): Promise => { - const identity: Identity | undefined = getIdentity(); - - if (!identity) { - throw new Error('Invalid identity.'); - } - - const managerActor: ManagerActor = await createManagerActor({identity}); - await Promise.all([managerActor.delData(), managerActor.delStorage()]); -}; - -export const getIdentity = (): Identity | undefined => { - return authClient?.getIdentity(); -}; diff --git a/providers/ic/src/providers/data/deck.ic.ts b/providers/ic/src/providers/data/deck.ic.ts deleted file mode 100644 index ec0bcc7b0..000000000 --- a/providers/ic/src/providers/data/deck.ic.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {Deck, DeckData, DeckEntries, DeleteDeck, SnapshotDeck} from '@deckdeckgo/editor'; -import {deleteData, entries} from '../../utils/data.utils'; - -export const deckEntries: DeckEntries = async (_userId: string): Promise => - entries({startsWith: '/decks/', notContains: '/slides/'}); - -export const deleteDeck: DeleteDeck = async (deckId: string): Promise => deleteData({key: `/decks/${deckId}`}); - -// Backwards compatibility with current publish mask in studio and Firebase support. In case of IC we actually do not need a snapshot, publish is synchronous on the client side. -export const snapshotDeck: SnapshotDeck = async ({ - onNext -}: { - deckId: string; - onNext: (snapshot: Deck) => Promise; - onError?: (error: string) => void; -}): Promise<() => void | undefined> => { - document.addEventListener('deckPublished', async ({detail}: CustomEvent) => await onNext(detail), {passive: true}); - - return () => document.removeEventListener('deckPublished', ({detail}: CustomEvent) => onNext(detail), false); -}; diff --git a/providers/ic/src/providers/data/doc.ic.ts b/providers/ic/src/providers/data/doc.ic.ts deleted file mode 100644 index 2bf300765..000000000 --- a/providers/ic/src/providers/data/doc.ic.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {DeleteDoc, Doc, DocData, DocEntries, SnapshotDoc} from '@deckdeckgo/editor'; -import {deleteData, entries} from '../../utils/data.utils'; - -export const docEntries: DocEntries = async (_userId: string): Promise => - entries({startsWith: '/docs/', notContains: '/paragraphs/'}); - -export const deleteDoc: DeleteDoc = async (docId: string): Promise => deleteData({key: `/docs/${docId}`}); - -// Backwards compatibility with current publish mask in studio and Firebase support. In case of IC we actually do not need a snapshot, publish is synchronous on the client side. -export const snapshotDoc: SnapshotDoc = async ({ - onNext -}: { - docId: string; - onNext: (snapshot: Doc) => Promise; - onError?: (error: string) => void; -}): Promise<() => void | undefined> => { - document.addEventListener('docPublished', async ({detail}: CustomEvent) => await onNext(detail), {passive: true}); - - return () => document.removeEventListener('docPublished', ({detail}: CustomEvent) => onNext(detail), false); -}; diff --git a/providers/ic/src/providers/data/paragraph.ic.ts b/providers/ic/src/providers/data/paragraph.ic.ts deleted file mode 100644 index 7260d5b6f..000000000 --- a/providers/ic/src/providers/data/paragraph.ic.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {Paragraph, ParagraphData} from '@deckdeckgo/editor'; -import {getData} from '../../utils/data.utils'; - -export const getParagraph = (docId: string, paragraphId: string): Promise => - getData({key: `/docs/${docId}/paragraphs/${paragraphId}`}); diff --git a/providers/ic/src/providers/data/slide.ic.ts b/providers/ic/src/providers/data/slide.ic.ts deleted file mode 100644 index 106175bf4..000000000 --- a/providers/ic/src/providers/data/slide.ic.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {Slide, SlideData} from '@deckdeckgo/editor'; -import {getData} from '../../utils/data.utils'; - -export const getSlide = (deckId: string, slideId: string): Promise => - getData({key: `/decks/${deckId}/slides/${slideId}`}); diff --git a/providers/ic/src/providers/data/template.ic.ts b/providers/ic/src/providers/data/template.ic.ts deleted file mode 100644 index 605f5397d..000000000 --- a/providers/ic/src/providers/data/template.ic.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {CreateTemplate, GetUserTemplates, Template, TemplateData, UpdateTemplate} from '@deckdeckgo/editor'; -import {nanoid} from 'nanoid'; -import {entries, setData} from '../../utils/data.utils'; - -export const getUserTemplates: GetUserTemplates = (_userId: string): Promise => - entries({startsWith: '/templates/'}); - -export const createTemplate: CreateTemplate = (data: TemplateData): Promise