@api-client/core 0.19.9 → 0.19.10

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 (98) hide show
  1. package/Testing.md +1 -1
  2. package/build/src/decorators/observed.d.ts.map +1 -1
  3. package/build/src/decorators/observed.js +91 -0
  4. package/build/src/decorators/observed.js.map +1 -1
  5. package/build/src/modeling/ApiModel.d.ts +21 -7
  6. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  7. package/build/src/modeling/ApiModel.js +70 -29
  8. package/build/src/modeling/ApiModel.js.map +1 -1
  9. package/build/src/modeling/DomainValidation.d.ts +1 -1
  10. package/build/src/modeling/DomainValidation.d.ts.map +1 -1
  11. package/build/src/modeling/DomainValidation.js.map +1 -1
  12. package/build/src/modeling/ExposedEntity.d.ts +14 -0
  13. package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
  14. package/build/src/modeling/ExposedEntity.js +59 -6
  15. package/build/src/modeling/ExposedEntity.js.map +1 -1
  16. package/build/src/modeling/actions/Action.d.ts +11 -1
  17. package/build/src/modeling/actions/Action.d.ts.map +1 -1
  18. package/build/src/modeling/actions/Action.js +21 -3
  19. package/build/src/modeling/actions/Action.js.map +1 -1
  20. package/build/src/modeling/actions/CreateAction.d.ts +2 -1
  21. package/build/src/modeling/actions/CreateAction.d.ts.map +1 -1
  22. package/build/src/modeling/actions/CreateAction.js +2 -2
  23. package/build/src/modeling/actions/CreateAction.js.map +1 -1
  24. package/build/src/modeling/actions/DeleteAction.d.ts +2 -1
  25. package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -1
  26. package/build/src/modeling/actions/DeleteAction.js +2 -2
  27. package/build/src/modeling/actions/DeleteAction.js.map +1 -1
  28. package/build/src/modeling/actions/ListAction.d.ts +2 -1
  29. package/build/src/modeling/actions/ListAction.d.ts.map +1 -1
  30. package/build/src/modeling/actions/ListAction.js +2 -2
  31. package/build/src/modeling/actions/ListAction.js.map +1 -1
  32. package/build/src/modeling/actions/ReadAction.d.ts +2 -1
  33. package/build/src/modeling/actions/ReadAction.d.ts.map +1 -1
  34. package/build/src/modeling/actions/ReadAction.js +2 -2
  35. package/build/src/modeling/actions/ReadAction.js.map +1 -1
  36. package/build/src/modeling/actions/SearchAction.d.ts +2 -1
  37. package/build/src/modeling/actions/SearchAction.d.ts.map +1 -1
  38. package/build/src/modeling/actions/SearchAction.js +2 -2
  39. package/build/src/modeling/actions/SearchAction.js.map +1 -1
  40. package/build/src/modeling/actions/UpdateAction.d.ts +2 -1
  41. package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -1
  42. package/build/src/modeling/actions/UpdateAction.js +2 -2
  43. package/build/src/modeling/actions/UpdateAction.js.map +1 -1
  44. package/build/src/modeling/actions/index.d.ts +2 -1
  45. package/build/src/modeling/actions/index.d.ts.map +1 -1
  46. package/build/src/modeling/actions/index.js +7 -7
  47. package/build/src/modeling/actions/index.js.map +1 -1
  48. package/build/src/modeling/index.d.ts +1 -0
  49. package/build/src/modeling/index.d.ts.map +1 -1
  50. package/build/src/modeling/index.js +1 -0
  51. package/build/src/modeling/index.js.map +1 -1
  52. package/build/src/modeling/types.d.ts +67 -0
  53. package/build/src/modeling/types.d.ts.map +1 -1
  54. package/build/src/modeling/types.js.map +1 -1
  55. package/build/src/modeling/validation/api_model_rules.d.ts +15 -0
  56. package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -0
  57. package/build/src/modeling/validation/api_model_rules.js +599 -0
  58. package/build/src/modeling/validation/api_model_rules.js.map +1 -0
  59. package/build/src/modeling/validation/association_validation.d.ts.map +1 -1
  60. package/build/src/modeling/validation/association_validation.js +1 -3
  61. package/build/src/modeling/validation/association_validation.js.map +1 -1
  62. package/build/tsconfig.tsbuildinfo +1 -1
  63. package/data/models/example-generator-api.json +8 -8
  64. package/eslint.config.js +0 -1
  65. package/package.json +17 -122
  66. package/src/decorators/observed.ts +91 -0
  67. package/src/modeling/ApiModel.ts +73 -33
  68. package/src/modeling/DomainValidation.ts +1 -1
  69. package/src/modeling/ExposedEntity.ts +63 -9
  70. package/src/modeling/actions/Action.ts +25 -2
  71. package/src/modeling/actions/CreateAction.ts +3 -2
  72. package/src/modeling/actions/DeleteAction.ts +3 -2
  73. package/src/modeling/actions/ListAction.ts +3 -2
  74. package/src/modeling/actions/ReadAction.ts +3 -2
  75. package/src/modeling/actions/SearchAction.ts +3 -2
  76. package/src/modeling/actions/UpdateAction.ts +3 -2
  77. package/src/modeling/types.ts +70 -0
  78. package/src/modeling/validation/api_model_rules.ts +640 -0
  79. package/src/modeling/validation/api_model_validation_rules.md +58 -0
  80. package/src/modeling/validation/association_validation.ts +1 -3
  81. package/tests/unit/modeling/actions/Action.spec.ts +40 -8
  82. package/tests/unit/modeling/actions/CreateAction.spec.ts +5 -5
  83. package/tests/unit/modeling/actions/DeleteAction.spec.ts +6 -6
  84. package/tests/unit/modeling/actions/ListAction.spec.ts +7 -7
  85. package/tests/unit/modeling/actions/ReadAction.spec.ts +6 -6
  86. package/tests/unit/modeling/actions/SearchAction.spec.ts +6 -6
  87. package/tests/unit/modeling/actions/UpdateAction.spec.ts +6 -6
  88. package/tests/unit/modeling/api_model.spec.ts +190 -13
  89. package/tests/unit/modeling/api_model_expose_entity.spec.ts +43 -19
  90. package/tests/unit/modeling/api_model_remove_entity.spec.ts +6 -6
  91. package/tests/unit/modeling/exposed_entity.spec.ts +123 -3
  92. package/tests/unit/modeling/exposed_entity_actions.spec.ts +41 -18
  93. package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
  94. package/tests/unit/modeling/rules/restoring_rules.spec.ts +9 -5
  95. package/tests/unit/modeling/validation/api_model_rules.spec.ts +324 -0
  96. package/tsconfig.browser.json +1 -1
  97. package/tsconfig.node.json +1 -1
  98. package/bin/test-web.ts +0 -6
@@ -21,7 +21,7 @@ let Action = (() => {
21
21
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
22
22
  _kind_decorators = [observed()];
23
23
  _accessRule_decorators = [observed({ deep: true })];
24
- _rateLimiting_decorators = [observed({ deep: true })];
24
+ _rateLimiting_decorators = [observed()];
25
25
  __esDecorate(this, null, _kind_decorators, { kind: "accessor", name: "kind", static: false, private: false, access: { has: obj => "kind" in obj, get: obj => obj.kind, set: (obj, value) => { obj.kind = value; } }, metadata: _metadata }, _kind_initializers, _kind_extraInitializers);
26
26
  __esDecorate(this, null, _accessRule_decorators, { kind: "accessor", name: "accessRule", static: false, private: false, access: { has: obj => "accessRule" in obj, get: obj => obj.accessRule, set: (obj, value) => { obj.accessRule = value; } }, metadata: _metadata }, _accessRule_initializers, _accessRule_extraInitializers);
27
27
  __esDecorate(this, null, _rateLimiting_decorators, { kind: "accessor", name: "rateLimiting", static: false, private: false, access: { has: obj => "rateLimiting" in obj, get: obj => obj.rateLimiting, set: (obj, value) => { obj.rateLimiting = value; } }, metadata: _metadata }, _rateLimiting_initializers, _rateLimiting_extraInitializers);
@@ -36,9 +36,10 @@ let Action = (() => {
36
36
  #rateLimiting_accessor_storage = (__runInitializers(this, _accessRule_extraInitializers), __runInitializers(this, _rateLimiting_initializers, void 0));
37
37
  get rateLimiting() { return this.#rateLimiting_accessor_storage; }
38
38
  set rateLimiting(value) { this.#rateLimiting_accessor_storage = value; }
39
- constructor(state = {}) {
39
+ parent = __runInitializers(this, _rateLimiting_extraInitializers);
40
+ constructor(parent, state = {}) {
40
41
  super();
41
- __runInitializers(this, _rateLimiting_extraInitializers);
42
+ this.parent = parent;
42
43
  this.kind = state.kind || '';
43
44
  this.accessRule = state.accessRule ? state.accessRule.map((rule) => restoreAccessRule(rule)) : [];
44
45
  this.rateLimiting = state.rateLimiting ? new RateLimitingConfiguration(state.rateLimiting) : undefined;
@@ -58,6 +59,23 @@ let Action = (() => {
58
59
  }
59
60
  return result;
60
61
  }
62
+ /**
63
+ * Returns all access rules for this action, including the ones from all the parents up to the API.
64
+ */
65
+ getAllRules() {
66
+ const rules = [...this.parent.getAllRules(), ...this.accessRule];
67
+ return rules;
68
+ }
69
+ /**
70
+ * Returns all rate limiters for this action, including the ones from all the parents up to the API.
71
+ */
72
+ getAllRateLimiters() {
73
+ const rateLimiters = this.parent.getAllRateLimiters();
74
+ if (this.rateLimiting) {
75
+ rateLimiters.push(this.rateLimiting);
76
+ }
77
+ return rateLimiters;
78
+ }
61
79
  };
62
80
  })();
63
81
  export { Action };
@@ -1 +1 @@
1
- {"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uCAAuC,CAAA;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AA8BrD;;GAEG;IACU,MAAM;sBAAS,WAAW;;;;;;;;;;iBAA1B,MAAO,SAAQ,WAAW;;;gCACpC,QAAQ,EAAE;sCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;wCACxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAFb,iKAAS,IAAI,6BAAJ,IAAI,mFAAQ;YACP,mLAAS,UAAU,6BAAV,UAAU,+FAAc;YACjC,yLAAS,YAAY,6BAAZ,YAAY,mGAAuC;;;QAF1E,6EAAqB;QAArB,IAAS,IAAI,0CAAQ;QAArB,IAAS,IAAI,gDAAQ;QACP,6IAAiC;QAAjC,IAAS,UAAU,gDAAc;QAAjC,IAAS,UAAU,sDAAc;QACjC,uJAA4D;QAA5D,IAAS,YAAY,kDAAuC;QAA5D,IAAS,YAAY,wDAAuC;QAEtF,YAAY,QAA+B,EAAE;YAC3C,KAAK,EAAE,CAAA;;YACP,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAA;YAC5B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YACjG,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,yBAAyB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;SACvG;QAED,YAAY;YACV,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;QACzC,CAAC;QAED,MAAM;YACJ,MAAM,MAAM,GAAiB;gBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAA;YACD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;gBAC3B,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;YAClE,CAAC;YACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAA;YAClD,CAAC;YACD,OAAO,MAAM,CAAA;QACf,CAAC;;;SA3BU,MAAM","sourcesContent":["import { AccessRule, AccessRuleSchema } from '../rules/AccessRule.js'\nimport { RateLimitingConfiguration, RateLimitingConfigurationSchema } from '../rules/RateLimitingConfiguration.js'\nimport { observed } from '../../decorators/observed.js'\nimport { restoreAccessRule } from '../rules/index.js'\n\n/**\n * A base interface for common properties across all actions.\n */\nexport interface ActionSchema {\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?: AccessRuleSchema[]\n /**\n * Optional configuration for action-wide rate limiting and throttling.\n * Defines rules to protect the action from overuse.\n */\n rateLimiting?: RateLimitingConfigurationSchema\n}\n\n/**\n * A base class for common properties across all actions.\n */\nexport class Action extends EventTarget implements ActionSchema {\n @observed() accessor kind: string\n @observed({ deep: true }) accessor accessRule: AccessRule[]\n @observed({ deep: true }) accessor rateLimiting: RateLimitingConfiguration | undefined\n\n constructor(state: Partial<ActionSchema> = {}) {\n super()\n this.kind = state.kind || ''\n this.accessRule = state.accessRule ? state.accessRule.map((rule) => restoreAccessRule(rule)) : []\n this.rateLimiting = state.rateLimiting ? new RateLimitingConfiguration(state.rateLimiting) : undefined\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n\n toJSON(): ActionSchema {\n const result: ActionSchema = {\n kind: this.kind,\n }\n if (this.accessRule.length) {\n result.accessRule = this.accessRule.map((rule) => rule.toJSON())\n }\n if (this.rateLimiting) {\n result.rateLimiting = this.rateLimiting.toJSON()\n }\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uCAAuC,CAAA;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AA+BrD;;GAEG;IACU,MAAM;sBAAS,WAAW;;;;;;;;;;iBAA1B,MAAO,SAAQ,WAAW;;;gCACpC,QAAQ,EAAE;sCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;wCACxB,QAAQ,EAAE;YAFC,iKAAS,IAAI,6BAAJ,IAAI,mFAAQ;YACP,mLAAS,UAAU,6BAAV,UAAU,+FAAc;YAC/C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,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAA;YAClD,CAAC;YACD,OAAO,MAAM,CAAA;QACf,CAAC;QAED;;WAEG;QACH,WAAW;YACT,MAAM,KAAK,GAAiB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;YAC9E,OAAO,KAAK,CAAA;QACd,CAAC;QAED;;WAEG;QACH,kBAAkB;YAChB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAA;YACrD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;YACtC,CAAC;YACD,OAAO,YAAY,CAAA;QACrB,CAAC;;;SAjDU,MAAM","sourcesContent":["import { AccessRule, AccessRuleSchema } from '../rules/AccessRule.js'\nimport { RateLimitingConfiguration, RateLimitingConfigurationSchema } from '../rules/RateLimitingConfiguration.js'\nimport { observed } from '../../decorators/observed.js'\nimport { restoreAccessRule } from '../rules/index.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * A base interface for common properties across all actions.\n */\nexport interface ActionSchema {\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?: AccessRuleSchema[]\n /**\n * Optional configuration for action-wide rate limiting and throttling.\n * Defines rules to protect the action from overuse.\n */\n rateLimiting?: RateLimitingConfigurationSchema\n}\n\n/**\n * A base class for common properties across all actions.\n */\nexport class Action extends EventTarget implements ActionSchema {\n @observed() accessor kind: string\n @observed({ deep: true }) accessor accessRule: AccessRule[]\n @observed() accessor rateLimiting: RateLimitingConfiguration | undefined\n\n protected parent: ExposedEntity\n\n constructor(parent: ExposedEntity, state: Partial<ActionSchema> = {}) {\n super()\n this.parent = parent\n this.kind = state.kind || ''\n this.accessRule = state.accessRule ? state.accessRule.map((rule) => restoreAccessRule(rule)) : []\n this.rateLimiting = state.rateLimiting ? new RateLimitingConfiguration(state.rateLimiting) : undefined\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n\n toJSON(): ActionSchema {\n const result: ActionSchema = {\n kind: this.kind,\n }\n if (this.accessRule.length) {\n result.accessRule = this.accessRule.map((rule) => rule.toJSON())\n }\n if (this.rateLimiting) {\n result.rateLimiting = this.rateLimiting.toJSON()\n }\n return result\n }\n\n /**\n * Returns all access rules for this action, including the ones from all the parents up to the API.\n */\n getAllRules(): AccessRule[] {\n const rules: AccessRule[] = [...this.parent.getAllRules(), ...this.accessRule]\n return rules\n }\n\n /**\n * Returns all rate limiters for this action, including the ones from all the parents up to the API.\n */\n getAllRateLimiters(): RateLimitingConfiguration[] {\n const rateLimiters = this.parent.getAllRateLimiters()\n if (this.rateLimiting) {\n rateLimiters.push(this.rateLimiting)\n }\n return rateLimiters\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Action, type ActionSchema } from './Action.js';
2
+ import type { ExposedEntity } from '../ExposedEntity.js';
2
3
  /**
3
4
  * Enables adding a new resource to a collection.
4
5
  * Endpoint: POST /[entity-collection-name]
@@ -12,7 +13,7 @@ export interface CreateActionSchema extends ActionSchema {
12
13
  */
13
14
  export declare class CreateAction extends Action implements CreateActionSchema {
14
15
  accessor kind: 'create';
15
- constructor(state?: Partial<CreateActionSchema>);
16
+ constructor(parent: ExposedEntity, state?: Partial<CreateActionSchema>);
16
17
  toJSON(): CreateActionSchema;
17
18
  static isCreateAction(action: Action): action is CreateAction;
18
19
  static isCreateActionSchema(schema: ActionSchema): schema is CreateActionSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"CreateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAGvD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;CACf;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;gBAEhC,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAK1C,MAAM,IAAI,kBAAkB;IAOrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
1
+ {"version":3,"file":"CreateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;CACf;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;gBAEhC,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAKjE,MAAM,IAAI,kBAAkB;IAOrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
@@ -20,8 +20,8 @@ let CreateAction = (() => {
20
20
  #kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
21
21
  get kind() { return this.#kind_accessor_storage; }
22
22
  set kind(value) { this.#kind_accessor_storage = value; }
23
- constructor(state = {}) {
24
- super(state);
23
+ constructor(parent, state = {}) {
24
+ super(parent, state);
25
25
  __runInitializers(this, _kind_extraInitializers);
26
26
  this.kind = 'create';
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CreateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAUvD;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;YAAC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;;;QAAhC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAE5C,YAAY,QAAqC,EAAE;YACjD,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;SACrB;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;aACf,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SArBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport interface CreateActionSchema extends ActionSchema {\n kind: 'create'\n}\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport class CreateAction extends Action implements CreateActionSchema {\n @observed() override accessor kind: 'create'\n\n constructor(state: Partial<CreateActionSchema> = {}) {\n super(state)\n this.kind = 'create'\n }\n\n override toJSON(): CreateActionSchema {\n return {\n ...(super.toJSON() as CreateActionSchema),\n kind: 'create',\n }\n }\n\n static isCreateAction(action: Action): action is CreateAction {\n return action.kind === 'create'\n }\n\n static isCreateActionSchema(schema: ActionSchema): schema is CreateActionSchema {\n return schema.kind === 'create'\n }\n}\n"]}
1
+ {"version":3,"file":"CreateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAWvD;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;YAAC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;;;QAAhC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAE5C,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;SACrB;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;aACf,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SArBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport interface CreateActionSchema extends ActionSchema {\n kind: 'create'\n}\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport class CreateAction extends Action implements CreateActionSchema {\n @observed() override accessor kind: 'create'\n\n constructor(parent: ExposedEntity, state: Partial<CreateActionSchema> = {}) {\n super(parent, state)\n this.kind = 'create'\n }\n\n override toJSON(): CreateActionSchema {\n return {\n ...(super.toJSON() as CreateActionSchema),\n kind: 'create',\n }\n }\n\n static isCreateAction(action: Action): action is CreateAction {\n return action.kind === 'create'\n }\n\n static isCreateActionSchema(schema: ActionSchema): schema is CreateActionSchema {\n return schema.kind === 'create'\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Action, type ActionSchema } from './Action.js';
2
+ import type { ExposedEntity } from '../ExposedEntity.js';
2
3
  export type DeleteStrategy = 'soft' | 'hard';
3
4
  /**
4
5
  * Enables removing an existing resource.
@@ -28,7 +29,7 @@ export declare class DeleteAction extends Action implements DeleteActionSchema {
28
29
  accessor kind: 'delete';
29
30
  accessor strategy: DeleteStrategy;
30
31
  accessor retentionPeriod: number;
31
- constructor(state?: Partial<DeleteActionSchema>);
32
+ constructor(parent: ExposedEntity, state?: Partial<DeleteActionSchema>);
32
33
  toJSON(): DeleteActionSchema;
33
34
  static isDeleteAction(action: Action): action is DeleteAction;
34
35
  static isDeleteActionSchema(schema: ActionSchema): schema is DeleteActionSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAG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AQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;gBAEhC,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAOjE,MAAM,IAAI,kBAAkB;IASrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
@@ -36,8 +36,8 @@ let DeleteAction = (() => {
36
36
  #retentionPeriod_accessor_storage = (__runInitializers(this, _strategy_extraInitializers), __runInitializers(this, _retentionPeriod_initializers, void 0));
37
37
  get retentionPeriod() { return this.#retentionPeriod_accessor_storage; }
38
38
  set retentionPeriod(value) { this.#retentionPeriod_accessor_storage = value; }
39
- constructor(state = {}) {
40
- super(state);
39
+ constructor(parent, state = {}) {
40
+ super(parent, state);
41
41
  __runInitializers(this, _retentionPeriod_extraInitializers);
42
42
  this.kind = 'delete';
43
43
  this.strategy = state.strategy || 'soft';
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAyBvD;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;oCACV,QAAQ,EAAE;2CACV,QAAQ,EAAE;YAFC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAChC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAgB;YACjC,kMAAS,eAAe,6BAAf,eAAe,yGAAQ;;;QAFhC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAChC,yIAAiC;QAAjC,IAAS,QAAQ,8CAAgB;QAAjC,IAAS,QAAQ,oDAAgB;QACjC,2JAAgC;QAAhC,IAAS,eAAe,qDAAQ;QAAhC,IAAS,eAAe,2DAAQ;QAE5C,YAAY,QAAqC,EAAE;YACjD,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAA;YACxC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAA;SACnD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,eAAe,EAAE,IAAI,CAAC,eAAe;aACtC,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SA3BU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\n\nexport type DeleteStrategy = 'soft' | 'hard'\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport interface DeleteActionSchema extends ActionSchema {\n kind: 'delete'\n /**\n * The strategy for deletion. Default: Soft Delete.\n *\n * @default 'soft'\n */\n strategy?: DeleteStrategy\n /**\n * The data retention period (in days) for soft-deleted resources.\n * This defines how long the data should be kept before it is permanently deleted.\n *\n * @default 30\n */\n retentionPeriod?: number\n}\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport class DeleteAction extends Action implements DeleteActionSchema {\n @observed() override accessor kind: 'delete'\n @observed() accessor strategy: DeleteStrategy\n @observed() accessor retentionPeriod: number\n\n constructor(state: Partial<DeleteActionSchema> = {}) {\n super(state)\n this.kind = 'delete'\n this.strategy = state.strategy || 'soft'\n this.retentionPeriod = state.retentionPeriod ?? 30\n }\n\n override toJSON(): DeleteActionSchema {\n return {\n ...(super.toJSON() as DeleteActionSchema),\n kind: 'delete',\n strategy: this.strategy,\n retentionPeriod: this.retentionPeriod,\n }\n }\n\n static isDeleteAction(action: Action): action is DeleteAction {\n return action.kind === 'delete'\n }\n\n static isDeleteActionSchema(schema: ActionSchema): schema is DeleteActionSchema {\n return schema.kind === 'delete'\n }\n}\n"]}
1
+ {"version":3,"file":"DeleteAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AA0BvD;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;oCACV,QAAQ,EAAE;2CACV,QAAQ,EAAE;YAFC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAChC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAgB;YACjC,kMAAS,eAAe,6BAAf,eAAe,yGAAQ;;;QAFhC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAChC,yIAAiC;QAAjC,IAAS,QAAQ,8CAAgB;QAAjC,IAAS,QAAQ,oDAAgB;QACjC,2JAAgC;QAAhC,IAAS,eAAe,qDAAQ;QAAhC,IAAS,eAAe,2DAAQ;QAE5C,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAA;YACxC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAA;SACnD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,eAAe,EAAE,IAAI,CAAC,eAAe;aACtC,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SA3BU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\nexport type DeleteStrategy = 'soft' | 'hard'\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport interface DeleteActionSchema extends ActionSchema {\n kind: 'delete'\n /**\n * The strategy for deletion. Default: Soft Delete.\n *\n * @default 'soft'\n */\n strategy?: DeleteStrategy\n /**\n * The data retention period (in days) for soft-deleted resources.\n * This defines how long the data should be kept before it is permanently deleted.\n *\n * @default 30\n */\n retentionPeriod?: number\n}\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport class DeleteAction extends Action implements DeleteActionSchema {\n @observed() override accessor kind: 'delete'\n @observed() accessor strategy: DeleteStrategy\n @observed() accessor retentionPeriod: number\n\n constructor(parent: ExposedEntity, state: Partial<DeleteActionSchema> = {}) {\n super(parent, state)\n this.kind = 'delete'\n this.strategy = state.strategy || 'soft'\n this.retentionPeriod = state.retentionPeriod ?? 30\n }\n\n override toJSON(): DeleteActionSchema {\n return {\n ...(super.toJSON() as DeleteActionSchema),\n kind: 'delete',\n strategy: this.strategy,\n retentionPeriod: this.retentionPeriod,\n }\n }\n\n static isDeleteAction(action: Action): action is DeleteAction {\n return action.kind === 'delete'\n }\n\n static isDeleteActionSchema(schema: ActionSchema): schema is DeleteActionSchema {\n return schema.kind === 'delete'\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { PaginationStrategy } from '../types.js';
2
2
  import { Action, type ActionSchema } from './Action.js';
3
+ import type { ExposedEntity } from '../ExposedEntity.js';
3
4
  /**
4
5
  * Enables retrieving a collection of resources.
5
6
  * Endpoint: GET /[entity-collection-name]
@@ -31,7 +32,7 @@ export declare class ListAction extends Action implements ListActionSchema {
31
32
  accessor pagination: PaginationStrategy;
32
33
  accessor filterableFields: string[];
33
34
  accessor sortableFields: string[];
34
- constructor(state?: Partial<ListActionSchema>);
35
+ constructor(parent: ExposedEntity, state?: Partial<ListActionSchema>);
35
36
  toJSON(): ListActionSchema;
36
37
  static isListAction(action: Action): action is ListAction;
37
38
  static isListActionSchema(schema: ActionSchema): schema is ListActionSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"ListAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ListAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAGvD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,UAAU,EAAE,kBAAkB,CAAA;IAC9B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B;;OAEG;IACH,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,MAAO,YAAW,gBAAgB;IAChE,SAA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,MAAM,IAAI,gBAAgB;IASnC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,UAAU;IAIzD,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,gBAAgB;CAG5E"}
@@ -44,8 +44,8 @@ let ListAction = (() => {
44
44
  #sortableFields_accessor_storage = (__runInitializers(this, _filterableFields_extraInitializers), __runInitializers(this, _sortableFields_initializers, []));
45
45
  get sortableFields() { return this.#sortableFields_accessor_storage; }
46
46
  set sortableFields(value) { this.#sortableFields_accessor_storage = value; }
47
- constructor(state = {}) {
48
- super(state);
47
+ constructor(parent, state = {}) {
48
+ super(parent, state);
49
49
  __runInitializers(this, _sortableFields_extraInitializers);
50
50
  this.kind = state.kind || 'list';
51
51
  this.pagination = state.pagination
@@ -1 +1 @@
1
- {"version":3,"file":"ListAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ListAction.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAyB9D;;;GAGG;IACU,UAAU;sBAAS,MAAM;;;;;;;;;;;;;iBAAzB,UAAW,SAAQ,WAAM;;;gCACnC,QAAQ,EAAE;sCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;4CACxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;0CACxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAHb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAQ;YAChB,mLAAS,UAAU,6BAAV,UAAU,+FAAoB;YACvC,qMAAS,gBAAgB,6BAAhB,gBAAgB,2GAAe;YACxC,+LAAS,cAAc,6BAAd,cAAc,uGAAe;;;QAHpD,6EAA8B;QAA9B,IAAkB,IAAI,0CAAQ;QAA9B,IAAkB,IAAI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MAAM,CAAA;QAC/B,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,MAAoB;YAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;;;SAjCU,UAAU","sourcesContent":["import type { PaginationStrategy } from '../types.js'\nimport { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * Enables retrieving a collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport interface ListActionSchema extends ActionSchema {\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 collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport class ListAction extends Action implements ListActionSchema {\n @observed() override accessor kind: 'list'\n @observed({ deep: true }) accessor pagination: PaginationStrategy\n @observed({ deep: true }) accessor filterableFields: string[] = []\n @observed({ deep: true }) accessor sortableFields: string[] = []\n\n constructor(state: Partial<ListActionSchema> = {}) {\n super(state)\n this.kind = state.kind || 'list'\n this.pagination = state.pagination\n ? { ...state.pagination }\n : {\n kind: 'offset',\n }\n this.filterableFields = state.filterableFields ? [...state.filterableFields] : []\n this.sortableFields = state.sortableFields ? [...state.sortableFields] : []\n }\n\n override toJSON(): ListActionSchema {\n return {\n ...(super.toJSON() as ListActionSchema),\n pagination: structuredClone(toRaw(this, this.pagination)) as PaginationStrategy,\n filterableFields: structuredClone(toRaw(this, this.filterableFields)) as string[],\n sortableFields: structuredClone(toRaw(this, this.sortableFields)) as string[],\n }\n }\n\n static isListAction(action: Action): action is ListAction {\n return action.kind === 'list'\n }\n\n static isListActionSchema(schema: ActionSchema): schema is ListActionSchema {\n return schema.kind === 'list'\n }\n}\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ACE,IAAI,EAAE,QAAQ;iBACf,CAAA;YACL,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YACjF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SAC5E;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAuB;gBACvC,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAuB;gBAC/E,gBAAgB,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAa;gBACjF,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAa;aAC9E,CAAA;QACH,CAAC;QAED,MAAM,CAAC,YAAY,CAAC,MAAc;YAChC,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,MAAoB;YAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;;;SAjCU,UAAU","sourcesContent":["import type { PaginationStrategy } from '../types.js'\nimport { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables retrieving a collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport interface ListActionSchema extends ActionSchema {\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 collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport class ListAction extends Action implements ListActionSchema {\n @observed() override accessor kind: 'list'\n @observed({ deep: true }) accessor pagination: PaginationStrategy\n @observed({ deep: true }) accessor filterableFields: string[] = []\n @observed({ deep: true }) accessor sortableFields: string[] = []\n\n constructor(parent: ExposedEntity, state: Partial<ListActionSchema> = {}) {\n super(parent, state)\n this.kind = state.kind || 'list'\n this.pagination = state.pagination\n ? { ...state.pagination }\n : {\n kind: 'offset',\n }\n this.filterableFields = state.filterableFields ? [...state.filterableFields] : []\n this.sortableFields = state.sortableFields ? [...state.sortableFields] : []\n }\n\n override toJSON(): ListActionSchema {\n return {\n ...(super.toJSON() as ListActionSchema),\n pagination: structuredClone(toRaw(this, this.pagination)) as PaginationStrategy,\n filterableFields: structuredClone(toRaw(this, this.filterableFields)) as string[],\n sortableFields: structuredClone(toRaw(this, this.sortableFields)) as string[],\n }\n }\n\n static isListAction(action: Action): action is ListAction {\n return action.kind === 'list'\n }\n\n static isListActionSchema(schema: ActionSchema): schema is ListActionSchema {\n return schema.kind === 'list'\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Action, type ActionSchema } from './Action.js';
2
+ import type { ExposedEntity } from '../ExposedEntity.js';
2
3
  /**
3
4
  * Enables retrieving a single resource by its ID.
4
5
  * Endpoint: GET /[entity-collection-name]/{id}
@@ -12,7 +13,7 @@ export interface ReadActionSchema extends ActionSchema {
12
13
  */
13
14
  export declare class ReadAction extends Action implements ReadActionSchema {
14
15
  accessor kind: 'read';
15
- constructor(state?: Partial<ReadActionSchema>);
16
+ constructor(parent: ExposedEntity, state?: Partial<ReadActionSchema>);
16
17
  toJSON(): ReadActionSchema;
17
18
  static isReadAction(action: Action): action is ReadAction;
18
19
  static isReadActionSchema(schema: ActionSchema): schema is ReadActionSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"ReadAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAGvD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,IAAI,EAAE,MAAM,CAAA;CAGb;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,MAAO,YAAW,gBAAgB;IAChE,SAA8B,IAAI,EAAE,MAAM,CAAA;gBAE9B,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAKxC,MAAM,IAAI,gBAAgB;IAOnC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,UAAU;IAIzD,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,gBAAgB;CAG5E"}
1
+ {"version":3,"file":"ReadAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,IAAI,EAAE,MAAM,CAAA;CAGb;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,MAAO,YAAW,gBAAgB;IAChE,SAA8B,IAAI,EAAE,MAAM,CAAA;gBAE9B,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAK/D,MAAM,IAAI,gBAAgB;IAOnC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,UAAU;IAIzD,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,gBAAgB;CAG5E"}
@@ -20,8 +20,8 @@ let ReadAction = (() => {
20
20
  #kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
21
21
  get kind() { return this.#kind_accessor_storage; }
22
22
  set kind(value) { this.#kind_accessor_storage = value; }
23
- constructor(state = {}) {
24
- super(state);
23
+ constructor(parent, state = {}) {
24
+ super(parent, state);
25
25
  __runInitializers(this, _kind_extraInitializers);
26
26
  this.kind = 'read';
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ReadAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAYvD;;;GAGG;IACU,UAAU;sBAAS,MAAM;;;;iBAAzB,UAAW,SAAQ,WAAM;;;gCACnC,QAAQ,EAAE;YAAC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAQ;;;QAA9B,6EAA8B;QAA9B,IAAkB,IAAI,0CAAQ;QAA9B,IAAkB,IAAI,gDAAQ;QAE1C,YAAY,QAAmC,EAAE;YAC/C,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,MAAM,CAAA;SACnB;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAuB;gBACvC,IAAI,EAAE,MAAM;aACb,CAAA;QACH,CAAC;QAED,MAAM,CAAC,YAAY,CAAC,MAAc;YAChC,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,MAAoB;YAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;;;SArBU,UAAU","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * Enables retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport interface ReadActionSchema extends ActionSchema {\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 retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport class ReadAction extends Action implements ReadActionSchema {\n @observed() override accessor kind: 'read'\n\n constructor(state: Partial<ReadActionSchema> = {}) {\n super(state)\n this.kind = 'read'\n }\n\n override toJSON(): ReadActionSchema {\n return {\n ...(super.toJSON() as ReadActionSchema),\n kind: 'read',\n }\n }\n\n static isReadAction(action: Action): action is ReadAction {\n return action.kind === 'read'\n }\n\n static isReadActionSchema(schema: ActionSchema): schema is ReadActionSchema {\n return schema.kind === 'read'\n }\n}\n"]}
1
+ {"version":3,"file":"ReadAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAavD;;;GAGG;IACU,UAAU;sBAAS,MAAM;;;;iBAAzB,UAAW,SAAQ,WAAM;;;gCACnC,QAAQ,EAAE;YAAC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAQ;;;QAA9B,6EAA8B;QAA9B,IAAkB,IAAI,0CAAQ;QAA9B,IAAkB,IAAI,gDAAQ;QAE1C,YAAY,MAAqB,EAAE,QAAmC,EAAE;YACtE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAA;SACnB;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAuB;gBACvC,IAAI,EAAE,MAAM;aACb,CAAA;QACH,CAAC;QAED,MAAM,CAAC,YAAY,CAAC,MAAc;YAChC,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,MAAoB;YAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;;;SArBU,UAAU","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport interface ReadActionSchema extends ActionSchema {\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 retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport class ReadAction extends Action implements ReadActionSchema {\n @observed() override accessor kind: 'read'\n\n constructor(parent: ExposedEntity, state: Partial<ReadActionSchema> = {}) {\n super(parent, state)\n this.kind = 'read'\n }\n\n override toJSON(): ReadActionSchema {\n return {\n ...(super.toJSON() as ReadActionSchema),\n kind: 'read',\n }\n }\n\n static isReadAction(action: Action): action is ReadAction {\n return action.kind === 'read'\n }\n\n static isReadActionSchema(schema: ActionSchema): schema is ReadActionSchema {\n return schema.kind === 'read'\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Action, type ActionSchema } from './Action.js';
2
+ import type { ExposedEntity } from '../ExposedEntity.js';
2
3
  /**
3
4
  * Enables keyword-based search across specified fields.
4
5
  * Endpoint: GET /[entity-collection-name]/search
@@ -18,7 +19,7 @@ export interface SearchActionSchema extends ActionSchema {
18
19
  export declare class SearchAction extends Action implements SearchActionSchema {
19
20
  accessor kind: 'search';
20
21
  accessor fields: string[];
21
- constructor(state?: Partial<SearchActionSchema>);
22
+ constructor(parent: ExposedEntity, state?: Partial<SearchActionSchema>);
22
23
  toJSON(): SearchActionSchema;
23
24
  static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema;
24
25
  static isSearchAction(action: Action): action is SearchAction;
@@ -1 +1 @@
1
- {"version":3,"file":"SearchAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAGvD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAA;gBAEvC,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAM1C,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;IAI/E,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;CAG9D"}
1
+ {"version":3,"file":"SearchAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAA;gBAEvC,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAMjE,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;IAI/E,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;CAG9D"}
@@ -28,8 +28,8 @@ let SearchAction = (() => {
28
28
  #fields_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _fields_initializers, void 0));
29
29
  get fields() { return this.#fields_accessor_storage; }
30
30
  set fields(value) { this.#fields_accessor_storage = value; }
31
- constructor(state = {}) {
32
- super(state);
31
+ constructor(parent, state = {}) {
32
+ super(parent, state);
33
33
  __runInitializers(this, _fields_extraInitializers);
34
34
  this.kind = 'search';
35
35
  this.fields = state.fields ? [...state.fields] : [];
@@ -1 +1 @@
1
- {"version":3,"file":"SearchAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAe9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;kCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,uKAAS,MAAM,6BAAN,MAAM,uFAAU;;;QADvC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qIAAyB;QAAzB,IAAS,MAAM,4CAAU;QAAzB,IAAS,MAAM,kDAAU;QAEnD,YAAY,QAAqC,EAAE;YACjD,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SACpD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAa;aAC9D,CAAA;QACH,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchActionSchema extends ActionSchema {\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 * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport class SearchAction extends Action implements SearchActionSchema {\n @observed() override accessor kind: 'search'\n @observed({ deep: true }) accessor fields: string[]\n\n constructor(state: Partial<SearchActionSchema> = {}) {\n super(state)\n this.kind = 'search'\n this.fields = state.fields ? [...state.fields] : []\n }\n\n override toJSON(): SearchActionSchema {\n return {\n ...(super.toJSON() as SearchActionSchema),\n kind: 'search',\n fields: structuredClone(toRaw(this, this.fields)) as string[],\n }\n }\n\n static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema {\n return schema.kind === 'search'\n }\n\n static isSearchAction(action: Action): action is SearchAction {\n return action.kind === 'search'\n }\n}\n"]}
1
+ {"version":3,"file":"SearchAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mapp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.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchActionSchema extends ActionSchema {\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 * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport class SearchAction extends Action implements SearchActionSchema {\n @observed() override accessor kind: 'search'\n @observed({ deep: true }) accessor fields: string[]\n\n constructor(parent: ExposedEntity, state: Partial<SearchActionSchema> = {}) {\n super(parent, state)\n this.kind = 'search'\n this.fields = state.fields ? [...state.fields] : []\n }\n\n override toJSON(): SearchActionSchema {\n return {\n ...(super.toJSON() as SearchActionSchema),\n kind: 'search',\n fields: structuredClone(toRaw(this, this.fields)) as string[],\n }\n }\n\n static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema {\n return schema.kind === 'search'\n }\n\n static isSearchAction(action: Action): action is SearchAction {\n return action.kind === 'search'\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Action, type ActionSchema } from './Action.js';
2
+ import type { ExposedEntity } from '../ExposedEntity.js';
2
3
  /**
3
4
  * Enables modifying an existing resource.
4
5
  * Endpoints: PUT or PATCH /[entity-collection-name]/{id}
@@ -21,7 +22,7 @@ export interface UpdateActionSchema extends ActionSchema {
21
22
  export declare class UpdateAction extends Action implements UpdateActionSchema {
22
23
  accessor kind: 'update';
23
24
  accessor allowedMethods: ('PUT' | 'PATCH')[];
24
- constructor(state?: Partial<UpdateActionSchema>);
25
+ constructor(parent: ExposedEntity, state?: Partial<UpdateActionSchema>);
25
26
  toJSON(): UpdateActionSchema;
26
27
  static isUpdateAction(action: Action): action is UpdateAction;
27
28
  static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAGvD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;gBAE1D,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAM1C,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
1
+ {"version":3,"file":"UpdateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;gBAE1D,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAMjE,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
@@ -28,8 +28,8 @@ let UpdateAction = (() => {
28
28
  #allowedMethods_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _allowedMethods_initializers, void 0));
29
29
  get allowedMethods() { return this.#allowedMethods_accessor_storage; }
30
30
  set allowedMethods(value) { this.#allowedMethods_accessor_storage = value; }
31
- constructor(state = {}) {
32
- super(state);
31
+ constructor(parent, state = {}) {
32
+ super(parent, state);
33
33
  __runInitializers(this, _allowedMethods_extraInitializers);
34
34
  this.kind = 'update';
35
35
  this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH'];
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAkB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;0CACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,+LAAS,cAAc,6BAAd,cAAc,uGAAqB;;;QAD1D,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qJAA4C;QAA5C,IAAS,cAAc,oDAAqB;QAA5C,IAAS,cAAc,0DAAqB;QAEtE,YAAY,QAAqC,EAAE;YACjD,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACnF;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAwB;aACzF,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateActionSchema extends ActionSchema {\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 modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport class UpdateAction extends Action implements UpdateActionSchema {\n @observed() override accessor kind: 'update'\n @observed({ deep: true }) accessor allowedMethods: ('PUT' | 'PATCH')[]\n\n constructor(state: Partial<UpdateActionSchema> = {}) {\n super(state)\n this.kind = 'update'\n this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH']\n }\n\n override toJSON(): UpdateActionSchema {\n return {\n ...(super.toJSON() as UpdateActionSchema),\n kind: 'update',\n allowedMethods: structuredClone(toRaw(this, this.allowedMethods)) as ('PUT' | 'PATCH')[],\n }\n }\n\n static isUpdateAction(action: Action): action is UpdateAction {\n return action.kind === 'update'\n }\n\n static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema {\n return schema.kind === 'update'\n }\n}\n"]}
1
+ {"version":3,"file":"UpdateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAmB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;0CACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,+LAAS,cAAc,6BAAd,cAAc,uGAAqB;;;QAD1D,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qJAA4C;QAA5C,IAAS,cAAc,oDAAqB;QAA5C,IAAS,cAAc,0DAAqB;QAEtE,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACnF;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAwB;aACzF,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateActionSchema extends ActionSchema {\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 modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport class UpdateAction extends Action implements UpdateActionSchema {\n @observed() override accessor kind: 'update'\n @observed({ deep: true }) accessor allowedMethods: ('PUT' | 'PATCH')[]\n\n constructor(parent: ExposedEntity, state: Partial<UpdateActionSchema> = {}) {\n super(parent, state)\n this.kind = 'update'\n this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH']\n }\n\n override toJSON(): UpdateActionSchema {\n return {\n ...(super.toJSON() as UpdateActionSchema),\n kind: 'update',\n allowedMethods: structuredClone(toRaw(this, this.allowedMethods)) as ('PUT' | 'PATCH')[],\n }\n }\n\n static isUpdateAction(action: Action): action is UpdateAction {\n return action.kind === 'update'\n }\n\n static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema {\n return schema.kind === 'update'\n }\n}\n"]}
@@ -6,6 +6,7 @@ import { ReadAction, type ReadActionSchema } from './ReadAction.js';
6
6
  import { SearchAction, type SearchActionSchema } from './SearchAction.js';
7
7
  import { UpdateAction, type UpdateActionSchema } from './UpdateAction.js';
8
8
  import type { ActionSchema } from './Action.js';
9
+ import type { ExposedEntity } from '../ExposedEntity.js';
9
10
  export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction };
10
11
  export type { CreateActionSchema, DeleteActionSchema, ListActionSchema, ReadActionSchema, SearchActionSchema, UpdateActionSchema, };
11
12
  /**
@@ -30,5 +31,5 @@ export type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'sea
30
31
  * @param schema The schema to restore the action from.
31
32
  * @returns The restored action.
32
33
  */
33
- export declare function restoreAction(schema: ActionSchema): ApiAction;
34
+ export declare function restoreAction(parent: ExposedEntity, schema: ActionSchema): ApiAction;
34
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,C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;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AACzF,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,CAAA;AAE3G;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,CAAA;AAEtB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEpF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,SAAS,CAoBpF"}
@@ -15,20 +15,20 @@ export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, Updat
15
15
  * @param schema The schema to restore the action from.
16
16
  * @returns The restored action.
17
17
  */
18
- export function restoreAction(schema) {
18
+ export function restoreAction(parent, schema) {
19
19
  switch (schema.kind) {
20
20
  case 'list':
21
- return new ListAction(schema);
21
+ return new ListAction(parent, schema);
22
22
  case 'read':
23
- return new ReadAction(schema);
23
+ return new ReadAction(parent, schema);
24
24
  case 'create':
25
- return new CreateAction(schema);
25
+ return new CreateAction(parent, schema);
26
26
  case 'update':
27
- return new UpdateAction(schema);
27
+ return new UpdateAction(parent, schema);
28
28
  case 'delete':
29
- return new DeleteAction(schema);
29
+ return new DeleteAction(parent, schema);
30
30
  case 'search':
31
- return new SearchAction(schema);
31
+ return new SearchAction(parent, schema);
32
32
  default:
33
33
  throw new Exception('Unknown action kind', {
34
34
  code: 'E_UNKNOWN_ACTION_KIND',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAGzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAiCzF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAAoB;IAChD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAA0B,CAAC,CAAA;QACnD,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAA0B,CAAC,CAAA;QACnD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD;YACE,MAAM,IAAI,SAAS,CAAC,qBAAqB,EAAE;gBACzC,IAAI,EAAE,uBAAuB;gBAC7B,MAAM,EAAE,GAAG;aACZ,CAAC,CAAA;IACN,CAAC;AACH,CAAC","sourcesContent":["export { Action, type ActionSchema } from './Action.js'\nimport { CreateAction, type CreateActionSchema } from './CreateAction.js'\nimport { DeleteAction, type DeleteActionSchema } from './DeleteAction.js'\nimport { ListAction, type ListActionSchema } from './ListAction.js'\nimport { ReadAction, type ReadActionSchema } from './ReadAction.js'\nimport { SearchAction, type SearchActionSchema } from './SearchAction.js'\nimport { UpdateAction, type UpdateActionSchema } from './UpdateAction.js'\nimport { Exception } from '../../exceptions/exception.js'\nimport type { ActionSchema } from './Action.js'\n\nexport { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction }\nexport type {\n CreateActionSchema,\n DeleteActionSchema,\n ListActionSchema,\n ReadActionSchema,\n SearchActionSchema,\n UpdateActionSchema,\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 = CreateAction | DeleteAction | ListAction | ReadAction | SearchAction | UpdateAction\n\n/**\n * Schema representation of a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiActionSchema =\n | CreateActionSchema\n | DeleteActionSchema\n | ListActionSchema\n | ReadActionSchema\n | SearchActionSchema\n | UpdateActionSchema\n\n/**\n * The kind of action to perform.\n */\nexport type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search'\n\n/**\n * Restores an action from a schema.\n *\n * It is a helper function to restore actions from schema.\n *\n * @param schema The schema to restore the action from.\n * @returns The restored action.\n */\nexport function restoreAction(schema: ActionSchema): ApiAction {\n switch (schema.kind) {\n case 'list':\n return new ListAction(schema as ListActionSchema)\n case 'read':\n return new ReadAction(schema as ReadActionSchema)\n case 'create':\n return new CreateAction(schema as CreateActionSchema)\n case 'update':\n return new UpdateAction(schema as UpdateActionSchema)\n case 'delete':\n return new DeleteAction(schema as DeleteActionSchema)\n case 'search':\n return new SearchAction(schema as SearchActionSchema)\n default:\n throw new Exception('Unknown action kind', {\n code: 'E_UNKNOWN_ACTION_KIND',\n status: 422,\n })\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAIzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAiCzF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAAqB,EAAE,MAAoB;IACvE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,MAA0B,CAAC,CAAA;QAC3D,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,MAA0B,CAAC,CAAA;QAC3D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D;YACE,MAAM,IAAI,SAAS,CAAC,qBAAqB,EAAE;gBACzC,IAAI,EAAE,uBAAuB;gBAC7B,MAAM,EAAE,GAAG;aACZ,CAAC,CAAA;IACN,CAAC;AACH,CAAC","sourcesContent":["export { Action, type ActionSchema } from './Action.js'\nimport { CreateAction, type CreateActionSchema } from './CreateAction.js'\nimport { DeleteAction, type DeleteActionSchema } from './DeleteAction.js'\nimport { ListAction, type ListActionSchema } from './ListAction.js'\nimport { ReadAction, type ReadActionSchema } from './ReadAction.js'\nimport { SearchAction, type SearchActionSchema } from './SearchAction.js'\nimport { UpdateAction, type UpdateActionSchema } from './UpdateAction.js'\nimport { Exception } from '../../exceptions/exception.js'\nimport type { ActionSchema } from './Action.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\nexport { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction }\nexport type {\n CreateActionSchema,\n DeleteActionSchema,\n ListActionSchema,\n ReadActionSchema,\n SearchActionSchema,\n UpdateActionSchema,\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 = CreateAction | DeleteAction | ListAction | ReadAction | SearchAction | UpdateAction\n\n/**\n * Schema representation of a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiActionSchema =\n | CreateActionSchema\n | DeleteActionSchema\n | ListActionSchema\n | ReadActionSchema\n | SearchActionSchema\n | UpdateActionSchema\n\n/**\n * The kind of action to perform.\n */\nexport type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search'\n\n/**\n * Restores an action from a schema.\n *\n * It is a helper function to restore actions from schema.\n *\n * @param schema The schema to restore the action from.\n * @returns The restored action.\n */\nexport function restoreAction(parent: ExposedEntity, schema: ActionSchema): ApiAction {\n switch (schema.kind) {\n case 'list':\n return new ListAction(parent, schema as ListActionSchema)\n case 'read':\n return new ReadAction(parent, schema as ReadActionSchema)\n case 'create':\n return new CreateAction(parent, schema as CreateActionSchema)\n case 'update':\n return new UpdateAction(parent, schema as UpdateActionSchema)\n case 'delete':\n return new DeleteAction(parent, schema as DeleteActionSchema)\n case 'search':\n return new SearchAction(parent, schema as SearchActionSchema)\n default:\n throw new Exception('Unknown action kind', {\n code: 'E_UNKNOWN_ACTION_KIND',\n status: 422,\n })\n }\n}\n"]}
@@ -9,4 +9,5 @@ export { DomainModel, type DomainModelSchema, type ModelOrderedItem } from './Do
9
9
  export { DomainNamespace, type DomainNamespaceSchema, type NamespaceOrderedItem } from './DomainNamespace.js';
10
10
  export { DomainProperty, type DomainPropertySchema } from './DomainProperty.js';
11
11
  export { ExposedEntity } from './ExposedEntity.js';
12
+ export * as ApiModelValidation from './validation/api_model_rules.js';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modeling/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACjG,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC7G,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modeling/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACjG,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC7G,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,kBAAkB,MAAM,iCAAiC,CAAA"}
@@ -9,4 +9,5 @@ export { DomainModel } from './DomainModel.js';
9
9
  export { DomainNamespace } from './DomainNamespace.js';
10
10
  export { DomainProperty } from './DomainProperty.js';
11
11
  export { ExposedEntity } from './ExposedEntity.js';
12
+ export * as ApiModelValidation from './validation/api_model_rules.js';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modeling/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAyD,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAmD,MAAM,wBAAwB,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAmD,MAAM,mBAAmB,CAAA;AACjG,OAAO,EAAE,WAAW,EAAiD,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAyD,MAAM,sBAAsB,CAAA;AAC7G,OAAO,EAAE,cAAc,EAA6B,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA","sourcesContent":["export * from './actions/index.js'\nexport * from './rules/index.js'\nexport * from './types.js'\nexport { ApiModel, type ApiModelSchema, type ApiContact, type ApiLicense } from './ApiModel.js'\nexport { DataDomain, type DataDomainSchema } from './DataDomain.js'\nexport { DomainAssociation, type DomainAssociationSchema, type OnDeleteRule } from './DomainAssociation.js'\nexport { DomainEntity, type DomainEntitySchema, type EntityOrderedItem } from './DomainEntity.js'\nexport { DomainModel, type DomainModelSchema, type ModelOrderedItem } from './DomainModel.js'\nexport { DomainNamespace, type DomainNamespaceSchema, type NamespaceOrderedItem } from './DomainNamespace.js'\nexport { DomainProperty, type DomainPropertySchema } from './DomainProperty.js'\nexport { ExposedEntity } from './ExposedEntity.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modeling/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAyD,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAmD,MAAM,wBAAwB,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAmD,MAAM,mBAAmB,CAAA;AACjG,OAAO,EAAE,WAAW,EAAiD,MAAM,kBAAkB,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAyD,MAAM,sBAAsB,CAAA;AAC7G,OAAO,EAAE,cAAc,EAA6B,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,kBAAkB,MAAM,iCAAiC,CAAA","sourcesContent":["export * from './actions/index.js'\nexport * from './rules/index.js'\nexport * from './types.js'\nexport { ApiModel, type ApiModelSchema, type ApiContact, type ApiLicense } from './ApiModel.js'\nexport { DataDomain, type DataDomainSchema } from './DataDomain.js'\nexport { DomainAssociation, type DomainAssociationSchema, type OnDeleteRule } from './DomainAssociation.js'\nexport { DomainEntity, type DomainEntitySchema, type EntityOrderedItem } from './DomainEntity.js'\nexport { DomainModel, type DomainModelSchema, type ModelOrderedItem } from './DomainModel.js'\nexport { DomainNamespace, type DomainNamespaceSchema, type NamespaceOrderedItem } from './DomainNamespace.js'\nexport { DomainProperty, type DomainPropertySchema } from './DomainProperty.js'\nexport { ExposedEntity } from './ExposedEntity.js'\nexport * as ApiModelValidation from './validation/api_model_rules.js'\n"]}
@@ -682,5 +682,72 @@ export interface DomainSearchResult {
682
682
  */
683
683
  isForeign: boolean;
684
684
  }
685
+ /**
686
+ * Contextual information about where the API Model validation issue occurred.
687
+ * This allows the UI to trace back a validation error to a specific module or component.
688
+ */
689
+ export interface ApiModelValidationContext {
690
+ /**
691
+ * The key of the ApiModel itself.
692
+ */
693
+ apiModelKey: string;
694
+ /**
695
+ * The kind of the affected component (e.g., 'ApiModel', 'ExposedEntity', 'Action').
696
+ */
697
+ kind: string;
698
+ /**
699
+ * The key of the specific entity or action where the issue occurred.
700
+ * If the error is at the root API model, this might be the ApiModel's key.
701
+ */
702
+ key: string;
703
+ /**
704
+ * The specific property being validated, if applicable.
705
+ */
706
+ property?: string;
707
+ /**
708
+ * The key of the parent ExposedEntity, if this issue occurred on a nested entity or an action.
709
+ */
710
+ parentExposedEntityKey?: string;
711
+ }
712
+ /**
713
+ * Represents a single validation issue found within an ApiModel.
714
+ */
715
+ export interface ApiModelValidationItem {
716
+ /**
717
+ * A unique code identifying the type of validation error. This enables
718
+ * programmatic handling or auto-fixing in the UI (e.g., 'API_MISSING_NAME', 'LIST_ACTION_MISSING_PAGINATION').
719
+ */
720
+ code: string;
721
+ /**
722
+ * A human-readable description of the problem.
723
+ */
724
+ message: string;
725
+ /**
726
+ * A human-readable suggestion on how to fix the issue.
727
+ */
728
+ suggestion: string;
729
+ /**
730
+ * The severity of the validation issue.
731
+ */
732
+ severity: 'error' | 'warning' | 'info';
733
+ /**
734
+ * Contextual information to trace the issue back to its source component.
735
+ */
736
+ context: ApiModelValidationContext;
737
+ }
738
+ /**
739
+ * The consolidated result of validating an entire ApiModel or a subset of it.
740
+ */
741
+ export interface ApiModelValidationResult {
742
+ /**
743
+ * A boolean indicating whether the model is structurally sound and ready for publication.
744
+ * Typically true if there are no 'error' severity issues.
745
+ */
746
+ isValid: boolean;
747
+ /**
748
+ * The aggregated list of all validation issues found.
749
+ */
750
+ issues: ApiModelValidationItem[];
751
+ }
685
752
  export {};
686
753
  //# sourceMappingURL=types.d.ts.map