@junobuild/config 0.1.8 → 0.2.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.
@@ -1,22 +1,119 @@
1
- import type { Rule } from '../types/rules';
1
+ import { type PrincipalText } from '@dfinity/zod-schemas';
2
+ import * as z from 'zod/v4';
3
+ import { type Rule } from '../types/rules';
4
+ /**
5
+ * @see SatelliteDevDataStoreCollection
6
+ */
7
+ export declare const SatelliteDevDataStoreCollectionSchema: z.ZodObject<{
8
+ collection: z.ZodString;
9
+ read: z.ZodEnum<{
10
+ controllers: "controllers";
11
+ public: "public";
12
+ private: "private";
13
+ managed: "managed";
14
+ }>;
15
+ write: z.ZodEnum<{
16
+ controllers: "controllers";
17
+ public: "public";
18
+ private: "private";
19
+ managed: "managed";
20
+ }>;
21
+ memory: z.ZodEnum<{
22
+ heap: "heap";
23
+ stable: "stable";
24
+ }>;
25
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
26
+ maxCapacity: z.ZodOptional<z.ZodNumber>;
27
+ mutablePermissions: z.ZodBoolean;
28
+ maxTokens: z.ZodOptional<z.ZodNumber>;
29
+ }, z.core.$strict>;
2
30
  /**
3
31
  * Represents a database collection configuration for a satellite in a development environment.
4
32
  * @typedef {Omit<Rule, 'createdAt' | 'updatedAt' | 'maxSize' | 'version'>} SatelliteDevDataStoreCollection
5
33
  */
6
34
  export type SatelliteDevDataStoreCollection = Omit<Rule, 'createdAt' | 'updatedAt' | 'maxSize' | 'version'>;
7
35
  /**
8
- * This type is an alias for SatelliteDevDataStoreCollection and is now deprecated.
9
- *
10
- * @see SatelliteDevDataStoreCollection
11
- * @deprecated Use {@link SatelliteDevDataStoreCollection} instead.
12
- * @typedef {SatelliteDevDataStoreCollection} SatelliteDevDbCollection
36
+ * @see SatelliteDevStorageCollection
13
37
  */
14
- export type SatelliteDevDbCollection = SatelliteDevDataStoreCollection;
38
+ export declare const SatelliteDevStorageCollectionSchema: z.ZodObject<{
39
+ collection: z.ZodString;
40
+ read: z.ZodEnum<{
41
+ controllers: "controllers";
42
+ public: "public";
43
+ private: "private";
44
+ managed: "managed";
45
+ }>;
46
+ write: z.ZodEnum<{
47
+ controllers: "controllers";
48
+ public: "public";
49
+ private: "private";
50
+ managed: "managed";
51
+ }>;
52
+ memory: z.ZodEnum<{
53
+ heap: "heap";
54
+ stable: "stable";
55
+ }>;
56
+ maxSize: z.ZodOptional<z.ZodNumber>;
57
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
58
+ mutablePermissions: z.ZodBoolean;
59
+ maxTokens: z.ZodOptional<z.ZodNumber>;
60
+ }, z.core.$strict>;
15
61
  /**
16
62
  * Represents a Storage collection configuration for a satellite in a development environment.
17
63
  * @typedef {Omit<Rule, 'createdAt' | 'updatedAt' | 'maxCapacity' | 'version'>} SatelliteDevStorageCollection
18
64
  */
19
65
  export type SatelliteDevStorageCollection = Omit<Rule, 'createdAt' | 'updatedAt' | 'maxCapacity' | 'version'>;
66
+ /**
67
+ * @see SatelliteDevCollections
68
+ */
69
+ export declare const SatelliteDevCollectionsSchema: z.ZodObject<{
70
+ datastore: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
+ collection: z.ZodString;
72
+ read: z.ZodEnum<{
73
+ controllers: "controllers";
74
+ public: "public";
75
+ private: "private";
76
+ managed: "managed";
77
+ }>;
78
+ write: z.ZodEnum<{
79
+ controllers: "controllers";
80
+ public: "public";
81
+ private: "private";
82
+ managed: "managed";
83
+ }>;
84
+ memory: z.ZodEnum<{
85
+ heap: "heap";
86
+ stable: "stable";
87
+ }>;
88
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
89
+ maxCapacity: z.ZodOptional<z.ZodNumber>;
90
+ mutablePermissions: z.ZodBoolean;
91
+ maxTokens: z.ZodOptional<z.ZodNumber>;
92
+ }, z.core.$strict>>>;
93
+ storage: z.ZodOptional<z.ZodArray<z.ZodObject<{
94
+ collection: z.ZodString;
95
+ read: z.ZodEnum<{
96
+ controllers: "controllers";
97
+ public: "public";
98
+ private: "private";
99
+ managed: "managed";
100
+ }>;
101
+ write: z.ZodEnum<{
102
+ controllers: "controllers";
103
+ public: "public";
104
+ private: "private";
105
+ managed: "managed";
106
+ }>;
107
+ memory: z.ZodEnum<{
108
+ heap: "heap";
109
+ stable: "stable";
110
+ }>;
111
+ maxSize: z.ZodOptional<z.ZodNumber>;
112
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
113
+ mutablePermissions: z.ZodBoolean;
114
+ maxTokens: z.ZodOptional<z.ZodNumber>;
115
+ }, z.core.$strict>>>;
116
+ }, z.core.$strict>;
20
117
  /**
21
118
  * Represents the collections configuration for a satellite in a development environment.
22
119
  * @interface SatelliteDevCollections
@@ -28,14 +125,6 @@ export interface SatelliteDevCollections {
28
125
  * @optional
29
126
  */
30
127
  datastore?: SatelliteDevDataStoreCollection[];
31
- /**
32
- * The Datastore collections configuration.
33
- * This property is deprecated. Use {@link datastore} instead.
34
- *
35
- * @deprecated
36
- * @type {SatelliteDevDbCollection[]}
37
- */
38
- db?: SatelliteDevDbCollection[];
39
128
  /**
40
129
  * The Storage collections configuration.
41
130
  * @type {SatelliteDevStorageCollection[]}
@@ -43,6 +132,17 @@ export interface SatelliteDevCollections {
43
132
  */
44
133
  storage?: SatelliteDevStorageCollection[];
45
134
  }
135
+ /**
136
+ * @see SatelliteDevController
137
+ */
138
+ export declare const SatelliteDevControllerSchema: z.ZodObject<{
139
+ id: z.ZodString;
140
+ scope: z.ZodEnum<{
141
+ write: "write";
142
+ admin: "admin";
143
+ submit: "submit";
144
+ }>;
145
+ }, z.core.$strict>;
46
146
  /**
47
147
  * Represents a controller configuration for a satellite in a development environment.
48
148
  * @interface SatelliteDevController
@@ -52,13 +152,74 @@ export interface SatelliteDevController {
52
152
  * The unique identifier of the controller.
53
153
  * @type {string}
54
154
  */
55
- id: string;
155
+ id: PrincipalText;
56
156
  /**
57
157
  * The scope of the controller's permissions.
58
158
  * @type {'write' | 'admin'}
59
159
  */
60
- scope: 'write' | 'admin';
160
+ scope: 'write' | 'admin' | 'submit';
61
161
  }
162
+ /**
163
+ * @see SatelliteDevConfig
164
+ */
165
+ export declare const SatelliteDevConfigSchema: z.ZodObject<{
166
+ collections: z.ZodObject<{
167
+ datastore: z.ZodOptional<z.ZodArray<z.ZodObject<{
168
+ collection: z.ZodString;
169
+ read: z.ZodEnum<{
170
+ controllers: "controllers";
171
+ public: "public";
172
+ private: "private";
173
+ managed: "managed";
174
+ }>;
175
+ write: z.ZodEnum<{
176
+ controllers: "controllers";
177
+ public: "public";
178
+ private: "private";
179
+ managed: "managed";
180
+ }>;
181
+ memory: z.ZodEnum<{
182
+ heap: "heap";
183
+ stable: "stable";
184
+ }>;
185
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
186
+ maxCapacity: z.ZodOptional<z.ZodNumber>;
187
+ mutablePermissions: z.ZodBoolean;
188
+ maxTokens: z.ZodOptional<z.ZodNumber>;
189
+ }, z.core.$strict>>>;
190
+ storage: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
+ collection: z.ZodString;
192
+ read: z.ZodEnum<{
193
+ controllers: "controllers";
194
+ public: "public";
195
+ private: "private";
196
+ managed: "managed";
197
+ }>;
198
+ write: z.ZodEnum<{
199
+ controllers: "controllers";
200
+ public: "public";
201
+ private: "private";
202
+ managed: "managed";
203
+ }>;
204
+ memory: z.ZodEnum<{
205
+ heap: "heap";
206
+ stable: "stable";
207
+ }>;
208
+ maxSize: z.ZodOptional<z.ZodNumber>;
209
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
210
+ mutablePermissions: z.ZodBoolean;
211
+ maxTokens: z.ZodOptional<z.ZodNumber>;
212
+ }, z.core.$strict>>>;
213
+ }, z.core.$strict>;
214
+ controllers: z.ZodOptional<z.ZodArray<z.ZodObject<{
215
+ id: z.ZodString;
216
+ scope: z.ZodEnum<{
217
+ write: "write";
218
+ admin: "admin";
219
+ submit: "submit";
220
+ }>;
221
+ }, z.core.$strict>>>;
222
+ }, z.core.$strict>;
62
223
  /**
63
224
  * Represents the development configuration for a satellite.
64
225
  * @interface SatelliteDevConfig
@@ -76,6 +237,69 @@ export interface SatelliteDevConfig {
76
237
  */
77
238
  controllers?: SatelliteDevController[];
78
239
  }
240
+ /**
241
+ * @see JunoDevConfig
242
+ */
243
+ export declare const JunoDevConfigSchema: z.ZodObject<{
244
+ satellite: z.ZodObject<{
245
+ collections: z.ZodObject<{
246
+ datastore: z.ZodOptional<z.ZodArray<z.ZodObject<{
247
+ collection: z.ZodString;
248
+ read: z.ZodEnum<{
249
+ controllers: "controllers";
250
+ public: "public";
251
+ private: "private";
252
+ managed: "managed";
253
+ }>;
254
+ write: z.ZodEnum<{
255
+ controllers: "controllers";
256
+ public: "public";
257
+ private: "private";
258
+ managed: "managed";
259
+ }>;
260
+ memory: z.ZodEnum<{
261
+ heap: "heap";
262
+ stable: "stable";
263
+ }>;
264
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
265
+ maxCapacity: z.ZodOptional<z.ZodNumber>;
266
+ mutablePermissions: z.ZodBoolean;
267
+ maxTokens: z.ZodOptional<z.ZodNumber>;
268
+ }, z.core.$strict>>>;
269
+ storage: z.ZodOptional<z.ZodArray<z.ZodObject<{
270
+ collection: z.ZodString;
271
+ read: z.ZodEnum<{
272
+ controllers: "controllers";
273
+ public: "public";
274
+ private: "private";
275
+ managed: "managed";
276
+ }>;
277
+ write: z.ZodEnum<{
278
+ controllers: "controllers";
279
+ public: "public";
280
+ private: "private";
281
+ managed: "managed";
282
+ }>;
283
+ memory: z.ZodEnum<{
284
+ heap: "heap";
285
+ stable: "stable";
286
+ }>;
287
+ maxSize: z.ZodOptional<z.ZodNumber>;
288
+ maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
289
+ mutablePermissions: z.ZodBoolean;
290
+ maxTokens: z.ZodOptional<z.ZodNumber>;
291
+ }, z.core.$strict>>>;
292
+ }, z.core.$strict>;
293
+ controllers: z.ZodOptional<z.ZodArray<z.ZodObject<{
294
+ id: z.ZodString;
295
+ scope: z.ZodEnum<{
296
+ write: "write";
297
+ admin: "admin";
298
+ submit: "submit";
299
+ }>;
300
+ }, z.core.$strict>>>;
301
+ }, z.core.$strict>;
302
+ }, z.core.$strict>;
79
303
  /**
80
304
  * Represents the development configuration for Juno.
81
305
  * @interface JunoDevConfig
@@ -1,3 +1,10 @@
1
+ import * as z from 'zod/v4';
2
+ /**
3
+ * @see SatelliteAssertions
4
+ */
5
+ export declare const SatelliteAssertionsSchema: z.ZodObject<{
6
+ heapMemory: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean]>>;
7
+ }, z.core.$strict>;
1
8
  /**
2
9
  * Configuration for satellite assertions.
3
10
  * @interface SatelliteAssertions
@@ -1,3 +1,11 @@
1
+ import * as z from 'zod/v4';
2
+ /**
3
+ * @see AuthenticationConfigInternetIdentity
4
+ */
5
+ export declare const AuthenticationConfigInternetIdentitySchema: z.ZodObject<{
6
+ derivationOrigin: z.ZodOptional<z.ZodURL>;
7
+ externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
8
+ }, z.core.$strict>;
1
9
  /**
2
10
  * Configure the behavior of Internet Identity.
3
11
  * @interface AuthenticationConfigInternetIdentity
@@ -17,6 +25,15 @@ export interface AuthenticationConfigInternetIdentity {
17
25
  */
18
26
  externalAlternativeOrigins?: string[];
19
27
  }
28
+ /**
29
+ * @see AuthenticationConfig
30
+ */
31
+ export declare const AuthenticationConfigSchema: z.ZodObject<{
32
+ internetIdentity: z.ZodOptional<z.ZodObject<{
33
+ derivationOrigin: z.ZodOptional<z.ZodURL>;
34
+ externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
35
+ }, z.core.$strict>>;
36
+ }, z.core.$strict>;
20
37
  /**
21
38
  * Configures the Authentication options of a Satellite.
22
39
  * @interface AuthenticationConfig
@@ -1,4 +1,14 @@
1
- import type { MaxMemorySizeConfig } from '../../../shared/feature.config';
1
+ import * as z from 'zod/v4';
2
+ import { type MaxMemorySizeConfig } from '../../../shared/feature.config';
3
+ /**
4
+ * @see DatastoreConfig
5
+ */
6
+ export declare const DatastoreConfigSchema: z.ZodObject<{
7
+ maxMemorySize: z.ZodOptional<z.ZodObject<{
8
+ heap: z.ZodOptional<z.ZodBigInt>;
9
+ stable: z.ZodOptional<z.ZodBigInt>;
10
+ }, z.core.$strict>>;
11
+ }, z.core.$strict>;
2
12
  /**
3
13
  * Configures the behavior of the Datastore.
4
14
  * @interface DatastoreConfig
@@ -0,0 +1,151 @@
1
+ import * as z from 'zod/v4';
2
+ /**
3
+ * Represents the ports exposed by an emulator container.
4
+ */
5
+ export interface EmulatorPorts {
6
+ /**
7
+ * The port of the server used to simulate execution. This is the port your app connects to.
8
+ * Also known as the "local Internet Computer replica" or the "Pocket-IC port".
9
+ * @default 5987
10
+ */
11
+ server?: number;
12
+ /**
13
+ * The port of the admin server used for tasks like transferring ICP from the ledger.
14
+ * @default 5999
15
+ */
16
+ admin?: number;
17
+ }
18
+ /**
19
+ * Represents a Juno configuration file path.
20
+ * Must end in `.mjs`, `.ts`, `.js`, or `.json`.
21
+ */
22
+ export type JunoConfigFile = string;
23
+ /**
24
+ * Represents a Juno development config file path.
25
+ * Must end in `.mjs`, `.ts`, `.js`, or `.json`.
26
+ */
27
+ export type JunoDevConfigFile = string;
28
+ /**
29
+ * Configuration for the Skylab emulator.
30
+ */
31
+ export interface EmulatorSkylab {
32
+ /**
33
+ * Ports exposed by the Skylab container.
34
+ */
35
+ ports?: EmulatorPorts & {
36
+ /**
37
+ * Console UI (like https://console.juno.build) running with the emulator.
38
+ * @default 5866
39
+ */
40
+ console: number;
41
+ };
42
+ /**
43
+ * Path to the Juno config file.
44
+ */
45
+ config: JunoConfigFile;
46
+ }
47
+ /**
48
+ * Configuration for the Console emulator.
49
+ */
50
+ export interface EmulatorConsole {
51
+ /**
52
+ * Ports exposed by the Console container.
53
+ */
54
+ ports?: EmulatorPorts;
55
+ }
56
+ /**
57
+ * Configuration for the Satellite emulator.
58
+ */
59
+ export interface EmulatorSatellite {
60
+ /**
61
+ * Ports exposed by the Satellite container.
62
+ */
63
+ ports?: EmulatorPorts;
64
+ /**
65
+ * Path to the dev config file to customize Satellite behavior.
66
+ */
67
+ config: JunoDevConfigFile;
68
+ }
69
+ /**
70
+ * Shared options for all emulator variants.
71
+ */
72
+ export interface EmulatorBaseConfig {
73
+ /**
74
+ * The containerization tool to run the emulator.
75
+ */
76
+ runner: 'docker';
77
+ /**
78
+ * Persistent volume to store internal state.
79
+ * @default "juno"
80
+ */
81
+ volume?: string;
82
+ /**
83
+ * Shared folder for deploying and hot-reloading serverless functions.
84
+ */
85
+ target?: string;
86
+ }
87
+ /**
88
+ * @see EmulatorConfig
89
+ */
90
+ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
91
+ runner: z.ZodEnum<{
92
+ docker: "docker";
93
+ }>;
94
+ volume: z.ZodOptional<z.ZodString>;
95
+ target: z.ZodOptional<z.ZodString>;
96
+ skylab: z.ZodObject<{
97
+ ports: z.ZodOptional<z.ZodObject<{
98
+ server: z.ZodOptional<z.ZodNumber>;
99
+ admin: z.ZodOptional<z.ZodNumber>;
100
+ console: z.ZodOptional<z.ZodNumber>;
101
+ }, z.core.$strict>>;
102
+ config: z.ZodString;
103
+ }, z.core.$strict>;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ runner: z.ZodEnum<{
106
+ docker: "docker";
107
+ }>;
108
+ volume: z.ZodOptional<z.ZodString>;
109
+ target: z.ZodOptional<z.ZodString>;
110
+ console: z.ZodObject<{
111
+ ports: z.ZodOptional<z.ZodObject<{
112
+ /**
113
+ * @default 5987
114
+ */
115
+ server: z.ZodOptional<z.ZodNumber>;
116
+ /**
117
+ * @default 5999
118
+ */
119
+ admin: z.ZodOptional<z.ZodNumber>;
120
+ }, z.core.$strict>>;
121
+ }, z.core.$strict>;
122
+ }, z.core.$strict>, z.ZodObject<{
123
+ runner: z.ZodEnum<{
124
+ docker: "docker";
125
+ }>;
126
+ volume: z.ZodOptional<z.ZodString>;
127
+ target: z.ZodOptional<z.ZodString>;
128
+ satellite: z.ZodObject<{
129
+ ports: z.ZodOptional<z.ZodObject<{
130
+ /**
131
+ * @default 5987
132
+ */
133
+ server: z.ZodOptional<z.ZodNumber>;
134
+ /**
135
+ * @default 5999
136
+ */
137
+ admin: z.ZodOptional<z.ZodNumber>;
138
+ }, z.core.$strict>>;
139
+ config: z.ZodString;
140
+ }, z.core.$strict>;
141
+ }, z.core.$strict>]>;
142
+ /**
143
+ * The configuration for running the Juno emulator.
144
+ */
145
+ export type EmulatorConfig = (EmulatorBaseConfig & {
146
+ skylab: EmulatorSkylab;
147
+ }) | (EmulatorBaseConfig & {
148
+ console: EmulatorConsole;
149
+ }) | (EmulatorBaseConfig & {
150
+ satellite: EmulatorSatellite;
151
+ });
@@ -1,5 +1,13 @@
1
- import type { JunoConfigMode } from '../../../types/juno.env';
1
+ import { type PrincipalText } from '@dfinity/zod-schemas';
2
+ import * as z from 'zod/v4';
3
+ import { type JunoConfigMode } from '../../../types/juno.env';
2
4
  import type { Either } from '../../../types/utility.types';
5
+ /**
6
+ * @see OrbiterId
7
+ */
8
+ export declare const OrbiterIdSchema: z.ZodObject<{
9
+ id: z.ZodString;
10
+ }, z.core.$strip>;
3
11
  /**
4
12
  * Represents the configuration for an orbiter.
5
13
  * @interface OrbiterId
@@ -9,14 +17,14 @@ export interface OrbiterId {
9
17
  * The identifier of the orbiter used in the dApp.
10
18
  * @type {string}
11
19
  */
12
- id: string;
13
- /**
14
- * The deprecated identifier of the orbiter.
15
- * @deprecated `orbiterId` will be removed in the future. Use `id` instead.
16
- * @type {string}
17
- */
18
- orbiterId?: string;
20
+ id: PrincipalText;
19
21
  }
22
+ /**
23
+ * @see OrbiterIds
24
+ */
25
+ export declare const OrbiterIdsSchema: z.ZodObject<{
26
+ ids: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>, z.ZodString>;
27
+ }, z.core.$strip>;
20
28
  /**
21
29
  * Represents a mapping of orbiter identitifiers to different configurations based on the mode of the application.
22
30
  * @interface OrbiterIds
@@ -34,8 +42,16 @@ export interface OrbiterIds {
34
42
  * }
35
43
  * @type {Record<JunoConfigMode, string>}
36
44
  */
37
- ids: Record<JunoConfigMode, string>;
45
+ ids: Record<JunoConfigMode, PrincipalText>;
38
46
  }
47
+ /**
48
+ * @see OrbiterConfig
49
+ */
50
+ export declare const OrbiterConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
51
+ id: z.ZodString;
52
+ }, z.core.$strict>, z.ZodObject<{
53
+ ids: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>, z.ZodString>;
54
+ }, z.core.$strict>]>;
39
55
  /**
40
56
  * Represents the configuration for an orbiter (analytics).
41
57
  *