@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.
- package/README.md +402 -53
- 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/console/console.config.d.ts +101 -5
- package/dist/types/index.d.ts +20 -19
- package/dist/types/module/module.settings.d.ts +22 -0
- package/dist/types/{schema/juno.package.schema.d.ts → pkg/juno.package.d.ts} +2 -10
- package/dist/types/satellite/dev/juno.dev.config.d.ts +241 -17
- package/dist/types/satellite/mainnet/configs/assertions.config.d.ts +7 -0
- package/dist/types/satellite/mainnet/configs/authentication.config.d.ts +17 -0
- package/dist/types/satellite/mainnet/configs/datastore.config.d.ts +11 -1
- package/dist/types/satellite/mainnet/configs/emulator.config.d.ts +151 -0
- package/dist/types/satellite/mainnet/configs/orbiter.config.d.ts +25 -9
- package/dist/types/satellite/mainnet/configs/satellite.config.d.ts +132 -14
- package/dist/types/satellite/mainnet/juno.config.d.ts +165 -2
- package/dist/types/satellite/types/rules.d.ts +54 -0
- package/dist/types/shared/feature.config.d.ts +8 -0
- package/dist/types/shared/storage.config.d.ts +56 -1
- package/dist/types/tests/mocks/principal.mocks.d.ts +2 -0
- package/dist/types/types/cli.config.d.ts +21 -3
- package/dist/types/types/encoding.d.ts +13 -2
- package/dist/types/types/juno.env.d.ts +11 -0
- package/package.json +3 -2
- /package/dist/types/{constants → pkg}/juno.package.constants.d.ts +0 -0
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
1
|
+
import { type PrincipalText } from '@dfinity/zod-schemas';
|
|
2
|
+
import * as z from 'zod/v4';
|
|
3
|
+
import { type ModuleSettings } from '../../../module/module.settings';
|
|
4
|
+
import { type StorageConfig } from '../../../shared/storage.config';
|
|
3
5
|
import type { CliConfig } from '../../../types/cli.config';
|
|
4
|
-
import type
|
|
6
|
+
import { type JunoConfigMode } from '../../../types/juno.env';
|
|
5
7
|
import type { Either } from '../../../types/utility.types';
|
|
6
|
-
import type
|
|
7
|
-
import type
|
|
8
|
-
import type
|
|
8
|
+
import { type SatelliteAssertions } from './assertions.config';
|
|
9
|
+
import { type AuthenticationConfig } from './authentication.config';
|
|
10
|
+
import { type DatastoreConfig } from './datastore.config';
|
|
11
|
+
/**
|
|
12
|
+
* @see SatelliteId
|
|
13
|
+
*/
|
|
14
|
+
export declare const SatelliteIdSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
9
17
|
/**
|
|
10
18
|
* Represents the unique identifier for a satellite.
|
|
11
19
|
* @interface SatelliteId
|
|
@@ -15,14 +23,14 @@ export interface SatelliteId {
|
|
|
15
23
|
* The unique identifier (ID) of the satellite for this application.
|
|
16
24
|
* @type {string}
|
|
17
25
|
*/
|
|
18
|
-
id:
|
|
19
|
-
/**
|
|
20
|
-
* The deprecated unique identifier (ID) of the satellite.
|
|
21
|
-
* @deprecated `satelliteId` will be removed in the future. Use `id` instead.
|
|
22
|
-
* @type {string}
|
|
23
|
-
*/
|
|
24
|
-
satelliteId?: string;
|
|
26
|
+
id: PrincipalText;
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* @see SatelliteIds
|
|
30
|
+
*/
|
|
31
|
+
export declare const SatelliteIdsSchema: z.ZodObject<{
|
|
32
|
+
ids: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>, z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
26
34
|
/**
|
|
27
35
|
* Represents a mapping of satellite identifiers to different configurations based on the mode of the application.
|
|
28
36
|
* @interface SatelliteIds
|
|
@@ -40,8 +48,118 @@ export interface SatelliteIds {
|
|
|
40
48
|
* }
|
|
41
49
|
* @type {Record<JunoConfigMode, string>}
|
|
42
50
|
*/
|
|
43
|
-
ids: Record<JunoConfigMode,
|
|
51
|
+
ids: Record<JunoConfigMode, PrincipalText>;
|
|
44
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* @see JunoConsoleConfig
|
|
55
|
+
*/
|
|
56
|
+
export declare const SatelliteConfigOptionsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
57
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
source: z.ZodString;
|
|
60
|
+
headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
61
|
+
}, z.core.$strict>>>;
|
|
62
|
+
rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
+
source: z.ZodString;
|
|
64
|
+
destination: z.ZodString;
|
|
65
|
+
}, z.core.$strict>>>;
|
|
66
|
+
redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
+
source: z.ZodString;
|
|
68
|
+
location: z.ZodString;
|
|
69
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
|
|
70
|
+
}, z.core.$strict>>>;
|
|
71
|
+
iframe: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
deny: "deny";
|
|
73
|
+
"same-origin": "same-origin";
|
|
74
|
+
"allow-any": "allow-any";
|
|
75
|
+
}>>;
|
|
76
|
+
rawAccess: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
79
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
datastore: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
85
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
authentication: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
internetIdentity: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
91
|
+
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
assertions: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
heapMemory: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean]>>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
freezingThreshold: z.ZodOptional<z.ZodBigInt>;
|
|
99
|
+
reservedCyclesLimit: z.ZodOptional<z.ZodBigInt>;
|
|
100
|
+
logVisibility: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
controllers: "controllers";
|
|
102
|
+
public: "public";
|
|
103
|
+
}>>;
|
|
104
|
+
heapMemoryLimit: z.ZodOptional<z.ZodBigInt>;
|
|
105
|
+
memoryAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
106
|
+
computeAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
112
|
+
source: z.ZodString;
|
|
113
|
+
headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
114
|
+
}, z.core.$strict>>>;
|
|
115
|
+
rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
source: z.ZodString;
|
|
117
|
+
destination: z.ZodString;
|
|
118
|
+
}, z.core.$strict>>>;
|
|
119
|
+
redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
|
+
source: z.ZodString;
|
|
121
|
+
location: z.ZodString;
|
|
122
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
|
|
123
|
+
}, z.core.$strict>>>;
|
|
124
|
+
iframe: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
deny: "deny";
|
|
126
|
+
"same-origin": "same-origin";
|
|
127
|
+
"allow-any": "allow-any";
|
|
128
|
+
}>>;
|
|
129
|
+
rawAccess: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
132
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
133
|
+
}, z.core.$strict>>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
datastore: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
138
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
139
|
+
}, z.core.$strict>>;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
authentication: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
internetIdentity: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
144
|
+
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
assertions: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
heapMemory: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean]>>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
freezingThreshold: z.ZodOptional<z.ZodBigInt>;
|
|
152
|
+
reservedCyclesLimit: z.ZodOptional<z.ZodBigInt>;
|
|
153
|
+
logVisibility: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
controllers: "controllers";
|
|
155
|
+
public: "public";
|
|
156
|
+
}>>;
|
|
157
|
+
heapMemoryLimit: z.ZodOptional<z.ZodBigInt>;
|
|
158
|
+
memoryAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
159
|
+
computeAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
ids: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>, z.ZodString>;
|
|
162
|
+
}, z.core.$strict>]>;
|
|
45
163
|
/**
|
|
46
164
|
* SatelliteConfigOptions interface provides configuration settings that allow for fine-tuning
|
|
47
165
|
* the operational behavior of various aspects of a Satellite, such as storage, datastore,
|
|
@@ -1,5 +1,164 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { type EmulatorConfig } from './configs/emulator.config';
|
|
3
|
+
import { type OrbiterConfig } from './configs/orbiter.config';
|
|
4
|
+
import { type SatelliteConfig } from './configs/satellite.config';
|
|
5
|
+
/**
|
|
6
|
+
* @see JunoConfig
|
|
7
|
+
*/
|
|
8
|
+
export declare const JunoConfigSchema: z.ZodObject<{
|
|
9
|
+
satellite: z.ZodUnion<readonly [z.ZodObject<{
|
|
10
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
+
source: z.ZodString;
|
|
13
|
+
headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
14
|
+
}, z.core.$strict>>>;
|
|
15
|
+
rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
|
+
source: z.ZodString;
|
|
17
|
+
destination: z.ZodString;
|
|
18
|
+
}, z.core.$strict>>>;
|
|
19
|
+
redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20
|
+
source: z.ZodString;
|
|
21
|
+
location: z.ZodString;
|
|
22
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
|
|
23
|
+
}, z.core.$strict>>>;
|
|
24
|
+
iframe: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
deny: "deny";
|
|
26
|
+
"same-origin": "same-origin";
|
|
27
|
+
"allow-any": "allow-any";
|
|
28
|
+
}>>;
|
|
29
|
+
rawAccess: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
32
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
datastore: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
38
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
authentication: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
internetIdentity: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
44
|
+
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
45
|
+
}, z.core.$strict>>;
|
|
46
|
+
}, z.core.$strict>>;
|
|
47
|
+
assertions: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
heapMemory: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean]>>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
freezingThreshold: z.ZodOptional<z.ZodBigInt>;
|
|
52
|
+
reservedCyclesLimit: z.ZodOptional<z.ZodBigInt>;
|
|
53
|
+
logVisibility: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
controllers: "controllers";
|
|
55
|
+
public: "public";
|
|
56
|
+
}>>;
|
|
57
|
+
heapMemoryLimit: z.ZodOptional<z.ZodBigInt>;
|
|
58
|
+
memoryAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
59
|
+
computeAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
65
|
+
source: z.ZodString;
|
|
66
|
+
headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
67
|
+
}, z.core.$strict>>>;
|
|
68
|
+
rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
69
|
+
source: z.ZodString;
|
|
70
|
+
destination: z.ZodString;
|
|
71
|
+
}, z.core.$strict>>>;
|
|
72
|
+
redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
73
|
+
source: z.ZodString;
|
|
74
|
+
location: z.ZodString;
|
|
75
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
|
|
76
|
+
}, z.core.$strict>>>;
|
|
77
|
+
iframe: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
deny: "deny";
|
|
79
|
+
"same-origin": "same-origin";
|
|
80
|
+
"allow-any": "allow-any";
|
|
81
|
+
}>>;
|
|
82
|
+
rawAccess: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
85
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
datastore: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
91
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
authentication: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
internetIdentity: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
derivationOrigin: z.ZodOptional<z.ZodURL>;
|
|
97
|
+
externalAlternativeOrigins: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
assertions: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
heapMemory: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean]>>;
|
|
102
|
+
}, z.core.$strict>>;
|
|
103
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
freezingThreshold: z.ZodOptional<z.ZodBigInt>;
|
|
105
|
+
reservedCyclesLimit: z.ZodOptional<z.ZodBigInt>;
|
|
106
|
+
logVisibility: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
controllers: "controllers";
|
|
108
|
+
public: "public";
|
|
109
|
+
}>>;
|
|
110
|
+
heapMemoryLimit: z.ZodOptional<z.ZodBigInt>;
|
|
111
|
+
memoryAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
112
|
+
computeAllocation: z.ZodOptional<z.ZodBigInt>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
ids: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>, z.ZodString>;
|
|
115
|
+
}, z.core.$strict>]>;
|
|
116
|
+
orbiter: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
119
|
+
ids: z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>, z.ZodString>;
|
|
120
|
+
}, z.core.$strict>]>>;
|
|
121
|
+
emulator: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
122
|
+
runner: z.ZodEnum<{
|
|
123
|
+
docker: "docker";
|
|
124
|
+
}>;
|
|
125
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
126
|
+
target: z.ZodOptional<z.ZodString>;
|
|
127
|
+
skylab: z.ZodObject<{
|
|
128
|
+
ports: z.ZodOptional<z.ZodObject<{
|
|
129
|
+
server: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
admin: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
console: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
}, z.core.$strict>>;
|
|
133
|
+
config: z.ZodString;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
136
|
+
runner: z.ZodEnum<{
|
|
137
|
+
docker: "docker";
|
|
138
|
+
}>;
|
|
139
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
140
|
+
target: z.ZodOptional<z.ZodString>;
|
|
141
|
+
console: z.ZodObject<{
|
|
142
|
+
ports: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
server: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
admin: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
148
|
+
runner: z.ZodEnum<{
|
|
149
|
+
docker: "docker";
|
|
150
|
+
}>;
|
|
151
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
152
|
+
target: z.ZodOptional<z.ZodString>;
|
|
153
|
+
satellite: z.ZodObject<{
|
|
154
|
+
ports: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
server: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
admin: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
}, z.core.$strict>>;
|
|
158
|
+
config: z.ZodString;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
}, z.core.$strict>]>>;
|
|
161
|
+
}, z.core.$strict>;
|
|
3
162
|
/**
|
|
4
163
|
* Represents the overall configuration for Juno.
|
|
5
164
|
* @interface JunoConfig
|
|
@@ -16,4 +175,8 @@ export interface JunoConfig {
|
|
|
16
175
|
* @optional
|
|
17
176
|
*/
|
|
18
177
|
orbiter?: OrbiterConfig;
|
|
178
|
+
/**
|
|
179
|
+
* Your options for the emulator.
|
|
180
|
+
*/
|
|
181
|
+
emulator?: EmulatorConfig;
|
|
19
182
|
}
|
|
@@ -1,18 +1,72 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* @see PermissionText
|
|
4
|
+
*/
|
|
5
|
+
export declare const PermissionTextSchema: z.ZodEnum<{
|
|
6
|
+
controllers: "controllers";
|
|
7
|
+
public: "public";
|
|
8
|
+
private: "private";
|
|
9
|
+
managed: "managed";
|
|
10
|
+
}>;
|
|
1
11
|
/**
|
|
2
12
|
* Represents the permission levels for read and write access.
|
|
3
13
|
* @typedef {'public' | 'private' | 'managed' | 'controllers'} PermissionText
|
|
4
14
|
*/
|
|
5
15
|
export type PermissionText = 'public' | 'private' | 'managed' | 'controllers';
|
|
16
|
+
/**
|
|
17
|
+
* @see MemoryText
|
|
18
|
+
*/
|
|
19
|
+
export declare const MemoryTextSchema: z.ZodEnum<{
|
|
20
|
+
heap: "heap";
|
|
21
|
+
stable: "stable";
|
|
22
|
+
}>;
|
|
6
23
|
/**
|
|
7
24
|
* Represents the memory types.
|
|
8
25
|
* @typedef {'heap' | 'stable'} MemoryText
|
|
9
26
|
*/
|
|
10
27
|
export type MemoryText = 'heap' | 'stable';
|
|
28
|
+
/**
|
|
29
|
+
* @see RulesType
|
|
30
|
+
*/
|
|
31
|
+
export declare const RulesTypeSchema: z.ZodEnum<{
|
|
32
|
+
storage: "storage";
|
|
33
|
+
db: "db";
|
|
34
|
+
}>;
|
|
11
35
|
/**
|
|
12
36
|
* Represents the types of rules.
|
|
13
37
|
* @typedef {'db' | 'storage'} RulesType
|
|
14
38
|
*/
|
|
15
39
|
export type RulesType = 'db' | 'storage';
|
|
40
|
+
/**
|
|
41
|
+
* @see Rule
|
|
42
|
+
*/
|
|
43
|
+
export declare const RuleSchema: z.ZodObject<{
|
|
44
|
+
collection: z.ZodString;
|
|
45
|
+
read: z.ZodEnum<{
|
|
46
|
+
controllers: "controllers";
|
|
47
|
+
public: "public";
|
|
48
|
+
private: "private";
|
|
49
|
+
managed: "managed";
|
|
50
|
+
}>;
|
|
51
|
+
write: z.ZodEnum<{
|
|
52
|
+
controllers: "controllers";
|
|
53
|
+
public: "public";
|
|
54
|
+
private: "private";
|
|
55
|
+
managed: "managed";
|
|
56
|
+
}>;
|
|
57
|
+
memory: z.ZodEnum<{
|
|
58
|
+
heap: "heap";
|
|
59
|
+
stable: "stable";
|
|
60
|
+
}>;
|
|
61
|
+
createdAt: z.ZodOptional<z.ZodBigInt>;
|
|
62
|
+
updatedAt: z.ZodOptional<z.ZodBigInt>;
|
|
63
|
+
version: z.ZodOptional<z.ZodBigInt>;
|
|
64
|
+
maxSize: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
maxChangesPerUser: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
maxCapacity: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
mutablePermissions: z.ZodBoolean;
|
|
68
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, z.core.$strict>;
|
|
16
70
|
/**
|
|
17
71
|
* Represents a rule configuration for a collection.
|
|
18
72
|
* @interface Rule
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* @see MaxMemorySizeConfig
|
|
4
|
+
*/
|
|
5
|
+
export declare const MaxMemorySizeConfigSchema: z.ZodObject<{
|
|
6
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
7
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
8
|
+
}, z.core.$strict>;
|
|
1
9
|
/**
|
|
2
10
|
* Configuration for granting access to features only if the maximum memory size limits are not reached.
|
|
3
11
|
*
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { type MaxMemorySizeConfig } from './feature.config';
|
|
3
|
+
/**
|
|
4
|
+
* @see StorageConfigSourceGlob
|
|
5
|
+
*/
|
|
6
|
+
export declare const StorageConfigSourceGlobSchema: z.ZodString;
|
|
2
7
|
/**
|
|
3
8
|
* Represents a glob pattern for matching files in the Storage configuration.
|
|
4
9
|
* @typedef {string} StorageConfigSourceGlob
|
|
5
10
|
*/
|
|
6
11
|
export type StorageConfigSourceGlob = string;
|
|
12
|
+
/**
|
|
13
|
+
* @see StorageConfigHeader
|
|
14
|
+
*/
|
|
15
|
+
export declare const StorageConfigHeaderSchema: z.ZodObject<{
|
|
16
|
+
source: z.ZodString;
|
|
17
|
+
headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
18
|
+
}, z.core.$strict>;
|
|
7
19
|
/**
|
|
8
20
|
* Headers allow the client and the Storage to pass additional information along with a request or a response.
|
|
9
21
|
* Some sets of headers can affect how the browser handles the page and its content.
|
|
@@ -23,6 +35,13 @@ export interface StorageConfigHeader {
|
|
|
23
35
|
*/
|
|
24
36
|
headers: [string, string][];
|
|
25
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @see StorageConfigRewrite
|
|
40
|
+
*/
|
|
41
|
+
export declare const StorageConfigRewriteSchema: z.ZodObject<{
|
|
42
|
+
source: z.ZodString;
|
|
43
|
+
destination: z.ZodString;
|
|
44
|
+
}, z.core.$strict>;
|
|
26
45
|
/**
|
|
27
46
|
* You can utilize optional rewrites to display the same content for multiple URLs.
|
|
28
47
|
* Rewrites are especially useful when combined with pattern matching, allowing acceptance of any URL that matches the pattern.
|
|
@@ -41,6 +60,14 @@ export interface StorageConfigRewrite {
|
|
|
41
60
|
*/
|
|
42
61
|
destination: string;
|
|
43
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* @see StorageConfigRedirect
|
|
65
|
+
*/
|
|
66
|
+
export declare const StorageConfigRedirectSchema: z.ZodObject<{
|
|
67
|
+
source: z.ZodString;
|
|
68
|
+
location: z.ZodString;
|
|
69
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
|
|
70
|
+
}, z.core.$strict>;
|
|
44
71
|
/**
|
|
45
72
|
* Use a URL redirect to prevent broken links if you've moved a page or to shorten URLs.
|
|
46
73
|
* @interface StorageConfigRedirect
|
|
@@ -62,6 +89,34 @@ export interface StorageConfigRedirect {
|
|
|
62
89
|
*/
|
|
63
90
|
code: 301 | 302;
|
|
64
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* @see StorageConfig
|
|
94
|
+
*/
|
|
95
|
+
export declare const StorageConfigSchema: z.ZodObject<{
|
|
96
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
+
source: z.ZodString;
|
|
98
|
+
headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
|
|
99
|
+
}, z.core.$strict>>>;
|
|
100
|
+
rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
101
|
+
source: z.ZodString;
|
|
102
|
+
destination: z.ZodString;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
105
|
+
source: z.ZodString;
|
|
106
|
+
location: z.ZodString;
|
|
107
|
+
code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
|
|
108
|
+
}, z.core.$strict>>>;
|
|
109
|
+
iframe: z.ZodOptional<z.ZodEnum<{
|
|
110
|
+
deny: "deny";
|
|
111
|
+
"same-origin": "same-origin";
|
|
112
|
+
"allow-any": "allow-any";
|
|
113
|
+
}>>;
|
|
114
|
+
rawAccess: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
maxMemorySize: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
heap: z.ZodOptional<z.ZodBigInt>;
|
|
117
|
+
stable: z.ZodOptional<z.ZodBigInt>;
|
|
118
|
+
}, z.core.$strict>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
65
120
|
/**
|
|
66
121
|
* Configures the hosting behavior of the Storage.
|
|
67
122
|
* @interface StorageConfig
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { type EncodingType } from './encoding';
|
|
3
|
+
/**
|
|
4
|
+
* @see CliConfig
|
|
5
|
+
*/
|
|
6
|
+
export declare const CliConfigSchema: z.ZodObject<{
|
|
7
|
+
source: z.ZodOptional<z.ZodString>;
|
|
8
|
+
ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
gzip: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
10
|
+
encoding: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
11
|
+
identity: "identity";
|
|
12
|
+
gzip: "gzip";
|
|
13
|
+
compress: "compress";
|
|
14
|
+
deflate: "deflate";
|
|
15
|
+
br: "br";
|
|
16
|
+
}>], null>>>;
|
|
17
|
+
predeploy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
postdeploy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
2
20
|
export interface CliConfig {
|
|
3
21
|
/**
|
|
4
22
|
* Specifies the directory from which to deploy to Storage.
|
|
@@ -29,10 +47,10 @@ export interface CliConfig {
|
|
|
29
47
|
* - `.zlib` for deflate,
|
|
30
48
|
* - anything else defaults to `identity`.
|
|
31
49
|
* The "encoding" attribute allows overriding default mappings with an array of glob patterns and encoding types.
|
|
32
|
-
* @type {Array<[string,
|
|
50
|
+
* @type {Array<[string, EncodingType]>}
|
|
33
51
|
* @optional
|
|
34
52
|
*/
|
|
35
|
-
encoding?: Array<[string,
|
|
53
|
+
encoding?: Array<[string, EncodingType]>;
|
|
36
54
|
/**
|
|
37
55
|
* Defines a list of scripts or commands to be run before the deployment process begins.
|
|
38
56
|
* This can be useful for tasks such as compiling assets, running tests, or building production-ready files.
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* see EncodingType
|
|
4
|
+
*/
|
|
5
|
+
export declare const EncodingTypeSchema: z.ZodEnum<{
|
|
6
|
+
identity: "identity";
|
|
7
|
+
gzip: "gzip";
|
|
8
|
+
compress: "compress";
|
|
9
|
+
deflate: "deflate";
|
|
10
|
+
br: "br";
|
|
11
|
+
}>;
|
|
1
12
|
/**
|
|
2
13
|
* Represents the encoding types for assets.
|
|
3
|
-
* @typedef {'identity' | 'gzip' | 'compress' | 'deflate' | 'br'}
|
|
14
|
+
* @typedef {'identity' | 'gzip' | 'compress' | 'deflate' | 'br'} EncodingType
|
|
4
15
|
*/
|
|
5
|
-
export type
|
|
16
|
+
export type EncodingType = 'identity' | 'gzip' | 'compress' | 'deflate' | 'br';
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
/**
|
|
3
|
+
* @see JunoConfigMode
|
|
4
|
+
*/
|
|
5
|
+
export declare const JunoConfigModeSchema: z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>;
|
|
1
6
|
/**
|
|
2
7
|
* Represents the mode of the Juno configuration.
|
|
3
8
|
* @typedef {'production' | string} JunoConfigMode
|
|
4
9
|
*/
|
|
5
10
|
export type JunoConfigMode = 'production' | string;
|
|
11
|
+
/**
|
|
12
|
+
* @see JunoConfigEnv
|
|
13
|
+
*/
|
|
14
|
+
export declare const JunoConfigEnvSchema: z.ZodObject<{
|
|
15
|
+
mode: z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>;
|
|
16
|
+
}, z.core.$strip>;
|
|
6
17
|
/**
|
|
7
18
|
* Represents the environment configuration for Juno.
|
|
8
19
|
* @interface JunoConfigEnv
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Configuration options for Juno CLI",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://juno.build",
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"zod": "^
|
|
44
|
+
"@dfinity/zod-schemas": "^1.0.0",
|
|
45
|
+
"zod": "^3.25"
|
|
45
46
|
}
|
|
46
47
|
}
|
|
File without changes
|