@cosmicdrift/kumiko-framework 0.411.0 → 0.413.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/agents/api/framework-db.md +1 -1
- package/agents/api/framework-engine.md +48 -1
- package/agents/api/framework-errors.md +2 -0
- package/agents/api/types.md +8 -0
- package/agents/api.md +2 -2
- package/agents/boot-rules.md +343 -0
- package/agents/examples/api-docs.md +710 -0
- package/agents/examples/golden-path.md +11 -11
- package/agents/examples/{contact.md → helpdesk.md} +31 -31
- package/agents/examples.md +2 -1
- package/agents/features-index.md +2 -2
- package/agents/features.md +16 -16
- package/dist/api/auth-middleware.d.ts +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/api/pat-auth-reject.d.ts +7 -0
- package/dist/api/pat-auth-reject.js +7 -0
- package/dist/api/server-middleware.js +2 -1
- package/dist/compliance/sub-processors.js +2 -2
- package/dist/config/index.d.ts +25 -0
- package/dist/config/index.js +28 -1
- package/dist/db/event-store-executor-read-paging.d.ts +1 -0
- package/dist/db/event-store-executor-read-paging.js +2 -1
- package/dist/db/read-gate-clause.js +26 -7
- package/dist/db/table-builder.d.ts +1 -2
- package/dist/engine/boot-validator/boot-report.d.ts +3 -0
- package/dist/engine/boot-validator/boot-report.js +2 -2
- package/dist/engine/boot-validator/boot-rules.d.ts +570 -0
- package/dist/engine/boot-validator/boot-rules.js +20 -0
- package/dist/engine/boot-validator/definition-config-events-jobs-rules.d.ts +77 -0
- package/dist/engine/boot-validator/definition-config-events-jobs-rules.js +77 -0
- package/dist/engine/boot-validator/definition-events-rules.d.ts +42 -0
- package/dist/engine/boot-validator/definition-events-rules.js +42 -0
- package/dist/engine/boot-validator/definition-feature-rules.d.ts +42 -0
- package/dist/engine/boot-validator/definition-feature-rules.js +42 -0
- package/dist/engine/boot-validator/definition-field-factories-rules.d.ts +17 -0
- package/dist/engine/boot-validator/definition-field-factories-rules.js +17 -0
- package/dist/engine/boot-validator/definition-handlers-rules.d.ts +72 -0
- package/dist/engine/boot-validator/definition-handlers-rules.js +72 -0
- package/dist/engine/boot-validator/definition-ownership-from-rules.d.ts +27 -0
- package/dist/engine/boot-validator/definition-ownership-from-rules.js +27 -0
- package/dist/engine/boot-validator/definition-probes-rules.d.ts +47 -0
- package/dist/engine/boot-validator/definition-probes-rules.js +47 -0
- package/dist/engine/boot-validator/definition-role-assignment-rules.d.ts +27 -0
- package/dist/engine/boot-validator/definition-role-assignment-rules.js +27 -0
- package/dist/engine/boot-validator/definition-ui-extensions-rules.d.ts +197 -0
- package/dist/engine/boot-validator/definition-ui-extensions-rules.js +197 -0
- package/dist/engine/boot-validator/definition-webhook-events-rules.d.ts +32 -0
- package/dist/engine/boot-validator/definition-webhook-events-rules.js +32 -0
- package/dist/engine/define-feature.js +29 -9
- package/dist/engine/define-handler.js +8 -4
- package/dist/engine/definition-violations.d.ts +14 -0
- package/dist/engine/definition-violations.js +71 -0
- package/dist/engine/entity-handlers.js +39 -13
- package/dist/engine/entity-list-runtime-options.js +12 -0
- package/dist/engine/event-def.js +32 -12
- package/dist/engine/factories.d.ts +2 -0
- package/dist/engine/factories.js +16 -5
- package/dist/engine/feature-builder-state.d.ts +2 -1
- package/dist/engine/feature-builder-state.js +1 -0
- package/dist/engine/feature-config-events-jobs.js +63 -27
- package/dist/engine/feature-entity-handlers.js +15 -6
- package/dist/engine/feature-probes.js +29 -9
- package/dist/engine/feature-ui-extensions.js +178 -92
- package/dist/engine/index.d.ts +5 -2
- package/dist/engine/index.js +4 -1
- package/dist/engine/object-form.js +8 -2
- package/dist/engine/ownership.js +17 -5
- package/dist/engine/registry-facade.js +13 -0
- package/dist/engine/role-assignment.js +17 -5
- package/dist/engine/webhook-contracts.d.ts +12 -0
- package/dist/engine/webhook-contracts.js +172 -0
- package/dist/engine/webhook-events.d.ts +34 -0
- package/dist/engine/webhook-events.js +85 -0
- package/dist/errors/docs-url.js +2 -19
- package/dist/errors/error-codes.d.ts +20 -0
- package/dist/errors/error-codes.js +19 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +1 -0
- package/dist/files/file-routes.js +1 -1
- package/dist/i18n/required-surface-keys.d.ts +4 -0
- package/dist/i18n/required-surface-keys.js +15 -0
- package/dist/schema-cli/shared.d.ts +11 -0
- package/dist/schema-cli/shared.js +37 -3
- package/dist/schema-cli/validate-command.js +10 -3
- package/package.json +3 -3
- package/src/changes.json +42 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const DEFINITION_CONFIG_EVENTS_JOBS_RULES: {
|
|
2
|
+
readonly jobMaintenanceTriggerInvalid: {
|
|
3
|
+
readonly id: "job/maintenance-trigger-invalid";
|
|
4
|
+
readonly summary: "A job maintenance trigger has the value true.";
|
|
5
|
+
readonly fix: "Use trigger { maintenance: true }.";
|
|
6
|
+
};
|
|
7
|
+
readonly jobWakesSleepingAppInvalid: {
|
|
8
|
+
readonly id: "job/wakes-sleeping-app-invalid";
|
|
9
|
+
readonly summary: "wakesSleepingApp is false and only on cron or maintenance triggers.";
|
|
10
|
+
readonly fix: "Use wakesSleepingApp: false on a cron or maintenance trigger, or omit it.";
|
|
11
|
+
};
|
|
12
|
+
readonly jobCronTimezoneInvalid: {
|
|
13
|
+
readonly id: "job/cron-timezone-invalid";
|
|
14
|
+
readonly summary: "A cron trigger tz is an IANA time zone name.";
|
|
15
|
+
readonly fix: 'Use a zone name such as "Europe/Berlin".';
|
|
16
|
+
};
|
|
17
|
+
readonly jobEscapeHatchInvalid: {
|
|
18
|
+
readonly id: "job/escape-hatch-invalid";
|
|
19
|
+
readonly summary: "A job escapeHatch carries a valid reason and grants.";
|
|
20
|
+
readonly fix: "Fix the escapeHatch reason or grants as the message describes.";
|
|
21
|
+
};
|
|
22
|
+
readonly configSingleKeyNeedsDefinition: {
|
|
23
|
+
readonly id: "config/single-key-needs-definition";
|
|
24
|
+
readonly summary: "The single-key config() form receives a definition as second argument.";
|
|
25
|
+
readonly fix: "Pass the key definition as the second argument.";
|
|
26
|
+
};
|
|
27
|
+
readonly eventMigrationStepSize: {
|
|
28
|
+
readonly id: "event/migration-step-size";
|
|
29
|
+
readonly summary: "Event migrations move exactly one version up.";
|
|
30
|
+
readonly fix: "Declare each version step separately with toVersion = fromVersion + 1.";
|
|
31
|
+
};
|
|
32
|
+
readonly eventMigrationFromVersionInvalid: {
|
|
33
|
+
readonly id: "event/migration-from-version-invalid";
|
|
34
|
+
readonly summary: "Event migrations start at fromVersion 1 or higher.";
|
|
35
|
+
readonly fix: "Set fromVersion to 1 or higher.";
|
|
36
|
+
};
|
|
37
|
+
readonly eventMigrationDuplicateStep: {
|
|
38
|
+
readonly id: "event/migration-duplicate-step";
|
|
39
|
+
readonly summary: "Each event migration step is declared once.";
|
|
40
|
+
readonly fix: "Remove the duplicate migration for that fromVersion.";
|
|
41
|
+
};
|
|
42
|
+
readonly eventMigrationRenameCollision: {
|
|
43
|
+
readonly id: "event/migration-rename-collision";
|
|
44
|
+
readonly summary: "A declarative migration maps at most one source to each rename target.";
|
|
45
|
+
readonly fix: "Rename only one source field to the target.";
|
|
46
|
+
};
|
|
47
|
+
readonly metricDuplicate: {
|
|
48
|
+
readonly id: "metric/name-duplicate";
|
|
49
|
+
readonly summary: "Metric names are unique per feature.";
|
|
50
|
+
readonly fix: "Rename one of the metrics.";
|
|
51
|
+
};
|
|
52
|
+
readonly envSchemaTwice: {
|
|
53
|
+
readonly id: "env-schema/declared-twice";
|
|
54
|
+
readonly summary: "A feature calls r.envSchema() at most once.";
|
|
55
|
+
readonly fix: "Compose all env keys into one Zod object.";
|
|
56
|
+
};
|
|
57
|
+
readonly secretDuplicate: {
|
|
58
|
+
readonly id: "secret/key-duplicate";
|
|
59
|
+
readonly summary: "Secret key names are unique per feature.";
|
|
60
|
+
readonly fix: "Rename one of the secrets.";
|
|
61
|
+
};
|
|
62
|
+
readonly secretWriteRolesEmpty: {
|
|
63
|
+
readonly id: "secret/write-roles-empty";
|
|
64
|
+
readonly summary: "A secret or namespace writeRoles list is non-empty.";
|
|
65
|
+
readonly fix: "Add roles or omit writeRoles to use the secrets handler access.";
|
|
66
|
+
};
|
|
67
|
+
readonly secretNamespaceDuplicate: {
|
|
68
|
+
readonly id: "secret/namespace-duplicate";
|
|
69
|
+
readonly summary: "Secret namespace names are unique per feature.";
|
|
70
|
+
readonly fix: "Rename one of the namespaces.";
|
|
71
|
+
};
|
|
72
|
+
readonly claimKeyDuplicate: {
|
|
73
|
+
readonly id: "claim/key-duplicate";
|
|
74
|
+
readonly summary: "Claim short names are unique per feature.";
|
|
75
|
+
readonly fix: "Rename one of the claims.";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const DEFINITION_CONFIG_EVENTS_JOBS_RULES = {
|
|
2
|
+
jobMaintenanceTriggerInvalid: {
|
|
3
|
+
id: "job/maintenance-trigger-invalid",
|
|
4
|
+
summary: "A job maintenance trigger has the value true.",
|
|
5
|
+
fix: "Use trigger { maintenance: true }.",
|
|
6
|
+
},
|
|
7
|
+
jobWakesSleepingAppInvalid: {
|
|
8
|
+
id: "job/wakes-sleeping-app-invalid",
|
|
9
|
+
summary: "wakesSleepingApp is false and only on cron or maintenance triggers.",
|
|
10
|
+
fix: "Use wakesSleepingApp: false on a cron or maintenance trigger, or omit it.",
|
|
11
|
+
},
|
|
12
|
+
jobCronTimezoneInvalid: {
|
|
13
|
+
id: "job/cron-timezone-invalid",
|
|
14
|
+
summary: "A cron trigger tz is an IANA time zone name.",
|
|
15
|
+
fix: 'Use a zone name such as "Europe/Berlin".',
|
|
16
|
+
},
|
|
17
|
+
jobEscapeHatchInvalid: {
|
|
18
|
+
id: "job/escape-hatch-invalid",
|
|
19
|
+
summary: "A job escapeHatch carries a valid reason and grants.",
|
|
20
|
+
fix: "Fix the escapeHatch reason or grants as the message describes.",
|
|
21
|
+
},
|
|
22
|
+
configSingleKeyNeedsDefinition: {
|
|
23
|
+
id: "config/single-key-needs-definition",
|
|
24
|
+
summary: "The single-key config() form receives a definition as second argument.",
|
|
25
|
+
fix: "Pass the key definition as the second argument.",
|
|
26
|
+
},
|
|
27
|
+
eventMigrationStepSize: {
|
|
28
|
+
id: "event/migration-step-size",
|
|
29
|
+
summary: "Event migrations move exactly one version up.",
|
|
30
|
+
fix: "Declare each version step separately with toVersion = fromVersion + 1.",
|
|
31
|
+
},
|
|
32
|
+
eventMigrationFromVersionInvalid: {
|
|
33
|
+
id: "event/migration-from-version-invalid",
|
|
34
|
+
summary: "Event migrations start at fromVersion 1 or higher.",
|
|
35
|
+
fix: "Set fromVersion to 1 or higher.",
|
|
36
|
+
},
|
|
37
|
+
eventMigrationDuplicateStep: {
|
|
38
|
+
id: "event/migration-duplicate-step",
|
|
39
|
+
summary: "Each event migration step is declared once.",
|
|
40
|
+
fix: "Remove the duplicate migration for that fromVersion.",
|
|
41
|
+
},
|
|
42
|
+
eventMigrationRenameCollision: {
|
|
43
|
+
id: "event/migration-rename-collision",
|
|
44
|
+
summary: "A declarative migration maps at most one source to each rename target.",
|
|
45
|
+
fix: "Rename only one source field to the target.",
|
|
46
|
+
},
|
|
47
|
+
metricDuplicate: {
|
|
48
|
+
id: "metric/name-duplicate",
|
|
49
|
+
summary: "Metric names are unique per feature.",
|
|
50
|
+
fix: "Rename one of the metrics.",
|
|
51
|
+
},
|
|
52
|
+
envSchemaTwice: {
|
|
53
|
+
id: "env-schema/declared-twice",
|
|
54
|
+
summary: "A feature calls r.envSchema() at most once.",
|
|
55
|
+
fix: "Compose all env keys into one Zod object.",
|
|
56
|
+
},
|
|
57
|
+
secretDuplicate: {
|
|
58
|
+
id: "secret/key-duplicate",
|
|
59
|
+
summary: "Secret key names are unique per feature.",
|
|
60
|
+
fix: "Rename one of the secrets.",
|
|
61
|
+
},
|
|
62
|
+
secretWriteRolesEmpty: {
|
|
63
|
+
id: "secret/write-roles-empty",
|
|
64
|
+
summary: "A secret or namespace writeRoles list is non-empty.",
|
|
65
|
+
fix: "Add roles or omit writeRoles to use the secrets handler access.",
|
|
66
|
+
},
|
|
67
|
+
secretNamespaceDuplicate: {
|
|
68
|
+
id: "secret/namespace-duplicate",
|
|
69
|
+
summary: "Secret namespace names are unique per feature.",
|
|
70
|
+
fix: "Rename one of the namespaces.",
|
|
71
|
+
},
|
|
72
|
+
claimKeyDuplicate: {
|
|
73
|
+
id: "claim/key-duplicate",
|
|
74
|
+
summary: "Claim short names are unique per feature.",
|
|
75
|
+
fix: "Rename one of the claims.",
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const DEFINITION_EVENT_RULES: {
|
|
2
|
+
readonly piiOwnerNotString: {
|
|
3
|
+
readonly id: "event/pii-owner-not-string";
|
|
4
|
+
readonly summary: "A PII owner field of an event payload is a string.";
|
|
5
|
+
readonly fix: 'Use a string owner field or declare whenAbsent ("tenant", "self" or "plaintext").';
|
|
6
|
+
};
|
|
7
|
+
readonly piiOwnerNullable: {
|
|
8
|
+
readonly id: "event/pii-owner-nullable";
|
|
9
|
+
readonly summary: "A nullable PII owner field of an event declares whenAbsent.";
|
|
10
|
+
readonly fix: 'Declare whenAbsent as "tenant", "self" or "plaintext".';
|
|
11
|
+
};
|
|
12
|
+
readonly piiFieldNotInSchema: {
|
|
13
|
+
readonly id: "event/pii-field-not-in-schema";
|
|
14
|
+
readonly summary: "Event piiFields reference fields of the payload schema.";
|
|
15
|
+
readonly fix: "Name an existing payload field.";
|
|
16
|
+
};
|
|
17
|
+
readonly piiSelfOwner: {
|
|
18
|
+
readonly id: "event/pii-self-owner";
|
|
19
|
+
readonly summary: "An event PII field is not its own owner field.";
|
|
20
|
+
readonly fix: "Point the owner at a separate user id field.";
|
|
21
|
+
};
|
|
22
|
+
readonly piiOwnerIsId: {
|
|
23
|
+
readonly id: "event/pii-owner-is-id";
|
|
24
|
+
readonly summary: 'Event PII fields do not use "id" as owner field.';
|
|
25
|
+
readonly fix: 'Use personal: "self" for record-owned event fields.';
|
|
26
|
+
};
|
|
27
|
+
readonly piiStanceMissing: {
|
|
28
|
+
readonly id: "event/pii-stance-missing";
|
|
29
|
+
readonly summary: "Events declare an explicit PII stance.";
|
|
30
|
+
readonly fix: 'Pass piiFields with owned fields or piiFields: "none".';
|
|
31
|
+
};
|
|
32
|
+
readonly piiStanceEmpty: {
|
|
33
|
+
readonly id: "event/pii-stance-empty";
|
|
34
|
+
readonly summary: "An empty piiFields object is not a stance.";
|
|
35
|
+
readonly fix: 'Use piiFields: "none" for payloads without personal data.';
|
|
36
|
+
};
|
|
37
|
+
readonly versionInvalid: {
|
|
38
|
+
readonly id: "event/version-invalid";
|
|
39
|
+
readonly summary: "Event version is a positive integer.";
|
|
40
|
+
readonly fix: "Set version to an integer of 1 or higher.";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const DEFINITION_EVENT_RULES = {
|
|
2
|
+
piiOwnerNotString: {
|
|
3
|
+
id: "event/pii-owner-not-string",
|
|
4
|
+
summary: "A PII owner field of an event payload is a string.",
|
|
5
|
+
fix: 'Use a string owner field or declare whenAbsent ("tenant", "self" or "plaintext").',
|
|
6
|
+
},
|
|
7
|
+
piiOwnerNullable: {
|
|
8
|
+
id: "event/pii-owner-nullable",
|
|
9
|
+
summary: "A nullable PII owner field of an event declares whenAbsent.",
|
|
10
|
+
fix: 'Declare whenAbsent as "tenant", "self" or "plaintext".',
|
|
11
|
+
},
|
|
12
|
+
piiFieldNotInSchema: {
|
|
13
|
+
id: "event/pii-field-not-in-schema",
|
|
14
|
+
summary: "Event piiFields reference fields of the payload schema.",
|
|
15
|
+
fix: "Name an existing payload field.",
|
|
16
|
+
},
|
|
17
|
+
piiSelfOwner: {
|
|
18
|
+
id: "event/pii-self-owner",
|
|
19
|
+
summary: "An event PII field is not its own owner field.",
|
|
20
|
+
fix: "Point the owner at a separate user id field.",
|
|
21
|
+
},
|
|
22
|
+
piiOwnerIsId: {
|
|
23
|
+
id: "event/pii-owner-is-id",
|
|
24
|
+
summary: 'Event PII fields do not use "id" as owner field.',
|
|
25
|
+
fix: 'Use personal: "self" for record-owned event fields.',
|
|
26
|
+
},
|
|
27
|
+
piiStanceMissing: {
|
|
28
|
+
id: "event/pii-stance-missing",
|
|
29
|
+
summary: "Events declare an explicit PII stance.",
|
|
30
|
+
fix: 'Pass piiFields with owned fields or piiFields: "none".',
|
|
31
|
+
},
|
|
32
|
+
piiStanceEmpty: {
|
|
33
|
+
id: "event/pii-stance-empty",
|
|
34
|
+
summary: "An empty piiFields object is not a stance.",
|
|
35
|
+
fix: 'Use piiFields: "none" for payloads without personal data.',
|
|
36
|
+
},
|
|
37
|
+
versionInvalid: {
|
|
38
|
+
id: "event/version-invalid",
|
|
39
|
+
summary: "Event version is a positive integer.",
|
|
40
|
+
fix: "Set version to an integer of 1 or higher.",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const FEATURE_DEFINITION_RULES: {
|
|
2
|
+
readonly dedupeOptionsNotComparable: {
|
|
3
|
+
readonly id: "feature/dedupe-options-not-comparable";
|
|
4
|
+
readonly summary: "dedupeOptions values are primitives or stable function references.";
|
|
5
|
+
readonly fix: "Replace nested objects in dedupeOptions with primitives or a module-level function reference.";
|
|
6
|
+
};
|
|
7
|
+
readonly describeTwice: {
|
|
8
|
+
readonly id: "feature/describe-twice";
|
|
9
|
+
readonly summary: "A feature calls r.describe() at most once.";
|
|
10
|
+
readonly fix: "Remove the second r.describe() call.";
|
|
11
|
+
};
|
|
12
|
+
readonly describeTextEmpty: {
|
|
13
|
+
readonly id: "feature/describe-text-empty";
|
|
14
|
+
readonly summary: "r.describe() receives a non-empty string.";
|
|
15
|
+
readonly fix: "Pass a non-empty description text.";
|
|
16
|
+
};
|
|
17
|
+
readonly requiresNeedsFeatures: {
|
|
18
|
+
readonly id: "feature/requires-needs-features";
|
|
19
|
+
readonly summary: "r.requires() receives { features: string[] }.";
|
|
20
|
+
readonly fix: 'Pass the feature names as r.requires({ features: ["other-feature"] }).';
|
|
21
|
+
};
|
|
22
|
+
readonly toggleableTwice: {
|
|
23
|
+
readonly id: "feature/toggleable-twice";
|
|
24
|
+
readonly summary: "A feature calls r.toggleable() at most once.";
|
|
25
|
+
readonly fix: "Remove the second r.toggleable() call.";
|
|
26
|
+
};
|
|
27
|
+
readonly uiHintsTwice: {
|
|
28
|
+
readonly id: "feature/ui-hints-twice";
|
|
29
|
+
readonly summary: "A feature calls r.uiHints() at most once.";
|
|
30
|
+
readonly fix: "Merge all UI hints into a single r.uiHints() call.";
|
|
31
|
+
};
|
|
32
|
+
readonly argumentMissing: {
|
|
33
|
+
readonly id: "registrar/argument-missing";
|
|
34
|
+
readonly summary: "Every registrar method receives all its required arguments.";
|
|
35
|
+
readonly fix: "Pass the missing argument named in the message.";
|
|
36
|
+
};
|
|
37
|
+
readonly optionsObjectRequired: {
|
|
38
|
+
readonly id: "registrar/options-object-required";
|
|
39
|
+
readonly summary: "Object-form registrar methods take one options object.";
|
|
40
|
+
readonly fix: "Pass a single options object such as r.entity({ name: ... }).";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const FEATURE_DEFINITION_RULES = {
|
|
2
|
+
dedupeOptionsNotComparable: {
|
|
3
|
+
id: "feature/dedupe-options-not-comparable",
|
|
4
|
+
summary: "dedupeOptions values are primitives or stable function references.",
|
|
5
|
+
fix: "Replace nested objects in dedupeOptions with primitives or a module-level function reference.",
|
|
6
|
+
},
|
|
7
|
+
describeTwice: {
|
|
8
|
+
id: "feature/describe-twice",
|
|
9
|
+
summary: "A feature calls r.describe() at most once.",
|
|
10
|
+
fix: "Remove the second r.describe() call.",
|
|
11
|
+
},
|
|
12
|
+
describeTextEmpty: {
|
|
13
|
+
id: "feature/describe-text-empty",
|
|
14
|
+
summary: "r.describe() receives a non-empty string.",
|
|
15
|
+
fix: "Pass a non-empty description text.",
|
|
16
|
+
},
|
|
17
|
+
requiresNeedsFeatures: {
|
|
18
|
+
id: "feature/requires-needs-features",
|
|
19
|
+
summary: "r.requires() receives { features: string[] }.",
|
|
20
|
+
fix: 'Pass the feature names as r.requires({ features: ["other-feature"] }).',
|
|
21
|
+
},
|
|
22
|
+
toggleableTwice: {
|
|
23
|
+
id: "feature/toggleable-twice",
|
|
24
|
+
summary: "A feature calls r.toggleable() at most once.",
|
|
25
|
+
fix: "Remove the second r.toggleable() call.",
|
|
26
|
+
},
|
|
27
|
+
uiHintsTwice: {
|
|
28
|
+
id: "feature/ui-hints-twice",
|
|
29
|
+
summary: "A feature calls r.uiHints() at most once.",
|
|
30
|
+
fix: "Merge all UI hints into a single r.uiHints() call.",
|
|
31
|
+
},
|
|
32
|
+
argumentMissing: {
|
|
33
|
+
id: "registrar/argument-missing",
|
|
34
|
+
summary: "Every registrar method receives all its required arguments.",
|
|
35
|
+
fix: "Pass the missing argument named in the message.",
|
|
36
|
+
},
|
|
37
|
+
optionsObjectRequired: {
|
|
38
|
+
id: "registrar/options-object-required",
|
|
39
|
+
summary: "Object-form registrar methods take one options object.",
|
|
40
|
+
fix: "Pass a single options object such as r.entity({ name: ... }).",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DEFINITION_FIELD_FACTORY_RULES: {
|
|
2
|
+
readonly personalRecordOwnerWhenAbsent: {
|
|
3
|
+
readonly id: "field/personal-record-owner-when-absent";
|
|
4
|
+
readonly summary: 'personal: { of: "id" } sets no whenAbsent.';
|
|
5
|
+
readonly fix: "Remove whenAbsent from the record-owned stance.";
|
|
6
|
+
};
|
|
7
|
+
readonly userReferenceNotPersonal: {
|
|
8
|
+
readonly id: "field/user-reference-not-personal";
|
|
9
|
+
readonly summary: "A reference to the user entity is personal data.";
|
|
10
|
+
readonly fix: 'Drop personal: false or use { personal: "ref" }.';
|
|
11
|
+
};
|
|
12
|
+
readonly decimalPrecisionScaleInvalid: {
|
|
13
|
+
readonly id: "field/decimal-precision-scale-invalid";
|
|
14
|
+
readonly summary: "Decimal precision is at least 1 and scale lies between 0 and precision.";
|
|
15
|
+
readonly fix: "Use integers with 1 <= precision and 0 <= scale <= precision.";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const DEFINITION_FIELD_FACTORY_RULES = {
|
|
2
|
+
personalRecordOwnerWhenAbsent: {
|
|
3
|
+
id: "field/personal-record-owner-when-absent",
|
|
4
|
+
summary: 'personal: { of: "id" } sets no whenAbsent.',
|
|
5
|
+
fix: "Remove whenAbsent from the record-owned stance.",
|
|
6
|
+
},
|
|
7
|
+
userReferenceNotPersonal: {
|
|
8
|
+
id: "field/user-reference-not-personal",
|
|
9
|
+
summary: "A reference to the user entity is personal data.",
|
|
10
|
+
fix: 'Drop personal: false or use { personal: "ref" }.',
|
|
11
|
+
},
|
|
12
|
+
decimalPrecisionScaleInvalid: {
|
|
13
|
+
id: "field/decimal-precision-scale-invalid",
|
|
14
|
+
summary: "Decimal precision is at least 1 and scale lies between 0 and precision.",
|
|
15
|
+
fix: "Use integers with 1 <= precision and 0 <= scale <= precision.",
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const DEFINITION_HANDLER_RULES: {
|
|
2
|
+
readonly escapeHatchAccessNotSystemAdmin: {
|
|
3
|
+
readonly id: "handler/escape-hatch-not-system-admin";
|
|
4
|
+
readonly summary: "A handler with escapeHatch is restricted to SystemAdmin.";
|
|
5
|
+
readonly fix: "Set access to { roles: [SystemAdmin] }.";
|
|
6
|
+
};
|
|
7
|
+
readonly nameWithoutColon: {
|
|
8
|
+
readonly id: "handler/name-pattern-invalid";
|
|
9
|
+
readonly summary: 'Entity handler names use the "<entity>:<verb>" pattern.';
|
|
10
|
+
readonly fix: 'Name the handler like "note:create".';
|
|
11
|
+
};
|
|
12
|
+
readonly nameMissingEntity: {
|
|
13
|
+
readonly id: "handler/name-missing-entity";
|
|
14
|
+
readonly summary: "Entity handler names start with the entity name.";
|
|
15
|
+
readonly fix: "Put the entity name before the colon.";
|
|
16
|
+
};
|
|
17
|
+
readonly verbUnknown: {
|
|
18
|
+
readonly id: "handler/verb-unknown";
|
|
19
|
+
readonly summary: "Entity handler names end in a standard verb.";
|
|
20
|
+
readonly fix: "Use a standard verb or the explicit r.writeHandler / r.queryHandler form.";
|
|
21
|
+
};
|
|
22
|
+
readonly agentRiskNotHigh: {
|
|
23
|
+
readonly id: "handler/agent-risk-not-high";
|
|
24
|
+
readonly summary: "Handlers with irreversible or instruction-carrying effects declare agent.risk high.";
|
|
25
|
+
readonly fix: 'Set agent.risk to "high".';
|
|
26
|
+
};
|
|
27
|
+
readonly excludeFieldsVerbUnsupported: {
|
|
28
|
+
readonly id: "handler/exclude-fields-verb-unsupported";
|
|
29
|
+
readonly summary: "excludeFields is used on create and update handlers only.";
|
|
30
|
+
readonly fix: "Remove excludeFields from this handler.";
|
|
31
|
+
};
|
|
32
|
+
readonly excludeFieldsUnknownField: {
|
|
33
|
+
readonly id: "handler/exclude-fields-unknown-field";
|
|
34
|
+
readonly summary: "excludeFields names fields of the entity.";
|
|
35
|
+
readonly fix: "Name an existing field or remove the entry.";
|
|
36
|
+
};
|
|
37
|
+
readonly excludeFieldsTotalsPair: {
|
|
38
|
+
readonly id: "handler/exclude-fields-totals-pair";
|
|
39
|
+
readonly summary: "excludeFields leaves totalsMatch pairs together.";
|
|
40
|
+
readonly fix: "Keep both fields of the pair writable.";
|
|
41
|
+
};
|
|
42
|
+
readonly excludeFieldsRequiredWithoutDefault: {
|
|
43
|
+
readonly id: "handler/exclude-fields-required-without-default";
|
|
44
|
+
readonly summary: "excludeFields on create does not exclude required fields without a default.";
|
|
45
|
+
readonly fix: "Give the field a default or keep it writable.";
|
|
46
|
+
};
|
|
47
|
+
readonly restoreWithoutSoftDelete: {
|
|
48
|
+
readonly id: "handler/restore-without-soft-delete";
|
|
49
|
+
readonly summary: "Restore handlers exist only for entities with softDelete.";
|
|
50
|
+
readonly fix: "Declare softDelete: true on the entity or drop the restore verb.";
|
|
51
|
+
};
|
|
52
|
+
readonly crudAccessUnresolved: {
|
|
53
|
+
readonly id: "handler/crud-access-unresolved";
|
|
54
|
+
readonly summary: "r.crud() resolves an access rule for every verb it registers.";
|
|
55
|
+
readonly fix: "Set write.access, read.access or verbAccess.<verb> in the r.crud options.";
|
|
56
|
+
};
|
|
57
|
+
readonly nameDuplicate: {
|
|
58
|
+
readonly id: "handler/name-duplicate";
|
|
59
|
+
readonly summary: "A handler name is registered once per feature.";
|
|
60
|
+
readonly fix: "Use a distinct name or drop the verb from r.crud.";
|
|
61
|
+
};
|
|
62
|
+
readonly inlineFormIncomplete: {
|
|
63
|
+
readonly id: "handler/inline-form-incomplete";
|
|
64
|
+
readonly summary: "The inline handler form provides schema, handler and options.access.";
|
|
65
|
+
readonly fix: "Pass schema, handler and options with access.";
|
|
66
|
+
};
|
|
67
|
+
readonly handlerAndPerformBoth: {
|
|
68
|
+
readonly id: "handler/handler-and-perform-both";
|
|
69
|
+
readonly summary: "A write handler sets handler or perform, not both.";
|
|
70
|
+
readonly fix: "Keep either the free-form handler or the perform pipeline.";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export const DEFINITION_HANDLER_RULES = {
|
|
2
|
+
escapeHatchAccessNotSystemAdmin: {
|
|
3
|
+
id: "handler/escape-hatch-not-system-admin",
|
|
4
|
+
summary: "A handler with escapeHatch is restricted to SystemAdmin.",
|
|
5
|
+
fix: "Set access to { roles: [SystemAdmin] }.",
|
|
6
|
+
},
|
|
7
|
+
nameWithoutColon: {
|
|
8
|
+
id: "handler/name-pattern-invalid",
|
|
9
|
+
summary: 'Entity handler names use the "<entity>:<verb>" pattern.',
|
|
10
|
+
fix: 'Name the handler like "note:create".',
|
|
11
|
+
},
|
|
12
|
+
nameMissingEntity: {
|
|
13
|
+
id: "handler/name-missing-entity",
|
|
14
|
+
summary: "Entity handler names start with the entity name.",
|
|
15
|
+
fix: "Put the entity name before the colon.",
|
|
16
|
+
},
|
|
17
|
+
verbUnknown: {
|
|
18
|
+
id: "handler/verb-unknown",
|
|
19
|
+
summary: "Entity handler names end in a standard verb.",
|
|
20
|
+
fix: "Use a standard verb or the explicit r.writeHandler / r.queryHandler form.",
|
|
21
|
+
},
|
|
22
|
+
agentRiskNotHigh: {
|
|
23
|
+
id: "handler/agent-risk-not-high",
|
|
24
|
+
summary: "Handlers with irreversible or instruction-carrying effects declare agent.risk high.",
|
|
25
|
+
fix: 'Set agent.risk to "high".',
|
|
26
|
+
},
|
|
27
|
+
excludeFieldsVerbUnsupported: {
|
|
28
|
+
id: "handler/exclude-fields-verb-unsupported",
|
|
29
|
+
summary: "excludeFields is used on create and update handlers only.",
|
|
30
|
+
fix: "Remove excludeFields from this handler.",
|
|
31
|
+
},
|
|
32
|
+
excludeFieldsUnknownField: {
|
|
33
|
+
id: "handler/exclude-fields-unknown-field",
|
|
34
|
+
summary: "excludeFields names fields of the entity.",
|
|
35
|
+
fix: "Name an existing field or remove the entry.",
|
|
36
|
+
},
|
|
37
|
+
excludeFieldsTotalsPair: {
|
|
38
|
+
id: "handler/exclude-fields-totals-pair",
|
|
39
|
+
summary: "excludeFields leaves totalsMatch pairs together.",
|
|
40
|
+
fix: "Keep both fields of the pair writable.",
|
|
41
|
+
},
|
|
42
|
+
excludeFieldsRequiredWithoutDefault: {
|
|
43
|
+
id: "handler/exclude-fields-required-without-default",
|
|
44
|
+
summary: "excludeFields on create does not exclude required fields without a default.",
|
|
45
|
+
fix: "Give the field a default or keep it writable.",
|
|
46
|
+
},
|
|
47
|
+
restoreWithoutSoftDelete: {
|
|
48
|
+
id: "handler/restore-without-soft-delete",
|
|
49
|
+
summary: "Restore handlers exist only for entities with softDelete.",
|
|
50
|
+
fix: "Declare softDelete: true on the entity or drop the restore verb.",
|
|
51
|
+
},
|
|
52
|
+
crudAccessUnresolved: {
|
|
53
|
+
id: "handler/crud-access-unresolved",
|
|
54
|
+
summary: "r.crud() resolves an access rule for every verb it registers.",
|
|
55
|
+
fix: "Set write.access, read.access or verbAccess.<verb> in the r.crud options.",
|
|
56
|
+
},
|
|
57
|
+
nameDuplicate: {
|
|
58
|
+
id: "handler/name-duplicate",
|
|
59
|
+
summary: "A handler name is registered once per feature.",
|
|
60
|
+
fix: "Use a distinct name or drop the verb from r.crud.",
|
|
61
|
+
},
|
|
62
|
+
inlineFormIncomplete: {
|
|
63
|
+
id: "handler/inline-form-incomplete",
|
|
64
|
+
summary: "The inline handler form provides schema, handler and options.access.",
|
|
65
|
+
fix: "Pass schema, handler and options with access.",
|
|
66
|
+
},
|
|
67
|
+
handlerAndPerformBoth: {
|
|
68
|
+
id: "handler/handler-and-perform-both",
|
|
69
|
+
summary: "A write handler sets handler or perform, not both.",
|
|
70
|
+
fix: "Keep either the free-form handler or the perform pipeline.",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const DEFINITION_OWNERSHIP_FROM_RULES: {
|
|
2
|
+
readonly refWithoutColon: {
|
|
3
|
+
readonly id: "ownership/from-ref-without-colon";
|
|
4
|
+
readonly summary: 'from() refs have the form "user:<field>" or "claim:<feature>:<key>".';
|
|
5
|
+
readonly fix: "Add the prefix and colon to the ref.";
|
|
6
|
+
};
|
|
7
|
+
readonly userColumnMissing: {
|
|
8
|
+
readonly id: "ownership/from-user-column-missing";
|
|
9
|
+
readonly summary: "from() with a user ref names the column explicitly.";
|
|
10
|
+
readonly fix: 'Pass a column, e.g. from("user:id", "assigneeId").';
|
|
11
|
+
};
|
|
12
|
+
readonly userRefUnsupported: {
|
|
13
|
+
readonly id: "ownership/from-user-ref-unsupported";
|
|
14
|
+
readonly summary: 'from() user refs are "user:id" or "user:tenantId".';
|
|
15
|
+
readonly fix: "Use one of the two supported user refs.";
|
|
16
|
+
};
|
|
17
|
+
readonly claimRefInvalid: {
|
|
18
|
+
readonly id: "ownership/from-claim-ref-invalid";
|
|
19
|
+
readonly summary: 'from() claim refs are "claim:<feature>:<shortName>".';
|
|
20
|
+
readonly fix: "Add the feature and short name to the ref.";
|
|
21
|
+
};
|
|
22
|
+
readonly prefixUnsupported: {
|
|
23
|
+
readonly id: "ownership/from-prefix-unsupported";
|
|
24
|
+
readonly summary: 'from() refs start with "user" or "claim".';
|
|
25
|
+
readonly fix: "Use a supported prefix.";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const DEFINITION_OWNERSHIP_FROM_RULES = {
|
|
2
|
+
refWithoutColon: {
|
|
3
|
+
id: "ownership/from-ref-without-colon",
|
|
4
|
+
summary: 'from() refs have the form "user:<field>" or "claim:<feature>:<key>".',
|
|
5
|
+
fix: "Add the prefix and colon to the ref.",
|
|
6
|
+
},
|
|
7
|
+
userColumnMissing: {
|
|
8
|
+
id: "ownership/from-user-column-missing",
|
|
9
|
+
summary: "from() with a user ref names the column explicitly.",
|
|
10
|
+
fix: 'Pass a column, e.g. from("user:id", "assigneeId").',
|
|
11
|
+
},
|
|
12
|
+
userRefUnsupported: {
|
|
13
|
+
id: "ownership/from-user-ref-unsupported",
|
|
14
|
+
summary: 'from() user refs are "user:id" or "user:tenantId".',
|
|
15
|
+
fix: "Use one of the two supported user refs.",
|
|
16
|
+
},
|
|
17
|
+
claimRefInvalid: {
|
|
18
|
+
id: "ownership/from-claim-ref-invalid",
|
|
19
|
+
summary: 'from() claim refs are "claim:<feature>:<shortName>".',
|
|
20
|
+
fix: "Add the feature and short name to the ref.",
|
|
21
|
+
},
|
|
22
|
+
prefixUnsupported: {
|
|
23
|
+
id: "ownership/from-prefix-unsupported",
|
|
24
|
+
summary: 'from() refs start with "user" or "claim".',
|
|
25
|
+
fix: "Use a supported prefix.",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const DEFINITION_PROBE_RULES: {
|
|
2
|
+
readonly nameEmpty: {
|
|
3
|
+
readonly id: "probe/name-empty";
|
|
4
|
+
readonly summary: "A probe name is a non-empty string.";
|
|
5
|
+
readonly fix: "Give the probe a name.";
|
|
6
|
+
};
|
|
7
|
+
readonly nameNotKebab: {
|
|
8
|
+
readonly id: "probe/name-not-kebab";
|
|
9
|
+
readonly summary: "Probe names are kebab-case.";
|
|
10
|
+
readonly fix: "Rename the probe to lowercase letters, digits and dashes.";
|
|
11
|
+
};
|
|
12
|
+
readonly scopeInvalid: {
|
|
13
|
+
readonly id: "probe/scope-invalid";
|
|
14
|
+
readonly summary: "Probe scope is tenant or system.";
|
|
15
|
+
readonly fix: "Set scope to a listed value.";
|
|
16
|
+
};
|
|
17
|
+
readonly costInvalid: {
|
|
18
|
+
readonly id: "probe/cost-invalid";
|
|
19
|
+
readonly summary: "Probe cost is free or paid.";
|
|
20
|
+
readonly fix: "Set cost to a listed value.";
|
|
21
|
+
};
|
|
22
|
+
readonly i18nKeyEmpty: {
|
|
23
|
+
readonly id: "probe/i18n-key-empty";
|
|
24
|
+
readonly summary: "Probe area and label are non-empty i18n keys.";
|
|
25
|
+
readonly fix: "Set area and label to i18n keys.";
|
|
26
|
+
};
|
|
27
|
+
readonly timeoutInvalid: {
|
|
28
|
+
readonly id: "probe/timeout-invalid";
|
|
29
|
+
readonly summary: "Probe timeoutMs is greater than zero.";
|
|
30
|
+
readonly fix: "Set timeoutMs above zero or omit it.";
|
|
31
|
+
};
|
|
32
|
+
readonly runNotFunction: {
|
|
33
|
+
readonly id: "probe/run-not-function";
|
|
34
|
+
readonly summary: "Probe run is a function.";
|
|
35
|
+
readonly fix: "Pass a run function.";
|
|
36
|
+
};
|
|
37
|
+
readonly targetsNotFunction: {
|
|
38
|
+
readonly id: "probe/targets-not-function";
|
|
39
|
+
readonly summary: "Probe targets is a function when set.";
|
|
40
|
+
readonly fix: "Pass a function or omit targets.";
|
|
41
|
+
};
|
|
42
|
+
readonly duplicate: {
|
|
43
|
+
readonly id: "probe/duplicate";
|
|
44
|
+
readonly summary: "Probe names are unique per feature.";
|
|
45
|
+
readonly fix: "Rename one of the probes.";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const DEFINITION_PROBE_RULES = {
|
|
2
|
+
nameEmpty: {
|
|
3
|
+
id: "probe/name-empty",
|
|
4
|
+
summary: "A probe name is a non-empty string.",
|
|
5
|
+
fix: "Give the probe a name.",
|
|
6
|
+
},
|
|
7
|
+
nameNotKebab: {
|
|
8
|
+
id: "probe/name-not-kebab",
|
|
9
|
+
summary: "Probe names are kebab-case.",
|
|
10
|
+
fix: "Rename the probe to lowercase letters, digits and dashes.",
|
|
11
|
+
},
|
|
12
|
+
scopeInvalid: {
|
|
13
|
+
id: "probe/scope-invalid",
|
|
14
|
+
summary: "Probe scope is tenant or system.",
|
|
15
|
+
fix: "Set scope to a listed value.",
|
|
16
|
+
},
|
|
17
|
+
costInvalid: {
|
|
18
|
+
id: "probe/cost-invalid",
|
|
19
|
+
summary: "Probe cost is free or paid.",
|
|
20
|
+
fix: "Set cost to a listed value.",
|
|
21
|
+
},
|
|
22
|
+
i18nKeyEmpty: {
|
|
23
|
+
id: "probe/i18n-key-empty",
|
|
24
|
+
summary: "Probe area and label are non-empty i18n keys.",
|
|
25
|
+
fix: "Set area and label to i18n keys.",
|
|
26
|
+
},
|
|
27
|
+
timeoutInvalid: {
|
|
28
|
+
id: "probe/timeout-invalid",
|
|
29
|
+
summary: "Probe timeoutMs is greater than zero.",
|
|
30
|
+
fix: "Set timeoutMs above zero or omit it.",
|
|
31
|
+
},
|
|
32
|
+
runNotFunction: {
|
|
33
|
+
id: "probe/run-not-function",
|
|
34
|
+
summary: "Probe run is a function.",
|
|
35
|
+
fix: "Pass a run function.",
|
|
36
|
+
},
|
|
37
|
+
targetsNotFunction: {
|
|
38
|
+
id: "probe/targets-not-function",
|
|
39
|
+
summary: "Probe targets is a function when set.",
|
|
40
|
+
fix: "Pass a function or omit targets.",
|
|
41
|
+
},
|
|
42
|
+
duplicate: {
|
|
43
|
+
id: "probe/duplicate",
|
|
44
|
+
summary: "Probe names are unique per feature.",
|
|
45
|
+
fix: "Rename one of the probes.",
|
|
46
|
+
},
|
|
47
|
+
};
|