@api-client/core 0.18.57 → 0.18.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/modeling/ApiModel.d.ts +7 -5
- package/build/src/modeling/ApiModel.d.ts.map +1 -1
- package/build/src/modeling/ApiModel.js +35 -16
- package/build/src/modeling/ApiModel.js.map +1 -1
- package/build/src/modeling/ExposedEntity.d.ts +5 -2
- package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
- package/build/src/modeling/ExposedEntity.js +11 -8
- package/build/src/modeling/ExposedEntity.js.map +1 -1
- package/build/src/modeling/actions/Action.d.ts +41 -0
- package/build/src/modeling/actions/Action.d.ts.map +1 -0
- package/build/src/modeling/actions/Action.js +64 -0
- package/build/src/modeling/actions/Action.js.map +1 -0
- package/build/src/modeling/actions/CreateAction.d.ts +18 -0
- package/build/src/modeling/actions/CreateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/CreateAction.js +37 -0
- package/build/src/modeling/actions/CreateAction.js.map +1 -0
- package/build/src/modeling/actions/DeleteAction.d.ts +34 -0
- package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -0
- package/build/src/modeling/actions/DeleteAction.js +57 -0
- package/build/src/modeling/actions/DeleteAction.js.map +1 -0
- package/build/src/modeling/actions/ListAction.d.ts +37 -0
- package/build/src/modeling/actions/ListAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ListAction.js +70 -0
- package/build/src/modeling/actions/ListAction.js.map +1 -0
- package/build/src/modeling/actions/ReadAction.d.ts +18 -0
- package/build/src/modeling/actions/ReadAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ReadAction.js +37 -0
- package/build/src/modeling/actions/ReadAction.js.map +1 -0
- package/build/src/modeling/actions/SearchAction.d.ts +24 -0
- package/build/src/modeling/actions/SearchAction.d.ts.map +1 -0
- package/build/src/modeling/actions/SearchAction.js +47 -0
- package/build/src/modeling/actions/SearchAction.js.map +1 -0
- package/build/src/modeling/actions/UpdateAction.d.ts +27 -0
- package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/UpdateAction.js +47 -0
- package/build/src/modeling/actions/UpdateAction.js.map +1 -0
- package/build/src/modeling/actions/index.d.ts +24 -0
- package/build/src/modeling/actions/index.d.ts.map +1 -0
- package/build/src/modeling/actions/index.js +9 -0
- package/build/src/modeling/actions/index.js.map +1 -0
- package/build/src/modeling/index.d.ts +12 -0
- package/build/src/modeling/index.d.ts.map +1 -0
- package/build/src/modeling/index.js +12 -0
- package/build/src/modeling/index.js.map +1 -0
- package/build/src/modeling/rules/AccessRule.d.ts +17 -0
- package/build/src/modeling/rules/AccessRule.d.ts.map +1 -0
- package/build/src/modeling/rules/AccessRule.js +19 -0
- package/build/src/modeling/rules/AccessRule.js.map +1 -0
- package/build/src/modeling/rules/AllowAuthenticated.d.ts +19 -0
- package/build/src/modeling/rules/AllowAuthenticated.d.ts.map +1 -0
- package/build/src/modeling/rules/AllowAuthenticated.js +14 -0
- package/build/src/modeling/rules/AllowAuthenticated.js.map +1 -0
- package/build/src/modeling/rules/AllowPublic.d.ts +19 -0
- package/build/src/modeling/rules/AllowPublic.d.ts.map +1 -0
- package/build/src/modeling/rules/AllowPublic.js +14 -0
- package/build/src/modeling/rules/AllowPublic.js.map +1 -0
- package/build/src/modeling/rules/MatchEmailDomain.d.ts +25 -0
- package/build/src/modeling/rules/MatchEmailDomain.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchEmailDomain.js +40 -0
- package/build/src/modeling/rules/MatchEmailDomain.js.map +1 -0
- package/build/src/modeling/rules/MatchResourceOwner.d.ts +29 -0
- package/build/src/modeling/rules/MatchResourceOwner.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchResourceOwner.js +40 -0
- package/build/src/modeling/rules/MatchResourceOwner.js.map +1 -0
- package/build/src/modeling/rules/MatchUserProperty.d.ts +28 -0
- package/build/src/modeling/rules/MatchUserProperty.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchUserProperty.js +49 -0
- package/build/src/modeling/rules/MatchUserProperty.js.map +1 -0
- package/build/src/modeling/rules/MatchUserRole.d.ts +29 -0
- package/build/src/modeling/rules/MatchUserRole.d.ts.map +1 -0
- package/build/src/modeling/rules/MatchUserRole.js +40 -0
- package/build/src/modeling/rules/MatchUserRole.js.map +1 -0
- package/build/src/modeling/rules/RateLimitRule.d.ts +61 -0
- package/build/src/modeling/rules/RateLimitRule.d.ts.map +1 -0
- package/build/src/modeling/rules/RateLimitRule.js +101 -0
- package/build/src/modeling/rules/RateLimitRule.js.map +1 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.d.ts +18 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.d.ts.map +1 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.js +35 -0
- package/build/src/modeling/rules/RateLimitingConfiguration.js.map +1 -0
- package/build/src/modeling/rules/index.d.ts +13 -0
- package/build/src/modeling/rules/index.d.ts.map +1 -0
- package/build/src/modeling/rules/index.js +10 -0
- package/build/src/modeling/rules/index.js.map +1 -0
- package/build/src/modeling/types.d.ts +6 -257
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +26 -26
- package/package.json +1 -1
- package/src/modeling/ApiModel.ts +21 -19
- package/src/modeling/ExposedEntity.ts +13 -18
- package/src/modeling/actions/Action.ts +64 -0
- package/src/modeling/actions/CreateAction.ts +30 -0
- package/src/modeling/actions/DeleteAction.ts +51 -0
- package/src/modeling/actions/ListAction.ts +58 -0
- package/src/modeling/actions/ReadAction.ts +32 -0
- package/src/modeling/actions/SearchAction.ts +38 -0
- package/src/modeling/actions/UpdateAction.ts +41 -0
- package/src/modeling/rules/AccessRule.ts +29 -0
- package/src/modeling/rules/AllowAuthenticated.ts +24 -0
- package/src/modeling/rules/AllowPublic.ts +24 -0
- package/src/modeling/rules/MatchEmailDomain.ts +39 -0
- package/src/modeling/rules/MatchResourceOwner.ts +43 -0
- package/src/modeling/rules/MatchUserProperty.ts +44 -0
- package/src/modeling/rules/MatchUserRole.ts +43 -0
- package/src/modeling/rules/RateLimitRule.ts +104 -0
- package/src/modeling/rules/RateLimitingConfiguration.ts +32 -0
- package/src/modeling/types.ts +6 -276
- package/tests/unit/modeling/actions/Action.spec.ts +109 -0
- package/tests/unit/modeling/actions/CreateAction.spec.ts +65 -0
- package/tests/unit/modeling/actions/DeleteAction.spec.ts +78 -0
- package/tests/unit/modeling/actions/ListAction.spec.ts +106 -0
- package/tests/unit/modeling/actions/ReadAction.spec.ts +77 -0
- package/tests/unit/modeling/actions/SearchAction.spec.ts +73 -0
- package/tests/unit/modeling/actions/UpdateAction.spec.ts +73 -0
- package/tests/unit/modeling/api_model.spec.ts +48 -3
- package/tests/unit/modeling/exposed_entity.spec.ts +73 -0
- package/tests/unit/modeling/rules/AccessRule.spec.ts +42 -0
- package/tests/unit/modeling/rules/AllowAuthenticated.spec.ts +28 -0
- package/tests/unit/modeling/rules/AllowPublic.spec.ts +28 -0
- package/tests/unit/modeling/rules/MatchEmailDomain.spec.ts +52 -0
- package/tests/unit/modeling/rules/MatchResourceOwner.spec.ts +37 -0
- package/tests/unit/modeling/rules/MatchUserProperty.spec.ts +58 -0
- package/tests/unit/modeling/rules/MatchUserRole.spec.ts +52 -0
- package/tests/unit/modeling/rules/RateLimitRule.spec.ts +70 -0
- package/tests/unit/modeling/rules/RateLimitingConfiguration.spec.ts +61 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AccessRule, AccessRuleSchema } from '../rules/AccessRule.js';
|
|
2
|
+
import { RateLimitingConfiguration, RateLimitingConfigurationSchema } from '../rules/RateLimitingConfiguration.js';
|
|
3
|
+
/**
|
|
4
|
+
* A base interface for common properties across all actions.
|
|
5
|
+
*/
|
|
6
|
+
export interface ActionSchema {
|
|
7
|
+
/**
|
|
8
|
+
* The specific kind of action (e.g., 'List', 'Read', etc.)
|
|
9
|
+
*/
|
|
10
|
+
kind: string;
|
|
11
|
+
/**
|
|
12
|
+
* Access control rules defining who can perform this action. It is only applied if the
|
|
13
|
+
* authorization strategy is set to 'RBAC'.
|
|
14
|
+
* If no rules grant access, it's denied by default making it essentially private.
|
|
15
|
+
*
|
|
16
|
+
* Note, the API can defined top level access rules that apply to all actions. If this property is set,
|
|
17
|
+
* it overrides the top level access rules for this specific action.
|
|
18
|
+
*
|
|
19
|
+
* It is an ordered list, meaning the first rule that matches the user will be applied.
|
|
20
|
+
* If multiple rules match, the first one in the list takes precedence.
|
|
21
|
+
* If no rules match, the action is denied.
|
|
22
|
+
*/
|
|
23
|
+
accessRule?: AccessRuleSchema[];
|
|
24
|
+
/**
|
|
25
|
+
* Optional configuration for action-wide rate limiting and throttling.
|
|
26
|
+
* Defines rules to protect the action from overuse.
|
|
27
|
+
*/
|
|
28
|
+
rateLimiting?: RateLimitingConfigurationSchema;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A base class for common properties across all actions.
|
|
32
|
+
*/
|
|
33
|
+
export declare class Action extends EventTarget implements ActionSchema {
|
|
34
|
+
accessor kind: string;
|
|
35
|
+
accessor accessRule: AccessRule[];
|
|
36
|
+
accessor rateLimiting: RateLimitingConfiguration | undefined;
|
|
37
|
+
constructor(state?: Partial<ActionSchema>);
|
|
38
|
+
notifyChange(): void;
|
|
39
|
+
toJSON(): ActionSchema;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAA;AAGlH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,+BAA+B,CAAA;CAC/C;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAY,YAAW,YAAY;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACP,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,CAAA;IACjC,QAAQ,CAAC,YAAY,EAAE,yBAAyB,GAAG,SAAS,CAAA;gBAE1E,KAAK,GAAE,OAAO,CAAC,YAAY,CAAM;IAO7C,YAAY;IAIZ,MAAM,IAAI,YAAY;CAYvB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from '../rules/AccessRule.js';
|
|
3
|
+
import { RateLimitingConfiguration } from '../rules/RateLimitingConfiguration.js';
|
|
4
|
+
import { observed } from '../../decorators/observed.js';
|
|
5
|
+
/**
|
|
6
|
+
* A base class for common properties across all actions.
|
|
7
|
+
*/
|
|
8
|
+
let Action = (() => {
|
|
9
|
+
let _classSuper = EventTarget;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
let _accessRule_decorators;
|
|
14
|
+
let _accessRule_initializers = [];
|
|
15
|
+
let _accessRule_extraInitializers = [];
|
|
16
|
+
let _rateLimiting_decorators;
|
|
17
|
+
let _rateLimiting_initializers = [];
|
|
18
|
+
let _rateLimiting_extraInitializers = [];
|
|
19
|
+
return class Action extends _classSuper {
|
|
20
|
+
static {
|
|
21
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
22
|
+
_kind_decorators = [observed()];
|
|
23
|
+
_accessRule_decorators = [observed({ deep: true })];
|
|
24
|
+
_rateLimiting_decorators = [observed({ deep: true })];
|
|
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
|
+
__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
|
+
__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);
|
|
28
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
29
|
+
}
|
|
30
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
31
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
32
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
33
|
+
#accessRule_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _accessRule_initializers, void 0));
|
|
34
|
+
get accessRule() { return this.#accessRule_accessor_storage; }
|
|
35
|
+
set accessRule(value) { this.#accessRule_accessor_storage = value; }
|
|
36
|
+
#rateLimiting_accessor_storage = (__runInitializers(this, _accessRule_extraInitializers), __runInitializers(this, _rateLimiting_initializers, void 0));
|
|
37
|
+
get rateLimiting() { return this.#rateLimiting_accessor_storage; }
|
|
38
|
+
set rateLimiting(value) { this.#rateLimiting_accessor_storage = value; }
|
|
39
|
+
constructor(state = {}) {
|
|
40
|
+
super();
|
|
41
|
+
__runInitializers(this, _rateLimiting_extraInitializers);
|
|
42
|
+
this.kind = state.kind || '';
|
|
43
|
+
this.accessRule = state.accessRule ? state.accessRule.map((rule) => new AccessRule(rule)) : [];
|
|
44
|
+
this.rateLimiting = state.rateLimiting ? new RateLimitingConfiguration(state.rateLimiting) : undefined;
|
|
45
|
+
}
|
|
46
|
+
notifyChange() {
|
|
47
|
+
this.dispatchEvent(new Event('change'));
|
|
48
|
+
}
|
|
49
|
+
toJSON() {
|
|
50
|
+
const result = {
|
|
51
|
+
kind: this.kind,
|
|
52
|
+
};
|
|
53
|
+
if (this.accessRule.length) {
|
|
54
|
+
result.accessRule = this.accessRule.map((rule) => rule.toJSON());
|
|
55
|
+
}
|
|
56
|
+
if (this.rateLimiting) {
|
|
57
|
+
result.rateLimiting = this.rateLimiting.toJSON();
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
})();
|
|
63
|
+
export { Action };
|
|
64
|
+
//# sourceMappingURL=Action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uCAAuC,CAAA;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AA8BvD;;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,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YAC9F,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'\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) => new AccessRule(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"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
/**
|
|
3
|
+
* Enables adding a new resource to a collection.
|
|
4
|
+
* Endpoint: POST /[entity-collection-name]
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateActionSchema extends ActionSchema {
|
|
7
|
+
kind: 'create';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Enables adding a new resource to a collection.
|
|
11
|
+
* Endpoint: POST /[entity-collection-name]
|
|
12
|
+
*/
|
|
13
|
+
export declare class CreateAction extends Action implements CreateActionSchema {
|
|
14
|
+
accessor kind: 'create';
|
|
15
|
+
constructor(state?: Partial<CreateActionSchema>);
|
|
16
|
+
toJSON(): CreateActionSchema;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=CreateAction.d.ts.map
|
|
@@ -0,0 +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;CAMtC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { Action } from './Action.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enables adding a new resource to a collection.
|
|
6
|
+
* Endpoint: POST /[entity-collection-name]
|
|
7
|
+
*/
|
|
8
|
+
let CreateAction = (() => {
|
|
9
|
+
let _classSuper = Action;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
return class CreateAction extends _classSuper {
|
|
14
|
+
static {
|
|
15
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
16
|
+
_kind_decorators = [observed()];
|
|
17
|
+
__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);
|
|
18
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
19
|
+
}
|
|
20
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
21
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
22
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
23
|
+
constructor(state = {}) {
|
|
24
|
+
super(state);
|
|
25
|
+
__runInitializers(this, _kind_extraInitializers);
|
|
26
|
+
this.kind = 'create';
|
|
27
|
+
}
|
|
28
|
+
toJSON() {
|
|
29
|
+
return {
|
|
30
|
+
...super.toJSON(),
|
|
31
|
+
kind: 'create',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
export { CreateAction };
|
|
37
|
+
//# sourceMappingURL=CreateAction.js.map
|
|
@@ -0,0 +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;;;SAbU,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"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
export type DeleteStrategy = 'soft' | 'hard';
|
|
3
|
+
/**
|
|
4
|
+
* Enables removing an existing resource.
|
|
5
|
+
* Endpoint: DELETE /[entity-collection-name]/{id}
|
|
6
|
+
*/
|
|
7
|
+
export interface DeleteActionSchema extends ActionSchema {
|
|
8
|
+
kind: 'delete';
|
|
9
|
+
/**
|
|
10
|
+
* The strategy for deletion. Default: Soft Delete.
|
|
11
|
+
*
|
|
12
|
+
* @default 'soft'
|
|
13
|
+
*/
|
|
14
|
+
strategy?: DeleteStrategy;
|
|
15
|
+
/**
|
|
16
|
+
* The data retention period (in days) for soft-deleted resources.
|
|
17
|
+
* This defines how long the data should be kept before it is permanently deleted.
|
|
18
|
+
*
|
|
19
|
+
* @default 30
|
|
20
|
+
*/
|
|
21
|
+
retentionPeriod?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Enables removing an existing resource.
|
|
25
|
+
* Endpoint: DELETE /[entity-collection-name]/{id}
|
|
26
|
+
*/
|
|
27
|
+
export declare class DeleteAction extends Action implements DeleteActionSchema {
|
|
28
|
+
accessor kind: 'delete';
|
|
29
|
+
accessor strategy: DeleteStrategy;
|
|
30
|
+
accessor retentionPeriod: number;
|
|
31
|
+
constructor(state?: Partial<DeleteActionSchema>);
|
|
32
|
+
toJSON(): DeleteActionSchema;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=DeleteAction.d.ts.map
|
|
@@ -0,0 +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;AAGvD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5C;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAChC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;gBAEhC,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAO1C,MAAM,IAAI,kBAAkB;CAQtC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { Action } from './Action.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enables removing an existing resource.
|
|
6
|
+
* Endpoint: DELETE /[entity-collection-name]/{id}
|
|
7
|
+
*/
|
|
8
|
+
let DeleteAction = (() => {
|
|
9
|
+
let _classSuper = Action;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
let _strategy_decorators;
|
|
14
|
+
let _strategy_initializers = [];
|
|
15
|
+
let _strategy_extraInitializers = [];
|
|
16
|
+
let _retentionPeriod_decorators;
|
|
17
|
+
let _retentionPeriod_initializers = [];
|
|
18
|
+
let _retentionPeriod_extraInitializers = [];
|
|
19
|
+
return class DeleteAction extends _classSuper {
|
|
20
|
+
static {
|
|
21
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
22
|
+
_kind_decorators = [observed()];
|
|
23
|
+
_strategy_decorators = [observed()];
|
|
24
|
+
_retentionPeriod_decorators = [observed()];
|
|
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
|
+
__esDecorate(this, null, _strategy_decorators, { kind: "accessor", name: "strategy", static: false, private: false, access: { has: obj => "strategy" in obj, get: obj => obj.strategy, set: (obj, value) => { obj.strategy = value; } }, metadata: _metadata }, _strategy_initializers, _strategy_extraInitializers);
|
|
27
|
+
__esDecorate(this, null, _retentionPeriod_decorators, { kind: "accessor", name: "retentionPeriod", static: false, private: false, access: { has: obj => "retentionPeriod" in obj, get: obj => obj.retentionPeriod, set: (obj, value) => { obj.retentionPeriod = value; } }, metadata: _metadata }, _retentionPeriod_initializers, _retentionPeriod_extraInitializers);
|
|
28
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
29
|
+
}
|
|
30
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
31
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
32
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
33
|
+
#strategy_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _strategy_initializers, void 0));
|
|
34
|
+
get strategy() { return this.#strategy_accessor_storage; }
|
|
35
|
+
set strategy(value) { this.#strategy_accessor_storage = value; }
|
|
36
|
+
#retentionPeriod_accessor_storage = (__runInitializers(this, _strategy_extraInitializers), __runInitializers(this, _retentionPeriod_initializers, void 0));
|
|
37
|
+
get retentionPeriod() { return this.#retentionPeriod_accessor_storage; }
|
|
38
|
+
set retentionPeriod(value) { this.#retentionPeriod_accessor_storage = value; }
|
|
39
|
+
constructor(state = {}) {
|
|
40
|
+
super(state);
|
|
41
|
+
__runInitializers(this, _retentionPeriod_extraInitializers);
|
|
42
|
+
this.kind = 'delete';
|
|
43
|
+
this.strategy = state.strategy || 'soft';
|
|
44
|
+
this.retentionPeriod = state.retentionPeriod ?? 30;
|
|
45
|
+
}
|
|
46
|
+
toJSON() {
|
|
47
|
+
return {
|
|
48
|
+
...super.toJSON(),
|
|
49
|
+
kind: 'delete',
|
|
50
|
+
strategy: this.strategy,
|
|
51
|
+
retentionPeriod: this.retentionPeriod,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
export { DeleteAction };
|
|
57
|
+
//# sourceMappingURL=DeleteAction.js.map
|
|
@@ -0,0 +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;;;SAnBU,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"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PaginationStrategy } from '../types.js';
|
|
2
|
+
import { Action, type ActionSchema } from './Action.js';
|
|
3
|
+
/**
|
|
4
|
+
* Enables retrieving a collection of resources.
|
|
5
|
+
* Endpoint: GET /[entity-collection-name]
|
|
6
|
+
*/
|
|
7
|
+
export interface ListActionSchema extends ActionSchema {
|
|
8
|
+
kind: 'list';
|
|
9
|
+
/**
|
|
10
|
+
* The pagination strategy used for this action.
|
|
11
|
+
* This defines how the results are paginated when retrieving a collection of resources.
|
|
12
|
+
* It can be either 'cursor' or 'offset'.
|
|
13
|
+
*/
|
|
14
|
+
pagination: PaginationStrategy;
|
|
15
|
+
/**
|
|
16
|
+
* Fields from the entity that can be used for filtering.
|
|
17
|
+
* Must be marked as "indexable" in the Data Model.
|
|
18
|
+
*/
|
|
19
|
+
filterableFields: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Fields from the entity that can be used for sorting.
|
|
22
|
+
*/
|
|
23
|
+
sortableFields: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Enables retrieving a collection of resources.
|
|
27
|
+
* Endpoint: GET /[entity-collection-name]
|
|
28
|
+
*/
|
|
29
|
+
export declare class ListAction extends Action implements ListActionSchema {
|
|
30
|
+
accessor kind: 'list';
|
|
31
|
+
accessor pagination: PaginationStrategy;
|
|
32
|
+
accessor filterableFields: string[];
|
|
33
|
+
accessor sortableFields: string[];
|
|
34
|
+
constructor(state?: Partial<ListActionSchema>);
|
|
35
|
+
toJSON(): ListActionSchema;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=ListAction.d.ts.map
|
|
@@ -0,0 +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,SAA8B,IAAI,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAA;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAA;gBAE/C,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAYxC,MAAM,IAAI,gBAAgB;CAQpC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { Action } from './Action.js';
|
|
3
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enables retrieving a collection of resources.
|
|
6
|
+
* Endpoint: GET /[entity-collection-name]
|
|
7
|
+
*/
|
|
8
|
+
let ListAction = (() => {
|
|
9
|
+
let _classSuper = Action;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
let _pagination_decorators;
|
|
14
|
+
let _pagination_initializers = [];
|
|
15
|
+
let _pagination_extraInitializers = [];
|
|
16
|
+
let _filterableFields_decorators;
|
|
17
|
+
let _filterableFields_initializers = [];
|
|
18
|
+
let _filterableFields_extraInitializers = [];
|
|
19
|
+
let _sortableFields_decorators;
|
|
20
|
+
let _sortableFields_initializers = [];
|
|
21
|
+
let _sortableFields_extraInitializers = [];
|
|
22
|
+
return class ListAction extends _classSuper {
|
|
23
|
+
static {
|
|
24
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
25
|
+
_kind_decorators = [observed()];
|
|
26
|
+
_pagination_decorators = [observed({ deep: true })];
|
|
27
|
+
_filterableFields_decorators = [observed({ deep: true })];
|
|
28
|
+
_sortableFields_decorators = [observed({ deep: true })];
|
|
29
|
+
__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);
|
|
30
|
+
__esDecorate(this, null, _pagination_decorators, { kind: "accessor", name: "pagination", static: false, private: false, access: { has: obj => "pagination" in obj, get: obj => obj.pagination, set: (obj, value) => { obj.pagination = value; } }, metadata: _metadata }, _pagination_initializers, _pagination_extraInitializers);
|
|
31
|
+
__esDecorate(this, null, _filterableFields_decorators, { kind: "accessor", name: "filterableFields", static: false, private: false, access: { has: obj => "filterableFields" in obj, get: obj => obj.filterableFields, set: (obj, value) => { obj.filterableFields = value; } }, metadata: _metadata }, _filterableFields_initializers, _filterableFields_extraInitializers);
|
|
32
|
+
__esDecorate(this, null, _sortableFields_decorators, { kind: "accessor", name: "sortableFields", static: false, private: false, access: { has: obj => "sortableFields" in obj, get: obj => obj.sortableFields, set: (obj, value) => { obj.sortableFields = value; } }, metadata: _metadata }, _sortableFields_initializers, _sortableFields_extraInitializers);
|
|
33
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
34
|
+
}
|
|
35
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
36
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
37
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
38
|
+
#pagination_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _pagination_initializers, void 0));
|
|
39
|
+
get pagination() { return this.#pagination_accessor_storage; }
|
|
40
|
+
set pagination(value) { this.#pagination_accessor_storage = value; }
|
|
41
|
+
#filterableFields_accessor_storage = (__runInitializers(this, _pagination_extraInitializers), __runInitializers(this, _filterableFields_initializers, void 0));
|
|
42
|
+
get filterableFields() { return this.#filterableFields_accessor_storage; }
|
|
43
|
+
set filterableFields(value) { this.#filterableFields_accessor_storage = value; }
|
|
44
|
+
#sortableFields_accessor_storage = (__runInitializers(this, _filterableFields_extraInitializers), __runInitializers(this, _sortableFields_initializers, void 0));
|
|
45
|
+
get sortableFields() { return this.#sortableFields_accessor_storage; }
|
|
46
|
+
set sortableFields(value) { this.#sortableFields_accessor_storage = value; }
|
|
47
|
+
constructor(state = {}) {
|
|
48
|
+
super(state);
|
|
49
|
+
__runInitializers(this, _sortableFields_extraInitializers);
|
|
50
|
+
this.kind = state.kind || 'list';
|
|
51
|
+
this.pagination = state.pagination
|
|
52
|
+
? { ...state.pagination }
|
|
53
|
+
: {
|
|
54
|
+
kind: 'offset',
|
|
55
|
+
};
|
|
56
|
+
this.filterableFields = state.filterableFields ? [...state.filterableFields] : [];
|
|
57
|
+
this.sortableFields = state.sortableFields ? [...state.sortableFields] : [];
|
|
58
|
+
}
|
|
59
|
+
toJSON() {
|
|
60
|
+
return {
|
|
61
|
+
...super.toJSON(),
|
|
62
|
+
pagination: structuredClone(toRaw(this, this.pagination)),
|
|
63
|
+
filterableFields: structuredClone(toRaw(this, this.filterableFields)),
|
|
64
|
+
sortableFields: structuredClone(toRaw(this, this.sortableFields)),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
})();
|
|
69
|
+
export { ListAction };
|
|
70
|
+
//# sourceMappingURL=ListAction.js.map
|
|
@@ -0,0 +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,2GAAU;YACnC,+LAAS,cAAc,6BAAd,cAAc,uGAAU;;;QAH/C,6EAA8B;QAA9B,IAAkB,IAAI,0CAAQ;QAA9B,IAAkB,IAAI,gDAAQ;QAChB,6IAAuC;QAAvC,IAAS,UAAU,gDAAoB;QAAvC,IAAS,UAAU,sDAAoB;QACvC,+JAAmC;QAAnC,IAAS,gBAAgB,sDAAU;QAAnC,IAAS,gBAAgB,4DAAU;QACnC,iKAAiC;QAAjC,IAAS,cAAc,oDAAU;QAAjC,IAAS,cAAc,0DAAU;QAE3D,YAAY,QAAmC,EAAE;YAC/C,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,MAAM,CAAA;YAChC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU;gBAChC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE;gBACzB,CAAC,CAAC;oBACE,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;;;SAzBU,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"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
/**
|
|
3
|
+
* Enables retrieving a single resource by its ID.
|
|
4
|
+
* Endpoint: GET /[entity-collection-name]/{id}
|
|
5
|
+
*/
|
|
6
|
+
export interface ReadActionSchema extends ActionSchema {
|
|
7
|
+
kind: 'read';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Enables retrieving a single resource by its ID.
|
|
11
|
+
* Endpoint: GET /[entity-collection-name]/{id}
|
|
12
|
+
*/
|
|
13
|
+
export declare class ReadAction extends Action implements ReadActionSchema {
|
|
14
|
+
accessor kind: 'read';
|
|
15
|
+
constructor(state?: Partial<ReadActionSchema>);
|
|
16
|
+
toJSON(): ReadActionSchema;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ReadAction.d.ts.map
|
|
@@ -0,0 +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;CAMpC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { Action } from './Action.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enables retrieving a single resource by its ID.
|
|
6
|
+
* Endpoint: GET /[entity-collection-name]/{id}
|
|
7
|
+
*/
|
|
8
|
+
let ReadAction = (() => {
|
|
9
|
+
let _classSuper = Action;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
return class ReadAction extends _classSuper {
|
|
14
|
+
static {
|
|
15
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
16
|
+
_kind_decorators = [observed()];
|
|
17
|
+
__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);
|
|
18
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
19
|
+
}
|
|
20
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
21
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
22
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
23
|
+
constructor(state = {}) {
|
|
24
|
+
super(state);
|
|
25
|
+
__runInitializers(this, _kind_extraInitializers);
|
|
26
|
+
this.kind = 'read';
|
|
27
|
+
}
|
|
28
|
+
toJSON() {
|
|
29
|
+
return {
|
|
30
|
+
...super.toJSON(),
|
|
31
|
+
kind: 'read',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
export { ReadAction };
|
|
37
|
+
//# sourceMappingURL=ReadAction.js.map
|
|
@@ -0,0 +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;;;SAbU,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"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
/**
|
|
3
|
+
* Enables keyword-based search across specified fields.
|
|
4
|
+
* Endpoint: GET /[entity-collection-name]/search
|
|
5
|
+
*/
|
|
6
|
+
export interface SearchActionSchema extends ActionSchema {
|
|
7
|
+
kind: 'search';
|
|
8
|
+
/**
|
|
9
|
+
* The fields within the entity to be included in the search scope.
|
|
10
|
+
* Must be "indexable" and typically text-based.
|
|
11
|
+
*/
|
|
12
|
+
fields: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Enables keyword-based search across specified fields.
|
|
16
|
+
* Endpoint: GET /[entity-collection-name]/search
|
|
17
|
+
*/
|
|
18
|
+
export declare class SearchAction extends Action implements SearchActionSchema {
|
|
19
|
+
accessor kind: 'search';
|
|
20
|
+
accessor fields: string[];
|
|
21
|
+
constructor(state?: Partial<SearchActionSchema>);
|
|
22
|
+
toJSON(): SearchActionSchema;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=SearchAction.d.ts.map
|
|
@@ -0,0 +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;CAOtC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { Action } from './Action.js';
|
|
3
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enables keyword-based search across specified fields.
|
|
6
|
+
* Endpoint: GET /[entity-collection-name]/search
|
|
7
|
+
*/
|
|
8
|
+
let SearchAction = (() => {
|
|
9
|
+
let _classSuper = Action;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
let _fields_decorators;
|
|
14
|
+
let _fields_initializers = [];
|
|
15
|
+
let _fields_extraInitializers = [];
|
|
16
|
+
return class SearchAction extends _classSuper {
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
_kind_decorators = [observed()];
|
|
20
|
+
_fields_decorators = [observed({ deep: true })];
|
|
21
|
+
__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);
|
|
22
|
+
__esDecorate(this, null, _fields_decorators, { kind: "accessor", name: "fields", static: false, private: false, access: { has: obj => "fields" in obj, get: obj => obj.fields, set: (obj, value) => { obj.fields = value; } }, metadata: _metadata }, _fields_initializers, _fields_extraInitializers);
|
|
23
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
24
|
+
}
|
|
25
|
+
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
26
|
+
get kind() { return this.#kind_accessor_storage; }
|
|
27
|
+
set kind(value) { this.#kind_accessor_storage = value; }
|
|
28
|
+
#fields_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _fields_initializers, void 0));
|
|
29
|
+
get fields() { return this.#fields_accessor_storage; }
|
|
30
|
+
set fields(value) { this.#fields_accessor_storage = value; }
|
|
31
|
+
constructor(state = {}) {
|
|
32
|
+
super(state);
|
|
33
|
+
__runInitializers(this, _fields_extraInitializers);
|
|
34
|
+
this.kind = 'search';
|
|
35
|
+
this.fields = state.fields ? [...state.fields] : [];
|
|
36
|
+
}
|
|
37
|
+
toJSON() {
|
|
38
|
+
return {
|
|
39
|
+
...super.toJSON(),
|
|
40
|
+
kind: 'search',
|
|
41
|
+
fields: structuredClone(toRaw(this, this.fields)),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
export { SearchAction };
|
|
47
|
+
//# sourceMappingURL=SearchAction.js.map
|
|
@@ -0,0 +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;;;SAhBU,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"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
/**
|
|
3
|
+
* Enables modifying an existing resource.
|
|
4
|
+
* Endpoints: PUT or PATCH /[entity-collection-name]/{id}
|
|
5
|
+
*/
|
|
6
|
+
export interface UpdateActionSchema extends ActionSchema {
|
|
7
|
+
kind: 'update';
|
|
8
|
+
/**
|
|
9
|
+
* The allowed HTTP methods for updates. Default: PATCH only.
|
|
10
|
+
*
|
|
11
|
+
* These two methods represent the two common ways to update a resource:
|
|
12
|
+
* - PUT: Replaces the entire resource with the provided data.
|
|
13
|
+
* - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.
|
|
14
|
+
*/
|
|
15
|
+
allowedMethods: ('PUT' | 'PATCH')[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Enables modifying an existing resource.
|
|
19
|
+
* Endpoints: PUT or PATCH /[entity-collection-name]/{id}
|
|
20
|
+
*/
|
|
21
|
+
export declare class UpdateAction extends Action implements UpdateActionSchema {
|
|
22
|
+
accessor kind: 'update';
|
|
23
|
+
accessor allowedMethods: ('PUT' | 'PATCH')[];
|
|
24
|
+
constructor(state?: Partial<UpdateActionSchema>);
|
|
25
|
+
toJSON(): UpdateActionSchema;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=UpdateAction.d.ts.map
|
|
@@ -0,0 +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;CAOtC"}
|