@nymbalhq/config 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- export { CommerceSlot } from '@nymbalhq/types';
2
+ import { CommerceSlotAdapters } from '@nymbalhq/types';
3
+ export { CommerceSlot, Slot } from '@nymbalhq/types';
3
4
 
4
5
  /** The schema's JWT secret when none is configured: fine for development, refused in production. */
5
6
  declare const DEFAULT_JWT_SECRET = "dev-secret-please-override-me-1234567890";
@@ -19,26 +20,202 @@ declare const storeSchema: z.ZodObject<{
19
20
  locale: string;
20
21
  timezone: string;
21
22
  }>;
22
- declare const infrastructureSchema: z.ZodObject<{
23
- cloud: z.ZodEnum<["local", "aws", "gcp", "azure", "docker"]>;
23
+ /** The shared Redis connection of the `redis` document store and the `redis-streams` bus. */
24
+ declare const redisSchema: z.ZodObject<{
25
+ /** Defaults to `REDIS_URL`. */
26
+ url: z.ZodOptional<z.ZodString>;
27
+ /** Namespaces every key and stream; defaults to `NYMBAL_REDIS_PREFIX`, then `'nymbal'`. */
28
+ prefix: z.ZodOptional<z.ZodString>;
29
+ /** How long a publish waits for the groups it delivers to (default 15 000). */
30
+ ackTimeoutMs: z.ZodOptional<z.ZodNumber>;
31
+ /** How long an entry may stay pending on a consumer before a live one takes it over (default 5 000). */
32
+ claimIdleMs: z.ZodOptional<z.ZodNumber>;
33
+ /** The approximate length each stream is trimmed to (default 10 000). */
34
+ streamMaxLen: z.ZodOptional<z.ZodNumber>;
35
+ }, "strict", z.ZodTypeAny, {
36
+ url?: string | undefined;
37
+ prefix?: string | undefined;
38
+ ackTimeoutMs?: number | undefined;
39
+ claimIdleMs?: number | undefined;
40
+ streamMaxLen?: number | undefined;
41
+ }, {
42
+ url?: string | undefined;
43
+ prefix?: string | undefined;
44
+ ackTimeoutMs?: number | undefined;
45
+ claimIdleMs?: number | undefined;
46
+ streamMaxLen?: number | undefined;
47
+ }>;
48
+ /**
49
+ * The bucket `media: 's3'` stores in. Each field falls back to the environment in the platform; credentials are never
50
+ * config keys: the AWS SDK's default chain provides them.
51
+ */
52
+ declare const s3Schema: z.ZodObject<{
53
+ /** Defaults to `S3_BUCKET`; one of the two is required. */
54
+ bucket: z.ZodOptional<z.ZodString>;
55
+ /** Defaults to `AWS_REGION`, then `'us-east-1'`. */
56
+ region: z.ZodOptional<z.ZodString>;
57
+ /** An S3-compatible API (MinIO, R2); defaults to `S3_ENDPOINT`, then AWS. */
58
+ endpoint: z.ZodOptional<z.ZodString>;
59
+ /** Where every object key starts; defaults to `NYMBAL_S3_PREFIX`, then none. */
60
+ prefix: z.ZodOptional<z.ZodString>;
61
+ /** Where the bucket's objects are served from (a CDN); defaults to `S3_PUBLIC_URL`, then the bucket's own URL. */
62
+ publicUrl: z.ZodOptional<z.ZodString>;
63
+ /** Path-style requests; true by default when an endpoint is set. */
64
+ forcePathStyle: z.ZodOptional<z.ZodBoolean>;
65
+ }, "strict", z.ZodTypeAny, {
66
+ prefix?: string | undefined;
67
+ bucket?: string | undefined;
68
+ region?: string | undefined;
69
+ endpoint?: string | undefined;
70
+ publicUrl?: string | undefined;
71
+ forcePathStyle?: boolean | undefined;
72
+ }, {
73
+ prefix?: string | undefined;
74
+ bucket?: string | undefined;
75
+ region?: string | undefined;
76
+ endpoint?: string | undefined;
77
+ publicUrl?: string | undefined;
78
+ forcePathStyle?: boolean | undefined;
79
+ }>;
80
+ declare const infrastructureSchema: z.ZodEffects<z.ZodObject<{
24
81
  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";
82
+ documentStore: z.ZodEnum<["in-memory", "redis", "postgres-jsonb"]>;
83
+ eventBus: z.ZodEnum<["in-process", "redis-streams"]>;
84
+ media: z.ZodDefault<z.ZodEnum<["local-fs", "s3"]>>;
85
+ redis: z.ZodOptional<z.ZodObject<{
86
+ /** Defaults to `REDIS_URL`. */
87
+ url: z.ZodOptional<z.ZodString>;
88
+ /** Namespaces every key and stream; defaults to `NYMBAL_REDIS_PREFIX`, then `'nymbal'`. */
89
+ prefix: z.ZodOptional<z.ZodString>;
90
+ /** How long a publish waits for the groups it delivers to (default 15 000). */
91
+ ackTimeoutMs: z.ZodOptional<z.ZodNumber>;
92
+ /** How long an entry may stay pending on a consumer before a live one takes it over (default 5 000). */
93
+ claimIdleMs: z.ZodOptional<z.ZodNumber>;
94
+ /** The approximate length each stream is trimmed to (default 10 000). */
95
+ streamMaxLen: z.ZodOptional<z.ZodNumber>;
96
+ }, "strict", z.ZodTypeAny, {
97
+ url?: string | undefined;
98
+ prefix?: string | undefined;
99
+ ackTimeoutMs?: number | undefined;
100
+ claimIdleMs?: number | undefined;
101
+ streamMaxLen?: number | undefined;
102
+ }, {
103
+ url?: string | undefined;
104
+ prefix?: string | undefined;
105
+ ackTimeoutMs?: number | undefined;
106
+ claimIdleMs?: number | undefined;
107
+ streamMaxLen?: number | undefined;
108
+ }>>;
109
+ s3: z.ZodOptional<z.ZodObject<{
110
+ /** Defaults to `S3_BUCKET`; one of the two is required. */
111
+ bucket: z.ZodOptional<z.ZodString>;
112
+ /** Defaults to `AWS_REGION`, then `'us-east-1'`. */
113
+ region: z.ZodOptional<z.ZodString>;
114
+ /** An S3-compatible API (MinIO, R2); defaults to `S3_ENDPOINT`, then AWS. */
115
+ endpoint: z.ZodOptional<z.ZodString>;
116
+ /** Where every object key starts; defaults to `NYMBAL_S3_PREFIX`, then none. */
117
+ prefix: z.ZodOptional<z.ZodString>;
118
+ /** Where the bucket's objects are served from (a CDN); defaults to `S3_PUBLIC_URL`, then the bucket's own URL. */
119
+ publicUrl: z.ZodOptional<z.ZodString>;
120
+ /** Path-style requests; true by default when an endpoint is set. */
121
+ forcePathStyle: z.ZodOptional<z.ZodBoolean>;
122
+ }, "strict", z.ZodTypeAny, {
123
+ prefix?: string | undefined;
124
+ bucket?: string | undefined;
125
+ region?: string | undefined;
126
+ endpoint?: string | undefined;
127
+ publicUrl?: string | undefined;
128
+ forcePathStyle?: boolean | undefined;
129
+ }, {
130
+ prefix?: string | undefined;
131
+ bucket?: string | undefined;
132
+ region?: string | undefined;
133
+ endpoint?: string | undefined;
134
+ publicUrl?: string | undefined;
135
+ forcePathStyle?: boolean | undefined;
136
+ }>>;
137
+ }, "strict", z.ZodTypeAny, {
30
138
  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";
139
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
140
+ eventBus: "in-process" | "redis-streams";
141
+ media: "local-fs" | "s3";
142
+ redis?: {
143
+ url?: string | undefined;
144
+ prefix?: string | undefined;
145
+ ackTimeoutMs?: number | undefined;
146
+ claimIdleMs?: number | undefined;
147
+ streamMaxLen?: number | undefined;
148
+ } | undefined;
149
+ s3?: {
150
+ prefix?: string | undefined;
151
+ bucket?: string | undefined;
152
+ region?: string | undefined;
153
+ endpoint?: string | undefined;
154
+ publicUrl?: string | undefined;
155
+ forcePathStyle?: boolean | undefined;
156
+ } | undefined;
34
157
  }, {
35
- cloud: "local" | "aws" | "gcp" | "azure" | "docker";
36
158
  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";
159
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
160
+ eventBus: "in-process" | "redis-streams";
161
+ redis?: {
162
+ url?: string | undefined;
163
+ prefix?: string | undefined;
164
+ ackTimeoutMs?: number | undefined;
165
+ claimIdleMs?: number | undefined;
166
+ streamMaxLen?: number | undefined;
167
+ } | undefined;
168
+ media?: "local-fs" | "s3" | undefined;
169
+ s3?: {
170
+ prefix?: string | undefined;
171
+ bucket?: string | undefined;
172
+ region?: string | undefined;
173
+ endpoint?: string | undefined;
174
+ publicUrl?: string | undefined;
175
+ forcePathStyle?: boolean | undefined;
176
+ } | undefined;
177
+ }>, {
178
+ commandStore: "sqlite" | "postgres";
179
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
180
+ eventBus: "in-process" | "redis-streams";
181
+ media: "local-fs" | "s3";
182
+ redis?: {
183
+ url?: string | undefined;
184
+ prefix?: string | undefined;
185
+ ackTimeoutMs?: number | undefined;
186
+ claimIdleMs?: number | undefined;
187
+ streamMaxLen?: number | undefined;
188
+ } | undefined;
189
+ s3?: {
190
+ prefix?: string | undefined;
191
+ bucket?: string | undefined;
192
+ region?: string | undefined;
193
+ endpoint?: string | undefined;
194
+ publicUrl?: string | undefined;
195
+ forcePathStyle?: boolean | undefined;
196
+ } | undefined;
197
+ }, {
198
+ commandStore: "sqlite" | "postgres";
199
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
200
+ eventBus: "in-process" | "redis-streams";
201
+ redis?: {
202
+ url?: string | undefined;
203
+ prefix?: string | undefined;
204
+ ackTimeoutMs?: number | undefined;
205
+ claimIdleMs?: number | undefined;
206
+ streamMaxLen?: number | undefined;
207
+ } | undefined;
208
+ media?: "local-fs" | "s3" | undefined;
209
+ s3?: {
210
+ prefix?: string | undefined;
211
+ bucket?: string | undefined;
212
+ region?: string | undefined;
213
+ endpoint?: string | undefined;
214
+ publicUrl?: string | undefined;
215
+ forcePathStyle?: boolean | undefined;
216
+ } | undefined;
40
217
  }>;
41
- declare const securitySchema: z.ZodObject<{
218
+ declare const securitySchema: z.ZodEffects<z.ZodObject<{
42
219
  adapter: z.ZodEnum<["middleware", "cloudflare", "aws-waf", "akamai"]>;
43
220
  rateLimit: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
44
221
  requests: z.ZodNumber;
@@ -93,6 +270,41 @@ declare const securitySchema: z.ZodObject<{
93
270
  accessTtl?: string | undefined;
94
271
  refreshTtl?: string | undefined;
95
272
  }>>;
273
+ cloudflare: z.ZodOptional<z.ZodObject<{
274
+ zoneId: z.ZodOptional<z.ZodString>;
275
+ apiToken: z.ZodOptional<z.ZodString>;
276
+ /** The Cloudflare v4 API; the adapter defaults it to https://api.cloudflare.com/client/v4. */
277
+ apiBase: z.ZodOptional<z.ZodString>;
278
+ }, "strip", z.ZodTypeAny, {
279
+ zoneId?: string | undefined;
280
+ apiToken?: string | undefined;
281
+ apiBase?: string | undefined;
282
+ }, {
283
+ zoneId?: string | undefined;
284
+ apiToken?: string | undefined;
285
+ apiBase?: string | undefined;
286
+ }>>;
287
+ geo: z.ZodDefault<z.ZodObject<{
288
+ block: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
289
+ }, "strip", z.ZodTypeAny, {
290
+ block: string[];
291
+ }, {
292
+ block?: string[] | undefined;
293
+ }>>;
294
+ customRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
295
+ name: z.ZodString;
296
+ expression: z.ZodString;
297
+ action: z.ZodEnum<["block", "managed_challenge", "js_challenge", "log"]>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ name: string;
300
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
301
+ expression: string;
302
+ }, {
303
+ name: string;
304
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
305
+ expression: string;
306
+ }>, "many">>;
307
+ managedRulesets: z.ZodDefault<z.ZodArray<z.ZodEnum<["cloudflare", "owasp"]>, "many">>;
96
308
  }, "strip", z.ZodTypeAny, {
97
309
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
98
310
  rateLimit: Record<string, {
@@ -116,8 +328,27 @@ declare const securitySchema: z.ZodObject<{
116
328
  accessTtl: string;
117
329
  refreshTtl: string;
118
330
  };
331
+ geo: {
332
+ block: string[];
333
+ };
334
+ customRules: {
335
+ name: string;
336
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
337
+ expression: string;
338
+ }[];
339
+ managedRulesets: ("cloudflare" | "owasp")[];
340
+ cloudflare?: {
341
+ zoneId?: string | undefined;
342
+ apiToken?: string | undefined;
343
+ apiBase?: string | undefined;
344
+ } | undefined;
119
345
  }, {
120
346
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
347
+ cloudflare?: {
348
+ zoneId?: string | undefined;
349
+ apiToken?: string | undefined;
350
+ apiBase?: string | undefined;
351
+ } | undefined;
121
352
  rateLimit?: Record<string, {
122
353
  requests: number;
123
354
  window: string;
@@ -139,87 +370,202 @@ declare const securitySchema: z.ZodObject<{
139
370
  accessTtl?: string | undefined;
140
371
  refreshTtl?: string | undefined;
141
372
  } | undefined;
373
+ geo?: {
374
+ block?: string[] | undefined;
375
+ } | undefined;
376
+ customRules?: {
377
+ name: string;
378
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
379
+ expression: string;
380
+ }[] | undefined;
381
+ managedRulesets?: ("cloudflare" | "owasp")[] | undefined;
382
+ }>, {
383
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
384
+ rateLimit: Record<string, {
385
+ requests: number;
386
+ window: string;
387
+ action: "block" | "challenge" | "throttle";
388
+ }>;
389
+ botProtection: {
390
+ mode: "strict" | "off" | "managed";
391
+ allowList: string[];
392
+ };
393
+ headers: {
394
+ hsts: boolean;
395
+ contentSecurityPolicy: string;
396
+ referrerPolicy: string;
397
+ xFrameOptions: "deny" | "sameorigin";
398
+ };
399
+ csrf: boolean;
400
+ auth: {
401
+ jwtSecret: string;
402
+ accessTtl: string;
403
+ refreshTtl: string;
404
+ };
405
+ geo: {
406
+ block: string[];
407
+ };
408
+ customRules: {
409
+ name: string;
410
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
411
+ expression: string;
412
+ }[];
413
+ managedRulesets: ("cloudflare" | "owasp")[];
414
+ cloudflare?: {
415
+ zoneId?: string | undefined;
416
+ apiToken?: string | undefined;
417
+ apiBase?: string | undefined;
418
+ } | undefined;
419
+ }, {
420
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
421
+ cloudflare?: {
422
+ zoneId?: string | undefined;
423
+ apiToken?: string | undefined;
424
+ apiBase?: string | undefined;
425
+ } | undefined;
426
+ rateLimit?: Record<string, {
427
+ requests: number;
428
+ window: string;
429
+ action: "block" | "challenge" | "throttle";
430
+ }> | undefined;
431
+ botProtection?: {
432
+ mode?: "strict" | "off" | "managed" | undefined;
433
+ allowList?: string[] | undefined;
434
+ } | undefined;
435
+ headers?: {
436
+ hsts?: boolean | undefined;
437
+ contentSecurityPolicy?: string | undefined;
438
+ referrerPolicy?: string | undefined;
439
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
440
+ } | undefined;
441
+ csrf?: boolean | undefined;
442
+ auth?: {
443
+ jwtSecret?: string | undefined;
444
+ accessTtl?: string | undefined;
445
+ refreshTtl?: string | undefined;
446
+ } | undefined;
447
+ geo?: {
448
+ block?: string[] | undefined;
449
+ } | undefined;
450
+ customRules?: {
451
+ name: string;
452
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
453
+ expression: string;
454
+ }[] | undefined;
455
+ managedRulesets?: ("cloudflare" | "owasp")[] | undefined;
142
456
  }>;
143
457
  declare const commerceSchema: z.ZodObject<{
144
458
  payments: z.ZodObject<{
145
459
  provider: z.ZodEnum<["native", "stripe", "custom"]>;
146
460
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
461
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
462
+ package: z.ZodOptional<z.ZodString>;
147
463
  }, "strip", z.ZodTypeAny, {
148
464
  provider: "native" | "stripe" | "custom";
149
465
  config?: Record<string, unknown> | undefined;
466
+ package?: string | undefined;
150
467
  }, {
151
468
  provider: "native" | "stripe" | "custom";
152
469
  config?: Record<string, unknown> | undefined;
470
+ package?: string | undefined;
153
471
  }>;
154
472
  email: z.ZodObject<{
155
473
  provider: z.ZodEnum<["native", "smtp", "custom"]>;
156
474
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
475
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
476
+ package: z.ZodOptional<z.ZodString>;
157
477
  }, "strip", z.ZodTypeAny, {
158
478
  provider: "native" | "custom" | "smtp";
159
479
  config?: Record<string, unknown> | undefined;
480
+ package?: string | undefined;
160
481
  }, {
161
482
  provider: "native" | "custom" | "smtp";
162
483
  config?: Record<string, unknown> | undefined;
484
+ package?: string | undefined;
163
485
  }>;
164
486
  reviews: z.ZodObject<{
165
487
  provider: z.ZodEnum<["native", "custom"]>;
166
488
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
489
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
490
+ package: z.ZodOptional<z.ZodString>;
167
491
  }, "strip", z.ZodTypeAny, {
168
492
  provider: "native" | "custom";
169
493
  config?: Record<string, unknown> | undefined;
494
+ package?: string | undefined;
170
495
  }, {
171
496
  provider: "native" | "custom";
172
497
  config?: Record<string, unknown> | undefined;
498
+ package?: string | undefined;
173
499
  }>;
174
500
  search: z.ZodObject<{
175
501
  provider: z.ZodEnum<["native", "custom"]>;
176
502
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
503
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
504
+ package: z.ZodOptional<z.ZodString>;
177
505
  }, "strip", z.ZodTypeAny, {
178
506
  provider: "native" | "custom";
179
507
  config?: Record<string, unknown> | undefined;
508
+ package?: string | undefined;
180
509
  }, {
181
510
  provider: "native" | "custom";
182
511
  config?: Record<string, unknown> | undefined;
512
+ package?: string | undefined;
183
513
  }>;
184
514
  analytics: z.ZodObject<{
185
515
  provider: z.ZodEnum<["native", "custom"]>;
186
516
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
517
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
518
+ package: z.ZodOptional<z.ZodString>;
187
519
  }, "strip", z.ZodTypeAny, {
188
520
  provider: "native" | "custom";
189
521
  config?: Record<string, unknown> | undefined;
522
+ package?: string | undefined;
190
523
  }, {
191
524
  provider: "native" | "custom";
192
525
  config?: Record<string, unknown> | undefined;
526
+ package?: string | undefined;
193
527
  }>;
194
528
  shipping: z.ZodObject<{
195
529
  provider: z.ZodEnum<["native", "custom"]>;
196
530
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
531
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
532
+ package: z.ZodOptional<z.ZodString>;
197
533
  }, "strip", z.ZodTypeAny, {
198
534
  provider: "native" | "custom";
199
535
  config?: Record<string, unknown> | undefined;
536
+ package?: string | undefined;
200
537
  }, {
201
538
  provider: "native" | "custom";
202
539
  config?: Record<string, unknown> | undefined;
540
+ package?: string | undefined;
203
541
  }>;
204
542
  tax: z.ZodObject<{
205
543
  provider: z.ZodEnum<["native", "custom"]>;
206
544
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
545
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
546
+ package: z.ZodOptional<z.ZodString>;
207
547
  }, "strip", z.ZodTypeAny, {
208
548
  provider: "native" | "custom";
209
549
  config?: Record<string, unknown> | undefined;
550
+ package?: string | undefined;
210
551
  }, {
211
552
  provider: "native" | "custom";
212
553
  config?: Record<string, unknown> | undefined;
554
+ package?: string | undefined;
213
555
  }>;
214
556
  ai: z.ZodObject<{
215
557
  provider: z.ZodEnum<["none", "anthropic", "custom"]>;
216
558
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
559
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
560
+ package: z.ZodOptional<z.ZodString>;
217
561
  }, "strip", z.ZodTypeAny, {
218
562
  provider: "custom" | "none" | "anthropic";
219
563
  config?: Record<string, unknown> | undefined;
564
+ package?: string | undefined;
220
565
  }, {
221
566
  provider: "custom" | "none" | "anthropic";
222
567
  config?: Record<string, unknown> | undefined;
568
+ package?: string | undefined;
223
569
  }>;
224
570
  orders: z.ZodDefault<z.ZodObject<{
225
571
  numberPrefix: z.ZodDefault<z.ZodString>;
@@ -235,34 +581,42 @@ declare const commerceSchema: z.ZodObject<{
235
581
  payments: {
236
582
  provider: "native" | "stripe" | "custom";
237
583
  config?: Record<string, unknown> | undefined;
584
+ package?: string | undefined;
238
585
  };
239
586
  email: {
240
587
  provider: "native" | "custom" | "smtp";
241
588
  config?: Record<string, unknown> | undefined;
589
+ package?: string | undefined;
242
590
  };
243
591
  reviews: {
244
592
  provider: "native" | "custom";
245
593
  config?: Record<string, unknown> | undefined;
594
+ package?: string | undefined;
246
595
  };
247
596
  search: {
248
597
  provider: "native" | "custom";
249
598
  config?: Record<string, unknown> | undefined;
599
+ package?: string | undefined;
250
600
  };
251
601
  analytics: {
252
602
  provider: "native" | "custom";
253
603
  config?: Record<string, unknown> | undefined;
604
+ package?: string | undefined;
254
605
  };
255
606
  shipping: {
256
607
  provider: "native" | "custom";
257
608
  config?: Record<string, unknown> | undefined;
609
+ package?: string | undefined;
258
610
  };
259
611
  tax: {
260
612
  provider: "native" | "custom";
261
613
  config?: Record<string, unknown> | undefined;
614
+ package?: string | undefined;
262
615
  };
263
616
  ai: {
264
617
  provider: "custom" | "none" | "anthropic";
265
618
  config?: Record<string, unknown> | undefined;
619
+ package?: string | undefined;
266
620
  };
267
621
  orders: {
268
622
  numberPrefix: string;
@@ -272,34 +626,42 @@ declare const commerceSchema: z.ZodObject<{
272
626
  payments: {
273
627
  provider: "native" | "stripe" | "custom";
274
628
  config?: Record<string, unknown> | undefined;
629
+ package?: string | undefined;
275
630
  };
276
631
  email: {
277
632
  provider: "native" | "custom" | "smtp";
278
633
  config?: Record<string, unknown> | undefined;
634
+ package?: string | undefined;
279
635
  };
280
636
  reviews: {
281
637
  provider: "native" | "custom";
282
638
  config?: Record<string, unknown> | undefined;
639
+ package?: string | undefined;
283
640
  };
284
641
  search: {
285
642
  provider: "native" | "custom";
286
643
  config?: Record<string, unknown> | undefined;
644
+ package?: string | undefined;
287
645
  };
288
646
  analytics: {
289
647
  provider: "native" | "custom";
290
648
  config?: Record<string, unknown> | undefined;
649
+ package?: string | undefined;
291
650
  };
292
651
  shipping: {
293
652
  provider: "native" | "custom";
294
653
  config?: Record<string, unknown> | undefined;
654
+ package?: string | undefined;
295
655
  };
296
656
  tax: {
297
657
  provider: "native" | "custom";
298
658
  config?: Record<string, unknown> | undefined;
659
+ package?: string | undefined;
299
660
  };
300
661
  ai: {
301
662
  provider: "custom" | "none" | "anthropic";
302
663
  config?: Record<string, unknown> | undefined;
664
+ package?: string | undefined;
303
665
  };
304
666
  orders?: {
305
667
  numberPrefix?: string | undefined;
@@ -361,6 +723,87 @@ declare const featuresSchema: z.ZodObject<{
361
723
  heartbeat?: boolean | undefined;
362
724
  autoUpdates?: boolean | undefined;
363
725
  }>;
726
+ /**
727
+ * The bucket delivered events past retention are archived to before they are deleted. Its objects hold customer
728
+ * data, so it must be private: never the media bucket, which serves its objects publicly. Credentials come from the
729
+ * AWS SDK's default chain, as `infrastructure.s3`'s do.
730
+ */
731
+ declare const eventArchiveSchema: z.ZodObject<{
732
+ adapter: z.ZodLiteral<"s3">;
733
+ bucket: z.ZodString;
734
+ /** Where every archive key starts; none when not given. */
735
+ prefix: z.ZodOptional<z.ZodString>;
736
+ /** `'us-east-1'` when not given. */
737
+ region: z.ZodOptional<z.ZodString>;
738
+ /** An S3-compatible API (MinIO, R2). */
739
+ endpoint: z.ZodOptional<z.ZodString>;
740
+ /** Path-style requests; true by default when an endpoint is set. */
741
+ forcePathStyle: z.ZodOptional<z.ZodBoolean>;
742
+ }, "strict", z.ZodTypeAny, {
743
+ bucket: string;
744
+ adapter: "s3";
745
+ prefix?: string | undefined;
746
+ region?: string | undefined;
747
+ endpoint?: string | undefined;
748
+ forcePathStyle?: boolean | undefined;
749
+ }, {
750
+ bucket: string;
751
+ adapter: "s3";
752
+ prefix?: string | undefined;
753
+ region?: string | undefined;
754
+ endpoint?: string | undefined;
755
+ forcePathStyle?: boolean | undefined;
756
+ }>;
757
+ declare const eventsSchema: z.ZodObject<{
758
+ /** Days a delivered event stays in the log. */
759
+ retentionDays: z.ZodDefault<z.ZodNumber>;
760
+ archive: z.ZodOptional<z.ZodObject<{
761
+ adapter: z.ZodLiteral<"s3">;
762
+ bucket: z.ZodString;
763
+ /** Where every archive key starts; none when not given. */
764
+ prefix: z.ZodOptional<z.ZodString>;
765
+ /** `'us-east-1'` when not given. */
766
+ region: z.ZodOptional<z.ZodString>;
767
+ /** An S3-compatible API (MinIO, R2). */
768
+ endpoint: z.ZodOptional<z.ZodString>;
769
+ /** Path-style requests; true by default when an endpoint is set. */
770
+ forcePathStyle: z.ZodOptional<z.ZodBoolean>;
771
+ }, "strict", z.ZodTypeAny, {
772
+ bucket: string;
773
+ adapter: "s3";
774
+ prefix?: string | undefined;
775
+ region?: string | undefined;
776
+ endpoint?: string | undefined;
777
+ forcePathStyle?: boolean | undefined;
778
+ }, {
779
+ bucket: string;
780
+ adapter: "s3";
781
+ prefix?: string | undefined;
782
+ region?: string | undefined;
783
+ endpoint?: string | undefined;
784
+ forcePathStyle?: boolean | undefined;
785
+ }>>;
786
+ }, "strict", z.ZodTypeAny, {
787
+ retentionDays: number;
788
+ archive?: {
789
+ bucket: string;
790
+ adapter: "s3";
791
+ prefix?: string | undefined;
792
+ region?: string | undefined;
793
+ endpoint?: string | undefined;
794
+ forcePathStyle?: boolean | undefined;
795
+ } | undefined;
796
+ }, {
797
+ retentionDays?: number | undefined;
798
+ archive?: {
799
+ bucket: string;
800
+ adapter: "s3";
801
+ prefix?: string | undefined;
802
+ region?: string | undefined;
803
+ endpoint?: string | undefined;
804
+ forcePathStyle?: boolean | undefined;
805
+ } | undefined;
806
+ }>;
364
807
  declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
365
808
  store: z.ZodObject<{
366
809
  name: z.ZodString;
@@ -379,26 +822,145 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
379
822
  timezone: string;
380
823
  }>;
381
824
  template: z.ZodEnum<["astro", "nextjs"]>;
382
- infrastructure: z.ZodObject<{
383
- cloud: z.ZodEnum<["local", "aws", "gcp", "azure", "docker"]>;
825
+ infrastructure: z.ZodEffects<z.ZodObject<{
384
826
  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";
827
+ documentStore: z.ZodEnum<["in-memory", "redis", "postgres-jsonb"]>;
828
+ eventBus: z.ZodEnum<["in-process", "redis-streams"]>;
829
+ media: z.ZodDefault<z.ZodEnum<["local-fs", "s3"]>>;
830
+ redis: z.ZodOptional<z.ZodObject<{
831
+ /** Defaults to `REDIS_URL`. */
832
+ url: z.ZodOptional<z.ZodString>;
833
+ /** Namespaces every key and stream; defaults to `NYMBAL_REDIS_PREFIX`, then `'nymbal'`. */
834
+ prefix: z.ZodOptional<z.ZodString>;
835
+ /** How long a publish waits for the groups it delivers to (default 15 000). */
836
+ ackTimeoutMs: z.ZodOptional<z.ZodNumber>;
837
+ /** How long an entry may stay pending on a consumer before a live one takes it over (default 5 000). */
838
+ claimIdleMs: z.ZodOptional<z.ZodNumber>;
839
+ /** The approximate length each stream is trimmed to (default 10 000). */
840
+ streamMaxLen: z.ZodOptional<z.ZodNumber>;
841
+ }, "strict", z.ZodTypeAny, {
842
+ url?: string | undefined;
843
+ prefix?: string | undefined;
844
+ ackTimeoutMs?: number | undefined;
845
+ claimIdleMs?: number | undefined;
846
+ streamMaxLen?: number | undefined;
847
+ }, {
848
+ url?: string | undefined;
849
+ prefix?: string | undefined;
850
+ ackTimeoutMs?: number | undefined;
851
+ claimIdleMs?: number | undefined;
852
+ streamMaxLen?: number | undefined;
853
+ }>>;
854
+ s3: z.ZodOptional<z.ZodObject<{
855
+ /** Defaults to `S3_BUCKET`; one of the two is required. */
856
+ bucket: z.ZodOptional<z.ZodString>;
857
+ /** Defaults to `AWS_REGION`, then `'us-east-1'`. */
858
+ region: z.ZodOptional<z.ZodString>;
859
+ /** An S3-compatible API (MinIO, R2); defaults to `S3_ENDPOINT`, then AWS. */
860
+ endpoint: z.ZodOptional<z.ZodString>;
861
+ /** Where every object key starts; defaults to `NYMBAL_S3_PREFIX`, then none. */
862
+ prefix: z.ZodOptional<z.ZodString>;
863
+ /** Where the bucket's objects are served from (a CDN); defaults to `S3_PUBLIC_URL`, then the bucket's own URL. */
864
+ publicUrl: z.ZodOptional<z.ZodString>;
865
+ /** Path-style requests; true by default when an endpoint is set. */
866
+ forcePathStyle: z.ZodOptional<z.ZodBoolean>;
867
+ }, "strict", z.ZodTypeAny, {
868
+ prefix?: string | undefined;
869
+ bucket?: string | undefined;
870
+ region?: string | undefined;
871
+ endpoint?: string | undefined;
872
+ publicUrl?: string | undefined;
873
+ forcePathStyle?: boolean | undefined;
874
+ }, {
875
+ prefix?: string | undefined;
876
+ bucket?: string | undefined;
877
+ region?: string | undefined;
878
+ endpoint?: string | undefined;
879
+ publicUrl?: string | undefined;
880
+ forcePathStyle?: boolean | undefined;
881
+ }>>;
882
+ }, "strict", z.ZodTypeAny, {
390
883
  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";
884
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
885
+ eventBus: "in-process" | "redis-streams";
886
+ media: "local-fs" | "s3";
887
+ redis?: {
888
+ url?: string | undefined;
889
+ prefix?: string | undefined;
890
+ ackTimeoutMs?: number | undefined;
891
+ claimIdleMs?: number | undefined;
892
+ streamMaxLen?: number | undefined;
893
+ } | undefined;
894
+ s3?: {
895
+ prefix?: string | undefined;
896
+ bucket?: string | undefined;
897
+ region?: string | undefined;
898
+ endpoint?: string | undefined;
899
+ publicUrl?: string | undefined;
900
+ forcePathStyle?: boolean | undefined;
901
+ } | undefined;
902
+ }, {
903
+ commandStore: "sqlite" | "postgres";
904
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
905
+ eventBus: "in-process" | "redis-streams";
906
+ redis?: {
907
+ url?: string | undefined;
908
+ prefix?: string | undefined;
909
+ ackTimeoutMs?: number | undefined;
910
+ claimIdleMs?: number | undefined;
911
+ streamMaxLen?: number | undefined;
912
+ } | undefined;
913
+ media?: "local-fs" | "s3" | undefined;
914
+ s3?: {
915
+ prefix?: string | undefined;
916
+ bucket?: string | undefined;
917
+ region?: string | undefined;
918
+ endpoint?: string | undefined;
919
+ publicUrl?: string | undefined;
920
+ forcePathStyle?: boolean | undefined;
921
+ } | undefined;
922
+ }>, {
923
+ commandStore: "sqlite" | "postgres";
924
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
925
+ eventBus: "in-process" | "redis-streams";
926
+ media: "local-fs" | "s3";
927
+ redis?: {
928
+ url?: string | undefined;
929
+ prefix?: string | undefined;
930
+ ackTimeoutMs?: number | undefined;
931
+ claimIdleMs?: number | undefined;
932
+ streamMaxLen?: number | undefined;
933
+ } | undefined;
934
+ s3?: {
935
+ prefix?: string | undefined;
936
+ bucket?: string | undefined;
937
+ region?: string | undefined;
938
+ endpoint?: string | undefined;
939
+ publicUrl?: string | undefined;
940
+ forcePathStyle?: boolean | undefined;
941
+ } | undefined;
394
942
  }, {
395
- cloud: "local" | "aws" | "gcp" | "azure" | "docker";
396
943
  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";
944
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
945
+ eventBus: "in-process" | "redis-streams";
946
+ redis?: {
947
+ url?: string | undefined;
948
+ prefix?: string | undefined;
949
+ ackTimeoutMs?: number | undefined;
950
+ claimIdleMs?: number | undefined;
951
+ streamMaxLen?: number | undefined;
952
+ } | undefined;
953
+ media?: "local-fs" | "s3" | undefined;
954
+ s3?: {
955
+ prefix?: string | undefined;
956
+ bucket?: string | undefined;
957
+ region?: string | undefined;
958
+ endpoint?: string | undefined;
959
+ publicUrl?: string | undefined;
960
+ forcePathStyle?: boolean | undefined;
961
+ } | undefined;
400
962
  }>;
401
- security: z.ZodObject<{
963
+ security: z.ZodEffects<z.ZodObject<{
402
964
  adapter: z.ZodEnum<["middleware", "cloudflare", "aws-waf", "akamai"]>;
403
965
  rateLimit: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
404
966
  requests: z.ZodNumber;
@@ -453,6 +1015,41 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
453
1015
  accessTtl?: string | undefined;
454
1016
  refreshTtl?: string | undefined;
455
1017
  }>>;
1018
+ cloudflare: z.ZodOptional<z.ZodObject<{
1019
+ zoneId: z.ZodOptional<z.ZodString>;
1020
+ apiToken: z.ZodOptional<z.ZodString>;
1021
+ /** The Cloudflare v4 API; the adapter defaults it to https://api.cloudflare.com/client/v4. */
1022
+ apiBase: z.ZodOptional<z.ZodString>;
1023
+ }, "strip", z.ZodTypeAny, {
1024
+ zoneId?: string | undefined;
1025
+ apiToken?: string | undefined;
1026
+ apiBase?: string | undefined;
1027
+ }, {
1028
+ zoneId?: string | undefined;
1029
+ apiToken?: string | undefined;
1030
+ apiBase?: string | undefined;
1031
+ }>>;
1032
+ geo: z.ZodDefault<z.ZodObject<{
1033
+ block: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1034
+ }, "strip", z.ZodTypeAny, {
1035
+ block: string[];
1036
+ }, {
1037
+ block?: string[] | undefined;
1038
+ }>>;
1039
+ customRules: z.ZodDefault<z.ZodArray<z.ZodObject<{
1040
+ name: z.ZodString;
1041
+ expression: z.ZodString;
1042
+ action: z.ZodEnum<["block", "managed_challenge", "js_challenge", "log"]>;
1043
+ }, "strip", z.ZodTypeAny, {
1044
+ name: string;
1045
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1046
+ expression: string;
1047
+ }, {
1048
+ name: string;
1049
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1050
+ expression: string;
1051
+ }>, "many">>;
1052
+ managedRulesets: z.ZodDefault<z.ZodArray<z.ZodEnum<["cloudflare", "owasp"]>, "many">>;
456
1053
  }, "strip", z.ZodTypeAny, {
457
1054
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
458
1055
  rateLimit: Record<string, {
@@ -476,8 +1073,101 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
476
1073
  accessTtl: string;
477
1074
  refreshTtl: string;
478
1075
  };
1076
+ geo: {
1077
+ block: string[];
1078
+ };
1079
+ customRules: {
1080
+ name: string;
1081
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1082
+ expression: string;
1083
+ }[];
1084
+ managedRulesets: ("cloudflare" | "owasp")[];
1085
+ cloudflare?: {
1086
+ zoneId?: string | undefined;
1087
+ apiToken?: string | undefined;
1088
+ apiBase?: string | undefined;
1089
+ } | undefined;
1090
+ }, {
1091
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
1092
+ cloudflare?: {
1093
+ zoneId?: string | undefined;
1094
+ apiToken?: string | undefined;
1095
+ apiBase?: string | undefined;
1096
+ } | undefined;
1097
+ rateLimit?: Record<string, {
1098
+ requests: number;
1099
+ window: string;
1100
+ action: "block" | "challenge" | "throttle";
1101
+ }> | undefined;
1102
+ botProtection?: {
1103
+ mode?: "strict" | "off" | "managed" | undefined;
1104
+ allowList?: string[] | undefined;
1105
+ } | undefined;
1106
+ headers?: {
1107
+ hsts?: boolean | undefined;
1108
+ contentSecurityPolicy?: string | undefined;
1109
+ referrerPolicy?: string | undefined;
1110
+ xFrameOptions?: "deny" | "sameorigin" | undefined;
1111
+ } | undefined;
1112
+ csrf?: boolean | undefined;
1113
+ auth?: {
1114
+ jwtSecret?: string | undefined;
1115
+ accessTtl?: string | undefined;
1116
+ refreshTtl?: string | undefined;
1117
+ } | undefined;
1118
+ geo?: {
1119
+ block?: string[] | undefined;
1120
+ } | undefined;
1121
+ customRules?: {
1122
+ name: string;
1123
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1124
+ expression: string;
1125
+ }[] | undefined;
1126
+ managedRulesets?: ("cloudflare" | "owasp")[] | undefined;
1127
+ }>, {
1128
+ adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
1129
+ rateLimit: Record<string, {
1130
+ requests: number;
1131
+ window: string;
1132
+ action: "block" | "challenge" | "throttle";
1133
+ }>;
1134
+ botProtection: {
1135
+ mode: "strict" | "off" | "managed";
1136
+ allowList: string[];
1137
+ };
1138
+ headers: {
1139
+ hsts: boolean;
1140
+ contentSecurityPolicy: string;
1141
+ referrerPolicy: string;
1142
+ xFrameOptions: "deny" | "sameorigin";
1143
+ };
1144
+ csrf: boolean;
1145
+ auth: {
1146
+ jwtSecret: string;
1147
+ accessTtl: string;
1148
+ refreshTtl: string;
1149
+ };
1150
+ geo: {
1151
+ block: string[];
1152
+ };
1153
+ customRules: {
1154
+ name: string;
1155
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1156
+ expression: string;
1157
+ }[];
1158
+ managedRulesets: ("cloudflare" | "owasp")[];
1159
+ cloudflare?: {
1160
+ zoneId?: string | undefined;
1161
+ apiToken?: string | undefined;
1162
+ apiBase?: string | undefined;
1163
+ } | undefined;
479
1164
  }, {
480
1165
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
1166
+ cloudflare?: {
1167
+ zoneId?: string | undefined;
1168
+ apiToken?: string | undefined;
1169
+ apiBase?: string | undefined;
1170
+ } | undefined;
481
1171
  rateLimit?: Record<string, {
482
1172
  requests: number;
483
1173
  window: string;
@@ -499,87 +1189,128 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
499
1189
  accessTtl?: string | undefined;
500
1190
  refreshTtl?: string | undefined;
501
1191
  } | undefined;
1192
+ geo?: {
1193
+ block?: string[] | undefined;
1194
+ } | undefined;
1195
+ customRules?: {
1196
+ name: string;
1197
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1198
+ expression: string;
1199
+ }[] | undefined;
1200
+ managedRulesets?: ("cloudflare" | "owasp")[] | undefined;
502
1201
  }>;
503
1202
  commerce: z.ZodObject<{
504
1203
  payments: z.ZodObject<{
505
1204
  provider: z.ZodEnum<["native", "stripe", "custom"]>;
506
1205
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1206
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1207
+ package: z.ZodOptional<z.ZodString>;
507
1208
  }, "strip", z.ZodTypeAny, {
508
1209
  provider: "native" | "stripe" | "custom";
509
1210
  config?: Record<string, unknown> | undefined;
1211
+ package?: string | undefined;
510
1212
  }, {
511
1213
  provider: "native" | "stripe" | "custom";
512
1214
  config?: Record<string, unknown> | undefined;
1215
+ package?: string | undefined;
513
1216
  }>;
514
1217
  email: z.ZodObject<{
515
1218
  provider: z.ZodEnum<["native", "smtp", "custom"]>;
516
1219
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1220
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1221
+ package: z.ZodOptional<z.ZodString>;
517
1222
  }, "strip", z.ZodTypeAny, {
518
1223
  provider: "native" | "custom" | "smtp";
519
1224
  config?: Record<string, unknown> | undefined;
1225
+ package?: string | undefined;
520
1226
  }, {
521
1227
  provider: "native" | "custom" | "smtp";
522
1228
  config?: Record<string, unknown> | undefined;
1229
+ package?: string | undefined;
523
1230
  }>;
524
1231
  reviews: z.ZodObject<{
525
1232
  provider: z.ZodEnum<["native", "custom"]>;
526
1233
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1234
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1235
+ package: z.ZodOptional<z.ZodString>;
527
1236
  }, "strip", z.ZodTypeAny, {
528
1237
  provider: "native" | "custom";
529
1238
  config?: Record<string, unknown> | undefined;
1239
+ package?: string | undefined;
530
1240
  }, {
531
1241
  provider: "native" | "custom";
532
1242
  config?: Record<string, unknown> | undefined;
1243
+ package?: string | undefined;
533
1244
  }>;
534
1245
  search: z.ZodObject<{
535
1246
  provider: z.ZodEnum<["native", "custom"]>;
536
1247
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1248
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1249
+ package: z.ZodOptional<z.ZodString>;
537
1250
  }, "strip", z.ZodTypeAny, {
538
1251
  provider: "native" | "custom";
539
1252
  config?: Record<string, unknown> | undefined;
1253
+ package?: string | undefined;
540
1254
  }, {
541
1255
  provider: "native" | "custom";
542
1256
  config?: Record<string, unknown> | undefined;
1257
+ package?: string | undefined;
543
1258
  }>;
544
1259
  analytics: z.ZodObject<{
545
1260
  provider: z.ZodEnum<["native", "custom"]>;
546
1261
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1262
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1263
+ package: z.ZodOptional<z.ZodString>;
547
1264
  }, "strip", z.ZodTypeAny, {
548
1265
  provider: "native" | "custom";
549
1266
  config?: Record<string, unknown> | undefined;
1267
+ package?: string | undefined;
550
1268
  }, {
551
1269
  provider: "native" | "custom";
552
1270
  config?: Record<string, unknown> | undefined;
1271
+ package?: string | undefined;
553
1272
  }>;
554
1273
  shipping: z.ZodObject<{
555
1274
  provider: z.ZodEnum<["native", "custom"]>;
556
1275
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1276
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1277
+ package: z.ZodOptional<z.ZodString>;
557
1278
  }, "strip", z.ZodTypeAny, {
558
1279
  provider: "native" | "custom";
559
1280
  config?: Record<string, unknown> | undefined;
1281
+ package?: string | undefined;
560
1282
  }, {
561
1283
  provider: "native" | "custom";
562
1284
  config?: Record<string, unknown> | undefined;
1285
+ package?: string | undefined;
563
1286
  }>;
564
1287
  tax: z.ZodObject<{
565
1288
  provider: z.ZodEnum<["native", "custom"]>;
566
1289
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1290
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1291
+ package: z.ZodOptional<z.ZodString>;
567
1292
  }, "strip", z.ZodTypeAny, {
568
1293
  provider: "native" | "custom";
569
1294
  config?: Record<string, unknown> | undefined;
1295
+ package?: string | undefined;
570
1296
  }, {
571
1297
  provider: "native" | "custom";
572
1298
  config?: Record<string, unknown> | undefined;
1299
+ package?: string | undefined;
573
1300
  }>;
574
1301
  ai: z.ZodObject<{
575
1302
  provider: z.ZodEnum<["none", "anthropic", "custom"]>;
576
1303
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1304
+ /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */
1305
+ package: z.ZodOptional<z.ZodString>;
577
1306
  }, "strip", z.ZodTypeAny, {
578
1307
  provider: "custom" | "none" | "anthropic";
579
1308
  config?: Record<string, unknown> | undefined;
1309
+ package?: string | undefined;
580
1310
  }, {
581
1311
  provider: "custom" | "none" | "anthropic";
582
1312
  config?: Record<string, unknown> | undefined;
1313
+ package?: string | undefined;
583
1314
  }>;
584
1315
  orders: z.ZodDefault<z.ZodObject<{
585
1316
  numberPrefix: z.ZodDefault<z.ZodString>;
@@ -595,34 +1326,42 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
595
1326
  payments: {
596
1327
  provider: "native" | "stripe" | "custom";
597
1328
  config?: Record<string, unknown> | undefined;
1329
+ package?: string | undefined;
598
1330
  };
599
1331
  email: {
600
1332
  provider: "native" | "custom" | "smtp";
601
1333
  config?: Record<string, unknown> | undefined;
1334
+ package?: string | undefined;
602
1335
  };
603
1336
  reviews: {
604
1337
  provider: "native" | "custom";
605
1338
  config?: Record<string, unknown> | undefined;
1339
+ package?: string | undefined;
606
1340
  };
607
1341
  search: {
608
1342
  provider: "native" | "custom";
609
1343
  config?: Record<string, unknown> | undefined;
1344
+ package?: string | undefined;
610
1345
  };
611
1346
  analytics: {
612
1347
  provider: "native" | "custom";
613
1348
  config?: Record<string, unknown> | undefined;
1349
+ package?: string | undefined;
614
1350
  };
615
1351
  shipping: {
616
1352
  provider: "native" | "custom";
617
1353
  config?: Record<string, unknown> | undefined;
1354
+ package?: string | undefined;
618
1355
  };
619
1356
  tax: {
620
1357
  provider: "native" | "custom";
621
1358
  config?: Record<string, unknown> | undefined;
1359
+ package?: string | undefined;
622
1360
  };
623
1361
  ai: {
624
1362
  provider: "custom" | "none" | "anthropic";
625
1363
  config?: Record<string, unknown> | undefined;
1364
+ package?: string | undefined;
626
1365
  };
627
1366
  orders: {
628
1367
  numberPrefix: string;
@@ -632,34 +1371,42 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
632
1371
  payments: {
633
1372
  provider: "native" | "stripe" | "custom";
634
1373
  config?: Record<string, unknown> | undefined;
1374
+ package?: string | undefined;
635
1375
  };
636
1376
  email: {
637
1377
  provider: "native" | "custom" | "smtp";
638
1378
  config?: Record<string, unknown> | undefined;
1379
+ package?: string | undefined;
639
1380
  };
640
1381
  reviews: {
641
1382
  provider: "native" | "custom";
642
1383
  config?: Record<string, unknown> | undefined;
1384
+ package?: string | undefined;
643
1385
  };
644
1386
  search: {
645
1387
  provider: "native" | "custom";
646
1388
  config?: Record<string, unknown> | undefined;
1389
+ package?: string | undefined;
647
1390
  };
648
1391
  analytics: {
649
1392
  provider: "native" | "custom";
650
1393
  config?: Record<string, unknown> | undefined;
1394
+ package?: string | undefined;
651
1395
  };
652
1396
  shipping: {
653
1397
  provider: "native" | "custom";
654
1398
  config?: Record<string, unknown> | undefined;
1399
+ package?: string | undefined;
655
1400
  };
656
1401
  tax: {
657
1402
  provider: "native" | "custom";
658
1403
  config?: Record<string, unknown> | undefined;
1404
+ package?: string | undefined;
659
1405
  };
660
1406
  ai: {
661
1407
  provider: "custom" | "none" | "anthropic";
662
1408
  config?: Record<string, unknown> | undefined;
1409
+ package?: string | undefined;
663
1410
  };
664
1411
  orders?: {
665
1412
  numberPrefix?: string | undefined;
@@ -721,6 +1468,56 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
721
1468
  heartbeat?: boolean | undefined;
722
1469
  autoUpdates?: boolean | undefined;
723
1470
  }>>;
1471
+ events: z.ZodDefault<z.ZodObject<{
1472
+ /** Days a delivered event stays in the log. */
1473
+ retentionDays: z.ZodDefault<z.ZodNumber>;
1474
+ archive: z.ZodOptional<z.ZodObject<{
1475
+ adapter: z.ZodLiteral<"s3">;
1476
+ bucket: z.ZodString;
1477
+ /** Where every archive key starts; none when not given. */
1478
+ prefix: z.ZodOptional<z.ZodString>;
1479
+ /** `'us-east-1'` when not given. */
1480
+ region: z.ZodOptional<z.ZodString>;
1481
+ /** An S3-compatible API (MinIO, R2). */
1482
+ endpoint: z.ZodOptional<z.ZodString>;
1483
+ /** Path-style requests; true by default when an endpoint is set. */
1484
+ forcePathStyle: z.ZodOptional<z.ZodBoolean>;
1485
+ }, "strict", z.ZodTypeAny, {
1486
+ bucket: string;
1487
+ adapter: "s3";
1488
+ prefix?: string | undefined;
1489
+ region?: string | undefined;
1490
+ endpoint?: string | undefined;
1491
+ forcePathStyle?: boolean | undefined;
1492
+ }, {
1493
+ bucket: string;
1494
+ adapter: "s3";
1495
+ prefix?: string | undefined;
1496
+ region?: string | undefined;
1497
+ endpoint?: string | undefined;
1498
+ forcePathStyle?: boolean | undefined;
1499
+ }>>;
1500
+ }, "strict", z.ZodTypeAny, {
1501
+ retentionDays: number;
1502
+ archive?: {
1503
+ bucket: string;
1504
+ adapter: "s3";
1505
+ prefix?: string | undefined;
1506
+ region?: string | undefined;
1507
+ endpoint?: string | undefined;
1508
+ forcePathStyle?: boolean | undefined;
1509
+ } | undefined;
1510
+ }, {
1511
+ retentionDays?: number | undefined;
1512
+ archive?: {
1513
+ bucket: string;
1514
+ adapter: "s3";
1515
+ prefix?: string | undefined;
1516
+ region?: string | undefined;
1517
+ endpoint?: string | undefined;
1518
+ forcePathStyle?: boolean | undefined;
1519
+ } | undefined;
1520
+ }>>;
724
1521
  }, "strip", z.ZodTypeAny, {
725
1522
  store: {
726
1523
  name: string;
@@ -730,11 +1527,25 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
730
1527
  };
731
1528
  template: "astro" | "nextjs";
732
1529
  infrastructure: {
733
- cloud: "local" | "aws" | "gcp" | "azure" | "docker";
734
1530
  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";
1531
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
1532
+ eventBus: "in-process" | "redis-streams";
1533
+ media: "local-fs" | "s3";
1534
+ redis?: {
1535
+ url?: string | undefined;
1536
+ prefix?: string | undefined;
1537
+ ackTimeoutMs?: number | undefined;
1538
+ claimIdleMs?: number | undefined;
1539
+ streamMaxLen?: number | undefined;
1540
+ } | undefined;
1541
+ s3?: {
1542
+ prefix?: string | undefined;
1543
+ bucket?: string | undefined;
1544
+ region?: string | undefined;
1545
+ endpoint?: string | undefined;
1546
+ publicUrl?: string | undefined;
1547
+ forcePathStyle?: boolean | undefined;
1548
+ } | undefined;
738
1549
  };
739
1550
  security: {
740
1551
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
@@ -759,39 +1570,61 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
759
1570
  accessTtl: string;
760
1571
  refreshTtl: string;
761
1572
  };
1573
+ geo: {
1574
+ block: string[];
1575
+ };
1576
+ customRules: {
1577
+ name: string;
1578
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1579
+ expression: string;
1580
+ }[];
1581
+ managedRulesets: ("cloudflare" | "owasp")[];
1582
+ cloudflare?: {
1583
+ zoneId?: string | undefined;
1584
+ apiToken?: string | undefined;
1585
+ apiBase?: string | undefined;
1586
+ } | undefined;
762
1587
  };
763
1588
  commerce: {
764
1589
  payments: {
765
1590
  provider: "native" | "stripe" | "custom";
766
1591
  config?: Record<string, unknown> | undefined;
1592
+ package?: string | undefined;
767
1593
  };
768
1594
  email: {
769
1595
  provider: "native" | "custom" | "smtp";
770
1596
  config?: Record<string, unknown> | undefined;
1597
+ package?: string | undefined;
771
1598
  };
772
1599
  reviews: {
773
1600
  provider: "native" | "custom";
774
1601
  config?: Record<string, unknown> | undefined;
1602
+ package?: string | undefined;
775
1603
  };
776
1604
  search: {
777
1605
  provider: "native" | "custom";
778
1606
  config?: Record<string, unknown> | undefined;
1607
+ package?: string | undefined;
779
1608
  };
780
1609
  analytics: {
781
1610
  provider: "native" | "custom";
782
1611
  config?: Record<string, unknown> | undefined;
1612
+ package?: string | undefined;
783
1613
  };
784
1614
  shipping: {
785
1615
  provider: "native" | "custom";
786
1616
  config?: Record<string, unknown> | undefined;
1617
+ package?: string | undefined;
787
1618
  };
788
1619
  tax: {
789
1620
  provider: "native" | "custom";
790
1621
  config?: Record<string, unknown> | undefined;
1622
+ package?: string | undefined;
791
1623
  };
792
1624
  ai: {
793
1625
  provider: "custom" | "none" | "anthropic";
794
1626
  config?: Record<string, unknown> | undefined;
1627
+ package?: string | undefined;
795
1628
  };
796
1629
  orders: {
797
1630
  numberPrefix: string;
@@ -816,6 +1649,17 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
816
1649
  heartbeat: boolean;
817
1650
  autoUpdates: boolean;
818
1651
  };
1652
+ events: {
1653
+ retentionDays: number;
1654
+ archive?: {
1655
+ bucket: string;
1656
+ adapter: "s3";
1657
+ prefix?: string | undefined;
1658
+ region?: string | undefined;
1659
+ endpoint?: string | undefined;
1660
+ forcePathStyle?: boolean | undefined;
1661
+ } | undefined;
1662
+ };
819
1663
  }, {
820
1664
  store: {
821
1665
  name: string;
@@ -825,14 +1669,33 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
825
1669
  };
826
1670
  template: "astro" | "nextjs";
827
1671
  infrastructure: {
828
- cloud: "local" | "aws" | "gcp" | "azure" | "docker";
829
1672
  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";
1673
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
1674
+ eventBus: "in-process" | "redis-streams";
1675
+ redis?: {
1676
+ url?: string | undefined;
1677
+ prefix?: string | undefined;
1678
+ ackTimeoutMs?: number | undefined;
1679
+ claimIdleMs?: number | undefined;
1680
+ streamMaxLen?: number | undefined;
1681
+ } | undefined;
1682
+ media?: "local-fs" | "s3" | undefined;
1683
+ s3?: {
1684
+ prefix?: string | undefined;
1685
+ bucket?: string | undefined;
1686
+ region?: string | undefined;
1687
+ endpoint?: string | undefined;
1688
+ publicUrl?: string | undefined;
1689
+ forcePathStyle?: boolean | undefined;
1690
+ } | undefined;
833
1691
  };
834
1692
  security: {
835
1693
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
1694
+ cloudflare?: {
1695
+ zoneId?: string | undefined;
1696
+ apiToken?: string | undefined;
1697
+ apiBase?: string | undefined;
1698
+ } | undefined;
836
1699
  rateLimit?: Record<string, {
837
1700
  requests: number;
838
1701
  window: string;
@@ -854,39 +1717,56 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
854
1717
  accessTtl?: string | undefined;
855
1718
  refreshTtl?: string | undefined;
856
1719
  } | undefined;
1720
+ geo?: {
1721
+ block?: string[] | undefined;
1722
+ } | undefined;
1723
+ customRules?: {
1724
+ name: string;
1725
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1726
+ expression: string;
1727
+ }[] | undefined;
1728
+ managedRulesets?: ("cloudflare" | "owasp")[] | undefined;
857
1729
  };
858
1730
  commerce: {
859
1731
  payments: {
860
1732
  provider: "native" | "stripe" | "custom";
861
1733
  config?: Record<string, unknown> | undefined;
1734
+ package?: string | undefined;
862
1735
  };
863
1736
  email: {
864
1737
  provider: "native" | "custom" | "smtp";
865
1738
  config?: Record<string, unknown> | undefined;
1739
+ package?: string | undefined;
866
1740
  };
867
1741
  reviews: {
868
1742
  provider: "native" | "custom";
869
1743
  config?: Record<string, unknown> | undefined;
1744
+ package?: string | undefined;
870
1745
  };
871
1746
  search: {
872
1747
  provider: "native" | "custom";
873
1748
  config?: Record<string, unknown> | undefined;
1749
+ package?: string | undefined;
874
1750
  };
875
1751
  analytics: {
876
1752
  provider: "native" | "custom";
877
1753
  config?: Record<string, unknown> | undefined;
1754
+ package?: string | undefined;
878
1755
  };
879
1756
  shipping: {
880
1757
  provider: "native" | "custom";
881
1758
  config?: Record<string, unknown> | undefined;
1759
+ package?: string | undefined;
882
1760
  };
883
1761
  tax: {
884
1762
  provider: "native" | "custom";
885
1763
  config?: Record<string, unknown> | undefined;
1764
+ package?: string | undefined;
886
1765
  };
887
1766
  ai: {
888
1767
  provider: "custom" | "none" | "anthropic";
889
1768
  config?: Record<string, unknown> | undefined;
1769
+ package?: string | undefined;
890
1770
  };
891
1771
  orders?: {
892
1772
  numberPrefix?: string | undefined;
@@ -911,6 +1791,17 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
911
1791
  heartbeat?: boolean | undefined;
912
1792
  autoUpdates?: boolean | undefined;
913
1793
  } | undefined;
1794
+ events?: {
1795
+ retentionDays?: number | undefined;
1796
+ archive?: {
1797
+ bucket: string;
1798
+ adapter: "s3";
1799
+ prefix?: string | undefined;
1800
+ region?: string | undefined;
1801
+ endpoint?: string | undefined;
1802
+ forcePathStyle?: boolean | undefined;
1803
+ } | undefined;
1804
+ } | undefined;
914
1805
  }>, {
915
1806
  store: {
916
1807
  name: string;
@@ -920,11 +1811,25 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
920
1811
  };
921
1812
  template: "astro" | "nextjs";
922
1813
  infrastructure: {
923
- cloud: "local" | "aws" | "gcp" | "azure" | "docker";
924
1814
  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";
1815
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
1816
+ eventBus: "in-process" | "redis-streams";
1817
+ media: "local-fs" | "s3";
1818
+ redis?: {
1819
+ url?: string | undefined;
1820
+ prefix?: string | undefined;
1821
+ ackTimeoutMs?: number | undefined;
1822
+ claimIdleMs?: number | undefined;
1823
+ streamMaxLen?: number | undefined;
1824
+ } | undefined;
1825
+ s3?: {
1826
+ prefix?: string | undefined;
1827
+ bucket?: string | undefined;
1828
+ region?: string | undefined;
1829
+ endpoint?: string | undefined;
1830
+ publicUrl?: string | undefined;
1831
+ forcePathStyle?: boolean | undefined;
1832
+ } | undefined;
928
1833
  };
929
1834
  security: {
930
1835
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
@@ -949,39 +1854,61 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
949
1854
  accessTtl: string;
950
1855
  refreshTtl: string;
951
1856
  };
1857
+ geo: {
1858
+ block: string[];
1859
+ };
1860
+ customRules: {
1861
+ name: string;
1862
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
1863
+ expression: string;
1864
+ }[];
1865
+ managedRulesets: ("cloudflare" | "owasp")[];
1866
+ cloudflare?: {
1867
+ zoneId?: string | undefined;
1868
+ apiToken?: string | undefined;
1869
+ apiBase?: string | undefined;
1870
+ } | undefined;
952
1871
  };
953
1872
  commerce: {
954
1873
  payments: {
955
1874
  provider: "native" | "stripe" | "custom";
956
1875
  config?: Record<string, unknown> | undefined;
1876
+ package?: string | undefined;
957
1877
  };
958
1878
  email: {
959
1879
  provider: "native" | "custom" | "smtp";
960
1880
  config?: Record<string, unknown> | undefined;
1881
+ package?: string | undefined;
961
1882
  };
962
1883
  reviews: {
963
1884
  provider: "native" | "custom";
964
1885
  config?: Record<string, unknown> | undefined;
1886
+ package?: string | undefined;
965
1887
  };
966
1888
  search: {
967
1889
  provider: "native" | "custom";
968
1890
  config?: Record<string, unknown> | undefined;
1891
+ package?: string | undefined;
969
1892
  };
970
1893
  analytics: {
971
1894
  provider: "native" | "custom";
972
1895
  config?: Record<string, unknown> | undefined;
1896
+ package?: string | undefined;
973
1897
  };
974
1898
  shipping: {
975
1899
  provider: "native" | "custom";
976
1900
  config?: Record<string, unknown> | undefined;
1901
+ package?: string | undefined;
977
1902
  };
978
1903
  tax: {
979
1904
  provider: "native" | "custom";
980
1905
  config?: Record<string, unknown> | undefined;
1906
+ package?: string | undefined;
981
1907
  };
982
1908
  ai: {
983
1909
  provider: "custom" | "none" | "anthropic";
984
1910
  config?: Record<string, unknown> | undefined;
1911
+ package?: string | undefined;
985
1912
  };
986
1913
  orders: {
987
1914
  numberPrefix: string;
@@ -1006,6 +1933,17 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
1006
1933
  heartbeat: boolean;
1007
1934
  autoUpdates: boolean;
1008
1935
  };
1936
+ events: {
1937
+ retentionDays: number;
1938
+ archive?: {
1939
+ bucket: string;
1940
+ adapter: "s3";
1941
+ prefix?: string | undefined;
1942
+ region?: string | undefined;
1943
+ endpoint?: string | undefined;
1944
+ forcePathStyle?: boolean | undefined;
1945
+ } | undefined;
1946
+ };
1009
1947
  }, {
1010
1948
  store: {
1011
1949
  name: string;
@@ -1015,14 +1953,33 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
1015
1953
  };
1016
1954
  template: "astro" | "nextjs";
1017
1955
  infrastructure: {
1018
- cloud: "local" | "aws" | "gcp" | "azure" | "docker";
1019
1956
  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";
1957
+ documentStore: "in-memory" | "redis" | "postgres-jsonb";
1958
+ eventBus: "in-process" | "redis-streams";
1959
+ redis?: {
1960
+ url?: string | undefined;
1961
+ prefix?: string | undefined;
1962
+ ackTimeoutMs?: number | undefined;
1963
+ claimIdleMs?: number | undefined;
1964
+ streamMaxLen?: number | undefined;
1965
+ } | undefined;
1966
+ media?: "local-fs" | "s3" | undefined;
1967
+ s3?: {
1968
+ prefix?: string | undefined;
1969
+ bucket?: string | undefined;
1970
+ region?: string | undefined;
1971
+ endpoint?: string | undefined;
1972
+ publicUrl?: string | undefined;
1973
+ forcePathStyle?: boolean | undefined;
1974
+ } | undefined;
1023
1975
  };
1024
1976
  security: {
1025
1977
  adapter: "middleware" | "cloudflare" | "aws-waf" | "akamai";
1978
+ cloudflare?: {
1979
+ zoneId?: string | undefined;
1980
+ apiToken?: string | undefined;
1981
+ apiBase?: string | undefined;
1982
+ } | undefined;
1026
1983
  rateLimit?: Record<string, {
1027
1984
  requests: number;
1028
1985
  window: string;
@@ -1044,39 +2001,56 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
1044
2001
  accessTtl?: string | undefined;
1045
2002
  refreshTtl?: string | undefined;
1046
2003
  } | undefined;
2004
+ geo?: {
2005
+ block?: string[] | undefined;
2006
+ } | undefined;
2007
+ customRules?: {
2008
+ name: string;
2009
+ action: "block" | "managed_challenge" | "js_challenge" | "log";
2010
+ expression: string;
2011
+ }[] | undefined;
2012
+ managedRulesets?: ("cloudflare" | "owasp")[] | undefined;
1047
2013
  };
1048
2014
  commerce: {
1049
2015
  payments: {
1050
2016
  provider: "native" | "stripe" | "custom";
1051
2017
  config?: Record<string, unknown> | undefined;
2018
+ package?: string | undefined;
1052
2019
  };
1053
2020
  email: {
1054
2021
  provider: "native" | "custom" | "smtp";
1055
2022
  config?: Record<string, unknown> | undefined;
2023
+ package?: string | undefined;
1056
2024
  };
1057
2025
  reviews: {
1058
2026
  provider: "native" | "custom";
1059
2027
  config?: Record<string, unknown> | undefined;
2028
+ package?: string | undefined;
1060
2029
  };
1061
2030
  search: {
1062
2031
  provider: "native" | "custom";
1063
2032
  config?: Record<string, unknown> | undefined;
2033
+ package?: string | undefined;
1064
2034
  };
1065
2035
  analytics: {
1066
2036
  provider: "native" | "custom";
1067
2037
  config?: Record<string, unknown> | undefined;
2038
+ package?: string | undefined;
1068
2039
  };
1069
2040
  shipping: {
1070
2041
  provider: "native" | "custom";
1071
2042
  config?: Record<string, unknown> | undefined;
2043
+ package?: string | undefined;
1072
2044
  };
1073
2045
  tax: {
1074
2046
  provider: "native" | "custom";
1075
2047
  config?: Record<string, unknown> | undefined;
2048
+ package?: string | undefined;
1076
2049
  };
1077
2050
  ai: {
1078
2051
  provider: "custom" | "none" | "anthropic";
1079
2052
  config?: Record<string, unknown> | undefined;
2053
+ package?: string | undefined;
1080
2054
  };
1081
2055
  orders?: {
1082
2056
  numberPrefix?: string | undefined;
@@ -1101,6 +2075,17 @@ declare const nymbalConfigSchema: z.ZodEffects<z.ZodObject<{
1101
2075
  heartbeat?: boolean | undefined;
1102
2076
  autoUpdates?: boolean | undefined;
1103
2077
  } | undefined;
2078
+ events?: {
2079
+ retentionDays?: number | undefined;
2080
+ archive?: {
2081
+ bucket: string;
2082
+ adapter: "s3";
2083
+ prefix?: string | undefined;
2084
+ region?: string | undefined;
2085
+ endpoint?: string | undefined;
2086
+ forcePathStyle?: boolean | undefined;
2087
+ } | undefined;
2088
+ } | undefined;
1104
2089
  }>;
1105
2090
  type NymbalConfigInput = z.input<typeof nymbalConfigSchema>;
1106
2091
  type NymbalConfig = z.output<typeof nymbalConfigSchema>;
@@ -1127,12 +2112,30 @@ declare const KNOWN_PROVIDERS: {
1127
2112
  readonly ai: readonly ["none", "anthropic", "custom"];
1128
2113
  };
1129
2114
 
2115
+ /**
2116
+ * The values each infrastructure slot accepts: only what is built. `in-memory`, `in-process` and `local-fs` are the
2117
+ * kernel's own; `redis`, `postgres-jsonb`, `redis-streams` and `s3` live in `@nymbalhq/*` packages the kernel loads
2118
+ * only when the config names them.
2119
+ */
2120
+ declare const KNOWN_INFRASTRUCTURE: {
2121
+ readonly commandStore: readonly ["sqlite", "postgres"];
2122
+ readonly documentStore: readonly ["in-memory", "redis", "postgres-jsonb"];
2123
+ readonly eventBus: readonly ["in-process", "redis-streams"];
2124
+ readonly media: readonly ["local-fs", "s3"];
2125
+ };
2126
+ type InfrastructureSlot = keyof typeof KNOWN_INFRASTRUCTURE;
2127
+ /** Keys that drove nothing and were removed; a config that still sets one is told to delete it. */
2128
+ declare const REMOVED_INFRASTRUCTURE_KEYS: readonly ["cloud", "compute"];
2129
+
1130
2130
  interface LoadedConfig {
1131
2131
  config: NymbalConfig;
1132
2132
  path: string;
1133
2133
  projectRoot: string;
2134
+ /** The module's named `adapters` export: one adapter per slot whose provider is `custom`, for createApp. */
2135
+ adapters?: Partial<CommerceSlotAdapters>;
1134
2136
  }
1135
2137
  declare function findConfigFile(startDir: string): string | null;
1136
2138
  declare function loadConfig(startDir?: string): Promise<LoadedConfig>;
1137
2139
 
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 };
2140
+ export { DEFAULT_JWT_SECRET, KNOWN_INFRASTRUCTURE, KNOWN_PROVIDERS, REMOVED_INFRASTRUCTURE_KEYS, commerceSchema, defineConfig, deploymentSchema, env, envBool, envNumber, envOptional, eventArchiveSchema, eventsSchema, featuresSchema, findConfigFile, httpSchema, infrastructureSchema, loadConfig, nymbalConfigSchema, redisSchema, s3Schema, securitySchema, storeSchema };
2141
+ export type { InfrastructureSlot, LoadedConfig, NymbalConfig, NymbalConfigInput };