@junobuild/core 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/actor.api.d.ts +1 -1
- package/dist/types/api/storage.api.d.ts +4 -4
- package/dist/types/services/storage.services.d.ts +3 -3
- package/dist/types/stores/actor.store.d.ts +1 -2
- package/dist/types/types/storage.types.d.ts +2 -2
- package/dist/types/utils/data.utils.d.ts +2 -2
- package/dist/types/utils/doc.utils.d.ts +4 -4
- package/dist/types/utils/list.utils.d.ts +2 -2
- package/package.json +4 -3
- package/dist/declarations/deprecated/console-0-0-14.did.d.ts +0 -267
- package/dist/declarations/deprecated/console-0-0-14.factory.did.js +0 -285
- package/dist/declarations/deprecated/console-0-0-8-patch1.did.d.ts +0 -75
- package/dist/declarations/deprecated/console-0-0-8-patch1.factory.did.js +0 -80
- package/dist/declarations/deprecated/mission_control-0-0-13.did.d.ts +0 -246
- package/dist/declarations/deprecated/mission_control-0-0-13.factory.did.js +0 -280
- package/dist/declarations/deprecated/mission_control-0-0-14.did.d.ts +0 -241
- package/dist/declarations/deprecated/mission_control-0-0-14.factory.did.js +0 -258
- package/dist/declarations/deprecated/mission_control-0-0-4.did.d.ts +0 -80
- package/dist/declarations/deprecated/mission_control-0-0-4.factory.did.js +0 -99
- package/dist/declarations/deprecated/observatory-0-0-9.did.d.ts +0 -70
- package/dist/declarations/deprecated/observatory-0-0-9.factory.did.js +0 -76
- package/dist/declarations/deprecated/orbiter-0-0-6.did.d.ts +0 -161
- package/dist/declarations/deprecated/orbiter-0-0-6.factory.did.js +0 -192
- package/dist/declarations/deprecated/orbiter-0-0-7.did.d.ts +0 -166
- package/dist/declarations/deprecated/orbiter-0-0-7.factory.did.js +0 -197
- package/dist/declarations/deprecated/orbiter-0-0-8.did.d.ts +0 -245
- package/dist/declarations/deprecated/orbiter-0-0-8.factory.did.js +0 -287
- package/dist/declarations/deprecated/orbiter-0-2-0.did.d.ts +0 -277
- package/dist/declarations/deprecated/orbiter-0-2-0.factory.did.js +0 -319
- package/dist/declarations/deprecated/satellite-0-0-16.did.d.ts +0 -240
- package/dist/declarations/deprecated/satellite-0-0-16.factory.did.js +0 -264
- package/dist/declarations/deprecated/satellite-0-0-17.did.d.ts +0 -254
- package/dist/declarations/deprecated/satellite-0-0-17.factory.did.js +0 -281
- package/dist/declarations/deprecated/satellite-0-0-21.did.d.ts +0 -299
- package/dist/declarations/deprecated/satellite-0-0-21.factory.did.js +0 -333
- package/dist/declarations/deprecated/satellite-0-0-22.did.d.ts +0 -290
- package/dist/declarations/deprecated/satellite-0-0-22.factory.did.js +0 -318
- package/dist/declarations/deprecated/satellite-0-0-8.did.d.ts +0 -183
- package/dist/declarations/deprecated/satellite-0-0-8.factory.did.js +0 -194
- package/dist/declarations/deprecated/satellite-0-0-9.did.d.ts +0 -199
- package/dist/declarations/deprecated/satellite-0-0-9.factory.did.js +0 -213
- package/dist/declarations/satellite/satellite.did.d.ts +0 -396
- package/dist/declarations/satellite/satellite.factory.certified.did.js +0 -419
- package/dist/declarations/satellite/satellite.factory.did.js +0 -419
- package/dist/declarations/satellite/satellite.factory.did.mjs +0 -419
- package/dist/declarations/sputnik/sputnik.did.d.ts +0 -396
- package/dist/declarations/sputnik/sputnik.factory.certified.did.js +0 -419
- package/dist/declarations/sputnik/sputnik.factory.did.js +0 -419
- package/dist/types/api/_actor.factory.d.ts +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ActorMethod, ActorSubclass } from '@dfinity/agent';
|
|
2
2
|
import type { IDL } from '@dfinity/candid';
|
|
3
|
+
import { type SatelliteActor } from '@junobuild/ic-client';
|
|
3
4
|
import type { CallOptions } from '../types/call-options';
|
|
4
5
|
import type { SatelliteContext } from '../types/satellite';
|
|
5
|
-
import { type SatelliteActor } from './_actor.factory';
|
|
6
6
|
export declare const getSatelliteActor: ({ satellite, options: { certified } }: {
|
|
7
7
|
satellite: SatelliteContext;
|
|
8
8
|
options: CallOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { SatelliteDid } from '@junobuild/ic-client';
|
|
1
2
|
import { type AssetKey, type UploadAsset } from '@junobuild/storage';
|
|
2
|
-
import type { AssetNoContent } from '../../declarations/satellite/satellite.did';
|
|
3
3
|
import type { ActorReadParams, ActorUpdateParams } from '../types/actor';
|
|
4
4
|
import type { ListParams, ListResults } from '../types/list';
|
|
5
5
|
export declare const uploadAsset: ({ asset, ...rest }: {
|
|
@@ -8,7 +8,7 @@ export declare const uploadAsset: ({ asset, ...rest }: {
|
|
|
8
8
|
export declare const listAssets: ({ collection, filter, ...rest }: {
|
|
9
9
|
collection: string;
|
|
10
10
|
filter: ListParams;
|
|
11
|
-
} & ActorReadParams) => Promise<ListResults<AssetNoContent>>;
|
|
11
|
+
} & ActorReadParams) => Promise<ListResults<SatelliteDid.AssetNoContent>>;
|
|
12
12
|
export declare const countAssets: ({ collection, filter, ...rest }: {
|
|
13
13
|
collection: string;
|
|
14
14
|
filter: ListParams;
|
|
@@ -27,9 +27,9 @@ export declare const deleteFilteredAssets: ({ collection, filter, ...rest }: {
|
|
|
27
27
|
} & ActorUpdateParams) => Promise<void>;
|
|
28
28
|
export declare const getAsset: ({ collection, fullPath, ...rest }: {
|
|
29
29
|
collection: string;
|
|
30
|
-
} & ActorReadParams & Pick<AssetKey, "fullPath">) => Promise<AssetNoContent | undefined>;
|
|
30
|
+
} & ActorReadParams & Pick<AssetKey, "fullPath">) => Promise<SatelliteDid.AssetNoContent | undefined>;
|
|
31
31
|
export declare const getManyAssets: ({ assets, ...rest }: {
|
|
32
32
|
assets: ({
|
|
33
33
|
collection: string;
|
|
34
34
|
} & Pick<AssetKey, "fullPath">)[];
|
|
35
|
-
} & ActorReadParams) => Promise<(AssetNoContent | undefined)[]>;
|
|
35
|
+
} & ActorReadParams) => Promise<(SatelliteDid.AssetNoContent | undefined)[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { SatelliteDid } from '@junobuild/ic-client';
|
|
1
2
|
import type { Asset, AssetKey, Storage } from '@junobuild/storage';
|
|
2
|
-
import type { AssetNoContent } from '../../declarations/satellite/satellite.did';
|
|
3
3
|
import type { ReadOptions } from '../types/call-options';
|
|
4
4
|
import type { ListParams } from '../types/list';
|
|
5
5
|
import type { SatelliteOptions } from '../types/satellite';
|
|
@@ -111,7 +111,7 @@ export declare const getAsset: ({ satellite, options, ...rest }: {
|
|
|
111
111
|
collection: string;
|
|
112
112
|
satellite?: SatelliteOptions;
|
|
113
113
|
options?: ReadOptions;
|
|
114
|
-
} & Pick<AssetKey, "fullPath">) => Promise<AssetNoContent | undefined>;
|
|
114
|
+
} & Pick<AssetKey, "fullPath">) => Promise<SatelliteDid.AssetNoContent | undefined>;
|
|
115
115
|
/**
|
|
116
116
|
* Retrieves multiple assets from the storage.
|
|
117
117
|
*
|
|
@@ -127,7 +127,7 @@ export declare const getManyAssets: ({ satellite, options, ...rest }: {
|
|
|
127
127
|
} & Pick<AssetKey, "fullPath">)[];
|
|
128
128
|
satellite?: SatelliteOptions;
|
|
129
129
|
options?: ReadOptions;
|
|
130
|
-
}) => Promise<(AssetNoContent | undefined)[]>;
|
|
130
|
+
}) => Promise<(SatelliteDid.AssetNoContent | undefined)[]>;
|
|
131
131
|
/**
|
|
132
132
|
* Returns a public URL for accessing a specific asset stored on a Satellite.
|
|
133
133
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type ActorSubclass } from '@dfinity/agent';
|
|
2
|
-
import type { ActorMethod } from '@dfinity/agent/lib/esm/actor';
|
|
1
|
+
import { type ActorMethod, type ActorSubclass } from '@dfinity/agent';
|
|
3
2
|
import type { IDL } from '@dfinity/candid';
|
|
4
3
|
import type { ActorKey } from '../types/actor';
|
|
5
4
|
import type { SatelliteContext } from '../types/satellite';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { SatelliteDid } from '@junobuild/ic-client';
|
|
1
2
|
import type { Asset } from '@junobuild/storage';
|
|
2
|
-
import type { AssetNoContent } from '../../declarations/satellite/satellite.did';
|
|
3
3
|
import type { ListResults } from './list';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a collection of assets with pagination details.
|
|
6
6
|
* @interface
|
|
7
7
|
* @extends {Pick<ListResults<AssetNoContent>, 'items_length' | 'items_page' | 'matches_length' | 'matches_pages'>}
|
|
8
8
|
*/
|
|
9
|
-
export interface Assets extends Omit<ListResults<AssetNoContent>, 'items'> {
|
|
9
|
+
export interface Assets extends Omit<ListResults<SatelliteDid.AssetNoContent>, 'items'> {
|
|
10
10
|
/**
|
|
11
11
|
* The collection of assets.
|
|
12
12
|
* @type {Asset[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const mapData: <D>({ data }: Pick<Doc, "data">) => Promise<D>;
|
|
1
|
+
import type { SatelliteDid } from '@junobuild/ic-client';
|
|
2
|
+
export declare const mapData: <D>({ data }: Pick<SatelliteDid.Doc, "data">) => Promise<D>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SatelliteDid } from '@junobuild/ic-client';
|
|
2
2
|
import type { Doc } from '../types/doc';
|
|
3
|
-
export declare const toSetDoc: <D>(doc: Doc<D>) => Promise<SetDoc>;
|
|
4
|
-
export declare const toDelDoc: <D>(doc: Doc<D>) => DelDoc;
|
|
3
|
+
export declare const toSetDoc: <D>(doc: Doc<D>) => Promise<SatelliteDid.SetDoc>;
|
|
4
|
+
export declare const toDelDoc: <D>(doc: Doc<D>) => SatelliteDid.DelDoc;
|
|
5
5
|
export declare const fromDoc: <D>({ doc, key }: {
|
|
6
|
-
doc:
|
|
6
|
+
doc: SatelliteDid.Doc;
|
|
7
7
|
key: string;
|
|
8
8
|
}) => Promise<Doc<D>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SatelliteDid } from '@junobuild/ic-client';
|
|
2
2
|
import type { ListParams } from '../types/list';
|
|
3
|
-
export declare const toListParams: ({ matcher, paginate, order, owner }: ListParams) =>
|
|
3
|
+
export declare const toListParams: ({ matcher, paginate, order, owner }: ListParams) => SatelliteDid.ListParams;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/core",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "JavaScript core client for Juno",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"rmdir": "node ../../scripts/rmdir.mjs",
|
|
30
30
|
"ts-declaration": "tsc --emitDeclarationOnly --outDir dist/types",
|
|
31
|
-
"build": "npm run rmdir && mkdir -p dist &&
|
|
31
|
+
"build": "npm run rmdir && mkdir -p dist && node esbuild.mjs && npm run ts-declaration",
|
|
32
32
|
"prepack": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"homepage": "https://juno.build",
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@junobuild/errors": "*",
|
|
54
|
-
"@junobuild/
|
|
54
|
+
"@junobuild/ic-client": "^1",
|
|
55
|
+
"@junobuild/storage": "^1",
|
|
55
56
|
"@junobuild/utils": "*"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
-
import type {IDL} from '@dfinity/candid';
|
|
3
|
-
import type {Principal} from '@dfinity/principal';
|
|
4
|
-
|
|
5
|
-
export interface AssertMissionControlCenterArgs {
|
|
6
|
-
mission_control_id: Principal;
|
|
7
|
-
user: Principal;
|
|
8
|
-
}
|
|
9
|
-
export interface AssetEncodingNoContent {
|
|
10
|
-
modified: bigint;
|
|
11
|
-
sha256: Uint8Array | number[];
|
|
12
|
-
total_length: bigint;
|
|
13
|
-
}
|
|
14
|
-
export interface AssetKey {
|
|
15
|
-
token: [] | [string];
|
|
16
|
-
collection: string;
|
|
17
|
-
owner: Principal;
|
|
18
|
-
name: string;
|
|
19
|
-
description: [] | [string];
|
|
20
|
-
full_path: string;
|
|
21
|
-
}
|
|
22
|
-
export interface AssetNoContent {
|
|
23
|
-
key: AssetKey;
|
|
24
|
-
updated_at: bigint;
|
|
25
|
-
encodings: Array<[string, AssetEncodingNoContent]>;
|
|
26
|
-
headers: Array<[string, string]>;
|
|
27
|
-
created_at: bigint;
|
|
28
|
-
version: [] | [bigint];
|
|
29
|
-
}
|
|
30
|
-
export interface AssetsUpgradeOptions {
|
|
31
|
-
clear_existing_assets: [] | [boolean];
|
|
32
|
-
}
|
|
33
|
-
export interface CommitBatch {
|
|
34
|
-
batch_id: bigint;
|
|
35
|
-
headers: Array<[string, string]>;
|
|
36
|
-
chunk_ids: Array<bigint>;
|
|
37
|
-
}
|
|
38
|
-
export interface CommitProposal {
|
|
39
|
-
sha256: Uint8Array | number[];
|
|
40
|
-
proposal_id: bigint;
|
|
41
|
-
}
|
|
42
|
-
export interface Config {
|
|
43
|
-
storage: StorageConfig;
|
|
44
|
-
}
|
|
45
|
-
export interface ConfigMaxMemorySize {
|
|
46
|
-
stable: [] | [bigint];
|
|
47
|
-
heap: [] | [bigint];
|
|
48
|
-
}
|
|
49
|
-
export type ControllerScope = {Write: null} | {Admin: null};
|
|
50
|
-
export interface CreateCanisterArgs {
|
|
51
|
-
block_index: [] | [bigint];
|
|
52
|
-
subnet_id: [] | [Principal];
|
|
53
|
-
user: Principal;
|
|
54
|
-
}
|
|
55
|
-
export interface CustomDomain {
|
|
56
|
-
updated_at: bigint;
|
|
57
|
-
created_at: bigint;
|
|
58
|
-
version: [] | [bigint];
|
|
59
|
-
bn_id: [] | [string];
|
|
60
|
-
}
|
|
61
|
-
export interface DeleteControllersArgs {
|
|
62
|
-
controllers: Array<Principal>;
|
|
63
|
-
}
|
|
64
|
-
export interface DeleteProposalAssets {
|
|
65
|
-
proposal_ids: Array<bigint>;
|
|
66
|
-
}
|
|
67
|
-
export interface GetCreateCanisterFeeArgs {
|
|
68
|
-
user: Principal;
|
|
69
|
-
}
|
|
70
|
-
export interface HttpRequest {
|
|
71
|
-
url: string;
|
|
72
|
-
method: string;
|
|
73
|
-
body: Uint8Array | number[];
|
|
74
|
-
headers: Array<[string, string]>;
|
|
75
|
-
certificate_version: [] | [number];
|
|
76
|
-
}
|
|
77
|
-
export interface HttpResponse {
|
|
78
|
-
body: Uint8Array | number[];
|
|
79
|
-
headers: Array<[string, string]>;
|
|
80
|
-
streaming_strategy: [] | [StreamingStrategy];
|
|
81
|
-
status_code: number;
|
|
82
|
-
}
|
|
83
|
-
export interface InitAssetKey {
|
|
84
|
-
token: [] | [string];
|
|
85
|
-
collection: string;
|
|
86
|
-
name: string;
|
|
87
|
-
description: [] | [string];
|
|
88
|
-
encoding_type: [] | [string];
|
|
89
|
-
full_path: string;
|
|
90
|
-
}
|
|
91
|
-
export interface InitUploadResult {
|
|
92
|
-
batch_id: bigint;
|
|
93
|
-
}
|
|
94
|
-
export interface ListMatcher {
|
|
95
|
-
key: [] | [string];
|
|
96
|
-
updated_at: [] | [TimestampMatcher];
|
|
97
|
-
description: [] | [string];
|
|
98
|
-
created_at: [] | [TimestampMatcher];
|
|
99
|
-
}
|
|
100
|
-
export interface ListOrder {
|
|
101
|
-
field: ListOrderField;
|
|
102
|
-
desc: boolean;
|
|
103
|
-
}
|
|
104
|
-
export type ListOrderField = {UpdatedAt: null} | {Keys: null} | {CreatedAt: null};
|
|
105
|
-
export interface ListPaginate {
|
|
106
|
-
start_after: [] | [string];
|
|
107
|
-
limit: [] | [bigint];
|
|
108
|
-
}
|
|
109
|
-
export interface ListParams {
|
|
110
|
-
order: [] | [ListOrder];
|
|
111
|
-
owner: [] | [Principal];
|
|
112
|
-
matcher: [] | [ListMatcher];
|
|
113
|
-
paginate: [] | [ListPaginate];
|
|
114
|
-
}
|
|
115
|
-
export interface ListResults {
|
|
116
|
-
matches_pages: [] | [bigint];
|
|
117
|
-
matches_length: bigint;
|
|
118
|
-
items_page: [] | [bigint];
|
|
119
|
-
items: Array<[string, AssetNoContent]>;
|
|
120
|
-
items_length: bigint;
|
|
121
|
-
}
|
|
122
|
-
export type Memory = {Heap: null} | {Stable: null};
|
|
123
|
-
export interface MissionControl {
|
|
124
|
-
updated_at: bigint;
|
|
125
|
-
credits: Tokens;
|
|
126
|
-
mission_control_id: [] | [Principal];
|
|
127
|
-
owner: Principal;
|
|
128
|
-
created_at: bigint;
|
|
129
|
-
}
|
|
130
|
-
export interface Payment {
|
|
131
|
-
status: PaymentStatus;
|
|
132
|
-
updated_at: bigint;
|
|
133
|
-
block_index_payment: bigint;
|
|
134
|
-
mission_control_id: [] | [Principal];
|
|
135
|
-
created_at: bigint;
|
|
136
|
-
block_index_refunded: [] | [bigint];
|
|
137
|
-
}
|
|
138
|
-
export type PaymentStatus = {Refunded: null} | {Acknowledged: null} | {Completed: null};
|
|
139
|
-
export interface Proposal {
|
|
140
|
-
status: ProposalStatus;
|
|
141
|
-
updated_at: bigint;
|
|
142
|
-
sha256: [] | [Uint8Array | number[]];
|
|
143
|
-
executed_at: [] | [bigint];
|
|
144
|
-
owner: Principal;
|
|
145
|
-
created_at: bigint;
|
|
146
|
-
version: [] | [bigint];
|
|
147
|
-
proposal_type: ProposalType;
|
|
148
|
-
}
|
|
149
|
-
export type ProposalStatus =
|
|
150
|
-
| {Initialized: null}
|
|
151
|
-
| {Failed: null}
|
|
152
|
-
| {Open: null}
|
|
153
|
-
| {Rejected: null}
|
|
154
|
-
| {Executed: null}
|
|
155
|
-
| {Accepted: null};
|
|
156
|
-
export type ProposalType =
|
|
157
|
-
| {AssetsUpgrade: AssetsUpgradeOptions}
|
|
158
|
-
| {SegmentsDeployment: SegmentsDeploymentOptions};
|
|
159
|
-
export interface RateConfig {
|
|
160
|
-
max_tokens: bigint;
|
|
161
|
-
time_per_token_ns: bigint;
|
|
162
|
-
}
|
|
163
|
-
export type SegmentType = {Orbiter: null} | {MissionControl: null} | {Satellite: null};
|
|
164
|
-
export interface SegmentsDeploymentOptions {
|
|
165
|
-
orbiter: [] | [string];
|
|
166
|
-
mission_control_version: [] | [string];
|
|
167
|
-
satellite_version: [] | [string];
|
|
168
|
-
}
|
|
169
|
-
export interface SetController {
|
|
170
|
-
metadata: Array<[string, string]>;
|
|
171
|
-
scope: ControllerScope;
|
|
172
|
-
expires_at: [] | [bigint];
|
|
173
|
-
}
|
|
174
|
-
export interface SetControllersArgs {
|
|
175
|
-
controller: SetController;
|
|
176
|
-
controllers: Array<Principal>;
|
|
177
|
-
}
|
|
178
|
-
export interface StorageConfig {
|
|
179
|
-
iframe: [] | [StorageConfigIFrame];
|
|
180
|
-
rewrites: Array<[string, string]>;
|
|
181
|
-
headers: Array<[string, Array<[string, string]>]>;
|
|
182
|
-
max_memory_size: [] | [ConfigMaxMemorySize];
|
|
183
|
-
raw_access: [] | [StorageConfigRawAccess];
|
|
184
|
-
redirects: [] | [Array<[string, StorageConfigRedirect]>];
|
|
185
|
-
}
|
|
186
|
-
export type StorageConfigIFrame = {Deny: null} | {AllowAny: null} | {SameOrigin: null};
|
|
187
|
-
export type StorageConfigRawAccess = {Deny: null} | {Allow: null};
|
|
188
|
-
export interface StorageConfigRedirect {
|
|
189
|
-
status_code: number;
|
|
190
|
-
location: string;
|
|
191
|
-
}
|
|
192
|
-
export interface StreamingCallbackHttpResponse {
|
|
193
|
-
token: [] | [StreamingCallbackToken];
|
|
194
|
-
body: Uint8Array | number[];
|
|
195
|
-
}
|
|
196
|
-
export interface StreamingCallbackToken {
|
|
197
|
-
memory: Memory;
|
|
198
|
-
token: [] | [string];
|
|
199
|
-
sha256: [] | [Uint8Array | number[]];
|
|
200
|
-
headers: Array<[string, string]>;
|
|
201
|
-
index: bigint;
|
|
202
|
-
encoding_type: string;
|
|
203
|
-
full_path: string;
|
|
204
|
-
}
|
|
205
|
-
export type StreamingStrategy = {
|
|
206
|
-
Callback: {
|
|
207
|
-
token: StreamingCallbackToken;
|
|
208
|
-
callback: [Principal, string];
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
export type TimestampMatcher =
|
|
212
|
-
| {Equal: bigint}
|
|
213
|
-
| {Between: [bigint, bigint]}
|
|
214
|
-
| {GreaterThan: bigint}
|
|
215
|
-
| {LessThan: bigint};
|
|
216
|
-
export interface Tokens {
|
|
217
|
-
e8s: bigint;
|
|
218
|
-
}
|
|
219
|
-
export interface UploadChunk {
|
|
220
|
-
content: Uint8Array | number[];
|
|
221
|
-
batch_id: bigint;
|
|
222
|
-
order_id: [] | [bigint];
|
|
223
|
-
}
|
|
224
|
-
export interface UploadChunkResult {
|
|
225
|
-
chunk_id: bigint;
|
|
226
|
-
}
|
|
227
|
-
export interface _SERVICE {
|
|
228
|
-
add_credits: ActorMethod<[Principal, Tokens], undefined>;
|
|
229
|
-
add_invitation_code: ActorMethod<[string], undefined>;
|
|
230
|
-
assert_mission_control_center: ActorMethod<[AssertMissionControlCenterArgs], undefined>;
|
|
231
|
-
commit_asset_upload: ActorMethod<[CommitBatch], undefined>;
|
|
232
|
-
commit_proposal: ActorMethod<[CommitProposal], null>;
|
|
233
|
-
create_orbiter: ActorMethod<[CreateCanisterArgs], Principal>;
|
|
234
|
-
create_satellite: ActorMethod<[CreateCanisterArgs], Principal>;
|
|
235
|
-
del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
|
|
236
|
-
del_custom_domain: ActorMethod<[string], undefined>;
|
|
237
|
-
delete_proposal_assets: ActorMethod<[DeleteProposalAssets], undefined>;
|
|
238
|
-
get_config: ActorMethod<[], Config>;
|
|
239
|
-
get_create_orbiter_fee: ActorMethod<[GetCreateCanisterFeeArgs], [] | [Tokens]>;
|
|
240
|
-
get_create_satellite_fee: ActorMethod<[GetCreateCanisterFeeArgs], [] | [Tokens]>;
|
|
241
|
-
get_credits: ActorMethod<[], Tokens>;
|
|
242
|
-
get_proposal: ActorMethod<[bigint], [] | [Proposal]>;
|
|
243
|
-
get_storage_config: ActorMethod<[], StorageConfig>;
|
|
244
|
-
get_user_mission_control_center: ActorMethod<[], [] | [MissionControl]>;
|
|
245
|
-
http_request: ActorMethod<[HttpRequest], HttpResponse>;
|
|
246
|
-
http_request_streaming_callback: ActorMethod<
|
|
247
|
-
[StreamingCallbackToken],
|
|
248
|
-
StreamingCallbackHttpResponse
|
|
249
|
-
>;
|
|
250
|
-
init_asset_upload: ActorMethod<[InitAssetKey, bigint], InitUploadResult>;
|
|
251
|
-
init_proposal: ActorMethod<[ProposalType], [bigint, Proposal]>;
|
|
252
|
-
init_user_mission_control_center: ActorMethod<[], MissionControl>;
|
|
253
|
-
list_assets: ActorMethod<[string, ListParams], ListResults>;
|
|
254
|
-
list_custom_domains: ActorMethod<[], Array<[string, CustomDomain]>>;
|
|
255
|
-
list_payments: ActorMethod<[], Array<[bigint, Payment]>>;
|
|
256
|
-
list_user_mission_control_centers: ActorMethod<[], Array<[Principal, MissionControl]>>;
|
|
257
|
-
set_controllers: ActorMethod<[SetControllersArgs], undefined>;
|
|
258
|
-
set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
|
|
259
|
-
set_fee: ActorMethod<[SegmentType, Tokens], undefined>;
|
|
260
|
-
set_storage_config: ActorMethod<[StorageConfig], undefined>;
|
|
261
|
-
submit_proposal: ActorMethod<[bigint], [bigint, Proposal]>;
|
|
262
|
-
update_rate_config: ActorMethod<[SegmentType, RateConfig], undefined>;
|
|
263
|
-
upload_asset_chunk: ActorMethod<[UploadChunk], UploadChunkResult>;
|
|
264
|
-
version: ActorMethod<[], string>;
|
|
265
|
-
}
|
|
266
|
-
export declare const idlFactory: IDL.InterfaceFactory;
|
|
267
|
-
export declare const init: (args: {IDL: typeof IDL}) => IDL.Type[];
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
export const idlFactory = ({IDL}) => {
|
|
3
|
-
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
4
|
-
const AssertMissionControlCenterArgs = IDL.Record({
|
|
5
|
-
mission_control_id: IDL.Principal,
|
|
6
|
-
user: IDL.Principal
|
|
7
|
-
});
|
|
8
|
-
const CommitBatch = IDL.Record({
|
|
9
|
-
batch_id: IDL.Nat,
|
|
10
|
-
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
11
|
-
chunk_ids: IDL.Vec(IDL.Nat)
|
|
12
|
-
});
|
|
13
|
-
const CommitProposal = IDL.Record({
|
|
14
|
-
sha256: IDL.Vec(IDL.Nat8),
|
|
15
|
-
proposal_id: IDL.Nat
|
|
16
|
-
});
|
|
17
|
-
const CreateCanisterArgs = IDL.Record({
|
|
18
|
-
block_index: IDL.Opt(IDL.Nat64),
|
|
19
|
-
subnet_id: IDL.Opt(IDL.Principal),
|
|
20
|
-
user: IDL.Principal
|
|
21
|
-
});
|
|
22
|
-
const DeleteControllersArgs = IDL.Record({
|
|
23
|
-
controllers: IDL.Vec(IDL.Principal)
|
|
24
|
-
});
|
|
25
|
-
const DeleteProposalAssets = IDL.Record({
|
|
26
|
-
proposal_ids: IDL.Vec(IDL.Nat)
|
|
27
|
-
});
|
|
28
|
-
const StorageConfigIFrame = IDL.Variant({
|
|
29
|
-
Deny: IDL.Null,
|
|
30
|
-
AllowAny: IDL.Null,
|
|
31
|
-
SameOrigin: IDL.Null
|
|
32
|
-
});
|
|
33
|
-
const ConfigMaxMemorySize = IDL.Record({
|
|
34
|
-
stable: IDL.Opt(IDL.Nat64),
|
|
35
|
-
heap: IDL.Opt(IDL.Nat64)
|
|
36
|
-
});
|
|
37
|
-
const StorageConfigRawAccess = IDL.Variant({
|
|
38
|
-
Deny: IDL.Null,
|
|
39
|
-
Allow: IDL.Null
|
|
40
|
-
});
|
|
41
|
-
const StorageConfigRedirect = IDL.Record({
|
|
42
|
-
status_code: IDL.Nat16,
|
|
43
|
-
location: IDL.Text
|
|
44
|
-
});
|
|
45
|
-
const StorageConfig = IDL.Record({
|
|
46
|
-
iframe: IDL.Opt(StorageConfigIFrame),
|
|
47
|
-
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
48
|
-
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
49
|
-
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
50
|
-
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
51
|
-
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
52
|
-
});
|
|
53
|
-
const Config = IDL.Record({storage: StorageConfig});
|
|
54
|
-
const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});
|
|
55
|
-
const ProposalStatus = IDL.Variant({
|
|
56
|
-
Initialized: IDL.Null,
|
|
57
|
-
Failed: IDL.Null,
|
|
58
|
-
Open: IDL.Null,
|
|
59
|
-
Rejected: IDL.Null,
|
|
60
|
-
Executed: IDL.Null,
|
|
61
|
-
Accepted: IDL.Null
|
|
62
|
-
});
|
|
63
|
-
const AssetsUpgradeOptions = IDL.Record({
|
|
64
|
-
clear_existing_assets: IDL.Opt(IDL.Bool)
|
|
65
|
-
});
|
|
66
|
-
const SegmentsDeploymentOptions = IDL.Record({
|
|
67
|
-
orbiter: IDL.Opt(IDL.Text),
|
|
68
|
-
mission_control_version: IDL.Opt(IDL.Text),
|
|
69
|
-
satellite_version: IDL.Opt(IDL.Text)
|
|
70
|
-
});
|
|
71
|
-
const ProposalType = IDL.Variant({
|
|
72
|
-
AssetsUpgrade: AssetsUpgradeOptions,
|
|
73
|
-
SegmentsDeployment: SegmentsDeploymentOptions
|
|
74
|
-
});
|
|
75
|
-
const Proposal = IDL.Record({
|
|
76
|
-
status: ProposalStatus,
|
|
77
|
-
updated_at: IDL.Nat64,
|
|
78
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
79
|
-
executed_at: IDL.Opt(IDL.Nat64),
|
|
80
|
-
owner: IDL.Principal,
|
|
81
|
-
created_at: IDL.Nat64,
|
|
82
|
-
version: IDL.Opt(IDL.Nat64),
|
|
83
|
-
proposal_type: ProposalType
|
|
84
|
-
});
|
|
85
|
-
const MissionControl = IDL.Record({
|
|
86
|
-
updated_at: IDL.Nat64,
|
|
87
|
-
credits: Tokens,
|
|
88
|
-
mission_control_id: IDL.Opt(IDL.Principal),
|
|
89
|
-
owner: IDL.Principal,
|
|
90
|
-
created_at: IDL.Nat64
|
|
91
|
-
});
|
|
92
|
-
const HttpRequest = IDL.Record({
|
|
93
|
-
url: IDL.Text,
|
|
94
|
-
method: IDL.Text,
|
|
95
|
-
body: IDL.Vec(IDL.Nat8),
|
|
96
|
-
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
97
|
-
certificate_version: IDL.Opt(IDL.Nat16)
|
|
98
|
-
});
|
|
99
|
-
const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
|
|
100
|
-
const StreamingCallbackToken = IDL.Record({
|
|
101
|
-
memory: Memory,
|
|
102
|
-
token: IDL.Opt(IDL.Text),
|
|
103
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
104
|
-
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
105
|
-
index: IDL.Nat64,
|
|
106
|
-
encoding_type: IDL.Text,
|
|
107
|
-
full_path: IDL.Text
|
|
108
|
-
});
|
|
109
|
-
const StreamingStrategy = IDL.Variant({
|
|
110
|
-
Callback: IDL.Record({
|
|
111
|
-
token: StreamingCallbackToken,
|
|
112
|
-
callback: IDL.Func([], [], ['query'])
|
|
113
|
-
})
|
|
114
|
-
});
|
|
115
|
-
const HttpResponse = IDL.Record({
|
|
116
|
-
body: IDL.Vec(IDL.Nat8),
|
|
117
|
-
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
118
|
-
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
119
|
-
status_code: IDL.Nat16
|
|
120
|
-
});
|
|
121
|
-
const StreamingCallbackHttpResponse = IDL.Record({
|
|
122
|
-
token: IDL.Opt(StreamingCallbackToken),
|
|
123
|
-
body: IDL.Vec(IDL.Nat8)
|
|
124
|
-
});
|
|
125
|
-
const InitAssetKey = IDL.Record({
|
|
126
|
-
token: IDL.Opt(IDL.Text),
|
|
127
|
-
collection: IDL.Text,
|
|
128
|
-
name: IDL.Text,
|
|
129
|
-
description: IDL.Opt(IDL.Text),
|
|
130
|
-
encoding_type: IDL.Opt(IDL.Text),
|
|
131
|
-
full_path: IDL.Text
|
|
132
|
-
});
|
|
133
|
-
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
134
|
-
const ListOrderField = IDL.Variant({
|
|
135
|
-
UpdatedAt: IDL.Null,
|
|
136
|
-
Keys: IDL.Null,
|
|
137
|
-
CreatedAt: IDL.Null
|
|
138
|
-
});
|
|
139
|
-
const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
|
|
140
|
-
const TimestampMatcher = IDL.Variant({
|
|
141
|
-
Equal: IDL.Nat64,
|
|
142
|
-
Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),
|
|
143
|
-
GreaterThan: IDL.Nat64,
|
|
144
|
-
LessThan: IDL.Nat64
|
|
145
|
-
});
|
|
146
|
-
const ListMatcher = IDL.Record({
|
|
147
|
-
key: IDL.Opt(IDL.Text),
|
|
148
|
-
updated_at: IDL.Opt(TimestampMatcher),
|
|
149
|
-
description: IDL.Opt(IDL.Text),
|
|
150
|
-
created_at: IDL.Opt(TimestampMatcher)
|
|
151
|
-
});
|
|
152
|
-
const ListPaginate = IDL.Record({
|
|
153
|
-
start_after: IDL.Opt(IDL.Text),
|
|
154
|
-
limit: IDL.Opt(IDL.Nat64)
|
|
155
|
-
});
|
|
156
|
-
const ListParams = IDL.Record({
|
|
157
|
-
order: IDL.Opt(ListOrder),
|
|
158
|
-
owner: IDL.Opt(IDL.Principal),
|
|
159
|
-
matcher: IDL.Opt(ListMatcher),
|
|
160
|
-
paginate: IDL.Opt(ListPaginate)
|
|
161
|
-
});
|
|
162
|
-
const AssetKey = IDL.Record({
|
|
163
|
-
token: IDL.Opt(IDL.Text),
|
|
164
|
-
collection: IDL.Text,
|
|
165
|
-
owner: IDL.Principal,
|
|
166
|
-
name: IDL.Text,
|
|
167
|
-
description: IDL.Opt(IDL.Text),
|
|
168
|
-
full_path: IDL.Text
|
|
169
|
-
});
|
|
170
|
-
const AssetEncodingNoContent = IDL.Record({
|
|
171
|
-
modified: IDL.Nat64,
|
|
172
|
-
sha256: IDL.Vec(IDL.Nat8),
|
|
173
|
-
total_length: IDL.Nat
|
|
174
|
-
});
|
|
175
|
-
const AssetNoContent = IDL.Record({
|
|
176
|
-
key: AssetKey,
|
|
177
|
-
updated_at: IDL.Nat64,
|
|
178
|
-
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
179
|
-
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
180
|
-
created_at: IDL.Nat64,
|
|
181
|
-
version: IDL.Opt(IDL.Nat64)
|
|
182
|
-
});
|
|
183
|
-
const ListResults = IDL.Record({
|
|
184
|
-
matches_pages: IDL.Opt(IDL.Nat64),
|
|
185
|
-
matches_length: IDL.Nat64,
|
|
186
|
-
items_page: IDL.Opt(IDL.Nat64),
|
|
187
|
-
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
|
|
188
|
-
items_length: IDL.Nat64
|
|
189
|
-
});
|
|
190
|
-
const CustomDomain = IDL.Record({
|
|
191
|
-
updated_at: IDL.Nat64,
|
|
192
|
-
created_at: IDL.Nat64,
|
|
193
|
-
version: IDL.Opt(IDL.Nat64),
|
|
194
|
-
bn_id: IDL.Opt(IDL.Text)
|
|
195
|
-
});
|
|
196
|
-
const PaymentStatus = IDL.Variant({
|
|
197
|
-
Refunded: IDL.Null,
|
|
198
|
-
Acknowledged: IDL.Null,
|
|
199
|
-
Completed: IDL.Null
|
|
200
|
-
});
|
|
201
|
-
const Payment = IDL.Record({
|
|
202
|
-
status: PaymentStatus,
|
|
203
|
-
updated_at: IDL.Nat64,
|
|
204
|
-
block_index_payment: IDL.Nat64,
|
|
205
|
-
mission_control_id: IDL.Opt(IDL.Principal),
|
|
206
|
-
created_at: IDL.Nat64,
|
|
207
|
-
block_index_refunded: IDL.Opt(IDL.Nat64)
|
|
208
|
-
});
|
|
209
|
-
const ControllerScope = IDL.Variant({
|
|
210
|
-
Write: IDL.Null,
|
|
211
|
-
Admin: IDL.Null
|
|
212
|
-
});
|
|
213
|
-
const SetController = IDL.Record({
|
|
214
|
-
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
215
|
-
scope: ControllerScope,
|
|
216
|
-
expires_at: IDL.Opt(IDL.Nat64)
|
|
217
|
-
});
|
|
218
|
-
const SetControllersArgs = IDL.Record({
|
|
219
|
-
controller: SetController,
|
|
220
|
-
controllers: IDL.Vec(IDL.Principal)
|
|
221
|
-
});
|
|
222
|
-
const SegmentType = IDL.Variant({
|
|
223
|
-
Orbiter: IDL.Null,
|
|
224
|
-
MissionControl: IDL.Null,
|
|
225
|
-
Satellite: IDL.Null
|
|
226
|
-
});
|
|
227
|
-
const RateConfig = IDL.Record({
|
|
228
|
-
max_tokens: IDL.Nat64,
|
|
229
|
-
time_per_token_ns: IDL.Nat64
|
|
230
|
-
});
|
|
231
|
-
const UploadChunk = IDL.Record({
|
|
232
|
-
content: IDL.Vec(IDL.Nat8),
|
|
233
|
-
batch_id: IDL.Nat,
|
|
234
|
-
order_id: IDL.Opt(IDL.Nat)
|
|
235
|
-
});
|
|
236
|
-
const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
|
|
237
|
-
return IDL.Service({
|
|
238
|
-
add_credits: IDL.Func([IDL.Principal, Tokens], [], []),
|
|
239
|
-
add_invitation_code: IDL.Func([IDL.Text], [], []),
|
|
240
|
-
assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
|
|
241
|
-
commit_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
242
|
-
commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
|
|
243
|
-
create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
|
|
244
|
-
create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
|
|
245
|
-
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
246
|
-
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
247
|
-
delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),
|
|
248
|
-
get_config: IDL.Func([], [Config], []),
|
|
249
|
-
get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),
|
|
250
|
-
get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),
|
|
251
|
-
get_credits: IDL.Func([], [Tokens], ['query']),
|
|
252
|
-
get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),
|
|
253
|
-
get_storage_config: IDL.Func([], [StorageConfig], ['query']),
|
|
254
|
-
get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
|
|
255
|
-
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
256
|
-
http_request_streaming_callback: IDL.Func(
|
|
257
|
-
[StreamingCallbackToken],
|
|
258
|
-
[StreamingCallbackHttpResponse],
|
|
259
|
-
['query']
|
|
260
|
-
),
|
|
261
|
-
init_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),
|
|
262
|
-
init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),
|
|
263
|
-
init_user_mission_control_center: IDL.Func([], [MissionControl], []),
|
|
264
|
-
list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
|
|
265
|
-
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
|
|
266
|
-
list_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], ['query']),
|
|
267
|
-
list_user_mission_control_centers: IDL.Func(
|
|
268
|
-
[],
|
|
269
|
-
[IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
|
|
270
|
-
['query']
|
|
271
|
-
),
|
|
272
|
-
set_controllers: IDL.Func([SetControllersArgs], [], []),
|
|
273
|
-
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
274
|
-
set_fee: IDL.Func([SegmentType, Tokens], [], []),
|
|
275
|
-
set_storage_config: IDL.Func([StorageConfig], [], []),
|
|
276
|
-
submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),
|
|
277
|
-
update_rate_config: IDL.Func([SegmentType, RateConfig], [], []),
|
|
278
|
-
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
279
|
-
version: IDL.Func([], [IDL.Text], ['query'])
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
// @ts-ignore
|
|
283
|
-
export const init = ({IDL}) => {
|
|
284
|
-
return [];
|
|
285
|
-
};
|