From d65b945d4f3f0e9cefaee841d40c5b290002b9d3 Mon Sep 17 00:00:00 2001 From: Henry Chan Date: Mon, 25 Apr 2022 10:49:03 +1000 Subject: [PATCH] [UI Declaration] Regenerate actor candid * remove unused hello_assets declaration --- ui/declarations/hello/hello.d.ts | 4 - ui/declarations/hello/hello.js | 3 - ui/declarations/hello/hello.most | 4 + ui/declarations/hello_assets/assetstorage.did | 140 ---------------- .../hello_assets/hello_assets.d.ts | 117 ------------- ui/declarations/hello_assets/hello_assets.did | 140 ---------------- .../hello_assets/hello_assets.did.d.ts | 117 ------------- .../hello_assets/hello_assets.did.js | 155 ------------------ ui/declarations/hello_assets/hello_assets.js | 3 - ui/declarations/hello_assets/index.js | 38 ----- ui/declarations/image/image.most | 21 +++ 11 files changed, 25 insertions(+), 717 deletions(-) delete mode 100644 ui/declarations/hello/hello.d.ts delete mode 100644 ui/declarations/hello/hello.js create mode 100644 ui/declarations/hello/hello.most delete mode 100644 ui/declarations/hello_assets/assetstorage.did delete mode 100644 ui/declarations/hello_assets/hello_assets.d.ts delete mode 100644 ui/declarations/hello_assets/hello_assets.did delete mode 100644 ui/declarations/hello_assets/hello_assets.did.d.ts delete mode 100644 ui/declarations/hello_assets/hello_assets.did.js delete mode 100644 ui/declarations/hello_assets/hello_assets.js delete mode 100644 ui/declarations/hello_assets/index.js create mode 100644 ui/declarations/image/image.most diff --git a/ui/declarations/hello/hello.d.ts b/ui/declarations/hello/hello.d.ts deleted file mode 100644 index 40320b8..0000000 --- a/ui/declarations/hello/hello.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Principal } from '@dfinity/agent'; -export default interface _SERVICE { - 'greet' : (arg_0: string) => Promise, -}; \ No newline at end of file diff --git a/ui/declarations/hello/hello.js b/ui/declarations/hello/hello.js deleted file mode 100644 index 939ac2e..0000000 --- a/ui/declarations/hello/hello.js +++ /dev/null @@ -1,3 +0,0 @@ -import idlImport from './hello.did.js'; -export const idlFactory = idlImport; -export const canisterId = "vriqd-siaaa-aaaah-qablq-cai"; diff --git a/ui/declarations/hello/hello.most b/ui/declarations/hello/hello.most new file mode 100644 index 0000000..8c1d898 --- /dev/null +++ b/ui/declarations/hello/hello.most @@ -0,0 +1,4 @@ +// Version: 1.0.0 +actor { + +}; diff --git a/ui/declarations/hello_assets/assetstorage.did b/ui/declarations/hello_assets/assetstorage.did deleted file mode 100644 index d11ecd9..0000000 --- a/ui/declarations/hello_assets/assetstorage.did +++ /dev/null @@ -1,140 +0,0 @@ -type BatchId = nat; -type ChunkId = nat; -type Key = text; -type Time = int; - -type CreateAssetArguments = record { - key: Key; - content_type: text; -}; - -// Add or change content for an asset, by content encoding -type SetAssetContentArguments = record { - key: Key; - content_encoding: text; - chunk_ids: vec ChunkId; - sha256: opt blob; -}; - -// Remove content for an asset, by content encoding -type UnsetAssetContentArguments = record { - key: Key; - content_encoding: text; -}; - -// Delete an asset -type DeleteAssetArguments = record { - key: Key; -}; - -// Reset everything -type ClearArguments = record {}; - -type BatchOperationKind = variant { - CreateAsset: CreateAssetArguments; - SetAssetContent: SetAssetContentArguments; - - UnsetAssetContent: UnsetAssetContentArguments; - DeleteAsset: DeleteAssetArguments; - - Clear: ClearArguments; -}; - -type HeaderField = record { text; text; }; - -type HttpRequest = record { - method: text; - url: text; - headers: vec HeaderField; - body: blob; -}; - -type HttpResponse = record { - status_code: nat16; - headers: vec HeaderField; - body: blob; - streaming_strategy: opt StreamingStrategy; -}; - -type StreamingCallbackHttpResponse = record { - body: blob; - token: opt StreamingCallbackToken; -}; - -type StreamingCallbackToken = record { - key: Key; - content_encoding: text; - index: nat; - sha256: opt blob; -}; - -type StreamingStrategy = variant { - Callback: record { - callback: func (StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query; - token: StreamingCallbackToken; - }; -}; - -service: { - - get: (record { - key: Key; - accept_encodings: vec text; - }) -> (record { - content: blob; // may be the entirety of the content, or just chunk index 0 - content_type: text; - content_encoding: text; - sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments - total_length: nat; // all chunks except last have size == content.size() - }) query; - - // if get() returned chunks > 1, call this to retrieve them. - // chunks may or may not be split up at the same boundaries as presented to create_chunk(). - get_chunk: (record { - key: Key; - content_encoding: text; - index: nat; - sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments - }) -> (record { content: blob }) query; - - list : (record {}) -> (vec record { - key: Key; - content_type: text; - encodings: vec record { - content_encoding: text; - sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments - length: nat; // Size of this encoding's blob. Calculated when uploading assets. - modified: Time; - }; - }) query; - - create_batch : (record {}) -> (record { batch_id: BatchId }); - - create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId }); - - // Perform all operations successfully, or reject - commit_batch: (record { batch_id: BatchId; operations: vec BatchOperationKind }) -> (); - - create_asset: (CreateAssetArguments) -> (); - set_asset_content: (SetAssetContentArguments) -> (); - unset_asset_content: (UnsetAssetContentArguments) -> (); - - delete_asset: (DeleteAssetArguments) -> (); - - clear: (ClearArguments) -> (); - - // Single call to create an asset with content for a single content encoding that - // fits within the message ingress limit. - store: (record { - key: Key; - content_type: text; - content_encoding: text; - content: blob; - sha256: opt blob - }) -> (); - - http_request: (request: HttpRequest) -> (HttpResponse) query; - http_request_streaming_callback: (token: StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query; - - authorize: (principal) -> (); -} diff --git a/ui/declarations/hello_assets/hello_assets.d.ts b/ui/declarations/hello_assets/hello_assets.d.ts deleted file mode 100644 index e530628..0000000 --- a/ui/declarations/hello_assets/hello_assets.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import type { Principal } from '@dfinity/agent'; -export type BatchId = bigint; -export type BatchOperationKind = { 'CreateAsset' : CreateAssetArguments } | - { 'UnsetAssetContent' : UnsetAssetContentArguments } | - { 'DeleteAsset' : DeleteAssetArguments } | - { 'SetAssetContent' : SetAssetContentArguments } | - { 'Clear' : ClearArguments }; -export type ChunkId = bigint; -export interface ClearArguments {}; -export interface CreateAssetArguments { 'key' : Key, 'content_type' : string }; -export interface DeleteAssetArguments { 'key' : Key }; -export interface HeaderField [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 type Key = string; -export interface SetAssetContentArguments { - 'key' : Key, - 'sha256' : [] | [Array], - 'chunk_ids' : Array, - 'content_encoding' : string, -}; -export interface StreamingCallbackHttpResponse { - 'token' : [] | [StreamingCallbackToken], - 'body' : Array, -}; -export interface StreamingCallbackToken { - 'key' : Key, - 'sha256' : [] | [Array], - 'index' : bigint, - 'content_encoding' : string, -}; -export type StreamingStrategy = { - 'Callback' : { - 'token' : StreamingCallbackToken, - 'callback' : [Principal, string], - } - }; -export type Time = bigint; -export interface UnsetAssetContentArguments { - 'key' : Key, - 'content_encoding' : string, -}; -export default interface _SERVICE { - 'authorize' : (arg_0: Principal) => Promise, - 'clear' : (arg_0: ClearArguments) => Promise, - 'commit_batch' : ( - arg_0: { 'batch_id' : BatchId, 'operations' : Array }, - ) => Promise, - 'create_asset' : (arg_0: CreateAssetArguments) => Promise, - 'create_batch' : (arg_0: {}) => Promise<{ 'batch_id' : BatchId }>, - 'create_chunk' : ( - arg_0: { 'content' : Array, 'batch_id' : BatchId }, - ) => Promise<{ 'chunk_id' : ChunkId }>, - 'delete_asset' : (arg_0: DeleteAssetArguments) => Promise, - 'get' : ( - arg_0: { 'key' : Key, 'accept_encodings' : Array }, - ) => Promise< - { - 'content' : Array, - 'sha256' : [] | [Array], - 'content_type' : string, - 'content_encoding' : string, - 'total_length' : bigint, - } - >, - 'get_chunk' : ( - arg_0: { - 'key' : Key, - 'sha256' : [] | [Array], - 'index' : bigint, - 'content_encoding' : string, - }, - ) => Promise<{ 'content' : Array }>, - 'http_request' : (arg_0: HttpRequest) => Promise, - 'http_request_streaming_callback' : ( - arg_0: StreamingCallbackToken, - ) => Promise<[] | [StreamingCallbackHttpResponse]>, - 'list' : (arg_0: {}) => Promise< - Array< - { - 'key' : Key, - 'encodings' : Array< - { - 'modified' : Time, - 'sha256' : [] | [Array], - 'length' : bigint, - 'content_encoding' : string, - } - >, - 'content_type' : string, - } - > - >, - 'set_asset_content' : (arg_0: SetAssetContentArguments) => Promise, - 'store' : ( - arg_0: { - 'key' : Key, - 'content' : Array, - 'sha256' : [] | [Array], - 'content_type' : string, - 'content_encoding' : string, - }, - ) => Promise, - 'unset_asset_content' : (arg_0: UnsetAssetContentArguments) => Promise< - undefined - >, -}; \ No newline at end of file diff --git a/ui/declarations/hello_assets/hello_assets.did b/ui/declarations/hello_assets/hello_assets.did deleted file mode 100644 index d11ecd9..0000000 --- a/ui/declarations/hello_assets/hello_assets.did +++ /dev/null @@ -1,140 +0,0 @@ -type BatchId = nat; -type ChunkId = nat; -type Key = text; -type Time = int; - -type CreateAssetArguments = record { - key: Key; - content_type: text; -}; - -// Add or change content for an asset, by content encoding -type SetAssetContentArguments = record { - key: Key; - content_encoding: text; - chunk_ids: vec ChunkId; - sha256: opt blob; -}; - -// Remove content for an asset, by content encoding -type UnsetAssetContentArguments = record { - key: Key; - content_encoding: text; -}; - -// Delete an asset -type DeleteAssetArguments = record { - key: Key; -}; - -// Reset everything -type ClearArguments = record {}; - -type BatchOperationKind = variant { - CreateAsset: CreateAssetArguments; - SetAssetContent: SetAssetContentArguments; - - UnsetAssetContent: UnsetAssetContentArguments; - DeleteAsset: DeleteAssetArguments; - - Clear: ClearArguments; -}; - -type HeaderField = record { text; text; }; - -type HttpRequest = record { - method: text; - url: text; - headers: vec HeaderField; - body: blob; -}; - -type HttpResponse = record { - status_code: nat16; - headers: vec HeaderField; - body: blob; - streaming_strategy: opt StreamingStrategy; -}; - -type StreamingCallbackHttpResponse = record { - body: blob; - token: opt StreamingCallbackToken; -}; - -type StreamingCallbackToken = record { - key: Key; - content_encoding: text; - index: nat; - sha256: opt blob; -}; - -type StreamingStrategy = variant { - Callback: record { - callback: func (StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query; - token: StreamingCallbackToken; - }; -}; - -service: { - - get: (record { - key: Key; - accept_encodings: vec text; - }) -> (record { - content: blob; // may be the entirety of the content, or just chunk index 0 - content_type: text; - content_encoding: text; - sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments - total_length: nat; // all chunks except last have size == content.size() - }) query; - - // if get() returned chunks > 1, call this to retrieve them. - // chunks may or may not be split up at the same boundaries as presented to create_chunk(). - get_chunk: (record { - key: Key; - content_encoding: text; - index: nat; - sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments - }) -> (record { content: blob }) query; - - list : (record {}) -> (vec record { - key: Key; - content_type: text; - encodings: vec record { - content_encoding: text; - sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments - length: nat; // Size of this encoding's blob. Calculated when uploading assets. - modified: Time; - }; - }) query; - - create_batch : (record {}) -> (record { batch_id: BatchId }); - - create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId }); - - // Perform all operations successfully, or reject - commit_batch: (record { batch_id: BatchId; operations: vec BatchOperationKind }) -> (); - - create_asset: (CreateAssetArguments) -> (); - set_asset_content: (SetAssetContentArguments) -> (); - unset_asset_content: (UnsetAssetContentArguments) -> (); - - delete_asset: (DeleteAssetArguments) -> (); - - clear: (ClearArguments) -> (); - - // Single call to create an asset with content for a single content encoding that - // fits within the message ingress limit. - store: (record { - key: Key; - content_type: text; - content_encoding: text; - content: blob; - sha256: opt blob - }) -> (); - - http_request: (request: HttpRequest) -> (HttpResponse) query; - http_request_streaming_callback: (token: StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query; - - authorize: (principal) -> (); -} diff --git a/ui/declarations/hello_assets/hello_assets.did.d.ts b/ui/declarations/hello_assets/hello_assets.did.d.ts deleted file mode 100644 index 990bf87..0000000 --- a/ui/declarations/hello_assets/hello_assets.did.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import type { Principal } from '@dfinity/principal'; -export type BatchId = bigint; -export type BatchOperationKind = { 'CreateAsset' : CreateAssetArguments } | - { 'UnsetAssetContent' : UnsetAssetContentArguments } | - { 'DeleteAsset' : DeleteAssetArguments } | - { 'SetAssetContent' : SetAssetContentArguments } | - { 'Clear' : ClearArguments }; -export type ChunkId = bigint; -export type ClearArguments = {}; -export interface CreateAssetArguments { 'key' : Key, 'content_type' : string } -export interface DeleteAssetArguments { 'key' : Key } -export type HeaderField = [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 type Key = string; -export interface SetAssetContentArguments { - 'key' : Key, - 'sha256' : [] | [Array], - 'chunk_ids' : Array, - 'content_encoding' : string, -} -export interface StreamingCallbackHttpResponse { - 'token' : [] | [StreamingCallbackToken], - 'body' : Array, -} -export interface StreamingCallbackToken { - 'key' : Key, - 'sha256' : [] | [Array], - 'index' : bigint, - 'content_encoding' : string, -} -export type StreamingStrategy = { - 'Callback' : { - 'token' : StreamingCallbackToken, - 'callback' : [Principal, string], - } - }; -export type Time = bigint; -export interface UnsetAssetContentArguments { - 'key' : Key, - 'content_encoding' : string, -} -export interface _SERVICE { - 'authorize' : (arg_0: Principal) => Promise, - 'clear' : (arg_0: ClearArguments) => Promise, - 'commit_batch' : ( - arg_0: { 'batch_id' : BatchId, 'operations' : Array }, - ) => Promise, - 'create_asset' : (arg_0: CreateAssetArguments) => Promise, - 'create_batch' : (arg_0: {}) => Promise<{ 'batch_id' : BatchId }>, - 'create_chunk' : ( - arg_0: { 'content' : Array, 'batch_id' : BatchId }, - ) => Promise<{ 'chunk_id' : ChunkId }>, - 'delete_asset' : (arg_0: DeleteAssetArguments) => Promise, - 'get' : ( - arg_0: { 'key' : Key, 'accept_encodings' : Array }, - ) => Promise< - { - 'content' : Array, - 'sha256' : [] | [Array], - 'content_type' : string, - 'content_encoding' : string, - 'total_length' : bigint, - } - >, - 'get_chunk' : ( - arg_0: { - 'key' : Key, - 'sha256' : [] | [Array], - 'index' : bigint, - 'content_encoding' : string, - }, - ) => Promise<{ 'content' : Array }>, - 'http_request' : (arg_0: HttpRequest) => Promise, - 'http_request_streaming_callback' : ( - arg_0: StreamingCallbackToken, - ) => Promise<[] | [StreamingCallbackHttpResponse]>, - 'list' : (arg_0: {}) => Promise< - Array< - { - 'key' : Key, - 'encodings' : Array< - { - 'modified' : Time, - 'sha256' : [] | [Array], - 'length' : bigint, - 'content_encoding' : string, - } - >, - 'content_type' : string, - } - > - >, - 'set_asset_content' : (arg_0: SetAssetContentArguments) => Promise, - 'store' : ( - arg_0: { - 'key' : Key, - 'content' : Array, - 'sha256' : [] | [Array], - 'content_type' : string, - 'content_encoding' : string, - }, - ) => Promise, - 'unset_asset_content' : (arg_0: UnsetAssetContentArguments) => Promise< - undefined - >, -} diff --git a/ui/declarations/hello_assets/hello_assets.did.js b/ui/declarations/hello_assets/hello_assets.did.js deleted file mode 100644 index 46f975e..0000000 --- a/ui/declarations/hello_assets/hello_assets.did.js +++ /dev/null @@ -1,155 +0,0 @@ -export const idlFactory = ({ IDL }) => { - const ClearArguments = IDL.Record({}); - const BatchId = IDL.Nat; - const Key = IDL.Text; - const CreateAssetArguments = IDL.Record({ - 'key' : Key, - 'content_type' : IDL.Text, - }); - const UnsetAssetContentArguments = IDL.Record({ - 'key' : Key, - 'content_encoding' : IDL.Text, - }); - const DeleteAssetArguments = IDL.Record({ 'key' : Key }); - const ChunkId = IDL.Nat; - const SetAssetContentArguments = IDL.Record({ - 'key' : Key, - 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), - 'chunk_ids' : IDL.Vec(ChunkId), - 'content_encoding' : IDL.Text, - }); - const BatchOperationKind = IDL.Variant({ - 'CreateAsset' : CreateAssetArguments, - 'UnsetAssetContent' : UnsetAssetContentArguments, - 'DeleteAsset' : DeleteAssetArguments, - 'SetAssetContent' : SetAssetContentArguments, - 'Clear' : ClearArguments, - }); - 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 = IDL.Record({ - 'key' : Key, - 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), - 'index' : IDL.Nat, - 'content_encoding' : IDL.Text, - }); - const StreamingCallbackHttpResponse = IDL.Record({ - 'token' : IDL.Opt(StreamingCallbackToken), - 'body' : IDL.Vec(IDL.Nat8), - }); - const StreamingStrategy = IDL.Variant({ - 'Callback' : IDL.Record({ - 'token' : StreamingCallbackToken, - 'callback' : IDL.Func( - [StreamingCallbackToken], - [IDL.Opt(StreamingCallbackHttpResponse)], - ['query'], - ), - }), - }); - const HttpResponse = IDL.Record({ - 'body' : IDL.Vec(IDL.Nat8), - 'headers' : IDL.Vec(HeaderField), - 'streaming_strategy' : IDL.Opt(StreamingStrategy), - 'status_code' : IDL.Nat16, - }); - const Time = IDL.Int; - return IDL.Service({ - 'authorize' : IDL.Func([IDL.Principal], [], []), - 'clear' : IDL.Func([ClearArguments], [], []), - 'commit_batch' : IDL.Func( - [ - IDL.Record({ - 'batch_id' : BatchId, - 'operations' : IDL.Vec(BatchOperationKind), - }), - ], - [], - [], - ), - 'create_asset' : IDL.Func([CreateAssetArguments], [], []), - 'create_batch' : IDL.Func( - [IDL.Record({})], - [IDL.Record({ 'batch_id' : BatchId })], - [], - ), - 'create_chunk' : IDL.Func( - [IDL.Record({ 'content' : IDL.Vec(IDL.Nat8), 'batch_id' : BatchId })], - [IDL.Record({ 'chunk_id' : ChunkId })], - [], - ), - 'delete_asset' : IDL.Func([DeleteAssetArguments], [], []), - 'get' : IDL.Func( - [IDL.Record({ 'key' : Key, 'accept_encodings' : IDL.Vec(IDL.Text) })], - [ - IDL.Record({ - 'content' : IDL.Vec(IDL.Nat8), - 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), - 'content_type' : IDL.Text, - 'content_encoding' : IDL.Text, - 'total_length' : IDL.Nat, - }), - ], - ['query'], - ), - 'get_chunk' : IDL.Func( - [ - IDL.Record({ - 'key' : Key, - 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), - 'index' : IDL.Nat, - 'content_encoding' : IDL.Text, - }), - ], - [IDL.Record({ 'content' : IDL.Vec(IDL.Nat8) })], - ['query'], - ), - 'http_request' : IDL.Func([HttpRequest], [HttpResponse], ['query']), - 'http_request_streaming_callback' : IDL.Func( - [StreamingCallbackToken], - [IDL.Opt(StreamingCallbackHttpResponse)], - ['query'], - ), - 'list' : IDL.Func( - [IDL.Record({})], - [ - IDL.Vec( - IDL.Record({ - 'key' : Key, - 'encodings' : IDL.Vec( - IDL.Record({ - 'modified' : Time, - 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), - 'length' : IDL.Nat, - 'content_encoding' : IDL.Text, - }) - ), - 'content_type' : IDL.Text, - }) - ), - ], - ['query'], - ), - 'set_asset_content' : IDL.Func([SetAssetContentArguments], [], []), - 'store' : IDL.Func( - [ - IDL.Record({ - 'key' : Key, - 'content' : IDL.Vec(IDL.Nat8), - 'sha256' : IDL.Opt(IDL.Vec(IDL.Nat8)), - 'content_type' : IDL.Text, - 'content_encoding' : IDL.Text, - }), - ], - [], - [], - ), - 'unset_asset_content' : IDL.Func([UnsetAssetContentArguments], [], []), - }); -}; -export const init = ({ IDL }) => { return []; }; diff --git a/ui/declarations/hello_assets/hello_assets.js b/ui/declarations/hello_assets/hello_assets.js deleted file mode 100644 index ce730da..0000000 --- a/ui/declarations/hello_assets/hello_assets.js +++ /dev/null @@ -1,3 +0,0 @@ -import idlImport from './hello_assets.did.js'; -export const idlFactory = idlImport; -export const canisterId = "u4gun-5aaaa-aaaah-qabma-cai"; diff --git a/ui/declarations/hello_assets/index.js b/ui/declarations/hello_assets/index.js deleted file mode 100644 index ff9ae49..0000000 --- a/ui/declarations/hello_assets/index.js +++ /dev/null @@ -1,38 +0,0 @@ -import { Actor, HttpAgent } from "@dfinity/agent"; - -// Imports and re-exports candid interface -import { idlFactory } from './hello_assets.did.js'; -export { idlFactory } from './hello_assets.did.js'; -// CANISTER_ID is replaced by webpack based on node environment -export const canisterId = process.env.HELLO_ASSETS_CANISTER_ID; - -/** - * - * @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent - * @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options] - * @return {import("@dfinity/agent").ActorSubclass} - */ - export const createActor = (canisterId, options) => { - const agent = new HttpAgent({ ...options?.agentOptions }); - - // Fetch root key for certificate validation during development - if(process.env.NODE_ENV !== "production") { - agent.fetchRootKey().catch(err=>{ - console.warn("Unable to fetch root key. Check to ensure that your local replica is running"); - console.error(err); - }); - } - - // Creates an actor with using the candid interface and the HttpAgent - return Actor.createActor(idlFactory, { - agent, - canisterId, - ...options?.actorOptions, - }); -}; - -/** - * A ready-to-use agent for the hello_assets canister - * @type {import("@dfinity/agent").ActorSubclass} - */ - export const hello_assets = createActor(canisterId); diff --git a/ui/declarations/image/image.most b/ui/declarations/image/image.most new file mode 100644 index 0000000..767b28c --- /dev/null +++ b/ui/declarations/image/image.most @@ -0,0 +1,21 @@ +// Version: 1.0.0 +type AssocList = List<(K, V)>; +type AssocList__1 = AssocList; +type Branch = {left : Trie; right : Trie; size : Nat}; +type Hash = Nat32; +type ImageId = Text; +type ImageId__2 = ImageId; +type ImageObject = [Nat8]; +type ImageObject__2 = ImageObject; +type Key = {hash : Hash; key : K}; +type Leaf = {keyvals : AssocList__1, V>; size : Nat}; +type List = ?(T, List); +type Trie = {#branch : Branch; #empty; #leaf : Leaf}; +actor { + stable var imageObjectStore : + { + #branch : Branch; + #empty; + #leaf : Leaf + } +};