@junobuild/config 0.3.1 → 0.4.1

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.
@@ -2,7 +2,12 @@ import * as z from 'zod';
2
2
  /**
3
3
  * @see PermissionText
4
4
  */
5
- export declare const PermissionTextSchema: z.ZodEnum<["public", "private", "managed", "controllers"]>;
5
+ export declare const PermissionTextSchema: z.ZodEnum<{
6
+ controllers: "controllers";
7
+ public: "public";
8
+ private: "private";
9
+ managed: "managed";
10
+ }>;
6
11
  /**
7
12
  * Represents the permission levels for read and write access.
8
13
  * @typedef {'public' | 'private' | 'managed' | 'controllers'} PermissionText
@@ -11,7 +16,10 @@ export type PermissionText = 'public' | 'private' | 'managed' | 'controllers';
11
16
  /**
12
17
  * @see MemoryText
13
18
  */
14
- export declare const MemoryTextSchema: z.ZodEnum<["heap", "stable"]>;
19
+ export declare const MemoryTextSchema: z.ZodEnum<{
20
+ heap: "heap";
21
+ stable: "stable";
22
+ }>;
15
23
  /**
16
24
  * Represents the memory types.
17
25
  * @typedef {'heap' | 'stable'} MemoryText
@@ -20,7 +28,10 @@ export type MemoryText = 'heap' | 'stable';
20
28
  /**
21
29
  * @see RulesType
22
30
  */
23
- export declare const RulesTypeSchema: z.ZodEnum<["db", "storage"]>;
31
+ export declare const RulesTypeSchema: z.ZodEnum<{
32
+ storage: "storage";
33
+ db: "db";
34
+ }>;
24
35
  /**
25
36
  * Represents the types of rules.
26
37
  * @typedef {'db' | 'storage'} RulesType
@@ -31,9 +42,22 @@ export type RulesType = 'db' | 'storage';
31
42
  */
32
43
  export declare const RuleSchema: z.ZodObject<{
33
44
  collection: z.ZodString;
34
- read: z.ZodEnum<["public", "private", "managed", "controllers"]>;
35
- write: z.ZodEnum<["public", "private", "managed", "controllers"]>;
36
- memory: z.ZodEnum<["heap", "stable"]>;
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
+ }>;
37
61
  createdAt: z.ZodOptional<z.ZodBigInt>;
38
62
  updatedAt: z.ZodOptional<z.ZodBigInt>;
39
63
  version: z.ZodOptional<z.ZodBigInt>;
@@ -42,33 +66,7 @@ export declare const RuleSchema: z.ZodObject<{
42
66
  maxCapacity: z.ZodOptional<z.ZodNumber>;
43
67
  mutablePermissions: z.ZodBoolean;
44
68
  maxTokens: z.ZodOptional<z.ZodNumber>;
45
- }, "strict", z.ZodTypeAny, {
46
- collection: string;
47
- read: "controllers" | "public" | "private" | "managed";
48
- write: "controllers" | "public" | "private" | "managed";
49
- memory: "heap" | "stable";
50
- mutablePermissions: boolean;
51
- version?: bigint | undefined;
52
- createdAt?: bigint | undefined;
53
- updatedAt?: bigint | undefined;
54
- maxSize?: number | undefined;
55
- maxChangesPerUser?: number | undefined;
56
- maxCapacity?: number | undefined;
57
- maxTokens?: number | undefined;
58
- }, {
59
- collection: string;
60
- read: "controllers" | "public" | "private" | "managed";
61
- write: "controllers" | "public" | "private" | "managed";
62
- memory: "heap" | "stable";
63
- mutablePermissions: boolean;
64
- version?: bigint | undefined;
65
- createdAt?: bigint | undefined;
66
- updatedAt?: bigint | undefined;
67
- maxSize?: number | undefined;
68
- maxChangesPerUser?: number | undefined;
69
- maxCapacity?: number | undefined;
70
- maxTokens?: number | undefined;
71
- }>;
69
+ }, z.core.$strict>;
72
70
  /**
73
71
  * Represents a rule configuration for a collection.
74
72
  * @interface Rule
@@ -5,13 +5,7 @@ import * as z from 'zod';
5
5
  export declare const MaxMemorySizeConfigSchema: z.ZodObject<{
6
6
  heap: z.ZodOptional<z.ZodBigInt>;
7
7
  stable: z.ZodOptional<z.ZodBigInt>;
8
- }, "strict", z.ZodTypeAny, {
9
- heap?: bigint | undefined;
10
- stable?: bigint | undefined;
11
- }, {
12
- heap?: bigint | undefined;
13
- stable?: bigint | undefined;
14
- }>;
8
+ }, z.core.$strict>;
15
9
  /**
16
10
  * Configuration for granting access to features only if the maximum memory size limits are not reached.
17
11
  *
@@ -14,14 +14,8 @@ export type StorageConfigSourceGlob = string;
14
14
  */
15
15
  export declare const StorageConfigHeaderSchema: z.ZodObject<{
16
16
  source: z.ZodString;
17
- headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
18
- }, "strict", z.ZodTypeAny, {
19
- source: string;
20
- headers: [string, string][];
21
- }, {
22
- source: string;
23
- headers: [string, string][];
24
- }>;
17
+ headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
18
+ }, z.core.$strict>;
25
19
  /**
26
20
  * Headers allow the client and the Storage to pass additional information along with a request or a response.
27
21
  * Some sets of headers can affect how the browser handles the page and its content.
@@ -47,13 +41,7 @@ export interface StorageConfigHeader {
47
41
  export declare const StorageConfigRewriteSchema: z.ZodObject<{
48
42
  source: z.ZodString;
49
43
  destination: z.ZodString;
50
- }, "strict", z.ZodTypeAny, {
51
- source: string;
52
- destination: string;
53
- }, {
54
- source: string;
55
- destination: string;
56
- }>;
44
+ }, z.core.$strict>;
57
45
  /**
58
46
  * You can utilize optional rewrites to display the same content for multiple URLs.
59
47
  * Rewrites are especially useful when combined with pattern matching, allowing acceptance of any URL that matches the pattern.
@@ -78,16 +66,8 @@ export interface StorageConfigRewrite {
78
66
  export declare const StorageConfigRedirectSchema: z.ZodObject<{
79
67
  source: z.ZodString;
80
68
  location: z.ZodString;
81
- code: z.ZodUnion<[z.ZodLiteral<301>, z.ZodLiteral<302>]>;
82
- }, "strict", z.ZodTypeAny, {
83
- code: 301 | 302;
84
- source: string;
85
- location: string;
86
- }, {
87
- code: 301 | 302;
88
- source: string;
89
- location: string;
90
- }>;
69
+ code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
70
+ }, z.core.$strict>;
91
71
  /**
92
72
  * Use a URL redirect to prevent broken links if you've moved a page or to shorten URLs.
93
73
  * @interface StorageConfigRedirect
@@ -115,90 +95,28 @@ export interface StorageConfigRedirect {
115
95
  export declare const StorageConfigSchema: z.ZodObject<{
116
96
  headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
117
97
  source: z.ZodString;
118
- headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
119
- }, "strict", z.ZodTypeAny, {
120
- source: string;
121
- headers: [string, string][];
122
- }, {
123
- source: string;
124
- headers: [string, string][];
125
- }>, "many">>;
98
+ headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
99
+ }, z.core.$strict>>>;
126
100
  rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
127
101
  source: z.ZodString;
128
102
  destination: z.ZodString;
129
- }, "strict", z.ZodTypeAny, {
130
- source: string;
131
- destination: string;
132
- }, {
133
- source: string;
134
- destination: string;
135
- }>, "many">>;
103
+ }, z.core.$strict>>>;
136
104
  redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
137
105
  source: z.ZodString;
138
106
  location: z.ZodString;
139
- code: z.ZodUnion<[z.ZodLiteral<301>, z.ZodLiteral<302>]>;
140
- }, "strict", z.ZodTypeAny, {
141
- code: 301 | 302;
142
- source: string;
143
- location: string;
144
- }, {
145
- code: 301 | 302;
146
- source: string;
147
- location: string;
148
- }>, "many">>;
149
- iframe: z.ZodOptional<z.ZodEnum<["deny", "same-origin", "allow-any"]>>;
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
+ }>>;
150
114
  rawAccess: z.ZodOptional<z.ZodBoolean>;
151
115
  maxMemorySize: z.ZodOptional<z.ZodObject<{
152
116
  heap: z.ZodOptional<z.ZodBigInt>;
153
117
  stable: z.ZodOptional<z.ZodBigInt>;
154
- }, "strict", z.ZodTypeAny, {
155
- heap?: bigint | undefined;
156
- stable?: bigint | undefined;
157
- }, {
158
- heap?: bigint | undefined;
159
- stable?: bigint | undefined;
160
- }>>;
161
- }, "strip", z.ZodTypeAny, {
162
- headers?: {
163
- source: string;
164
- headers: [string, string][];
165
- }[] | undefined;
166
- rewrites?: {
167
- source: string;
168
- destination: string;
169
- }[] | undefined;
170
- redirects?: {
171
- code: 301 | 302;
172
- source: string;
173
- location: string;
174
- }[] | undefined;
175
- iframe?: "deny" | "same-origin" | "allow-any" | undefined;
176
- rawAccess?: boolean | undefined;
177
- maxMemorySize?: {
178
- heap?: bigint | undefined;
179
- stable?: bigint | undefined;
180
- } | undefined;
181
- }, {
182
- headers?: {
183
- source: string;
184
- headers: [string, string][];
185
- }[] | undefined;
186
- rewrites?: {
187
- source: string;
188
- destination: string;
189
- }[] | undefined;
190
- redirects?: {
191
- code: 301 | 302;
192
- source: string;
193
- location: string;
194
- }[] | undefined;
195
- iframe?: "deny" | "same-origin" | "allow-any" | undefined;
196
- rawAccess?: boolean | undefined;
197
- maxMemorySize?: {
198
- heap?: bigint | undefined;
199
- stable?: bigint | undefined;
200
- } | undefined;
201
- }>;
118
+ }, z.core.$strict>>;
119
+ }, z.core.$strip>;
202
120
  /**
203
121
  * Configures the hosting behavior of the Storage.
204
122
  * @interface StorageConfig
@@ -5,26 +5,18 @@ import { type EncodingType } from './encoding';
5
5
  */
6
6
  export declare const CliConfigSchema: z.ZodObject<{
7
7
  source: z.ZodOptional<z.ZodString>;
8
- ignore: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
- gzip: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
10
- encoding: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<["identity", "gzip", "compress", "deflate", "br"]>], null>, "many">>;
11
- predeploy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
- postdeploy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
- }, "strict", z.ZodTypeAny, {
14
- source?: string | undefined;
15
- gzip?: string | false | undefined;
16
- ignore?: string[] | undefined;
17
- encoding?: [string, "identity" | "gzip" | "compress" | "deflate" | "br"][] | undefined;
18
- predeploy?: string[] | undefined;
19
- postdeploy?: string[] | undefined;
20
- }, {
21
- source?: string | undefined;
22
- gzip?: string | false | undefined;
23
- ignore?: string[] | undefined;
24
- encoding?: [string, "identity" | "gzip" | "compress" | "deflate" | "br"][] | undefined;
25
- predeploy?: string[] | undefined;
26
- postdeploy?: string[] | undefined;
27
- }>;
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>;
28
20
  export interface CliConfig {
29
21
  /**
30
22
  * Specifies the directory from which to deploy to Storage.
@@ -2,7 +2,13 @@ import * as z from 'zod';
2
2
  /**
3
3
  * see EncodingType
4
4
  */
5
- export declare const EncodingTypeSchema: z.ZodEnum<["identity", "gzip", "compress", "deflate", "br"]>;
5
+ export declare const EncodingTypeSchema: z.ZodEnum<{
6
+ identity: "identity";
7
+ gzip: "gzip";
8
+ compress: "compress";
9
+ deflate: "deflate";
10
+ br: "br";
11
+ }>;
6
12
  /**
7
13
  * Represents the encoding types for assets.
8
14
  * @typedef {'identity' | 'gzip' | 'compress' | 'deflate' | 'br'} EncodingType
@@ -2,7 +2,7 @@ import * as z from 'zod';
2
2
  /**
3
3
  * @see JunoConfigMode
4
4
  */
5
- export declare const JunoConfigModeSchema: z.ZodUnion<[z.ZodLiteral<"production">, z.ZodString]>;
5
+ export declare const JunoConfigModeSchema: z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>;
6
6
  /**
7
7
  * Represents the mode of the Juno configuration.
8
8
  * @typedef {'production' | string} JunoConfigMode
@@ -12,12 +12,8 @@ export type JunoConfigMode = 'production' | string;
12
12
  * @see JunoConfigEnv
13
13
  */
14
14
  export declare const JunoConfigEnvSchema: z.ZodObject<{
15
- mode: z.ZodUnion<[z.ZodLiteral<"production">, z.ZodString]>;
16
- }, "strip", z.ZodTypeAny, {
17
- mode: string;
18
- }, {
19
- mode: string;
20
- }>;
15
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>;
16
+ }, z.core.$strip>;
21
17
  /**
22
18
  * Represents the environment configuration for Juno.
23
19
  * @interface JunoConfigEnv
@@ -2,4 +2,4 @@ import * as z from 'zod';
2
2
  /**
3
3
  * Ensures reliable validation of PrincipalTextSchema inside z.record.
4
4
  */
5
- export declare const StrictPrincipalTextSchema: z.ZodEffects<z.ZodString, string, string>;
5
+ export declare const StrictPrincipalTextSchema: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/config",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "Configuration options for Juno CLI",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://juno.build",
43
43
  "peerDependencies": {
44
- "@dfinity/zod-schemas": "^0.0.2",
45
- "zod": "^3.25"
44
+ "@dfinity/zod-schemas": "^2",
45
+ "zod": "^4"
46
46
  }
47
47
  }