Skip to content

Commit

Permalink
chore: types generated by dfx 0.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Mar 3, 2023
1 parent acd3152 commit 323e887
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/declarations/cmc/cmc.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/declarations/console/console.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
43 changes: 42 additions & 1 deletion src/declarations/frontend/frontend.did
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
72 changes: 58 additions & 14 deletions src/declarations/frontend/frontend.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,58 @@ export interface CreateAssetArguments {
key: Key;
content_type: string;
headers: [] | [Array<HeaderField>];
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<HeaderField>;
}
export interface HttpResponse {
body: Uint8Array;
body: Uint8Array | number[];
headers: Array<HeaderField>;
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<ChunkId>;
content_encoding: string;
}
export interface SetAssetPropertiesArguments {
key: Key;
headers: [] | [[] | [Array<HeaderField>]];
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;
}
Expand All @@ -60,39 +80,56 @@ 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<BatchOperationKind> }],
undefined
>;
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<string> }],
{
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<HeaderField>];
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],
Expand All @@ -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<Principal>>;
list_permitted: ActorMethod<[ListPermitted], Array<Principal>>;
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>;
}
47 changes: 45 additions & 2 deletions src/declarations/frontend/frontend.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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) })],
Expand All @@ -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({
Expand All @@ -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],
Expand All @@ -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({
Expand All @@ -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 }) => {
Expand Down
Loading

0 comments on commit 323e887

Please sign in to comment.