@beechcms/core 0.4.3 → 0.6.0-preview.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/auth/hash-provider.d.ts.map +1 -1
- package/dist/auth/hash-provider.js +2 -0
- package/dist/auth/password-reset-token.repository.d.ts.map +1 -1
- package/dist/auth/password-reset-token.repository.js +2 -0
- package/dist/auth/session.repository.d.ts.map +1 -1
- package/dist/auth/session.repository.js +2 -0
- package/dist/auth/token-service.d.ts +2 -0
- package/dist/auth/token-service.d.ts.map +1 -1
- package/dist/auth/token-service.js +2 -0
- package/dist/auth/user.repository.d.ts +4 -1
- package/dist/auth/user.repository.d.ts.map +1 -1
- package/dist/auth/user.repository.js +2 -0
- package/dist/automations-grammar-words.d.ts.map +1 -1
- package/dist/automations-grammar-words.js +2 -0
- package/dist/automations.repository.interface.d.ts.map +1 -1
- package/dist/automations.repository.interface.js +2 -0
- package/dist/automations.runner.interface.d.ts.map +1 -1
- package/dist/automations.runner.interface.js +2 -0
- package/dist/automations.runner.stub.d.ts.map +1 -1
- package/dist/automations.runner.stub.js +2 -0
- package/dist/automations.types.d.ts +2 -0
- package/dist/automations.types.d.ts.map +1 -1
- package/dist/automations.types.js +2 -0
- package/dist/clock.d.ts.map +1 -1
- package/dist/clock.js +2 -0
- package/dist/content-scan.repository.d.ts.map +1 -1
- package/dist/content-scan.repository.js +2 -0
- package/dist/content.repository.d.ts +62 -0
- package/dist/content.repository.d.ts.map +1 -1
- package/dist/content.repository.js +18 -0
- package/dist/define-seed.d.ts.map +1 -1
- package/dist/define-seed.js +2 -0
- package/dist/demo-data.repository.d.ts +5 -0
- package/dist/demo-data.repository.d.ts.map +1 -0
- package/dist/demo-data.repository.js +3 -0
- package/dist/engine.d.ts +76 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +253 -8
- package/dist/file-types.d.ts +13 -0
- package/dist/file-types.d.ts.map +1 -0
- package/dist/file-types.js +85 -0
- package/dist/id-generator.d.ts +7 -0
- package/dist/id-generator.d.ts.map +1 -1
- package/dist/id-generator.js +5 -0
- package/dist/idempotency.repository.d.ts.map +1 -1
- package/dist/idempotency.repository.js +2 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/layout-permissions.d.ts +3 -0
- package/dist/layout-permissions.d.ts.map +1 -0
- package/dist/layout-permissions.js +11 -0
- package/dist/media.repository.d.ts.map +1 -1
- package/dist/media.repository.js +2 -0
- package/dist/notifications/notification-service.d.ts.map +1 -1
- package/dist/notifications/notification-service.js +2 -0
- package/dist/notifications/notification.repository.d.ts.map +1 -1
- package/dist/notifications/notification.repository.js +2 -9
- package/dist/observability/activity-log.repository.d.ts.map +1 -1
- package/dist/observability/activity-log.repository.js +2 -0
- package/dist/observability/activity-logger.d.ts +2 -2
- package/dist/observability/activity-logger.d.ts.map +1 -1
- package/dist/observability/activity-logger.js +2 -11
- package/dist/observability/analytics.repository.d.ts.map +1 -1
- package/dist/observability/analytics.repository.js +2 -0
- package/dist/policies.d.ts.map +1 -1
- package/dist/policies.js +2 -0
- package/dist/rate-limit/rate-limiter.d.ts.map +1 -1
- package/dist/rate-limit/rate-limiter.js +2 -0
- package/dist/relations.d.ts +28 -0
- package/dist/relations.d.ts.map +1 -0
- package/dist/relations.js +25 -0
- package/dist/richtext-render.d.ts.map +1 -1
- package/dist/richtext-render.js +2 -0
- package/dist/richtext.d.ts.map +1 -1
- package/dist/richtext.js +2 -0
- package/dist/scheduler.interface.d.ts.map +1 -1
- package/dist/scheduler.interface.js +2 -0
- package/dist/scheduler.stub.d.ts.map +1 -1
- package/dist/scheduler.stub.js +2 -0
- package/dist/schema-mutator.d.ts +22 -0
- package/dist/schema-mutator.d.ts.map +1 -0
- package/dist/schema-mutator.js +3 -0
- package/dist/search/search.repository.d.ts.map +1 -1
- package/dist/search/search.repository.js +2 -0
- package/dist/seed-ddl.d.ts +40 -0
- package/dist/seed-ddl.d.ts.map +1 -0
- package/dist/seed-ddl.js +100 -0
- package/dist/seed-layout.d.ts +117 -0
- package/dist/seed-layout.d.ts.map +1 -0
- package/dist/seed-layout.js +169 -0
- package/dist/seed-layout.repository.d.ts +18 -0
- package/dist/seed-layout.repository.d.ts.map +1 -0
- package/dist/seed-layout.repository.js +3 -0
- package/dist/seed-registry.d.ts +23 -1
- package/dist/seed-registry.d.ts.map +1 -1
- package/dist/seed-registry.js +105 -0
- package/dist/seed-validation.d.ts +23 -0
- package/dist/seed-validation.d.ts.map +1 -0
- package/dist/seed-validation.js +156 -0
- package/dist/seed.repository.d.ts +37 -0
- package/dist/seed.repository.d.ts.map +1 -0
- package/dist/seed.repository.js +3 -0
- package/dist/seeds.d.ts.map +1 -1
- package/dist/seeds.js +2 -0
- package/dist/site-settings.repository.d.ts +16 -0
- package/dist/site-settings.repository.d.ts.map +1 -0
- package/dist/site-settings.repository.js +3 -0
- package/dist/slug-utils.d.ts.map +1 -1
- package/dist/slug-utils.js +2 -0
- package/dist/storage.d.ts +12 -38
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +2 -0
- package/dist/types.d.ts +80 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/validation.d.ts +23 -17
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +495 -393
- package/dist/webhook-validation.d.ts +3 -0
- package/dist/webhook-validation.d.ts.map +1 -0
- package/dist/webhook-validation.js +6 -0
- package/dist/widget/widget.repository.d.ts.map +1 -1
- package/dist/widget/widget.repository.js +2 -0
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-provider.d.ts","sourceRoot":"","sources":["../../src/auth/hash-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hash-provider.d.ts","sourceRoot":"","sources":["../../src/auth/hash-provider.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEhD;;;OAGG;IACH,MAAM,CAAC,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset-token.repository.d.ts","sourceRoot":"","sources":["../../src/auth/password-reset-token.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"password-reset-token.repository.d.ts","sourceRoot":"","sources":["../../src/auth/password-reset-token.repository.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtE,0FAA0F;IAC1F,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpD;;;;OAIG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;IAEtG,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.repository.d.ts","sourceRoot":"","sources":["../../src/auth/session.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,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AAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-service.d.ts","sourceRoot":"","sources":["../../src/auth/token-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"token-service.d.ts","sourceRoot":"","sources":["../../src/auth/token-service.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEtE;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;CACjD"}
|
|
@@ -2,6 +2,7 @@ export interface UserRecord {
|
|
|
2
2
|
id: string;
|
|
3
3
|
email: string;
|
|
4
4
|
name: string | null;
|
|
5
|
+
surname: string | null;
|
|
5
6
|
passwordHash: string;
|
|
6
7
|
role: string;
|
|
7
8
|
avatarUrl: string | null;
|
|
@@ -13,6 +14,7 @@ export interface NewUserInput {
|
|
|
13
14
|
passwordHash: string;
|
|
14
15
|
role: string;
|
|
15
16
|
name: string | null;
|
|
17
|
+
surname: string | null;
|
|
16
18
|
}
|
|
17
19
|
export interface IUserRepository {
|
|
18
20
|
/**
|
|
@@ -26,9 +28,10 @@ export interface IUserRepository {
|
|
|
26
28
|
findByEmail(email: string): Promise<UserRecord | null>;
|
|
27
29
|
/** Inserts a new user record. */
|
|
28
30
|
create(user: NewUserInput): Promise<void>;
|
|
29
|
-
/** Updates the user's display name and/or email address. */
|
|
31
|
+
/** Updates the user's display name, surname, and/or email address. */
|
|
30
32
|
updateProfile(userId: string, fields: {
|
|
31
33
|
name?: string;
|
|
34
|
+
surname?: string;
|
|
32
35
|
email?: string;
|
|
33
36
|
}): Promise<void>;
|
|
34
37
|
/** Replaces the user's stored password hash after a successful password change. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.repository.d.ts","sourceRoot":"","sources":["../../src/auth/user.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.repository.d.ts","sourceRoot":"","sources":["../../src/auth/user.repository.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,uBAAuB,EAAE,MAAM,CAAA;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IAE3B,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAEpD,qEAAqE;IACrE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAEtD,iCAAiC;IACjC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzC,sEAAsE;IACtE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzG,mFAAmF;IACnF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1E,4CAA4C;IAC5C,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExE,qEAAqE;IACrE,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErF;;;;OAIG;IACH,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAClF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations-grammar-words.d.ts","sourceRoot":"","sources":["../src/automations-grammar-words.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.repository.interface.d.ts","sourceRoot":"","sources":["../src/automations.repository.interface.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.runner.interface.d.ts","sourceRoot":"","sources":["../src/automations.runner.interface.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.runner.stub.d.ts","sourceRoot":"","sources":["../src/automations.runner.stub.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -38,6 +38,8 @@ export interface SetVariableAction {
|
|
|
38
38
|
filters?: TriggerCondition[];
|
|
39
39
|
order_by?: string;
|
|
40
40
|
order?: 'asc' | 'desc';
|
|
41
|
+
/** @deprecated Read but ignored at runtime. Removed on next save. */
|
|
42
|
+
load_type?: 'fruit' | 'branch';
|
|
41
43
|
}
|
|
42
44
|
export type AutomationAction = {
|
|
43
45
|
type: 'webhook';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.types.d.ts","sourceRoot":"","sources":["../src/automations.types.ts"],"names":[],"mappings":"
|
|
1
|
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kB,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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../src/clock.ts"],"names":[],"mappings":"
|
|
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-scan.repository.d.ts","sourceRoot":"","sources":["../src/content-scan.repository.ts"],"names":[],"mappings":"
|
|
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,4 +1,20 @@
|
|
|
1
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
|
+
}
|
|
2
18
|
/**
|
|
3
19
|
* Base Repository Error
|
|
4
20
|
*/
|
|
@@ -18,6 +34,33 @@ export declare class EntryNotFoundError extends RepositoryError {
|
|
|
18
34
|
export declare class SlugConflictError extends RepositoryError {
|
|
19
35
|
constructor(message: string);
|
|
20
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
|
+
export type BulkFieldUpdate = {
|
|
52
|
+
kind: 'set';
|
|
53
|
+
value: unknown;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'array_replace';
|
|
56
|
+
value: string[];
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'array_add';
|
|
59
|
+
value: string[];
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'array_remove';
|
|
62
|
+
value: string[];
|
|
63
|
+
};
|
|
21
64
|
/**
|
|
22
65
|
* Interface defining the standard operations for content persistence.
|
|
23
66
|
* This is platform-agnostic and should be implemented for specific databases (e.g., D1).
|
|
@@ -91,5 +134,24 @@ export interface ContentRepository {
|
|
|
91
134
|
* Checks if an entry has a pending draft.
|
|
92
135
|
*/
|
|
93
136
|
hasDraft(seed: Seed, entryId: string): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* Aggregates pending drafts across every draft-enabled seed in a single round-trip.
|
|
139
|
+
* Exists so the unified /drafts view never issues one query per seed.
|
|
140
|
+
* @param seeds The draft-enabled seeds to scan (caller passes seedRegistry.draftEnabled()).
|
|
141
|
+
* @returns Drafts newest-first; empty array when no seeds or no drafts.
|
|
142
|
+
*/
|
|
143
|
+
findPendingDrafts(seeds: Seed[]): Promise<DraftSummary[]>;
|
|
144
|
+
/**
|
|
145
|
+
* Apply the same field update to many entries. Returns per-id outcome.
|
|
146
|
+
* Caller is responsible for validation; this method assumes the payload is
|
|
147
|
+
* already shape-checked against the seed.
|
|
148
|
+
*/
|
|
149
|
+
bulkUpdate(seedSlug: string, ids: string[], fields: Record<string, BulkFieldUpdate>): Promise<{
|
|
150
|
+
updated: number;
|
|
151
|
+
failed: Array<{
|
|
152
|
+
id: string;
|
|
153
|
+
reason: string;
|
|
154
|
+
}>;
|
|
155
|
+
}>;
|
|
94
156
|
}
|
|
95
157
|
//# sourceMappingURL=content.repository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.repository.d.ts","sourceRoot":"","sources":["../src/content.repository.ts"],"names":[],"mappings":"
|
|
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,eAAgB,SAAQ,KAAK;IACJ,KAAK,CAAC,EAAE,OAAO;gBAA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AG,CAAC,GAAG,IAAI,CAAC,CAAA;IAE1E;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExD;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,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,3 +1,5 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright (c) 2024–2026 Flavio De Musso
|
|
1
3
|
/**
|
|
2
4
|
* Base Repository Error
|
|
3
5
|
*/
|
|
@@ -27,3 +29,19 @@ export class SlugConflictError extends RepositoryError {
|
|
|
27
29
|
this.name = 'SlugConflictError';
|
|
28
30
|
}
|
|
29
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
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-seed.d.ts","sourceRoot":"","sources":["../src/define-seed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"define-seed.d.ts","sourceRoot":"","sources":["../src/define-seed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE3C"}
|
package/dist/define-seed.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-data.repository.d.ts","sourceRoot":"","sources":["../src/demo-data.repository.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9B"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* It does not know about HTTP, auth, or UI — it's a pure TypeScript library.
|
|
7
7
|
*/
|
|
8
8
|
import type { Seed, Branch, SelectOptions, ParameterizedQuery } from './types.js';
|
|
9
|
+
export declare function indexableSearchBranches(seed: Seed): Branch[];
|
|
9
10
|
/**
|
|
10
11
|
* Generates `CREATE TABLE IF NOT EXISTS content_{slug}` with system columns
|
|
11
12
|
* + one column per Branch. Pure function: same Seed → same SQL.
|
|
@@ -60,6 +61,81 @@ export declare function getExpectedColumns(seed: Seed): SchemaColumn[];
|
|
|
60
61
|
* boolean → 0/1 | date → Unix timestamp | json/asset-list → JSON string
|
|
61
62
|
*/
|
|
62
63
|
export declare function serializeForDb(branch: Branch, value: unknown): string | number | null;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the junction table name for a many-to-many relation branch.
|
|
66
|
+
* Format: `rel_<seedSlug>_<branchAlias>`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function junctionTableName(seedSlug: string, branchAlias: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Generates `CREATE TABLE IF NOT EXISTS rel_<seed>_<alias>` for a multi-relation
|
|
71
|
+
* branch. The parent FK always cascades (parent lifecycle owns the edge);
|
|
72
|
+
* the target FK uses `branch.onDelete` (default CASCADE).
|
|
73
|
+
*
|
|
74
|
+
* @throws {Error} when called on a non-multi-relation branch
|
|
75
|
+
* @throws {Error} when `branch.targetSeed` is missing
|
|
76
|
+
*/
|
|
77
|
+
export declare function generateJunctionTable(seed: Seed, branch: Branch): string;
|
|
78
|
+
/**
|
|
79
|
+
* Generates the two B-tree indexes for a junction table:
|
|
80
|
+
* one on `parent_id` (list entries by parent) and one on `target_id`
|
|
81
|
+
* (cascade checks from target side).
|
|
82
|
+
*/
|
|
83
|
+
export declare function generateJunctionIndexes(seed: Seed, branch: Branch): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Generates the drafts junction table `rel_<seed>_<alias>_drafts` for a
|
|
86
|
+
* many-to-many relation branch. Note: no FK on `target_id` — targets may be
|
|
87
|
+
* deleted between draft save and publish; the FK would be wrong here.
|
|
88
|
+
* Returns null when `seed.allowDrafts` is falsy.
|
|
89
|
+
*/
|
|
90
|
+
export declare function generateJunctionDraftTable(seed: Seed, branch: Branch): string | null;
|
|
91
|
+
/**
|
|
92
|
+
* Returns every `DROP TABLE IF EXISTS` needed to fully remove a content type:
|
|
93
|
+
* the main `content_{slug}` table, its `fts_{slug}` virtual table, the
|
|
94
|
+
* `content_{slug}_drafts` mirror (when drafts are enabled), and each
|
|
95
|
+
* multi-relation junction table `rel_{slug}_{alias}` (+ its `_drafts` mirror).
|
|
96
|
+
*
|
|
97
|
+
* FTS triggers reference the main table; dropping the main table also drops
|
|
98
|
+
* its triggers in SQLite, but we drop the FTS table explicitly so no orphaned
|
|
99
|
+
* virtual table survives. Order: junction (children) → drafts → fts → main.
|
|
100
|
+
*/
|
|
101
|
+
export declare function generateDropTable(seed: Seed): string[];
|
|
102
|
+
/**
|
|
103
|
+
* Returns the `DROP COLUMN` statements for removing a single field.
|
|
104
|
+
*
|
|
105
|
+
* - For a multi-relation branch (no column on the parent table) it drops the
|
|
106
|
+
* junction table `rel_{slug}_{alias}` (+ `_drafts`) instead.
|
|
107
|
+
* - For a normal branch it drops the column from `content_{slug}` and, when
|
|
108
|
+
* drafts are enabled, the mirror column from `content_{slug}_drafts`.
|
|
109
|
+
* - For an orphan column (no matching branch in the definition) it falls back
|
|
110
|
+
* to a plain `ALTER TABLE … DROP COLUMN`, never touching drafts.
|
|
111
|
+
*
|
|
112
|
+
* Callers must rebuild FTS separately (planFtsRebuild) when the dropped column
|
|
113
|
+
* was searchable, since SQLite cannot ALTER an fts5 table's columns.
|
|
114
|
+
*/
|
|
115
|
+
export declare function generateDropColumn(seed: Seed, alias: string): string[];
|
|
116
|
+
/**
|
|
117
|
+
* Returns the `RENAME COLUMN` statements for renaming a field's alias while
|
|
118
|
+
* keeping the stable `branch.id`. Renames the column on `content_{slug}` and,
|
|
119
|
+
* when drafts are enabled, the mirror column on `content_{slug}_drafts`.
|
|
120
|
+
*
|
|
121
|
+
* For a multi-relation branch the alias is part of the junction table name, so
|
|
122
|
+
* the junction table (+ `_drafts`) is renamed instead of a column.
|
|
123
|
+
*
|
|
124
|
+
* Callers must rebuild FTS separately (planFtsRebuild) when the renamed column
|
|
125
|
+
* was searchable.
|
|
126
|
+
*/
|
|
127
|
+
export declare function generateRenameColumn(seed: Seed, from: string, to: string): string[];
|
|
128
|
+
/**
|
|
129
|
+
* Returns the add/copy/drop/rename statements that change a column's SQL type
|
|
130
|
+
* in place, preserving data via `CAST`. This is the documented simpler
|
|
131
|
+
* alternative to SQLite's full 12-step table rebuild.
|
|
132
|
+
*
|
|
133
|
+
* The `branch` passed in is the *target* definition (already carrying the new
|
|
134
|
+
* `type`); its SQL type is read from BRANCH_TYPE_SQL. Multi-relation branches
|
|
135
|
+
* have no column to retype and are rejected. Mirrors the change onto the drafts
|
|
136
|
+
* table when drafts are enabled. Callers rebuild FTS separately when needed.
|
|
137
|
+
*/
|
|
138
|
+
export declare function generateRetypeColumn(seed: Seed, branch: Branch): string[];
|
|
63
139
|
/**
|
|
64
140
|
* Deserializes a value read from the DB for the API response.
|
|
65
141
|
* 0/1 → boolean | Unix timestamp → ISO 8601 | JSON string → object
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,IAAI,EACJ,MAAM,EAKN,aAAa,EACb,kBAAkB,EACnB,MAAM,YAAY,CAAA;AAqCnB,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,CAI5D;AAkED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CA0BtD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAyB5D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;GAGG;AACH,wBAAgB,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