@junobuild/cli 0.4.0 → 0.5.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The Juno command-line interface",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"format": "prettier . --write",
|
|
20
20
|
"format:check": "prettier --check .",
|
|
21
21
|
"build": "tsc --noEmit && node ./scripts/rmdir.mjs && node ./scripts/esbuild.mjs",
|
|
22
|
-
"dev": "node ./scripts/rmdir.mjs && NODE_ENV=development node ./scripts/esbuild.mjs",
|
|
23
22
|
"lint": "eslint --max-warnings 0 \"src/**/*\"",
|
|
24
23
|
"prepublishOnly": "./scripts/prepublish.sh"
|
|
25
24
|
},
|
|
@@ -30,12 +29,14 @@
|
|
|
30
29
|
"@dfinity/ic-management": "^6.1.1",
|
|
31
30
|
"@dfinity/identity": "^2.3.0",
|
|
32
31
|
"@dfinity/principal": "^2.3.0",
|
|
33
|
-
"@junobuild/admin": "^0.
|
|
34
|
-
"@junobuild/
|
|
32
|
+
"@junobuild/admin": "^0.5.0",
|
|
33
|
+
"@junobuild/cdn": "^0.1.1",
|
|
34
|
+
"@junobuild/cli-tools": "^0.2.1",
|
|
35
35
|
"@junobuild/config": "^0.1.8",
|
|
36
36
|
"@junobuild/config-loader": "^0.2.1",
|
|
37
|
-
"@junobuild/core": "^0.1.
|
|
37
|
+
"@junobuild/core": "^0.1.15",
|
|
38
38
|
"@junobuild/did-tools": "^0.2.1",
|
|
39
|
+
"@junobuild/storage": "^0.2.0",
|
|
39
40
|
"@junobuild/utils": "^0.1.3",
|
|
40
41
|
"chokidar": "^4.0.3",
|
|
41
42
|
"conf": "^13.1.0",
|
|
@@ -43,22 +44,21 @@
|
|
|
43
44
|
"ora": "^8.2.0",
|
|
44
45
|
"portfinder": "^1.0.37",
|
|
45
46
|
"prompts": "^2.4.2",
|
|
46
|
-
"semver": "^7.7.
|
|
47
|
+
"semver": "^7.7.2",
|
|
47
48
|
"terminal-link": "^4.0.0"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@eslint/eslintrc": "^3.3.1",
|
|
51
|
-
"@eslint/js": "^9.
|
|
52
|
-
"@junobuild/functions": "^0.1.
|
|
53
|
-
"@types/node": "^22.15.
|
|
52
|
+
"@eslint/js": "^9.27.0",
|
|
53
|
+
"@junobuild/functions": "^0.1.1",
|
|
54
|
+
"@types/node": "^22.15.27",
|
|
54
55
|
"@types/prompts": "^2.4.9",
|
|
55
56
|
"@types/semver": "^7.7.0",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"eslint": "^
|
|
59
|
-
"eslint-config-
|
|
60
|
-
"
|
|
61
|
-
"globals": "^16.0.0",
|
|
57
|
+
"esbuild": "^0.25.5",
|
|
58
|
+
"eslint": "^9.27.0",
|
|
59
|
+
"eslint-config-love": "^120.0.0",
|
|
60
|
+
"eslint-config-prettier": "^10.1.5",
|
|
61
|
+
"globals": "^16.2.0",
|
|
62
62
|
"prettier": "^3.5.3",
|
|
63
63
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
64
64
|
"typescript": "^5.8.3"
|
|
@@ -19,6 +19,7 @@ type AssetNoContent = record {
|
|
|
19
19
|
created_at : nat64;
|
|
20
20
|
version : opt nat64;
|
|
21
21
|
};
|
|
22
|
+
type AssetsUpgradeOptions = record { clear_existing_assets : opt bool };
|
|
22
23
|
type AuthenticationConfig = record {
|
|
23
24
|
internet_identity : opt AuthenticationConfigInternetIdentity;
|
|
24
25
|
};
|
|
@@ -32,6 +33,7 @@ type CommitBatch = record {
|
|
|
32
33
|
headers : vec record { text; text };
|
|
33
34
|
chunk_ids : vec nat;
|
|
34
35
|
};
|
|
36
|
+
type CommitProposal = record { sha256 : blob; proposal_id : nat };
|
|
35
37
|
type Config = record {
|
|
36
38
|
db : opt DbConfig;
|
|
37
39
|
authentication : opt AuthenticationConfig;
|
|
@@ -45,7 +47,7 @@ type Controller = record {
|
|
|
45
47
|
scope : ControllerScope;
|
|
46
48
|
expires_at : opt nat64;
|
|
47
49
|
};
|
|
48
|
-
type ControllerScope = variant { Write; Admin };
|
|
50
|
+
type ControllerScope = variant { Write; Admin; Submit };
|
|
49
51
|
type CustomDomain = record {
|
|
50
52
|
updated_at : nat64;
|
|
51
53
|
created_at : nat64;
|
|
@@ -56,6 +58,7 @@ type DbConfig = record { max_memory_size : opt ConfigMaxMemorySize };
|
|
|
56
58
|
type DelDoc = record { version : opt nat64 };
|
|
57
59
|
type DelRule = record { version : opt nat64 };
|
|
58
60
|
type DeleteControllersArgs = record { controllers : vec principal };
|
|
61
|
+
type DeleteProposalAssets = record { proposal_ids : vec nat };
|
|
59
62
|
type DepositCyclesArgs = record { cycles : nat; destination_id : principal };
|
|
60
63
|
type Doc = record {
|
|
61
64
|
updated_at : nat64;
|
|
@@ -102,6 +105,17 @@ type ListParams = record {
|
|
|
102
105
|
matcher : opt ListMatcher;
|
|
103
106
|
paginate : opt ListPaginate;
|
|
104
107
|
};
|
|
108
|
+
type ListProposalResults = record {
|
|
109
|
+
matches_length : nat64;
|
|
110
|
+
items : vec record { ProposalKey; Proposal };
|
|
111
|
+
items_length : nat64;
|
|
112
|
+
};
|
|
113
|
+
type ListProposalsOrder = record { desc : bool };
|
|
114
|
+
type ListProposalsPaginate = record { start_after : opt nat; limit : opt nat };
|
|
115
|
+
type ListProposalsParams = record {
|
|
116
|
+
order : opt ListProposalsOrder;
|
|
117
|
+
paginate : opt ListProposalsPaginate;
|
|
118
|
+
};
|
|
105
119
|
type ListResults = record {
|
|
106
120
|
matches_pages : opt nat64;
|
|
107
121
|
matches_length : nat64;
|
|
@@ -116,9 +130,39 @@ type ListResults_1 = record {
|
|
|
116
130
|
items : vec record { text; Doc };
|
|
117
131
|
items_length : nat64;
|
|
118
132
|
};
|
|
133
|
+
type ListRulesMatcher = record { include_system : bool };
|
|
134
|
+
type ListRulesParams = record { matcher : opt ListRulesMatcher };
|
|
135
|
+
type ListRulesResults = record {
|
|
136
|
+
matches_length : nat64;
|
|
137
|
+
items : vec record { text; Rule };
|
|
138
|
+
items_length : nat64;
|
|
139
|
+
};
|
|
119
140
|
type Memory = variant { Heap; Stable };
|
|
120
141
|
type MemorySize = record { stable : nat64; heap : nat64 };
|
|
121
142
|
type Permission = variant { Controllers; Private; Public; Managed };
|
|
143
|
+
type Proposal = record {
|
|
144
|
+
status : ProposalStatus;
|
|
145
|
+
updated_at : nat64;
|
|
146
|
+
sha256 : opt blob;
|
|
147
|
+
executed_at : opt nat64;
|
|
148
|
+
owner : principal;
|
|
149
|
+
created_at : nat64;
|
|
150
|
+
version : opt nat64;
|
|
151
|
+
proposal_type : ProposalType;
|
|
152
|
+
};
|
|
153
|
+
type ProposalKey = record { proposal_id : nat };
|
|
154
|
+
type ProposalStatus = variant {
|
|
155
|
+
Initialized;
|
|
156
|
+
Failed;
|
|
157
|
+
Open;
|
|
158
|
+
Rejected;
|
|
159
|
+
Executed;
|
|
160
|
+
Accepted;
|
|
161
|
+
};
|
|
162
|
+
type ProposalType = variant {
|
|
163
|
+
AssetsUpgrade : AssetsUpgradeOptions;
|
|
164
|
+
SegmentsDeployment : SegmentsDeploymentOptions;
|
|
165
|
+
};
|
|
122
166
|
type RateConfig = record { max_tokens : nat64; time_per_token_ns : nat64 };
|
|
123
167
|
type Rule = record {
|
|
124
168
|
max_capacity : opt nat32;
|
|
@@ -133,6 +177,11 @@ type Rule = record {
|
|
|
133
177
|
write : Permission;
|
|
134
178
|
max_changes_per_user : opt nat32;
|
|
135
179
|
};
|
|
180
|
+
type SegmentsDeploymentOptions = record {
|
|
181
|
+
orbiter : opt text;
|
|
182
|
+
mission_control_version : opt text;
|
|
183
|
+
satellite_version : opt text;
|
|
184
|
+
};
|
|
136
185
|
type SetController = record {
|
|
137
186
|
metadata : vec record { text; text };
|
|
138
187
|
scope : ControllerScope;
|
|
@@ -202,10 +251,13 @@ type UploadChunk = record {
|
|
|
202
251
|
type UploadChunkResult = record { chunk_id : nat };
|
|
203
252
|
service : () -> {
|
|
204
253
|
commit_asset_upload : (CommitBatch) -> ();
|
|
254
|
+
commit_proposal : (CommitProposal) -> (null);
|
|
255
|
+
commit_proposal_asset_upload : (CommitBatch) -> ();
|
|
205
256
|
count_assets : (text, ListParams) -> (nat64) query;
|
|
206
257
|
count_collection_assets : (text) -> (nat64) query;
|
|
207
258
|
count_collection_docs : (text) -> (nat64) query;
|
|
208
259
|
count_docs : (text, ListParams) -> (nat64) query;
|
|
260
|
+
count_proposals : () -> (nat64) query;
|
|
209
261
|
del_asset : (text, text) -> ();
|
|
210
262
|
del_assets : (text) -> ();
|
|
211
263
|
del_controllers : (DeleteControllersArgs) -> (
|
|
@@ -219,6 +271,7 @@ service : () -> {
|
|
|
219
271
|
del_many_assets : (vec record { text; text }) -> ();
|
|
220
272
|
del_many_docs : (vec record { text; text; DelDoc }) -> ();
|
|
221
273
|
del_rule : (CollectionType, text, DelRule) -> ();
|
|
274
|
+
delete_proposal_assets : (DeleteProposalAssets) -> ();
|
|
222
275
|
deposit_cycles : (DepositCyclesArgs) -> ();
|
|
223
276
|
get_asset : (text, text) -> (opt AssetNoContent) query;
|
|
224
277
|
get_auth_config : () -> (opt AuthenticationConfig) query;
|
|
@@ -231,6 +284,7 @@ service : () -> {
|
|
|
231
284
|
get_many_docs : (vec record { text; text }) -> (
|
|
232
285
|
vec record { text; opt Doc },
|
|
233
286
|
) query;
|
|
287
|
+
get_proposal : (nat) -> (opt Proposal) query;
|
|
234
288
|
get_rule : (CollectionType, text) -> (opt Rule) query;
|
|
235
289
|
get_storage_config : () -> (StorageConfig) query;
|
|
236
290
|
http_request : (HttpRequest) -> (HttpResponse) query;
|
|
@@ -238,12 +292,16 @@ service : () -> {
|
|
|
238
292
|
StreamingCallbackHttpResponse,
|
|
239
293
|
) query;
|
|
240
294
|
init_asset_upload : (InitAssetKey) -> (InitUploadResult);
|
|
295
|
+
init_proposal : (ProposalType) -> (nat, Proposal);
|
|
296
|
+
init_proposal_asset_upload : (InitAssetKey, nat) -> (InitUploadResult);
|
|
241
297
|
list_assets : (text, ListParams) -> (ListResults) query;
|
|
242
298
|
list_controllers : () -> (vec record { principal; Controller }) query;
|
|
243
299
|
list_custom_domains : () -> (vec record { text; CustomDomain }) query;
|
|
244
300
|
list_docs : (text, ListParams) -> (ListResults_1) query;
|
|
245
|
-
|
|
301
|
+
list_proposals : (ListProposalsParams) -> (ListProposalResults) query;
|
|
302
|
+
list_rules : (CollectionType, ListRulesParams) -> (ListRulesResults) query;
|
|
246
303
|
memory_size : () -> (MemorySize) query;
|
|
304
|
+
reject_proposal : (CommitProposal) -> (null);
|
|
247
305
|
set_auth_config : (AuthenticationConfig) -> ();
|
|
248
306
|
set_controllers : (SetControllersArgs) -> (
|
|
249
307
|
vec record { principal; Controller },
|
|
@@ -256,6 +314,7 @@ service : () -> {
|
|
|
256
314
|
);
|
|
257
315
|
set_rule : (CollectionType, text, SetRule) -> (Rule);
|
|
258
316
|
set_storage_config : (StorageConfig) -> ();
|
|
317
|
+
submit_proposal : (nat) -> (nat, Proposal);
|
|
259
318
|
upload_asset_chunk : (UploadChunk) -> (UploadChunkResult);
|
|
260
|
-
|
|
319
|
+
upload_proposal_asset_chunk : (UploadChunk) -> (UploadChunkResult);
|
|
261
320
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type OnDeleteManyDocs,
|
|
14
14
|
type OnSetDoc,
|
|
15
15
|
type OnSetManyDocs,
|
|
16
|
-
OnUploadAsset
|
|
16
|
+
type OnUploadAsset
|
|
17
17
|
} from '@junobuild/functions';
|
|
18
18
|
|
|
19
19
|
// All the available hooks and assertions for your Datastore and Storage are scaffolded by default in this module.
|