@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 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserRole.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserRole.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAmB9D;;;;GAIG;IACU,uBAAuB;sBAAS,UAAU;;;;iBAA1C,uBAAwB,SAAQ,WAAU;;;gCAGpD,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAAC,iKAAS,IAAI,6BAAJ,IAAI,mFAAU;;;QAF/B,IAAI,CAAiB;QAEb,6EAAuB;QAAvB,IAAS,IAAI,0CAAU;QAAvB,IAAS,IAAI,gDAAU;QAEjD,YAAY,QAAgD,EAAE;YAC5D,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;YAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SAC9C;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAoC;gBACpD,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAa;aAC1D,CAAA;QACH,CAAC;;;SAhBU,uBAAuB","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 has a specific role.\n * This is used to enforce role-based access control (RBAC).\n * For example, only users with the \"admin\" role can perform certain actions.\n */\nexport interface MatchUserRoleAccessRuleSchema extends AccessRuleSchema {\n type: 'matchUserRole'\n /**\n * The role that the authenticated user must have to access the resource.\n * This is typically a property on the user entity that defines their role.\n *\n * The domain model should annotate this property with the \"UserRole\" semantic\n * to indicate that it is used for role-based access control.\n */\n role: string[]\n}\n\n/**\n * The action is allowed if the authenticated user has a specific role.\n * This is used to enforce role-based access control (RBAC).\n * For example, only users with the \"admin\" role can perform certain actions.\n */\nexport class MatchUserRoleAccessRule extends AccessRule implements MatchUserRoleAccessRuleSchema {\n override readonly type: 'matchUserRole'\n\n @observed({ deep: true }) accessor role: string[]\n\n constructor(state: Partial<MatchUserRoleAccessRuleSchema> = {}) {\n super(state)\n this.type = 'matchUserRole'\n this.role = state.role ? [...state.role] : []\n }\n\n override toJSON(): MatchUserRoleAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchUserRoleAccessRuleSchema),\n role: structuredClone(toRaw(this, this.role)) as string[],\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type RateLimitRuleKey = {
|
|
2
|
+
type: 'ip';
|
|
3
|
+
} | {
|
|
4
|
+
type: 'userId';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'role';
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
export type RateLimitRuleInterval = 'second' | 'minute' | 'hour' | 'day';
|
|
10
|
+
/**
|
|
11
|
+
* Represents a single rate limiting rule that applies to a specific
|
|
12
|
+
* type of client, using a token bucket algorithm.
|
|
13
|
+
*/
|
|
14
|
+
export interface RateLimitRuleSchema {
|
|
15
|
+
/**
|
|
16
|
+
* A human-readable description of what this rule is for.
|
|
17
|
+
* e.g., "Limit anonymous users to 60 requests per hour."
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Defines how to group requests for rate limiting. This determines
|
|
22
|
+
* who the limit applies to.
|
|
23
|
+
*
|
|
24
|
+
* - 'ip': Keys on the client's IP address. Best for anonymous traffic.
|
|
25
|
+
* - 'userId': Keys on the authenticated user's ID. Best for logged-in users.
|
|
26
|
+
* - 'role': Applies a shared limit to all users of a specific role.
|
|
27
|
+
*/
|
|
28
|
+
key?: RateLimitRuleKey;
|
|
29
|
+
/**
|
|
30
|
+
* The number of requests allowed over the defined interval.
|
|
31
|
+
* This is the rate at which tokens are added to the bucket.
|
|
32
|
+
*/
|
|
33
|
+
rate?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The time interval for the rate.
|
|
36
|
+
*/
|
|
37
|
+
interval?: RateLimitRuleInterval;
|
|
38
|
+
/**
|
|
39
|
+
* The maximum number of requests that can be made in a burst.
|
|
40
|
+
* This represents the "bucket size." A larger burst allows for
|
|
41
|
+
* more requests to be made in a short period before throttling begins.
|
|
42
|
+
*/
|
|
43
|
+
burst?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents a single rate limiting rule that applies to a specific
|
|
47
|
+
* type of client, using a token bucket algorithm.
|
|
48
|
+
*/
|
|
49
|
+
export declare class RateLimitRule extends EventTarget implements RateLimitRuleSchema {
|
|
50
|
+
accessor description: string | undefined;
|
|
51
|
+
accessor key: RateLimitRuleKey | undefined;
|
|
52
|
+
accessor rate: number | undefined;
|
|
53
|
+
accessor interval: RateLimitRuleInterval | undefined;
|
|
54
|
+
accessor burst: number | undefined;
|
|
55
|
+
constructor(state?: Partial<RateLimitRuleSchema>);
|
|
56
|
+
toJSON(): RateLimitRuleSchema;
|
|
57
|
+
notifyChange(): void;
|
|
58
|
+
static isRateLimitRuleInterval(value: unknown): value is RateLimitRuleInterval;
|
|
59
|
+
static isRateLimitRuleKey(value: unknown): value is RateLimitRuleKey;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=RateLimitRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitRule.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitRule.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AACpG,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;AAExE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,gBAAgB,CAAA;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAEhC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAY,YAAW,mBAAmB;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAA;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;gBAElC,KAAK,GAAE,OAAO,CAAC,mBAAmB,CAAM;IASpD,MAAM,IAAI,mBAAmB;IAoB7B,YAAY;IAIZ,MAAM,CAAC,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB;IAO9E,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB;CAOrE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { observed, toRaw } from '../../decorators/observed.js';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single rate limiting rule that applies to a specific
|
|
5
|
+
* type of client, using a token bucket algorithm.
|
|
6
|
+
*/
|
|
7
|
+
let RateLimitRule = (() => {
|
|
8
|
+
let _classSuper = EventTarget;
|
|
9
|
+
let _description_decorators;
|
|
10
|
+
let _description_initializers = [];
|
|
11
|
+
let _description_extraInitializers = [];
|
|
12
|
+
let _key_decorators;
|
|
13
|
+
let _key_initializers = [];
|
|
14
|
+
let _key_extraInitializers = [];
|
|
15
|
+
let _rate_decorators;
|
|
16
|
+
let _rate_initializers = [];
|
|
17
|
+
let _rate_extraInitializers = [];
|
|
18
|
+
let _interval_decorators;
|
|
19
|
+
let _interval_initializers = [];
|
|
20
|
+
let _interval_extraInitializers = [];
|
|
21
|
+
let _burst_decorators;
|
|
22
|
+
let _burst_initializers = [];
|
|
23
|
+
let _burst_extraInitializers = [];
|
|
24
|
+
return class RateLimitRule extends _classSuper {
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
27
|
+
_description_decorators = [observed()];
|
|
28
|
+
_key_decorators = [observed({ deep: true })];
|
|
29
|
+
_rate_decorators = [observed()];
|
|
30
|
+
_interval_decorators = [observed()];
|
|
31
|
+
_burst_decorators = [observed()];
|
|
32
|
+
__esDecorate(this, null, _description_decorators, { kind: "accessor", name: "description", static: false, private: false, access: { has: obj => "description" in obj, get: obj => obj.description, set: (obj, value) => { obj.description = value; } }, metadata: _metadata }, _description_initializers, _description_extraInitializers);
|
|
33
|
+
__esDecorate(this, null, _key_decorators, { kind: "accessor", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
34
|
+
__esDecorate(this, null, _rate_decorators, { kind: "accessor", name: "rate", static: false, private: false, access: { has: obj => "rate" in obj, get: obj => obj.rate, set: (obj, value) => { obj.rate = value; } }, metadata: _metadata }, _rate_initializers, _rate_extraInitializers);
|
|
35
|
+
__esDecorate(this, null, _interval_decorators, { kind: "accessor", name: "interval", static: false, private: false, access: { has: obj => "interval" in obj, get: obj => obj.interval, set: (obj, value) => { obj.interval = value; } }, metadata: _metadata }, _interval_initializers, _interval_extraInitializers);
|
|
36
|
+
__esDecorate(this, null, _burst_decorators, { kind: "accessor", name: "burst", static: false, private: false, access: { has: obj => "burst" in obj, get: obj => obj.burst, set: (obj, value) => { obj.burst = value; } }, metadata: _metadata }, _burst_initializers, _burst_extraInitializers);
|
|
37
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
38
|
+
}
|
|
39
|
+
#description_accessor_storage = __runInitializers(this, _description_initializers, void 0);
|
|
40
|
+
get description() { return this.#description_accessor_storage; }
|
|
41
|
+
set description(value) { this.#description_accessor_storage = value; }
|
|
42
|
+
#key_accessor_storage = (__runInitializers(this, _description_extraInitializers), __runInitializers(this, _key_initializers, void 0));
|
|
43
|
+
get key() { return this.#key_accessor_storage; }
|
|
44
|
+
set key(value) { this.#key_accessor_storage = value; }
|
|
45
|
+
#rate_accessor_storage = (__runInitializers(this, _key_extraInitializers), __runInitializers(this, _rate_initializers, void 0));
|
|
46
|
+
get rate() { return this.#rate_accessor_storage; }
|
|
47
|
+
set rate(value) { this.#rate_accessor_storage = value; }
|
|
48
|
+
#interval_accessor_storage = (__runInitializers(this, _rate_extraInitializers), __runInitializers(this, _interval_initializers, void 0));
|
|
49
|
+
get interval() { return this.#interval_accessor_storage; }
|
|
50
|
+
set interval(value) { this.#interval_accessor_storage = value; }
|
|
51
|
+
#burst_accessor_storage = (__runInitializers(this, _interval_extraInitializers), __runInitializers(this, _burst_initializers, void 0));
|
|
52
|
+
get burst() { return this.#burst_accessor_storage; }
|
|
53
|
+
set burst(value) { this.#burst_accessor_storage = value; }
|
|
54
|
+
constructor(state = {}) {
|
|
55
|
+
super();
|
|
56
|
+
__runInitializers(this, _burst_extraInitializers);
|
|
57
|
+
this.description = state.description;
|
|
58
|
+
this.key = RateLimitRule.isRateLimitRuleKey(state.key) ? structuredClone(state.key) : undefined;
|
|
59
|
+
this.rate = typeof state.rate === 'number' ? state.rate : undefined;
|
|
60
|
+
this.interval = RateLimitRule.isRateLimitRuleInterval(state.interval) ? state.interval : undefined;
|
|
61
|
+
this.burst = typeof state.burst === 'number' ? state.burst : undefined;
|
|
62
|
+
}
|
|
63
|
+
toJSON() {
|
|
64
|
+
const result = {};
|
|
65
|
+
if (this.description) {
|
|
66
|
+
result.description = this.description;
|
|
67
|
+
}
|
|
68
|
+
if (RateLimitRule.isRateLimitRuleKey(this.key)) {
|
|
69
|
+
result.key = structuredClone(toRaw(this, this.key));
|
|
70
|
+
}
|
|
71
|
+
if (typeof this.rate === 'number') {
|
|
72
|
+
result.rate = this.rate;
|
|
73
|
+
}
|
|
74
|
+
if (RateLimitRule.isRateLimitRuleInterval(this.interval)) {
|
|
75
|
+
result.interval = this.interval;
|
|
76
|
+
}
|
|
77
|
+
if (typeof this.burst === 'number') {
|
|
78
|
+
result.burst = this.burst;
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
notifyChange() {
|
|
83
|
+
this.dispatchEvent(new Event('change'));
|
|
84
|
+
}
|
|
85
|
+
static isRateLimitRuleInterval(value) {
|
|
86
|
+
if (typeof value !== 'string') {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return ['second', 'minute', 'hour', 'day'].includes(value);
|
|
90
|
+
}
|
|
91
|
+
static isRateLimitRuleKey(value) {
|
|
92
|
+
if (typeof value !== 'object' || value === null) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const key = value;
|
|
96
|
+
return 'type' in key && (key.type === 'ip' || key.type === 'userId' || key.type === 'role');
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
})();
|
|
100
|
+
export { RateLimitRule };
|
|
101
|
+
//# sourceMappingURL=RateLimitRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitRule.js","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitRule.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AA6C9D;;;GAGG;IACU,aAAa;sBAAS,WAAW;;;;;;;;;;;;;;;;iBAAjC,aAAc,SAAQ,WAAW;;;uCAC3C,QAAQ,EAAE;+BACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;gCACxB,QAAQ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C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBAChD,OAAO,KAAK,CAAA;YACd,CAAC;YACD,MAAM,GAAG,GAAG,KAAgC,CAAA;YAC5C,OAAO,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAA;QAC7F,CAAC;;;SArDU,aAAa","sourcesContent":["import { observed, toRaw } from '../../decorators/observed.js'\n\nexport type RateLimitRuleKey = { type: 'ip' } | { type: 'userId' } | { type: 'role'; value: string }\nexport type RateLimitRuleInterval = 'second' | 'minute' | 'hour' | 'day'\n\n/**\n * Represents a single rate limiting rule that applies to a specific\n * type of client, using a token bucket algorithm.\n */\nexport interface RateLimitRuleSchema {\n /**\n * A human-readable description of what this rule is for.\n * e.g., \"Limit anonymous users to 60 requests per hour.\"\n */\n description?: string\n\n /**\n * Defines how to group requests for rate limiting. This determines\n * who the limit applies to.\n *\n * - 'ip': Keys on the client's IP address. Best for anonymous traffic.\n * - 'userId': Keys on the authenticated user's ID. Best for logged-in users.\n * - 'role': Applies a shared limit to all users of a specific role.\n */\n key?: RateLimitRuleKey\n\n /**\n * The number of requests allowed over the defined interval.\n * This is the rate at which tokens are added to the bucket.\n */\n rate?: number\n\n /**\n * The time interval for the rate.\n */\n interval?: RateLimitRuleInterval\n\n /**\n * The maximum number of requests that can be made in a burst.\n * This represents the \"bucket size.\" A larger burst allows for\n * more requests to be made in a short period before throttling begins.\n */\n burst?: number\n}\n\n/**\n * Represents a single rate limiting rule that applies to a specific\n * type of client, using a token bucket algorithm.\n */\nexport class RateLimitRule extends EventTarget implements RateLimitRuleSchema {\n @observed() accessor description: string | undefined\n @observed({ deep: true }) accessor key: RateLimitRuleKey | undefined\n @observed() accessor rate: number | undefined\n @observed() accessor interval: RateLimitRuleInterval | undefined\n @observed() accessor burst: number | undefined\n\n constructor(state: Partial<RateLimitRuleSchema> = {}) {\n super()\n this.description = state.description\n this.key = RateLimitRule.isRateLimitRuleKey(state.key) ? structuredClone(state.key) : undefined\n this.rate = typeof state.rate === 'number' ? state.rate : undefined\n this.interval = RateLimitRule.isRateLimitRuleInterval(state.interval) ? state.interval : undefined\n this.burst = typeof state.burst === 'number' ? state.burst : undefined\n }\n\n toJSON(): RateLimitRuleSchema {\n const result: RateLimitRuleSchema = {}\n if (this.description) {\n result.description = this.description\n }\n if (RateLimitRule.isRateLimitRuleKey(this.key)) {\n result.key = structuredClone(toRaw(this, this.key))\n }\n if (typeof this.rate === 'number') {\n result.rate = this.rate\n }\n if (RateLimitRule.isRateLimitRuleInterval(this.interval)) {\n result.interval = this.interval\n }\n if (typeof this.burst === 'number') {\n result.burst = this.burst\n }\n return result\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n\n static isRateLimitRuleInterval(value: unknown): value is RateLimitRuleInterval {\n if (typeof value !== 'string') {\n return false\n }\n return ['second', 'minute', 'hour', 'day'].includes(value)\n }\n\n static isRateLimitRuleKey(value: unknown): value is RateLimitRuleKey {\n if (typeof value !== 'object' || value === null) {\n return false\n }\n const key = value as Record<string, unknown>\n return 'type' in key && (key.type === 'ip' || key.type === 'userId' || key.type === 'role')\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RateLimitRule, type RateLimitRuleSchema } from './RateLimitRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the rate limiting and throttling policies for the entire API.
|
|
4
|
+
*/
|
|
5
|
+
export interface RateLimitingConfigurationSchema {
|
|
6
|
+
/**
|
|
7
|
+
* An ordered list of rules. The first rule that matches an incoming
|
|
8
|
+
* request will be applied.
|
|
9
|
+
*/
|
|
10
|
+
rules: RateLimitRuleSchema[];
|
|
11
|
+
}
|
|
12
|
+
export declare class RateLimitingConfiguration extends EventTarget implements RateLimitingConfigurationSchema {
|
|
13
|
+
accessor rules: RateLimitRule[];
|
|
14
|
+
constructor(state?: Partial<RateLimitingConfigurationSchema>);
|
|
15
|
+
toJSON(): RateLimitingConfigurationSchema;
|
|
16
|
+
notifyChange(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=RateLimitingConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitingConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitingConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG5E;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B;AAED,qBAAa,yBAA0B,SAAQ,WAAY,YAAW,+BAA+B;IACzE,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,CAAA;gBAE7C,KAAK,GAAE,OAAO,CAAC,+BAA+B,CAAM;IAKhE,MAAM,IAAI,+BAA+B;IAMzC,YAAY;CAGb"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { RateLimitRule } from './RateLimitRule.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
let RateLimitingConfiguration = (() => {
|
|
5
|
+
let _classSuper = EventTarget;
|
|
6
|
+
let _rules_decorators;
|
|
7
|
+
let _rules_initializers = [];
|
|
8
|
+
let _rules_extraInitializers = [];
|
|
9
|
+
return class RateLimitingConfiguration extends _classSuper {
|
|
10
|
+
static {
|
|
11
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
12
|
+
_rules_decorators = [observed({ deep: true })];
|
|
13
|
+
__esDecorate(this, null, _rules_decorators, { kind: "accessor", name: "rules", static: false, private: false, access: { has: obj => "rules" in obj, get: obj => obj.rules, set: (obj, value) => { obj.rules = value; } }, metadata: _metadata }, _rules_initializers, _rules_extraInitializers);
|
|
14
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
15
|
+
}
|
|
16
|
+
#rules_accessor_storage = __runInitializers(this, _rules_initializers, void 0);
|
|
17
|
+
get rules() { return this.#rules_accessor_storage; }
|
|
18
|
+
set rules(value) { this.#rules_accessor_storage = value; }
|
|
19
|
+
constructor(state = {}) {
|
|
20
|
+
super();
|
|
21
|
+
__runInitializers(this, _rules_extraInitializers);
|
|
22
|
+
this.rules = state.rules?.map((rule) => new RateLimitRule(rule)) || [];
|
|
23
|
+
}
|
|
24
|
+
toJSON() {
|
|
25
|
+
return {
|
|
26
|
+
rules: this.rules.map((rule) => rule.toJSON()),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
notifyChange() {
|
|
30
|
+
this.dispatchEvent(new Event('change'));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
export { RateLimitingConfiguration };
|
|
35
|
+
//# sourceMappingURL=RateLimitingConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimitingConfiguration.js","sourceRoot":"","sources":["../../../../src/modeling/rules/RateLimitingConfiguration.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;IAa1C,yBAAyB;sBAAS,WAAW;;;;iBAA7C,yBAA0B,SAAQ,WAAW;;;iCACvD,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAAC,oKAAS,KAAK,6BAAL,KAAK,qFAAiB;;;QAA/B,+EAA+B;QAA/B,IAAS,KAAK,2CAAiB;QAA/B,IAAS,KAAK,iDAAiB;QAEzD,YAAY,QAAkD,EAAE;YAC9D,KAAK,EAAE,CAAA;;YACP,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;SACvE;QAED,MAAM;YACJ,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;aAC/C,CAAA;QACH,CAAC;QAED,YAAY;YACV,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;QACzC,CAAC;;;SAhBU,yBAAyB","sourcesContent":["import { RateLimitRule, type RateLimitRuleSchema } from './RateLimitRule.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * Defines the rate limiting and throttling policies for the entire API.\n */\nexport interface RateLimitingConfigurationSchema {\n /**\n * An ordered list of rules. The first rule that matches an incoming\n * request will be applied.\n */\n rules: RateLimitRuleSchema[]\n}\n\nexport class RateLimitingConfiguration extends EventTarget implements RateLimitingConfigurationSchema {\n @observed({ deep: true }) accessor rules: RateLimitRule[]\n\n constructor(state: Partial<RateLimitingConfigurationSchema> = {}) {\n super()\n this.rules = state.rules?.map((rule) => new RateLimitRule(rule)) || []\n }\n\n toJSON(): RateLimitingConfigurationSchema {\n return {\n rules: this.rules.map((rule) => rule.toJSON()),\n }\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
export { RateLimitingConfiguration, type RateLimitingConfigurationSchema } from './RateLimitingConfiguration.js';
|
|
3
|
+
import { AllowAuthenticatedAccessRule, type AllowAuthenticatedAccessRuleSchema } from './AllowAuthenticated.js';
|
|
4
|
+
import { AllowPublicAccessRule, type AllowPublicAccessRuleSchema } from './AllowPublic.js';
|
|
5
|
+
import { MatchEmailDomainAccessRule, type MatchEmailDomainAccessRuleSchema } from './MatchEmailDomain.js';
|
|
6
|
+
import { MatchResourceOwnerAccessRule, type MatchResourceOwnerAccessRuleSchema } from './MatchResourceOwner.js';
|
|
7
|
+
import { MatchUserPropertyAccessRule, type MatchUserPropertyAccessRuleSchema } from './MatchUserProperty.js';
|
|
8
|
+
import { MatchUserRoleAccessRule, type MatchUserRoleAccessRuleSchema } from './MatchUserRole.js';
|
|
9
|
+
export { AllowAuthenticatedAccessRule, AllowPublicAccessRule, MatchEmailDomainAccessRule, MatchResourceOwnerAccessRule, MatchUserPropertyAccessRule, MatchUserRoleAccessRule, };
|
|
10
|
+
export type { AllowAuthenticatedAccessRuleSchema, AllowPublicAccessRuleSchema, MatchEmailDomainAccessRuleSchema, MatchResourceOwnerAccessRuleSchema, MatchUserPropertyAccessRuleSchema, MatchUserRoleAccessRuleSchema, };
|
|
11
|
+
export type ApiAccessRule = AllowAuthenticatedAccessRule | AllowPublicAccessRule | MatchEmailDomainAccessRule | MatchResourceOwnerAccessRule | MatchUserPropertyAccessRule | MatchUserRoleAccessRule;
|
|
12
|
+
export type ApiAccessRuleSchema = AllowAuthenticatedAccessRuleSchema | AllowPublicAccessRuleSchema | MatchEmailDomainAccessRuleSchema | MatchResourceOwnerAccessRuleSchema | MatchUserPropertyAccessRuleSchema | MatchUserRoleAccessRuleSchema;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,yBAAyB,EAAE,KAAK,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAChH,OAAO,EAAE,4BAA4B,EAAE,KAAK,kCAAkC,EAAE,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAE,KAAK,gCAAgC,EAAE,MAAM,uBAAuB,CAAA;AACzG,OAAO,EAAE,4BAA4B,EAAE,KAAK,kCAAkC,EAAE,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,2BAA2B,EAAE,KAAK,iCAAiC,EAAE,MAAM,wBAAwB,CAAA;AAC5G,OAAO,EAAE,uBAAuB,EAAE,KAAK,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAEhG,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,GACxB,CAAA;AACD,YAAY,EACV,kCAAkC,EAClC,2BAA2B,EAC3B,gCAAgC,EAChC,kCAAkC,EAClC,iCAAiC,EACjC,6BAA6B,GAC9B,CAAA;AAED,MAAM,MAAM,aAAa,GACrB,4BAA4B,GAC5B,qBAAqB,GACrB,0BAA0B,GAC1B,4BAA4B,GAC5B,2BAA2B,GAC3B,uBAAuB,CAAA;AAC3B,MAAM,MAAM,mBAAmB,GAC3B,kCAAkC,GAClC,2BAA2B,GAC3B,gCAAgC,GAChC,kCAAkC,GAClC,iCAAiC,GACjC,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AccessRule } from './AccessRule.js';
|
|
2
|
+
export { RateLimitingConfiguration } from './RateLimitingConfiguration.js';
|
|
3
|
+
import { AllowAuthenticatedAccessRule } from './AllowAuthenticated.js';
|
|
4
|
+
import { AllowPublicAccessRule } from './AllowPublic.js';
|
|
5
|
+
import { MatchEmailDomainAccessRule } from './MatchEmailDomain.js';
|
|
6
|
+
import { MatchResourceOwnerAccessRule } from './MatchResourceOwner.js';
|
|
7
|
+
import { MatchUserPropertyAccessRule } from './MatchUserProperty.js';
|
|
8
|
+
import { MatchUserRoleAccessRule } from './MatchUserRole.js';
|
|
9
|
+
export { AllowAuthenticatedAccessRule, AllowPublicAccessRule, MatchEmailDomainAccessRule, MatchResourceOwnerAccessRule, MatchUserPropertyAccessRule, MatchUserRoleAccessRule, };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,yBAAyB,EAAwC,MAAM,gCAAgC,CAAA;AAChH,OAAO,EAAE,4BAA4B,EAA2C,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,qBAAqB,EAAoC,MAAM,kBAAkB,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAyC,MAAM,uBAAuB,CAAA;AACzG,OAAO,EAAE,4BAA4B,EAA2C,MAAM,yBAAyB,CAAA;AAC/G,OAAO,EAAE,2BAA2B,EAA0C,MAAM,wBAAwB,CAAA;AAC5G,OAAO,EAAE,uBAAuB,EAAsC,MAAM,oBAAoB,CAAA;AAEhG,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,GACxB,CAAA","sourcesContent":["export { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nexport { RateLimitingConfiguration, type RateLimitingConfigurationSchema } from './RateLimitingConfiguration.js'\nimport { AllowAuthenticatedAccessRule, type AllowAuthenticatedAccessRuleSchema } from './AllowAuthenticated.js'\nimport { AllowPublicAccessRule, type AllowPublicAccessRuleSchema } from './AllowPublic.js'\nimport { MatchEmailDomainAccessRule, type MatchEmailDomainAccessRuleSchema } from './MatchEmailDomain.js'\nimport { MatchResourceOwnerAccessRule, type MatchResourceOwnerAccessRuleSchema } from './MatchResourceOwner.js'\nimport { MatchUserPropertyAccessRule, type MatchUserPropertyAccessRuleSchema } from './MatchUserProperty.js'\nimport { MatchUserRoleAccessRule, type MatchUserRoleAccessRuleSchema } from './MatchUserRole.js'\n\nexport {\n AllowAuthenticatedAccessRule,\n AllowPublicAccessRule,\n MatchEmailDomainAccessRule,\n MatchResourceOwnerAccessRule,\n MatchUserPropertyAccessRule,\n MatchUserRoleAccessRule,\n}\nexport type {\n AllowAuthenticatedAccessRuleSchema,\n AllowPublicAccessRuleSchema,\n MatchEmailDomainAccessRuleSchema,\n MatchResourceOwnerAccessRuleSchema,\n MatchUserPropertyAccessRuleSchema,\n MatchUserRoleAccessRuleSchema,\n}\n\nexport type ApiAccessRule =\n | AllowAuthenticatedAccessRule\n | AllowPublicAccessRule\n | MatchEmailDomainAccessRule\n | MatchResourceOwnerAccessRule\n | MatchUserPropertyAccessRule\n | MatchUserRoleAccessRule\nexport type ApiAccessRuleSchema =\n | AllowAuthenticatedAccessRuleSchema\n | AllowPublicAccessRuleSchema\n | MatchEmailDomainAccessRuleSchema\n | MatchResourceOwnerAccessRuleSchema\n | MatchUserPropertyAccessRuleSchema\n | MatchUserRoleAccessRuleSchema\n"]}
|
|
@@ -7,6 +7,9 @@ import type { DomainNamespace } from './DomainNamespace.js';
|
|
|
7
7
|
import type { DomainProperty } from './DomainProperty.js';
|
|
8
8
|
import type { DomainNamespaceKind, DomainEntityKind, DomainModelKind, DomainPropertyKind, DomainAssociationKind, DataDomainKind, ExposedEntityKind } from '../models/kinds.js';
|
|
9
9
|
import type { DataDomain } from './DataDomain.js';
|
|
10
|
+
import { AccessRuleSchema } from './rules/AccessRule.js';
|
|
11
|
+
import { RateLimitingConfigurationSchema } from './rules/RateLimitingConfiguration.js';
|
|
12
|
+
import { ActionSchema } from './actions/Action.js';
|
|
10
13
|
export interface DataDomainRemoveOptions {
|
|
11
14
|
/**
|
|
12
15
|
* When true, the object will be forcibly removed.
|
|
@@ -435,15 +438,15 @@ export interface ExposedEntitySchema {
|
|
|
435
438
|
/**
|
|
436
439
|
* The list of enabled API actions for this exposure (List/Read/Create/etc.)
|
|
437
440
|
*/
|
|
438
|
-
actions:
|
|
441
|
+
actions: ActionSchema[];
|
|
439
442
|
/**
|
|
440
443
|
* Optional array of access rules that define the access control policies for this exposure.
|
|
441
444
|
*/
|
|
442
|
-
accessRule?:
|
|
445
|
+
accessRule?: AccessRuleSchema[];
|
|
443
446
|
/**
|
|
444
447
|
* Optional configuration for rate limiting for this exposure.
|
|
445
448
|
*/
|
|
446
|
-
rateLimiting?:
|
|
449
|
+
rateLimiting?: RateLimitingConfigurationSchema;
|
|
447
450
|
/**
|
|
448
451
|
* When true, generation for this exposure hit configured limits
|
|
449
452
|
*/
|
|
@@ -481,38 +484,6 @@ export interface ExposeOptions {
|
|
|
481
484
|
*/
|
|
482
485
|
maxDepth?: number;
|
|
483
486
|
}
|
|
484
|
-
/**
|
|
485
|
-
* Represents a specific, configurable API operation applied to a Data Entity.
|
|
486
|
-
* Corresponds to common RESTful interactions.
|
|
487
|
-
*/
|
|
488
|
-
export type ApiAction = ListAction | ReadAction | CreateAction | UpdateAction | DeleteAction | SearchAction;
|
|
489
|
-
/**
|
|
490
|
-
* A base interface for common properties across all actions.
|
|
491
|
-
*/
|
|
492
|
-
interface Action {
|
|
493
|
-
/**
|
|
494
|
-
* The specific kind of action (e.g., 'List', 'Read', etc.)
|
|
495
|
-
*/
|
|
496
|
-
kind: string;
|
|
497
|
-
/**
|
|
498
|
-
* Access control rules defining who can perform this action. It is only applied if the
|
|
499
|
-
* authorization strategy is set to 'RBAC'.
|
|
500
|
-
* If no rules grant access, it's denied by default making it essentially private.
|
|
501
|
-
*
|
|
502
|
-
* Note, the API can defined top level access rules that apply to all actions. If this property is set,
|
|
503
|
-
* it overrides the top level access rules for this specific action.
|
|
504
|
-
*
|
|
505
|
-
* It is an ordered list, meaning the first rule that matches the user will be applied.
|
|
506
|
-
* If multiple rules match, the first one in the list takes precedence.
|
|
507
|
-
* If no rules match, the action is denied.
|
|
508
|
-
*/
|
|
509
|
-
accessRule?: AccessRule[];
|
|
510
|
-
/**
|
|
511
|
-
* Optional configuration for action-wide rate limiting and throttling.
|
|
512
|
-
* Defines rules to protect the action from overuse.
|
|
513
|
-
*/
|
|
514
|
-
rateLimiting?: RateLimitingConfiguration;
|
|
515
|
-
}
|
|
516
487
|
/**
|
|
517
488
|
* Represents a pagination strategy for API actions that return collections of resources.
|
|
518
489
|
* This is a base interface that can be extended for different pagination strategies.
|
|
@@ -541,228 +512,6 @@ export interface CursorPaginationStrategy extends PaginationStrategy {
|
|
|
541
512
|
export interface OffsetPaginationStrategy extends PaginationStrategy {
|
|
542
513
|
kind: 'offset';
|
|
543
514
|
}
|
|
544
|
-
/**
|
|
545
|
-
* Enables retrieving a collection of resources.
|
|
546
|
-
* Endpoint: GET /[entity-collection-name]
|
|
547
|
-
*/
|
|
548
|
-
export interface ListAction extends Action {
|
|
549
|
-
kind: 'list';
|
|
550
|
-
/**
|
|
551
|
-
* The pagination strategy used for this action.
|
|
552
|
-
* This defines how the results are paginated when retrieving a collection of resources.
|
|
553
|
-
* It can be either 'cursor' or 'offset'.
|
|
554
|
-
*/
|
|
555
|
-
pagination: PaginationStrategy;
|
|
556
|
-
/**
|
|
557
|
-
* Fields from the entity that can be used for filtering.
|
|
558
|
-
* Must be marked as "indexable" in the Data Model.
|
|
559
|
-
*/
|
|
560
|
-
filterableFields: string[];
|
|
561
|
-
/**
|
|
562
|
-
* Fields from the entity that can be used for sorting.
|
|
563
|
-
*/
|
|
564
|
-
sortableFields: string[];
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Enables retrieving a single resource by its ID.
|
|
568
|
-
* Endpoint: GET /[entity-collection-name]/{id}
|
|
569
|
-
*/
|
|
570
|
-
export interface ReadAction extends Action {
|
|
571
|
-
kind: 'read';
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Enables adding a new resource to a collection.
|
|
575
|
-
* Endpoint: POST /[entity-collection-name]
|
|
576
|
-
*/
|
|
577
|
-
export interface CreateAction extends Action {
|
|
578
|
-
kind: 'create';
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Enables modifying an existing resource.
|
|
582
|
-
* Endpoints: PUT or PATCH /[entity-collection-name]/{id}
|
|
583
|
-
*/
|
|
584
|
-
export interface UpdateAction extends Action {
|
|
585
|
-
kind: 'update';
|
|
586
|
-
/**
|
|
587
|
-
* The allowed HTTP methods for updates. Default: PATCH only.
|
|
588
|
-
*
|
|
589
|
-
* These two methods represent the two common ways to update a resource:
|
|
590
|
-
* - PUT: Replaces the entire resource with the provided data.
|
|
591
|
-
* - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.
|
|
592
|
-
*/
|
|
593
|
-
allowedMethods: ('PUT' | 'PATCH')[];
|
|
594
|
-
}
|
|
595
|
-
/**
|
|
596
|
-
* Enables removing an existing resource.
|
|
597
|
-
* Endpoint: DELETE /[entity-collection-name]/{id}
|
|
598
|
-
*/
|
|
599
|
-
export interface DeleteAction extends Action {
|
|
600
|
-
kind: 'delete';
|
|
601
|
-
/**
|
|
602
|
-
* The strategy for deletion. Default: Soft Delete.
|
|
603
|
-
*
|
|
604
|
-
* @default 'soft'
|
|
605
|
-
*/
|
|
606
|
-
strategy?: 'soft' | 'hard';
|
|
607
|
-
/**
|
|
608
|
-
* The data retention period (in days) for soft-deleted resources.
|
|
609
|
-
* This defines how long the data should be kept before it is permanently deleted.
|
|
610
|
-
*
|
|
611
|
-
* @default 30
|
|
612
|
-
*/
|
|
613
|
-
retentionPeriod?: number;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Enables keyword-based search across specified fields.
|
|
617
|
-
* Endpoint: GET /[entity-collection-name]/search
|
|
618
|
-
*/
|
|
619
|
-
export interface SearchAction extends Action {
|
|
620
|
-
kind: 'search';
|
|
621
|
-
/**
|
|
622
|
-
* The fields within the entity to be included in the search scope.
|
|
623
|
-
* Must be "indexable" and typically text-based.
|
|
624
|
-
*/
|
|
625
|
-
fields: string[];
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Defines the access control policy for a specific API action.
|
|
629
|
-
* Based on the predefined rule types for session-based authentication.
|
|
630
|
-
*/
|
|
631
|
-
export type AccessRule = AllowPublicAccessRule | AllowAuthenticatedAccessRule | MatchResourceOwnerAccessRule | MatchUserRoleAccessRule | MatchUserPropertyAccessRule | MatchEmailDomainAccessRule;
|
|
632
|
-
export interface BaseAccessRule {
|
|
633
|
-
/**
|
|
634
|
-
* The unique identifier for the access rule.
|
|
635
|
-
* This is used to reference the rule in the API configuration.
|
|
636
|
-
*/
|
|
637
|
-
type: string;
|
|
638
|
-
}
|
|
639
|
-
/**
|
|
640
|
-
* The action is allowed for all users, including unauthenticated ones.
|
|
641
|
-
* This is typically used for public APIs or resources that do not require authentication.
|
|
642
|
-
* It is the most permissive rule and should be used with caution.
|
|
643
|
-
*/
|
|
644
|
-
export interface AllowPublicAccessRule extends BaseAccessRule {
|
|
645
|
-
type: 'public';
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* The action is allowed for any authenticated user.
|
|
649
|
-
* This rule does not impose any additional restrictions based on user properties or resource ownership.
|
|
650
|
-
* It is used for resources that should be accessible to all logged-in users.
|
|
651
|
-
*/
|
|
652
|
-
export interface AllowAuthenticatedAccessRule extends BaseAccessRule {
|
|
653
|
-
type: 'authenticated';
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* The action is allowed if the authenticated user's ID matches a specific property on the resource.
|
|
657
|
-
* This is typically used to restrict access to resources owned by the user.
|
|
658
|
-
* For example, a user can only access their own profile or documents.
|
|
659
|
-
*/
|
|
660
|
-
export interface MatchResourceOwnerAccessRule extends BaseAccessRule {
|
|
661
|
-
type: 'resourceOwner';
|
|
662
|
-
/**
|
|
663
|
-
* The property on the resource that should match the authenticated user's ID.
|
|
664
|
-
* This is typically the ID of the user who owns the resource.
|
|
665
|
-
*
|
|
666
|
-
* The domain model should annotate this property with the "ResourceOwnerIdentifier" semantic
|
|
667
|
-
* to indicate that it is used for ownership checks.
|
|
668
|
-
*/
|
|
669
|
-
property: string;
|
|
670
|
-
}
|
|
671
|
-
/**
|
|
672
|
-
* The action is allowed if the authenticated user has a specific role.
|
|
673
|
-
* This is used to enforce role-based access control (RBAC).
|
|
674
|
-
* For example, only users with the "admin" role can perform certain actions.
|
|
675
|
-
*/
|
|
676
|
-
export interface MatchUserRoleAccessRule extends BaseAccessRule {
|
|
677
|
-
type: 'matchUserRole';
|
|
678
|
-
/**
|
|
679
|
-
* The role that the authenticated user must have to access the resource.
|
|
680
|
-
* This is typically a property on the user entity that defines their role.
|
|
681
|
-
*
|
|
682
|
-
* The domain model should annotate this property with the "UserRole" semantic
|
|
683
|
-
* to indicate that it is used for role-based access control.
|
|
684
|
-
*/
|
|
685
|
-
role: string[];
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
689
|
-
* This is used to enforce other user-specific restrictions.
|
|
690
|
-
*/
|
|
691
|
-
export interface MatchUserPropertyAccessRule extends BaseAccessRule {
|
|
692
|
-
type: 'matchUserProperty';
|
|
693
|
-
/**
|
|
694
|
-
* The property on the authenticated user that should match the expected value.
|
|
695
|
-
*/
|
|
696
|
-
property: string;
|
|
697
|
-
/**
|
|
698
|
-
* The expected value for the user property.
|
|
699
|
-
*/
|
|
700
|
-
value: string;
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* The action is allowed if the authenticated user's email domain matches a specific domain.
|
|
704
|
-
* This is used to restrict access based on the user's email address.
|
|
705
|
-
* For example, only users with an email address from "my-company.com" can access certain resources.
|
|
706
|
-
*/
|
|
707
|
-
export interface MatchEmailDomainAccessRule extends BaseAccessRule {
|
|
708
|
-
type: 'matchEmailDomain';
|
|
709
|
-
/**
|
|
710
|
-
* The email domains that the authenticated user's email must match.
|
|
711
|
-
*/
|
|
712
|
-
domains: string[];
|
|
713
|
-
}
|
|
714
|
-
/**
|
|
715
|
-
* Defines the rate limiting and throttling policies for the entire API.
|
|
716
|
-
*/
|
|
717
|
-
export interface RateLimitingConfiguration {
|
|
718
|
-
/**
|
|
719
|
-
* An ordered list of rules. The first rule that matches an incoming
|
|
720
|
-
* request will be applied.
|
|
721
|
-
*/
|
|
722
|
-
rules: RateLimitRule[];
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* Represents a single rate limiting rule that applies to a specific
|
|
726
|
-
* type of client, using a token bucket algorithm.
|
|
727
|
-
*/
|
|
728
|
-
export interface RateLimitRule {
|
|
729
|
-
/**
|
|
730
|
-
* A human-readable description of what this rule is for.
|
|
731
|
-
* e.g., "Limit anonymous users to 60 requests per hour."
|
|
732
|
-
*/
|
|
733
|
-
description?: string;
|
|
734
|
-
/**
|
|
735
|
-
* Defines how to group requests for rate limiting. This determines
|
|
736
|
-
* who the limit applies to.
|
|
737
|
-
*
|
|
738
|
-
* - 'ip': Keys on the client's IP address. Best for anonymous traffic.
|
|
739
|
-
* - 'userId': Keys on the authenticated user's ID. Best for logged-in users.
|
|
740
|
-
* - 'role': Applies a shared limit to all users of a specific role.
|
|
741
|
-
*/
|
|
742
|
-
key: {
|
|
743
|
-
type: 'ip';
|
|
744
|
-
} | {
|
|
745
|
-
type: 'userId';
|
|
746
|
-
} | {
|
|
747
|
-
type: 'role';
|
|
748
|
-
value: string;
|
|
749
|
-
};
|
|
750
|
-
/**
|
|
751
|
-
* The number of requests allowed over the defined interval.
|
|
752
|
-
* This is the rate at which tokens are added to the bucket.
|
|
753
|
-
*/
|
|
754
|
-
rate: number;
|
|
755
|
-
/**
|
|
756
|
-
* The time interval for the rate.
|
|
757
|
-
*/
|
|
758
|
-
interval: 'second' | 'minute' | 'hour' | 'day';
|
|
759
|
-
/**
|
|
760
|
-
* The maximum number of requests that can be made in a burst.
|
|
761
|
-
* This represents the "bucket size." A larger burst allows for
|
|
762
|
-
* more requests to be made in a short period before throttling begins.
|
|
763
|
-
*/
|
|
764
|
-
burst: number;
|
|
765
|
-
}
|
|
766
515
|
export type DomainImpactKinds = typeof DomainNamespaceKind | typeof DomainEntityKind | typeof DomainModelKind | typeof DomainPropertyKind | typeof DomainAssociationKind | typeof DataDomainKind;
|
|
767
516
|
/**
|
|
768
517
|
* The impact analysis report
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAA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