@api-client/core 0.18.57 → 0.18.59
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/decorators/observed.d.ts.map +1 -1
- package/build/src/decorators/observed.js +15 -1
- package/build/src/decorators/observed.js.map +1 -1
- 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 +20 -0
- package/build/src/modeling/actions/CreateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/CreateAction.js +43 -0
- package/build/src/modeling/actions/CreateAction.js.map +1 -0
- package/build/src/modeling/actions/DeleteAction.d.ts +36 -0
- package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -0
- package/build/src/modeling/actions/DeleteAction.js +63 -0
- package/build/src/modeling/actions/DeleteAction.js.map +1 -0
- package/build/src/modeling/actions/ListAction.d.ts +39 -0
- package/build/src/modeling/actions/ListAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ListAction.js +76 -0
- package/build/src/modeling/actions/ListAction.js.map +1 -0
- package/build/src/modeling/actions/ReadAction.d.ts +20 -0
- package/build/src/modeling/actions/ReadAction.d.ts.map +1 -0
- package/build/src/modeling/actions/ReadAction.js +43 -0
- package/build/src/modeling/actions/ReadAction.js.map +1 -0
- package/build/src/modeling/actions/SearchAction.d.ts +26 -0
- package/build/src/modeling/actions/SearchAction.d.ts.map +1 -0
- package/build/src/modeling/actions/SearchAction.js +53 -0
- package/build/src/modeling/actions/SearchAction.js.map +1 -0
- package/build/src/modeling/actions/UpdateAction.d.ts +29 -0
- package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -0
- package/build/src/modeling/actions/UpdateAction.js +53 -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 +14 -0
- package/build/src/modeling/rules/index.d.ts.map +1 -0
- package/build/src/modeling/rules/index.js +11 -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 +6 -6
- package/package.json +1 -1
- package/src/decorators/observed.ts +15 -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 +38 -0
- package/src/modeling/actions/DeleteAction.ts +59 -0
- package/src/modeling/actions/ListAction.ts +66 -0
- package/src/modeling/actions/ReadAction.ts +40 -0
- package/src/modeling/actions/SearchAction.ts +46 -0
- package/src/modeling/actions/UpdateAction.ts +49 -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/decorators/observed.spec.ts +42 -0
- 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,43 @@
|
|
|
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
|
+
static isReadAction(action) {
|
|
35
|
+
return action.kind === 'read';
|
|
36
|
+
}
|
|
37
|
+
static isReadActionSchema(schema) {
|
|
38
|
+
return schema.kind === 'read';
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
export { ReadAction };
|
|
43
|
+
//# 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;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"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema;
|
|
24
|
+
static isSearchAction(action: Action): action is SearchAction;
|
|
25
|
+
}
|
|
26
|
+
//# 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;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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
static isSearchActionSchema(schema) {
|
|
45
|
+
return schema.kind === 'search';
|
|
46
|
+
}
|
|
47
|
+
static isSearchAction(action) {
|
|
48
|
+
return action.kind === 'search';
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
export { SearchAction };
|
|
53
|
+
//# 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;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"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
static isUpdateAction(action: Action): action is UpdateAction;
|
|
27
|
+
static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema;
|
|
28
|
+
}
|
|
29
|
+
//# 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;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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { Action } from './Action.js';
|
|
3
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* Enables modifying an existing resource.
|
|
6
|
+
* Endpoints: PUT or PATCH /[entity-collection-name]/{id}
|
|
7
|
+
*/
|
|
8
|
+
let UpdateAction = (() => {
|
|
9
|
+
let _classSuper = Action;
|
|
10
|
+
let _kind_decorators;
|
|
11
|
+
let _kind_initializers = [];
|
|
12
|
+
let _kind_extraInitializers = [];
|
|
13
|
+
let _allowedMethods_decorators;
|
|
14
|
+
let _allowedMethods_initializers = [];
|
|
15
|
+
let _allowedMethods_extraInitializers = [];
|
|
16
|
+
return class UpdateAction 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
|
+
_allowedMethods_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, _allowedMethods_decorators, { kind: "accessor", name: "allowedMethods", static: false, private: false, access: { has: obj => "allowedMethods" in obj, get: obj => obj.allowedMethods, set: (obj, value) => { obj.allowedMethods = value; } }, metadata: _metadata }, _allowedMethods_initializers, _allowedMethods_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
|
+
#allowedMethods_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _allowedMethods_initializers, void 0));
|
|
29
|
+
get allowedMethods() { return this.#allowedMethods_accessor_storage; }
|
|
30
|
+
set allowedMethods(value) { this.#allowedMethods_accessor_storage = value; }
|
|
31
|
+
constructor(state = {}) {
|
|
32
|
+
super(state);
|
|
33
|
+
__runInitializers(this, _allowedMethods_extraInitializers);
|
|
34
|
+
this.kind = 'update';
|
|
35
|
+
this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH'];
|
|
36
|
+
}
|
|
37
|
+
toJSON() {
|
|
38
|
+
return {
|
|
39
|
+
...super.toJSON(),
|
|
40
|
+
kind: 'update',
|
|
41
|
+
allowedMethods: structuredClone(toRaw(this, this.allowedMethods)),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static isUpdateAction(action) {
|
|
45
|
+
return action.kind === 'update';
|
|
46
|
+
}
|
|
47
|
+
static isUpdateActionSchema(schema) {
|
|
48
|
+
return schema.kind === 'update';
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
export { UpdateAction };
|
|
53
|
+
//# sourceMappingURL=UpdateAction.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
import { CreateAction, type CreateActionSchema } from './CreateAction.js';
|
|
3
|
+
import { DeleteAction, type DeleteActionSchema } from './DeleteAction.js';
|
|
4
|
+
import { ListAction, type ListActionSchema } from './ListAction.js';
|
|
5
|
+
import { ReadAction, type ReadActionSchema } from './ReadAction.js';
|
|
6
|
+
import { SearchAction, type SearchActionSchema } from './SearchAction.js';
|
|
7
|
+
import { UpdateAction, type UpdateActionSchema } from './UpdateAction.js';
|
|
8
|
+
export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction };
|
|
9
|
+
export type { CreateActionSchema, DeleteActionSchema, ListActionSchema, ReadActionSchema, SearchActionSchema, UpdateActionSchema, };
|
|
10
|
+
/**
|
|
11
|
+
* Represents a specific, configurable API operation applied to a Data Entity.
|
|
12
|
+
* Corresponds to common RESTful interactions.
|
|
13
|
+
*/
|
|
14
|
+
export type ApiAction = CreateAction | DeleteAction | ListAction | ReadAction | SearchAction | UpdateAction;
|
|
15
|
+
/**
|
|
16
|
+
* Schema representation of a specific, configurable API operation applied to a Data Entity.
|
|
17
|
+
* Corresponds to common RESTful interactions.
|
|
18
|
+
*/
|
|
19
|
+
export type ApiActionSchema = CreateActionSchema | DeleteActionSchema | ListActionSchema | ReadActionSchema | SearchActionSchema | UpdateActionSchema;
|
|
20
|
+
/**
|
|
21
|
+
* The kind of action to perform.
|
|
22
|
+
*/
|
|
23
|
+
export type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Action } from './Action.js';
|
|
2
|
+
import { CreateAction } from './CreateAction.js';
|
|
3
|
+
import { DeleteAction } from './DeleteAction.js';
|
|
4
|
+
import { ListAction } from './ListAction.js';
|
|
5
|
+
import { ReadAction } from './ReadAction.js';
|
|
6
|
+
import { SearchAction } from './SearchAction.js';
|
|
7
|
+
import { UpdateAction } from './UpdateAction.js';
|
|
8
|
+
export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction };
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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;AAEzE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA","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'\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"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './actions/index.js';
|
|
2
|
+
export * from './rules/index.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export { ApiModel, type ApiModelSchema, type ApiContact, type ApiLicense } from './ApiModel.js';
|
|
5
|
+
export { DataDomain, type DataDomainSchema } from './DataDomain.js';
|
|
6
|
+
export { DomainAssociation, type DomainAssociationSchema, type OnDeleteRule } from './DomainAssociation.js';
|
|
7
|
+
export { DomainEntity, type DomainEntitySchema, type EntityOrderedItem } from './DomainEntity.js';
|
|
8
|
+
export { DomainModel, type DomainModelSchema, type ModelOrderedItem } from './DomainModel.js';
|
|
9
|
+
export { DomainNamespace, type DomainNamespaceSchema, type NamespaceOrderedItem } from './DomainNamespace.js';
|
|
10
|
+
export { DomainProperty, type DomainPropertySchema } from './DomainProperty.js';
|
|
11
|
+
export { ExposedEntity } from './ExposedEntity.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './actions/index.js';
|
|
2
|
+
export * from './rules/index.js';
|
|
3
|
+
export * from './types.js';
|
|
4
|
+
export { ApiModel } from './ApiModel.js';
|
|
5
|
+
export { DataDomain } from './DataDomain.js';
|
|
6
|
+
export { DomainAssociation } from './DomainAssociation.js';
|
|
7
|
+
export { DomainEntity } from './DomainEntity.js';
|
|
8
|
+
export { DomainModel } from './DomainModel.js';
|
|
9
|
+
export { DomainNamespace } from './DomainNamespace.js';
|
|
10
|
+
export { DomainProperty } from './DomainProperty.js';
|
|
11
|
+
export { ExposedEntity } from './ExposedEntity.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface AccessRuleSchema {
|
|
2
|
+
/**
|
|
3
|
+
* The unique identifier for the access rule.
|
|
4
|
+
* This is used to reference the rule in the API configuration.
|
|
5
|
+
*/
|
|
6
|
+
type: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Base class for all access rules.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AccessRule extends EventTarget implements AccessRuleSchema {
|
|
12
|
+
readonly type: string;
|
|
13
|
+
constructor(state?: Partial<AccessRuleSchema>);
|
|
14
|
+
toJSON(): AccessRuleSchema;
|
|
15
|
+
notifyChange(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=AccessRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessRule.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/AccessRule.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,WAAY,YAAW,gBAAgB;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;gBAET,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAKjD,MAAM,IAAI,gBAAgB;IAM1B,YAAY;CAGb"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all access rules.
|
|
3
|
+
*/
|
|
4
|
+
export class AccessRule extends EventTarget {
|
|
5
|
+
type;
|
|
6
|
+
constructor(state = {}) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = state.type ?? '';
|
|
9
|
+
}
|
|
10
|
+
toJSON() {
|
|
11
|
+
return {
|
|
12
|
+
type: this.type,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
notifyChange() {
|
|
16
|
+
this.dispatchEvent(new Event('change'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=AccessRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessRule.js","sourceRoot":"","sources":["../../../../src/modeling/rules/AccessRule.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IAChC,IAAI,CAAQ;IAErB,YAAY,QAAmC,EAAE;QAC/C,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAA;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;IACzC,CAAC;CACF","sourcesContent":["export interface AccessRuleSchema {\n /**\n * The unique identifier for the access rule.\n * This is used to reference the rule in the API configuration.\n */\n type: string\n}\n\n/**\n * Base class for all access rules.\n */\nexport class AccessRule extends EventTarget implements AccessRuleSchema {\n readonly type: string\n\n constructor(state: Partial<AccessRuleSchema> = {}) {\n super()\n this.type = state.type ?? ''\n }\n\n toJSON(): AccessRuleSchema {\n return {\n type: this.type,\n }\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed for any authenticated user.
|
|
4
|
+
* This rule does not impose any additional restrictions based on user properties or resource ownership.
|
|
5
|
+
* It is used for resources that should be accessible to all logged-in users.
|
|
6
|
+
*/
|
|
7
|
+
export interface AllowAuthenticatedAccessRuleSchema extends AccessRuleSchema {
|
|
8
|
+
type: 'authenticated';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The action is allowed for any authenticated user.
|
|
12
|
+
* This rule does not impose any additional restrictions based on user properties or resource ownership.
|
|
13
|
+
* It is used for resources that should be accessible to all logged-in users.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AllowAuthenticatedAccessRule extends AccessRule implements AllowAuthenticatedAccessRuleSchema {
|
|
16
|
+
readonly type: 'authenticated';
|
|
17
|
+
constructor(state?: Partial<AllowAuthenticatedAccessRuleSchema>);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=AllowAuthenticated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllowAuthenticated.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/AllowAuthenticated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEnE;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,gBAAgB;IAC1E,IAAI,EAAE,eAAe,CAAA;CACtB;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,UAAW,YAAW,kCAAkC;IACxG,SAAkB,IAAI,EAAE,eAAe,CAAA;gBAE3B,KAAK,GAAE,OAAO,CAAC,kCAAkC,CAAM;CAIpE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AccessRule } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed for any authenticated user.
|
|
4
|
+
* This rule does not impose any additional restrictions based on user properties or resource ownership.
|
|
5
|
+
* It is used for resources that should be accessible to all logged-in users.
|
|
6
|
+
*/
|
|
7
|
+
export class AllowAuthenticatedAccessRule extends AccessRule {
|
|
8
|
+
type;
|
|
9
|
+
constructor(state = {}) {
|
|
10
|
+
super(state);
|
|
11
|
+
this.type = 'authenticated';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=AllowAuthenticated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllowAuthenticated.js","sourceRoot":"","sources":["../../../../src/modeling/rules/AllowAuthenticated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AAWnE;;;;GAIG;AACH,MAAM,OAAO,4BAA6B,SAAQ,UAAU;IACxC,IAAI,CAAiB;IAEvC,YAAY,QAAqD,EAAE;QACjE,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;IAC7B,CAAC;CACF","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\n\n/**\n * The action is allowed for any authenticated user.\n * This rule does not impose any additional restrictions based on user properties or resource ownership.\n * It is used for resources that should be accessible to all logged-in users.\n */\nexport interface AllowAuthenticatedAccessRuleSchema extends AccessRuleSchema {\n type: 'authenticated'\n}\n\n/**\n * The action is allowed for any authenticated user.\n * This rule does not impose any additional restrictions based on user properties or resource ownership.\n * It is used for resources that should be accessible to all logged-in users.\n */\nexport class AllowAuthenticatedAccessRule extends AccessRule implements AllowAuthenticatedAccessRuleSchema {\n override readonly type: 'authenticated'\n\n constructor(state: Partial<AllowAuthenticatedAccessRuleSchema> = {}) {\n super(state)\n this.type = 'authenticated'\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed for all users, including unauthenticated ones.
|
|
4
|
+
* This is typically used for public APIs or resources that do not require authentication.
|
|
5
|
+
* It is the most permissive rule and should be used with caution.
|
|
6
|
+
*/
|
|
7
|
+
export interface AllowPublicAccessRuleSchema extends AccessRuleSchema {
|
|
8
|
+
type: 'public';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The action is allowed for all users, including unauthenticated ones.
|
|
12
|
+
* This is typically used for public APIs or resources that do not require authentication.
|
|
13
|
+
* It is the most permissive rule and should be used with caution.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AllowPublicAccessRule extends AccessRule implements AllowPublicAccessRuleSchema {
|
|
16
|
+
readonly type: 'public';
|
|
17
|
+
constructor(state?: Partial<AllowPublicAccessRuleSchema>);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=AllowPublic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllowPublic.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/AllowPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEnE;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,IAAI,EAAE,QAAQ,CAAA;CACf;AAED;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,UAAW,YAAW,2BAA2B;IAC1F,SAAkB,IAAI,EAAE,QAAQ,CAAA;gBAEpB,KAAK,GAAE,OAAO,CAAC,2BAA2B,CAAM;CAI7D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AccessRule } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed for all users, including unauthenticated ones.
|
|
4
|
+
* This is typically used for public APIs or resources that do not require authentication.
|
|
5
|
+
* It is the most permissive rule and should be used with caution.
|
|
6
|
+
*/
|
|
7
|
+
export class AllowPublicAccessRule extends AccessRule {
|
|
8
|
+
type;
|
|
9
|
+
constructor(state = {}) {
|
|
10
|
+
super(state);
|
|
11
|
+
this.type = 'public';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=AllowPublic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllowPublic.js","sourceRoot":"","sources":["../../../../src/modeling/rules/AllowPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AAWnE;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IACjC,IAAI,CAAU;IAEhC,YAAY,QAA8C,EAAE;QAC1D,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;IACtB,CAAC;CACF","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\n\n/**\n * The action is allowed for all users, including unauthenticated ones.\n * This is typically used for public APIs or resources that do not require authentication.\n * It is the most permissive rule and should be used with caution.\n */\nexport interface AllowPublicAccessRuleSchema extends AccessRuleSchema {\n type: 'public'\n}\n\n/**\n * The action is allowed for all users, including unauthenticated ones.\n * This is typically used for public APIs or resources that do not require authentication.\n * It is the most permissive rule and should be used with caution.\n */\nexport class AllowPublicAccessRule extends AccessRule implements AllowPublicAccessRuleSchema {\n override readonly type: 'public'\n\n constructor(state: Partial<AllowPublicAccessRuleSchema> = {}) {\n super(state)\n this.type = 'public'\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed if the authenticated user's email domain matches a specific domain.
|
|
4
|
+
* This is used to restrict access based on the user's email address.
|
|
5
|
+
* For example, only users with an email address from "my-company.com" can access certain resources.
|
|
6
|
+
*/
|
|
7
|
+
export interface MatchEmailDomainAccessRuleSchema extends AccessRuleSchema {
|
|
8
|
+
type: 'matchEmailDomain';
|
|
9
|
+
/**
|
|
10
|
+
* The email domains that the authenticated user's email must match.
|
|
11
|
+
*/
|
|
12
|
+
domains: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The action is allowed if the authenticated user's email domain matches a specific domain.
|
|
16
|
+
* This is used to restrict access based on the user's email address.
|
|
17
|
+
* For example, only users with an email address from "my-company.com" can access certain resources.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MatchEmailDomainAccessRule extends AccessRule implements MatchEmailDomainAccessRuleSchema {
|
|
20
|
+
readonly type: 'matchEmailDomain';
|
|
21
|
+
accessor domains: string[];
|
|
22
|
+
constructor(state?: Partial<MatchEmailDomainAccessRuleSchema>);
|
|
23
|
+
toJSON(): MatchEmailDomainAccessRuleSchema;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=MatchEmailDomain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchEmailDomain.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchEmailDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;;GAIG;AACH,MAAM,WAAW,gCAAiC,SAAQ,gBAAgB;IACxE,IAAI,EAAE,kBAAkB,CAAA;IACxB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,UAAW,YAAW,gCAAgC;IACpG,SAAkB,IAAI,EAAE,kBAAkB,CAAA;IAEhB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA;gBAExC,KAAK,GAAE,OAAO,CAAC,gCAAgC,CAAM;IAMxD,MAAM,IAAI,gCAAgC;CAMpD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from './AccessRule.js';
|
|
3
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* The action is allowed if the authenticated user's email domain matches a specific domain.
|
|
6
|
+
* This is used to restrict access based on the user's email address.
|
|
7
|
+
* For example, only users with an email address from "my-company.com" can access certain resources.
|
|
8
|
+
*/
|
|
9
|
+
let MatchEmailDomainAccessRule = (() => {
|
|
10
|
+
let _classSuper = AccessRule;
|
|
11
|
+
let _domains_decorators;
|
|
12
|
+
let _domains_initializers = [];
|
|
13
|
+
let _domains_extraInitializers = [];
|
|
14
|
+
return class MatchEmailDomainAccessRule extends _classSuper {
|
|
15
|
+
static {
|
|
16
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17
|
+
_domains_decorators = [observed({ deep: true })];
|
|
18
|
+
__esDecorate(this, null, _domains_decorators, { kind: "accessor", name: "domains", static: false, private: false, access: { has: obj => "domains" in obj, get: obj => obj.domains, set: (obj, value) => { obj.domains = value; } }, metadata: _metadata }, _domains_initializers, _domains_extraInitializers);
|
|
19
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
20
|
+
}
|
|
21
|
+
type;
|
|
22
|
+
#domains_accessor_storage = __runInitializers(this, _domains_initializers, void 0);
|
|
23
|
+
get domains() { return this.#domains_accessor_storage; }
|
|
24
|
+
set domains(value) { this.#domains_accessor_storage = value; }
|
|
25
|
+
constructor(state = {}) {
|
|
26
|
+
super(state);
|
|
27
|
+
__runInitializers(this, _domains_extraInitializers);
|
|
28
|
+
this.type = 'matchEmailDomain';
|
|
29
|
+
this.domains = state.domains ? [...state.domains] : [];
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
return {
|
|
33
|
+
...super.toJSON(),
|
|
34
|
+
domains: structuredClone(toRaw(this, this.domains)),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
export { MatchEmailDomainAccessRule };
|
|
40
|
+
//# sourceMappingURL=MatchEmailDomain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchEmailDomain.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchEmailDomain.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAe9D;;;;GAIG;IACU,0BAA0B;sBAAS,UAAU;;;;iBAA7C,0BAA2B,SAAQ,WAAU;;;mCAGvD,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAAC,0KAAS,OAAO,6BAAP,OAAO,yFAAU;;;QAFlC,IAAI,CAAoB;QAEhB,mFAA0B;QAA1B,IAAS,OAAO,6CAAU;QAA1B,IAAS,OAAO,mDAAU;QAEpD,YAAY,QAAmD,EAAE;YAC/D,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAA;YAC9B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SACvD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAuC;gBACvD,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAa;aAChE,CAAA;QACH,CAAC;;;SAhBU,0BAA0B","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * The action is allowed if the authenticated user's email domain matches a specific domain.\n * This is used to restrict access based on the user's email address.\n * For example, only users with an email address from \"my-company.com\" can access certain resources.\n */\nexport interface MatchEmailDomainAccessRuleSchema extends AccessRuleSchema {\n type: 'matchEmailDomain'\n /**\n * The email domains that the authenticated user's email must match.\n */\n domains: string[]\n}\n\n/**\n * The action is allowed if the authenticated user's email domain matches a specific domain.\n * This is used to restrict access based on the user's email address.\n * For example, only users with an email address from \"my-company.com\" can access certain resources.\n */\nexport class MatchEmailDomainAccessRule extends AccessRule implements MatchEmailDomainAccessRuleSchema {\n override readonly type: 'matchEmailDomain'\n\n @observed({ deep: true }) accessor domains: string[]\n\n constructor(state: Partial<MatchEmailDomainAccessRuleSchema> = {}) {\n super(state)\n this.type = 'matchEmailDomain'\n this.domains = state.domains ? [...state.domains] : []\n }\n\n override toJSON(): MatchEmailDomainAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchEmailDomainAccessRuleSchema),\n domains: structuredClone(toRaw(this, this.domains)) as string[],\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed if the authenticated user's ID matches a specific property on the resource.
|
|
4
|
+
* This is typically used to restrict access to resources owned by the user.
|
|
5
|
+
* For example, a user can only access their own profile or documents.
|
|
6
|
+
*/
|
|
7
|
+
export interface MatchResourceOwnerAccessRuleSchema extends AccessRuleSchema {
|
|
8
|
+
type: 'resourceOwner';
|
|
9
|
+
/**
|
|
10
|
+
* The property on the resource that should match the authenticated user's ID.
|
|
11
|
+
* This is typically the ID of the user who owns the resource.
|
|
12
|
+
*
|
|
13
|
+
* The domain model should annotate this property with the "ResourceOwnerIdentifier" semantic
|
|
14
|
+
* to indicate that it is used for ownership checks.
|
|
15
|
+
*/
|
|
16
|
+
property: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The action is allowed if the authenticated user's ID matches a specific property on the resource.
|
|
20
|
+
* This is typically used to restrict access to resources owned by the user.
|
|
21
|
+
* For example, a user can only access their own profile or documents.
|
|
22
|
+
*/
|
|
23
|
+
export declare class MatchResourceOwnerAccessRule extends AccessRule implements MatchResourceOwnerAccessRuleSchema {
|
|
24
|
+
readonly type: 'resourceOwner';
|
|
25
|
+
accessor property: string;
|
|
26
|
+
constructor(state?: Partial<MatchResourceOwnerAccessRuleSchema>);
|
|
27
|
+
toJSON(): MatchResourceOwnerAccessRuleSchema;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=MatchResourceOwner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchResourceOwner.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchResourceOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,gBAAgB;IAC1E,IAAI,EAAE,eAAe,CAAA;IACrB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,UAAW,YAAW,kCAAkC;IACxG,SAAkB,IAAI,EAAE,eAAe,CAAA;IAE3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;gBAEzB,KAAK,GAAE,OAAO,CAAC,kCAAkC,CAAM;IAM1D,MAAM,IAAI,kCAAkC;CAMtD"}
|