@junobuild/config 0.2.3 → 0.3.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.
@@ -1,13 +1,8 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see PermissionText
4
4
  */
5
- export declare const PermissionTextSchema: z.ZodEnum<{
6
- controllers: "controllers";
7
- public: "public";
8
- private: "private";
9
- managed: "managed";
10
- }>;
5
+ export declare const PermissionTextSchema: z.ZodEnum<["public", "private", "managed", "controllers"]>;
11
6
  /**
12
7
  * Represents the permission levels for read and write access.
13
8
  * @typedef {'public' | 'private' | 'managed' | 'controllers'} PermissionText
@@ -16,10 +11,7 @@ export type PermissionText = 'public' | 'private' | 'managed' | 'controllers';
16
11
  /**
17
12
  * @see MemoryText
18
13
  */
19
- export declare const MemoryTextSchema: z.ZodEnum<{
20
- heap: "heap";
21
- stable: "stable";
22
- }>;
14
+ export declare const MemoryTextSchema: z.ZodEnum<["heap", "stable"]>;
23
15
  /**
24
16
  * Represents the memory types.
25
17
  * @typedef {'heap' | 'stable'} MemoryText
@@ -28,10 +20,7 @@ export type MemoryText = 'heap' | 'stable';
28
20
  /**
29
21
  * @see RulesType
30
22
  */
31
- export declare const RulesTypeSchema: z.ZodEnum<{
32
- storage: "storage";
33
- db: "db";
34
- }>;
23
+ export declare const RulesTypeSchema: z.ZodEnum<["db", "storage"]>;
35
24
  /**
36
25
  * Represents the types of rules.
37
26
  * @typedef {'db' | 'storage'} RulesType
@@ -42,22 +31,9 @@ export type RulesType = 'db' | 'storage';
42
31
  */
43
32
  export declare const RuleSchema: z.ZodObject<{
44
33
  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
- }>;
34
+ read: z.ZodEnum<["public", "private", "managed", "controllers"]>;
35
+ write: z.ZodEnum<["public", "private", "managed", "controllers"]>;
36
+ memory: z.ZodEnum<["heap", "stable"]>;
61
37
  createdAt: z.ZodOptional<z.ZodBigInt>;
62
38
  updatedAt: z.ZodOptional<z.ZodBigInt>;
63
39
  version: z.ZodOptional<z.ZodBigInt>;
@@ -66,7 +42,33 @@ export declare const RuleSchema: z.ZodObject<{
66
42
  maxCapacity: z.ZodOptional<z.ZodNumber>;
67
43
  mutablePermissions: z.ZodBoolean;
68
44
  maxTokens: z.ZodOptional<z.ZodNumber>;
69
- }, z.core.$strict>;
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
+ }>;
70
72
  /**
71
73
  * Represents a rule configuration for a collection.
72
74
  * @interface Rule
@@ -1,11 +1,17 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see MaxMemorySizeConfig
4
4
  */
5
5
  export declare const MaxMemorySizeConfigSchema: z.ZodObject<{
6
6
  heap: z.ZodOptional<z.ZodBigInt>;
7
7
  stable: z.ZodOptional<z.ZodBigInt>;
8
- }, z.core.$strict>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ heap?: bigint | undefined;
10
+ stable?: bigint | undefined;
11
+ }, {
12
+ heap?: bigint | undefined;
13
+ stable?: bigint | undefined;
14
+ }>;
9
15
  /**
10
16
  * Configuration for granting access to features only if the maximum memory size limits are not reached.
11
17
  *
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type MaxMemorySizeConfig } from './feature.config';
3
3
  /**
4
4
  * @see StorageConfigSourceGlob
@@ -14,8 +14,14 @@ 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>>;
18
- }, z.core.$strict>;
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
+ }>;
19
25
  /**
20
26
  * Headers allow the client and the Storage to pass additional information along with a request or a response.
21
27
  * Some sets of headers can affect how the browser handles the page and its content.
@@ -41,7 +47,13 @@ export interface StorageConfigHeader {
41
47
  export declare const StorageConfigRewriteSchema: z.ZodObject<{
42
48
  source: z.ZodString;
43
49
  destination: z.ZodString;
44
- }, z.core.$strict>;
50
+ }, "strict", z.ZodTypeAny, {
51
+ source: string;
52
+ destination: string;
53
+ }, {
54
+ source: string;
55
+ destination: string;
56
+ }>;
45
57
  /**
46
58
  * You can utilize optional rewrites to display the same content for multiple URLs.
47
59
  * Rewrites are especially useful when combined with pattern matching, allowing acceptance of any URL that matches the pattern.
@@ -66,8 +78,16 @@ export interface StorageConfigRewrite {
66
78
  export declare const StorageConfigRedirectSchema: z.ZodObject<{
67
79
  source: z.ZodString;
68
80
  location: z.ZodString;
69
- code: z.ZodUnion<readonly [z.ZodLiteral<301>, z.ZodLiteral<302>]>;
70
- }, z.core.$strict>;
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
+ }>;
71
91
  /**
72
92
  * Use a URL redirect to prevent broken links if you've moved a page or to shorten URLs.
73
93
  * @interface StorageConfigRedirect
@@ -95,28 +115,90 @@ export interface StorageConfigRedirect {
95
115
  export declare const StorageConfigSchema: z.ZodObject<{
96
116
  headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
117
  source: z.ZodString;
98
- headers: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>;
99
- }, z.core.$strict>>>;
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">>;
100
126
  rewrites: z.ZodOptional<z.ZodArray<z.ZodObject<{
101
127
  source: z.ZodString;
102
128
  destination: z.ZodString;
103
- }, z.core.$strict>>>;
129
+ }, "strict", z.ZodTypeAny, {
130
+ source: string;
131
+ destination: string;
132
+ }, {
133
+ source: string;
134
+ destination: string;
135
+ }>, "many">>;
104
136
  redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
105
137
  source: z.ZodString;
106
138
  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
- }>>;
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"]>>;
114
150
  rawAccess: z.ZodOptional<z.ZodBoolean>;
115
151
  maxMemorySize: z.ZodOptional<z.ZodObject<{
116
152
  heap: z.ZodOptional<z.ZodBigInt>;
117
153
  stable: z.ZodOptional<z.ZodBigInt>;
118
- }, z.core.$strict>>;
119
- }, z.core.$strip>;
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
+ }>;
120
202
  /**
121
203
  * Configures the hosting behavior of the Storage.
122
204
  * @interface StorageConfig
@@ -1,22 +1,30 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type EncodingType } from './encoding';
3
3
  /**
4
4
  * @see CliConfig
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>>;
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>;
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
+ }>;
20
28
  export interface CliConfig {
21
29
  /**
22
30
  * Specifies the directory from which to deploy to Storage.
@@ -1,14 +1,8 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * see EncodingType
4
4
  */
5
- export declare const EncodingTypeSchema: z.ZodEnum<{
6
- identity: "identity";
7
- gzip: "gzip";
8
- compress: "compress";
9
- deflate: "deflate";
10
- br: "br";
11
- }>;
5
+ export declare const EncodingTypeSchema: z.ZodEnum<["identity", "gzip", "compress", "deflate", "br"]>;
12
6
  /**
13
7
  * Represents the encoding types for assets.
14
8
  * @typedef {'identity' | 'gzip' | 'compress' | 'deflate' | 'br'} EncodingType
@@ -1,8 +1,8 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see JunoConfigMode
4
4
  */
5
- export declare const JunoConfigModeSchema: z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>;
5
+ export declare const JunoConfigModeSchema: z.ZodUnion<[z.ZodLiteral<"production">, z.ZodString]>;
6
6
  /**
7
7
  * Represents the mode of the Juno configuration.
8
8
  * @typedef {'production' | string} JunoConfigMode
@@ -12,8 +12,12 @@ export type JunoConfigMode = 'production' | string;
12
12
  * @see JunoConfigEnv
13
13
  */
14
14
  export declare const JunoConfigEnvSchema: z.ZodObject<{
15
- mode: z.ZodUnion<readonly [z.ZodLiteral<"production">, z.ZodString]>;
16
- }, z.core.$strip>;
15
+ mode: z.ZodUnion<[z.ZodLiteral<"production">, z.ZodString]>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ mode: string;
18
+ }, {
19
+ mode: string;
20
+ }>;
17
21
  /**
18
22
  * Represents the environment configuration for Juno.
19
23
  * @interface JunoConfigEnv
@@ -0,0 +1,5 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * Ensures reliable validation of PrincipalTextSchema inside z.record.
4
+ */
5
+ export declare const StrictPrincipalTextSchema: z.ZodEffects<z.ZodString, string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/config",
3
- "version": "0.2.3",
3
+ "version": "0.3.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": "^1.0.0",
44
+ "@dfinity/zod-schemas": "^0.0.2",
45
45
  "zod": "^3.25"
46
46
  }
47
47
  }