@coffer-org/plugin-orchestrator 1.2.4 → 1.3.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/schema.js +55 -10
- package/package.json +4 -4
package/dist/schema.js
CHANGED
|
@@ -4466,7 +4466,15 @@ function jsonRefined(inner, code) {
|
|
|
4466
4466
|
});
|
|
4467
4467
|
}
|
|
4468
4468
|
function optionalize(schema, required) {
|
|
4469
|
-
|
|
4469
|
+
const req = required === true;
|
|
4470
|
+
const pre = (v) => v === "" || v === null ? void 0 : v;
|
|
4471
|
+
if (!req) return preprocess(pre, schema.optional());
|
|
4472
|
+
return preprocess(pre, unknown().superRefine((v, ctx) => {
|
|
4473
|
+
if (v === void 0) ctx.addIssue({
|
|
4474
|
+
code: ZodIssueCode.custom,
|
|
4475
|
+
message: vmsg("required")
|
|
4476
|
+
});
|
|
4477
|
+
}).pipe(schema));
|
|
4470
4478
|
}
|
|
4471
4479
|
//#endregion
|
|
4472
4480
|
//#region ../sdk/src/fields/normalize.ts
|
|
@@ -4575,6 +4583,29 @@ function password(raw) {
|
|
|
4575
4583
|
zod: optionalize(s, required)
|
|
4576
4584
|
});
|
|
4577
4585
|
}
|
|
4586
|
+
/**
|
|
4587
|
+
* Internal API-token list — keyValue-shaped collection (name + write-only
|
|
4588
|
+
* token + timestamps), custom renderer (`kind:'internalApiToken'`, own
|
|
4589
|
+
* create/revoke UI — same trick as url()/perWeekday()). "Internal" = not a
|
|
4590
|
+
* general-purpose field type for plugin modules, only for the core account
|
|
4591
|
+
* settings page. `token` is `kind:'password'` so maskSecrets/preserveTree
|
|
4592
|
+
* already mask/preserve it for free.
|
|
4593
|
+
*/
|
|
4594
|
+
function internalApiToken(o) {
|
|
4595
|
+
return group({
|
|
4596
|
+
key: o.key,
|
|
4597
|
+
label: o.label ?? o.key,
|
|
4598
|
+
multiple: true,
|
|
4599
|
+
rules: { unique: ["name"] },
|
|
4600
|
+
view: { kind: "internalApiToken" },
|
|
4601
|
+
fields: [
|
|
4602
|
+
string({ key: "name" }),
|
|
4603
|
+
password({ key: "token" }),
|
|
4604
|
+
string({ key: "createdAt" }),
|
|
4605
|
+
string({ key: "lastUsedAt" })
|
|
4606
|
+
]
|
|
4607
|
+
});
|
|
4608
|
+
}
|
|
4578
4609
|
var SLUG_RE = /^[a-z0-9-]+$/;
|
|
4579
4610
|
function slug(raw) {
|
|
4580
4611
|
const o = normalizeOpts(raw);
|
|
@@ -5003,7 +5034,8 @@ var presets = {
|
|
|
5003
5034
|
year,
|
|
5004
5035
|
weight,
|
|
5005
5036
|
dimensions,
|
|
5006
|
-
country
|
|
5037
|
+
country,
|
|
5038
|
+
internalApiToken
|
|
5007
5039
|
};
|
|
5008
5040
|
//#endregion
|
|
5009
5041
|
//#region ../../node_modules/iso-639-1/src/data.js
|
|
@@ -6357,20 +6389,21 @@ function check(raw) {
|
|
|
6357
6389
|
const multiple = o.multiple ?? false;
|
|
6358
6390
|
const slots = o.slots && o.slots.length > 0 ? o.slots : [""];
|
|
6359
6391
|
if (multiple) {
|
|
6360
|
-
const fields =
|
|
6361
|
-
key: "text",
|
|
6362
|
-
label: "core.fields.text"
|
|
6363
|
-
})];
|
|
6364
|
-
slots.forEach((label, i) => fields.push(boolean({
|
|
6392
|
+
const fields = slots.map((label, i) => boolean({
|
|
6365
6393
|
key: `check${i}`,
|
|
6366
6394
|
label: label || "core.fields.check"
|
|
6367
|
-
}))
|
|
6395
|
+
}));
|
|
6396
|
+
fields.push(string({
|
|
6397
|
+
key: "text",
|
|
6398
|
+
label: "core.fields.text"
|
|
6399
|
+
}));
|
|
6368
6400
|
return group({
|
|
6369
6401
|
key: o.key,
|
|
6370
6402
|
label: o.label ?? o.key,
|
|
6371
6403
|
multiple: true,
|
|
6372
6404
|
required,
|
|
6373
|
-
fields
|
|
6405
|
+
fields,
|
|
6406
|
+
view: { kind: "checklist" }
|
|
6374
6407
|
});
|
|
6375
6408
|
}
|
|
6376
6409
|
const shape = { text: string$1() };
|
|
@@ -6546,10 +6579,18 @@ function geo(raw) {
|
|
|
6546
6579
|
const rowSchema = object({
|
|
6547
6580
|
lat: number$1().min(-90).max(90),
|
|
6548
6581
|
lng: number$1().min(-180).max(180),
|
|
6549
|
-
label: string$1().
|
|
6582
|
+
label: string$1().nullish()
|
|
6550
6583
|
});
|
|
6551
6584
|
const s = unknown().superRefine((raw, ctx) => {
|
|
6552
6585
|
const parsed = jsonValue(raw);
|
|
6586
|
+
const p = parsed;
|
|
6587
|
+
if (p == null || typeof p === "object" && p.lat == null && p.lng == null) {
|
|
6588
|
+
if (required) ctx.addIssue({
|
|
6589
|
+
code: ZodIssueCode.custom,
|
|
6590
|
+
message: vmsg("required")
|
|
6591
|
+
});
|
|
6592
|
+
return;
|
|
6593
|
+
}
|
|
6553
6594
|
if (typeof parsed === "string") {
|
|
6554
6595
|
ctx.addIssue({
|
|
6555
6596
|
code: ZodIssueCode.custom,
|
|
@@ -6756,6 +6797,9 @@ function avatar(o) {
|
|
|
6756
6797
|
function cover(o) {
|
|
6757
6798
|
return makeFile("cover", o);
|
|
6758
6799
|
}
|
|
6800
|
+
function poster(o) {
|
|
6801
|
+
return makeFile("poster", o);
|
|
6802
|
+
}
|
|
6759
6803
|
function keyValue(raw) {
|
|
6760
6804
|
const o = normalizeOpts(raw);
|
|
6761
6805
|
const valueType = {
|
|
@@ -6909,6 +6953,7 @@ var PRIMITIVES = {
|
|
|
6909
6953
|
media,
|
|
6910
6954
|
avatar,
|
|
6911
6955
|
cover,
|
|
6956
|
+
poster,
|
|
6912
6957
|
embed,
|
|
6913
6958
|
keyValue,
|
|
6914
6959
|
numberRange,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/plugin-orchestrator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"postpack": "node ../../scripts/swap-exports.mjs src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@coffer-org/sdk": "^1.
|
|
29
|
-
"@coffer-org/server": "^1.
|
|
30
|
-
"@coffer-org/plugin-agent": "^1.
|
|
28
|
+
"@coffer-org/sdk": "^1.3.0",
|
|
29
|
+
"@coffer-org/server": "^1.3.0",
|
|
30
|
+
"@coffer-org/plugin-agent": "^1.3.0"
|
|
31
31
|
},
|
|
32
32
|
"coffer": {
|
|
33
33
|
"schema": "dist/schema.js"
|