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