@nymbalhq/config 1.4.0 → 1.5.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 +1051 -454
- package/dist/index.js +232 -53
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -37,25 +37,98 @@ function envBool(key, defaultValue = false) {
|
|
|
37
37
|
return raw === "true" || raw === "1" || raw === "yes" || raw === "on";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
// src/
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
// src/adapter-names.ts
|
|
41
|
+
var PROVIDER_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
42
|
+
function slotFolder(slot) {
|
|
43
|
+
return slot.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
44
|
+
}
|
|
45
|
+
function conventionPackage(slot, provider) {
|
|
46
|
+
return `@nymbalhq/${slotFolder(slot)}-${provider}`;
|
|
47
|
+
}
|
|
48
|
+
var builtIn = { builtIn: true };
|
|
49
|
+
var ADAPTER_CATALOGUE = {
|
|
50
|
+
payments: { native: builtIn, stripe: { sdk: "stripe" } },
|
|
51
|
+
email: {
|
|
52
|
+
native: builtIn,
|
|
53
|
+
smtp: { sdk: "nodemailer" },
|
|
54
|
+
mailgun: { sdk: "nodemailer" },
|
|
55
|
+
resend: { sdk: "nodemailer" },
|
|
56
|
+
ses: { sdk: "nodemailer" }
|
|
57
|
+
},
|
|
58
|
+
reviews: { native: builtIn },
|
|
59
|
+
search: { native: builtIn, algolia: {} },
|
|
60
|
+
analytics: { native: builtIn },
|
|
61
|
+
shipping: { native: builtIn, easypost: {} },
|
|
62
|
+
tax: { native: builtIn },
|
|
63
|
+
ai: { none: builtIn, anthropic: { sdk: "@anthropic-ai/sdk" } },
|
|
64
|
+
documentStore: {
|
|
65
|
+
"in-memory": builtIn,
|
|
66
|
+
redis: { sdk: "ioredis" },
|
|
67
|
+
"postgres-jsonb": { sdk: "pg" }
|
|
68
|
+
},
|
|
69
|
+
eventBus: { "in-process": builtIn, "redis-streams": { sdk: "ioredis" } },
|
|
70
|
+
media: { "local-fs": builtIn, s3: { sdk: "@aws-sdk/client-s3" } },
|
|
71
|
+
security: { middleware: builtIn, cloudflare: {} }
|
|
50
72
|
};
|
|
73
|
+
var SLOTS = Object.keys(ADAPTER_CATALOGUE);
|
|
74
|
+
var BUILT_IN = Object.fromEntries(
|
|
75
|
+
SLOTS.map((slot) => [
|
|
76
|
+
slot,
|
|
77
|
+
Object.entries(ADAPTER_CATALOGUE[slot]).filter(([, entry]) => entry.builtIn === true).map(([name]) => name)
|
|
78
|
+
])
|
|
79
|
+
);
|
|
80
|
+
var COMMERCE_SLOTS = [
|
|
81
|
+
"payments",
|
|
82
|
+
"email",
|
|
83
|
+
"reviews",
|
|
84
|
+
"search",
|
|
85
|
+
"analytics",
|
|
86
|
+
"shipping",
|
|
87
|
+
"tax",
|
|
88
|
+
"ai"
|
|
89
|
+
];
|
|
90
|
+
function isCommerceSlot(slot) {
|
|
91
|
+
return COMMERCE_SLOTS.includes(slot);
|
|
92
|
+
}
|
|
93
|
+
function editDistance(a, b) {
|
|
94
|
+
const d = Array.from(
|
|
95
|
+
{ length: a.length + 1 },
|
|
96
|
+
(_, i) => Array.from({ length: b.length + 1 }, (_2, j) => i === 0 ? j : j === 0 ? i : 0)
|
|
97
|
+
);
|
|
98
|
+
for (let i = 1; i <= a.length; i++) {
|
|
99
|
+
for (let j = 1; j <= b.length; j++) {
|
|
100
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
101
|
+
let best = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
|
|
102
|
+
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
|
103
|
+
best = Math.min(best, d[i - 2][j - 2] + 1);
|
|
104
|
+
}
|
|
105
|
+
d[i][j] = best;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return d[a.length][b.length];
|
|
109
|
+
}
|
|
110
|
+
var MAX_SUGGESTION_DISTANCE = 2;
|
|
111
|
+
function suggestProvider(slot, name) {
|
|
112
|
+
const candidates = [
|
|
113
|
+
...Object.keys(ADAPTER_CATALOGUE[slot]),
|
|
114
|
+
...isCommerceSlot(slot) ? ["custom"] : []
|
|
115
|
+
].sort();
|
|
116
|
+
let best;
|
|
117
|
+
for (const candidate of candidates) {
|
|
118
|
+
const distance = editDistance(candidate, name);
|
|
119
|
+
if (distance > MAX_SUGGESTION_DISTANCE) continue;
|
|
120
|
+
if (best === void 0 || distance < best.distance) best = { name: candidate, distance };
|
|
121
|
+
}
|
|
122
|
+
return best?.name;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/known-providers.ts
|
|
126
|
+
var KNOWN_PROVIDERS = Object.fromEntries(
|
|
127
|
+
COMMERCE_SLOTS.map((slot) => [slot, [...Object.keys(ADAPTER_CATALOGUE[slot]), "custom"]])
|
|
128
|
+
);
|
|
51
129
|
|
|
52
130
|
// src/known-infrastructure.ts
|
|
53
|
-
var
|
|
54
|
-
commandStore: ["sqlite", "postgres"],
|
|
55
|
-
documentStore: ["in-memory", "redis", "postgres-jsonb"],
|
|
56
|
-
eventBus: ["in-process", "redis-streams"],
|
|
57
|
-
media: ["local-fs", "s3"]
|
|
58
|
-
};
|
|
131
|
+
var COMMAND_STORES = ["sqlite", "postgres"];
|
|
59
132
|
var REMOVED_INFRASTRUCTURE_KEYS = ["cloud", "compute"];
|
|
60
133
|
|
|
61
134
|
// src/load.ts
|
|
@@ -71,7 +144,9 @@ import { z } from "zod";
|
|
|
71
144
|
var rateLimitRuleSchema = z.object({
|
|
72
145
|
requests: z.number().int().positive(),
|
|
73
146
|
window: z.string().regex(/^\d+(ms|s|m|h)$/, 'window must look like "60s", "5m", "1h"'),
|
|
74
|
-
action: z.enum(["block", "challenge", "throttle"])
|
|
147
|
+
action: z.enum(["block", "challenge", "throttle"]),
|
|
148
|
+
/** Counts only the requests to the path that carry this header, such as `x-nymbal-order-email`. */
|
|
149
|
+
header: z.string().min(1).optional()
|
|
75
150
|
});
|
|
76
151
|
var rateLimitPathPattern = /^\/[\w\-/*:]*$/;
|
|
77
152
|
var DEFAULT_JWT_SECRET = "dev-secret-please-override-me-1234567890";
|
|
@@ -91,7 +166,84 @@ function infrastructureValue(slot, values) {
|
|
|
91
166
|
} : { message: ctx.defaultError }
|
|
92
167
|
});
|
|
93
168
|
}
|
|
94
|
-
var
|
|
169
|
+
var NPM_PACKAGE_NAME = /^(?:@[a-z0-9~-][a-z0-9._~-]*\/)?[a-z0-9~-][a-z0-9._~-]*$/;
|
|
170
|
+
var packageNameSchema = z.string().max(214, "an npm package name is at most 214 characters").regex(NPM_PACKAGE_NAME, "must be an npm package name, such as `@acme/nymbal-search`");
|
|
171
|
+
function providerNameSchema(where) {
|
|
172
|
+
return z.string().superRefine((value, ctx) => {
|
|
173
|
+
if (!PROVIDER_NAME.test(value)) {
|
|
174
|
+
ctx.addIssue({
|
|
175
|
+
code: z.ZodIssueCode.custom,
|
|
176
|
+
message: `${where} '${value}' is not a provider name: a provider matches ${PROVIDER_NAME.source}`
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function choiceOf(slot, provider) {
|
|
182
|
+
if (slot === "security") return `security.adapter '${provider}'`;
|
|
183
|
+
if (slot === "documentStore" || slot === "eventBus" || slot === "media") {
|
|
184
|
+
return `infrastructure.${slot} '${provider}'`;
|
|
185
|
+
}
|
|
186
|
+
return `${slot}.provider '${provider}'`;
|
|
187
|
+
}
|
|
188
|
+
function packageBesideBuiltIn(slot, block, ctx) {
|
|
189
|
+
if (block.package === void 0 || !BUILT_IN[slot].includes(block.provider)) return;
|
|
190
|
+
ctx.addIssue({
|
|
191
|
+
code: z.ZodIssueCode.custom,
|
|
192
|
+
path: ["package"],
|
|
193
|
+
message: `${choiceOf(slot, block.provider)} is built in, so it takes no package: delete package, or give the third-party adapter's own provider name beside it`
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function customOutsideCommerce(slot, provider, ctx) {
|
|
197
|
+
if (provider !== "custom") return;
|
|
198
|
+
ctx.addIssue({
|
|
199
|
+
code: z.ZodIssueCode.custom,
|
|
200
|
+
path: [slot === "security" ? "adapter" : "provider"],
|
|
201
|
+
message: `${choiceOf(slot, provider)}: only a commerce slot takes an adapter passed to createApp; name a third-party adapter with package: { provider: 'acme', package: '@acme/nymbal-${slotFolder(slot)}' }`
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
var KERNEL_CONFIGURED = {
|
|
205
|
+
documentStore: {
|
|
206
|
+
"in-memory": "it is built in and takes none",
|
|
207
|
+
redis: "infrastructure.redis configures it",
|
|
208
|
+
"postgres-jsonb": "it uses the command store's Postgres connection (DATABASE_URL)"
|
|
209
|
+
},
|
|
210
|
+
eventBus: {
|
|
211
|
+
"in-process": "it is built in and takes none",
|
|
212
|
+
"redis-streams": "infrastructure.redis configures it"
|
|
213
|
+
},
|
|
214
|
+
media: {
|
|
215
|
+
"local-fs": "it is built in and takes none",
|
|
216
|
+
s3: "infrastructure.s3 configures it"
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
function infrastructureBlock(slot) {
|
|
220
|
+
return z.object(
|
|
221
|
+
{
|
|
222
|
+
provider: providerNameSchema(`infrastructure.${slot}`),
|
|
223
|
+
/** The npm package the adapter comes from, in place of `@nymbalhq/<slot>-<provider>`. */
|
|
224
|
+
package: packageNameSchema.optional(),
|
|
225
|
+
/** The adapter's `ctx.config`, for a provider whose connection the kernel does not build. */
|
|
226
|
+
config: z.record(z.string(), z.unknown()).optional()
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
errorMap: (issue, ctx) => issue.code === z.ZodIssueCode.invalid_type && typeof ctx.data === "string" ? {
|
|
230
|
+
message: `infrastructure.${slot} takes a block: write { provider: '${ctx.data}' }`
|
|
231
|
+
} : { message: ctx.defaultError }
|
|
232
|
+
}
|
|
233
|
+
).superRefine((block, ctx) => {
|
|
234
|
+
customOutsideCommerce(slot, block.provider, ctx);
|
|
235
|
+
packageBesideBuiltIn(slot, block, ctx);
|
|
236
|
+
const configuredBy = Object.hasOwn(KERNEL_CONFIGURED[slot], block.provider) ? KERNEL_CONFIGURED[slot][block.provider] : void 0;
|
|
237
|
+
if (block.config !== void 0 && configuredBy !== void 0) {
|
|
238
|
+
ctx.addIssue({
|
|
239
|
+
code: z.ZodIssueCode.custom,
|
|
240
|
+
path: ["config"],
|
|
241
|
+
message: `infrastructure.${slot} '${block.provider}' takes no config: ${configuredBy}`
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
var INFRASTRUCTURE_KEYS = ["commandStore", "documentStore", "eventBus", "media", "redis", "s3"];
|
|
95
247
|
function unrecognizedInfrastructureKeys(keys) {
|
|
96
248
|
return keys.map(
|
|
97
249
|
(key) => REMOVED_INFRASTRUCTURE_KEYS.includes(key) ? `infrastructure.${key} was removed: it drives nothing, so delete it from the config` : `unknown infrastructure key '${key}'; the infrastructure keys are ${quotedList(INFRASTRUCTURE_KEYS)}`
|
|
@@ -133,10 +285,10 @@ var s3Schema = z.object(
|
|
|
133
285
|
).strict();
|
|
134
286
|
var infrastructureSchema = z.object(
|
|
135
287
|
{
|
|
136
|
-
commandStore: infrastructureValue("commandStore",
|
|
137
|
-
documentStore:
|
|
138
|
-
eventBus:
|
|
139
|
-
media:
|
|
288
|
+
commandStore: infrastructureValue("commandStore", COMMAND_STORES),
|
|
289
|
+
documentStore: infrastructureBlock("documentStore"),
|
|
290
|
+
eventBus: infrastructureBlock("eventBus"),
|
|
291
|
+
media: infrastructureBlock("media").default({ provider: "local-fs" }),
|
|
140
292
|
redis: redisSchema.optional(),
|
|
141
293
|
s3: s3Schema.optional()
|
|
142
294
|
},
|
|
@@ -144,25 +296,25 @@ var infrastructureSchema = z.object(
|
|
|
144
296
|
errorMap: (issue, ctx) => issue.code === z.ZodIssueCode.unrecognized_keys ? { message: unrecognizedInfrastructureKeys(issue.keys) } : { message: ctx.defaultError }
|
|
145
297
|
}
|
|
146
298
|
).strict().superRefine((infra, ctx) => {
|
|
147
|
-
if (infra.documentStore === "postgres-jsonb" && infra.commandStore !== "postgres") {
|
|
299
|
+
if (infra.documentStore.provider === "postgres-jsonb" && infra.commandStore !== "postgres") {
|
|
148
300
|
ctx.addIssue({
|
|
149
301
|
code: z.ZodIssueCode.custom,
|
|
150
302
|
path: ["documentStore"],
|
|
151
303
|
message: `documentStore 'postgres-jsonb' shares the command store's Postgres connection, so it needs commandStore 'postgres' (not '${infra.commandStore}')`
|
|
152
304
|
});
|
|
153
305
|
}
|
|
154
|
-
if (infra.eventBus === "redis-streams" && infra.documentStore === "in-memory") {
|
|
306
|
+
if (infra.eventBus.provider === "redis-streams" && infra.documentStore.provider === "in-memory") {
|
|
155
307
|
ctx.addIssue({
|
|
156
308
|
code: z.ZodIssueCode.custom,
|
|
157
309
|
path: ["eventBus"],
|
|
158
310
|
message: `eventBus 'redis-streams' needs a shared documentStore ('redis' or 'postgres-jsonb'), not 'in-memory': a named group hands each event to one instance, so a per-process read model would miss the rest`
|
|
159
311
|
});
|
|
160
312
|
}
|
|
161
|
-
if (infra.s3 !== void 0 && infra.media !== "s3") {
|
|
313
|
+
if (infra.s3 !== void 0 && infra.media.provider !== "s3") {
|
|
162
314
|
ctx.addIssue({
|
|
163
315
|
code: z.ZodIssueCode.custom,
|
|
164
316
|
path: ["s3"],
|
|
165
|
-
message: `infrastructure.s3 configures media 's3', but media is '${infra.media}': set media to 's3' or delete the s3 block`
|
|
317
|
+
message: `infrastructure.s3 configures media 's3', but media is '${infra.media.provider}': set media to 's3' or delete the s3 block`
|
|
166
318
|
});
|
|
167
319
|
}
|
|
168
320
|
});
|
|
@@ -178,7 +330,12 @@ var customRuleSchema = z.object({
|
|
|
178
330
|
action: z.enum(["block", "managed_challenge", "js_challenge", "log"])
|
|
179
331
|
});
|
|
180
332
|
var securityFields = z.object({
|
|
181
|
-
|
|
333
|
+
/** `middleware` is the kernel's own; any other resolves as a commerce provider does, `security-<adapter>`. */
|
|
334
|
+
adapter: providerNameSchema("security.adapter"),
|
|
335
|
+
/** The npm package the adapter comes from, in place of `@nymbalhq/security-<adapter>`. */
|
|
336
|
+
package: packageNameSchema.optional(),
|
|
337
|
+
/** A third-party adapter's `ctx.config`; `cloudflare` reads `security.cloudflare`, and `middleware` takes none. */
|
|
338
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
182
339
|
rateLimit: z.record(
|
|
183
340
|
z.string().regex(rateLimitPathPattern, {
|
|
184
341
|
message: 'rate limit keys must start with "/" and use only letters, numbers, -, _, /, *, :'
|
|
@@ -209,6 +366,15 @@ var securityFields = z.object({
|
|
|
209
366
|
managedRulesets: z.array(z.enum(["cloudflare", "owasp"])).default([])
|
|
210
367
|
});
|
|
211
368
|
var securitySchema = securityFields.superRefine((security, ctx) => {
|
|
369
|
+
customOutsideCommerce("security", security.adapter, ctx);
|
|
370
|
+
packageBesideBuiltIn("security", { provider: security.adapter, package: security.package }, ctx);
|
|
371
|
+
if (security.config !== void 0 && (security.adapter === "middleware" || security.adapter === "cloudflare")) {
|
|
372
|
+
ctx.addIssue({
|
|
373
|
+
code: z.ZodIssueCode.custom,
|
|
374
|
+
path: ["config"],
|
|
375
|
+
message: `security.config is a third-party adapter's config; security.adapter '${security.adapter}' ${security.adapter === "cloudflare" ? "reads security.cloudflare" : "takes none"}`
|
|
376
|
+
});
|
|
377
|
+
}
|
|
212
378
|
if (security.adapter === "cloudflare") {
|
|
213
379
|
for (const field of ["zoneId", "apiToken"]) {
|
|
214
380
|
if (!security.cloudflare?.[field]) {
|
|
@@ -232,40 +398,47 @@ var securitySchema = securityFields.superRefine((security, ctx) => {
|
|
|
232
398
|
seen.add(rule.name);
|
|
233
399
|
});
|
|
234
400
|
});
|
|
235
|
-
|
|
236
|
-
function adapterBlock(slot, providers) {
|
|
237
|
-
const known = providers.map((p) => `'${p}'`).join(", ");
|
|
401
|
+
function adapterBlock(slot) {
|
|
238
402
|
return z.object({
|
|
239
|
-
provider:
|
|
240
|
-
errorMap: (issue, ctx) => issue.code === z.ZodIssueCode.invalid_enum_value ? {
|
|
241
|
-
message: `unknown ${slot} provider '${String(issue.received)}'; the ${slot} providers are ${known}`
|
|
242
|
-
} : { message: ctx.defaultError }
|
|
243
|
-
}),
|
|
403
|
+
provider: providerNameSchema(`${slot}.provider`),
|
|
244
404
|
config: z.record(z.string(), z.unknown()).optional(),
|
|
245
|
-
/**
|
|
246
|
-
|
|
247
|
-
|
|
405
|
+
/**
|
|
406
|
+
* The npm package the adapter comes from, in place of `@nymbalhq/<slot>-<provider>`. On a `custom` slot it is for
|
|
407
|
+
* tooling (`nymbal test:contracts`): the kernel takes the adapter passed to `createApp` and imports nothing.
|
|
408
|
+
*/
|
|
409
|
+
package: packageNameSchema.optional()
|
|
410
|
+
}).superRefine((block, ctx) => packageBesideBuiltIn(slot, block, ctx));
|
|
248
411
|
}
|
|
249
412
|
var commerceSchema = z.object({
|
|
250
|
-
payments: adapterBlock("payments"
|
|
251
|
-
email: adapterBlock("email"
|
|
252
|
-
reviews: adapterBlock("reviews"
|
|
253
|
-
search: adapterBlock("search"
|
|
254
|
-
analytics: adapterBlock("analytics"
|
|
255
|
-
shipping: adapterBlock("shipping"
|
|
256
|
-
tax: adapterBlock("tax"
|
|
257
|
-
ai: adapterBlock("ai"
|
|
413
|
+
payments: adapterBlock("payments"),
|
|
414
|
+
email: adapterBlock("email"),
|
|
415
|
+
reviews: adapterBlock("reviews"),
|
|
416
|
+
search: adapterBlock("search"),
|
|
417
|
+
analytics: adapterBlock("analytics"),
|
|
418
|
+
shipping: adapterBlock("shipping"),
|
|
419
|
+
tax: adapterBlock("tax"),
|
|
420
|
+
ai: adapterBlock("ai"),
|
|
258
421
|
orders: z.object({
|
|
259
422
|
numberPrefix: z.string().min(1).default("NYM"),
|
|
260
|
-
numberStart: z.number().int().nonnegative().default(1e3)
|
|
423
|
+
numberStart: z.number().int().nonnegative().default(1e3),
|
|
424
|
+
/** How long an order key opens the order on its own: the checkout's, and the order email's. */
|
|
425
|
+
keyLifetime: z.object({
|
|
426
|
+
checkout: z.string().regex(/^\d+(ms|s|m|h|d)$/, 'TTL must look like "48h"').default("48h"),
|
|
427
|
+
email: z.string().regex(/^\d+(ms|s|m|h|d)$/, 'TTL must look like "30d"').default("30d")
|
|
428
|
+
}).default({})
|
|
261
429
|
}).default({})
|
|
262
430
|
});
|
|
263
431
|
var httpSchema = z.object({
|
|
264
432
|
adapter: z.enum(["fastify", "hono"]).default("fastify"),
|
|
265
433
|
port: z.number().int().positive().default(3001),
|
|
266
434
|
host: z.string().default("0.0.0.0"),
|
|
267
|
-
/**
|
|
268
|
-
|
|
435
|
+
/**
|
|
436
|
+
* Which `X-Forwarded-For` entries set the client IP the rate limiter keys on. A number trusts that many proxy hops
|
|
437
|
+
* nearest the server (`1` behind one platform proxy); `0` trusts none. `true` trusts every entry, so a client's own
|
|
438
|
+
* left-most value wins: spoofable unless your proxy overwrites the header. Left at `false` (explicitly or not),
|
|
439
|
+
* NYMBAL_TRUST_PROXY_HOPS fills it at run time.
|
|
440
|
+
*/
|
|
441
|
+
trustProxy: z.union([z.boolean(), z.number().int().min(0)]).default(false),
|
|
269
442
|
cors: z.object({
|
|
270
443
|
allowedOrigins: z.array(z.string()).default(["http://localhost:3000", "http://localhost:4321"]),
|
|
271
444
|
credentials: z.boolean().default(true)
|
|
@@ -312,7 +485,7 @@ var nymbalConfigSchema = z.object({
|
|
|
312
485
|
events: eventsSchema.default({})
|
|
313
486
|
}).superRefine((cfg, ctx) => {
|
|
314
487
|
const archiveBucket = cfg.events.archive?.bucket;
|
|
315
|
-
if (archiveBucket !== void 0 && cfg.infrastructure.media === "s3" && archiveBucket === cfg.infrastructure.s3?.bucket) {
|
|
488
|
+
if (archiveBucket !== void 0 && cfg.infrastructure.media.provider === "s3" && archiveBucket === cfg.infrastructure.s3?.bucket) {
|
|
316
489
|
ctx.addIssue({
|
|
317
490
|
code: z.ZodIssueCode.custom,
|
|
318
491
|
path: ["events", "archive", "bucket"],
|
|
@@ -324,7 +497,7 @@ var nymbalConfigSchema = z.object({
|
|
|
324
497
|
ctx.addIssue({
|
|
325
498
|
code: z.ZodIssueCode.custom,
|
|
326
499
|
path: ["commerce", "email", "config", "transport"],
|
|
327
|
-
message: `the native email provider only prints to the console; for SMTP mail set email.provider to 'smtp' (@nymbalhq/
|
|
500
|
+
message: `the native email provider only prints to the console; for SMTP mail set email.provider to 'smtp' (@nymbalhq/email-smtp)`
|
|
328
501
|
});
|
|
329
502
|
}
|
|
330
503
|
});
|
|
@@ -401,11 +574,15 @@ function formatZodError(err, path) {
|
|
|
401
574
|
${lines.join("\n")}`;
|
|
402
575
|
}
|
|
403
576
|
export {
|
|
577
|
+
ADAPTER_CATALOGUE,
|
|
578
|
+
BUILT_IN,
|
|
579
|
+
COMMAND_STORES,
|
|
404
580
|
DEFAULT_JWT_SECRET,
|
|
405
|
-
KNOWN_INFRASTRUCTURE,
|
|
406
581
|
KNOWN_PROVIDERS,
|
|
582
|
+
PROVIDER_NAME,
|
|
407
583
|
REMOVED_INFRASTRUCTURE_KEYS,
|
|
408
584
|
commerceSchema,
|
|
585
|
+
conventionPackage,
|
|
409
586
|
defineConfig,
|
|
410
587
|
deploymentSchema,
|
|
411
588
|
env,
|
|
@@ -423,6 +600,8 @@ export {
|
|
|
423
600
|
redisSchema,
|
|
424
601
|
s3Schema,
|
|
425
602
|
securitySchema,
|
|
426
|
-
|
|
603
|
+
slotFolder,
|
|
604
|
+
storeSchema,
|
|
605
|
+
suggestProvider
|
|
427
606
|
};
|
|
428
607
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/define-config.ts","../src/env.ts","../src/known-providers.ts","../src/known-infrastructure.ts","../src/load.ts","../src/schema.ts"],"sourcesContent":["import type { NymbalConfigInput } from './schema.js'\n\nexport function defineConfig<T extends NymbalConfigInput>(config: T): T {\n return config\n}\n","import { ConfigError } from '@nymbalhq/types'\n\nexport function env(key: string, defaultValue?: string): string {\n const value = process.env[key]\n if (value !== undefined && value !== '') return value\n if (defaultValue !== undefined) return defaultValue\n throw new ConfigError(`Missing required environment variable: ${key}`, {\n context: { key },\n })\n}\n\nexport function envOptional(key: string): string | undefined {\n const value = process.env[key]\n return value !== undefined && value !== '' ? value : undefined\n}\n\nexport function envNumber(key: string, defaultValue?: number): number {\n const raw = envOptional(key)\n if (raw === undefined) {\n if (defaultValue !== undefined) return defaultValue\n throw new ConfigError(`Missing required environment variable: ${key}`, { context: { key } })\n }\n const parsed = Number(raw)\n if (!Number.isFinite(parsed)) {\n throw new ConfigError(`Environment variable ${key} is not a valid number: ${raw}`, {\n context: { key, raw },\n })\n }\n return parsed\n}\n\nexport function envBool(key: string, defaultValue = false): boolean {\n const raw = envOptional(key)?.toLowerCase()\n if (raw === undefined) return defaultValue\n return raw === 'true' || raw === '1' || raw === 'yes' || raw === 'on'\n}\n","import type { CommerceSlot } from '@nymbalhq/types'\n\nexport type { CommerceSlot }\n\n/**\n * The providers each commerce slot accepts. A provider that needs an SDK lives in an `@nymbalhq/adapter-*` package the\n * kernel loads only when the config names it; `custom` takes the adapter a project passes to `createApp`.\n */\nexport const KNOWN_PROVIDERS = {\n payments: ['native', 'stripe', 'custom'],\n email: ['native', 'smtp', 'custom'],\n reviews: ['native', 'custom'],\n search: ['native', 'custom'],\n analytics: ['native', 'custom'],\n shipping: ['native', 'custom'],\n tax: ['native', 'custom'],\n ai: ['none', 'anthropic', 'custom'],\n} as const satisfies Readonly<Record<CommerceSlot, readonly [string, ...string[]]>>\n","/**\n * The values each infrastructure slot accepts: only what is built. `in-memory`, `in-process` and `local-fs` are the\n * kernel's own; `redis`, `postgres-jsonb`, `redis-streams` and `s3` live in `@nymbalhq/*` packages the kernel loads\n * only when the config names them.\n */\nexport const KNOWN_INFRASTRUCTURE = {\n commandStore: ['sqlite', 'postgres'],\n documentStore: ['in-memory', 'redis', 'postgres-jsonb'],\n eventBus: ['in-process', 'redis-streams'],\n media: ['local-fs', 's3'],\n} as const satisfies Readonly<Record<string, readonly [string, ...string[]]>>\n\nexport type InfrastructureSlot = keyof typeof KNOWN_INFRASTRUCTURE\n\n/** Keys that drove nothing and were removed; a config that still sets one is told to delete it. */\nexport const REMOVED_INFRASTRUCTURE_KEYS = ['cloud', 'compute'] as const\n","import { existsSync } from 'node:fs'\nimport { dirname, isAbsolute, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { createJiti } from 'jiti'\nimport { z } from 'zod'\nimport { ConfigError, type CommerceSlotAdapters } from '@nymbalhq/types'\nimport { KNOWN_PROVIDERS } from './known-providers.js'\nimport { nymbalConfigSchema, type NymbalConfig } from './schema.js'\n\nconst CONFIG_FILE = 'nymbal.config.ts'\n\nexport interface LoadedConfig {\n config: NymbalConfig\n path: string\n projectRoot: string\n /** The module's named `adapters` export: one adapter per slot whose provider is `custom`, for createApp. */\n adapters?: Partial<CommerceSlotAdapters>\n}\n\nexport function findConfigFile(startDir: string): string | null {\n let current = isAbsolute(startDir) ? startDir : resolve(startDir)\n while (true) {\n const candidate = resolve(current, CONFIG_FILE)\n if (existsSync(candidate)) return candidate\n const parent = dirname(current)\n if (parent === current) return null\n current = parent\n }\n}\n\nexport async function loadConfig(startDir: string = process.cwd()): Promise<LoadedConfig> {\n const path = findConfigFile(startDir)\n if (!path) {\n throw new ConfigError(\n `Could not find ${CONFIG_FILE} in ${startDir} or any parent directory.`,\n { context: { startDir } },\n )\n }\n\n const jiti = createJiti(pathToFileURL(path).href, { interopDefault: true })\n let mod: Record<string, unknown>\n try {\n mod = await jiti.import<Record<string, unknown>>(path)\n } catch (err) {\n throw new ConfigError(`Failed to load ${path}: ${(err as Error).message}`, {\n cause: err,\n context: { path },\n })\n }\n\n const raw = mod['default'] ?? mod\n const adapters = adaptersExport(mod['adapters'], path)\n try {\n const config = nymbalConfigSchema.parse(raw)\n return { config, path, projectRoot: dirname(path), ...(adapters !== undefined && { adapters }) }\n } catch (err) {\n if (err instanceof z.ZodError) {\n throw new ConfigError(formatZodError(err, path), {\n cause: err,\n context: { path, issues: err.issues },\n })\n }\n throw err\n }\n}\n\n/** The `adapters` export, keyed by commerce slot; anything else is a mistake worth naming before createApp runs. */\nfunction adaptersExport(value: unknown, path: string): Partial<CommerceSlotAdapters> | undefined {\n if (value === undefined) return undefined\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new ConfigError(`${path}: the adapters export must be an object keyed by commerce slot`, {\n code: 'config.adapters_invalid',\n context: { path },\n })\n }\n const slots = Object.keys(KNOWN_PROVIDERS)\n const unknown = Object.keys(value).filter((key) => !slots.includes(key))\n if (unknown.length > 0) {\n throw new ConfigError(\n `${path}: the adapters export names ${unknown.join(', ')}, which is no commerce slot (${slots.join(', ')})`,\n { code: 'config.adapters_invalid', context: { path, unknown } },\n )\n }\n return value as Partial<CommerceSlotAdapters>\n}\n\nfunction formatZodError(err: z.ZodError, path: string): string {\n const lines = err.issues.map((issue) => {\n const at = issue.path.length > 0 ? issue.path.join('.') : '<root>'\n return ` • ${at}: ${issue.message}`\n })\n return `Invalid configuration in ${path}:\\n${lines.join('\\n')}`\n}\n","import { z } from 'zod'\nimport {\n KNOWN_INFRASTRUCTURE,\n REMOVED_INFRASTRUCTURE_KEYS,\n type InfrastructureSlot,\n} from './known-infrastructure.js'\nimport { KNOWN_PROVIDERS, type CommerceSlot } from './known-providers.js'\n\nconst rateLimitRuleSchema = z.object({\n requests: z.number().int().positive(),\n window: z.string().regex(/^\\d+(ms|s|m|h)$/, 'window must look like \"60s\", \"5m\", \"1h\"'),\n action: z.enum(['block', 'challenge', 'throttle']),\n})\n\nconst rateLimitPathPattern = /^\\/[\\w\\-/*:]*$/\n\n/** The schema's JWT secret when none is configured: fine for development, refused in production. */\nexport const DEFAULT_JWT_SECRET = 'dev-secret-please-override-me-1234567890'\n\nexport const storeSchema = z.object({\n name: z.string().min(1),\n currency: z.string().length(3),\n locale: z.string().min(2),\n timezone: z.string().min(1),\n /** The storefront's public URL, which the order email links from; with none, the email has no link. */\n url: z\n .string()\n .url()\n .transform((url) => url.replace(/\\/+$/, ''))\n .optional(),\n})\n\nconst quotedList = (values: readonly string[]): string => values.map((v) => `'${v}'`).join(', ')\n\n/** A slot's value must be one the slot lists; an unknown one is named with the list. */\nfunction infrastructureValue<const V extends readonly [string, ...string[]]>(\n slot: InfrastructureSlot,\n values: V,\n) {\n return z.enum(values, {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.invalid_enum_value\n ? {\n message: `unknown ${slot} '${String(issue.received)}'; the ${slot} values are ${quotedList(values)}`,\n }\n : { message: ctx.defaultError },\n })\n}\n\nconst INFRASTRUCTURE_KEYS = [...Object.keys(KNOWN_INFRASTRUCTURE), 'redis', 's3']\n\nfunction unrecognizedInfrastructureKeys(keys: string[]): string {\n return keys\n .map((key) =>\n (REMOVED_INFRASTRUCTURE_KEYS as readonly string[]).includes(key)\n ? `infrastructure.${key} was removed: it drives nothing, so delete it from the config`\n : `unknown infrastructure key '${key}'; the infrastructure keys are ${quotedList(INFRASTRUCTURE_KEYS)}`,\n )\n .join('; ')\n}\n\n/** The shared Redis connection of the `redis` document store and the `redis-streams` bus. */\nexport const redisSchema = z\n .object({\n /** Defaults to `REDIS_URL`. */\n url: z.string().min(1).optional(),\n /** Namespaces every key and stream; defaults to `NYMBAL_REDIS_PREFIX`, then `'nymbal'`. */\n prefix: z.string().min(1).optional(),\n /** How long a publish waits for the groups it delivers to (default 15 000). */\n ackTimeoutMs: z.number().int().positive().optional(),\n /** How long an entry may stay pending on a consumer before a live one takes it over (default 5 000). */\n claimIdleMs: z.number().int().positive().optional(),\n /** The approximate length each stream is trimmed to (default 10 000). */\n streamMaxLen: z.number().int().positive().optional(),\n })\n .strict()\n\nconst S3_KEYS = ['bucket', 'region', 'endpoint', 'prefix', 'publicUrl', 'forcePathStyle']\n\n/**\n * The bucket `media: 's3'` stores in. Each field falls back to the environment in the platform; credentials are never\n * config keys: the AWS SDK's default chain provides them.\n */\nexport const s3Schema = z\n .object(\n {\n /** Defaults to `S3_BUCKET`; one of the two is required. */\n bucket: z.string().min(1).optional(),\n /** Defaults to `AWS_REGION`, then `'us-east-1'`. */\n region: z.string().min(1).optional(),\n /** An S3-compatible API (MinIO, R2); defaults to `S3_ENDPOINT`, then AWS. */\n endpoint: z.string().min(1).optional(),\n /** Where every object key starts; defaults to `NYMBAL_S3_PREFIX`, then none. */\n prefix: z.string().optional(),\n /** Where the bucket's objects are served from (a CDN); defaults to `S3_PUBLIC_URL`, then the bucket's own URL. */\n publicUrl: z.string().min(1).optional(),\n /** Path-style requests; true by default when an endpoint is set. */\n forcePathStyle: z.boolean().optional(),\n },\n {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.unrecognized_keys\n ? {\n message: `unknown infrastructure.s3 key${issue.keys.length > 1 ? 's' : ''} ${quotedList(issue.keys)}; the s3 keys are ${quotedList(S3_KEYS)}, and credentials come from the AWS SDK (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, a profile or a role), never the config`,\n }\n : { message: ctx.defaultError },\n },\n )\n .strict()\n\nexport const infrastructureSchema = z\n .object(\n {\n commandStore: infrastructureValue('commandStore', KNOWN_INFRASTRUCTURE.commandStore),\n documentStore: infrastructureValue('documentStore', KNOWN_INFRASTRUCTURE.documentStore),\n eventBus: infrastructureValue('eventBus', KNOWN_INFRASTRUCTURE.eventBus),\n media: infrastructureValue('media', KNOWN_INFRASTRUCTURE.media).default('local-fs'),\n redis: redisSchema.optional(),\n s3: s3Schema.optional(),\n },\n {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.unrecognized_keys\n ? { message: unrecognizedInfrastructureKeys(issue.keys) }\n : { message: ctx.defaultError },\n },\n )\n .strict()\n .superRefine((infra, ctx) => {\n if (infra.documentStore === 'postgres-jsonb' && infra.commandStore !== 'postgres') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['documentStore'],\n message: `documentStore 'postgres-jsonb' shares the command store's Postgres connection, so it needs commandStore 'postgres' (not '${infra.commandStore}')`,\n })\n }\n if (infra.eventBus === 'redis-streams' && infra.documentStore === 'in-memory') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['eventBus'],\n message: `eventBus 'redis-streams' needs a shared documentStore ('redis' or 'postgres-jsonb'), not 'in-memory': a named group hands each event to one instance, so a per-process read model would miss the rest`,\n })\n }\n if (infra.s3 !== undefined && infra.media !== 's3') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['s3'],\n message: `infrastructure.s3 configures media 's3', but media is '${infra.media}': set media to 's3' or delete the s3 block`,\n })\n }\n })\n\n/** Where a `cloudflare` store's rules go: required when `security.adapter` is `cloudflare`, read with `env()`. */\nconst cloudflareSchema = z.object({\n zoneId: z.string().optional(),\n apiToken: z.string().optional(),\n /** The Cloudflare v4 API; the adapter defaults it to https://api.cloudflare.com/client/v4. */\n apiBase: z.string().url().optional(),\n})\n\nconst customRuleSchema = z.object({\n name: z.string().min(1),\n expression: z.string().min(1),\n action: z.enum(['block', 'managed_challenge', 'js_challenge', 'log']),\n})\n\nconst securityFields = z.object({\n adapter: z.enum(['middleware', 'cloudflare', 'aws-waf', 'akamai']),\n rateLimit: z\n .record(\n z.string().regex(rateLimitPathPattern, {\n message: 'rate limit keys must start with \"/\" and use only letters, numbers, -, _, /, *, :',\n }),\n rateLimitRuleSchema,\n )\n .default({}),\n botProtection: z\n .object({\n mode: z.enum(['off', 'managed', 'strict']).default('off'),\n allowList: z.array(z.string()).default([]),\n })\n .default({ mode: 'off', allowList: [] }),\n headers: z\n .object({\n hsts: z.boolean().default(true),\n contentSecurityPolicy: z\n .union([z.enum(['strict', 'relaxed', 'off']), z.string()])\n .default('strict'),\n referrerPolicy: z.string().default('strict-origin-when-cross-origin'),\n xFrameOptions: z.enum(['deny', 'sameorigin']).default('deny'),\n })\n .default({}),\n csrf: z.boolean().default(true),\n auth: z\n .object({\n jwtSecret: z.string().min(16).default(DEFAULT_JWT_SECRET),\n accessTtl: z\n .string()\n .regex(/^\\d+(ms|s|m|h|d)$/, 'TTL must look like \"15m\"')\n .default('15m'),\n refreshTtl: z\n .string()\n .regex(/^\\d+(ms|s|m|h|d)$/, 'TTL must look like \"7d\"')\n .default('7d'),\n })\n .default({}),\n cloudflare: cloudflareSchema.optional(),\n geo: z\n .object({\n block: z\n .array(z.string().regex(/^[A-Z]{2}$/, 'geo.block codes are ISO 3166 alpha-2, like \"RU\"'))\n .default([]),\n })\n .default({ block: [] }),\n customRules: z.array(customRuleSchema).default([]),\n managedRulesets: z.array(z.enum(['cloudflare', 'owasp'])).default([]),\n})\n\nexport const securitySchema = securityFields.superRefine((security, ctx) => {\n if (security.adapter === 'cloudflare') {\n for (const field of ['zoneId', 'apiToken'] as const) {\n if (!security.cloudflare?.[field]) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['cloudflare', field],\n message: `security.adapter 'cloudflare' needs security.cloudflare.${field}`,\n })\n }\n }\n }\n const seen = new Set<string>()\n security.customRules.forEach((rule, i) => {\n if (seen.has(rule.name)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['customRules', i, 'name'],\n message: `customRules has two rules named '${rule.name}'; names must be unique`,\n })\n }\n seen.add(rule.name)\n })\n})\n\n/**\n * npm's rules for a new package name: lower case and URL-safe, optionally `@scope/`, never starting with `.` or `_`.\n * The 214-character limit is checked beside it.\n */\nconst NPM_PACKAGE_NAME = /^(?:@[a-z0-9~-][a-z0-9._~-]*\\/)?[a-z0-9~-][a-z0-9._~-]*$/\n\n/** A slot's block: its provider must be one the slot knows, and an unknown one is named with the slot's list. */\nfunction adapterBlock<const P extends readonly [string, ...string[]]>(\n slot: CommerceSlot,\n providers: P,\n) {\n const known = providers.map((p) => `'${p}'`).join(', ')\n return z.object({\n provider: z.enum(providers, {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.invalid_enum_value\n ? {\n message: `unknown ${slot} provider '${String(issue.received)}'; the ${slot} providers are ${known}`,\n }\n : { message: ctx.defaultError },\n }),\n config: z.record(z.string(), z.unknown()).optional(),\n /** The npm package a `custom` slot's adapter comes from, for tooling (`nymbal test:contracts`); the kernel never reads it. */\n package: z\n .string()\n .max(214, 'an npm package name is at most 214 characters')\n .regex(NPM_PACKAGE_NAME, 'must be an npm package name, such as `@acme/nymbal-search`')\n .optional(),\n })\n}\n\nexport const commerceSchema = z.object({\n payments: adapterBlock('payments', KNOWN_PROVIDERS.payments),\n email: adapterBlock('email', KNOWN_PROVIDERS.email),\n reviews: adapterBlock('reviews', KNOWN_PROVIDERS.reviews),\n search: adapterBlock('search', KNOWN_PROVIDERS.search),\n analytics: adapterBlock('analytics', KNOWN_PROVIDERS.analytics),\n shipping: adapterBlock('shipping', KNOWN_PROVIDERS.shipping),\n tax: adapterBlock('tax', KNOWN_PROVIDERS.tax),\n ai: adapterBlock('ai', KNOWN_PROVIDERS.ai),\n orders: z\n .object({\n numberPrefix: z.string().min(1).default('NYM'),\n numberStart: z.number().int().nonnegative().default(1000),\n })\n .default({}),\n})\n\nexport const httpSchema = z.object({\n adapter: z.enum(['fastify', 'hono']).default('fastify'),\n port: z.number().int().positive().default(3001),\n host: z.string().default('0.0.0.0'),\n /** Whether `X-Forwarded-For` sets the client IP the rate limiter keys on; only behind a proxy you run. */\n trustProxy: z.boolean().default(false),\n cors: z\n .object({\n allowedOrigins: z\n .array(z.string())\n .default(['http://localhost:3000', 'http://localhost:4321']),\n credentials: z.boolean().default(true),\n })\n .default({}),\n})\n\nexport const deploymentSchema = z.object({\n strategy: z.enum(['standard', 'blue-green']).default('standard'),\n})\n\nexport const featuresSchema = z.object({\n staging: z.boolean().default(false),\n heartbeat: z.boolean().default(false),\n autoUpdates: z.boolean().default(false),\n})\n\n/**\n * The bucket delivered events past retention are archived to before they are deleted. Its objects hold customer\n * data, so it must be private: never the media bucket, which serves its objects publicly. Credentials come from the\n * AWS SDK's default chain, as `infrastructure.s3`'s do.\n */\nexport const eventArchiveSchema = z\n .object({\n adapter: z.literal('s3'),\n bucket: z.string().min(1),\n /** Where every archive key starts; none when not given. */\n prefix: z.string().optional(),\n /** `'us-east-1'` when not given. */\n region: z.string().min(1).optional(),\n /** An S3-compatible API (MinIO, R2). */\n endpoint: z.string().min(1).optional(),\n /** Path-style requests; true by default when an endpoint is set. */\n forcePathStyle: z.boolean().optional(),\n })\n .strict()\n\nexport const eventsSchema = z\n .object({\n /** Days a delivered event stays in the log. */\n retentionDays: z.number().int().min(1).default(30),\n archive: eventArchiveSchema.optional(),\n })\n .strict()\n\nexport const nymbalConfigSchema = z\n .object({\n store: storeSchema,\n template: z.enum(['astro', 'nextjs']),\n infrastructure: infrastructureSchema,\n security: securitySchema,\n commerce: commerceSchema,\n http: httpSchema,\n deployment: deploymentSchema,\n features: featuresSchema.default({\n staging: false,\n heartbeat: false,\n autoUpdates: false,\n }),\n events: eventsSchema.default({}),\n })\n .superRefine((cfg, ctx) => {\n const archiveBucket = cfg.events.archive?.bucket\n if (\n archiveBucket !== undefined &&\n cfg.infrastructure.media === 's3' &&\n archiveBucket === cfg.infrastructure.s3?.bucket\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['events', 'archive', 'bucket'],\n message: `events.archive.bucket is infrastructure.s3.bucket ('${archiveBucket}'), the media bucket, which serves its objects publicly; archive events to a private bucket of their own`,\n })\n }\n // SMTP left the kernel for @nymbalhq/adapter-smtp; a native block still asking for it would print to the console.\n const email = cfg.commerce.email\n if (email.provider === 'native' && email.config?.['transport'] === 'smtp') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['commerce', 'email', 'config', 'transport'],\n message: `the native email provider only prints to the console; for SMTP mail set email.provider to 'smtp' (@nymbalhq/adapter-smtp)`,\n })\n }\n })\n\nexport type NymbalConfigInput = z.input<typeof nymbalConfigSchema>\nexport type NymbalConfig = z.output<typeof nymbalConfigSchema>\n"],"mappings":";AAEO,SAAS,aAA0C,QAAc;AACtE,SAAO;AACT;;;ACJA,SAAS,mBAAmB;AAErB,SAAS,IAAI,KAAa,cAA+B;AAC9D,QAAM,QAAQ,QAAQ,IAAI,GAAG;AAC7B,MAAI,UAAU,UAAa,UAAU,GAAI,QAAO;AAChD,MAAI,iBAAiB,OAAW,QAAO;AACvC,QAAM,IAAI,YAAY,0CAA0C,GAAG,IAAI;AAAA,IACrE,SAAS,EAAE,IAAI;AAAA,EACjB,CAAC;AACH;AAEO,SAAS,YAAY,KAAiC;AAC3D,QAAM,QAAQ,QAAQ,IAAI,GAAG;AAC7B,SAAO,UAAU,UAAa,UAAU,KAAK,QAAQ;AACvD;AAEO,SAAS,UAAU,KAAa,cAA+B;AACpE,QAAM,MAAM,YAAY,GAAG;AAC3B,MAAI,QAAQ,QAAW;AACrB,QAAI,iBAAiB,OAAW,QAAO;AACvC,UAAM,IAAI,YAAY,0CAA0C,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAAA,EAC7F;AACA,QAAM,SAAS,OAAO,GAAG;AACzB,MAAI,CAAC,OAAO,SAAS,MAAM,GAAG;AAC5B,UAAM,IAAI,YAAY,wBAAwB,GAAG,2BAA2B,GAAG,IAAI;AAAA,MACjF,SAAS,EAAE,KAAK,IAAI;AAAA,IACtB,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEO,SAAS,QAAQ,KAAa,eAAe,OAAgB;AAClE,QAAM,MAAM,YAAY,GAAG,GAAG,YAAY;AAC1C,MAAI,QAAQ,OAAW,QAAO;AAC9B,SAAO,QAAQ,UAAU,QAAQ,OAAO,QAAQ,SAAS,QAAQ;AACnE;;;AC3BO,IAAM,kBAAkB;AAAA,EA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SAAO;AACT;AAEA,SAAS,eAAe,KAAiB,MAAsB;AAC7D,QAAM,QAAQ,IAAI,OAAO,IAAI,CAAC,UAAU;AACtC,UAAM,KAAK,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,KAAK,GAAG,IAAI;AAC1D,WAAO,YAAO,EAAE,KAAK,MAAM,OAAO;AAAA,EACpC,CAAC;AACD,SAAO,4BAA4B,IAAI;AAAA,EAAM,MAAM,KAAK,IAAI,CAAC;AAC/D;","names":["z","ConfigError","ConfigError","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/define-config.ts","../src/env.ts","../src/adapter-names.ts","../src/known-providers.ts","../src/known-infrastructure.ts","../src/load.ts","../src/schema.ts"],"sourcesContent":["import type { NymbalConfigInput } from './schema.js'\n\nexport function defineConfig<T extends NymbalConfigInput>(config: T): T {\n return config\n}\n","import { ConfigError } from '@nymbalhq/types'\n\nexport function env(key: string, defaultValue?: string): string {\n const value = process.env[key]\n if (value !== undefined && value !== '') return value\n if (defaultValue !== undefined) return defaultValue\n throw new ConfigError(`Missing required environment variable: ${key}`, {\n context: { key },\n })\n}\n\nexport function envOptional(key: string): string | undefined {\n const value = process.env[key]\n return value !== undefined && value !== '' ? value : undefined\n}\n\nexport function envNumber(key: string, defaultValue?: number): number {\n const raw = envOptional(key)\n if (raw === undefined) {\n if (defaultValue !== undefined) return defaultValue\n throw new ConfigError(`Missing required environment variable: ${key}`, { context: { key } })\n }\n const parsed = Number(raw)\n if (!Number.isFinite(parsed)) {\n throw new ConfigError(`Environment variable ${key} is not a valid number: ${raw}`, {\n context: { key, raw },\n })\n }\n return parsed\n}\n\nexport function envBool(key: string, defaultValue = false): boolean {\n const raw = envOptional(key)?.toLowerCase()\n if (raw === undefined) return defaultValue\n return raw === 'true' || raw === '1' || raw === 'yes' || raw === 'on'\n}\n","import type { CommerceSlot, Slot } from '@nymbalhq/types'\n\n/**\n * What a slot's provider may be called: lower-case letters, digits and hyphens, starting with a letter or digit. The\n * bound keeps every convention name within npm's 214 characters.\n */\nexport const PROVIDER_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A slot as its package names and folders spell it: `documentStore` is `document-store`. */\nexport function slotFolder(slot: Slot): string {\n return slot.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)\n}\n\n/** The package a provider lives in when the config names no `package`: `@nymbalhq/<slot folder>-<provider>`. */\nexport function conventionPackage(slot: Slot, provider: string): string {\n return `@nymbalhq/${slotFolder(slot)}-${provider}`\n}\n\nexport interface CatalogueEntry {\n /** The kernel's own provider, which no package holds. */\n builtIn?: true\n /** The SDK the provider's package peers, which the project installs beside it. */\n sdk?: string\n}\n\nconst builtIn = { builtIn: true } as const\n\n/**\n * The providers Nymbal ships, by slot: the kernel's built-ins and the first-party packages, each with the SDK it peers.\n * It never decides what loads; it gives install lines, suggestions for a mistyped provider and `nymbal add`'s list.\n */\nexport const ADAPTER_CATALOGUE: Readonly<Record<Slot, Readonly<Record<string, CatalogueEntry>>>> = {\n payments: { native: builtIn, stripe: { sdk: 'stripe' } },\n email: {\n native: builtIn,\n smtp: { sdk: 'nodemailer' },\n mailgun: { sdk: 'nodemailer' },\n resend: { sdk: 'nodemailer' },\n ses: { sdk: 'nodemailer' },\n },\n reviews: { native: builtIn },\n search: { native: builtIn, algolia: {} },\n analytics: { native: builtIn },\n shipping: { native: builtIn, easypost: {} },\n tax: { native: builtIn },\n ai: { none: builtIn, anthropic: { sdk: '@anthropic-ai/sdk' } },\n documentStore: {\n 'in-memory': builtIn,\n redis: { sdk: 'ioredis' },\n 'postgres-jsonb': { sdk: 'pg' },\n },\n eventBus: { 'in-process': builtIn, 'redis-streams': { sdk: 'ioredis' } },\n media: { 'local-fs': builtIn, s3: { sdk: '@aws-sdk/client-s3' } },\n security: { middleware: builtIn, cloudflare: {} },\n}\n\nconst SLOTS = Object.keys(ADAPTER_CATALOGUE) as Slot[]\n\n/** Each slot's built-in providers: the kernel's own adapter is used, and nothing is imported. */\nexport const BUILT_IN: Readonly<Record<Slot, readonly string[]>> = Object.fromEntries(\n SLOTS.map((slot) => [\n slot,\n Object.entries(ADAPTER_CATALOGUE[slot])\n .filter(([, entry]) => entry.builtIn === true)\n .map(([name]) => name),\n ]),\n) as unknown as Record<Slot, readonly string[]>\n\nexport const COMMERCE_SLOTS = [\n 'payments',\n 'email',\n 'reviews',\n 'search',\n 'analytics',\n 'shipping',\n 'tax',\n 'ai',\n] as const satisfies readonly CommerceSlot[]\n\nexport function isCommerceSlot(slot: Slot): slot is CommerceSlot {\n return (COMMERCE_SLOTS as readonly string[]).includes(slot)\n}\n\n/** Optimal string alignment distance: insertions, deletions, substitutions and adjacent transpositions. */\nfunction editDistance(a: string, b: string): number {\n const d: number[][] = Array.from({ length: a.length + 1 }, (_, i) =>\n Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)),\n )\n for (let i = 1; i <= a.length; i++) {\n for (let j = 1; j <= b.length; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1\n let best = Math.min(d[i - 1]![j]! + 1, d[i]![j - 1]! + 1, d[i - 1]![j - 1]! + cost)\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n best = Math.min(best, d[i - 2]![j - 2]! + 1)\n }\n d[i]![j] = best\n }\n }\n return d[a.length]![b.length]!\n}\n\nconst MAX_SUGGESTION_DISTANCE = 2\n\n/**\n * The catalogue name `name` was most likely meant to be, among the slot's catalogue names and, on a commerce slot,\n * `custom`: the nearest within two edits, the alphabetically first on a tie; none when nothing is that near.\n */\nexport function suggestProvider(slot: Slot, name: string): string | undefined {\n const candidates = [\n ...Object.keys(ADAPTER_CATALOGUE[slot]),\n ...(isCommerceSlot(slot) ? ['custom'] : []),\n ].sort()\n let best: { name: string; distance: number } | undefined\n for (const candidate of candidates) {\n const distance = editDistance(candidate, name)\n if (distance > MAX_SUGGESTION_DISTANCE) continue\n if (best === undefined || distance < best.distance) best = { name: candidate, distance }\n }\n return best?.name\n}\n","import type { CommerceSlot } from '@nymbalhq/types'\nimport { ADAPTER_CATALOGUE, COMMERCE_SLOTS } from './adapter-names.js'\n\nexport type { CommerceSlot }\n\n/**\n * The providers Nymbal ships for each commerce slot, from the catalogue, and `custom`, the adapter a project passes\n * to `createApp`. A slot accepts any provider name; this list gates nothing.\n */\nexport const KNOWN_PROVIDERS: Readonly<Record<CommerceSlot, readonly string[]>> =\n Object.fromEntries(\n COMMERCE_SLOTS.map((slot) => [slot, [...Object.keys(ADAPTER_CATALOGUE[slot]), 'custom']]),\n ) as unknown as Record<CommerceSlot, readonly string[]>\n","/** The command store's dialects: a kernel dialect, not an adapter slot, so it stays a closed list. */\nexport const COMMAND_STORES = ['sqlite', 'postgres'] as const\n\n/** The infrastructure slots: the command store, and the three that take an adapter block. */\nexport type InfrastructureSlot = 'commandStore' | 'documentStore' | 'eventBus' | 'media'\n\n/** Keys that drove nothing and were removed; a config that still sets one is told to delete it. */\nexport const REMOVED_INFRASTRUCTURE_KEYS = ['cloud', 'compute'] as const\n","import { existsSync } from 'node:fs'\nimport { dirname, isAbsolute, resolve } from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { createJiti } from 'jiti'\nimport { z } from 'zod'\nimport { ConfigError, type CommerceSlotAdapters } from '@nymbalhq/types'\nimport { KNOWN_PROVIDERS } from './known-providers.js'\nimport { nymbalConfigSchema, type NymbalConfig } from './schema.js'\n\nconst CONFIG_FILE = 'nymbal.config.ts'\n\nexport interface LoadedConfig {\n config: NymbalConfig\n path: string\n projectRoot: string\n /** The module's named `adapters` export: one adapter per slot whose provider is `custom`, for createApp. */\n adapters?: Partial<CommerceSlotAdapters>\n}\n\nexport function findConfigFile(startDir: string): string | null {\n let current = isAbsolute(startDir) ? startDir : resolve(startDir)\n while (true) {\n const candidate = resolve(current, CONFIG_FILE)\n if (existsSync(candidate)) return candidate\n const parent = dirname(current)\n if (parent === current) return null\n current = parent\n }\n}\n\nexport async function loadConfig(startDir: string = process.cwd()): Promise<LoadedConfig> {\n const path = findConfigFile(startDir)\n if (!path) {\n throw new ConfigError(\n `Could not find ${CONFIG_FILE} in ${startDir} or any parent directory.`,\n { context: { startDir } },\n )\n }\n\n const jiti = createJiti(pathToFileURL(path).href, { interopDefault: true })\n let mod: Record<string, unknown>\n try {\n mod = await jiti.import<Record<string, unknown>>(path)\n } catch (err) {\n throw new ConfigError(`Failed to load ${path}: ${(err as Error).message}`, {\n cause: err,\n context: { path },\n })\n }\n\n const raw = mod['default'] ?? mod\n const adapters = adaptersExport(mod['adapters'], path)\n try {\n const config = nymbalConfigSchema.parse(raw)\n return { config, path, projectRoot: dirname(path), ...(adapters !== undefined && { adapters }) }\n } catch (err) {\n if (err instanceof z.ZodError) {\n throw new ConfigError(formatZodError(err, path), {\n cause: err,\n context: { path, issues: err.issues },\n })\n }\n throw err\n }\n}\n\n/** The `adapters` export, keyed by commerce slot; anything else is a mistake worth naming before createApp runs. */\nfunction adaptersExport(value: unknown, path: string): Partial<CommerceSlotAdapters> | undefined {\n if (value === undefined) return undefined\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new ConfigError(`${path}: the adapters export must be an object keyed by commerce slot`, {\n code: 'config.adapters_invalid',\n context: { path },\n })\n }\n const slots = Object.keys(KNOWN_PROVIDERS)\n const unknown = Object.keys(value).filter((key) => !slots.includes(key))\n if (unknown.length > 0) {\n throw new ConfigError(\n `${path}: the adapters export names ${unknown.join(', ')}, which is no commerce slot (${slots.join(', ')})`,\n { code: 'config.adapters_invalid', context: { path, unknown } },\n )\n }\n return value as Partial<CommerceSlotAdapters>\n}\n\nfunction formatZodError(err: z.ZodError, path: string): string {\n const lines = err.issues.map((issue) => {\n const at = issue.path.length > 0 ? issue.path.join('.') : '<root>'\n return ` • ${at}: ${issue.message}`\n })\n return `Invalid configuration in ${path}:\\n${lines.join('\\n')}`\n}\n","import { z } from 'zod'\nimport type { Slot } from '@nymbalhq/types'\nimport { BUILT_IN, PROVIDER_NAME, slotFolder } from './adapter-names.js'\nimport {\n COMMAND_STORES,\n REMOVED_INFRASTRUCTURE_KEYS,\n type InfrastructureSlot,\n} from './known-infrastructure.js'\nimport { type CommerceSlot } from './known-providers.js'\n\nconst rateLimitRuleSchema = z.object({\n requests: z.number().int().positive(),\n window: z.string().regex(/^\\d+(ms|s|m|h)$/, 'window must look like \"60s\", \"5m\", \"1h\"'),\n action: z.enum(['block', 'challenge', 'throttle']),\n /** Counts only the requests to the path that carry this header, such as `x-nymbal-order-email`. */\n header: z.string().min(1).optional(),\n})\n\nconst rateLimitPathPattern = /^\\/[\\w\\-/*:]*$/\n\n/** The schema's JWT secret when none is configured: fine for development, refused in production. */\nexport const DEFAULT_JWT_SECRET = 'dev-secret-please-override-me-1234567890'\n\nexport const storeSchema = z.object({\n name: z.string().min(1),\n currency: z.string().length(3),\n locale: z.string().min(2),\n timezone: z.string().min(1),\n /** The storefront's public URL, which the order email links from; with none, the email has no link. */\n url: z\n .string()\n .url()\n .transform((url) => url.replace(/\\/+$/, ''))\n .optional(),\n})\n\nconst quotedList = (values: readonly string[]): string => values.map((v) => `'${v}'`).join(', ')\n\n/** A slot's value must be one the slot lists; an unknown one is named with the list. */\nfunction infrastructureValue<const V extends readonly [string, ...string[]]>(\n slot: InfrastructureSlot,\n values: V,\n) {\n return z.enum(values, {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.invalid_enum_value\n ? {\n message: `unknown ${slot} '${String(issue.received)}'; the ${slot} values are ${quotedList(values)}`,\n }\n : { message: ctx.defaultError },\n })\n}\n\n/**\n * npm's rules for a new package name: lower case and URL-safe, optionally `@scope/`, never starting with `.` or `_`.\n * The 214-character limit is checked beside it.\n */\nconst NPM_PACKAGE_NAME = /^(?:@[a-z0-9~-][a-z0-9._~-]*\\/)?[a-z0-9~-][a-z0-9._~-]*$/\n\nconst packageNameSchema = z\n .string()\n .max(214, 'an npm package name is at most 214 characters')\n .regex(NPM_PACKAGE_NAME, 'must be an npm package name, such as `@acme/nymbal-search`')\n\n/** A provider name, refused with the value and the pattern when it is not one: it becomes part of a package name. */\nfunction providerNameSchema(where: string) {\n return z.string().superRefine((value, ctx) => {\n if (!PROVIDER_NAME.test(value)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `${where} '${value}' is not a provider name: a provider matches ${PROVIDER_NAME.source}`,\n })\n }\n })\n}\n\n/** How a slot's choice reads in a message: `payments.provider 'stripe'`, `infrastructure.media 's3'`. */\nfunction choiceOf(slot: Slot, provider: string): string {\n if (slot === 'security') return `security.adapter '${provider}'`\n if (slot === 'documentStore' || slot === 'eventBus' || slot === 'media') {\n return `infrastructure.${slot} '${provider}'`\n }\n return `${slot}.provider '${provider}'`\n}\n\n/** `package` names a third party's adapter, which a built-in provider never is. */\nfunction packageBesideBuiltIn(\n slot: Slot,\n block: { provider: string; package?: string | undefined },\n ctx: z.RefinementCtx,\n): void {\n if (block.package === undefined || !BUILT_IN[slot].includes(block.provider)) return\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['package'],\n message: `${choiceOf(slot, block.provider)} is built in, so it takes no package: delete package, or give the third-party adapter's own provider name beside it`,\n })\n}\n\n/** `custom` is the adapter passed to `createApp`, which only a commerce slot takes. */\nfunction customOutsideCommerce(slot: Slot, provider: string, ctx: z.RefinementCtx): void {\n if (provider !== 'custom') return\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [slot === 'security' ? 'adapter' : 'provider'],\n message: `${choiceOf(slot, provider)}: only a commerce slot takes an adapter passed to createApp; name a third-party adapter with package: { provider: 'acme', package: '@acme/nymbal-${slotFolder(slot)}' }`,\n })\n}\n\ntype BlockSlot = 'documentStore' | 'eventBus' | 'media'\n\n/**\n * The providers whose connection the kernel builds itself, and what configures each: their block takes no `config`.\n * Any other provider gets the block's `config` as its adapter's `ctx.config`.\n */\nconst KERNEL_CONFIGURED: Readonly<Record<BlockSlot, Readonly<Record<string, string>>>> = {\n documentStore: {\n 'in-memory': 'it is built in and takes none',\n redis: 'infrastructure.redis configures it',\n 'postgres-jsonb': \"it uses the command store's Postgres connection (DATABASE_URL)\",\n },\n eventBus: {\n 'in-process': 'it is built in and takes none',\n 'redis-streams': 'infrastructure.redis configures it',\n },\n media: {\n 'local-fs': 'it is built in and takes none',\n s3: 'infrastructure.s3 configures it',\n },\n}\n\n/** An infrastructure slot's block, `{ provider, package?, config? }`; a string is refused, saying how to write it. */\nfunction infrastructureBlock(slot: BlockSlot) {\n return z\n .object(\n {\n provider: providerNameSchema(`infrastructure.${slot}`),\n /** The npm package the adapter comes from, in place of `@nymbalhq/<slot>-<provider>`. */\n package: packageNameSchema.optional(),\n /** The adapter's `ctx.config`, for a provider whose connection the kernel does not build. */\n config: z.record(z.string(), z.unknown()).optional(),\n },\n {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.invalid_type && typeof ctx.data === 'string'\n ? {\n message: `infrastructure.${slot} takes a block: write { provider: '${ctx.data}' }`,\n }\n : { message: ctx.defaultError },\n },\n )\n .superRefine((block, ctx) => {\n customOutsideCommerce(slot, block.provider, ctx)\n packageBesideBuiltIn(slot, block, ctx)\n const configuredBy = Object.hasOwn(KERNEL_CONFIGURED[slot], block.provider)\n ? KERNEL_CONFIGURED[slot][block.provider]\n : undefined\n if (block.config !== undefined && configuredBy !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['config'],\n message: `infrastructure.${slot} '${block.provider}' takes no config: ${configuredBy}`,\n })\n }\n })\n}\n\nconst INFRASTRUCTURE_KEYS = ['commandStore', 'documentStore', 'eventBus', 'media', 'redis', 's3']\n\nfunction unrecognizedInfrastructureKeys(keys: string[]): string {\n return keys\n .map((key) =>\n (REMOVED_INFRASTRUCTURE_KEYS as readonly string[]).includes(key)\n ? `infrastructure.${key} was removed: it drives nothing, so delete it from the config`\n : `unknown infrastructure key '${key}'; the infrastructure keys are ${quotedList(INFRASTRUCTURE_KEYS)}`,\n )\n .join('; ')\n}\n\n/** The shared Redis connection of the `redis` document store and the `redis-streams` bus. */\nexport const redisSchema = z\n .object({\n /** Defaults to `REDIS_URL`. */\n url: z.string().min(1).optional(),\n /** Namespaces every key and stream; defaults to `NYMBAL_REDIS_PREFIX`, then `'nymbal'`. */\n prefix: z.string().min(1).optional(),\n /** How long a publish waits for the groups it delivers to (default 15 000). */\n ackTimeoutMs: z.number().int().positive().optional(),\n /** How long an entry may stay pending on a consumer before a live one takes it over (default 5 000). */\n claimIdleMs: z.number().int().positive().optional(),\n /** The approximate length each stream is trimmed to (default 10 000). */\n streamMaxLen: z.number().int().positive().optional(),\n })\n .strict()\n\nconst S3_KEYS = ['bucket', 'region', 'endpoint', 'prefix', 'publicUrl', 'forcePathStyle']\n\n/**\n * The bucket `media: { provider: 's3' }` stores in. Each field falls back to the environment in the platform;\n * credentials are never config keys: the AWS SDK's default chain provides them.\n */\nexport const s3Schema = z\n .object(\n {\n /** Defaults to `S3_BUCKET`; one of the two is required. */\n bucket: z.string().min(1).optional(),\n /** Defaults to `AWS_REGION`, then `'us-east-1'`. */\n region: z.string().min(1).optional(),\n /** An S3-compatible API (MinIO, R2); defaults to `S3_ENDPOINT`, then AWS. */\n endpoint: z.string().min(1).optional(),\n /** Where every object key starts; defaults to `NYMBAL_S3_PREFIX`, then none. */\n prefix: z.string().optional(),\n /** Where the bucket's objects are served from (a CDN); defaults to `S3_PUBLIC_URL`, then the bucket's own URL. */\n publicUrl: z.string().min(1).optional(),\n /** Path-style requests; true by default when an endpoint is set. */\n forcePathStyle: z.boolean().optional(),\n },\n {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.unrecognized_keys\n ? {\n message: `unknown infrastructure.s3 key${issue.keys.length > 1 ? 's' : ''} ${quotedList(issue.keys)}; the s3 keys are ${quotedList(S3_KEYS)}, and credentials come from the AWS SDK (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, a profile or a role), never the config`,\n }\n : { message: ctx.defaultError },\n },\n )\n .strict()\n\nexport const infrastructureSchema = z\n .object(\n {\n commandStore: infrastructureValue('commandStore', COMMAND_STORES),\n documentStore: infrastructureBlock('documentStore'),\n eventBus: infrastructureBlock('eventBus'),\n media: infrastructureBlock('media').default({ provider: 'local-fs' }),\n redis: redisSchema.optional(),\n s3: s3Schema.optional(),\n },\n {\n errorMap: (issue, ctx) =>\n issue.code === z.ZodIssueCode.unrecognized_keys\n ? { message: unrecognizedInfrastructureKeys(issue.keys) }\n : { message: ctx.defaultError },\n },\n )\n .strict()\n .superRefine((infra, ctx) => {\n if (infra.documentStore.provider === 'postgres-jsonb' && infra.commandStore !== 'postgres') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['documentStore'],\n message: `documentStore 'postgres-jsonb' shares the command store's Postgres connection, so it needs commandStore 'postgres' (not '${infra.commandStore}')`,\n })\n }\n if (\n infra.eventBus.provider === 'redis-streams' &&\n infra.documentStore.provider === 'in-memory'\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['eventBus'],\n message: `eventBus 'redis-streams' needs a shared documentStore ('redis' or 'postgres-jsonb'), not 'in-memory': a named group hands each event to one instance, so a per-process read model would miss the rest`,\n })\n }\n if (infra.s3 !== undefined && infra.media.provider !== 's3') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['s3'],\n message: `infrastructure.s3 configures media 's3', but media is '${infra.media.provider}': set media to 's3' or delete the s3 block`,\n })\n }\n })\n\n/** Where a `cloudflare` store's rules go: required when `security.adapter` is `cloudflare`, read with `env()`. */\nconst cloudflareSchema = z.object({\n zoneId: z.string().optional(),\n apiToken: z.string().optional(),\n /** The Cloudflare v4 API; the adapter defaults it to https://api.cloudflare.com/client/v4. */\n apiBase: z.string().url().optional(),\n})\n\nconst customRuleSchema = z.object({\n name: z.string().min(1),\n expression: z.string().min(1),\n action: z.enum(['block', 'managed_challenge', 'js_challenge', 'log']),\n})\n\nconst securityFields = z.object({\n /** `middleware` is the kernel's own; any other resolves as a commerce provider does, `security-<adapter>`. */\n adapter: providerNameSchema('security.adapter'),\n /** The npm package the adapter comes from, in place of `@nymbalhq/security-<adapter>`. */\n package: packageNameSchema.optional(),\n /** A third-party adapter's `ctx.config`; `cloudflare` reads `security.cloudflare`, and `middleware` takes none. */\n config: z.record(z.string(), z.unknown()).optional(),\n rateLimit: z\n .record(\n z.string().regex(rateLimitPathPattern, {\n message: 'rate limit keys must start with \"/\" and use only letters, numbers, -, _, /, *, :',\n }),\n rateLimitRuleSchema,\n )\n .default({}),\n botProtection: z\n .object({\n mode: z.enum(['off', 'managed', 'strict']).default('off'),\n allowList: z.array(z.string()).default([]),\n })\n .default({ mode: 'off', allowList: [] }),\n headers: z\n .object({\n hsts: z.boolean().default(true),\n contentSecurityPolicy: z\n .union([z.enum(['strict', 'relaxed', 'off']), z.string()])\n .default('strict'),\n referrerPolicy: z.string().default('strict-origin-when-cross-origin'),\n xFrameOptions: z.enum(['deny', 'sameorigin']).default('deny'),\n })\n .default({}),\n csrf: z.boolean().default(true),\n auth: z\n .object({\n jwtSecret: z.string().min(16).default(DEFAULT_JWT_SECRET),\n accessTtl: z\n .string()\n .regex(/^\\d+(ms|s|m|h|d)$/, 'TTL must look like \"15m\"')\n .default('15m'),\n refreshTtl: z\n .string()\n .regex(/^\\d+(ms|s|m|h|d)$/, 'TTL must look like \"7d\"')\n .default('7d'),\n })\n .default({}),\n cloudflare: cloudflareSchema.optional(),\n geo: z\n .object({\n block: z\n .array(z.string().regex(/^[A-Z]{2}$/, 'geo.block codes are ISO 3166 alpha-2, like \"RU\"'))\n .default([]),\n })\n .default({ block: [] }),\n customRules: z.array(customRuleSchema).default([]),\n managedRulesets: z.array(z.enum(['cloudflare', 'owasp'])).default([]),\n})\n\nexport const securitySchema = securityFields.superRefine((security, ctx) => {\n customOutsideCommerce('security', security.adapter, ctx)\n packageBesideBuiltIn('security', { provider: security.adapter, package: security.package }, ctx)\n if (\n security.config !== undefined &&\n (security.adapter === 'middleware' || security.adapter === 'cloudflare')\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['config'],\n message: `security.config is a third-party adapter's config; security.adapter '${security.adapter}' ${security.adapter === 'cloudflare' ? 'reads security.cloudflare' : 'takes none'}`,\n })\n }\n if (security.adapter === 'cloudflare') {\n for (const field of ['zoneId', 'apiToken'] as const) {\n if (!security.cloudflare?.[field]) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['cloudflare', field],\n message: `security.adapter 'cloudflare' needs security.cloudflare.${field}`,\n })\n }\n }\n }\n const seen = new Set<string>()\n security.customRules.forEach((rule, i) => {\n if (seen.has(rule.name)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['customRules', i, 'name'],\n message: `customRules has two rules named '${rule.name}'; names must be unique`,\n })\n }\n seen.add(rule.name)\n })\n})\n\n/** A commerce slot's block: any provider name, the npm package it comes from, and the adapter's config. */\nfunction adapterBlock(slot: CommerceSlot) {\n return z\n .object({\n provider: providerNameSchema(`${slot}.provider`),\n config: z.record(z.string(), z.unknown()).optional(),\n /**\n * The npm package the adapter comes from, in place of `@nymbalhq/<slot>-<provider>`. On a `custom` slot it is for\n * tooling (`nymbal test:contracts`): the kernel takes the adapter passed to `createApp` and imports nothing.\n */\n package: packageNameSchema.optional(),\n })\n .superRefine((block, ctx) => packageBesideBuiltIn(slot, block, ctx))\n}\n\nexport const commerceSchema = z.object({\n payments: adapterBlock('payments'),\n email: adapterBlock('email'),\n reviews: adapterBlock('reviews'),\n search: adapterBlock('search'),\n analytics: adapterBlock('analytics'),\n shipping: adapterBlock('shipping'),\n tax: adapterBlock('tax'),\n ai: adapterBlock('ai'),\n orders: z\n .object({\n numberPrefix: z.string().min(1).default('NYM'),\n numberStart: z.number().int().nonnegative().default(1000),\n /** How long an order key opens the order on its own: the checkout's, and the order email's. */\n keyLifetime: z\n .object({\n checkout: z\n .string()\n .regex(/^\\d+(ms|s|m|h|d)$/, 'TTL must look like \"48h\"')\n .default('48h'),\n email: z\n .string()\n .regex(/^\\d+(ms|s|m|h|d)$/, 'TTL must look like \"30d\"')\n .default('30d'),\n })\n .default({}),\n })\n .default({}),\n})\n\nexport const httpSchema = z.object({\n adapter: z.enum(['fastify', 'hono']).default('fastify'),\n port: z.number().int().positive().default(3001),\n host: z.string().default('0.0.0.0'),\n /**\n * Which `X-Forwarded-For` entries set the client IP the rate limiter keys on. A number trusts that many proxy hops\n * nearest the server (`1` behind one platform proxy); `0` trusts none. `true` trusts every entry, so a client's own\n * left-most value wins: spoofable unless your proxy overwrites the header. Left at `false` (explicitly or not),\n * NYMBAL_TRUST_PROXY_HOPS fills it at run time.\n */\n trustProxy: z.union([z.boolean(), z.number().int().min(0)]).default(false),\n cors: z\n .object({\n allowedOrigins: z\n .array(z.string())\n .default(['http://localhost:3000', 'http://localhost:4321']),\n credentials: z.boolean().default(true),\n })\n .default({}),\n})\n\nexport const deploymentSchema = z.object({\n strategy: z.enum(['standard', 'blue-green']).default('standard'),\n})\n\nexport const featuresSchema = z.object({\n staging: z.boolean().default(false),\n heartbeat: z.boolean().default(false),\n autoUpdates: z.boolean().default(false),\n})\n\n/**\n * The bucket delivered events past retention are archived to before they are deleted. Its objects hold customer\n * data, so it must be private: never the media bucket, which serves its objects publicly. Credentials come from the\n * AWS SDK's default chain, as `infrastructure.s3`'s do.\n */\nexport const eventArchiveSchema = z\n .object({\n adapter: z.literal('s3'),\n bucket: z.string().min(1),\n /** Where every archive key starts; none when not given. */\n prefix: z.string().optional(),\n /** `'us-east-1'` when not given. */\n region: z.string().min(1).optional(),\n /** An S3-compatible API (MinIO, R2). */\n endpoint: z.string().min(1).optional(),\n /** Path-style requests; true by default when an endpoint is set. */\n forcePathStyle: z.boolean().optional(),\n })\n .strict()\n\nexport const eventsSchema = z\n .object({\n /** Days a delivered event stays in the log. */\n retentionDays: z.number().int().min(1).default(30),\n archive: eventArchiveSchema.optional(),\n })\n .strict()\n\nexport const nymbalConfigSchema = z\n .object({\n store: storeSchema,\n template: z.enum(['astro', 'nextjs']),\n infrastructure: infrastructureSchema,\n security: securitySchema,\n commerce: commerceSchema,\n http: httpSchema,\n deployment: deploymentSchema,\n features: featuresSchema.default({\n staging: false,\n heartbeat: false,\n autoUpdates: false,\n }),\n events: eventsSchema.default({}),\n })\n .superRefine((cfg, ctx) => {\n const archiveBucket = cfg.events.archive?.bucket\n if (\n archiveBucket !== undefined &&\n cfg.infrastructure.media.provider === 's3' &&\n archiveBucket === cfg.infrastructure.s3?.bucket\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['events', 'archive', 'bucket'],\n message: `events.archive.bucket is infrastructure.s3.bucket ('${archiveBucket}'), the media bucket, which serves its objects publicly; archive events to a private bucket of their own`,\n })\n }\n // SMTP left the kernel for @nymbalhq/email-smtp; a native block still asking for it would print to the console.\n const email = cfg.commerce.email\n if (email.provider === 'native' && email.config?.['transport'] === 'smtp') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['commerce', 'email', 'config', 'transport'],\n message: `the native email provider only prints to the console; for SMTP mail set email.provider to 'smtp' (@nymbalhq/email-smtp)`,\n })\n }\n })\n\nexport type NymbalConfigInput = z.input<typeof nymbalConfigSchema>\nexport type NymbalConfig = z.output<typeof nymbalConfigSchema>\n"],"mappings":";AAEO,SAAS,aAA0C,QAAc;AACtE,SAAO;AACT;;;ACJA,SAAS,mBAAmB;AAErB,SAAS,IAAI,KAAa,cAA+B;AAC9D,QAAM,QAAQ,QAAQ,IAAI,GAAG;AAC7B,MAAI,UAAU,UAAa,UAAU,GAAI,QAAO;AAChD,MAAI,iBAAiB,OAAW,QAAO;AACvC,QAAM,IAAI,YAAY,0CAA0C,GAAG,IAAI;AAAA,IACrE,SAAS,EAAE,IAAI;AAAA,EACjB,CAAC;AACH;AAEO,SAAS,YAAY,KAAiC;AAC3D,QAAM,QAAQ,QAAQ,IAAI,GAAG;AAC7B,SAAO,UAAU,UAAa,UAAU,KAAK,QAAQ;AACvD;AAEO,SAAS,UAAU,KAAa,cAA+B;AACpE,QAAM,MAAM,YAAY,GAAG;AAC3B,MAAI,Q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C;AACD,SAAO,4BAA4B,IAAI;AAAA,EAAM,MAAM,KAAK,IAAI,CAAC;AAC/D;","names":["_","z","ConfigError","ConfigError","z"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nymbalhq/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Typed configuration surface for Nymbal",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nymbalhq/types": "1.
|
|
30
|
+
"@nymbalhq/types": "1.5.0",
|
|
31
31
|
"jiti": "^2.4.0",
|
|
32
32
|
"zod": "^3.23.8"
|
|
33
33
|
},
|