diff --git a/src/declarations/cmc/cmc.did.d.ts b/src/declarations/cmc/cmc.did.d.ts index f7bf23a62..4a3f141aa 100644 --- a/src/declarations/cmc/cmc.did.d.ts +++ b/src/declarations/cmc/cmc.did.d.ts @@ -14,9 +14,9 @@ export interface IcpXdrConversionRate { timestamp_seconds: bigint; } export interface IcpXdrConversionRateResponse { - certificate: Uint8Array; + certificate: Uint8Array | number[]; data: IcpXdrConversionRate; - hash_tree: Uint8Array; + hash_tree: Uint8Array | number[]; } export interface NotifyCreateCanisterArg { controller: Principal; diff --git a/src/declarations/console/console.did.d.ts b/src/declarations/console/console.did.d.ts index 21e029133..7097451e2 100644 --- a/src/declarations/console/console.did.d.ts +++ b/src/declarations/console/console.did.d.ts @@ -40,7 +40,7 @@ export interface _SERVICE { get_user_mission_control_center: ActorMethod<[], [] | [MissionControl]>; init_user_mission_control_center: ActorMethod<[[] | [string]], MissionControl>; list_user_mission_control_centers: ActorMethod<[], Array<[Principal, MissionControl]>>; - load_release: ActorMethod<[ReleaseType, Uint8Array, string], LoadRelease>; + load_release: ActorMethod<[ReleaseType, Uint8Array | number[], string], LoadRelease>; remove_controllers: ActorMethod<[ControllersArgs], undefined>; reset_release: ActorMethod<[ReleaseType], undefined>; version: ActorMethod<[], string>; diff --git a/src/declarations/frontend/frontend.did b/src/declarations/frontend/frontend.did index a6a58e229..701d34c57 100644 --- a/src/declarations/frontend/frontend.did +++ b/src/declarations/frontend/frontend.did @@ -8,6 +8,8 @@ type CreateAssetArguments = record { content_type: text; max_age: opt nat64; headers: opt vec HeaderField; + enable_aliasing: opt bool; + allow_raw_access: opt bool; }; // Add or change content for an asset, by content encoding @@ -77,8 +79,32 @@ type StreamingStrategy = variant { }; }; -service: { +type SetAssetPropertiesArguments = record { + key: Key; + max_age: opt opt nat64; + headers: opt opt vec HeaderField; + allow_raw_access: opt opt bool; +}; + +type Permission = variant { + Commit; + ManagePermissions; + Prepare; +}; +type GrantPermission = record { + to_principal: principal; + permission: Permission; +}; +type RevokePermission = record { + of_principal: principal; + permission: Permission; +}; +type ListPermitted = record { permission: Permission }; + +type ValidationResult = variant { Ok : text; Err : text }; + +service: { get: (record { key: Key; accept_encodings: vec text; @@ -144,4 +170,19 @@ service: { http_request_streaming_callback: (token: StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query; authorize: (principal) -> (); + deauthorize: (principal) -> (); + list_authorized: () -> (vec principal) query; + grant_permission: (GrantPermission) -> (); + revoke_permission: (RevokePermission) -> (); + list_permitted: (ListPermitted) -> (vec principal) query; + take_ownership: () -> (); + + get_asset_properties : (key: Key) -> (record { + max_age: opt nat64; + headers: opt vec HeaderField; + allow_raw_access: opt bool; } ) query; + set_asset_properties: (SetAssetPropertiesArguments) -> (); + + validate_grant_permission: (GrantPermission) -> (ValidationResult); + validate_revoke_permission: (RevokePermission) -> (ValidationResult); } diff --git a/src/declarations/frontend/frontend.did.d.ts b/src/declarations/frontend/frontend.did.d.ts index 2c95ed71f..2eb2d05ef 100644 --- a/src/declarations/frontend/frontend.did.d.ts +++ b/src/declarations/frontend/frontend.did.d.ts @@ -14,38 +14,58 @@ export interface CreateAssetArguments { key: Key; content_type: string; headers: [] | [Array]; + allow_raw_access: [] | [boolean]; max_age: [] | [bigint]; + enable_aliasing: [] | [boolean]; } export interface DeleteAssetArguments { key: Key; } +export interface GrantPermission { + permission: Permission; + to_principal: Principal; +} export type HeaderField = [string, string]; export interface HttpRequest { url: string; method: string; - body: Uint8Array; + body: Uint8Array | number[]; headers: Array; } export interface HttpResponse { - body: Uint8Array; + body: Uint8Array | number[]; headers: Array; streaming_strategy: [] | [StreamingStrategy]; status_code: number; } export type Key = string; +export interface ListPermitted { + permission: Permission; +} +export type Permission = { Prepare: null } | { ManagePermissions: null } | { Commit: null }; +export interface RevokePermission { + permission: Permission; + of_principal: Principal; +} export interface SetAssetContentArguments { key: Key; - sha256: [] | [Uint8Array]; + sha256: [] | [Uint8Array | number[]]; chunk_ids: Array; content_encoding: string; } +export interface SetAssetPropertiesArguments { + key: Key; + headers: [] | [[] | [Array]]; + allow_raw_access: [] | [[] | [boolean]]; + max_age: [] | [[] | [bigint]]; +} export interface StreamingCallbackHttpResponse { token: [] | [StreamingCallbackToken]; - body: Uint8Array; + body: Uint8Array | number[]; } export interface StreamingCallbackToken { key: Key; - sha256: [] | [Uint8Array]; + sha256: [] | [Uint8Array | number[]]; index: bigint; content_encoding: string; } @@ -60,9 +80,13 @@ export interface UnsetAssetContentArguments { key: Key; content_encoding: string; } +export type ValidationResult = { Ok: string } | { Err: string }; export interface _SERVICE { authorize: ActorMethod<[Principal], undefined>; - certified_tree: ActorMethod<[{}], { certificate: Uint8Array; tree: Uint8Array }>; + certified_tree: ActorMethod< + [{}], + { certificate: Uint8Array | number[]; tree: Uint8Array | number[] } + >; clear: ActorMethod<[ClearArguments], undefined>; commit_batch: ActorMethod< [{ batch_id: BatchId; operations: Array }], @@ -70,29 +94,42 @@ export interface _SERVICE { >; create_asset: ActorMethod<[CreateAssetArguments], undefined>; create_batch: ActorMethod<[{}], { batch_id: BatchId }>; - create_chunk: ActorMethod<[{ content: Uint8Array; batch_id: BatchId }], { chunk_id: ChunkId }>; + create_chunk: ActorMethod< + [{ content: Uint8Array | number[]; batch_id: BatchId }], + { chunk_id: ChunkId } + >; + deauthorize: ActorMethod<[Principal], undefined>; delete_asset: ActorMethod<[DeleteAssetArguments], undefined>; get: ActorMethod< [{ key: Key; accept_encodings: Array }], { - content: Uint8Array; - sha256: [] | [Uint8Array]; + content: Uint8Array | number[]; + sha256: [] | [Uint8Array | number[]]; content_type: string; content_encoding: string; total_length: bigint; } >; + get_asset_properties: ActorMethod< + [Key], + { + headers: [] | [Array]; + allow_raw_access: [] | [boolean]; + max_age: [] | [bigint]; + } + >; get_chunk: ActorMethod< [ { key: Key; - sha256: [] | [Uint8Array]; + sha256: [] | [Uint8Array | number[]]; index: bigint; content_encoding: string; } ], - { content: Uint8Array } + { content: Uint8Array | number[] } >; + grant_permission: ActorMethod<[GrantPermission], undefined>; http_request: ActorMethod<[HttpRequest], HttpResponse>; http_request_streaming_callback: ActorMethod< [StreamingCallbackToken], @@ -104,25 +141,32 @@ export interface _SERVICE { key: Key; encodings: Array<{ modified: Time; - sha256: [] | [Uint8Array]; + sha256: [] | [Uint8Array | number[]]; length: bigint; content_encoding: string; }>; content_type: string; }> >; + list_authorized: ActorMethod<[], Array>; + list_permitted: ActorMethod<[ListPermitted], Array>; + revoke_permission: ActorMethod<[RevokePermission], undefined>; set_asset_content: ActorMethod<[SetAssetContentArguments], undefined>; + set_asset_properties: ActorMethod<[SetAssetPropertiesArguments], undefined>; store: ActorMethod< [ { key: Key; - content: Uint8Array; - sha256: [] | [Uint8Array]; + content: Uint8Array | number[]; + sha256: [] | [Uint8Array | number[]]; content_type: string; content_encoding: string; } ], undefined >; + take_ownership: ActorMethod<[], undefined>; unset_asset_content: ActorMethod<[UnsetAssetContentArguments], undefined>; + validate_grant_permission: ActorMethod<[GrantPermission], ValidationResult>; + validate_revoke_permission: ActorMethod<[RevokePermission], ValidationResult>; } diff --git a/src/declarations/frontend/frontend.factory.did.js b/src/declarations/frontend/frontend.factory.did.js index 756eb7545..ff3ab1217 100644 --- a/src/declarations/frontend/frontend.factory.did.js +++ b/src/declarations/frontend/frontend.factory.did.js @@ -7,7 +7,9 @@ export const idlFactory = ({ IDL }) => { key: Key, content_type: IDL.Text, headers: IDL.Opt(IDL.Vec(HeaderField)), - max_age: IDL.Opt(IDL.Nat64) + allow_raw_access: IDL.Opt(IDL.Bool), + max_age: IDL.Opt(IDL.Nat64), + enable_aliasing: IDL.Opt(IDL.Bool) }); const UnsetAssetContentArguments = IDL.Record({ key: Key, @@ -28,6 +30,15 @@ export const idlFactory = ({ IDL }) => { SetAssetContent: SetAssetContentArguments, Clear: ClearArguments }); + const Permission = IDL.Variant({ + Prepare: IDL.Null, + ManagePermissions: IDL.Null, + Commit: IDL.Null + }); + const GrantPermission = IDL.Record({ + permission: Permission, + to_principal: IDL.Principal + }); const HttpRequest = IDL.Record({ url: IDL.Text, method: IDL.Text, @@ -61,6 +72,18 @@ export const idlFactory = ({ IDL }) => { status_code: IDL.Nat16 }); const Time = IDL.Int; + const ListPermitted = IDL.Record({ permission: Permission }); + const RevokePermission = IDL.Record({ + permission: Permission, + of_principal: IDL.Principal + }); + const SetAssetPropertiesArguments = IDL.Record({ + key: Key, + headers: IDL.Opt(IDL.Opt(IDL.Vec(HeaderField))), + allow_raw_access: IDL.Opt(IDL.Opt(IDL.Bool)), + max_age: IDL.Opt(IDL.Opt(IDL.Nat64)) + }); + const ValidationResult = IDL.Variant({ Ok: IDL.Text, Err: IDL.Text }); return IDL.Service({ authorize: IDL.Func([IDL.Principal], [], []), certified_tree: IDL.Func( @@ -91,6 +114,7 @@ export const idlFactory = ({ IDL }) => { [IDL.Record({ chunk_id: ChunkId })], [] ), + deauthorize: IDL.Func([IDL.Principal], [], []), delete_asset: IDL.Func([DeleteAssetArguments], [], []), get: IDL.Func( [IDL.Record({ key: Key, accept_encodings: IDL.Vec(IDL.Text) })], @@ -105,6 +129,17 @@ export const idlFactory = ({ IDL }) => { ], ['query'] ), + get_asset_properties: IDL.Func( + [Key], + [ + IDL.Record({ + headers: IDL.Opt(IDL.Vec(HeaderField)), + allow_raw_access: IDL.Opt(IDL.Bool), + max_age: IDL.Opt(IDL.Nat64) + }) + ], + ['query'] + ), get_chunk: IDL.Func( [ IDL.Record({ @@ -117,6 +152,7 @@ export const idlFactory = ({ IDL }) => { [IDL.Record({ content: IDL.Vec(IDL.Nat8) })], ['query'] ), + grant_permission: IDL.Func([GrantPermission], [], []), http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']), http_request_streaming_callback: IDL.Func( [StreamingCallbackToken], @@ -143,7 +179,11 @@ export const idlFactory = ({ IDL }) => { ], ['query'] ), + list_authorized: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']), + list_permitted: IDL.Func([ListPermitted], [IDL.Vec(IDL.Principal)], ['query']), + revoke_permission: IDL.Func([RevokePermission], [], []), set_asset_content: IDL.Func([SetAssetContentArguments], [], []), + set_asset_properties: IDL.Func([SetAssetPropertiesArguments], [], []), store: IDL.Func( [ IDL.Record({ @@ -157,7 +197,10 @@ export const idlFactory = ({ IDL }) => { [], [] ), - unset_asset_content: IDL.Func([UnsetAssetContentArguments], [], []) + take_ownership: IDL.Func([], [], []), + unset_asset_content: IDL.Func([UnsetAssetContentArguments], [], []), + validate_grant_permission: IDL.Func([GrantPermission], [ValidationResult], []), + validate_revoke_permission: IDL.Func([RevokePermission], [ValidationResult], []) }); }; export const init = ({ IDL }) => { diff --git a/src/declarations/internet_identity/internet_identity.did.d.ts b/src/declarations/internet_identity/internet_identity.did.d.ts index 5066b7db7..6854ea022 100644 --- a/src/declarations/internet_identity/internet_identity.did.d.ts +++ b/src/declarations/internet_identity/internet_identity.did.d.ts @@ -16,7 +16,7 @@ export interface ArchiveConfig { polling_interval_ns: bigint; entries_buffer_limit: bigint; archive_integration: [] | [{ pull: null } | { push: null }]; - module_hash: Uint8Array; + module_hash: Uint8Array | number[]; entries_fetch_limit: number; } export interface ArchiveInfo { @@ -25,7 +25,7 @@ export interface ArchiveInfo { } export interface BufferedArchiveEntry { sequence_number: bigint; - entry: Uint8Array; + entry: Uint8Array | number[]; anchor_number: UserNumber; timestamp: Timestamp; } @@ -38,7 +38,7 @@ export interface ChallengeResult { key: ChallengeKey; chars: string; } -export type CredentialId = Uint8Array; +export type CredentialId = Uint8Array | number[]; export interface Delegation { pubkey: PublicKey; targets: [] | [Array]; @@ -70,11 +70,11 @@ export type HeaderField = [string, string]; export interface HttpRequest { url: string; method: string; - body: Uint8Array; + body: Uint8Array | number[]; headers: Array; } export interface HttpResponse { - body: Uint8Array; + body: Uint8Array | number[]; headers: Array; streaming_strategy: [] | [StreamingStrategy]; status_code: number; @@ -101,7 +101,7 @@ export type KeyType = | { seed_phrase: null } | { cross_platform: null } | { unknown: null }; -export type PublicKey = Uint8Array; +export type PublicKey = Uint8Array | number[]; export type Purpose = { authentication: null } | { recovery: null }; export type RegisterResponse = | { bad_challenge: null } @@ -109,12 +109,12 @@ export type RegisterResponse = | { registered: { user_number: UserNumber } }; export type SessionKey = PublicKey; export interface SignedDelegation { - signature: Uint8Array; + signature: Uint8Array | number[]; delegation: Delegation; } export interface StreamingCallbackHttpResponse { token: [] | [Token]; - body: Uint8Array; + body: Uint8Array | number[]; } export type StreamingStrategy = { Callback: { token: Token; callback: [Principal, string] }; @@ -135,7 +135,7 @@ export interface _SERVICE { add: ActorMethod<[UserNumber, DeviceData], undefined>; add_tentative_device: ActorMethod<[UserNumber, DeviceData], AddTentativeDeviceResponse>; create_challenge: ActorMethod<[], Challenge>; - deploy_archive: ActorMethod<[Uint8Array], DeployArchiveResult>; + deploy_archive: ActorMethod<[Uint8Array | number[]], DeployArchiveResult>; enter_device_registration_mode: ActorMethod<[UserNumber], Timestamp>; exit_device_registration_mode: ActorMethod<[UserNumber], undefined>; fetch_entries: ActorMethod<[], Array>; diff --git a/src/declarations/ledger/ledger.did.d.ts b/src/declarations/ledger/ledger.did.d.ts index 36b820ba9..1914b57ff 100644 --- a/src/declarations/ledger/ledger.did.d.ts +++ b/src/declarations/ledger/ledger.did.d.ts @@ -4,7 +4,7 @@ import type { Principal } from '@dfinity/principal'; export interface AccountBalanceArgs { account: AccountIdentifier; } -export type AccountIdentifier = Uint8Array; +export type AccountIdentifier = Uint8Array | number[]; export interface Archive { canister_id: Principal; } @@ -14,7 +14,7 @@ export interface Archives { export interface Block { transaction: Transaction; timestamp: TimeStamp; - parent_hash: [] | [Uint8Array]; + parent_hash: [] | [Uint8Array | number[]]; } export type BlockIndex = bigint; export interface BlockRange { @@ -49,13 +49,13 @@ export type QueryArchiveError = export type QueryArchiveFn = ActorMethod<[GetBlocksArgs], QueryArchiveResult>; export type QueryArchiveResult = { Ok: BlockRange } | { Err: QueryArchiveError }; export interface QueryBlocksResponse { - certificate: [] | [Uint8Array]; + certificate: [] | [Uint8Array | number[]]; blocks: Array; chain_length: bigint; first_block_index: BlockIndex; archived_blocks: Array<{ callback: QueryArchiveFn; start: BlockIndex; length: bigint }>; } -export type SubAccount = Uint8Array; +export type SubAccount = Uint8Array | number[]; export interface TimeStamp { timestamp_nanos: bigint; } diff --git a/src/declarations/satellite/satellite.did.d.ts b/src/declarations/satellite/satellite.did.d.ts index f589b6136..f14af3ca1 100644 --- a/src/declarations/satellite/satellite.did.d.ts +++ b/src/declarations/satellite/satellite.did.d.ts @@ -3,7 +3,7 @@ import type { Principal } from '@dfinity/principal'; export interface AssetEncodingNoContent { modified: bigint; - sha256: Uint8Array; + sha256: Uint8Array | number[]; total_length: bigint; } export interface AssetKey { @@ -21,7 +21,7 @@ export interface AssetNoContent { created_at: bigint; } export interface Chunk { - content: Uint8Array; + content: Uint8Array | number[]; batch_id: bigint; } export interface CommitBatch { @@ -46,17 +46,17 @@ export interface DelDoc { export interface Doc { updated_at: bigint; owner: Principal; - data: Uint8Array; + data: Uint8Array | number[]; created_at: bigint; } export interface HttpRequest { url: string; method: string; - body: Uint8Array; + body: Uint8Array | number[]; headers: Array<[string, string]>; } export interface HttpResponse { - body: Uint8Array; + body: Uint8Array | number[]; headers: Array<[string, string]>; streaming_strategy: [] | [StreamingStrategy]; status_code: number; @@ -110,7 +110,7 @@ export interface Rule { export type RulesType = { Db: null } | { Storage: null }; export interface SetDoc { updated_at: [] | [bigint]; - data: Uint8Array; + data: Uint8Array | number[]; } export interface SetRule { updated_at: [] | [bigint]; @@ -123,11 +123,11 @@ export interface StorageConfig { } export interface StreamingCallbackHttpResponse { token: [] | [StreamingCallbackToken]; - body: Uint8Array; + body: Uint8Array | number[]; } export interface StreamingCallbackToken { token: [] | [string]; - sha256: [] | [Uint8Array]; + sha256: [] | [Uint8Array | number[]]; headers: Array<[string, string]>; index: bigint; encoding_type: string;