@api-client/core 0.14.10 → 0.15.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.
Files changed (96) hide show
  1. package/RELEASE.md +163 -0
  2. package/RELEASE_SETUP.md +235 -0
  3. package/build/src/events/authorization/AuthorizationEvents.d.ts +1 -1
  4. package/build/src/events/authorization/AuthorizationEvents.d.ts.map +1 -1
  5. package/build/src/events/authorization/AuthorizationEvents.js +1 -1
  6. package/build/src/events/authorization/AuthorizationEvents.js.map +1 -1
  7. package/build/src/events/cookies/CookieEvents.d.ts +1 -1
  8. package/build/src/events/cookies/CookieEvents.d.ts.map +1 -1
  9. package/build/src/events/cookies/CookieEvents.js +1 -1
  10. package/build/src/events/cookies/CookieEvents.js.map +1 -1
  11. package/build/src/modeling/DomainImpactAnalysis.d.ts +22 -119
  12. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  13. package/build/src/modeling/DomainImpactAnalysis.js +49 -155
  14. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  15. package/build/src/modeling/DomainValidation.d.ts +8 -0
  16. package/build/src/modeling/DomainValidation.d.ts.map +1 -0
  17. package/build/src/modeling/DomainValidation.js +99 -0
  18. package/build/src/modeling/DomainValidation.js.map +1 -0
  19. package/build/src/modeling/types.d.ts +70 -0
  20. package/build/src/modeling/types.d.ts.map +1 -1
  21. package/build/src/modeling/types.js.map +1 -1
  22. package/build/src/modeling/validation/rules.d.ts +2 -3
  23. package/build/src/modeling/validation/rules.d.ts.map +1 -1
  24. package/build/src/modeling/validation/rules.js.map +1 -1
  25. package/build/src/modeling/validation/semantic_validation.d.ts +31 -0
  26. package/build/src/modeling/validation/semantic_validation.d.ts.map +1 -0
  27. package/build/src/modeling/validation/semantic_validation.js +126 -0
  28. package/build/src/modeling/validation/semantic_validation.js.map +1 -0
  29. package/build/tsconfig.tsbuildinfo +1 -1
  30. package/data/models/example-generator-api.json +6 -6
  31. package/noop.ts +3 -0
  32. package/package.json +9 -4
  33. package/src/events/authorization/AuthorizationEvents.ts +1 -1
  34. package/src/events/cookies/CookieEvents.ts +1 -1
  35. package/src/modeling/DomainImpactAnalysis.ts +54 -239
  36. package/src/modeling/DomainValidation.ts +105 -0
  37. package/src/modeling/types.ts +86 -0
  38. package/src/modeling/validation/rules.ts +2 -4
  39. package/src/modeling/validation/semantic_validation.ts +145 -0
  40. package/tests/unit/events/EventsTestHelpers.ts +16 -0
  41. package/tests/unit/events/amf.spec.ts +151 -0
  42. package/tests/unit/events/authorization.spec.ts +150 -0
  43. package/tests/unit/events/cookie.spec.ts +274 -0
  44. package/tests/unit/events/encryption.spec.ts +108 -0
  45. package/tests/unit/events/events_polyfills.ts +77 -0
  46. package/tests/unit/events/process.spec.ts +120 -0
  47. package/tests/unit/events/reporting.spec.ts +82 -0
  48. package/tests/unit/events/telemetry.spec.ts +224 -0
  49. package/tests/unit/events/transport.spec.ts +139 -0
  50. package/tests/unit/modeling/domain_impact_analysis.spec.ts +0 -110
  51. package/tests/unit/modeling/domain_validation.spec.ts +94 -0
  52. package/tests/unit/modeling/validation/semantic_validation.spec.ts +91 -0
  53. package/tests/unit/models/environment.spec.ts +574 -0
  54. package/tests/unit/models/error_response.spec.ts +183 -0
  55. package/tests/unit/models/headers_array.spec.ts +86 -0
  56. package/tests/unit/models/http-actions/assertion/equal_assertion.spec.ts +103 -0
  57. package/tests/unit/models/http-actions/assertion/greater_than_assertion.spec.ts +91 -0
  58. package/tests/unit/models/http-actions/assertion/includes_assertion.spec.ts +71 -0
  59. package/tests/unit/models/http-actions/assertion/less_than_assertion.spec.ts +91 -0
  60. package/tests/unit/models/http-actions/assertion/matches_assertion.spec.ts +71 -0
  61. package/tests/unit/models/http-actions/assertion/matches_schema_assertion.spec.ts +117 -0
  62. package/tests/unit/models/http-actions/assertion/not_equal_assertion.spec.ts +103 -0
  63. package/tests/unit/models/http-actions/assertion/not_includes_assertion.spec.ts +71 -0
  64. package/tests/unit/models/http-actions/assertion/not_ok_assertion.spec.ts +47 -0
  65. package/tests/unit/models/http-actions/assertion/not_to_be_assertion.spec.ts +72 -0
  66. package/tests/unit/models/http-actions/assertion/ok_assertion.spec.ts +44 -0
  67. package/tests/unit/models/http-actions/assertion/to_be_assertion.spec.ts +71 -0
  68. package/tests/unit/models/http-actions/transformation/as_lower_case_step.spec.ts +47 -0
  69. package/tests/unit/models/http-actions/transformation/as_number_step.spec.ts +47 -0
  70. package/tests/unit/models/http-actions/transformation/as_upper_case_step.spec.ts +47 -0
  71. package/tests/unit/models/http-actions/transformation/round_step.spec.ts +69 -0
  72. package/tests/unit/models/http-actions/transformation/substring_step.spec.ts +85 -0
  73. package/tests/unit/models/http-actions/transformation/trim_step.spec.ts +44 -0
  74. package/tests/unit/models/http_cookie.spec.ts +516 -0
  75. package/tests/unit/models/http_history.spec.ts +443 -0
  76. package/tests/unit/models/project_folder.spec.ts +926 -0
  77. package/tests/unit/models/project_item.spec.ts +137 -0
  78. package/tests/unit/models/project_request.spec.ts +1047 -0
  79. package/tests/unit/models/project_schema.spec.ts +236 -0
  80. package/tests/unit/models/property.spec.ts +625 -0
  81. package/tests/unit/models/provider.spec.ts +102 -0
  82. package/tests/unit/models/request.spec.ts +1206 -0
  83. package/tests/unit/models/request_log.spec.ts +308 -0
  84. package/tests/unit/models/request_time.spec.ts +138 -0
  85. package/tests/unit/models/response_redirect.spec.ts +303 -0
  86. package/tests/unit/models/sent_request.spec.ts +206 -0
  87. package/tests/unit/models/server.spec.ts +195 -0
  88. package/tests/unit/models/thing.spec.ts +154 -0
  89. package/build/oauth-popup.html +0 -33
  90. /package/tests/unit/models/{Certificate.spec.ts → certificate.spec.ts} +0 -0
  91. /package/tests/unit/models/{HostRule.spec.ts → host_rule.spec.ts} +0 -0
  92. /package/tests/unit/models/{HttpProject.spec.ts → http_project.spec.ts} +0 -0
  93. /package/tests/unit/models/{HttpRequest.spec.ts → http_request.spec.ts} +0 -0
  94. /package/tests/unit/models/{HttpResponse.spec.ts → http_response.spec.ts} +0 -0
  95. /package/tests/unit/models/{License.spec.ts → license.spec.ts} +0 -0
  96. /package/tests/unit/models/{Response.spec.ts → response.spec.ts} +0 -0
@@ -0,0 +1,99 @@
1
+ import { DataDomainKind } from '../models/kinds.js';
2
+ import { AssociationValidation } from './validation/association_validation.js';
3
+ import { EntityValidation } from './validation/entity_validation.js';
4
+ import { PropertyValidation } from './validation/property_validation.js';
5
+ import { SemanticValidation } from './validation/semantic_validation.js';
6
+ export class DomainValidation {
7
+ root;
8
+ constructor(root) {
9
+ this.root = root;
10
+ }
11
+ validate() {
12
+ const result = {
13
+ key: '',
14
+ kind: DataDomainKind,
15
+ impact: [],
16
+ canProceed: true,
17
+ };
18
+ const entityValidator = new EntityValidation(this.root);
19
+ const propertyValidator = new PropertyValidation(this.root);
20
+ const associationValidator = new AssociationValidation(this.root);
21
+ const semanticValidator = new SemanticValidation(this.root);
22
+ let hasEntities = false;
23
+ // Validate entities, properties, and associations
24
+ for (const entity of this.root.listEntities()) {
25
+ if (entity.domain.key !== this.root.key) {
26
+ // we don't need to validate foreign entities
27
+ continue;
28
+ }
29
+ hasEntities = true;
30
+ const report = entityValidator.validate(entity);
31
+ for (const item of report) {
32
+ const blocking = item.severity === 'error';
33
+ result.canProceed = result.canProceed && !blocking;
34
+ result.impact.push({
35
+ key: item.key,
36
+ kind: item.kind,
37
+ type: 'publish',
38
+ impact: item.message,
39
+ resolution: item.help,
40
+ severity: item.severity,
41
+ parent: item.parent,
42
+ });
43
+ }
44
+ for (const property of entity.properties) {
45
+ const report = propertyValidator.validate(property);
46
+ for (const item of report) {
47
+ const blocking = item.severity === 'error';
48
+ result.canProceed = result.canProceed && !blocking;
49
+ result.impact.push({
50
+ key: item.key,
51
+ kind: item.kind,
52
+ type: 'publish',
53
+ impact: item.message,
54
+ resolution: item.help,
55
+ severity: item.severity,
56
+ parent: item.parent,
57
+ });
58
+ }
59
+ }
60
+ for (const association of entity.associations) {
61
+ const report = associationValidator.validate(association);
62
+ for (const item of report) {
63
+ const blocking = item.severity === 'error';
64
+ result.canProceed = result.canProceed && !blocking;
65
+ result.impact.push({
66
+ key: item.key,
67
+ kind: item.kind,
68
+ type: 'publish',
69
+ impact: item.message,
70
+ resolution: item.help,
71
+ severity: item.severity,
72
+ parent: item.parent,
73
+ });
74
+ }
75
+ }
76
+ }
77
+ if (!hasEntities) {
78
+ // no entities, no need to validate anything else
79
+ return result;
80
+ }
81
+ // Validate semantics
82
+ const semanticReport = semanticValidator.validate();
83
+ for (const item of semanticReport) {
84
+ const blocking = item.severity === 'error';
85
+ result.canProceed = result.canProceed && !blocking;
86
+ result.impact.push({
87
+ key: item.key,
88
+ kind: item.kind,
89
+ type: 'publish',
90
+ impact: item.message,
91
+ resolution: item.help,
92
+ severity: item.severity,
93
+ parent: item.parent,
94
+ });
95
+ }
96
+ return result;
97
+ }
98
+ }
99
+ //# sourceMappingURL=DomainValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DomainValidation.js","sourceRoot":"","sources":["../../../src/modeling/DomainValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAExE,MAAM,OAAO,gBAAgB;IACnB,IAAI,CAAY;IAExB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,QAAQ;QACN,MAAM,MAAM,GAAuB;YACjC,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,IAAI;SACjB,CAAA;QACD,MAAM,eAAe,GAAG,IAAI,gBAAgB,CAAC,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AAI,CAAC,WAAW,EAAE,CAAC;YACjB,iDAAiD;YACjD,OAAO,MAAM,CAAA;QACf,CAAC;QACD,qBAAqB;QACrB,MAAM,cAAc,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAA;QACnD,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;YAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAA;YAC1C,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAA;YAClD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;gBACjB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,IAAI,CAAC,OAAO;gBACpB,UAAU,EAAE,IAAI,CAAC,IAAI;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { DataDomainKind } from '../models/kinds.js'\nimport { DataDomain } from './DataDomain.js'\nimport { DomainImpactReport } from './types.js'\nimport { AssociationValidation } from './validation/association_validation.js'\nimport { EntityValidation } from './validation/entity_validation.js'\nimport { PropertyValidation } from './validation/property_validation.js'\nimport { SemanticValidation } from './validation/semantic_validation.js'\n\nexport class DomainValidation {\n private root: DataDomain\n\n constructor(root: DataDomain) {\n this.root = root\n }\n\n validate(): DomainImpactReport {\n const result: DomainImpactReport = {\n key: '',\n kind: DataDomainKind,\n impact: [],\n canProceed: true,\n }\n const entityValidator = new EntityValidation(this.root)\n const propertyValidator = new PropertyValidation(this.root)\n const associationValidator = new AssociationValidation(this.root)\n const semanticValidator = new SemanticValidation(this.root)\n\n let hasEntities = false\n // Validate entities, properties, and associations\n for (const entity of this.root.listEntities()) {\n if (entity.domain.key !== this.root.key) {\n // we don't need to validate foreign entities\n continue\n }\n hasEntities = true\n const report = entityValidator.validate(entity)\n for (const item of report) {\n const blocking = item.severity === 'error'\n result.canProceed = result.canProceed && !blocking\n result.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n for (const property of entity.properties) {\n const report = propertyValidator.validate(property)\n for (const item of report) {\n const blocking = item.severity === 'error'\n result.canProceed = result.canProceed && !blocking\n result.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n }\n for (const association of entity.associations) {\n const report = associationValidator.validate(association)\n for (const item of report) {\n const blocking = item.severity === 'error'\n result.canProceed = result.canProceed && !blocking\n result.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n }\n }\n if (!hasEntities) {\n // no entities, no need to validate anything else\n return result\n }\n // Validate semantics\n const semanticReport = semanticValidator.validate()\n for (const item of semanticReport) {\n const blocking = item.severity === 'error'\n result.canProceed = result.canProceed && !blocking\n result.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n\n return result\n }\n}\n"]}
@@ -5,6 +5,7 @@ import type { DomainEntity } from './DomainEntity.js';
5
5
  import type { DomainModel } from './DomainModel.js';
6
6
  import type { DomainNamespace } from './DomainNamespace.js';
7
7
  import type { DomainProperty } from './DomainProperty.js';
8
+ import type { DomainNamespaceKind, DomainEntityKind, DomainModelKind, DomainPropertyKind, DomainAssociationKind, DataDomainKind } from '../models/kinds.js';
8
9
  export interface DataDomainRemoveOptions {
9
10
  /**
10
11
  * When true, the object will be forcibly removed.
@@ -668,5 +669,74 @@ export interface RateLimitRule {
668
669
  */
669
670
  burst: number;
670
671
  }
672
+ export type DomainImpactKinds = typeof DomainNamespaceKind | typeof DomainEntityKind | typeof DomainModelKind | typeof DomainPropertyKind | typeof DomainAssociationKind | typeof DataDomainKind;
673
+ /**
674
+ * The impact analysis report
675
+ */
676
+ export interface DomainImpactReport {
677
+ /**
678
+ * The key of the impacted data object.
679
+ * This is the key of the object that is being changed.
680
+ */
681
+ key: string;
682
+ /**
683
+ * The kind of the impacted data object.
684
+ * This is the kind of the object that is being changed.
685
+ */
686
+ kind: DomainImpactKinds;
687
+ /**
688
+ * The list of impacted data objects.
689
+ */
690
+ impact: DomainImpactItem[];
691
+ /**
692
+ * Whether it is possible to proceed with the change.
693
+ * If the change is not possible, the reason will be in the impact list.
694
+ */
695
+ canProceed: boolean;
696
+ }
697
+ export interface DomainImpactItem {
698
+ /**
699
+ * The key of the impacted data object.
700
+ */
701
+ key: string;
702
+ /**
703
+ * The kind of the impacted data object.
704
+ */
705
+ kind: string;
706
+ /**
707
+ * The type of the impact.
708
+ *
709
+ * - `delete` - The data object would be deleted.
710
+ */
711
+ type: 'delete' | 'publish';
712
+ /**
713
+ * The impact description.
714
+ * Explains what will happen to the impacted data object.
715
+ * This is a human-readable description of the impact.
716
+ * It should be clear and concise.
717
+ */
718
+ impact: string;
719
+ /**
720
+ * The severity of the impact.
721
+ *
722
+ * - `info` - The impact is informational.
723
+ * - `warning` - The impact can potentially cause problems but is not a blocker.
724
+ * - `error` - The impact is a blocker and needs to be resolved before proceeding.
725
+ */
726
+ severity: 'info' | 'warning' | 'error';
727
+ /**
728
+ * The type of the relationship between two impacted objects.
729
+ */
730
+ relationship?: 'child';
731
+ /**
732
+ * The resolution of the conflict if the change will be forced.
733
+ */
734
+ resolution?: string;
735
+ /**
736
+ * The optional parent of the impacted data object.
737
+ * For example, if the impacted item is a property, this will be the entity it belongs to.
738
+ */
739
+ parent?: string;
740
+ }
671
741
  export {};
672
742
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/mode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OAIG;IACH,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC1B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACtC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphJson } from '@api-client/graph/graph/types.js'\nimport type { Graph } from '@api-client/graph/graph/Graph.js'\nimport type { DomainAssociation } from './DomainAssociation.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { DomainModel } from './DomainModel.js'\nimport type { DomainNamespace } from './DomainNamespace.js'\nimport type { DomainProperty } from './DomainProperty.js'\n\nexport interface DataDomainRemoveOptions {\n /**\n * When true, the object will be forcibly removed.\n * The resolution defined in the `ImpactResolution` class will be applied.\n *\n * For example, when removing an entity that is a parent to another entity, it will\n * removed itself as a parent from the child entity.\n *\n * Note, this option should only be used when the DomainImpactAnalysis has been performed\n * and the user was informed of the impact.\n */\n force?: boolean\n}\n\nexport interface AssociationAddOptions {\n /**\n * When set, it is the the association target's origin data domain.\n * The key of the target data domain where this target entity is defined.\n * Only used when `key` is specified.\n */\n domain?: string\n /**\n * The key of the association target, if known.\n * If the target of the association is not specified, and the association has no other targets,\n * the association is ignored in the namespace while processing.\n */\n key?: string\n}\n\nexport interface DomainGraphEdge {\n /**\n * Indicates that the edge is to or from a foreign domain.\n */\n foreign?: boolean\n /**\n * The key of the foreign domain. Always set with the `foreign` property.\n */\n domain?: string\n /**\n * The type of the edge.\n * - `association` The edge is to an association object.\n * - When coming **from** an entiry (the `v` property), that entity owns the association.\n * - When coming **to** an entity (the `w` property), that entity is the target of the association.\n * An association can have multiple targets.\n * - `property` The edge is to a property object. Can only be created between an entity and a property.\n * - The **from** (`v`) is the entity.\n * - The **to** (`w`) is the property.\n * - `parent` The edge is to a parent object.\n * - The **from** (`v`) is the child entity.\n * - The **to** (`w`) is the parent entity.\n */\n type: 'association' | 'property' | 'parent'\n}\n\nexport type DomainGraphNodeType = DomainNamespace | DomainModel | DomainEntity | DomainProperty | DomainAssociation\n\n/**\n * An interface that describes the data domain dependency.\n */\nexport interface ForeignDomainDependency {\n /**\n * The system registered key of the foreign domain.\n */\n key: string\n /**\n * The version of the foreign domain used in this domain.\n */\n version: string\n}\n\nexport interface AssociationTarget {\n /**\n * The key of the target entity.\n */\n key: string\n /**\n * The key of the target data domain.\n * This is only set when the target is in a different data domain.\n */\n domain?: string\n}\n\n/**\n * Describes the default value set on a property schema.\n */\nexport interface SchemaDefaultValue {\n /**\n * The type of the default value.\n *\n * - `literal` The `value` should be used as-is.\n * - `function` The value represents the name of the function to be used.\n */\n type: 'literal' | 'function'\n /**\n * The actual value type depends on the `type`.\n * It is always a string and it has to be casted to the property's data type.\n */\n value: string\n}\n\n/**\n * A general schema definition for a property.\n * This is propagated to all bindings (when they support these properties).\n */\nexport interface PropertySchema {\n /**\n * The minimum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n minimum?: number\n /**\n * The maximum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n maximum?: number\n /**\n * When set, the minimum value is exclusive.\n *\n * - When `false`: value ≥ minimum.\n * - When `true`: value > minimum.\n */\n exclusiveMinimum?: boolean\n /**\n * When set, the exclusiveMaximum value is exclusive.\n *\n * - When `false`: value ≤ maximum.\n * - When `true`: value < minimum.\n */\n exclusiveMaximum?: boolean\n /**\n * The multiplier value for a number scalar.\n *\n * Examples:\n * - if `1` then every integer is allowed\n * - if `2` than every even number is allowed\n * - if `0.5` than every number dividable by `0.5` is allowed\n */\n multipleOf?: number\n /**\n * The enum values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n enum?: string[]\n /**\n * The default value for the property.\n * This is always encoded as a string. The actual type is defined in the `dataType` property.\n */\n defaultValue?: SchemaDefaultValue\n /**\n * The example values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n examples?: string[]\n}\n\n/**\n * The shortcut type for the data domain graph.\n */\nexport type DataDomainGraph = Graph<unknown, DomainGraphNodeType, DomainGraphEdge>\n/**\n * The serialized version of the data domain graph.\n */\nexport type SerializedGraph = GraphJson<unknown, object, DomainGraphEdge>\n\n/**\n * Represents a standardized, machine-readable error response body\n * as defined by RFC 7807 for HTTP APIs.\n */\nexport interface ProblemDetails {\n /**\n * A URI that identifies the specific problem type. Should resolve to human-readable docs.\n * e.g., \"https://docs.apinow.app/errors/validation-failed\"\n */\n type: string\n\n /**\n * A short, human-readable summary of the problem type.\n * e.g., \"Validation Error\"\n */\n title: string\n\n /**\n * The HTTP status code generated by the origin server for this problem.\n */\n status?: number\n\n /**\n * A human-readable explanation specific to this occurrence of the problem.\n */\n detail?: string\n\n /**\n * A URI that identifies the specific occurrence of the problem.\n * Can be the API request path that caused the error.\n */\n instance: string\n}\n\n/**\n * The set of supported filter operators for the List action.\n * These are used in query parameters, e.g., ?price[gte]=100\n *\n * - eq: Equal\n * - nq: Not Equal\n * - lt: Less Than\n * - lte: Less Than or Equal\n * - gt: Greater Than\n * - gte: Greater Than or Equal\n * - ex: Checks if the field exists\n * - re: Regular expression match\n * - bf: Date before a specific value\n * - af: Date after a specific value\n * - cn: String contains substring / Array contains element\n * - st: String starts with\n * - end: String ends with\n * - in: Value is one of the elements in the provided array\n * - nin: Value is not one of the elements in the provided array\n */\nexport type ResourceFilterOperator =\n | 'eq' // Equal\n | 'nq' // Not equal\n | 'lt' // Less than\n | 'lte' // Less than or equal\n | 'gt' // Greater than\n | 'gte' // Greater than or equal\n | 'ex' // Checks if the field exists\n | 're' // Regular expression match\n | 'bf' // Date before a specific value\n | 'af' // Date after a specific value\n | 'cn' // String contains substring / Array contains element\n | 'st' // String starts with\n | 'end' // String ends with\n | 'in' // Value is one of the elements in the provided array\n | 'nin' // Value is not one of the elements in the provided array\n\n/**\n * The session transport configuration interface.\n * This defines the properties that are common to all session transports.\n */\ninterface SessionTransport {\n /**\n * Whether the session transport is enabled.\n */\n enabled: boolean\n /**\n * The kind of session transport. Each interface defines its own kind.\n */\n kind: string\n}\n\n/**\n * Configuration for cookie-based session transport.\n */\nexport interface CookieConfiguration extends SessionTransport {\n kind: 'cookie'\n /**\n * The lifetime of the cookie session.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"24h\" for 24 hours.\n *\n * @default \"7d\"\n */\n lifetime: string\n /**\n * Whether the cookie can only be accessed by the server.\n * This is a security feature to prevent client-side scripts from accessing the cookie.\n * If set to false, the cookie can be accessed by client-side scripts.\n * @default true\n */\n httpOnly: boolean // Defaults to true\n /**\n * Whether the cookie should only be sent over secure connections (HTTPS).\n * This is a security feature to prevent the cookie from being sent over unencrypted connections.\n * @default true\n */\n secure: boolean\n /**\n * The SameSite attribute of the cookie.\n * This attribute controls whether the cookie is sent with cross-site requests.\n * - 'none' means the cookie is sent with cross-site requests.\n * - 'lax' means the cookie is sent with top-level navigations and will be sent along with GET\n * requests initiated by third-party websites.\n * @default 'none'\n */\n sameSite: 'none' | 'lax'\n /**\n * The name of the cookie.\n * This is the key under which the session data will be stored in the cookie.\n * @default 'as' - 'as' stands for \"api session\"\n */\n name: string\n}\n\n/**\n * Configuration for JWT-based session transport.\n */\nexport interface JwtConfiguration extends SessionTransport {\n kind: 'jwt'\n /**\n * The lifetime of the JWT token.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"15m\" for 15 minutes.\n *\n * @default \"7d\"\n */\n lifetime: string\n}\n\nexport interface SessionConfiguration {\n /**\n * The secret used to sign the JWT and cookies. Should be handled securely.\n * Not visible in the UI after being set.\n */\n secret: string\n /**\n * The properties from the `User` entity to be encoded into the session payload (JWT/cookie).\n * These properties become available in the `request.auth` object at runtime.\n *\n * In practice, these are the ids of the properties in the `User` entity.\n */\n properties: string[]\n /**\n * The cookie-based session transport configuration.\n */\n cookie?: CookieConfiguration\n\n /**\n * The JWT-based session transport configuration.\n */\n jwt?: JwtConfiguration\n}\n\n/**\n * Defines the authorization strategy for the API.\n * It is a base interface that can be extended for different strategies.\n * For MVP, we will start with Roles-Based Access Control (RBAC).\n */\nexport interface AuthorizationConfiguration {\n /**\n * The authorization strategy. For MVP, we will start with RBAC.\n * Post-MVP will include Permission-Based Access Control (PBAC).\n * The strategy determines how users are granted access to resources.\n *\n * - RBAC (Roles-Based Access Control): Users are assigned roles, and permissions are granted to those roles.\n * - PBAC (Permission-Based Access Control): Users are granted permissions directly, allowing for more\n * granular control.\n */\n strategy: string\n}\n\nexport interface RolesBasedAccessControl extends AuthorizationConfiguration {\n strategy: 'RBAC'\n /**\n * The property within the designated \"User\" entity that defines the user's role.\n * This field is used in access rules to grant permissions.\n *\n * This property must be marked with the \"Role\" data semantic in the Data Modeler.\n * It is required to publish the API.\n */\n roleKey: string\n}\n\n/**\n * Configures the strategy for authenticating end-users.\n * An API can only support one authentication strategy at a time.\n * This is a base interface that can be extended for different strategies.\n */\nexport interface AuthenticationConfiguration {\n /**\n * The authentication method. For MVP, this is focused on username/password.\n * This can be extended in the future to include 'SSO'.\n */\n strategy: string\n}\n\n/**\n * Configuration for username/password authentication.\n * This is the primary authentication method for the API (MVP).\n */\nexport interface UsernamePasswordConfiguration extends AuthenticationConfiguration {\n strategy: 'UsernamePassword'\n /**\n * The specific property within the User entity that holds the password.\n * This property must be marked with the \"Password\" data semantic in the Data Modeler.\n *\n * This property is required to publish the API.\n */\n passwordKey?: string\n}\n\n/**\n * Represents a Data Entity from the Data Domain that the API will expose and operate upon.\n */\nexport interface ExposedEntity {\n /**\n * The key of the Data Entity from the Data Domain.\n */\n key: string\n\n /**\n * Optional configuration for resource-wide rate limiting and throttling.\n * Defines rules to protect the resource from overuse.\n */\n rateLimiting?: RateLimitingConfiguration\n /**\n * Access control rules defining who can perform actions on this resource or collection.\n * It override the top-level access rules defined in the API model.\n */\n accessRule?: AccessRule[]\n\n /**\n * The collection of API actions (e.g., List, Read, Create) enabled for this entity.\n */\n actions: ApiAction[]\n}\n\n/**\n * Represents a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiAction = ListAction | ReadAction | CreateAction | UpdateAction | DeleteAction | SearchAction\n\n/**\n * A base interface for common properties across all actions.\n */\ninterface Action {\n /**\n * The specific kind of action (e.g., 'List', 'Read', etc.)\n */\n kind: string\n /**\n * Access control rules defining who can perform this action. It is only applied if the\n * authorization strategy is set to 'RBAC'.\n * If no rules grant access, it's denied by default making it essentially private.\n *\n * Note, the API can defined top level access rules that apply to all actions. If this property is set,\n * it overrides the top level access rules for this specific action.\n *\n * It is an ordered list, meaning the first rule that matches the user will be applied.\n * If multiple rules match, the first one in the list takes precedence.\n * If no rules match, the action is denied.\n */\n accessRule?: AccessRule[]\n /**\n * Optional configuration for action-wide rate limiting and throttling.\n * Defines rules to protect the action from overuse.\n */\n rateLimiting?: RateLimitingConfiguration\n}\n\n/**\n * Represents a pagination strategy for API actions that return collections of resources.\n * This is a base interface that can be extended for different pagination strategies.\n */\nexport interface PaginationStrategy {\n /**\n * The kind of pagination strategy. This is used to identify the specific pagination method.\n * For example, 'cursor' for cursor-based pagination or 'offset' for offset-based pagination.\n */\n kind: string\n /**\n * The default page size for the pagination strategy.\n * This is the number of items returned per page when no specific page size is requested.\n */\n pageSize?: number\n}\n\n/**\n * Represents the cursor-based pagination strategy.\n */\nexport interface CursorPaginationStrategy extends PaginationStrategy {\n kind: 'cursor'\n}\n\n/**\n * Represents the offset-based pagination strategy.\n */\nexport interface OffsetPaginationStrategy extends PaginationStrategy {\n kind: 'offset'\n}\n\n/**\n * Enables retrieving a collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport interface ListAction extends Action {\n kind: 'list'\n /**\n * The pagination strategy used for this action.\n * This defines how the results are paginated when retrieving a collection of resources.\n * It can be either 'cursor' or 'offset'.\n */\n pagination: PaginationStrategy\n /**\n * Fields from the entity that can be used for filtering.\n * Must be marked as \"indexable\" in the Data Model.\n */\n filterableFields: string[]\n /**\n * Fields from the entity that can be used for sorting.\n */\n sortableFields: string[]\n}\n\n/**\n * Enables retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport interface ReadAction extends Action {\n kind: 'read'\n // Association handling (Link IDs vs. Embed) is defined on the\n // data association itself in the Data Modeler.\n}\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport interface CreateAction extends Action {\n kind: 'create'\n}\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateAction extends Action {\n kind: 'update'\n /**\n * The allowed HTTP methods for updates. Default: PATCH only.\n *\n * These two methods represent the two common ways to update a resource:\n * - PUT: Replaces the entire resource with the provided data.\n * - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.\n */\n allowedMethods: ('PUT' | 'PATCH')[]\n}\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport interface DeleteAction extends Action {\n kind: 'delete'\n /**\n * The strategy for deletion. Default: Soft Delete.\n *\n * @default 'soft'\n */\n strategy?: 'soft' | 'hard'\n}\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchAction extends Action {\n kind: 'search'\n /**\n * The fields within the entity to be included in the search scope.\n * Must be \"indexable\" and typically text-based.\n */\n fields: string[]\n}\n\n/**\n * Defines the access control policy for a specific API action.\n * Based on the predefined rule types for session-based authentication.\n */\nexport type AccessRule =\n | AllowPublicAccessRule\n | AllowAuthenticatedAccessRule\n | MatchResourceOwnerAccessRule\n | MatchUserRoleAccessRule\n | MatchUserPropertyAccessRule\n | MatchEmailDomainAccessRule\n\nexport interface BaseAccessRule {\n /**\n * The unique identifier for the access rule.\n * This is used to reference the rule in the API configuration.\n */\n type: string\n}\n\n/**\n * The action is allowed for all users, including unauthenticated ones.\n * This is typically used for public APIs or resources that do not require authentication.\n * It is the most permissive rule and should be used with caution.\n */\nexport interface AllowPublicAccessRule extends BaseAccessRule {\n type: 'public'\n}\n/**\n * The action is allowed for any authenticated user.\n * This rule does not impose any additional restrictions based on user properties or resource ownership.\n * It is used for resources that should be accessible to all logged-in users.\n */\nexport interface AllowAuthenticatedAccessRule extends BaseAccessRule {\n type: 'authenticated'\n}\n/**\n * The action is allowed if the authenticated user's ID matches a specific property on the resource.\n * This is typically used to restrict access to resources owned by the user.\n * For example, a user can only access their own profile or documents.\n */\nexport interface MatchResourceOwnerAccessRule extends BaseAccessRule {\n type: 'resourceOwner'\n /**\n * The property on the resource that should match the authenticated user's ID.\n * This is typically the ID of the user who owns the resource.\n *\n * The domain model should annotate this property with the \"ResourceOwnerIdentifier\" semantic\n * to indicate that it is used for ownership checks.\n */\n property: string\n}\n\n/**\n * The action is allowed if the authenticated user has a specific role.\n * This is used to enforce role-based access control (RBAC).\n * For example, only users with the \"admin\" role can perform certain actions.\n */\nexport interface MatchUserRoleAccessRule extends BaseAccessRule {\n type: 'matchUserRole'\n /**\n * The role that the authenticated user must have to access the resource.\n * This is typically a property on the user entity that defines their role.\n *\n * The domain model should annotate this property with the \"UserRole\" semantic\n * to indicate that it is used for role-based access control.\n */\n role: string\n}\n/**\n * The action is allowed if a specific property on the authenticated user matches an expected value.\n * This is used to enforce other user-specific restrictions.\n */\nexport interface MatchUserPropertyAccessRule extends BaseAccessRule {\n type: 'matchUserProperty'\n /**\n * The property on the authenticated user that should match the expected value.\n */\n property: string\n /**\n * The expected value for the user property.\n */\n value: string\n}\n/**\n * The action is allowed if the authenticated user's email domain matches a specific domain.\n * This is used to restrict access based on the user's email address.\n * For example, only users with an email address from \"mycompany.com\" can access certain resources.\n */\nexport interface MatchEmailDomainAccessRule extends BaseAccessRule {\n type: 'matchEmailDomain'\n /**\n * The email domain that the authenticated user's email must match.\n */\n domain: string\n}\n\n/**\n * Defines the rate limiting and throttling policies for the entire API.\n */\nexport interface RateLimitingConfiguration {\n /**\n * An ordered list of rules. The first rule that matches an incoming\n * request will be applied.\n */\n rules: RateLimitRule[]\n}\n\n/**\n * Represents a single rate limiting rule that applies to a specific\n * type of client, using a token bucket algorithm.\n */\nexport interface RateLimitRule {\n /**\n * A human-readable description of what this rule is for.\n * e.g., \"Limit anonymous users to 60 requests per hour.\"\n */\n description?: string\n\n /**\n * Defines how to group requests for rate limiting. This determines\n * who the limit applies to.\n *\n * - 'ip': Keys on the client's IP address. Best for anonymous traffic.\n * - 'userId': Keys on the authenticated user's ID. Best for logged-in users.\n * - 'role': Applies a shared limit to all users of a specific role.\n */\n key: { type: 'ip' } | { type: 'userId' } | { type: 'role'; value: string }\n\n /**\n * The number of requests allowed over the defined interval.\n * This is the rate at which tokens are added to the bucket.\n */\n rate: number\n\n /**\n * The time interval for the rate.\n */\n interval: 'second' | 'minute' | 'hour' | 'day'\n\n /**\n * The maximum number of requests that can be made in a burst.\n * This represents the \"bucket size.\" A larger burst allows for\n * more requests to be made in a short period before throttling begins.\n */\n burst: number\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphJson } from '@api-client/graph/graph/types.js'\nimport type { Graph } from '@api-client/graph/graph/Graph.js'\nimport type { DomainAssociation } from './DomainAssociation.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { DomainModel } from './DomainModel.js'\nimport type { DomainNamespace } from './DomainNamespace.js'\nimport type { DomainProperty } from './DomainProperty.js'\nimport type {\n DomainNamespaceKind,\n DomainEntityKind,\n DomainModelKind,\n DomainPropertyKind,\n DomainAssociationKind,\n DataDomainKind,\n} from '../models/kinds.js'\n\nexport interface DataDomainRemoveOptions {\n /**\n * When true, the object will be forcibly removed.\n * The resolution defined in the `ImpactResolution` class will be applied.\n *\n * For example, when removing an entity that is a parent to another entity, it will\n * removed itself as a parent from the child entity.\n *\n * Note, this option should only be used when the DomainImpactAnalysis has been performed\n * and the user was informed of the impact.\n */\n force?: boolean\n}\n\nexport interface AssociationAddOptions {\n /**\n * When set, it is the the association target's origin data domain.\n * The key of the target data domain where this target entity is defined.\n * Only used when `key` is specified.\n */\n domain?: string\n /**\n * The key of the association target, if known.\n * If the target of the association is not specified, and the association has no other targets,\n * the association is ignored in the namespace while processing.\n */\n key?: string\n}\n\nexport interface DomainGraphEdge {\n /**\n * Indicates that the edge is to or from a foreign domain.\n */\n foreign?: boolean\n /**\n * The key of the foreign domain. Always set with the `foreign` property.\n */\n domain?: string\n /**\n * The type of the edge.\n * - `association` The edge is to an association object.\n * - When coming **from** an entiry (the `v` property), that entity owns the association.\n * - When coming **to** an entity (the `w` property), that entity is the target of the association.\n * An association can have multiple targets.\n * - `property` The edge is to a property object. Can only be created between an entity and a property.\n * - The **from** (`v`) is the entity.\n * - The **to** (`w`) is the property.\n * - `parent` The edge is to a parent object.\n * - The **from** (`v`) is the child entity.\n * - The **to** (`w`) is the parent entity.\n */\n type: 'association' | 'property' | 'parent'\n}\n\nexport type DomainGraphNodeType = DomainNamespace | DomainModel | DomainEntity | DomainProperty | DomainAssociation\n\n/**\n * An interface that describes the data domain dependency.\n */\nexport interface ForeignDomainDependency {\n /**\n * The system registered key of the foreign domain.\n */\n key: string\n /**\n * The version of the foreign domain used in this domain.\n */\n version: string\n}\n\nexport interface AssociationTarget {\n /**\n * The key of the target entity.\n */\n key: string\n /**\n * The key of the target data domain.\n * This is only set when the target is in a different data domain.\n */\n domain?: string\n}\n\n/**\n * Describes the default value set on a property schema.\n */\nexport interface SchemaDefaultValue {\n /**\n * The type of the default value.\n *\n * - `literal` The `value` should be used as-is.\n * - `function` The value represents the name of the function to be used.\n */\n type: 'literal' | 'function'\n /**\n * The actual value type depends on the `type`.\n * It is always a string and it has to be casted to the property's data type.\n */\n value: string\n}\n\n/**\n * A general schema definition for a property.\n * This is propagated to all bindings (when they support these properties).\n */\nexport interface PropertySchema {\n /**\n * The minimum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n minimum?: number\n /**\n * The maximum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n maximum?: number\n /**\n * When set, the minimum value is exclusive.\n *\n * - When `false`: value ≥ minimum.\n * - When `true`: value > minimum.\n */\n exclusiveMinimum?: boolean\n /**\n * When set, the exclusiveMaximum value is exclusive.\n *\n * - When `false`: value ≤ maximum.\n * - When `true`: value < minimum.\n */\n exclusiveMaximum?: boolean\n /**\n * The multiplier value for a number scalar.\n *\n * Examples:\n * - if `1` then every integer is allowed\n * - if `2` than every even number is allowed\n * - if `0.5` than every number dividable by `0.5` is allowed\n */\n multipleOf?: number\n /**\n * The enum values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n enum?: string[]\n /**\n * The default value for the property.\n * This is always encoded as a string. The actual type is defined in the `dataType` property.\n */\n defaultValue?: SchemaDefaultValue\n /**\n * The example values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n examples?: string[]\n}\n\n/**\n * The shortcut type for the data domain graph.\n */\nexport type DataDomainGraph = Graph<unknown, DomainGraphNodeType, DomainGraphEdge>\n/**\n * The serialized version of the data domain graph.\n */\nexport type SerializedGraph = GraphJson<unknown, object, DomainGraphEdge>\n\n/**\n * Represents a standardized, machine-readable error response body\n * as defined by RFC 7807 for HTTP APIs.\n */\nexport interface ProblemDetails {\n /**\n * A URI that identifies the specific problem type. Should resolve to human-readable docs.\n * e.g., \"https://docs.apinow.app/errors/validation-failed\"\n */\n type: string\n\n /**\n * A short, human-readable summary of the problem type.\n * e.g., \"Validation Error\"\n */\n title: string\n\n /**\n * The HTTP status code generated by the origin server for this problem.\n */\n status?: number\n\n /**\n * A human-readable explanation specific to this occurrence of the problem.\n */\n detail?: string\n\n /**\n * A URI that identifies the specific occurrence of the problem.\n * Can be the API request path that caused the error.\n */\n instance: string\n}\n\n/**\n * The set of supported filter operators for the List action.\n * These are used in query parameters, e.g., ?price[gte]=100\n *\n * - eq: Equal\n * - nq: Not Equal\n * - lt: Less Than\n * - lte: Less Than or Equal\n * - gt: Greater Than\n * - gte: Greater Than or Equal\n * - ex: Checks if the field exists\n * - re: Regular expression match\n * - bf: Date before a specific value\n * - af: Date after a specific value\n * - cn: String contains substring / Array contains element\n * - st: String starts with\n * - end: String ends with\n * - in: Value is one of the elements in the provided array\n * - nin: Value is not one of the elements in the provided array\n */\nexport type ResourceFilterOperator =\n | 'eq' // Equal\n | 'nq' // Not equal\n | 'lt' // Less than\n | 'lte' // Less than or equal\n | 'gt' // Greater than\n | 'gte' // Greater than or equal\n | 'ex' // Checks if the field exists\n | 're' // Regular expression match\n | 'bf' // Date before a specific value\n | 'af' // Date after a specific value\n | 'cn' // String contains substring / Array contains element\n | 'st' // String starts with\n | 'end' // String ends with\n | 'in' // Value is one of the elements in the provided array\n | 'nin' // Value is not one of the elements in the provided array\n\n/**\n * The session transport configuration interface.\n * This defines the properties that are common to all session transports.\n */\ninterface SessionTransport {\n /**\n * Whether the session transport is enabled.\n */\n enabled: boolean\n /**\n * The kind of session transport. Each interface defines its own kind.\n */\n kind: string\n}\n\n/**\n * Configuration for cookie-based session transport.\n */\nexport interface CookieConfiguration extends SessionTransport {\n kind: 'cookie'\n /**\n * The lifetime of the cookie session.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"24h\" for 24 hours.\n *\n * @default \"7d\"\n */\n lifetime: string\n /**\n * Whether the cookie can only be accessed by the server.\n * This is a security feature to prevent client-side scripts from accessing the cookie.\n * If set to false, the cookie can be accessed by client-side scripts.\n * @default true\n */\n httpOnly: boolean // Defaults to true\n /**\n * Whether the cookie should only be sent over secure connections (HTTPS).\n * This is a security feature to prevent the cookie from being sent over unencrypted connections.\n * @default true\n */\n secure: boolean\n /**\n * The SameSite attribute of the cookie.\n * This attribute controls whether the cookie is sent with cross-site requests.\n * - 'none' means the cookie is sent with cross-site requests.\n * - 'lax' means the cookie is sent with top-level navigations and will be sent along with GET\n * requests initiated by third-party websites.\n * @default 'none'\n */\n sameSite: 'none' | 'lax'\n /**\n * The name of the cookie.\n * This is the key under which the session data will be stored in the cookie.\n * @default 'as' - 'as' stands for \"api session\"\n */\n name: string\n}\n\n/**\n * Configuration for JWT-based session transport.\n */\nexport interface JwtConfiguration extends SessionTransport {\n kind: 'jwt'\n /**\n * The lifetime of the JWT token.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"15m\" for 15 minutes.\n *\n * @default \"7d\"\n */\n lifetime: string\n}\n\nexport interface SessionConfiguration {\n /**\n * The secret used to sign the JWT and cookies. Should be handled securely.\n * Not visible in the UI after being set.\n */\n secret: string\n /**\n * The properties from the `User` entity to be encoded into the session payload (JWT/cookie).\n * These properties become available in the `request.auth` object at runtime.\n *\n * In practice, these are the ids of the properties in the `User` entity.\n */\n properties: string[]\n /**\n * The cookie-based session transport configuration.\n */\n cookie?: CookieConfiguration\n\n /**\n * The JWT-based session transport configuration.\n */\n jwt?: JwtConfiguration\n}\n\n/**\n * Defines the authorization strategy for the API.\n * It is a base interface that can be extended for different strategies.\n * For MVP, we will start with Roles-Based Access Control (RBAC).\n */\nexport interface AuthorizationConfiguration {\n /**\n * The authorization strategy. For MVP, we will start with RBAC.\n * Post-MVP will include Permission-Based Access Control (PBAC).\n * The strategy determines how users are granted access to resources.\n *\n * - RBAC (Roles-Based Access Control): Users are assigned roles, and permissions are granted to those roles.\n * - PBAC (Permission-Based Access Control): Users are granted permissions directly, allowing for more\n * granular control.\n */\n strategy: string\n}\n\nexport interface RolesBasedAccessControl extends AuthorizationConfiguration {\n strategy: 'RBAC'\n /**\n * The property within the designated \"User\" entity that defines the user's role.\n * This field is used in access rules to grant permissions.\n *\n * This property must be marked with the \"Role\" data semantic in the Data Modeler.\n * It is required to publish the API.\n */\n roleKey: string\n}\n\n/**\n * Configures the strategy for authenticating end-users.\n * An API can only support one authentication strategy at a time.\n * This is a base interface that can be extended for different strategies.\n */\nexport interface AuthenticationConfiguration {\n /**\n * The authentication method. For MVP, this is focused on username/password.\n * This can be extended in the future to include 'SSO'.\n */\n strategy: string\n}\n\n/**\n * Configuration for username/password authentication.\n * This is the primary authentication method for the API (MVP).\n */\nexport interface UsernamePasswordConfiguration extends AuthenticationConfiguration {\n strategy: 'UsernamePassword'\n /**\n * The specific property within the User entity that holds the password.\n * This property must be marked with the \"Password\" data semantic in the Data Modeler.\n *\n * This property is required to publish the API.\n */\n passwordKey?: string\n}\n\n/**\n * Represents a Data Entity from the Data Domain that the API will expose and operate upon.\n */\nexport interface ExposedEntity {\n /**\n * The key of the Data Entity from the Data Domain.\n */\n key: string\n\n /**\n * Optional configuration for resource-wide rate limiting and throttling.\n * Defines rules to protect the resource from overuse.\n */\n rateLimiting?: RateLimitingConfiguration\n /**\n * Access control rules defining who can perform actions on this resource or collection.\n * It override the top-level access rules defined in the API model.\n */\n accessRule?: AccessRule[]\n\n /**\n * The collection of API actions (e.g., List, Read, Create) enabled for this entity.\n */\n actions: ApiAction[]\n}\n\n/**\n * Represents a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiAction = ListAction | ReadAction | CreateAction | UpdateAction | DeleteAction | SearchAction\n\n/**\n * A base interface for common properties across all actions.\n */\ninterface Action {\n /**\n * The specific kind of action (e.g., 'List', 'Read', etc.)\n */\n kind: string\n /**\n * Access control rules defining who can perform this action. It is only applied if the\n * authorization strategy is set to 'RBAC'.\n * If no rules grant access, it's denied by default making it essentially private.\n *\n * Note, the API can defined top level access rules that apply to all actions. If this property is set,\n * it overrides the top level access rules for this specific action.\n *\n * It is an ordered list, meaning the first rule that matches the user will be applied.\n * If multiple rules match, the first one in the list takes precedence.\n * If no rules match, the action is denied.\n */\n accessRule?: AccessRule[]\n /**\n * Optional configuration for action-wide rate limiting and throttling.\n * Defines rules to protect the action from overuse.\n */\n rateLimiting?: RateLimitingConfiguration\n}\n\n/**\n * Represents a pagination strategy for API actions that return collections of resources.\n * This is a base interface that can be extended for different pagination strategies.\n */\nexport interface PaginationStrategy {\n /**\n * The kind of pagination strategy. This is used to identify the specific pagination method.\n * For example, 'cursor' for cursor-based pagination or 'offset' for offset-based pagination.\n */\n kind: string\n /**\n * The default page size for the pagination strategy.\n * This is the number of items returned per page when no specific page size is requested.\n */\n pageSize?: number\n}\n\n/**\n * Represents the cursor-based pagination strategy.\n */\nexport interface CursorPaginationStrategy extends PaginationStrategy {\n kind: 'cursor'\n}\n\n/**\n * Represents the offset-based pagination strategy.\n */\nexport interface OffsetPaginationStrategy extends PaginationStrategy {\n kind: 'offset'\n}\n\n/**\n * Enables retrieving a collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport interface ListAction extends Action {\n kind: 'list'\n /**\n * The pagination strategy used for this action.\n * This defines how the results are paginated when retrieving a collection of resources.\n * It can be either 'cursor' or 'offset'.\n */\n pagination: PaginationStrategy\n /**\n * Fields from the entity that can be used for filtering.\n * Must be marked as \"indexable\" in the Data Model.\n */\n filterableFields: string[]\n /**\n * Fields from the entity that can be used for sorting.\n */\n sortableFields: string[]\n}\n\n/**\n * Enables retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport interface ReadAction extends Action {\n kind: 'read'\n // Association handling (Link IDs vs. Embed) is defined on the\n // data association itself in the Data Modeler.\n}\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport interface CreateAction extends Action {\n kind: 'create'\n}\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateAction extends Action {\n kind: 'update'\n /**\n * The allowed HTTP methods for updates. Default: PATCH only.\n *\n * These two methods represent the two common ways to update a resource:\n * - PUT: Replaces the entire resource with the provided data.\n * - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.\n */\n allowedMethods: ('PUT' | 'PATCH')[]\n}\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport interface DeleteAction extends Action {\n kind: 'delete'\n /**\n * The strategy for deletion. Default: Soft Delete.\n *\n * @default 'soft'\n */\n strategy?: 'soft' | 'hard'\n}\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchAction extends Action {\n kind: 'search'\n /**\n * The fields within the entity to be included in the search scope.\n * Must be \"indexable\" and typically text-based.\n */\n fields: string[]\n}\n\n/**\n * Defines the access control policy for a specific API action.\n * Based on the predefined rule types for session-based authentication.\n */\nexport type AccessRule =\n | AllowPublicAccessRule\n | AllowAuthenticatedAccessRule\n | MatchResourceOwnerAccessRule\n | MatchUserRoleAccessRule\n | MatchUserPropertyAccessRule\n | MatchEmailDomainAccessRule\n\nexport interface BaseAccessRule {\n /**\n * The unique identifier for the access rule.\n * This is used to reference the rule in the API configuration.\n */\n type: string\n}\n\n/**\n * The action is allowed for all users, including unauthenticated ones.\n * This is typically used for public APIs or resources that do not require authentication.\n * It is the most permissive rule and should be used with caution.\n */\nexport interface AllowPublicAccessRule extends BaseAccessRule {\n type: 'public'\n}\n/**\n * The action is allowed for any authenticated user.\n * This rule does not impose any additional restrictions based on user properties or resource ownership.\n * It is used for resources that should be accessible to all logged-in users.\n */\nexport interface AllowAuthenticatedAccessRule extends BaseAccessRule {\n type: 'authenticated'\n}\n/**\n * The action is allowed if the authenticated user's ID matches a specific property on the resource.\n * This is typically used to restrict access to resources owned by the user.\n * For example, a user can only access their own profile or documents.\n */\nexport interface MatchResourceOwnerAccessRule extends BaseAccessRule {\n type: 'resourceOwner'\n /**\n * The property on the resource that should match the authenticated user's ID.\n * This is typically the ID of the user who owns the resource.\n *\n * The domain model should annotate this property with the \"ResourceOwnerIdentifier\" semantic\n * to indicate that it is used for ownership checks.\n */\n property: string\n}\n\n/**\n * The action is allowed if the authenticated user has a specific role.\n * This is used to enforce role-based access control (RBAC).\n * For example, only users with the \"admin\" role can perform certain actions.\n */\nexport interface MatchUserRoleAccessRule extends BaseAccessRule {\n type: 'matchUserRole'\n /**\n * The role that the authenticated user must have to access the resource.\n * This is typically a property on the user entity that defines their role.\n *\n * The domain model should annotate this property with the \"UserRole\" semantic\n * to indicate that it is used for role-based access control.\n */\n role: string\n}\n/**\n * The action is allowed if a specific property on the authenticated user matches an expected value.\n * This is used to enforce other user-specific restrictions.\n */\nexport interface MatchUserPropertyAccessRule extends BaseAccessRule {\n type: 'matchUserProperty'\n /**\n * The property on the authenticated user that should match the expected value.\n */\n property: string\n /**\n * The expected value for the user property.\n */\n value: string\n}\n/**\n * The action is allowed if the authenticated user's email domain matches a specific domain.\n * This is used to restrict access based on the user's email address.\n * For example, only users with an email address from \"mycompany.com\" can access certain resources.\n */\nexport interface MatchEmailDomainAccessRule extends BaseAccessRule {\n type: 'matchEmailDomain'\n /**\n * The email domain that the authenticated user's email must match.\n */\n domain: string\n}\n\n/**\n * Defines the rate limiting and throttling policies for the entire API.\n */\nexport interface RateLimitingConfiguration {\n /**\n * An ordered list of rules. The first rule that matches an incoming\n * request will be applied.\n */\n rules: RateLimitRule[]\n}\n\n/**\n * Represents a single rate limiting rule that applies to a specific\n * type of client, using a token bucket algorithm.\n */\nexport interface RateLimitRule {\n /**\n * A human-readable description of what this rule is for.\n * e.g., \"Limit anonymous users to 60 requests per hour.\"\n */\n description?: string\n\n /**\n * Defines how to group requests for rate limiting. This determines\n * who the limit applies to.\n *\n * - 'ip': Keys on the client's IP address. Best for anonymous traffic.\n * - 'userId': Keys on the authenticated user's ID. Best for logged-in users.\n * - 'role': Applies a shared limit to all users of a specific role.\n */\n key: { type: 'ip' } | { type: 'userId' } | { type: 'role'; value: string }\n\n /**\n * The number of requests allowed over the defined interval.\n * This is the rate at which tokens are added to the bucket.\n */\n rate: number\n\n /**\n * The time interval for the rate.\n */\n interval: 'second' | 'minute' | 'hour' | 'day'\n\n /**\n * The maximum number of requests that can be made in a burst.\n * This represents the \"bucket size.\" A larger burst allows for\n * more requests to be made in a short period before throttling begins.\n */\n burst: number\n}\n\nexport type DomainImpactKinds =\n | typeof DomainNamespaceKind\n | typeof DomainEntityKind\n | typeof DomainModelKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n | typeof DataDomainKind\n\n/**\n * The impact analysis report\n */\nexport interface DomainImpactReport {\n /**\n * The key of the impacted data object.\n * This is the key of the object that is being changed.\n */\n key: string\n /**\n * The kind of the impacted data object.\n * This is the kind of the object that is being changed.\n */\n kind: DomainImpactKinds\n /**\n * The list of impacted data objects.\n */\n impact: DomainImpactItem[]\n /**\n * Whether it is possible to proceed with the change.\n * If the change is not possible, the reason will be in the impact list.\n */\n canProceed: boolean\n}\n\nexport interface DomainImpactItem {\n /**\n * The key of the impacted data object.\n */\n key: string\n /**\n * The kind of the impacted data object.\n */\n kind: string\n /**\n * The type of the impact.\n *\n * - `delete` - The data object would be deleted.\n */\n type: 'delete' | 'publish'\n /**\n * The impact description.\n * Explains what will happen to the impacted data object.\n * This is a human-readable description of the impact.\n * It should be clear and concise.\n */\n impact: string\n /**\n * The severity of the impact.\n *\n * - `info` - The impact is informational.\n * - `warning` - The impact can potentially cause problems but is not a blocker.\n * - `error` - The impact is a blocker and needs to be resolved before proceeding.\n */\n severity: 'info' | 'warning' | 'error'\n /**\n * The type of the relationship between two impacted objects.\n */\n relationship?: 'child'\n /**\n * The resolution of the conflict if the change will be forced.\n */\n resolution?: string\n /**\n * The optional parent of the impacted data object.\n * For example, if the impacted item is a property, this will be the entity it belongs to.\n */\n parent?: string\n}\n"]}
@@ -1,15 +1,14 @@
1
1
  import type { DomainProperty } from '../DomainProperty.js';
2
2
  import type { DomainAssociation } from '../DomainAssociation.js';
3
- import type { DomainImpactItem } from '../DomainImpactAnalysis.js';
3
+ import type { DomainImpactItem } from '../types.js';
4
4
  /**
5
5
  * `DomainImpactItem` mapping:
6
6
  * - `impact` -> `message`
7
7
  * - `resolution` -> `help`
8
8
  * - `type` -> unused
9
- * - `blocking` -> unused (deprecated)
10
9
  * - `relationship` -> unused
11
10
  */
12
- export interface DomainValidation extends Omit<DomainImpactItem, 'type' | 'impact' | 'blocking' | 'relationship' | 'resolution'> {
11
+ export interface DomainValidation extends Omit<DomainImpactItem, 'type' | 'impact' | 'relationship' | 'resolution'> {
13
12
  /**
14
13
  * The field that did not pass validation.
15
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../src/modeling/validation/rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAIlE;;;;;;;GAOG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IAC9F;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,EAAE,CA4FrG"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../src/modeling/validation/rules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAInD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,GAAG,cAAc,GAAG,YAAY,CAAC;IACjH;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,EAAE,CA4FrG"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/modeling/validation/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAKlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAwC1D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAA4C;IAC/E,MAAM,OAAO,GAAuB,EAAE,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;IACtC,MAAM,YAAY,GAAG,QAAQ,CAAC,iBAAiB,EAAkB,CAAA;IACjE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,CA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AAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,UAAU;YAChB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { ReservedKeywords } from './postgresql.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainImpactItem } from '../DomainImpactAnalysis.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { DomainPropertyKind } from '../../models/kinds.js'\n\n/**\n * `DomainImpactItem` mapping:\n * - `impact` -> `message`\n * - `resolution` -> `help`\n * - `type` -> unused\n * - `blocking` -> unused (deprecated)\n * - `relationship` -> unused\n */\nexport interface DomainValidation\n extends Omit<DomainImpactItem, 'type' | 'impact' | 'blocking' | 'relationship' | 'resolution'> {\n /**\n * The field that did not pass validation.\n */\n field: string\n /**\n * The name of the rule that was violated.\n */\n rule: string\n /**\n * Optional help message that can be used to provide\n * more information about the error.\n */\n help?: string\n /**\n * Optional URL that can be used to provide more information\n * about the error.\n */\n url?: string\n /**\n * The validation error message.\n * This message should be user-friendly and should not\n * contain any technical details.\n * It should be used to display the error to the user.\n * It should be short and concise.\n */\n message: string\n}\n\n/**\n * Validates the property name. This includes associations.\n *\n * @remarks\n * - A property must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).\n * - The name must start with a letter (a-z, A-Z) or an underscore (_).\n * - PostgreSQL limits column names to a maximum of 59 characters.\n * - (our rule) Column names are case insensitive.\n * - (recommendation) Column names should be in lower case.\n *\n * @param property The property to validate\n */\nexport function validatePropertyName(property: DomainProperty | DomainAssociation): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = property.info.getLabel()\n const parentEntity = property.getParentInstance() as DomainEntity\n const type = property.kind === DomainPropertyKind ? 'property' : 'association'\n if (!property.info.name) {\n const message = `The \"${label}\" ${type} has no name.`\n const help = `The ${type} must have a name.`\n results.push({\n field: 'name',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n return results\n }\n const name = property.info.name\n if (name.length < 2) {\n const message = `The \"${label}\" ${type} name is too short.`\n const help = `The name must be at least 2 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (name.length > 59) {\n const message = `The \"${label}\" ${type} name is too long.`\n const help = `The name must be at most 59 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {\n const message = `The \"${label}\" ${type} name is invalid.`\n const help = `The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).`\n results.push({\n field: 'name',\n rule: 'format',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (/^[A-Z]/.test(name)) {\n const message = `The \"${label}\" ${type} name is not in snake case.`\n const help = `The name should be in snake case (lowercase letters and underscores).`\n results.push({\n field: 'name',\n rule: 'snake_case',\n message,\n help,\n severity: 'info',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (ReservedKeywords.has(name.toUpperCase())) {\n const message = `The \"${label}\" ${type} name is a reserved keyword.`\n const help = `The name should not be a reserved keyword.`\n results.push({\n field: 'name',\n rule: 'reserved',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n return results\n}\n"]}
1
+ {"version":3,"file":"rules.js","sourceRoot":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A;QACpF,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,YAAY;YAClB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,MAAM;YAChB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;IACJ,CAAC;IACD,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,QAAQ,KAAK,KAAK,IAAI,8BAA8B,CAAA;QACpE,MAAM,IAAI,GAAG,4CAA4C,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,UAAU;YAChB,OAAO;YACP,IAAI;YACJ,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,YAAY,CAAC,GAAG;SACzB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import { ReservedKeywords } from './postgresql.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainImpactItem } from '../types.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { DomainPropertyKind } from '../../models/kinds.js'\n\n/**\n * `DomainImpactItem` mapping:\n * - `impact` -> `message`\n * - `resolution` -> `help`\n * - `type` -> unused\n * - `relationship` -> unused\n */\nexport interface DomainValidation extends Omit<DomainImpactItem, 'type' | 'impact' | 'relationship' | 'resolution'> {\n /**\n * The field that did not pass validation.\n */\n field: string\n /**\n * The name of the rule that was violated.\n */\n rule: string\n /**\n * Optional help message that can be used to provide\n * more information about the error.\n */\n help?: string\n /**\n * Optional URL that can be used to provide more information\n * about the error.\n */\n url?: string\n /**\n * The validation error message.\n * This message should be user-friendly and should not\n * contain any technical details.\n * It should be used to display the error to the user.\n * It should be short and concise.\n */\n message: string\n}\n\n/**\n * Validates the property name. This includes associations.\n *\n * @remarks\n * - A property must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).\n * - The name must start with a letter (a-z, A-Z) or an underscore (_).\n * - PostgreSQL limits column names to a maximum of 59 characters.\n * - (our rule) Column names are case insensitive.\n * - (recommendation) Column names should be in lower case.\n *\n * @param property The property to validate\n */\nexport function validatePropertyName(property: DomainProperty | DomainAssociation): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = property.info.getLabel()\n const parentEntity = property.getParentInstance() as DomainEntity\n const type = property.kind === DomainPropertyKind ? 'property' : 'association'\n if (!property.info.name) {\n const message = `The \"${label}\" ${type} has no name.`\n const help = `The ${type} must have a name.`\n results.push({\n field: 'name',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n return results\n }\n const name = property.info.name\n if (name.length < 2) {\n const message = `The \"${label}\" ${type} name is too short.`\n const help = `The name must be at least 2 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (name.length > 59) {\n const message = `The \"${label}\" ${type} name is too long.`\n const help = `The name must be at most 59 characters long.`\n results.push({\n field: 'name',\n rule: 'length',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {\n const message = `The \"${label}\" ${type} name is invalid.`\n const help = `The name must start with a letter (a-z) or underscore (_). Subsequent characters can be letters, digits (0-9), or underscores (_).`\n results.push({\n field: 'name',\n rule: 'format',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (/^[A-Z]/.test(name)) {\n const message = `The \"${label}\" ${type} name is not in snake case.`\n const help = `The name should be in snake case (lowercase letters and underscores).`\n results.push({\n field: 'name',\n rule: 'snake_case',\n message,\n help,\n severity: 'info',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n if (ReservedKeywords.has(name.toUpperCase())) {\n const message = `The \"${label}\" ${type} name is a reserved keyword.`\n const help = `The name should not be a reserved keyword.`\n results.push({\n field: 'name',\n rule: 'reserved',\n message,\n help,\n severity: 'error',\n key: property.key,\n kind: property.kind,\n parent: parentEntity.key,\n })\n }\n return results\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import type { DataDomain } from '../DataDomain.js';
2
+ import type { DomainValidation } from './rules.js';
3
+ /**
4
+ * SemanticValidation is a class that performs validation on semantics in a data domain.
5
+ * It checks for required and recommended semantics in entities, properties, and associations.
6
+ */
7
+ export declare class SemanticValidation {
8
+ protected domain: DataDomain;
9
+ constructor(domain: DataDomain);
10
+ /**
11
+ * Performs all the semantic validation rules on the domain.
12
+ * @returns The list of validation messages.
13
+ */
14
+ validate(): DomainValidation[];
15
+ /**
16
+ * Validates if there is at least one entity with the User semantic.
17
+ * This is a recommended semantic for authentication purposes.
18
+ */
19
+ private validateUserEntity;
20
+ /**
21
+ * Validates if entities have the recommended timestamp semantics.
22
+ * This includes CreatedTimestamp and UpdatedTimestamp.
23
+ */
24
+ private validateTimestampSemantics;
25
+ /**
26
+ * Validates if entities have the recommended soft delete semantics.
27
+ * This includes either DeletedTimestamp or DeletedFlag.
28
+ */
29
+ private validateSoftDeleteSemantics;
30
+ }
31
+ //# sourceMappingURL=semantic_validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic_validation.d.ts","sourceRoot":"","sources":["../../../../src/modeling/validation/semantic_validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;GAGG;AACH,qBAAa,kBAAkB;IACjB,SAAS,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;IAExC;;;OAGG;IACH,QAAQ,IAAI,gBAAgB,EAAE;IAkB9B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IA0B1B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IA4ClC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;CA4BpC"}
@@ -0,0 +1,126 @@
1
+ import { DomainEntityKind } from '../../models/kinds.js';
2
+ import { SemanticType } from '../Semantics.js';
3
+ /**
4
+ * SemanticValidation is a class that performs validation on semantics in a data domain.
5
+ * It checks for required and recommended semantics in entities, properties, and associations.
6
+ */
7
+ export class SemanticValidation {
8
+ domain;
9
+ constructor(domain) {
10
+ this.domain = domain;
11
+ }
12
+ /**
13
+ * Performs all the semantic validation rules on the domain.
14
+ * @returns The list of validation messages.
15
+ */
16
+ validate() {
17
+ const results = [];
18
+ // Check for User entity semantic
19
+ const hasUserEntity = this.validateUserEntity();
20
+ results.push(...hasUserEntity);
21
+ // Check for timestamp semantics
22
+ const timestampSemantics = this.validateTimestampSemantics();
23
+ results.push(...timestampSemantics);
24
+ // Check for soft delete semantics
25
+ const softDeleteSemantics = this.validateSoftDeleteSemantics();
26
+ results.push(...softDeleteSemantics);
27
+ return results;
28
+ }
29
+ /**
30
+ * Validates if there is at least one entity with the User semantic.
31
+ * This is a recommended semantic for authentication purposes.
32
+ */
33
+ validateUserEntity() {
34
+ const results = [];
35
+ let hasUserEntity = false;
36
+ for (const entity of this.domain.listEntities()) {
37
+ if (entity.hasSemantic(SemanticType.User)) {
38
+ hasUserEntity = true;
39
+ break;
40
+ }
41
+ }
42
+ if (!hasUserEntity) {
43
+ results.push({
44
+ field: 'semantics',
45
+ rule: 'recommended',
46
+ message: 'No entity with User taxonomy found in the domain.',
47
+ help: 'It is recommended to have at least one entity with the User taxonomy for authentication purposes.',
48
+ severity: 'warning',
49
+ key: 'user_semantic',
50
+ kind: DomainEntityKind,
51
+ });
52
+ }
53
+ return results;
54
+ }
55
+ /**
56
+ * Validates if entities have the recommended timestamp semantics.
57
+ * This includes CreatedTimestamp and UpdatedTimestamp.
58
+ */
59
+ validateTimestampSemantics() {
60
+ const results = [];
61
+ for (const entity of this.domain.listEntities()) {
62
+ let hasCreatedTimestamp = false;
63
+ let hasUpdatedTimestamp = false;
64
+ for (const property of entity.listProperties()) {
65
+ if (property.hasSemantic(SemanticType.CreatedTimestamp)) {
66
+ hasCreatedTimestamp = true;
67
+ }
68
+ if (property.hasSemantic(SemanticType.UpdatedTimestamp)) {
69
+ hasUpdatedTimestamp = true;
70
+ }
71
+ }
72
+ if (!hasCreatedTimestamp) {
73
+ results.push({
74
+ field: 'semantics',
75
+ rule: 'recommended',
76
+ message: `The "${entity.info.getLabel()}" entity does not have a CreatedTimestamp taxonomy.`,
77
+ help: 'It is recommended to have a CreatedTimestamp property to track when the entity was created.',
78
+ severity: 'info',
79
+ key: entity.key,
80
+ kind: entity.kind,
81
+ });
82
+ }
83
+ if (!hasUpdatedTimestamp) {
84
+ results.push({
85
+ field: 'semantics',
86
+ rule: 'recommended',
87
+ message: `The "${entity.info.getLabel()}" entity does not have an UpdatedTimestamp taxonomy.`,
88
+ help: 'It is recommended to have an UpdatedTimestamp property to track when the entity was last modified.',
89
+ severity: 'info',
90
+ key: entity.key,
91
+ kind: entity.kind,
92
+ });
93
+ }
94
+ }
95
+ return results;
96
+ }
97
+ /**
98
+ * Validates if entities have the recommended soft delete semantics.
99
+ * This includes either DeletedTimestamp or DeletedFlag.
100
+ */
101
+ validateSoftDeleteSemantics() {
102
+ const results = [];
103
+ for (const entity of this.domain.listEntities()) {
104
+ let hasSoftDelete = false;
105
+ for (const property of entity.listProperties()) {
106
+ if (property.hasSemantic(SemanticType.DeletedTimestamp) || property.hasSemantic(SemanticType.DeletedFlag)) {
107
+ hasSoftDelete = true;
108
+ break;
109
+ }
110
+ }
111
+ if (!hasSoftDelete) {
112
+ results.push({
113
+ field: 'semantics',
114
+ rule: 'recommended',
115
+ message: `The "${entity.info.getLabel()}" entity does not have soft delete taxonomy.`,
116
+ help: 'It is recommended to have either a DeletedTimestamp or DeletedFlag property for soft deletion.',
117
+ severity: 'info',
118
+ key: entity.key,
119
+ kind: entity.kind,
120
+ });
121
+ }
122
+ }
123
+ return results;
124
+ }
125
+ }
126
+ //# sourceMappingURL=semantic_validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic_validation.js","sourceRoot":"","sources":["../../../../src/modeling/validation/semantic_validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAG9C;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACP;IAAtB,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE5C;;;OAGG;IACH,QAAQ;QACN,MAAM,OAAO,GAAuB,EAAE,CAAA;QAEtC,iCAAiC;QACjC,MAAM,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAA;QAC/C,OAAO,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAA;QAE9B,gCAAgC;QAChC,MAAM,kBAAkB,GAAG,IAAI,CAAC,0BAA0B,EAAE,CAAA;QAC5D,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAA;QAEnC,kCAAkC;QAClC,MAAM,mBAAmB,GAAG,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAC9D,OAAO,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAA;QAEpC,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;OAGG;IACK,kBAAkB;QACxB,MAAM,OAAO,GAAuB,EAAE,CAAA;QACtC,IAAI,aAAa,GAAG,KAAK,CAAA;QAEzB,KAAK,MAAM,MAA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E,gGAAgG;oBACtG,QAAQ,EAAE,MAAM;oBAChB,GAAG,EAAE,MAAM,CAAC,GAAG;oBACf,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF","sourcesContent":["import { DomainEntityKind } from '../../models/kinds.js'\nimport type { DataDomain } from '../DataDomain.js'\nimport { SemanticType } from '../Semantics.js'\nimport type { DomainValidation } from './rules.js'\n\n/**\n * SemanticValidation is a class that performs validation on semantics in a data domain.\n * It checks for required and recommended semantics in entities, properties, and associations.\n */\nexport class SemanticValidation {\n constructor(protected domain: DataDomain) {}\n\n /**\n * Performs all the semantic validation rules on the domain.\n * @returns The list of validation messages.\n */\n validate(): DomainValidation[] {\n const results: DomainValidation[] = []\n\n // Check for User entity semantic\n const hasUserEntity = this.validateUserEntity()\n results.push(...hasUserEntity)\n\n // Check for timestamp semantics\n const timestampSemantics = this.validateTimestampSemantics()\n results.push(...timestampSemantics)\n\n // Check for soft delete semantics\n const softDeleteSemantics = this.validateSoftDeleteSemantics()\n results.push(...softDeleteSemantics)\n\n return results\n }\n\n /**\n * Validates if there is at least one entity with the User semantic.\n * This is a recommended semantic for authentication purposes.\n */\n private validateUserEntity(): DomainValidation[] {\n const results: DomainValidation[] = []\n let hasUserEntity = false\n\n for (const entity of this.domain.listEntities()) {\n if (entity.hasSemantic(SemanticType.User)) {\n hasUserEntity = true\n break\n }\n }\n\n if (!hasUserEntity) {\n results.push({\n field: 'semantics',\n rule: 'recommended',\n message: 'No entity with User taxonomy found in the domain.',\n help: 'It is recommended to have at least one entity with the User taxonomy for authentication purposes.',\n severity: 'warning',\n key: 'user_semantic',\n kind: DomainEntityKind,\n })\n }\n\n return results\n }\n\n /**\n * Validates if entities have the recommended timestamp semantics.\n * This includes CreatedTimestamp and UpdatedTimestamp.\n */\n private validateTimestampSemantics(): DomainValidation[] {\n const results: DomainValidation[] = []\n\n for (const entity of this.domain.listEntities()) {\n let hasCreatedTimestamp = false\n let hasUpdatedTimestamp = false\n\n for (const property of entity.listProperties()) {\n if (property.hasSemantic(SemanticType.CreatedTimestamp)) {\n hasCreatedTimestamp = true\n }\n if (property.hasSemantic(SemanticType.UpdatedTimestamp)) {\n hasUpdatedTimestamp = true\n }\n }\n\n if (!hasCreatedTimestamp) {\n results.push({\n field: 'semantics',\n rule: 'recommended',\n message: `The \"${entity.info.getLabel()}\" entity does not have a CreatedTimestamp taxonomy.`,\n help: 'It is recommended to have a CreatedTimestamp property to track when the entity was created.',\n severity: 'info',\n key: entity.key,\n kind: entity.kind,\n })\n }\n\n if (!hasUpdatedTimestamp) {\n results.push({\n field: 'semantics',\n rule: 'recommended',\n message: `The \"${entity.info.getLabel()}\" entity does not have an UpdatedTimestamp taxonomy.`,\n help: 'It is recommended to have an UpdatedTimestamp property to track when the entity was last modified.',\n severity: 'info',\n key: entity.key,\n kind: entity.kind,\n })\n }\n }\n\n return results\n }\n\n /**\n * Validates if entities have the recommended soft delete semantics.\n * This includes either DeletedTimestamp or DeletedFlag.\n */\n private validateSoftDeleteSemantics(): DomainValidation[] {\n const results: DomainValidation[] = []\n\n for (const entity of this.domain.listEntities()) {\n let hasSoftDelete = false\n\n for (const property of entity.listProperties()) {\n if (property.hasSemantic(SemanticType.DeletedTimestamp) || property.hasSemantic(SemanticType.DeletedFlag)) {\n hasSoftDelete = true\n break\n }\n }\n\n if (!hasSoftDelete) {\n results.push({\n field: 'semantics',\n rule: 'recommended',\n message: `The \"${entity.info.getLabel()}\" entity does not have soft delete taxonomy.`,\n help: 'It is recommended to have either a DeletedTimestamp or DeletedFlag property for soft deletion.',\n severity: 'info',\n key: entity.key,\n kind: entity.kind,\n })\n }\n }\n\n return results\n }\n}\n"]}