@junobuild/cli 0.0.45 → 0.0.47

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.0.45",
3
+ "version": "0.0.47",
4
4
  "description": "The Juno command-line interface",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -27,17 +27,17 @@
27
27
  "@dfinity/candid": "^0.20.2",
28
28
  "@dfinity/identity": "^0.20.2",
29
29
  "@dfinity/principal": "^0.20.2",
30
- "@junobuild/admin": "^0.0.40",
31
- "@junobuild/core-peer": "^0.0.5",
32
- "@junobuild/utils": "^0.0.17",
30
+ "@junobuild/admin": "^0.0.45",
31
+ "@junobuild/core-peer": "^0.0.10",
32
+ "@junobuild/utils": "^0.0.18",
33
33
  "conf": "^12.0.0",
34
- "file-type": "^18.7.0",
34
+ "file-type": "^19.0.0",
35
35
  "listr": "^0.14.3",
36
36
  "mime-types": "^2.1.35",
37
37
  "minimatch": "^9.0.3",
38
38
  "node-fetch": "^3.3.2",
39
- "open": "^10.0.1",
40
- "ora": "^7.0.1",
39
+ "open": "^10.0.3",
40
+ "ora": "^8.0.1",
41
41
  "portfinder": "^1.0.32",
42
42
  "prompts": "^2.4.2",
43
43
  "semver": "^7.5.4",
@@ -49,17 +49,17 @@
49
49
  "@types/minimatch": "^5.1.2",
50
50
  "@types/prompts": "^2.4.9",
51
51
  "@types/semver": "^7.5.6",
52
- "@typescript-eslint/eslint-plugin": "^6.15.0",
53
- "dotenv": "^16.3.1",
54
- "esbuild": "^0.19.10",
52
+ "@typescript-eslint/eslint-plugin": "^6.20.0",
53
+ "dotenv": "^16.4.1",
54
+ "esbuild": "^0.20.0",
55
55
  "eslint": "^8.56.0",
56
56
  "eslint-config-prettier": "^9.1.0",
57
- "eslint-config-standard-with-typescript": "^43.0.0",
57
+ "eslint-config-standard-with-typescript": "^43.0.1",
58
58
  "eslint-plugin-import": "^2.29.1",
59
- "eslint-plugin-n": "^16.5.0",
60
- "eslint-plugin-prettier": "^5.1.1",
59
+ "eslint-plugin-n": "^16.6.2",
60
+ "eslint-plugin-prettier": "^5.1.3",
61
61
  "eslint-plugin-promise": "^6.1.1",
62
- "prettier": "^3.1.1",
62
+ "prettier": "^3.2.5",
63
63
  "prettier-plugin-organize-imports": "^3.2.4",
64
64
  "typescript": "^5.2.2"
65
65
  },
@@ -0,0 +1,12 @@
1
+ services:
2
+ juno-satellite:
3
+ image: junobuild/satellite:latest
4
+ ports:
5
+ - 5987:5987
6
+ volumes:
7
+ - juno_satellite:/juno/.juno
8
+ - ./juno.dev.json:/juno/juno.dev.json
9
+ - ./target/deploy:/juno/target/deploy/
10
+
11
+ volumes:
12
+ juno_satellite:
@@ -0,0 +1,9 @@
1
+ {
2
+ "satellite": {
3
+ "collections": {
4
+ "db": [],
5
+ "storage": []
6
+ },
7
+ "controllers": []
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ [workspace]
2
+ members = [
3
+ "src/satellite"
4
+ ]
5
+ resolver = "2"
@@ -0,0 +1,18 @@
1
+ [package]
2
+ name = "satellite"
3
+ version = "0.0.1"
4
+ edition = "2021"
5
+
6
+ [lib]
7
+ crate-type = ["cdylib"]
8
+
9
+ [dependencies]
10
+ candid = "0.10.2"
11
+ ic-cdk = "0.12.1"
12
+ ic-cdk-macros = "0.8.1"
13
+ serde = "1.0.190"
14
+ serde_cbor = "0.11.2"
15
+ junobuild-satellite = "0.0.15"
16
+ junobuild-macros = "0.0.1"
17
+ junobuild-utils = "0.0.1"
18
+
@@ -0,0 +1,212 @@
1
+ type AssetEncodingNoContent = record {
2
+ modified : nat64;
3
+ sha256 : vec nat8;
4
+ total_length : nat;
5
+ };
6
+ type AssetKey = record {
7
+ token : opt text;
8
+ collection : text;
9
+ owner : principal;
10
+ name : text;
11
+ description : opt text;
12
+ full_path : text;
13
+ };
14
+ type AssetNoContent = record {
15
+ key : AssetKey;
16
+ updated_at : nat64;
17
+ encodings : vec record { text; AssetEncodingNoContent };
18
+ headers : vec record { text; text };
19
+ created_at : nat64;
20
+ };
21
+ type CommitBatch = record {
22
+ batch_id : nat;
23
+ headers : vec record { text; text };
24
+ chunk_ids : vec nat;
25
+ };
26
+ type Config = record { storage : StorageConfig };
27
+ type Controller = record {
28
+ updated_at : nat64;
29
+ metadata : vec record { text; text };
30
+ created_at : nat64;
31
+ scope : ControllerScope;
32
+ expires_at : opt nat64;
33
+ };
34
+ type ControllerScope = variant { Write; Admin };
35
+ type CustomDomain = record {
36
+ updated_at : nat64;
37
+ created_at : nat64;
38
+ bn_id : opt text;
39
+ };
40
+ type DelDoc = record { updated_at : opt nat64 };
41
+ type DeleteControllersArgs = record { controllers : vec principal };
42
+ type DepositCyclesArgs = record { cycles : nat; destination_id : principal };
43
+ type Doc = record {
44
+ updated_at : nat64;
45
+ owner : principal;
46
+ data : vec nat8;
47
+ description : opt text;
48
+ created_at : nat64;
49
+ };
50
+ type HttpRequest = record {
51
+ url : text;
52
+ method : text;
53
+ body : vec nat8;
54
+ headers : vec record { text; text };
55
+ certificate_version : opt nat16;
56
+ };
57
+ type HttpResponse = record {
58
+ body : vec nat8;
59
+ headers : vec record { text; text };
60
+ streaming_strategy : opt StreamingStrategy;
61
+ status_code : nat16;
62
+ };
63
+ type InitAssetKey = record {
64
+ token : opt text;
65
+ collection : text;
66
+ name : text;
67
+ description : opt text;
68
+ encoding_type : opt text;
69
+ full_path : text;
70
+ };
71
+ type InitUploadResult = record { batch_id : nat };
72
+ type ListMatcher = record { key : opt text; description : opt text };
73
+ type ListOrder = record { field : ListOrderField; desc : bool };
74
+ type ListOrderField = variant { UpdatedAt; Keys; CreatedAt };
75
+ type ListPaginate = record { start_after : opt text; limit : opt nat64 };
76
+ type ListParams = record {
77
+ order : opt ListOrder;
78
+ owner : opt principal;
79
+ matcher : opt ListMatcher;
80
+ paginate : opt ListPaginate;
81
+ };
82
+ type ListResults = record {
83
+ matches_pages : opt nat64;
84
+ matches_length : nat64;
85
+ items_page : opt nat64;
86
+ items : vec record { text; AssetNoContent };
87
+ items_length : nat64;
88
+ };
89
+ type ListResults_1 = record {
90
+ matches_pages : opt nat64;
91
+ matches_length : nat64;
92
+ items_page : opt nat64;
93
+ items : vec record { text; Doc };
94
+ items_length : nat64;
95
+ };
96
+ type Memory = variant { Heap; Stable };
97
+ type MemorySize = record { stable : nat64; heap : nat64 };
98
+ type Permission = variant { Controllers; Private; Public; Managed };
99
+ type Rule = record {
100
+ memory : opt Memory;
101
+ updated_at : nat64;
102
+ max_size : opt nat;
103
+ read : Permission;
104
+ created_at : nat64;
105
+ mutable_permissions : opt bool;
106
+ write : Permission;
107
+ };
108
+ type RulesType = variant { Db; Storage };
109
+ type SetController = record {
110
+ metadata : vec record { text; text };
111
+ scope : ControllerScope;
112
+ expires_at : opt nat64;
113
+ };
114
+ type SetControllersArgs = record {
115
+ controller : SetController;
116
+ controllers : vec principal;
117
+ };
118
+ type SetDoc = record {
119
+ updated_at : opt nat64;
120
+ data : vec nat8;
121
+ description : opt text;
122
+ };
123
+ type SetRule = record {
124
+ memory : opt Memory;
125
+ updated_at : opt nat64;
126
+ max_size : opt nat;
127
+ read : Permission;
128
+ mutable_permissions : opt bool;
129
+ write : Permission;
130
+ };
131
+ type StorageConfig = record {
132
+ iframe : opt StorageConfigIFrame;
133
+ rewrites : vec record { text; text };
134
+ headers : vec record { text; vec record { text; text } };
135
+ redirects : opt vec record { text; StorageConfigRedirect };
136
+ };
137
+ type StorageConfigIFrame = variant { Deny; AllowAny; SameOrigin };
138
+ type StorageConfigRedirect = record { status_code : nat16; location : text };
139
+ type StreamingCallbackHttpResponse = record {
140
+ token : opt StreamingCallbackToken;
141
+ body : vec nat8;
142
+ };
143
+ type StreamingCallbackToken = record {
144
+ memory : Memory;
145
+ token : opt text;
146
+ sha256 : opt vec nat8;
147
+ headers : vec record { text; text };
148
+ index : nat64;
149
+ encoding_type : text;
150
+ full_path : text;
151
+ };
152
+ type StreamingStrategy = variant {
153
+ Callback : record {
154
+ token : StreamingCallbackToken;
155
+ callback : func () -> () query;
156
+ };
157
+ };
158
+ type UploadChunk = record {
159
+ content : vec nat8;
160
+ batch_id : nat;
161
+ order_id : opt nat;
162
+ };
163
+ type UploadChunkResult = record { chunk_id : nat };
164
+ service : () -> {
165
+ commit_asset_upload : (CommitBatch) -> ();
166
+ count_assets : (text) -> (nat64) query;
167
+ count_docs : (text) -> (nat64) query;
168
+ del_asset : (text, text) -> ();
169
+ del_assets : (text) -> ();
170
+ del_controllers : (DeleteControllersArgs) -> (
171
+ vec record { principal; Controller },
172
+ );
173
+ del_custom_domain : (text) -> ();
174
+ del_doc : (text, text, DelDoc) -> ();
175
+ del_docs : (text) -> ();
176
+ del_many_assets : (vec record { text; text }) -> ();
177
+ del_many_docs : (vec record { text; text; DelDoc }) -> ();
178
+ del_rule : (RulesType, text, DelDoc) -> ();
179
+ deposit_cycles : (DepositCyclesArgs) -> ();
180
+ get_asset : (text, text) -> (opt AssetNoContent) query;
181
+ get_config : () -> (Config);
182
+ get_doc : (text, text) -> (opt Doc) query;
183
+ get_many_assets : (vec record { text; text }) -> (
184
+ vec record { text; opt AssetNoContent },
185
+ ) query;
186
+ get_many_docs : (vec record { text; text }) -> (
187
+ vec record { text; opt Doc },
188
+ ) query;
189
+ http_request : (HttpRequest) -> (HttpResponse) query;
190
+ http_request_streaming_callback : (StreamingCallbackToken) -> (
191
+ StreamingCallbackHttpResponse,
192
+ ) query;
193
+ init_asset_upload : (InitAssetKey) -> (InitUploadResult);
194
+ list_assets : (text, ListParams) -> (ListResults) query;
195
+ list_controllers : () -> (vec record { principal; Controller }) query;
196
+ list_custom_domains : () -> (vec record { text; CustomDomain }) query;
197
+ list_docs : (text, ListParams) -> (ListResults_1) query;
198
+ list_rules : (RulesType) -> (vec record { text; Rule }) query;
199
+ memory_size : () -> (MemorySize) query;
200
+ set_config : (Config) -> ();
201
+ set_controllers : (SetControllersArgs) -> (
202
+ vec record { principal; Controller },
203
+ );
204
+ set_custom_domain : (text, opt text) -> ();
205
+ set_doc : (text, text, SetDoc) -> (Doc);
206
+ set_many_docs : (vec record { text; text; SetDoc }) -> (
207
+ vec record { text; Doc },
208
+ );
209
+ set_rule : (RulesType, text, SetRule) -> ();
210
+ upload_asset_chunk : (UploadChunk) -> (UploadChunkResult);
211
+ version : () -> (text) query;
212
+ }
@@ -0,0 +1,45 @@
1
+ use junobuild_macros::{
2
+ on_delete_asset, on_delete_doc, on_delete_many_assets, on_delete_many_docs, on_set_doc,
3
+ on_set_many_docs, on_upload_asset,
4
+ };
5
+ use junobuild_satellite::{
6
+ include_satellite, OnDeleteAssetContext, OnDeleteDocContext, OnDeleteManyAssetsContext,
7
+ OnDeleteManyDocsContext, OnSetDocContext, OnSetManyDocsContext, OnUploadAssetContext,
8
+ };
9
+
10
+ #[on_set_doc]
11
+ async fn on_set_doc(_context: OnSetDocContext) -> Result<(), String> {
12
+ Ok(())
13
+ }
14
+
15
+ #[on_set_many_docs]
16
+ async fn on_set_many_docs(_context: OnSetManyDocsContext) -> Result<(), String> {
17
+ Ok(())
18
+ }
19
+
20
+ #[on_delete_doc]
21
+ async fn on_delete_doc(_context: OnDeleteDocContext) -> Result<(), String> {
22
+ Ok(())
23
+ }
24
+
25
+ #[on_delete_many_docs]
26
+ async fn on_delete_many_docs(_context: OnDeleteManyDocsContext) -> Result<(), String> {
27
+ Ok(())
28
+ }
29
+
30
+ #[on_upload_asset]
31
+ async fn on_upload_asset(_context: OnUploadAssetContext) -> Result<(), String> {
32
+ Ok(())
33
+ }
34
+
35
+ #[on_delete_asset]
36
+ async fn on_delete_asset(_context: OnDeleteAssetContext) -> Result<(), String> {
37
+ Ok(())
38
+ }
39
+
40
+ #[on_delete_many_assets]
41
+ async fn on_delete_many_assets(_context: OnDeleteManyAssetsContext) -> Result<(), String> {
42
+ Ok(())
43
+ }
44
+
45
+ include_satellite!();
@@ -5,9 +5,7 @@
5
5
  <meta content="width=device-width, initial-scale=1" name="viewport" />
6
6
 
7
7
  <title>Juno</title>
8
- <meta
9
- content="Build Web3 Apps Like It's Web2. No backend code required. 100% on-chain with minimal carbon impact."
10
- name="description" />
8
+ <meta content="Build Web3 dApps like Web2" name="description" />
11
9
 
12
10
  <style>
13
11
  :root {
@@ -5,9 +5,7 @@
5
5
  <meta content="width=device-width, initial-scale=1" name="viewport" />
6
6
 
7
7
  <title>Juno</title>
8
- <meta
9
- content="Build Web3 Apps Like It's Web2. No backend code required. 100% on-chain with minimal carbon impact."
10
- name="description" />
8
+ <meta content="Build Web3 dApps like Web2" name="description" />
11
9
 
12
10
  <style>
13
11
  :root {