@api-client/core 0.18.56 → 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/helpers/Intelisense.d.ts +1 -0
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +23 -0
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- 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 +27 -27
- package/package.json +2 -7
- 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/helpers/Intelisense.ts +23 -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/helpers/intellisense.spec.ts +46 -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
- package/build/src/modeling/templates/index.d.ts +0 -21
- package/build/src/modeling/templates/index.d.ts.map +0 -1
- package/build/src/modeling/templates/index.js +0 -176
- package/build/src/modeling/templates/index.js.map +0 -1
- package/build/src/modeling/templates/meta/blog-publishing-platform.json +0 -1
- package/build/src/modeling/templates/meta/ecommerce-platform.json +0 -1
- package/build/src/modeling/templates/meta/education-management-platform.json +0 -1
- package/build/src/modeling/templates/meta/financial-services-platform.json +0 -1
- package/build/src/modeling/templates/meta/gaming-platform.json +0 -1
- package/build/src/modeling/templates/meta/healthcare-management-platform.json +0 -1
- package/build/src/modeling/templates/meta/hospitality-platform.json +0 -1
- package/build/src/modeling/templates/meta/index.d.ts +0 -64
- package/build/src/modeling/templates/meta/index.d.ts.map +0 -1
- package/build/src/modeling/templates/meta/index.js +0 -150
- package/build/src/modeling/templates/meta/index.js.map +0 -1
- package/build/src/modeling/templates/meta/iot-smart-home-platform.json +0 -1
- package/build/src/modeling/templates/meta/legal-services-platform.json +0 -1
- package/build/src/modeling/templates/meta/manufacturing-platform.json +0 -1
- package/build/src/modeling/templates/meta/non-profit-platform.json +0 -1
- package/build/src/modeling/templates/meta/real-estate-management-platform.json +0 -1
- package/build/src/modeling/templates/template-registry.d.ts +0 -55
- package/build/src/modeling/templates/template-registry.d.ts.map +0 -1
- package/build/src/modeling/templates/template-registry.js +0 -111
- package/build/src/modeling/templates/template-registry.js.map +0 -1
- package/build/src/modeling/templates/types.d.ts +0 -167
- package/build/src/modeling/templates/types.d.ts.map +0 -1
- package/build/src/modeling/templates/types.js +0 -2
- package/build/src/modeling/templates/types.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts +0 -39
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js +0 -672
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +0 -942
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +0 -45
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +0 -797
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/index.d.ts +0 -21
- package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/index.js +0 -50
- package/build/src/modeling/templates/verticals/business-services/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +0 -46
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +0 -837
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/education-domain.js +0 -725
- package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/education-training/index.js +0 -21
- package/build/src/modeling/templates/verticals/education-training/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +0 -859
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +0 -21
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/index.d.ts +0 -79
- package/build/src/modeling/templates/verticals/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/index.js +0 -186
- package/build/src/modeling/templates/verticals/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +0 -22
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +0 -45
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +0 -710
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/index.js +0 -22
- package/build/src/modeling/templates/verticals/public-sector/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +0 -47
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +0 -864
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +0 -18
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js +0 -21
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +0 -727
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts +0 -40
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js +0 -629
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +0 -46
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +0 -1033
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts +0 -21
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/index.js +0 -42
- package/build/src/modeling/templates/verticals/technology-media/index.js.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +0 -47
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +0 -1029
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +0 -1
- package/src/modeling/templates/meta/blog-publishing-platform.json +0 -1
- package/src/modeling/templates/meta/ecommerce-platform.json +0 -1
- package/src/modeling/templates/meta/education-management-platform.json +0 -1
- package/src/modeling/templates/meta/financial-services-platform.json +0 -1
- package/src/modeling/templates/meta/gaming-platform.json +0 -1
- package/src/modeling/templates/meta/healthcare-management-platform.json +0 -1
- package/src/modeling/templates/meta/hospitality-platform.json +0 -1
- package/src/modeling/templates/meta/iot-smart-home-platform.json +0 -1
- package/src/modeling/templates/meta/legal-services-platform.json +0 -1
- package/src/modeling/templates/meta/manufacturing-platform.json +0 -1
- package/src/modeling/templates/meta/non-profit-platform.json +0 -1
- package/src/modeling/templates/meta/real-estate-management-platform.json +0 -1
- package/src/modeling/templates/readme.md +0 -260
- package/src/modeling/templates/template-registry.ts +0 -140
- package/src/modeling/templates/types.ts +0 -175
- package/src/modeling/templates/verticals/README.md +0 -122
- package/src/modeling/templates/verticals/business-services/ecommerce-domain.ts +0 -844
- package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +0 -1177
- package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +0 -994
- package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +0 -1059
- package/src/modeling/templates/verticals/education-training/education-domain.ts +0 -922
- package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +0 -1111
- package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +0 -895
- package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +0 -1109
- package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +0 -944
- package/src/modeling/templates/verticals/technology-media/blog-domain.ts +0 -796
- package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +0 -1290
- package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +0 -1289
|
@@ -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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from './AccessRule.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* The action is allowed if the authenticated user's ID matches a specific property on the resource.
|
|
6
|
+
* This is typically used to restrict access to resources owned by the user.
|
|
7
|
+
* For example, a user can only access their own profile or documents.
|
|
8
|
+
*/
|
|
9
|
+
let MatchResourceOwnerAccessRule = (() => {
|
|
10
|
+
let _classSuper = AccessRule;
|
|
11
|
+
let _property_decorators;
|
|
12
|
+
let _property_initializers = [];
|
|
13
|
+
let _property_extraInitializers = [];
|
|
14
|
+
return class MatchResourceOwnerAccessRule extends _classSuper {
|
|
15
|
+
static {
|
|
16
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17
|
+
_property_decorators = [observed()];
|
|
18
|
+
__esDecorate(this, null, _property_decorators, { kind: "accessor", name: "property", static: false, private: false, access: { has: obj => "property" in obj, get: obj => obj.property, set: (obj, value) => { obj.property = value; } }, metadata: _metadata }, _property_initializers, _property_extraInitializers);
|
|
19
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
20
|
+
}
|
|
21
|
+
type;
|
|
22
|
+
#property_accessor_storage = __runInitializers(this, _property_initializers, void 0);
|
|
23
|
+
get property() { return this.#property_accessor_storage; }
|
|
24
|
+
set property(value) { this.#property_accessor_storage = value; }
|
|
25
|
+
constructor(state = {}) {
|
|
26
|
+
super(state);
|
|
27
|
+
__runInitializers(this, _property_extraInitializers);
|
|
28
|
+
this.type = 'resourceOwner';
|
|
29
|
+
this.property = state.property ?? '';
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
return {
|
|
33
|
+
...super.toJSON(),
|
|
34
|
+
property: this.property,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
export { MatchResourceOwnerAccessRule };
|
|
40
|
+
//# sourceMappingURL=MatchResourceOwner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchResourceOwner.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchResourceOwner.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAmBvD;;;;GAIG;IACU,4BAA4B;sBAAS,UAAU;;;;iBAA/C,4BAA6B,SAAQ,WAAU;;;oCAGzD,QAAQ,EAAE;YAAC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAQ;;;QAFnB,IAAI,CAAiB;QAE3B,qFAAyB;QAAzB,IAAS,QAAQ,8CAAQ;QAAzB,IAAS,QAAQ,oDAAQ;QAErC,YAAY,QAAqD,EAAE;YACjE,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;YAC3B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAA;SACrC;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyC;gBACzD,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAA;QACH,CAAC;;;SAhBU,4BAA4B","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * The action is allowed if the authenticated user's ID matches a specific property on the resource.\n * This is typically used to restrict access to resources owned by the user.\n * For example, a user can only access their own profile or documents.\n */\nexport interface MatchResourceOwnerAccessRuleSchema extends AccessRuleSchema {\n type: 'resourceOwner'\n /**\n * The property on the resource that should match the authenticated user's ID.\n * This is typically the ID of the user who owns the resource.\n *\n * The domain model should annotate this property with the \"ResourceOwnerIdentifier\" semantic\n * to indicate that it is used for ownership checks.\n */\n property: string\n}\n\n/**\n * The action is allowed if the authenticated user's ID matches a specific property on the resource.\n * This is typically used to restrict access to resources owned by the user.\n * For example, a user can only access their own profile or documents.\n */\nexport class MatchResourceOwnerAccessRule extends AccessRule implements MatchResourceOwnerAccessRuleSchema {\n override readonly type: 'resourceOwner'\n\n @observed() accessor property: string\n\n constructor(state: Partial<MatchResourceOwnerAccessRuleSchema> = {}) {\n super(state)\n this.type = 'resourceOwner'\n this.property = state.property ?? ''\n }\n\n override toJSON(): MatchResourceOwnerAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchResourceOwnerAccessRuleSchema),\n property: this.property,\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AccessRule, type AccessRuleSchema } from './AccessRule.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
4
|
+
* This is used to enforce other user-specific restrictions.
|
|
5
|
+
*/
|
|
6
|
+
export interface MatchUserPropertyAccessRuleSchema extends AccessRuleSchema {
|
|
7
|
+
type: 'matchUserProperty';
|
|
8
|
+
/**
|
|
9
|
+
* The property on the authenticated user that should match the expected value.
|
|
10
|
+
*/
|
|
11
|
+
property: string;
|
|
12
|
+
/**
|
|
13
|
+
* The expected value for the user property.
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
19
|
+
* This is used to enforce other user-specific restrictions.
|
|
20
|
+
*/
|
|
21
|
+
export declare class MatchUserPropertyAccessRule extends AccessRule implements MatchUserPropertyAccessRuleSchema {
|
|
22
|
+
readonly type: 'matchUserProperty';
|
|
23
|
+
accessor property: string;
|
|
24
|
+
accessor value: string;
|
|
25
|
+
constructor(state?: Partial<MatchUserPropertyAccessRuleSchema>);
|
|
26
|
+
toJSON(): MatchUserPropertyAccessRuleSchema;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=MatchUserProperty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserProperty.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,gBAAgB;IACzE,IAAI,EAAE,mBAAmB,CAAA;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,UAAW,YAAW,iCAAiC;IACtG,SAAkB,IAAI,EAAE,mBAAmB,CAAA;IAE/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEtB,KAAK,GAAE,OAAO,CAAC,iCAAiC,CAAM;IAOzD,MAAM,IAAI,iCAAiC;CAOrD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { AccessRule } from './AccessRule.js';
|
|
3
|
+
import { observed } from '../../decorators/observed.js';
|
|
4
|
+
/**
|
|
5
|
+
* The action is allowed if a specific property on the authenticated user matches an expected value.
|
|
6
|
+
* This is used to enforce other user-specific restrictions.
|
|
7
|
+
*/
|
|
8
|
+
let MatchUserPropertyAccessRule = (() => {
|
|
9
|
+
let _classSuper = AccessRule;
|
|
10
|
+
let _property_decorators;
|
|
11
|
+
let _property_initializers = [];
|
|
12
|
+
let _property_extraInitializers = [];
|
|
13
|
+
let _value_decorators;
|
|
14
|
+
let _value_initializers = [];
|
|
15
|
+
let _value_extraInitializers = [];
|
|
16
|
+
return class MatchUserPropertyAccessRule extends _classSuper {
|
|
17
|
+
static {
|
|
18
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
19
|
+
_property_decorators = [observed()];
|
|
20
|
+
_value_decorators = [observed()];
|
|
21
|
+
__esDecorate(this, null, _property_decorators, { kind: "accessor", name: "property", static: false, private: false, access: { has: obj => "property" in obj, get: obj => obj.property, set: (obj, value) => { obj.property = value; } }, metadata: _metadata }, _property_initializers, _property_extraInitializers);
|
|
22
|
+
__esDecorate(this, null, _value_decorators, { kind: "accessor", name: "value", static: false, private: false, access: { has: obj => "value" in obj, get: obj => obj.value, set: (obj, value) => { obj.value = value; } }, metadata: _metadata }, _value_initializers, _value_extraInitializers);
|
|
23
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
24
|
+
}
|
|
25
|
+
type;
|
|
26
|
+
#property_accessor_storage = __runInitializers(this, _property_initializers, void 0);
|
|
27
|
+
get property() { return this.#property_accessor_storage; }
|
|
28
|
+
set property(value) { this.#property_accessor_storage = value; }
|
|
29
|
+
#value_accessor_storage = (__runInitializers(this, _property_extraInitializers), __runInitializers(this, _value_initializers, void 0));
|
|
30
|
+
get value() { return this.#value_accessor_storage; }
|
|
31
|
+
set value(value) { this.#value_accessor_storage = value; }
|
|
32
|
+
constructor(state = {}) {
|
|
33
|
+
super(state);
|
|
34
|
+
__runInitializers(this, _value_extraInitializers);
|
|
35
|
+
this.type = 'matchUserProperty';
|
|
36
|
+
this.property = state.property ?? '';
|
|
37
|
+
this.value = state.value ?? '';
|
|
38
|
+
}
|
|
39
|
+
toJSON() {
|
|
40
|
+
return {
|
|
41
|
+
...super.toJSON(),
|
|
42
|
+
property: this.property,
|
|
43
|
+
value: this.value,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
export { MatchUserPropertyAccessRule };
|
|
49
|
+
//# sourceMappingURL=MatchUserProperty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserProperty.js","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserProperty.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAkBvD;;;GAGG;IACU,2BAA2B;sBAAS,UAAU;;;;;;;iBAA9C,2BAA4B,SAAQ,WAAU;;;oCAGxD,QAAQ,EAAE;iCACV,QAAQ,EAAE;YADC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAQ;YACzB,oKAAS,KAAK,6BAAL,KAAK,qFAAQ;;;QAHhB,IAAI,CAAqB;QAE/B,qFAAyB;QAAzB,IAAS,QAAQ,8CAAQ;QAAzB,IAAS,QAAQ,oDAAQ;QACzB,uIAAsB;QAAtB,IAAS,KAAK,2CAAQ;QAAtB,IAAS,KAAK,iDAAQ;QAElC,YAAY,QAAoD,EAAE;YAChE,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;YAC/B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAA;YACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAA;SAC/B;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAwC;gBACxD,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAA;QACH,CAAC;;;SAnBU,2BAA2B","sourcesContent":["import { AccessRule, type AccessRuleSchema } from './AccessRule.js'\nimport { observed } from '../../decorators/observed.js'\n\n/**\n * The action is allowed if a specific property on the authenticated user matches an expected value.\n * This is used to enforce other user-specific restrictions.\n */\nexport interface MatchUserPropertyAccessRuleSchema extends AccessRuleSchema {\n type: 'matchUserProperty'\n /**\n * The property on the authenticated user that should match the expected value.\n */\n property: string\n /**\n * The expected value for the user property.\n */\n value: string\n}\n\n/**\n * The action is allowed if a specific property on the authenticated user matches an expected value.\n * This is used to enforce other user-specific restrictions.\n */\nexport class MatchUserPropertyAccessRule extends AccessRule implements MatchUserPropertyAccessRuleSchema {\n override readonly type: 'matchUserProperty'\n\n @observed() accessor property: string\n @observed() accessor value: string\n\n constructor(state: Partial<MatchUserPropertyAccessRuleSchema> = {}) {\n super(state)\n this.type = 'matchUserProperty'\n this.property = state.property ?? ''\n this.value = state.value ?? ''\n }\n\n override toJSON(): MatchUserPropertyAccessRuleSchema {\n return {\n ...(super.toJSON() as MatchUserPropertyAccessRuleSchema),\n property: this.property,\n value: this.value,\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 has a specific role.
|
|
4
|
+
* This is used to enforce role-based access control (RBAC).
|
|
5
|
+
* For example, only users with the "admin" role can perform certain actions.
|
|
6
|
+
*/
|
|
7
|
+
export interface MatchUserRoleAccessRuleSchema extends AccessRuleSchema {
|
|
8
|
+
type: 'matchUserRole';
|
|
9
|
+
/**
|
|
10
|
+
* The role that the authenticated user must have to access the resource.
|
|
11
|
+
* This is typically a property on the user entity that defines their role.
|
|
12
|
+
*
|
|
13
|
+
* The domain model should annotate this property with the "UserRole" semantic
|
|
14
|
+
* to indicate that it is used for role-based access control.
|
|
15
|
+
*/
|
|
16
|
+
role: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The action is allowed if the authenticated user has a specific role.
|
|
20
|
+
* This is used to enforce role-based access control (RBAC).
|
|
21
|
+
* For example, only users with the "admin" role can perform certain actions.
|
|
22
|
+
*/
|
|
23
|
+
export declare class MatchUserRoleAccessRule extends AccessRule implements MatchUserRoleAccessRuleSchema {
|
|
24
|
+
readonly type: 'matchUserRole';
|
|
25
|
+
accessor role: string[];
|
|
26
|
+
constructor(state?: Partial<MatchUserRoleAccessRuleSchema>);
|
|
27
|
+
toJSON(): MatchUserRoleAccessRuleSchema;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=MatchUserRole.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchUserRole.d.ts","sourceRoot":"","sources":["../../../../src/modeling/rules/MatchUserRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGnE;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACrE,IAAI,EAAE,eAAe,CAAA;IACrB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,EAAE,CAAA;CACf;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,UAAW,YAAW,6BAA6B;IAC9F,SAAkB,IAAI,EAAE,eAAe,CAAA;IAEb,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;gBAErC,KAAK,GAAE,OAAO,CAAC,6BAA6B,CAAM;IAMrD,MAAM,IAAI,6BAA6B;CAMjD"}
|
|
@@ -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 has a specific role.
|
|
6
|
+
* This is used to enforce role-based access control (RBAC).
|
|
7
|
+
* For example, only users with the "admin" role can perform certain actions.
|
|
8
|
+
*/
|
|
9
|
+
let MatchUserRoleAccessRule = (() => {
|
|
10
|
+
let _classSuper = AccessRule;
|
|
11
|
+
let _role_decorators;
|
|
12
|
+
let _role_initializers = [];
|
|
13
|
+
let _role_extraInitializers = [];
|
|
14
|
+
return class MatchUserRoleAccessRule extends _classSuper {
|
|
15
|
+
static {
|
|
16
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17
|
+
_role_decorators = [observed({ deep: true })];
|
|
18
|
+
__esDecorate(this, null, _role_decorators, { kind: "accessor", name: "role", static: false, private: false, access: { has: obj => "role" in obj, get: obj => obj.role, set: (obj, value) => { obj.role = value; } }, metadata: _metadata }, _role_initializers, _role_extraInitializers);
|
|
19
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
20
|
+
}
|
|
21
|
+
type;
|
|
22
|
+
#role_accessor_storage = __runInitializers(this, _role_initializers, void 0);
|
|
23
|
+
get role() { return this.#role_accessor_storage; }
|
|
24
|
+
set role(value) { this.#role_accessor_storage = value; }
|
|
25
|
+
constructor(state = {}) {
|
|
26
|
+
super(state);
|
|
27
|
+
__runInitializers(this, _role_extraInitializers);
|
|
28
|
+
this.type = 'matchUserRole';
|
|
29
|
+
this.role = state.role ? [...state.role] : [];
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
return {
|
|
33
|
+
...super.toJSON(),
|
|
34
|
+
role: structuredClone(toRaw(this, this.role)),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
export { MatchUserRoleAccessRule };
|
|
40
|
+
//# sourceMappingURL=MatchUserRole.js.map
|
|
@@ -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"}
|