@junobuild/cli 0.0.77 → 0.0.78

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/index.js CHANGED
@@ -638,7 +638,7 @@ Are you sure the folder containing your built app (the "source" tag in the confi
638
638
  ${r}`,"utf-8")},Lxe=async()=>{await Bxe(JU,{recursive:!0}),await La({command:"ic-wasm",args:[nd(YU,"satellite.wasm"),"-o",Sa,"shrink"]}),await La({command:"ic-wasm",args:[Sa,"-o",Sa,"metadata","candid:service","-f",ZU,"-v","public"]}),await La({command:"ic-wasm",args:[Sa,"-o",Sa,"metadata","juno:build","-d","extended","-v","public"]}),await La({command:"ic-wasm",args:[Sa,"-o",Sa,"metadata","supported_certificate_versions","-d",'"1,2"',"-v","public"]})},$xe=async e=>{let t=`${Sa}.gz`,{size:r}=await Fxe(t),n=i=>Intl.NumberFormat("en-US",{maximumSignificantDigits:2}).format(i/(1024*1024));e.succeed(`${(0,xl.green)("Success!")}
639
639
 
640
640
  The satellite has been compiled.
641
- Output file: ${(0,xl.yellow)(`${Rxe(process.cwd(),t)}`)} ${(0,xl.grey)(`(${n(r)}MB)`)}`)},Uxe=async()=>{let{valid:e}=await WU();return e===!1?{valid:e}:(e==="error"&&(await Di(`The ${(0,xl.magenta)("ic-wasm")} ${(0,xl.yellow)(`v${sh}`)} tool is required to build a satellite but appears to be not available. Would you like to install it on your machine?`),await Jl({command:"cargo",args:["install",`ic-wasm@${sh}`]})),{valid:!0})},qxe=async()=>{let{valid:e}=await KU();return e===!1?{valid:e}:(e==="error"&&(await Di(`The ${(0,xl.magenta)("candid-extractor")} tool is required to generate the API ("did file") of your custom satellite but appears to be not available. Would you like to install it on your machine?`),await Jl({command:"cargo",args:["install","candid-extractor"]})),{valid:!0})};var nq=St(Gt(),1);import{existsSync as Vxe}from"node:fs";import{writeFile as Gxe}from"node:fs/promises";import{basename as Hxe,join as Wxe}from"node:path";var dD={filename:_b},eq=async()=>await ev(dD),tq=()=>tv(dD),rq=()=>Gf(dD);var iq="../templates/docker",sq=process.cwd(),aq=async()=>{let{valid:e}=await cD();e==="error"||!e||(await pD(),await Kxe(),await Yxe(),await Jl({command:"docker",args:["compose","up"]}))},oq=async()=>{let{valid:e}=await cD();e==="error"||!e||(await pD(),await Jl({command:"docker",args:["compose","stop"]}))},Kxe=async()=>{if(await eq())return;await Di("A config file is required for development. Would you like the CLI to create one for you?");let{configType:e,configPath:t}=await zxe();await Vc({template:`${_b}.${e}`,sourceFolder:iq,destinationFolder:sq,...or(t)&&{destinationFilename:t}})},zxe=async()=>{let e=tq();return or(e)?e:{configType:await jv()}},Yxe=async()=>{if(Vxe("docker-compose.yml"))return;await Di(`The CLI utilizes Docker Compose, which is handy for customizing configurations. Would you like the CLI to generate a default ${(0,nq.magenta)("docker-compose.yml")} file for you?`);let e=await Hf({template:"docker-compose.yml",sourceFolder:iq}),{configPath:t}=rq(),r=Hxe(t),n=e.replaceAll("<JUNO_DEV_CONFIG>",r);await Gxe(Wxe(sq,"docker-compose.yml"),n,"utf-8")};var Yc=St(Gt(),1);import{mkdir as Zxe}from"node:fs/promises";import{join as bq}from"node:path";var Tt=St(Gt(),1);var qv="0.0.77";var Xxe=` __ __ __ __ _ ____
641
+ Output file: ${(0,xl.yellow)(`${Rxe(process.cwd(),t)}`)} ${(0,xl.grey)(`(${n(r)}MB)`)}`)},Uxe=async()=>{let{valid:e}=await WU();return e===!1?{valid:e}:(e==="error"&&(await Di(`The ${(0,xl.magenta)("ic-wasm")} ${(0,xl.yellow)(`v${sh}`)} tool is required to build a satellite but appears to be not available. Would you like to install it on your machine?`),await Jl({command:"cargo",args:["install",`ic-wasm@${sh}`]})),{valid:!0})},qxe=async()=>{let{valid:e}=await KU();return e===!1?{valid:e}:(e==="error"&&(await Di(`The ${(0,xl.magenta)("candid-extractor")} tool is required to generate the API ("did file") of your custom satellite but appears to be not available. Would you like to install it on your machine?`),await Jl({command:"cargo",args:["install","candid-extractor"]})),{valid:!0})};var nq=St(Gt(),1);import{existsSync as Vxe}from"node:fs";import{writeFile as Gxe}from"node:fs/promises";import{basename as Hxe,join as Wxe}from"node:path";var dD={filename:_b},eq=async()=>await ev(dD),tq=()=>tv(dD),rq=()=>Gf(dD);var iq="../templates/docker",sq=process.cwd(),aq=async()=>{let{valid:e}=await cD();e==="error"||!e||(await pD(),await Kxe(),await Yxe(),await Jl({command:"docker",args:["compose","up"]}))},oq=async()=>{let{valid:e}=await cD();e==="error"||!e||(await pD(),await Jl({command:"docker",args:["compose","stop"]}))},Kxe=async()=>{if(await eq())return;await Di("A config file is required for development. Would you like the CLI to create one for you?");let{configType:e,configPath:t}=await zxe();await Vc({template:`${_b}.${e}`,sourceFolder:iq,destinationFolder:sq,...or(t)&&{destinationFilename:t}})},zxe=async()=>{let e=tq();return or(e)?e:{configType:await jv()}},Yxe=async()=>{if(Vxe("docker-compose.yml"))return;await Di(`The CLI utilizes Docker Compose, which is handy for customizing configurations. Would you like the CLI to generate a default ${(0,nq.magenta)("docker-compose.yml")} file for you?`);let e=await Hf({template:"docker-compose.yml",sourceFolder:iq}),{configPath:t}=rq(),r=Hxe(t),n=e.replaceAll("<JUNO_DEV_CONFIG>",r);await Gxe(Wxe(sq,"docker-compose.yml"),n,"utf-8")};var Yc=St(Gt(),1);import{mkdir as Zxe}from"node:fs/promises";import{join as bq}from"node:path";var Tt=St(Gt(),1);var qv="0.0.78";var Xxe=` __ __ __ __ _ ____
642
642
  __) || | || \\| |/ \\
643
643
  \\___/ \\___/ |_|\\__|\\____/`,El=`${Xxe} CLI ${(0,Tt.grey)(`v${qv}`)}`,Vv=`
644
644
  ${El}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/cli",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "description": "The Juno command-line interface",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -8,11 +8,11 @@ crate-type = ["cdylib"]
8
8
 
9
9
  [dependencies]
10
10
  candid = "0.10.2"
11
- ic-cdk = "0.14.0"
12
- ic-cdk-macros = "0.14.0"
11
+ ic-cdk = "0.15.1"
12
+ ic-cdk-macros = "0.15.0"
13
13
  serde = "1.0.190"
14
14
  serde_cbor = "0.11.2"
15
- junobuild-satellite = "0.0.19"
15
+ junobuild-satellite = "0.0.20"
16
16
  junobuild-macros = "0.0.2"
17
- junobuild-utils = "0.0.2"
17
+ junobuild-utils = "0.0.3"
18
18
 
@@ -1,6 +1,6 @@
1
1
  type AssetEncodingNoContent = record {
2
2
  modified : nat64;
3
- sha256 : vec nat8;
3
+ sha256 : blob;
4
4
  total_length : nat;
5
5
  };
6
6
  type AssetKey = record {
@@ -30,7 +30,12 @@ type CommitBatch = record {
30
30
  headers : vec record { text; text };
31
31
  chunk_ids : vec nat;
32
32
  };
33
- type Config = record { storage : StorageConfig };
33
+ type Config = record {
34
+ db : opt DbConfig;
35
+ authentication : opt AuthenticationConfig;
36
+ storage : StorageConfig;
37
+ };
38
+ type ConfigMaxMemorySize = record { stable : opt nat64; heap : opt nat64 };
34
39
  type Controller = record {
35
40
  updated_at : nat64;
36
41
  metadata : vec record { text; text };
@@ -45,13 +50,15 @@ type CustomDomain = record {
45
50
  version : opt nat64;
46
51
  bn_id : opt text;
47
52
  };
53
+ type DbConfig = record { max_memory_size : opt ConfigMaxMemorySize };
48
54
  type DelDoc = record { version : opt nat64 };
55
+ type DelRule = record { version : opt nat64 };
49
56
  type DeleteControllersArgs = record { controllers : vec principal };
50
57
  type DepositCyclesArgs = record { cycles : nat; destination_id : principal };
51
58
  type Doc = record {
52
59
  updated_at : nat64;
53
60
  owner : principal;
54
- data : vec nat8;
61
+ data : blob;
55
62
  description : opt text;
56
63
  created_at : nat64;
57
64
  version : opt nat64;
@@ -59,12 +66,12 @@ type Doc = record {
59
66
  type HttpRequest = record {
60
67
  url : text;
61
68
  method : text;
62
- body : vec nat8;
69
+ body : blob;
63
70
  headers : vec record { text; text };
64
71
  certificate_version : opt nat16;
65
72
  };
66
73
  type HttpResponse = record {
67
- body : vec nat8;
74
+ body : blob;
68
75
  headers : vec record { text; text };
69
76
  streaming_strategy : opt StreamingStrategy;
70
77
  status_code : nat16;
@@ -78,7 +85,12 @@ type InitAssetKey = record {
78
85
  full_path : text;
79
86
  };
80
87
  type InitUploadResult = record { batch_id : nat };
81
- type ListMatcher = record { key : opt text; description : opt text };
88
+ type ListMatcher = record {
89
+ key : opt text;
90
+ updated_at : opt TimestampMatcher;
91
+ description : opt text;
92
+ created_at : opt TimestampMatcher;
93
+ };
82
94
  type ListOrder = record { field : ListOrderField; desc : bool };
83
95
  type ListOrderField = variant { UpdatedAt; Keys; CreatedAt };
84
96
  type ListPaginate = record { start_after : opt text; limit : opt nat64 };
@@ -127,7 +139,7 @@ type SetControllersArgs = record {
127
139
  controllers : vec principal;
128
140
  };
129
141
  type SetDoc = record {
130
- data : vec nat8;
142
+ data : blob;
131
143
  description : opt text;
132
144
  version : opt nat64;
133
145
  };
@@ -144,6 +156,7 @@ type StorageConfig = record {
144
156
  iframe : opt StorageConfigIFrame;
145
157
  rewrites : vec record { text; text };
146
158
  headers : vec record { text; vec record { text; text } };
159
+ max_memory_size : opt ConfigMaxMemorySize;
147
160
  raw_access : opt StorageConfigRawAccess;
148
161
  redirects : opt vec record { text; StorageConfigRedirect };
149
162
  };
@@ -152,12 +165,12 @@ type StorageConfigRawAccess = variant { Deny; Allow };
152
165
  type StorageConfigRedirect = record { status_code : nat16; location : text };
153
166
  type StreamingCallbackHttpResponse = record {
154
167
  token : opt StreamingCallbackToken;
155
- body : vec nat8;
168
+ body : blob;
156
169
  };
157
170
  type StreamingCallbackToken = record {
158
171
  memory : Memory;
159
172
  token : opt text;
160
- sha256 : opt vec nat8;
173
+ sha256 : opt blob;
161
174
  headers : vec record { text; text };
162
175
  index : nat64;
163
176
  encoding_type : text;
@@ -169,16 +182,24 @@ type StreamingStrategy = variant {
169
182
  callback : func () -> () query;
170
183
  };
171
184
  };
185
+ type TimestampMatcher = variant {
186
+ Equal : nat64;
187
+ Between : record { nat64; nat64 };
188
+ GreaterThan : nat64;
189
+ LessThan : nat64;
190
+ };
172
191
  type UploadChunk = record {
173
- content : vec nat8;
192
+ content : blob;
174
193
  batch_id : nat;
175
194
  order_id : opt nat;
176
195
  };
177
196
  type UploadChunkResult = record { chunk_id : nat };
178
197
  service : () -> {
179
198
  commit_asset_upload : (CommitBatch) -> ();
180
- count_assets : (text) -> (nat64) query;
181
- count_docs : (text) -> (nat64) query;
199
+ count_assets : (text, ListParams) -> (nat64) query;
200
+ count_collection_assets : (text) -> (nat64) query;
201
+ count_collection_docs : (text) -> (nat64) query;
202
+ count_docs : (text, ListParams) -> (nat64) query;
182
203
  del_asset : (text, text) -> ();
183
204
  del_assets : (text) -> ();
184
205
  del_controllers : (DeleteControllersArgs) -> (
@@ -189,11 +210,12 @@ service : () -> {
189
210
  del_docs : (text) -> ();
190
211
  del_many_assets : (vec record { text; text }) -> ();
191
212
  del_many_docs : (vec record { text; text; DelDoc }) -> ();
192
- del_rule : (RulesType, text, DelDoc) -> ();
213
+ del_rule : (RulesType, text, DelRule) -> ();
193
214
  deposit_cycles : (DepositCyclesArgs) -> ();
194
215
  get_asset : (text, text) -> (opt AssetNoContent) query;
195
216
  get_auth_config : () -> (opt AuthenticationConfig) query;
196
217
  get_config : () -> (Config);
218
+ get_db_config : () -> (opt DbConfig) query;
197
219
  get_doc : (text, text) -> (opt Doc) query;
198
220
  get_many_assets : (vec record { text; text }) -> (
199
221
  vec record { text; opt AssetNoContent },
@@ -201,6 +223,7 @@ service : () -> {
201
223
  get_many_docs : (vec record { text; text }) -> (
202
224
  vec record { text; opt Doc },
203
225
  ) query;
226
+ get_storage_config : () -> (StorageConfig) query;
204
227
  http_request : (HttpRequest) -> (HttpResponse) query;
205
228
  http_request_streaming_callback : (StreamingCallbackToken) -> (
206
229
  StreamingCallbackHttpResponse,
@@ -213,16 +236,17 @@ service : () -> {
213
236
  list_rules : (RulesType) -> (vec record { text; Rule }) query;
214
237
  memory_size : () -> (MemorySize) query;
215
238
  set_auth_config : (AuthenticationConfig) -> ();
216
- set_config : (Config) -> ();
217
239
  set_controllers : (SetControllersArgs) -> (
218
240
  vec record { principal; Controller },
219
241
  );
220
242
  set_custom_domain : (text, opt text) -> ();
243
+ set_db_config : (DbConfig) -> ();
221
244
  set_doc : (text, text, SetDoc) -> (Doc);
222
245
  set_many_docs : (vec record { text; text; SetDoc }) -> (
223
246
  vec record { text; Doc },
224
247
  );
225
248
  set_rule : (RulesType, text, SetRule) -> ();
249
+ set_storage_config : (StorageConfig) -> ();
226
250
  upload_asset_chunk : (UploadChunk) -> (UploadChunkResult);
227
251
  version : () -> (text) query;
228
252
  }