@nymbalhq/config 0.0.0-stage → 1.0.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.
@@ -0,0 +1,1138 @@
1
+ import { z } from 'zod';
2
+ export { CommerceSlot } from '@nymbalhq/types';
3
+
4
+ /** The schema's JWT secret when none is configured: fine for development, refused in production. */
5
+ declare const DEFAULT_JWT_SECRET = "dev-secret-please-override-me-1234567890";
6
+ declare const storeSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ currency: z.ZodString;
9
+ locale: z.ZodString;
10
+ timezone: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ name: string;
13
+ currency: string;
14
+ locale: string;
15
+ timezone: string;
16
+ }, {
17
+ name: string;
18
+ currency: string;
19
+ locale: string;
20
+ timezone: string;
21
+ }>;
22
+ declare const infrastructureSchema: z.ZodObject<{
23
+ cloud: z.ZodEnum<["local", "aws", "gcp", "azure", "docker"]>;
24
+ commandStore: z.ZodEnum<["sqlite", "postgres"]>;
25
+ documentStore: z.ZodEnum<["in-memory", "dynamodb", "firestore", "cosmosdb", "postgres-jsonb"]>;
26
+ eventBus: z.ZodEnum<["in-process", "eventbridge", "pubsub", "service-bus", "redis-streams"]>;
27
+ compute: z.ZodEnum<["in-process", "lambda", "cloud-functions", "azure-functions", "worker-threads"]>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
30
+ commandStore: "sqlite" | "postgres";
31
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
32
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
33
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
34
+ }, {
35
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
36
+ commandStore: "sqlite" | "postgres";
37
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
38
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
39
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
40
+ }>;
41
+ declare const securitySchema: z.ZodObject<{
42
+ adapter: z.ZodEnum<["middleware", "cloudflare", "aws-waf", "akamai"]>;
43
+ rateLimit: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
44
+ requests: z.ZodNumber;
45
+ window: z.ZodString;
46
+ action: z.ZodEnum<["block", "challenge", "throttle"]>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ requests: number;
49
+ window: string;
50
+ action: "block" | "challenge" | "throttle";
51
+ }, {
52
+ requests: number;
53
+ window: string;
54
+ action: "block" | "challenge" | "throttle";
55
+ }>>>;
56
+ botProtection: z.ZodDefault<z.ZodObject<{
57
+ mode: z.ZodDefault<z.ZodEnum<["off", "managed", "strict"]>>;
58
+ allowList: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ mode: "strict" | "off" | "managed";
61
+ allowList: string[];
62
+ }, {
63
+ mode?: "strict" | "off" | "managed" | undefined;
64
+ allowList?: string[] | undefined;
65
+ }>>;
66
+ headers: z.ZodDefault<z.ZodObject<{
67
+ hsts: z.ZodDefault<z.ZodBoolean>;
68
+ contentSecurityPolicy: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["strict", "relaxed", "off"]>, z.ZodString]>>;
69
+ referrerPolicy: z.ZodDefault<z.ZodString>;
70
+ xFrameOptions: z.ZodDefault<z.ZodEnum<["deny", "sameorigin"]>>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ hsts: boolean;
73
+ contentSecurityPolicy: string;
74
+ referrerPolicy: string;
75
+ xFrameOptions: "deny" | "sameorigin";
76
+ }, {
77
+ hsts?: boolean | undefined;
78
+ contentSecurityPolicy?: string | undefined;
79
+ referrerPolicy?: string | undefined;
80
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
81
+ }>>;
82
+ csrf: z.ZodDefault<z.ZodBoolean>;
83
+ auth: z.ZodDefault<z.ZodObject<{
84
+ jwtSecret: z.ZodDefault<z.ZodString>;
85
+ accessTtl: z.ZodDefault<z.ZodString>;
86
+ refreshTtl: z.ZodDefault<z.ZodString>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ jwtSecret: string;
89
+ accessTtl: string;
90
+ refreshTtl: string;
91
+ }, {
92
+ jwtSecret?: string | undefined;
93
+ accessTtl?: string | undefined;
94
+ refreshTtl?: string | undefined;
95
+ }>>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
98
+ rateLimit: Record<string, {
99
+ requests: number;
100
+ window: string;
101
+ action: "block" | "challenge" | "throttle";
102
+ }>;
103
+ botProtection: {
104
+ mode: "strict" | "off" | "managed";
105
+ allowList: string[];
106
+ };
107
+ headers: {
108
+ hsts: boolean;
109
+ contentSecurityPolicy: string;
110
+ referrerPolicy: string;
111
+ xFrameOptions: "deny" | "sameorigin";
112
+ };
113
+ csrf: boolean;
114
+ auth: {
115
+ jwtSecret: string;
116
+ accessTtl: string;
117
+ refreshTtl: string;
118
+ };
119
+ }, {
120
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
121
+ rateLimit?: Record<string, {
122
+ requests: number;
123
+ window: string;
124
+ action: "block" | "challenge" | "throttle";
125
+ }> | undefined;
126
+ botProtection?: {
127
+ mode?: "strict" | "off" | "managed" | undefined;
128
+ allowList?: string[] | undefined;
129
+ } | undefined;
130
+ headers?: {
131
+ hsts?: boolean | undefined;
132
+ contentSecurityPolicy?: string | undefined;
133
+ referrerPolicy?: string | undefined;
134
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
135
+ } | undefined;
136
+ csrf?: boolean | undefined;
137
+ auth?: {
138
+ jwtSecret?: string | undefined;
139
+ accessTtl?: string | undefined;
140
+ refreshTtl?: string | undefined;
141
+ } | undefined;
142
+ }>;
143
+ declare const commerceSchema: z.ZodObject<{
144
+ payments: z.ZodObject<{
145
+ provider: z.ZodEnum<["native", "stripe", "custom"]>;
146
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ provider: "native" | "stripe" | "custom";
149
+ config?: Record<string, unknown> | undefined;
150
+ }, {
151
+ provider: "native" | "stripe" | "custom";
152
+ config?: Record<string, unknown> | undefined;
153
+ }>;
154
+ email: z.ZodObject<{
155
+ provider: z.ZodEnum<["native", "smtp", "custom"]>;
156
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ provider: "native" | "custom" | "smtp";
159
+ config?: Record<string, unknown> | undefined;
160
+ }, {
161
+ provider: "native" | "custom" | "smtp";
162
+ config?: Record<string, unknown> | undefined;
163
+ }>;
164
+ reviews: z.ZodObject<{
165
+ provider: z.ZodEnum<["native", "custom"]>;
166
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ provider: "native" | "custom";
169
+ config?: Record<string, unknown> | undefined;
170
+ }, {
171
+ provider: "native" | "custom";
172
+ config?: Record<string, unknown> | undefined;
173
+ }>;
174
+ search: z.ZodObject<{
175
+ provider: z.ZodEnum<["native", "custom"]>;
176
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ provider: "native" | "custom";
179
+ config?: Record<string, unknown> | undefined;
180
+ }, {
181
+ provider: "native" | "custom";
182
+ config?: Record<string, unknown> | undefined;
183
+ }>;
184
+ analytics: z.ZodObject<{
185
+ provider: z.ZodEnum<["native", "custom"]>;
186
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ provider: "native" | "custom";
189
+ config?: Record<string, unknown> | undefined;
190
+ }, {
191
+ provider: "native" | "custom";
192
+ config?: Record<string, unknown> | undefined;
193
+ }>;
194
+ shipping: z.ZodObject<{
195
+ provider: z.ZodEnum<["native", "custom"]>;
196
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ provider: "native" | "custom";
199
+ config?: Record<string, unknown> | undefined;
200
+ }, {
201
+ provider: "native" | "custom";
202
+ config?: Record<string, unknown> | undefined;
203
+ }>;
204
+ tax: z.ZodObject<{
205
+ provider: z.ZodEnum<["native", "custom"]>;
206
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ provider: "native" | "custom";
209
+ config?: Record<string, unknown> | undefined;
210
+ }, {
211
+ provider: "native" | "custom";
212
+ config?: Record<string, unknown> | undefined;
213
+ }>;
214
+ ai: z.ZodObject<{
215
+ provider: z.ZodEnum<["none", "anthropic", "custom"]>;
216
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ provider: "custom" | "none" | "anthropic";
219
+ config?: Record<string, unknown> | undefined;
220
+ }, {
221
+ provider: "custom" | "none" | "anthropic";
222
+ config?: Record<string, unknown> | undefined;
223
+ }>;
224
+ orders: z.ZodDefault<z.ZodObject<{
225
+ numberPrefix: z.ZodDefault<z.ZodString>;
226
+ numberStart: z.ZodDefault<z.ZodNumber>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ numberPrefix: string;
229
+ numberStart: number;
230
+ }, {
231
+ numberPrefix?: string | undefined;
232
+ numberStart?: number | undefined;
233
+ }>>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ payments: {
236
+ provider: "native" | "stripe" | "custom";
237
+ config?: Record<string, unknown> | undefined;
238
+ };
239
+ email: {
240
+ provider: "native" | "custom" | "smtp";
241
+ config?: Record<string, unknown> | undefined;
242
+ };
243
+ reviews: {
244
+ provider: "native" | "custom";
245
+ config?: Record<string, unknown> | undefined;
246
+ };
247
+ search: {
248
+ provider: "native" | "custom";
249
+ config?: Record<string, unknown> | undefined;
250
+ };
251
+ analytics: {
252
+ provider: "native" | "custom";
253
+ config?: Record<string, unknown> | undefined;
254
+ };
255
+ shipping: {
256
+ provider: "native" | "custom";
257
+ config?: Record<string, unknown> | undefined;
258
+ };
259
+ tax: {
260
+ provider: "native" | "custom";
261
+ config?: Record<string, unknown> | undefined;
262
+ };
263
+ ai: {
264
+ provider: "custom" | "none" | "anthropic";
265
+ config?: Record<string, unknown> | undefined;
266
+ };
267
+ orders: {
268
+ numberPrefix: string;
269
+ numberStart: number;
270
+ };
271
+ }, {
272
+ payments: {
273
+ provider: "native" | "stripe" | "custom";
274
+ config?: Record<string, unknown> | undefined;
275
+ };
276
+ email: {
277
+ provider: "native" | "custom" | "smtp";
278
+ config?: Record<string, unknown> | undefined;
279
+ };
280
+ reviews: {
281
+ provider: "native" | "custom";
282
+ config?: Record<string, unknown> | undefined;
283
+ };
284
+ search: {
285
+ provider: "native" | "custom";
286
+ config?: Record<string, unknown> | undefined;
287
+ };
288
+ analytics: {
289
+ provider: "native" | "custom";
290
+ config?: Record<string, unknown> | undefined;
291
+ };
292
+ shipping: {
293
+ provider: "native" | "custom";
294
+ config?: Record<string, unknown> | undefined;
295
+ };
296
+ tax: {
297
+ provider: "native" | "custom";
298
+ config?: Record<string, unknown> | undefined;
299
+ };
300
+ ai: {
301
+ provider: "custom" | "none" | "anthropic";
302
+ config?: Record<string, unknown> | undefined;
303
+ };
304
+ orders?: {
305
+ numberPrefix?: string | undefined;
306
+ numberStart?: number | undefined;
307
+ } | undefined;
308
+ }>;
309
+ declare const httpSchema: z.ZodObject<{
310
+ adapter: z.ZodDefault<z.ZodEnum<["fastify", "hono"]>>;
311
+ port: z.ZodDefault<z.ZodNumber>;
312
+ host: z.ZodDefault<z.ZodString>;
313
+ /** Whether `X-Forwarded-For` sets the client IP the rate limiter keys on; only behind a proxy you run. */
314
+ trustProxy: z.ZodDefault<z.ZodBoolean>;
315
+ cors: z.ZodDefault<z.ZodObject<{
316
+ allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
317
+ credentials: z.ZodDefault<z.ZodBoolean>;
318
+ }, "strip", z.ZodTypeAny, {
319
+ allowedOrigins: string[];
320
+ credentials: boolean;
321
+ }, {
322
+ allowedOrigins?: string[] | undefined;
323
+ credentials?: boolean | undefined;
324
+ }>>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ adapter: "fastify" | "hono";
327
+ port: number;
328
+ host: string;
329
+ trustProxy: boolean;
330
+ cors: {
331
+ allowedOrigins: string[];
332
+ credentials: boolean;
333
+ };
334
+ }, {
335
+ adapter?: "fastify" | "hono" | undefined;
336
+ port?: number | undefined;
337
+ host?: string | undefined;
338
+ trustProxy?: boolean | undefined;
339
+ cors?: {
340
+ allowedOrigins?: string[] | undefined;
341
+ credentials?: boolean | undefined;
342
+ } | undefined;
343
+ }>;
344
+ declare const deploymentSchema: z.ZodObject<{
345
+ strategy: z.ZodDefault<z.ZodEnum<["standard", "blue-green"]>>;
346
+ }, "strip", z.ZodTypeAny, {
347
+ strategy: "standard" | "blue-green";
348
+ }, {
349
+ strategy?: "standard" | "blue-green" | undefined;
350
+ }>;
351
+ declare const featuresSchema: z.ZodObject<{
352
+ staging: z.ZodDefault<z.ZodBoolean>;
353
+ heartbeat: z.ZodDefault<z.ZodBoolean>;
354
+ autoUpdates: z.ZodDefault<z.ZodBoolean>;
355
+ }, "strip", z.ZodTypeAny, {
356
+ staging: boolean;
357
+ heartbeat: boolean;
358
+ autoUpdates: boolean;
359
+ }, {
360
+ staging?: boolean | undefined;
361
+ heartbeat?: boolean | undefined;
362
+ autoUpdates?: boolean | undefined;
363
+ }>;
364
+ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
365
+ store: z.ZodObject<{
366
+ name: z.ZodString;
367
+ currency: z.ZodString;
368
+ locale: z.ZodString;
369
+ timezone: z.ZodString;
370
+ }, "strip", z.ZodTypeAny, {
371
+ name: string;
372
+ currency: string;
373
+ locale: string;
374
+ timezone: string;
375
+ }, {
376
+ name: string;
377
+ currency: string;
378
+ locale: string;
379
+ timezone: string;
380
+ }>;
381
+ template: z.ZodEnum<["astro", "nextjs"]>;
382
+ infrastructure: z.ZodObject<{
383
+ cloud: z.ZodEnum<["local", "aws", "gcp", "azure", "docker"]>;
384
+ commandStore: z.ZodEnum<["sqlite", "postgres"]>;
385
+ documentStore: z.ZodEnum<["in-memory", "dynamodb", "firestore", "cosmosdb", "postgres-jsonb"]>;
386
+ eventBus: z.ZodEnum<["in-process", "eventbridge", "pubsub", "service-bus", "redis-streams"]>;
387
+ compute: z.ZodEnum<["in-process", "lambda", "cloud-functions", "azure-functions", "worker-threads"]>;
388
+ }, "strip", z.ZodTypeAny, {
389
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
390
+ commandStore: "sqlite" | "postgres";
391
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
392
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
393
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
394
+ }, {
395
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
396
+ commandStore: "sqlite" | "postgres";
397
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
398
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
399
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
400
+ }>;
401
+ security: z.ZodObject<{
402
+ adapter: z.ZodEnum<["middleware", "cloudflare", "aws-waf", "akamai"]>;
403
+ rateLimit: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
404
+ requests: z.ZodNumber;
405
+ window: z.ZodString;
406
+ action: z.ZodEnum<["block", "challenge", "throttle"]>;
407
+ }, "strip", z.ZodTypeAny, {
408
+ requests: number;
409
+ window: string;
410
+ action: "block" | "challenge" | "throttle";
411
+ }, {
412
+ requests: number;
413
+ window: string;
414
+ action: "block" | "challenge" | "throttle";
415
+ }>>>;
416
+ botProtection: z.ZodDefault<z.ZodObject<{
417
+ mode: z.ZodDefault<z.ZodEnum<["off", "managed", "strict"]>>;
418
+ allowList: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
419
+ }, "strip", z.ZodTypeAny, {
420
+ mode: "strict" | "off" | "managed";
421
+ allowList: string[];
422
+ }, {
423
+ mode?: "strict" | "off" | "managed" | undefined;
424
+ allowList?: string[] | undefined;
425
+ }>>;
426
+ headers: z.ZodDefault<z.ZodObject<{
427
+ hsts: z.ZodDefault<z.ZodBoolean>;
428
+ contentSecurityPolicy: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["strict", "relaxed", "off"]>, z.ZodString]>>;
429
+ referrerPolicy: z.ZodDefault<z.ZodString>;
430
+ xFrameOptions: z.ZodDefault<z.ZodEnum<["deny", "sameorigin"]>>;
431
+ }, "strip", z.ZodTypeAny, {
432
+ hsts: boolean;
433
+ contentSecurityPolicy: string;
434
+ referrerPolicy: string;
435
+ xFrameOptions: "deny" | "sameorigin";
436
+ }, {
437
+ hsts?: boolean | undefined;
438
+ contentSecurityPolicy?: string | undefined;
439
+ referrerPolicy?: string | undefined;
440
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
441
+ }>>;
442
+ csrf: z.ZodDefault<z.ZodBoolean>;
443
+ auth: z.ZodDefault<z.ZodObject<{
444
+ jwtSecret: z.ZodDefault<z.ZodString>;
445
+ accessTtl: z.ZodDefault<z.ZodString>;
446
+ refreshTtl: z.ZodDefault<z.ZodString>;
447
+ }, "strip", z.ZodTypeAny, {
448
+ jwtSecret: string;
449
+ accessTtl: string;
450
+ refreshTtl: string;
451
+ }, {
452
+ jwtSecret?: string | undefined;
453
+ accessTtl?: string | undefined;
454
+ refreshTtl?: string | undefined;
455
+ }>>;
456
+ }, "strip", z.ZodTypeAny, {
457
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
458
+ rateLimit: Record<string, {
459
+ requests: number;
460
+ window: string;
461
+ action: "block" | "challenge" | "throttle";
462
+ }>;
463
+ botProtection: {
464
+ mode: "strict" | "off" | "managed";
465
+ allowList: string[];
466
+ };
467
+ headers: {
468
+ hsts: boolean;
469
+ contentSecurityPolicy: string;
470
+ referrerPolicy: string;
471
+ xFrameOptions: "deny" | "sameorigin";
472
+ };
473
+ csrf: boolean;
474
+ auth: {
475
+ jwtSecret: string;
476
+ accessTtl: string;
477
+ refreshTtl: string;
478
+ };
479
+ }, {
480
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
481
+ rateLimit?: Record<string, {
482
+ requests: number;
483
+ window: string;
484
+ action: "block" | "challenge" | "throttle";
485
+ }> | undefined;
486
+ botProtection?: {
487
+ mode?: "strict" | "off" | "managed" | undefined;
488
+ allowList?: string[] | undefined;
489
+ } | undefined;
490
+ headers?: {
491
+ hsts?: boolean | undefined;
492
+ contentSecurityPolicy?: string | undefined;
493
+ referrerPolicy?: string | undefined;
494
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
495
+ } | undefined;
496
+ csrf?: boolean | undefined;
497
+ auth?: {
498
+ jwtSecret?: string | undefined;
499
+ accessTtl?: string | undefined;
500
+ refreshTtl?: string | undefined;
501
+ } | undefined;
502
+ }>;
503
+ commerce: z.ZodObject<{
504
+ payments: z.ZodObject<{
505
+ provider: z.ZodEnum<["native", "stripe", "custom"]>;
506
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
507
+ }, "strip", z.ZodTypeAny, {
508
+ provider: "native" | "stripe" | "custom";
509
+ config?: Record<string, unknown> | undefined;
510
+ }, {
511
+ provider: "native" | "stripe" | "custom";
512
+ config?: Record<string, unknown> | undefined;
513
+ }>;
514
+ email: z.ZodObject<{
515
+ provider: z.ZodEnum<["native", "smtp", "custom"]>;
516
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
517
+ }, "strip", z.ZodTypeAny, {
518
+ provider: "native" | "custom" | "smtp";
519
+ config?: Record<string, unknown> | undefined;
520
+ }, {
521
+ provider: "native" | "custom" | "smtp";
522
+ config?: Record<string, unknown> | undefined;
523
+ }>;
524
+ reviews: z.ZodObject<{
525
+ provider: z.ZodEnum<["native", "custom"]>;
526
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
527
+ }, "strip", z.ZodTypeAny, {
528
+ provider: "native" | "custom";
529
+ config?: Record<string, unknown> | undefined;
530
+ }, {
531
+ provider: "native" | "custom";
532
+ config?: Record<string, unknown> | undefined;
533
+ }>;
534
+ search: z.ZodObject<{
535
+ provider: z.ZodEnum<["native", "custom"]>;
536
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
537
+ }, "strip", z.ZodTypeAny, {
538
+ provider: "native" | "custom";
539
+ config?: Record<string, unknown> | undefined;
540
+ }, {
541
+ provider: "native" | "custom";
542
+ config?: Record<string, unknown> | undefined;
543
+ }>;
544
+ analytics: z.ZodObject<{
545
+ provider: z.ZodEnum<["native", "custom"]>;
546
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ provider: "native" | "custom";
549
+ config?: Record<string, unknown> | undefined;
550
+ }, {
551
+ provider: "native" | "custom";
552
+ config?: Record<string, unknown> | undefined;
553
+ }>;
554
+ shipping: z.ZodObject<{
555
+ provider: z.ZodEnum<["native", "custom"]>;
556
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
557
+ }, "strip", z.ZodTypeAny, {
558
+ provider: "native" | "custom";
559
+ config?: Record<string, unknown> | undefined;
560
+ }, {
561
+ provider: "native" | "custom";
562
+ config?: Record<string, unknown> | undefined;
563
+ }>;
564
+ tax: z.ZodObject<{
565
+ provider: z.ZodEnum<["native", "custom"]>;
566
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ provider: "native" | "custom";
569
+ config?: Record<string, unknown> | undefined;
570
+ }, {
571
+ provider: "native" | "custom";
572
+ config?: Record<string, unknown> | undefined;
573
+ }>;
574
+ ai: z.ZodObject<{
575
+ provider: z.ZodEnum<["none", "anthropic", "custom"]>;
576
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
577
+ }, "strip", z.ZodTypeAny, {
578
+ provider: "custom" | "none" | "anthropic";
579
+ config?: Record<string, unknown> | undefined;
580
+ }, {
581
+ provider: "custom" | "none" | "anthropic";
582
+ config?: Record<string, unknown> | undefined;
583
+ }>;
584
+ orders: z.ZodDefault<z.ZodObject<{
585
+ numberPrefix: z.ZodDefault<z.ZodString>;
586
+ numberStart: z.ZodDefault<z.ZodNumber>;
587
+ }, "strip", z.ZodTypeAny, {
588
+ numberPrefix: string;
589
+ numberStart: number;
590
+ }, {
591
+ numberPrefix?: string | undefined;
592
+ numberStart?: number | undefined;
593
+ }>>;
594
+ }, "strip", z.ZodTypeAny, {
595
+ payments: {
596
+ provider: "native" | "stripe" | "custom";
597
+ config?: Record<string, unknown> | undefined;
598
+ };
599
+ email: {
600
+ provider: "native" | "custom" | "smtp";
601
+ config?: Record<string, unknown> | undefined;
602
+ };
603
+ reviews: {
604
+ provider: "native" | "custom";
605
+ config?: Record<string, unknown> | undefined;
606
+ };
607
+ search: {
608
+ provider: "native" | "custom";
609
+ config?: Record<string, unknown> | undefined;
610
+ };
611
+ analytics: {
612
+ provider: "native" | "custom";
613
+ config?: Record<string, unknown> | undefined;
614
+ };
615
+ shipping: {
616
+ provider: "native" | "custom";
617
+ config?: Record<string, unknown> | undefined;
618
+ };
619
+ tax: {
620
+ provider: "native" | "custom";
621
+ config?: Record<string, unknown> | undefined;
622
+ };
623
+ ai: {
624
+ provider: "custom" | "none" | "anthropic";
625
+ config?: Record<string, unknown> | undefined;
626
+ };
627
+ orders: {
628
+ numberPrefix: string;
629
+ numberStart: number;
630
+ };
631
+ }, {
632
+ payments: {
633
+ provider: "native" | "stripe" | "custom";
634
+ config?: Record<string, unknown> | undefined;
635
+ };
636
+ email: {
637
+ provider: "native" | "custom" | "smtp";
638
+ config?: Record<string, unknown> | undefined;
639
+ };
640
+ reviews: {
641
+ provider: "native" | "custom";
642
+ config?: Record<string, unknown> | undefined;
643
+ };
644
+ search: {
645
+ provider: "native" | "custom";
646
+ config?: Record<string, unknown> | undefined;
647
+ };
648
+ analytics: {
649
+ provider: "native" | "custom";
650
+ config?: Record<string, unknown> | undefined;
651
+ };
652
+ shipping: {
653
+ provider: "native" | "custom";
654
+ config?: Record<string, unknown> | undefined;
655
+ };
656
+ tax: {
657
+ provider: "native" | "custom";
658
+ config?: Record<string, unknown> | undefined;
659
+ };
660
+ ai: {
661
+ provider: "custom" | "none" | "anthropic";
662
+ config?: Record<string, unknown> | undefined;
663
+ };
664
+ orders?: {
665
+ numberPrefix?: string | undefined;
666
+ numberStart?: number | undefined;
667
+ } | undefined;
668
+ }>;
669
+ http: z.ZodObject<{
670
+ adapter: z.ZodDefault<z.ZodEnum<["fastify", "hono"]>>;
671
+ port: z.ZodDefault<z.ZodNumber>;
672
+ host: z.ZodDefault<z.ZodString>;
673
+ /** Whether `X-Forwarded-For` sets the client IP the rate limiter keys on; only behind a proxy you run. */
674
+ trustProxy: z.ZodDefault<z.ZodBoolean>;
675
+ cors: z.ZodDefault<z.ZodObject<{
676
+ allowedOrigins: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
677
+ credentials: z.ZodDefault<z.ZodBoolean>;
678
+ }, "strip", z.ZodTypeAny, {
679
+ allowedOrigins: string[];
680
+ credentials: boolean;
681
+ }, {
682
+ allowedOrigins?: string[] | undefined;
683
+ credentials?: boolean | undefined;
684
+ }>>;
685
+ }, "strip", z.ZodTypeAny, {
686
+ adapter: "fastify" | "hono";
687
+ port: number;
688
+ host: string;
689
+ trustProxy: boolean;
690
+ cors: {
691
+ allowedOrigins: string[];
692
+ credentials: boolean;
693
+ };
694
+ }, {
695
+ adapter?: "fastify" | "hono" | undefined;
696
+ port?: number | undefined;
697
+ host?: string | undefined;
698
+ trustProxy?: boolean | undefined;
699
+ cors?: {
700
+ allowedOrigins?: string[] | undefined;
701
+ credentials?: boolean | undefined;
702
+ } | undefined;
703
+ }>;
704
+ deployment: z.ZodObject<{
705
+ strategy: z.ZodDefault<z.ZodEnum<["standard", "blue-green"]>>;
706
+ }, "strip", z.ZodTypeAny, {
707
+ strategy: "standard" | "blue-green";
708
+ }, {
709
+ strategy?: "standard" | "blue-green" | undefined;
710
+ }>;
711
+ features: z.ZodDefault<z.ZodObject<{
712
+ staging: z.ZodDefault<z.ZodBoolean>;
713
+ heartbeat: z.ZodDefault<z.ZodBoolean>;
714
+ autoUpdates: z.ZodDefault<z.ZodBoolean>;
715
+ }, "strip", z.ZodTypeAny, {
716
+ staging: boolean;
717
+ heartbeat: boolean;
718
+ autoUpdates: boolean;
719
+ }, {
720
+ staging?: boolean | undefined;
721
+ heartbeat?: boolean | undefined;
722
+ autoUpdates?: boolean | undefined;
723
+ }>>;
724
+ }, "strip", z.ZodTypeAny, {
725
+ store: {
726
+ name: string;
727
+ currency: string;
728
+ locale: string;
729
+ timezone: string;
730
+ };
731
+ template: "astro" | "nextjs";
732
+ infrastructure: {
733
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
734
+ commandStore: "sqlite" | "postgres";
735
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
736
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
737
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
738
+ };
739
+ security: {
740
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
741
+ rateLimit: Record<string, {
742
+ requests: number;
743
+ window: string;
744
+ action: "block" | "challenge" | "throttle";
745
+ }>;
746
+ botProtection: {
747
+ mode: "strict" | "off" | "managed";
748
+ allowList: string[];
749
+ };
750
+ headers: {
751
+ hsts: boolean;
752
+ contentSecurityPolicy: string;
753
+ referrerPolicy: string;
754
+ xFrameOptions: "deny" | "sameorigin";
755
+ };
756
+ csrf: boolean;
757
+ auth: {
758
+ jwtSecret: string;
759
+ accessTtl: string;
760
+ refreshTtl: string;
761
+ };
762
+ };
763
+ commerce: {
764
+ payments: {
765
+ provider: "native" | "stripe" | "custom";
766
+ config?: Record<string, unknown> | undefined;
767
+ };
768
+ email: {
769
+ provider: "native" | "custom" | "smtp";
770
+ config?: Record<string, unknown> | undefined;
771
+ };
772
+ reviews: {
773
+ provider: "native" | "custom";
774
+ config?: Record<string, unknown> | undefined;
775
+ };
776
+ search: {
777
+ provider: "native" | "custom";
778
+ config?: Record<string, unknown> | undefined;
779
+ };
780
+ analytics: {
781
+ provider: "native" | "custom";
782
+ config?: Record<string, unknown> | undefined;
783
+ };
784
+ shipping: {
785
+ provider: "native" | "custom";
786
+ config?: Record<string, unknown> | undefined;
787
+ };
788
+ tax: {
789
+ provider: "native" | "custom";
790
+ config?: Record<string, unknown> | undefined;
791
+ };
792
+ ai: {
793
+ provider: "custom" | "none" | "anthropic";
794
+ config?: Record<string, unknown> | undefined;
795
+ };
796
+ orders: {
797
+ numberPrefix: string;
798
+ numberStart: number;
799
+ };
800
+ };
801
+ http: {
802
+ adapter: "fastify" | "hono";
803
+ port: number;
804
+ host: string;
805
+ trustProxy: boolean;
806
+ cors: {
807
+ allowedOrigins: string[];
808
+ credentials: boolean;
809
+ };
810
+ };
811
+ deployment: {
812
+ strategy: "standard" | "blue-green";
813
+ };
814
+ features: {
815
+ staging: boolean;
816
+ heartbeat: boolean;
817
+ autoUpdates: boolean;
818
+ };
819
+ }, {
820
+ store: {
821
+ name: string;
822
+ currency: string;
823
+ locale: string;
824
+ timezone: string;
825
+ };
826
+ template: "astro" | "nextjs";
827
+ infrastructure: {
828
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
829
+ commandStore: "sqlite" | "postgres";
830
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
831
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
832
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
833
+ };
834
+ security: {
835
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
836
+ rateLimit?: Record<string, {
837
+ requests: number;
838
+ window: string;
839
+ action: "block" | "challenge" | "throttle";
840
+ }> | undefined;
841
+ botProtection?: {
842
+ mode?: "strict" | "off" | "managed" | undefined;
843
+ allowList?: string[] | undefined;
844
+ } | undefined;
845
+ headers?: {
846
+ hsts?: boolean | undefined;
847
+ contentSecurityPolicy?: string | undefined;
848
+ referrerPolicy?: string | undefined;
849
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
850
+ } | undefined;
851
+ csrf?: boolean | undefined;
852
+ auth?: {
853
+ jwtSecret?: string | undefined;
854
+ accessTtl?: string | undefined;
855
+ refreshTtl?: string | undefined;
856
+ } | undefined;
857
+ };
858
+ commerce: {
859
+ payments: {
860
+ provider: "native" | "stripe" | "custom";
861
+ config?: Record<string, unknown> | undefined;
862
+ };
863
+ email: {
864
+ provider: "native" | "custom" | "smtp";
865
+ config?: Record<string, unknown> | undefined;
866
+ };
867
+ reviews: {
868
+ provider: "native" | "custom";
869
+ config?: Record<string, unknown> | undefined;
870
+ };
871
+ search: {
872
+ provider: "native" | "custom";
873
+ config?: Record<string, unknown> | undefined;
874
+ };
875
+ analytics: {
876
+ provider: "native" | "custom";
877
+ config?: Record<string, unknown> | undefined;
878
+ };
879
+ shipping: {
880
+ provider: "native" | "custom";
881
+ config?: Record<string, unknown> | undefined;
882
+ };
883
+ tax: {
884
+ provider: "native" | "custom";
885
+ config?: Record<string, unknown> | undefined;
886
+ };
887
+ ai: {
888
+ provider: "custom" | "none" | "anthropic";
889
+ config?: Record<string, unknown> | undefined;
890
+ };
891
+ orders?: {
892
+ numberPrefix?: string | undefined;
893
+ numberStart?: number | undefined;
894
+ } | undefined;
895
+ };
896
+ http: {
897
+ adapter?: "fastify" | "hono" | undefined;
898
+ port?: number | undefined;
899
+ host?: string | undefined;
900
+ trustProxy?: boolean | undefined;
901
+ cors?: {
902
+ allowedOrigins?: string[] | undefined;
903
+ credentials?: boolean | undefined;
904
+ } | undefined;
905
+ };
906
+ deployment: {
907
+ strategy?: "standard" | "blue-green" | undefined;
908
+ };
909
+ features?: {
910
+ staging?: boolean | undefined;
911
+ heartbeat?: boolean | undefined;
912
+ autoUpdates?: boolean | undefined;
913
+ } | undefined;
914
+ }>, {
915
+ store: {
916
+ name: string;
917
+ currency: string;
918
+ locale: string;
919
+ timezone: string;
920
+ };
921
+ template: "astro" | "nextjs";
922
+ infrastructure: {
923
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
924
+ commandStore: "sqlite" | "postgres";
925
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
926
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
927
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
928
+ };
929
+ security: {
930
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
931
+ rateLimit: Record<string, {
932
+ requests: number;
933
+ window: string;
934
+ action: "block" | "challenge" | "throttle";
935
+ }>;
936
+ botProtection: {
937
+ mode: "strict" | "off" | "managed";
938
+ allowList: string[];
939
+ };
940
+ headers: {
941
+ hsts: boolean;
942
+ contentSecurityPolicy: string;
943
+ referrerPolicy: string;
944
+ xFrameOptions: "deny" | "sameorigin";
945
+ };
946
+ csrf: boolean;
947
+ auth: {
948
+ jwtSecret: string;
949
+ accessTtl: string;
950
+ refreshTtl: string;
951
+ };
952
+ };
953
+ commerce: {
954
+ payments: {
955
+ provider: "native" | "stripe" | "custom";
956
+ config?: Record<string, unknown> | undefined;
957
+ };
958
+ email: {
959
+ provider: "native" | "custom" | "smtp";
960
+ config?: Record<string, unknown> | undefined;
961
+ };
962
+ reviews: {
963
+ provider: "native" | "custom";
964
+ config?: Record<string, unknown> | undefined;
965
+ };
966
+ search: {
967
+ provider: "native" | "custom";
968
+ config?: Record<string, unknown> | undefined;
969
+ };
970
+ analytics: {
971
+ provider: "native" | "custom";
972
+ config?: Record<string, unknown> | undefined;
973
+ };
974
+ shipping: {
975
+ provider: "native" | "custom";
976
+ config?: Record<string, unknown> | undefined;
977
+ };
978
+ tax: {
979
+ provider: "native" | "custom";
980
+ config?: Record<string, unknown> | undefined;
981
+ };
982
+ ai: {
983
+ provider: "custom" | "none" | "anthropic";
984
+ config?: Record<string, unknown> | undefined;
985
+ };
986
+ orders: {
987
+ numberPrefix: string;
988
+ numberStart: number;
989
+ };
990
+ };
991
+ http: {
992
+ adapter: "fastify" | "hono";
993
+ port: number;
994
+ host: string;
995
+ trustProxy: boolean;
996
+ cors: {
997
+ allowedOrigins: string[];
998
+ credentials: boolean;
999
+ };
1000
+ };
1001
+ deployment: {
1002
+ strategy: "standard" | "blue-green";
1003
+ };
1004
+ features: {
1005
+ staging: boolean;
1006
+ heartbeat: boolean;
1007
+ autoUpdates: boolean;
1008
+ };
1009
+ }, {
1010
+ store: {
1011
+ name: string;
1012
+ currency: string;
1013
+ locale: string;
1014
+ timezone: string;
1015
+ };
1016
+ template: "astro" | "nextjs";
1017
+ infrastructure: {
1018
+ cloud: "local" | "aws" | "gcp" | "azure" | "docker";
1019
+ commandStore: "sqlite" | "postgres";
1020
+ documentStore: "in-memory" | "dynamodb" | "firestore" | "cosmosdb" | "postgres-jsonb";
1021
+ eventBus: "in-process" | "eventbridge" | "pubsub" | "service-bus" | "redis-streams";
1022
+ compute: "in-process" | "lambda" | "cloud-functions" | "azure-functions" | "worker-threads";
1023
+ };
1024
+ security: {
1025
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
1026
+ rateLimit?: Record<string, {
1027
+ requests: number;
1028
+ window: string;
1029
+ action: "block" | "challenge" | "throttle";
1030
+ }> | undefined;
1031
+ botProtection?: {
1032
+ mode?: "strict" | "off" | "managed" | undefined;
1033
+ allowList?: string[] | undefined;
1034
+ } | undefined;
1035
+ headers?: {
1036
+ hsts?: boolean | undefined;
1037
+ contentSecurityPolicy?: string | undefined;
1038
+ referrerPolicy?: string | undefined;
1039
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
1040
+ } | undefined;
1041
+ csrf?: boolean | undefined;
1042
+ auth?: {
1043
+ jwtSecret?: string | undefined;
1044
+ accessTtl?: string | undefined;
1045
+ refreshTtl?: string | undefined;
1046
+ } | undefined;
1047
+ };
1048
+ commerce: {
1049
+ payments: {
1050
+ provider: "native" | "stripe" | "custom";
1051
+ config?: Record<string, unknown> | undefined;
1052
+ };
1053
+ email: {
1054
+ provider: "native" | "custom" | "smtp";
1055
+ config?: Record<string, unknown> | undefined;
1056
+ };
1057
+ reviews: {
1058
+ provider: "native" | "custom";
1059
+ config?: Record<string, unknown> | undefined;
1060
+ };
1061
+ search: {
1062
+ provider: "native" | "custom";
1063
+ config?: Record<string, unknown> | undefined;
1064
+ };
1065
+ analytics: {
1066
+ provider: "native" | "custom";
1067
+ config?: Record<string, unknown> | undefined;
1068
+ };
1069
+ shipping: {
1070
+ provider: "native" | "custom";
1071
+ config?: Record<string, unknown> | undefined;
1072
+ };
1073
+ tax: {
1074
+ provider: "native" | "custom";
1075
+ config?: Record<string, unknown> | undefined;
1076
+ };
1077
+ ai: {
1078
+ provider: "custom" | "none" | "anthropic";
1079
+ config?: Record<string, unknown> | undefined;
1080
+ };
1081
+ orders?: {
1082
+ numberPrefix?: string | undefined;
1083
+ numberStart?: number | undefined;
1084
+ } | undefined;
1085
+ };
1086
+ http: {
1087
+ adapter?: "fastify" | "hono" | undefined;
1088
+ port?: number | undefined;
1089
+ host?: string | undefined;
1090
+ trustProxy?: boolean | undefined;
1091
+ cors?: {
1092
+ allowedOrigins?: string[] | undefined;
1093
+ credentials?: boolean | undefined;
1094
+ } | undefined;
1095
+ };
1096
+ deployment: {
1097
+ strategy?: "standard" | "blue-green" | undefined;
1098
+ };
1099
+ features?: {
1100
+ staging?: boolean | undefined;
1101
+ heartbeat?: boolean | undefined;
1102
+ autoUpdates?: boolean | undefined;
1103
+ } | undefined;
1104
+ }>;
1105
+ type NymbalConfigInput = z.input<typeof nymbalConfigSchema>;
1106
+ type NymbalConfig = z.output<typeof nymbalConfigSchema>;
1107
+
1108
+ declare function defineConfig<T extends NymbalConfigInput>(config: T): T;
1109
+
1110
+ declare function env(key: string, defaultValue?: string): string;
1111
+ declare function envOptional(key: string): string | undefined;
1112
+ declare function envNumber(key: string, defaultValue?: number): number;
1113
+ declare function envBool(key: string, defaultValue?: boolean): boolean;
1114
+
1115
+ /**
1116
+ * The providers each commerce slot accepts. A provider that needs an SDK lives in an `@nymbalhq/adapter-*` package the
1117
+ * kernel loads only when the config names it; `custom` takes the adapter a project passes to `createApp`.
1118
+ */
1119
+ declare const KNOWN_PROVIDERS: {
1120
+ readonly payments: readonly ["native", "stripe", "custom"];
1121
+ readonly email: readonly ["native", "smtp", "custom"];
1122
+ readonly reviews: readonly ["native", "custom"];
1123
+ readonly search: readonly ["native", "custom"];
1124
+ readonly analytics: readonly ["native", "custom"];
1125
+ readonly shipping: readonly ["native", "custom"];
1126
+ readonly tax: readonly ["native", "custom"];
1127
+ readonly ai: readonly ["none", "anthropic", "custom"];
1128
+ };
1129
+
1130
+ interface LoadedConfig {
1131
+ config: NymbalConfig;
1132
+ path: string;
1133
+ projectRoot: string;
1134
+ }
1135
+ declare function findConfigFile(startDir: string): string | null;
1136
+ declare function loadConfig(startDir?: string): Promise<LoadedConfig>;
1137
+
1138
+ export { DEFAULT_JWT_SECRET, KNOWN_PROVIDERS, type LoadedConfig, type NymbalConfig, type NymbalConfigInput, commerceSchema, defineConfig, deploymentSchema, env, envBool, envNumber, envOptional, featuresSchema, findConfigFile, httpSchema, infrastructureSchema, loadConfig, nymbalConfigSchema, securitySchema, storeSchema };