riverbankcms 0.31.1 → 0.32.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/acceptance/matrix.mjs +3 -3
- package/dist/cli/index.mjs +10625 -5194
- package/dist/cli/init-docs/content/cli-reference.md +24 -1
- package/dist/{entryCommands-CYEpLRXI.mjs → entryCommands-BJFkJn_e.mjs} +2665 -1409
- package/dist/eventUpsertInputSchema-BD_RuhcK.mjs +108 -0
- package/dist/load-config-CODn5_ki.mjs +4 -0
- package/dist/{load-config-DIyqYeRP.mjs → load-config-CfL4ZWC8.mjs} +3 -2
- package/dist/{plan-D5NfiRLe.mjs → plan-CbzdsZp3.mjs} +1 -1
- package/dist/scaffold/index.mjs +2 -2
- package/dist/sdk-event-upsert-SodZay6g.mjs +46258 -0
- package/dist/{src-exrglXYU.mjs → src-CVyy-M-N.mjs} +544 -368
- package/dist/testing.mjs +4 -4
- package/package.json +2 -1
- package/dist/eventUpsertInputSchema-CGmm5o_I.mjs +0 -5519
- package/dist/load-config-B_kPvIxz.mjs +0 -4
- package/dist/sdk-event-upsert-0U4hsDpo.mjs +0 -15688
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { En as sdkEntrySlotBlocksInputSchema, a as classifySdkEventSchedule, i as sdkEventUpsertOptionalFieldSchemas, n as sdkCourseBookingSettingsSchema, o as classifySdkEventBookingOffer } from "./sdk-event-upsert-SodZay6g.mjs";
|
|
3
|
+
import { _ as EVENT_PRESET_VALUES } from "./src-CVyy-M-N.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region src/commands/eventUpsertInputSchema.ts
|
|
7
|
+
const eventScheduleInputSchema = z.object({
|
|
8
|
+
recurrenceRule: z.string().nullable().optional(),
|
|
9
|
+
startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
|
10
|
+
defaultStartTime: z.string().min(1).optional(),
|
|
11
|
+
durationMinutes: z.number().int().positive().optional(),
|
|
12
|
+
startsAt: z.string().min(1).optional(),
|
|
13
|
+
endsAt: z.string().min(1).optional()
|
|
14
|
+
}).transform((schedule, ctx) => {
|
|
15
|
+
const result = classifySdkEventSchedule(schedule, { requireCanonicalFields: true });
|
|
16
|
+
if (!result.ok) {
|
|
17
|
+
result.issues.forEach((issue) => ctx.addIssue({
|
|
18
|
+
code: "custom",
|
|
19
|
+
path: [...issue.path],
|
|
20
|
+
message: issue.message
|
|
21
|
+
}));
|
|
22
|
+
return z.NEVER;
|
|
23
|
+
}
|
|
24
|
+
if (result.kind === "start-end") {
|
|
25
|
+
return {
|
|
26
|
+
startsAt: result.startsAtIso,
|
|
27
|
+
endsAt: result.endsAtIso
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (result.kind === "start-duration") {
|
|
31
|
+
return {
|
|
32
|
+
startsAt: result.startsAtIso,
|
|
33
|
+
durationMinutes: (Date.parse(result.endsAtIso) - Date.parse(result.startsAtIso)) / 6e4
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return result.canonical;
|
|
37
|
+
});
|
|
38
|
+
function classifiedSchema(classify) {
|
|
39
|
+
return z.unknown().transform((input, ctx) => {
|
|
40
|
+
const result = classify(input);
|
|
41
|
+
if (result.ok) return result.value;
|
|
42
|
+
result.issues.forEach((issue) => ctx.addIssue({
|
|
43
|
+
code: "custom",
|
|
44
|
+
path: issue.path.map(String),
|
|
45
|
+
message: issue.message
|
|
46
|
+
}));
|
|
47
|
+
return z.NEVER;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const eventBookingOfferInputSchema = classifiedSchema((input) => {
|
|
51
|
+
const result = classifySdkEventBookingOffer(input);
|
|
52
|
+
return result.ok && result.bookingOffer ? {
|
|
53
|
+
ok: true,
|
|
54
|
+
value: result.bookingOffer
|
|
55
|
+
} : result.ok ? {
|
|
56
|
+
ok: false,
|
|
57
|
+
issues: [{
|
|
58
|
+
path: [],
|
|
59
|
+
message: "Event bookingOffer is required"
|
|
60
|
+
}]
|
|
61
|
+
} : result;
|
|
62
|
+
});
|
|
63
|
+
const eventRunCommonInputSchema = z.object({
|
|
64
|
+
identifier: z.string().min(1),
|
|
65
|
+
eventRef: z.string().min(1),
|
|
66
|
+
status: sdkEventUpsertOptionalFieldSchemas.status,
|
|
67
|
+
visibility: sdkEventUpsertOptionalFieldSchemas.visibility,
|
|
68
|
+
waitlistMode: sdkEventUpsertOptionalFieldSchemas.waitlistMode,
|
|
69
|
+
occurrences: sdkEventUpsertOptionalFieldSchemas.occurrences.unwrap(),
|
|
70
|
+
schedule: eventScheduleInputSchema.optional(),
|
|
71
|
+
bookings: sdkEventUpsertOptionalFieldSchemas.bookings,
|
|
72
|
+
attendeeMigration: sdkEventUpsertOptionalFieldSchemas.attendeeMigration,
|
|
73
|
+
bookingOffer: eventBookingOfferInputSchema.optional(),
|
|
74
|
+
capacity: sdkEventUpsertOptionalFieldSchemas.capacity,
|
|
75
|
+
venueRef: z.string().nullable().optional(),
|
|
76
|
+
settings: z.record(z.string(), z.unknown()).optional(),
|
|
77
|
+
tags: z.array(z.string()).optional()
|
|
78
|
+
}).strict();
|
|
79
|
+
const eventRunInputSchema = z.discriminatedUnion("bookingScope", [eventRunCommonInputSchema.extend({ bookingScope: z.literal("single_occurrence") }).strict(), eventRunCommonInputSchema.extend({
|
|
80
|
+
bookingScope: z.literal("whole_series"),
|
|
81
|
+
name: z.string().nullable().optional()
|
|
82
|
+
}).strict()]);
|
|
83
|
+
const eventUpsertInputSchema = z.object({
|
|
84
|
+
identifier: z.string().min(1).optional(),
|
|
85
|
+
courseBooking: sdkCourseBookingSettingsSchema.optional(),
|
|
86
|
+
title: z.string().min(1, "title is required"),
|
|
87
|
+
categoryRef: z.string().nullable().optional(),
|
|
88
|
+
slug: z.string().min(1).optional(),
|
|
89
|
+
content: z.record(z.string(), z.unknown()).optional(),
|
|
90
|
+
blocks: sdkEntrySlotBlocksInputSchema.optional(),
|
|
91
|
+
preset: z.enum(EVENT_PRESET_VALUES),
|
|
92
|
+
runRefs: z.tuple([z.string().min(1)], z.string().min(1)),
|
|
93
|
+
runs: z.tuple([eventRunInputSchema], eventRunInputSchema)
|
|
94
|
+
}).strict().superRefine((input, ctx) => input.runs.forEach((run, index) => {
|
|
95
|
+
if (new Set(run.occurrences.map((item) => item.timeZone)).size <= 1) return;
|
|
96
|
+
ctx.addIssue({
|
|
97
|
+
code: "custom",
|
|
98
|
+
path: [
|
|
99
|
+
"runs",
|
|
100
|
+
index,
|
|
101
|
+
"occurrences"
|
|
102
|
+
],
|
|
103
|
+
message: "all occurrences must use the same timeZone"
|
|
104
|
+
});
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { eventUpsertInputSchema as t };
|
|
@@ -7,7 +7,7 @@ import { existsSync as existsSync$1 } from "fs";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
|
-
var version = "0.
|
|
10
|
+
var version = "0.32.0";
|
|
11
11
|
var peerDependencies = { "@riverbankcms/sdk": ">=0.157.0 <1.0.0" };
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "riverbankcms",
|
|
@@ -37,6 +37,7 @@ var package_default = {
|
|
|
37
37
|
"dev": "node scripts/build.mjs --watch",
|
|
38
38
|
"typecheck": "cd ../.. && bash scripts/run-package-typecheck.sh packages/cli",
|
|
39
39
|
"lint": "node ../../scripts/run-package-lint.mjs src",
|
|
40
|
+
"lint:baseline:update": "pnpm --filter @riverbankcms/eslint-plugin build && cd ../.. && node scripts/run-cli-riverbank-lint.mjs --update-baseline",
|
|
40
41
|
"test": "node scripts/run-tests.mjs",
|
|
41
42
|
"test:bun": "node scripts/run-bun-tests.mjs",
|
|
42
43
|
"test:bun:check": "node scripts/run-bun-tests.mjs --check",
|
|
@@ -93,7 +94,7 @@ var package_default = {
|
|
|
93
94
|
//#endregion
|
|
94
95
|
//#region src/version.ts
|
|
95
96
|
/** The package manifest is the source-run fallback; builds inject this value. */
|
|
96
|
-
const CLI_VERSION = typeof "0.
|
|
97
|
+
const CLI_VERSION = typeof "0.32.0" === "string" ? "0.32.0" : version;
|
|
97
98
|
/**
|
|
98
99
|
* The CLI's SDK peer range is bundled from the CLI manifest alongside its
|
|
99
100
|
* version. Runtime config loading uses this value as the single compatibility
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { Sr as ok, lr as parseSiteId, xr as err } from "./src-CVyy-M-N.mjs";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
package/dist/scaffold/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../src-
|
|
3
|
-
import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-
|
|
2
|
+
import "../src-CVyy-M-N.mjs";
|
|
3
|
+
import { a as prepareScaffoldExecution, d as loadGeneratedPackageRanges, i as preflightScaffoldTargets, l as deriveGeneratedPackageRanges, o as writeScaffoldFiles, r as preflightScaffoldPlan, s as deriveScaffoldLocalManifest, t as deriveScaffoldPlan, u as findPackageManifestPath } from "../plan-CbzdsZp3.mjs";
|
|
4
4
|
|
|
5
5
|
export { deriveGeneratedPackageRanges, deriveScaffoldLocalManifest, deriveScaffoldPlan, findPackageManifestPath, loadGeneratedPackageRanges, preflightScaffoldPlan, preflightScaffoldTargets, prepareScaffoldExecution, writeScaffoldFiles };
|