trellis 3.1.3 → 3.1.6
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/cms/client.d.ts +2 -2
- package/dist/cms/client.d.ts.map +1 -1
- package/dist/cms/formula.d.ts +10 -0
- package/dist/cms/formula.d.ts.map +1 -0
- package/dist/cms/index.d.ts +3 -2
- package/dist/cms/index.d.ts.map +1 -1
- package/dist/cms/index.js +152 -4
- package/dist/cms/types.d.ts +11 -0
- package/dist/cms/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cms/client.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @module trellis/cms
|
|
25
25
|
*/
|
|
26
26
|
import type { CmsClientOptions, Collection, Entry, EntrySubscribeOptions, EntrySubscriber, GetOptions, ListOptions, ListSubscribeOptions, ListSubscriber, Unsubscribe } from './types.js';
|
|
27
|
-
import { type RawEntity } from './internal.js';
|
|
27
|
+
import { type RawEntity, type RawFact } from './internal.js';
|
|
28
28
|
export declare class CmsClient {
|
|
29
29
|
private readonly url;
|
|
30
30
|
private readonly basePath;
|
|
@@ -55,7 +55,7 @@ export declare class CmsClient {
|
|
|
55
55
|
/** @internal */
|
|
56
56
|
_entities(): Promise<RawEntity[]>;
|
|
57
57
|
/** @internal */
|
|
58
|
-
_entryById(id: string): Promise<Entry | null>;
|
|
58
|
+
_entryById(id: string, schemaFacts?: RawFact[]): Promise<Entry | null>;
|
|
59
59
|
}
|
|
60
60
|
export declare class CollectionRef<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
61
61
|
private readonly client;
|
package/dist/cms/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/cms/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,qBAAq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GAAE,oBAAyB,GAC9B,WAAW;CAUf;AAED,qBAAa,QAAQ,CACnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAGzD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM;gBADF,MAAM,EAAE,SAAS,EACzB,EAAE,EAAE,MAAM;IAGf,GAAG,CAAC,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAY1D,SAAS,CACP,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,EAC5B,IAAI,GAAE,qBAA0B,GAC/B,WAAW;CAUf;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,CAEjE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Entry, FieldDefinition } from './types.js';
|
|
2
|
+
export declare function evaluateFormula(expr: string, fields: Record<string, unknown>): number | undefined;
|
|
3
|
+
export declare function parseFields(raw: unknown): FieldDefinition[];
|
|
4
|
+
export declare function schemaFields(facts: {
|
|
5
|
+
e: string;
|
|
6
|
+
a: string;
|
|
7
|
+
v: unknown;
|
|
8
|
+
}[], names: string[]): FieldDefinition[];
|
|
9
|
+
export declare function applyFormulas<T extends Record<string, unknown>>(entry: Entry<T>, defs: FieldDefinition[]): Entry<T>;
|
|
10
|
+
//# sourceMappingURL=formula.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../src/cms/formula.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA2FzD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,GAAG,SAAS,CASpB;AAcD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,EAAE,CAa3D;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,EAC7C,KAAK,EAAE,MAAM,EAAE,GACd,eAAe,EAAE,CASnB;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,IAAI,EAAE,eAAe,EAAE,GACtB,KAAK,CAAC,CAAC,CAAC,CAcV"}
|
package/dist/cms/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module trellis/cms
|
|
5
5
|
*/
|
|
6
|
-
export { CmsClient, CollectionRef, EntryRef, createCmsClient } from './client.js';
|
|
7
|
-
export type { CmsClientOptions, Collection, Entry, EntryStatus, EntrySubscribeOptions, EntrySubscriber, Framework, GetOptions, ListOptions, ListSubscribeOptions, ListSubscriber, SubscribeExtras, Unsubscribe, } from './types.js';
|
|
6
|
+
export { CmsClient, CollectionRef, EntryRef, createCmsClient, } from './client.js';
|
|
7
|
+
export type { CmsClientOptions, Collection, Entry, EntryStatus, EntrySubscribeOptions, EntrySubscriber, FieldDefinition, FieldKind, Framework, GetOptions, ListOptions, ListSubscribeOptions, ListSubscriber, SubscribeExtras, Unsubscribe, } from './types.js';
|
|
8
|
+
export { applyFormulas, evaluateFormula, parseFields } from './formula.js';
|
|
8
9
|
export { scaffoldConsumer, scaffoldFilename } from './scaffold.js';
|
|
9
10
|
export type { ScaffoldOptions } from './scaffold.js';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cms/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cms/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cms/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,aAAa,EACb,QAAQ,EACR,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/cms/index.js
CHANGED
|
@@ -115,6 +115,146 @@ function fingerprint(value) {
|
|
|
115
115
|
return JSON.stringify(value);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
// src/cms/formula.ts
|
|
119
|
+
var OPS = new Set(["+", "-", "*", "/", "(", ")"]);
|
|
120
|
+
function num(value) {
|
|
121
|
+
if (typeof value === "number")
|
|
122
|
+
return Number.isFinite(value) ? value : undefined;
|
|
123
|
+
if (typeof value !== "string" || value.trim() === "")
|
|
124
|
+
return;
|
|
125
|
+
const parsed = Number(value);
|
|
126
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
127
|
+
}
|
|
128
|
+
function tokenize(expr) {
|
|
129
|
+
const tokens = [];
|
|
130
|
+
let i = 0;
|
|
131
|
+
while (i < expr.length) {
|
|
132
|
+
const ch = expr[i];
|
|
133
|
+
if (/\s/.test(ch)) {
|
|
134
|
+
i++;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (OPS.has(ch)) {
|
|
138
|
+
tokens.push(ch);
|
|
139
|
+
i++;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (/\d|\./.test(ch)) {
|
|
143
|
+
let end = i + 1;
|
|
144
|
+
while (end < expr.length && /\d|\./.test(expr[end]))
|
|
145
|
+
end++;
|
|
146
|
+
const value = Number(expr.slice(i, end));
|
|
147
|
+
if (!Number.isFinite(value))
|
|
148
|
+
return;
|
|
149
|
+
tokens.push(value);
|
|
150
|
+
i = end;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
return tokens;
|
|
156
|
+
}
|
|
157
|
+
function parse(tokens) {
|
|
158
|
+
let i = 0;
|
|
159
|
+
const peek = () => tokens[i];
|
|
160
|
+
const take = () => tokens[i++];
|
|
161
|
+
const primary = () => {
|
|
162
|
+
const token = take();
|
|
163
|
+
if (typeof token === "number")
|
|
164
|
+
return token;
|
|
165
|
+
if (token === "+")
|
|
166
|
+
return primary();
|
|
167
|
+
if (token === "-") {
|
|
168
|
+
const value2 = primary();
|
|
169
|
+
return value2 === undefined ? undefined : -value2;
|
|
170
|
+
}
|
|
171
|
+
if (token === "(") {
|
|
172
|
+
const value2 = add();
|
|
173
|
+
if (take() !== ")")
|
|
174
|
+
return;
|
|
175
|
+
return value2;
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
};
|
|
179
|
+
const mul = () => {
|
|
180
|
+
let left = primary();
|
|
181
|
+
while (peek() === "*" || peek() === "/") {
|
|
182
|
+
const op = take();
|
|
183
|
+
const right = primary();
|
|
184
|
+
if (left === undefined || right === undefined)
|
|
185
|
+
return;
|
|
186
|
+
left = op === "*" ? left * right : left / right;
|
|
187
|
+
}
|
|
188
|
+
return left;
|
|
189
|
+
};
|
|
190
|
+
const add = () => {
|
|
191
|
+
let left = mul();
|
|
192
|
+
while (peek() === "+" || peek() === "-") {
|
|
193
|
+
const op = take();
|
|
194
|
+
const right = mul();
|
|
195
|
+
if (left === undefined || right === undefined)
|
|
196
|
+
return;
|
|
197
|
+
left = op === "+" ? left + right : left - right;
|
|
198
|
+
}
|
|
199
|
+
return left;
|
|
200
|
+
};
|
|
201
|
+
const value = add();
|
|
202
|
+
if (i !== tokens.length || value === undefined || !Number.isFinite(value))
|
|
203
|
+
return;
|
|
204
|
+
return value;
|
|
205
|
+
}
|
|
206
|
+
function evaluateFormula(expr, fields) {
|
|
207
|
+
const interpolated = expr.replace(/\{([^{}]+)\}/g, (match, key) => {
|
|
208
|
+
const value = num(fields[key.trim()]);
|
|
209
|
+
return value === undefined ? match : String(value);
|
|
210
|
+
});
|
|
211
|
+
if (interpolated.includes("{") || interpolated.includes("}"))
|
|
212
|
+
return;
|
|
213
|
+
const tokens = tokenize(interpolated);
|
|
214
|
+
return tokens ? parse(tokens) : undefined;
|
|
215
|
+
}
|
|
216
|
+
function keys(value) {
|
|
217
|
+
const raw = value.replace(/^schema:/, "").trim();
|
|
218
|
+
const camel = raw.replace(/([a-z0-9])([A-Z])/g, "$1_$2");
|
|
219
|
+
const lower = raw.toLowerCase().replace(/\s+/g, "_");
|
|
220
|
+
const snake = camel.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
221
|
+
const compact = lower.replace(/[^a-z0-9]+/g, "");
|
|
222
|
+
return [...new Set([lower, snake, compact].filter(Boolean))];
|
|
223
|
+
}
|
|
224
|
+
function parseFields(raw) {
|
|
225
|
+
if (typeof raw !== "string")
|
|
226
|
+
return [];
|
|
227
|
+
try {
|
|
228
|
+
const parsed = JSON.parse(raw);
|
|
229
|
+
if (!Array.isArray(parsed))
|
|
230
|
+
return [];
|
|
231
|
+
return parsed.filter((item) => {
|
|
232
|
+
if (!item || typeof item !== "object")
|
|
233
|
+
return false;
|
|
234
|
+
const def = item;
|
|
235
|
+
return typeof def.key === "string" && typeof def.type === "string";
|
|
236
|
+
});
|
|
237
|
+
} catch {
|
|
238
|
+
return [];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function schemaFields(facts, names) {
|
|
242
|
+
const wanted = new Set(names.flatMap(keys));
|
|
243
|
+
const fact = facts.find((item) => item.e.startsWith("schema:") && item.a === "props" && keys(item.e).some((key) => wanted.has(key)));
|
|
244
|
+
return parseFields(fact?.v);
|
|
245
|
+
}
|
|
246
|
+
function applyFormulas(entry, defs) {
|
|
247
|
+
const formulas = defs.filter((def) => def.type === "formula" && typeof def.formula === "string" && def.formula.trim());
|
|
248
|
+
if (formulas.length === 0)
|
|
249
|
+
return entry;
|
|
250
|
+
const fields = { ...entry.fields };
|
|
251
|
+
for (let pass = 0;pass < formulas.length; pass++) {
|
|
252
|
+
for (const def of formulas)
|
|
253
|
+
fields[def.key] = evaluateFormula(def.formula, fields);
|
|
254
|
+
}
|
|
255
|
+
return { ...entry, fields };
|
|
256
|
+
}
|
|
257
|
+
|
|
118
258
|
// src/cms/client.ts
|
|
119
259
|
var DEFAULT_BASE_PATH = "/trellis/store";
|
|
120
260
|
var DEFAULT_POLL_MS = 2000;
|
|
@@ -273,13 +413,14 @@ class CmsClient {
|
|
|
273
413
|
offset += MAX_ENTITIES_PER_FETCH;
|
|
274
414
|
}
|
|
275
415
|
}
|
|
276
|
-
async _entryById(id) {
|
|
416
|
+
async _entryById(id, schemaFacts) {
|
|
277
417
|
const detail = await this._get(`/entity/${encodeURIComponent(id)}`);
|
|
278
418
|
if (!detail)
|
|
279
419
|
return null;
|
|
280
420
|
const typeFact = detail.facts.find((f) => f.a === "type");
|
|
281
421
|
const type = typeof typeFact?.v === "string" ? typeFact.v : "unknown";
|
|
282
|
-
|
|
422
|
+
const facts = schemaFacts ?? await this._get(`/facts?limit=${MAX_FACTS_PER_FETCH}`) ?? [];
|
|
423
|
+
return applyFormulas(entryFromFacts({ id: detail.id, type }, detail.facts, detail.links), schemaFields(facts, [type]));
|
|
283
424
|
}
|
|
284
425
|
}
|
|
285
426
|
|
|
@@ -307,13 +448,17 @@ class CollectionRef {
|
|
|
307
448
|
return [];
|
|
308
449
|
const factsByEntity = groupFactsByEntity(facts ?? []);
|
|
309
450
|
const linksBySource = groupLinksBySource(links ?? []);
|
|
310
|
-
|
|
451
|
+
const defs = schemaFields(facts ?? [], [
|
|
452
|
+
this.key,
|
|
453
|
+
...matching.map((e) => e.type)
|
|
454
|
+
]);
|
|
455
|
+
let entries = matching.map((e) => applyFormulas(entryFromFacts(e, factsByEntity.get(e.id) ?? [], linksBySource.get(e.id) ?? []), defs));
|
|
311
456
|
if (status !== "all") {
|
|
312
457
|
entries = entries.filter((e) => e.status === status);
|
|
313
458
|
}
|
|
314
459
|
entries = entries.slice(0, limit);
|
|
315
460
|
if (wantsExpand) {
|
|
316
|
-
entries = await expandReferences(entries, opts.expand, (id) => this.client._entryById(id));
|
|
461
|
+
entries = await expandReferences(entries, opts.expand, (id) => this.client._entryById(id, facts ?? []));
|
|
317
462
|
}
|
|
318
463
|
return entries;
|
|
319
464
|
}
|
|
@@ -485,7 +630,10 @@ function scaffoldFilename(opts) {
|
|
|
485
630
|
export {
|
|
486
631
|
scaffoldFilename,
|
|
487
632
|
scaffoldConsumer,
|
|
633
|
+
parseFields,
|
|
634
|
+
evaluateFormula,
|
|
488
635
|
createCmsClient,
|
|
636
|
+
applyFormulas,
|
|
489
637
|
EntryRef,
|
|
490
638
|
CollectionRef,
|
|
491
639
|
CmsClient
|
package/dist/cms/types.d.ts
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
* @module trellis/cms
|
|
5
5
|
*/
|
|
6
6
|
export type EntryStatus = 'draft' | 'published';
|
|
7
|
+
export type FieldKind = 'text' | 'rich_text' | 'number' | 'boolean' | 'date' | 'email' | 'url' | 'color' | 'select' | 'multiselect' | 'file' | 'formula' | 'reference' | 'image';
|
|
8
|
+
export type FieldDefinition = {
|
|
9
|
+
key: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
type: FieldKind;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
default?: string;
|
|
14
|
+
options?: string[];
|
|
15
|
+
formula?: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
};
|
|
7
18
|
export type Entry<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
8
19
|
/** Stable entity id (e.g. "blog_post:abc123" or "BlogPost:abc"). */
|
|
9
20
|
id: string;
|
package/dist/cms/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cms/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,WAAW,CAAC;AAEhD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cms/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,WAAW,CAAC;AAEhD,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,WAAW,GACX,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,GACP,QAAQ,GACR,aAAa,GACb,MAAM,GACN,SAAS,GACT,WAAW,GACX,OAAO,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,KAAK,CAAC,C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