@beechcms/core 0.9.0 → 0.9.1
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/dashboard-layout/content-view.d.ts +4 -4
- package/package.json +2 -2
- package/dist/automations-grammar-words.d.ts +0 -2
- package/dist/automations-grammar-words.d.ts.map +0 -1
- package/dist/automations-grammar-words.js +0 -8
- package/dist/automations.repository.interface.d.ts +0 -19
- package/dist/automations.repository.interface.d.ts.map +0 -1
- package/dist/automations.repository.interface.js +0 -3
- package/dist/automations.runner.interface.d.ts +0 -10
- package/dist/automations.runner.interface.d.ts.map +0 -1
- package/dist/automations.runner.interface.js +0 -3
- package/dist/automations.runner.stub.d.ts +0 -5
- package/dist/automations.runner.stub.d.ts.map +0 -1
- package/dist/automations.runner.stub.js +0 -7
- package/dist/automations.types.d.ts +0 -75
- package/dist/automations.types.d.ts.map +0 -1
- package/dist/automations.types.js +0 -3
- package/dist/clock.d.ts +0 -25
- package/dist/clock.d.ts.map +0 -1
- package/dist/clock.js +0 -11
- package/dist/content-scan.repository.d.ts +0 -9
- package/dist/content-scan.repository.d.ts.map +0 -1
- package/dist/content-scan.repository.js +0 -3
- package/dist/content.repository.d.ts +0 -247
- package/dist/content.repository.d.ts.map +0 -1
- package/dist/content.repository.js +0 -59
- package/dist/dashboard-layout/kanban/kanban-position.repository.d.ts +0 -19
- package/dist/dashboard-layout/kanban/kanban-position.repository.d.ts.map +0 -1
- package/dist/dashboard-layout/kanban/kanban-position.repository.js +0 -3
- package/dist/dashboard-layout.d.ts +0 -154
- package/dist/dashboard-layout.d.ts.map +0 -1
- package/dist/dashboard-layout.js +0 -186
- package/dist/dashboard-layout.repository.d.ts +0 -18
- package/dist/dashboard-layout.repository.d.ts.map +0 -1
- package/dist/dashboard-layout.repository.js +0 -3
- package/dist/dashboard-permissions.d.ts +0 -3
- package/dist/dashboard-permissions.d.ts.map +0 -1
- package/dist/dashboard-permissions.js +0 -11
- package/dist/dashboard-scopes.d.ts +0 -12
- package/dist/dashboard-scopes.d.ts.map +0 -1
- package/dist/dashboard-scopes.js +0 -30
- package/dist/define-seed.d.ts +0 -3
- package/dist/define-seed.d.ts.map +0 -1
- package/dist/define-seed.js +0 -5
- package/dist/demo-data.repository.d.ts +0 -5
- package/dist/demo-data.repository.d.ts.map +0 -1
- package/dist/demo-data.repository.js +0 -3
- package/dist/email.provider.d.ts +0 -32
- package/dist/email.provider.d.ts.map +0 -1
- package/dist/email.provider.js +0 -4
- package/dist/engine/ddl/seed-ddl-destructive.d.ts +0 -40
- package/dist/engine/ddl/seed-ddl-destructive.d.ts.map +0 -1
- package/dist/engine/ddl/seed-ddl-destructive.js +0 -149
- package/dist/engine/ddl.d.ts +0 -193
- package/dist/engine/ddl.d.ts.map +0 -1
- package/dist/engine/ddl.js +0 -518
- package/dist/engine/define-seed.d.ts +0 -3
- package/dist/engine/define-seed.d.ts.map +0 -1
- package/dist/engine/define-seed.js +0 -5
- package/dist/engine/introspection.d.ts +0 -101
- package/dist/engine/introspection.d.ts.map +0 -1
- package/dist/engine/introspection.js +0 -127
- package/dist/engine/localization.d.ts +0 -127
- package/dist/engine/localization.d.ts.map +0 -1
- package/dist/engine/localization.js +0 -212
- package/dist/engine/policies.d.ts +0 -58
- package/dist/engine/policies.d.ts.map +0 -1
- package/dist/engine/policies.js +0 -168
- package/dist/engine/privacy.service.d.ts +0 -65
- package/dist/engine/privacy.service.d.ts.map +0 -1
- package/dist/engine/privacy.service.js +0 -114
- package/dist/engine/query.d.ts +0 -23
- package/dist/engine/query.d.ts.map +0 -1
- package/dist/engine/query.js +0 -236
- package/dist/engine/relations.d.ts +0 -28
- package/dist/engine/relations.d.ts.map +0 -1
- package/dist/engine/relations.js +0 -25
- package/dist/engine/schema-fingerprint.d.ts +0 -73
- package/dist/engine/schema-fingerprint.d.ts.map +0 -1
- package/dist/engine/schema-fingerprint.js +0 -97
- package/dist/engine/schema-mutator.d.ts +0 -26
- package/dist/engine/schema-mutator.d.ts.map +0 -1
- package/dist/engine/schema-mutator.js +0 -3
- package/dist/engine/seed-ddl-destructive.d.ts +0 -40
- package/dist/engine/seed-ddl-destructive.d.ts.map +0 -1
- package/dist/engine/seed-ddl-destructive.js +0 -149
- package/dist/engine/seed-ddl.d.ts +0 -40
- package/dist/engine/seed-ddl.d.ts.map +0 -1
- package/dist/engine/seed-ddl.js +0 -100
- package/dist/engine/seed-registry.d.ts +0 -71
- package/dist/engine/seed-registry.d.ts.map +0 -1
- package/dist/engine/seed-registry.js +0 -167
- package/dist/engine/seed-types-generator.d.ts +0 -10
- package/dist/engine/seed-types-generator.d.ts.map +0 -1
- package/dist/engine/seed-types-generator.js +0 -89
- package/dist/engine/seed-validation.d.ts +0 -30
- package/dist/engine/seed-validation.d.ts.map +0 -1
- package/dist/engine/seed-validation.js +0 -319
- package/dist/engine/seeds.d.ts +0 -20
- package/dist/engine/seeds.d.ts.map +0 -1
- package/dist/engine/seeds.js +0 -21
- package/dist/engine/serialize.d.ts +0 -20
- package/dist/engine/serialize.d.ts.map +0 -1
- package/dist/engine/serialize.js +0 -160
- package/dist/engine.d.ts +0 -144
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js +0 -741
- package/dist/file-types.d.ts +0 -13
- package/dist/file-types.d.ts.map +0 -1
- package/dist/file-types.js +0 -85
- package/dist/hooks.d.ts +0 -29
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js +0 -3
- package/dist/id-generator.d.ts +0 -26
- package/dist/id-generator.d.ts.map +0 -1
- package/dist/id-generator.js +0 -12
- package/dist/idempotency.repository.d.ts +0 -13
- package/dist/idempotency.repository.d.ts.map +0 -1
- package/dist/idempotency.repository.js +0 -3
- package/dist/kanban-position.repository.d.ts +0 -19
- package/dist/kanban-position.repository.d.ts.map +0 -1
- package/dist/kanban-position.repository.js +0 -3
- package/dist/kanban.d.ts +0 -75
- package/dist/kanban.d.ts.map +0 -1
- package/dist/kanban.js +0 -82
- package/dist/layout-permissions.d.ts +0 -3
- package/dist/layout-permissions.d.ts.map +0 -1
- package/dist/layout-permissions.js +0 -11
- package/dist/media.repository.d.ts +0 -61
- package/dist/media.repository.d.ts.map +0 -1
- package/dist/media.repository.js +0 -3
- package/dist/policies.d.ts +0 -10
- package/dist/policies.d.ts.map +0 -1
- package/dist/policies.js +0 -33
- package/dist/queue.interface.d.ts +0 -39
- package/dist/queue.interface.d.ts.map +0 -1
- package/dist/queue.interface.js +0 -3
- package/dist/queue.stub.d.ts +0 -6
- package/dist/queue.stub.d.ts.map +0 -1
- package/dist/queue.stub.js +0 -8
- package/dist/relations.d.ts +0 -28
- package/dist/relations.d.ts.map +0 -1
- package/dist/relations.js +0 -25
- package/dist/richtext-render.d.ts +0 -11
- package/dist/richtext-render.d.ts.map +0 -1
- package/dist/richtext-render.js +0 -87
- package/dist/richtext.d.ts +0 -11
- package/dist/richtext.d.ts.map +0 -1
- package/dist/richtext.js +0 -13
- package/dist/scheduler.interface.d.ts +0 -4
- package/dist/scheduler.interface.d.ts.map +0 -1
- package/dist/scheduler.interface.js +0 -3
- package/dist/scheduler.stub.d.ts +0 -5
- package/dist/scheduler.stub.d.ts.map +0 -1
- package/dist/scheduler.stub.js +0 -7
- package/dist/schema-mutator.d.ts +0 -26
- package/dist/schema-mutator.d.ts.map +0 -1
- package/dist/schema-mutator.js +0 -3
- package/dist/seed-ddl-destructive.d.ts +0 -40
- package/dist/seed-ddl-destructive.d.ts.map +0 -1
- package/dist/seed-ddl-destructive.js +0 -149
- package/dist/seed-ddl.d.ts +0 -40
- package/dist/seed-ddl.d.ts.map +0 -1
- package/dist/seed-ddl.js +0 -100
- package/dist/seed-layout.d.ts +0 -145
- package/dist/seed-layout.d.ts.map +0 -1
- package/dist/seed-layout.js +0 -192
- package/dist/seed-layout.repository.d.ts +0 -22
- package/dist/seed-layout.repository.d.ts.map +0 -1
- package/dist/seed-layout.repository.js +0 -3
- package/dist/seed-registry.d.ts +0 -71
- package/dist/seed-registry.d.ts.map +0 -1
- package/dist/seed-registry.js +0 -143
- package/dist/seed-types-generator.d.ts +0 -10
- package/dist/seed-types-generator.d.ts.map +0 -1
- package/dist/seed-types-generator.js +0 -86
- package/dist/seed-validation.d.ts +0 -23
- package/dist/seed-validation.d.ts.map +0 -1
- package/dist/seed-validation.js +0 -224
- package/dist/seed.repository.d.ts +0 -37
- package/dist/seed.repository.d.ts.map +0 -1
- package/dist/seed.repository.js +0 -3
- package/dist/seeds.d.ts +0 -20
- package/dist/seeds.d.ts.map +0 -1
- package/dist/seeds.js +0 -21
- package/dist/site-settings.repository.d.ts +0 -16
- package/dist/site-settings.repository.d.ts.map +0 -1
- package/dist/site-settings.repository.js +0 -3
- package/dist/slug-utils.d.ts +0 -18
- package/dist/slug-utils.d.ts.map +0 -1
- package/dist/slug-utils.js +0 -32
- package/dist/storage.d.ts +0 -46
- package/dist/storage.d.ts.map +0 -1
- package/dist/storage.js +0 -3
- package/dist/types.d.ts +0 -243
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -3
- package/dist/validation.d.ts +0 -50
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -660
- package/dist/webhook-validation.d.ts +0 -3
- package/dist/webhook-validation.d.ts.map +0 -1
- package/dist/webhook-validation.js +0 -6
|
@@ -126,9 +126,9 @@ export declare const viewConditionalFormatSchema: z.ZodObject<{
|
|
|
126
126
|
}, z.core.$strip>>;
|
|
127
127
|
tone: z.ZodEnum<{
|
|
128
128
|
success: "success";
|
|
129
|
-
neutral: "neutral";
|
|
130
129
|
info: "info";
|
|
131
130
|
warning: "warning";
|
|
131
|
+
neutral: "neutral";
|
|
132
132
|
danger: "danger";
|
|
133
133
|
}>;
|
|
134
134
|
target: z.ZodEnum<{
|
|
@@ -276,9 +276,9 @@ export declare const contentViewConfigSchema: z.ZodObject<{
|
|
|
276
276
|
}, z.core.$strip>>;
|
|
277
277
|
tone: z.ZodEnum<{
|
|
278
278
|
success: "success";
|
|
279
|
-
neutral: "neutral";
|
|
280
279
|
info: "info";
|
|
281
280
|
warning: "warning";
|
|
281
|
+
neutral: "neutral";
|
|
282
282
|
danger: "danger";
|
|
283
283
|
}>;
|
|
284
284
|
target: z.ZodEnum<{
|
|
@@ -458,9 +458,9 @@ export declare const createContentViewInputSchema: z.ZodObject<{
|
|
|
458
458
|
}, z.core.$strip>>;
|
|
459
459
|
tone: z.ZodEnum<{
|
|
460
460
|
success: "success";
|
|
461
|
-
neutral: "neutral";
|
|
462
461
|
info: "info";
|
|
463
462
|
warning: "warning";
|
|
463
|
+
neutral: "neutral";
|
|
464
464
|
danger: "danger";
|
|
465
465
|
}>;
|
|
466
466
|
target: z.ZodEnum<{
|
|
@@ -630,9 +630,9 @@ export declare const updateContentViewInputSchema: z.ZodObject<{
|
|
|
630
630
|
}, z.core.$strip>>;
|
|
631
631
|
tone: z.ZodEnum<{
|
|
632
632
|
success: "success";
|
|
633
|
-
neutral: "neutral";
|
|
634
633
|
info: "info";
|
|
635
634
|
warning: "warning";
|
|
635
|
+
neutral: "neutral";
|
|
636
636
|
danger: "danger";
|
|
637
637
|
}>;
|
|
638
638
|
target: z.ZodEnum<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beechcms/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@tiptap/extension-text-style": "^3.31.3",
|
|
48
48
|
"@tiptap/html": "^3.31.3",
|
|
49
49
|
"@tiptap/starter-kit": "^3.31.3",
|
|
50
|
-
"katex": "^0.
|
|
50
|
+
"katex": "^0.18.2",
|
|
51
51
|
"zod": "^4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automations-grammar-words.d.ts","sourceRoot":"","sources":["../src/automations-grammar-words.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,aAKpC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright (c) 2024–2026 Flavio De Musso
|
|
3
|
-
export const AUTOMATION_RESERVED_WORDS = new Set([
|
|
4
|
-
'this', 'batch', 'all', 'firstone', 'lastone', 'byid', 'where',
|
|
5
|
-
'array',
|
|
6
|
-
'count', 'sum', 'avg', 'min', 'max', 'pluck',
|
|
7
|
-
'true', 'false', 'null',
|
|
8
|
-
]);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Automation, AutomationAction, AutomationTrigger, AutomationTriggerEvent, WhenNode } from './automations.types.js';
|
|
2
|
-
export interface CreateAutomationInput {
|
|
3
|
-
seed_slug: string;
|
|
4
|
-
name: string;
|
|
5
|
-
triggers: AutomationTrigger[];
|
|
6
|
-
trigger_conditions: WhenNode | null;
|
|
7
|
-
actions: AutomationAction[];
|
|
8
|
-
}
|
|
9
|
-
export type UpdateAutomationInput = Partial<CreateAutomationInput>;
|
|
10
|
-
export interface IAutomationRepository {
|
|
11
|
-
list(seedSlug: string): Promise<Automation[]>;
|
|
12
|
-
findById(id: string): Promise<Automation | null>;
|
|
13
|
-
create(input: CreateAutomationInput): Promise<string>;
|
|
14
|
-
update(id: string, input: UpdateAutomationInput): Promise<void>;
|
|
15
|
-
toggle(id: string, enabled: boolean): Promise<void>;
|
|
16
|
-
delete(id: string): Promise<void>;
|
|
17
|
-
findActive(seedSlug: string, event: AutomationTriggerEvent): Promise<Automation[]>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=automations.repository.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automations.repository.interface.d.ts","sourceRoot":"","sources":["../src/automations.repository.interface.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAE/H,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,kBAAkB,EAAE,QAAQ,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAElE,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAC7C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAChD,MAAM,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACrD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;CACnF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AutomationTriggerEvent } from './automations.types.js';
|
|
2
|
-
export interface AutomationEventPayload {
|
|
3
|
-
seedSlug: string;
|
|
4
|
-
event: AutomationTriggerEvent;
|
|
5
|
-
entry: Record<string, unknown>;
|
|
6
|
-
}
|
|
7
|
-
export interface IAutomationRunner {
|
|
8
|
-
run(payload: AutomationEventPayload): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=automations.runner.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automations.runner.interface.d.ts","sourceRoot":"","sources":["../src/automations.runner.interface.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,sBAAsB,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpD"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { IAutomationRunner, AutomationEventPayload } from './automations.runner.interface.js';
|
|
2
|
-
export declare class NoOpAutomationRunner implements IAutomationRunner {
|
|
3
|
-
run(_payload: AutomationEventPayload): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
//# sourceMappingURL=automations.runner.stub.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automations.runner.stub.d.ts","sourceRoot":"","sources":["../src/automations.runner.stub.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAElG,qBAAa,oBAAqB,YAAW,iBAAiB;IACtD,GAAG,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export type AutomationTriggerEvent = 'create' | 'update' | 'delete' | 'cron';
|
|
2
|
-
export interface AutomationTrigger {
|
|
3
|
-
event: AutomationTriggerEvent;
|
|
4
|
-
cron?: string | null;
|
|
5
|
-
}
|
|
6
|
-
export interface TriggerCondition {
|
|
7
|
-
field: string;
|
|
8
|
-
op: 'eq' | 'neq' | 'contains' | 'gt' | 'lt' | 'isempty' | 'isnotempty';
|
|
9
|
-
value: unknown;
|
|
10
|
-
}
|
|
11
|
-
export type WhenOperand = {
|
|
12
|
-
kind: 'literal';
|
|
13
|
-
value: unknown;
|
|
14
|
-
} | {
|
|
15
|
-
kind: 'ref';
|
|
16
|
-
key: string;
|
|
17
|
-
};
|
|
18
|
-
export type WhenOp = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'startswith' | 'endswith' | 'in' | 'notin' | 'isempty' | 'isnotempty' | 'matches';
|
|
19
|
-
export interface WhenPredicate {
|
|
20
|
-
kind: 'predicate';
|
|
21
|
-
left: WhenOperand;
|
|
22
|
-
op: WhenOp;
|
|
23
|
-
right?: WhenOperand;
|
|
24
|
-
}
|
|
25
|
-
export interface WhenGroup {
|
|
26
|
-
kind: 'group';
|
|
27
|
-
op: 'AND' | 'OR';
|
|
28
|
-
children: WhenNode[];
|
|
29
|
-
negate?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export type WhenNode = WhenPredicate | WhenGroup;
|
|
32
|
-
export interface SetVariableAction {
|
|
33
|
-
type: 'set_variable';
|
|
34
|
-
name: string;
|
|
35
|
-
seed_slug?: string;
|
|
36
|
-
fixed_id?: string;
|
|
37
|
-
column?: string;
|
|
38
|
-
filters?: TriggerCondition[];
|
|
39
|
-
order_by?: string;
|
|
40
|
-
order?: 'asc' | 'desc';
|
|
41
|
-
/** @deprecated Read but ignored at runtime. Removed on next save. */
|
|
42
|
-
load_type?: 'fruit' | 'branch';
|
|
43
|
-
}
|
|
44
|
-
export type AutomationAction = {
|
|
45
|
-
type: 'webhook';
|
|
46
|
-
url: string;
|
|
47
|
-
method?: 'POST' | 'GET' | 'PUT';
|
|
48
|
-
headers?: Record<string, string>;
|
|
49
|
-
body_template?: string;
|
|
50
|
-
} | {
|
|
51
|
-
type: 'send_mail';
|
|
52
|
-
to: string;
|
|
53
|
-
subject_template: string;
|
|
54
|
-
body_template: string;
|
|
55
|
-
} | {
|
|
56
|
-
type: 'edit_field';
|
|
57
|
-
field: string;
|
|
58
|
-
value: unknown;
|
|
59
|
-
} | {
|
|
60
|
-
type: 'create_entry';
|
|
61
|
-
seed_slug: string;
|
|
62
|
-
field_map: Record<string, string>;
|
|
63
|
-
} | SetVariableAction;
|
|
64
|
-
export interface Automation {
|
|
65
|
-
id: string;
|
|
66
|
-
seed_slug: string;
|
|
67
|
-
name: string;
|
|
68
|
-
enabled: boolean;
|
|
69
|
-
triggers: AutomationTrigger[];
|
|
70
|
-
trigger_conditions: WhenNode | null;
|
|
71
|
-
actions: AutomationAction[];
|
|
72
|
-
created_at: number;
|
|
73
|
-
updated_at: number;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=automations.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"automations.types.d.ts","sourceRoot":"","sources":["../src/automations.types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE5E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,sBAAsB,CAAA;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,IAAI,GAAG,KAAK,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,CAAA;IACtE,KAAK,EAAE,OAAO,CAAA;CACf;AAMD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEhC,MAAM,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I;IAAE,IAAI,EAAE,WAAW,CAAC;IAAI,EAAE,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,YAAY,CAAC;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAC9E,iBAAiB,CAAA;AAErB,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,kBAAkB,EAAE,QAAQ,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/clock.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Time abstraction. Hides direct calls to {@link Date.now} so callers can
|
|
3
|
-
* swap in deterministic clocks during tests without resorting to global
|
|
4
|
-
* timer mocks (e.g. vi.useFakeTimers, sinon, monkey-patching Date).
|
|
5
|
-
*/
|
|
6
|
-
export interface IClock {
|
|
7
|
-
/**
|
|
8
|
-
* Returns the current Unix timestamp in milliseconds.
|
|
9
|
-
* Equivalent to Date.now() in production.
|
|
10
|
-
* Overridable in tests for deterministic time-sensitive assertions.
|
|
11
|
-
*/
|
|
12
|
-
now(): number;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the current Unix timestamp in whole seconds.
|
|
15
|
-
* Equivalent to Math.floor(Date.now() / 1000) in production.
|
|
16
|
-
* Used by JWT issuance, session expiry, and analytics day-bucket computations.
|
|
17
|
-
*/
|
|
18
|
-
nowSeconds(): number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Production singleton. Delegates to the host runtime clock. Stateless and
|
|
22
|
-
* therefore safe to share across requests.
|
|
23
|
-
*/
|
|
24
|
-
export declare const SystemClock: IClock;
|
|
25
|
-
//# sourceMappingURL=clock.d.ts.map
|
package/dist/clock.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,GAAG,IAAI,MAAM,CAAA;IAEb;;;;OAIG;IACH,UAAU,IAAI,MAAM,CAAA;CACrB;AAID;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAGzB,CAAA"}
|
package/dist/clock.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright (c) 2024–2026 Flavio De Musso
|
|
3
|
-
const MILLISECONDS_PER_SECOND = 1000;
|
|
4
|
-
/**
|
|
5
|
-
* Production singleton. Delegates to the host runtime clock. Stateless and
|
|
6
|
-
* therefore safe to share across requests.
|
|
7
|
-
*/
|
|
8
|
-
export const SystemClock = {
|
|
9
|
-
now: () => Date.now(),
|
|
10
|
-
nowSeconds: () => Math.floor(Date.now() / MILLISECONDS_PER_SECOND),
|
|
11
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Seed } from './types.js';
|
|
2
|
-
export interface IContentScanRepository {
|
|
3
|
-
/**
|
|
4
|
-
* Scans across all registered seeds to identify media keys that are currently referenced
|
|
5
|
-
* by any content entry. Used for orphaned media detection and storage analytics.
|
|
6
|
-
*/
|
|
7
|
-
getReferencedMediaKeys(seeds: Seed[]): Promise<Set<string>>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=content-scan.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-scan.repository.d.ts","sourceRoot":"","sources":["../src/content-scan.repository.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;CAC5D"}
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { Seed, SelectOptions } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* One row of the cross-seed pending-drafts overview. Aggregates the minimum a
|
|
4
|
-
* reviewer needs to triage a draft without opening it: which seed it belongs to,
|
|
5
|
-
* a human title, when it was last touched, and who touched it.
|
|
6
|
-
*/
|
|
7
|
-
export interface DraftSummary {
|
|
8
|
-
id: string;
|
|
9
|
-
seedSlug: string;
|
|
10
|
-
seedLabel: string;
|
|
11
|
-
title: string;
|
|
12
|
-
updatedAt: number;
|
|
13
|
-
lastModifiedBy: {
|
|
14
|
-
name: string | null;
|
|
15
|
-
email: string;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Base Repository Error
|
|
20
|
-
*/
|
|
21
|
-
export declare class RepositoryError extends Error {
|
|
22
|
-
cause?: unknown | undefined;
|
|
23
|
-
constructor(message: string, cause?: unknown | undefined);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Thrown when an entry is not found by ID or Slug
|
|
27
|
-
*/
|
|
28
|
-
export declare class EntryNotFoundError extends RepositoryError {
|
|
29
|
-
constructor(message: string);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Thrown when a slug already exists for a content type
|
|
33
|
-
*/
|
|
34
|
-
export declare class SlugConflictError extends RepositoryError {
|
|
35
|
-
constructor(message: string);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Thrown by publishDraft when a non-null relation value points to a missing
|
|
39
|
-
* target row. Mapped to 422 Unprocessable Entity by the API problem-mapper.
|
|
40
|
-
*/
|
|
41
|
-
export declare class RelationTargetNotFoundError extends RepositoryError {
|
|
42
|
-
readonly alias: string;
|
|
43
|
-
readonly targetSeed: string;
|
|
44
|
-
readonly value: string;
|
|
45
|
-
constructor(params: {
|
|
46
|
-
alias: string;
|
|
47
|
-
targetSeed: string;
|
|
48
|
-
value: string;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Thrown by lifecycle `before*` hooks to signal a business validation failure.
|
|
53
|
-
* Mapped to 422 Unprocessable Entity by the API problem-mapper.
|
|
54
|
-
*/
|
|
55
|
-
export declare class HookValidationError extends RepositoryError {
|
|
56
|
-
readonly fields?: Array<{
|
|
57
|
-
field: string;
|
|
58
|
-
message: string;
|
|
59
|
-
}>;
|
|
60
|
-
constructor(message: string, fields?: Array<{
|
|
61
|
-
field: string;
|
|
62
|
-
message: string;
|
|
63
|
-
}>);
|
|
64
|
-
}
|
|
65
|
-
export type BulkFieldUpdate = {
|
|
66
|
-
kind: 'set';
|
|
67
|
-
value: unknown;
|
|
68
|
-
} | {
|
|
69
|
-
kind: 'array_replace';
|
|
70
|
-
value: string[];
|
|
71
|
-
} | {
|
|
72
|
-
kind: 'array_add';
|
|
73
|
-
value: string[];
|
|
74
|
-
} | {
|
|
75
|
-
kind: 'array_remove';
|
|
76
|
-
value: string[];
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Options passed to write operations. Currently carries the acting user
|
|
80
|
-
* (extracted from the JWT) so lifecycle hooks can attribute changes.
|
|
81
|
-
*/
|
|
82
|
-
export interface RepositoryOptions {
|
|
83
|
-
actor?: {
|
|
84
|
-
id: string;
|
|
85
|
-
role?: string;
|
|
86
|
-
email?: string;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Declarative multi-write operation translated into a single `db.batch` call.
|
|
91
|
-
* Used for coordinated writes across one or more seeds when D1's lack of
|
|
92
|
-
* interactive transactions makes a callback-based API impossible.
|
|
93
|
-
*
|
|
94
|
-
* NOTE: document-level lifecycle hooks do NOT run for operations inside a
|
|
95
|
-
* `runBatch` call — they would be non-atomic side-effects.
|
|
96
|
-
*/
|
|
97
|
-
export type BatchWrite = {
|
|
98
|
-
kind: 'create';
|
|
99
|
-
seed: Seed;
|
|
100
|
-
id: string;
|
|
101
|
-
slug: string;
|
|
102
|
-
status: string;
|
|
103
|
-
data: Record<string, any>;
|
|
104
|
-
} | {
|
|
105
|
-
kind: 'update';
|
|
106
|
-
seed: Seed;
|
|
107
|
-
id: string;
|
|
108
|
-
data: Record<string, any>;
|
|
109
|
-
status?: string;
|
|
110
|
-
} | {
|
|
111
|
-
kind: 'mutateField';
|
|
112
|
-
seed: Seed;
|
|
113
|
-
id: string;
|
|
114
|
-
fieldName: string;
|
|
115
|
-
operation: {
|
|
116
|
-
type: 'increment' | 'decrement';
|
|
117
|
-
value: number;
|
|
118
|
-
};
|
|
119
|
-
options?: {
|
|
120
|
-
min?: number;
|
|
121
|
-
max?: number;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Interface defining the standard operations for content persistence.
|
|
126
|
-
* This is platform-agnostic and should be implemented for specific databases (e.g., D1).
|
|
127
|
-
*/
|
|
128
|
-
export interface ContentRepository {
|
|
129
|
-
/**
|
|
130
|
-
* Retrieves a paginated and filtered list of entries.
|
|
131
|
-
*/
|
|
132
|
-
findMany(seed: Seed, options: SelectOptions): Promise<{
|
|
133
|
-
items: Record<string, any>[];
|
|
134
|
-
total: number;
|
|
135
|
-
}>;
|
|
136
|
-
/**
|
|
137
|
-
* Finds a single entry by its unique ID.
|
|
138
|
-
* Throws EntryNotFoundError if not found.
|
|
139
|
-
*/
|
|
140
|
-
findById(seed: Seed, id: string): Promise<Record<string, any>>;
|
|
141
|
-
/**
|
|
142
|
-
* Finds a single entry by its unique slug.
|
|
143
|
-
* Throws EntryNotFoundError if not found.
|
|
144
|
-
*/
|
|
145
|
-
findBySlug(seed: Seed, slug: string): Promise<Record<string, any>>;
|
|
146
|
-
/**
|
|
147
|
-
* Computes facets (status counts and distinct tags) for a content type.
|
|
148
|
-
*/
|
|
149
|
-
getFacets(seed: Seed): Promise<{
|
|
150
|
-
statuses: Record<string, number>;
|
|
151
|
-
tagsByColumn: Record<string, string[]>;
|
|
152
|
-
}>;
|
|
153
|
-
/**
|
|
154
|
-
* Creates a new content entry in the live table.
|
|
155
|
-
* Throws SlugConflictError if the slug is already taken.
|
|
156
|
-
*/
|
|
157
|
-
create(seed: Seed, id: string, slug: string, status: string, data: Record<string, any>, options?: RepositoryOptions): Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* Partially updates an existing entry in the live table.
|
|
160
|
-
* Throws EntryNotFoundError if the ID does not exist.
|
|
161
|
-
*/
|
|
162
|
-
update(seed: Seed, id: string, data: Record<string, any>, status?: string, options?: RepositoryOptions): Promise<void>;
|
|
163
|
-
/**
|
|
164
|
-
* Deletes an entry from the live table.
|
|
165
|
-
* Returns the deleted row data (useful for media cleanup).
|
|
166
|
-
* Throws EntryNotFoundError if the ID does not exist.
|
|
167
|
-
*/
|
|
168
|
-
delete(seed: Seed, id: string, options?: RepositoryOptions): Promise<{
|
|
169
|
-
row: Record<string, any>;
|
|
170
|
-
}>;
|
|
171
|
-
/**
|
|
172
|
-
* Atomically increments/decrements a numeric field with optional min/max guards.
|
|
173
|
-
* Bypasses document-level lifecycle hooks — it's a single UPDATE statement,
|
|
174
|
-
* used to prevent race conditions on counters (stock, balances).
|
|
175
|
-
* Throws RepositoryError if `fieldName` is not a numeric branch of `seed`, or
|
|
176
|
-
* if the guard conditions fail / the row does not exist.
|
|
177
|
-
*/
|
|
178
|
-
mutateField(seed: Seed, id: string, fieldName: string, operation: {
|
|
179
|
-
type: 'increment' | 'decrement';
|
|
180
|
-
value: number;
|
|
181
|
-
}, options?: {
|
|
182
|
-
min?: number;
|
|
183
|
-
max?: number;
|
|
184
|
-
}): Promise<{
|
|
185
|
-
newValue: number;
|
|
186
|
-
}>;
|
|
187
|
-
/**
|
|
188
|
-
* Atomically applies an axis-value patch AND a kanban_positions upsert in one DB batch (KB-S04e).
|
|
189
|
-
* `patch` is null for same-column reorders (position only).
|
|
190
|
-
*/
|
|
191
|
-
updateWithKanbanPosition(seed: Seed, id: string, patch: Record<string, unknown> | null, position: string, axisBranchId: string, ctx: {
|
|
192
|
-
actor: string;
|
|
193
|
-
}): Promise<{
|
|
194
|
-
success: boolean;
|
|
195
|
-
}>;
|
|
196
|
-
/**
|
|
197
|
-
* Executes a list of write operations atomically via a single `db.batch`.
|
|
198
|
-
* Document-level lifecycle hooks do NOT run for operations inside this call.
|
|
199
|
-
*/
|
|
200
|
-
runBatch(operations: BatchWrite[]): Promise<void>;
|
|
201
|
-
/**
|
|
202
|
-
* Saves or updates a pending draft in the mirror table.
|
|
203
|
-
*/
|
|
204
|
-
saveDraft(seed: Seed, entryId: string, data: Record<string, any>): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Retrieves the pending draft for a given entry.
|
|
207
|
-
* Returns null if no draft exists.
|
|
208
|
-
*/
|
|
209
|
-
getDraft(seed: Seed, entryId: string): Promise<Record<string, any> | null>;
|
|
210
|
-
/**
|
|
211
|
-
* Atomic promotion of a draft to the live table.
|
|
212
|
-
* Must use a transaction (db.batch) to update live and delete draft.
|
|
213
|
-
*/
|
|
214
|
-
publishDraft(seed: Seed, entryId: string): Promise<void>;
|
|
215
|
-
/**
|
|
216
|
-
* Discards the pending draft.
|
|
217
|
-
*/
|
|
218
|
-
deleteDraft(seed: Seed, entryId: string): Promise<void>;
|
|
219
|
-
/**
|
|
220
|
-
* Checks if a slug is already taken by another entry.
|
|
221
|
-
*/
|
|
222
|
-
existsSlug(seed: Seed, slug: string, excludeId?: string): Promise<boolean>;
|
|
223
|
-
/**
|
|
224
|
-
* Checks if an entry has a pending draft.
|
|
225
|
-
*/
|
|
226
|
-
hasDraft(seed: Seed, entryId: string): Promise<boolean>;
|
|
227
|
-
/**
|
|
228
|
-
* Aggregates pending drafts across every draft-enabled seed in a single round-trip.
|
|
229
|
-
* Exists so the unified /drafts view never issues one query per seed.
|
|
230
|
-
* @param seeds The draft-enabled seeds to scan (caller passes seedRegistry.draftEnabled()).
|
|
231
|
-
* @returns Drafts newest-first; empty array when no seeds or no drafts.
|
|
232
|
-
*/
|
|
233
|
-
findPendingDrafts(seeds: Seed[]): Promise<DraftSummary[]>;
|
|
234
|
-
/**
|
|
235
|
-
* Apply the same field update to many entries. Returns per-id outcome.
|
|
236
|
-
* Caller is responsible for validation; this method assumes the payload is
|
|
237
|
-
* already shape-checked against the seed.
|
|
238
|
-
*/
|
|
239
|
-
bulkUpdate(seedSlug: string, ids: string[], fields: Record<string, BulkFieldUpdate>): Promise<{
|
|
240
|
-
updated: number;
|
|
241
|
-
failed: Array<{
|
|
242
|
-
id: string;
|
|
243
|
-
reason: string;
|
|
244
|
-
}>;
|
|
245
|
-
}>;
|
|
246
|
-
}
|
|
247
|
-
//# sourceMappingURL=content.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.repository.d.ts","sourceRoot":"","sources":["../src/content.repository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED;;GAEG;AACH,qBAAa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AO,CAAC,IAAI,CAAC,CAAA;IAEvD;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE1E;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvD;;;;;OAKG;IACH,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IAEzD;;;;OAIG;IACH,UAAU,CACR,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GACtC,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAA;CAC/E"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright (c) 2024–2026 Flavio De Musso
|
|
3
|
-
/**
|
|
4
|
-
* Base Repository Error
|
|
5
|
-
*/
|
|
6
|
-
export class RepositoryError extends Error {
|
|
7
|
-
cause;
|
|
8
|
-
constructor(message, cause) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.cause = cause;
|
|
11
|
-
this.name = 'RepositoryError';
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Thrown when an entry is not found by ID or Slug
|
|
16
|
-
*/
|
|
17
|
-
export class EntryNotFoundError extends RepositoryError {
|
|
18
|
-
constructor(message) {
|
|
19
|
-
super(message);
|
|
20
|
-
this.name = 'EntryNotFoundError';
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Thrown when a slug already exists for a content type
|
|
25
|
-
*/
|
|
26
|
-
export class SlugConflictError extends RepositoryError {
|
|
27
|
-
constructor(message) {
|
|
28
|
-
super(message);
|
|
29
|
-
this.name = 'SlugConflictError';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Thrown by publishDraft when a non-null relation value points to a missing
|
|
34
|
-
* target row. Mapped to 422 Unprocessable Entity by the API problem-mapper.
|
|
35
|
-
*/
|
|
36
|
-
export class RelationTargetNotFoundError extends RepositoryError {
|
|
37
|
-
alias;
|
|
38
|
-
targetSeed;
|
|
39
|
-
value;
|
|
40
|
-
constructor(params) {
|
|
41
|
-
super(`Relation target not found: field '${params.alias}' references '${params.targetSeed}' id='${params.value}' which does not exist`);
|
|
42
|
-
this.name = 'RelationTargetNotFoundError';
|
|
43
|
-
this.alias = params.alias;
|
|
44
|
-
this.targetSeed = params.targetSeed;
|
|
45
|
-
this.value = params.value;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Thrown by lifecycle `before*` hooks to signal a business validation failure.
|
|
50
|
-
* Mapped to 422 Unprocessable Entity by the API problem-mapper.
|
|
51
|
-
*/
|
|
52
|
-
export class HookValidationError extends RepositoryError {
|
|
53
|
-
fields;
|
|
54
|
-
constructor(message, fields) {
|
|
55
|
-
super(message);
|
|
56
|
-
this.name = 'HookValidationError';
|
|
57
|
-
this.fields = fields;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface KanbanPositionRecord {
|
|
2
|
-
entryId: string;
|
|
3
|
-
position: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Persistence contract for card ordering. The ONLY gateway to `kanban_positions`.
|
|
7
|
-
* Handlers and the dashboard never touch the table directly (Botanical invariant).
|
|
8
|
-
*/
|
|
9
|
-
export interface IKanbanPositionRepository {
|
|
10
|
-
/** entryId → position for one column axis (entries without a row are omitted). */
|
|
11
|
-
getColumn(seedSlug: string, axisBranchId: string): Promise<Map<string, string>>;
|
|
12
|
-
/** Single-row upsert — exactly one write per drag (KB-S04b). */
|
|
13
|
-
setPosition(seedSlug: string, entryId: string, axisBranchId: string, position: string): Promise<void>;
|
|
14
|
-
/** Remove an entry's position row (e.g. entry deleted). */
|
|
15
|
-
remove(seedSlug: string, entryId: string, axisBranchId: string): Promise<void>;
|
|
16
|
-
/** Async rebalance (KB-S04f): rewrite a whole column's positions in one batch. */
|
|
17
|
-
rebalance(seedSlug: string, axisBranchId: string, ordered: KanbanPositionRecord[]): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=kanban-position.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kanban-position.repository.d.ts","sourceRoot":"","sources":["../../../src/dashboard-layout/kanban/kanban-position.repository.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,kFAAkF;IAClF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC/E,gEAAgE;IAChE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrG,2DAA2D;IAC3D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9E,kFAAkF;IAClF,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAClG"}
|