@api-client/core 0.19.9 → 0.19.11
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/LICENSE.md +9 -63
- package/Testing.md +1 -1
- package/bin/test.ts +1 -12
- package/build/src/browser.d.ts +0 -15
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +0 -17
- package/build/src/browser.js.map +1 -1
- package/build/src/decorators/observed.d.ts.map +1 -1
- package/build/src/decorators/observed.js +91 -0
- package/build/src/decorators/observed.js.map +1 -1
- package/build/src/events/EventTypes.d.ts +0 -6
- package/build/src/events/EventTypes.d.ts.map +1 -1
- package/build/src/events/EventTypes.js +0 -2
- package/build/src/events/EventTypes.js.map +1 -1
- package/build/src/events/Events.d.ts +0 -2
- package/build/src/events/Events.d.ts.map +1 -1
- package/build/src/events/Events.js +0 -2
- package/build/src/events/Events.js.map +1 -1
- package/build/src/index.d.ts +0 -15
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +0 -17
- package/build/src/index.js.map +1 -1
- package/build/src/modeling/ApiModel.d.ts +21 -7
- package/build/src/modeling/ApiModel.d.ts.map +1 -1
- package/build/src/modeling/ApiModel.js +70 -29
- package/build/src/modeling/ApiModel.js.map +1 -1
- package/build/src/modeling/Bindings.d.ts +3 -3
- package/build/src/modeling/Bindings.d.ts.map +1 -1
- package/build/src/modeling/Bindings.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts +5 -5
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/DomainEntity.d.ts +2 -3
- package/build/src/modeling/DomainEntity.d.ts.map +1 -1
- package/build/src/modeling/DomainEntity.js +1 -1
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/DomainProperty.d.ts +2 -3
- package/build/src/modeling/DomainProperty.d.ts.map +1 -1
- package/build/src/modeling/DomainProperty.js +1 -1
- package/build/src/modeling/DomainProperty.js.map +1 -1
- package/build/src/modeling/DomainValidation.d.ts +1 -1
- package/build/src/modeling/DomainValidation.d.ts.map +1 -1
- package/build/src/modeling/DomainValidation.js.map +1 -1
- package/build/src/modeling/ExposedEntity.d.ts +14 -0
- package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
- package/build/src/modeling/ExposedEntity.js +59 -6
- package/build/src/modeling/ExposedEntity.js.map +1 -1
- package/build/src/modeling/actions/Action.d.ts +11 -1
- package/build/src/modeling/actions/Action.d.ts.map +1 -1
- package/build/src/modeling/actions/Action.js +21 -3
- package/build/src/modeling/actions/Action.js.map +1 -1
- package/build/src/modeling/actions/CreateAction.d.ts +2 -1
- package/build/src/modeling/actions/CreateAction.d.ts.map +1 -1
- package/build/src/modeling/actions/CreateAction.js +2 -2
- package/build/src/modeling/actions/CreateAction.js.map +1 -1
- package/build/src/modeling/actions/DeleteAction.d.ts +2 -1
- package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -1
- package/build/src/modeling/actions/DeleteAction.js +2 -2
- package/build/src/modeling/actions/DeleteAction.js.map +1 -1
- package/build/src/modeling/actions/ListAction.d.ts +2 -1
- package/build/src/modeling/actions/ListAction.d.ts.map +1 -1
- package/build/src/modeling/actions/ListAction.js +2 -2
- package/build/src/modeling/actions/ListAction.js.map +1 -1
- package/build/src/modeling/actions/ReadAction.d.ts +2 -1
- package/build/src/modeling/actions/ReadAction.d.ts.map +1 -1
- package/build/src/modeling/actions/ReadAction.js +2 -2
- package/build/src/modeling/actions/ReadAction.js.map +1 -1
- package/build/src/modeling/actions/SearchAction.d.ts +2 -1
- package/build/src/modeling/actions/SearchAction.d.ts.map +1 -1
- package/build/src/modeling/actions/SearchAction.js +2 -2
- package/build/src/modeling/actions/SearchAction.js.map +1 -1
- package/build/src/modeling/actions/UpdateAction.d.ts +2 -1
- package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -1
- package/build/src/modeling/actions/UpdateAction.js +2 -2
- package/build/src/modeling/actions/UpdateAction.js.map +1 -1
- package/build/src/modeling/actions/index.d.ts +2 -1
- package/build/src/modeling/actions/index.d.ts.map +1 -1
- package/build/src/modeling/actions/index.js +7 -7
- package/build/src/modeling/actions/index.js.map +1 -1
- package/build/src/modeling/ai/types.d.ts +2 -2
- package/build/src/modeling/ai/types.d.ts.map +1 -1
- package/build/src/modeling/ai/types.js.map +1 -1
- package/build/src/{amf → modeling/amf}/DataValueGenerator.d.ts +1 -1
- package/build/src/modeling/amf/DataValueGenerator.d.ts.map +1 -0
- package/build/src/{amf → modeling/amf}/DataValueGenerator.js +2 -3
- package/build/src/modeling/amf/DataValueGenerator.js.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts +20 -20
- package/build/src/modeling/amf/ShapeGenerator.d.ts.map +1 -1
- package/build/src/modeling/amf/ShapeGenerator.js +16 -18
- package/build/src/modeling/amf/ShapeGenerator.js.map +1 -1
- package/build/src/modeling/amf/core_types.d.ts +9 -0
- package/build/src/modeling/amf/core_types.d.ts.map +1 -0
- package/build/src/modeling/amf/core_types.js +45 -0
- package/build/src/modeling/amf/core_types.js.map +1 -0
- package/build/src/modeling/index.d.ts +1 -0
- package/build/src/modeling/index.d.ts.map +1 -1
- package/build/src/modeling/index.js +1 -0
- package/build/src/modeling/index.js.map +1 -1
- package/build/src/modeling/types.d.ts +67 -0
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/modeling/validation/api_model_rules.d.ts +15 -0
- package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -0
- package/build/src/modeling/validation/api_model_rules.js +599 -0
- package/build/src/modeling/validation/api_model_rules.js.map +1 -0
- package/build/src/modeling/validation/association_validation.d.ts.map +1 -1
- package/build/src/modeling/validation/association_validation.js +1 -3
- package/build/src/modeling/validation/association_validation.js.map +1 -1
- package/build/src/models/http-flows/LegacyTranslator.js +1 -1
- package/build/src/models/http-flows/LegacyTranslator.js.map +1 -1
- package/build/src/runtime/http-runner/HttpFlows.js +1 -1
- package/build/src/runtime/http-runner/HttpFlows.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.js +0 -2
- package/package.json +27 -135
- package/src/decorators/observed.ts +91 -0
- package/src/events/EventTypes.ts +0 -2
- package/src/events/Events.ts +0 -2
- package/src/modeling/ApiModel.ts +73 -33
- package/src/modeling/Bindings.ts +3 -3
- package/src/modeling/DomainAssociation.ts +5 -5
- package/src/modeling/DomainEntity.ts +3 -4
- package/src/modeling/DomainProperty.ts +3 -4
- package/src/modeling/DomainValidation.ts +1 -1
- package/src/modeling/ExposedEntity.ts +63 -9
- package/src/modeling/actions/Action.ts +25 -2
- package/src/modeling/actions/CreateAction.ts +3 -2
- package/src/modeling/actions/DeleteAction.ts +3 -2
- package/src/modeling/actions/ListAction.ts +3 -2
- package/src/modeling/actions/ReadAction.ts +3 -2
- package/src/modeling/actions/SearchAction.ts +3 -2
- package/src/modeling/actions/UpdateAction.ts +3 -2
- package/src/modeling/ai/types.ts +2 -2
- package/src/{amf → modeling/amf}/DataValueGenerator.ts +3 -4
- package/src/modeling/amf/ShapeGenerator.ts +45 -61
- package/src/modeling/amf/core_types.ts +47 -0
- package/src/modeling/types.ts +70 -0
- package/src/modeling/validation/api_model_rules.ts +640 -0
- package/src/modeling/validation/api_model_validation_rules.md +58 -0
- package/src/modeling/validation/association_validation.ts +1 -3
- package/src/models/http-flows/LegacyTranslator.ts +1 -1
- package/src/runtime/http-runner/HttpFlows.ts +1 -1
- package/tests/unit/modeling/actions/Action.spec.ts +40 -8
- package/tests/unit/modeling/actions/CreateAction.spec.ts +5 -5
- package/tests/unit/modeling/actions/DeleteAction.spec.ts +6 -6
- package/tests/unit/modeling/actions/ListAction.spec.ts +7 -7
- package/tests/unit/modeling/actions/ReadAction.spec.ts +6 -6
- package/tests/unit/modeling/actions/SearchAction.spec.ts +6 -6
- package/tests/unit/modeling/actions/UpdateAction.spec.ts +6 -6
- package/tests/unit/{amf → modeling/amf}/data_value_generator.spec.ts +2 -2
- package/tests/unit/modeling/amf/shape_generator.spec.ts +146 -167
- package/tests/unit/modeling/api_model.spec.ts +190 -13
- package/tests/unit/modeling/api_model_expose_entity.spec.ts +43 -19
- package/tests/unit/modeling/api_model_remove_entity.spec.ts +6 -6
- package/tests/unit/modeling/domain_asociation.spec.ts +13 -13
- package/tests/unit/modeling/exposed_entity.spec.ts +123 -3
- package/tests/unit/modeling/exposed_entity_actions.spec.ts +41 -18
- package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
- package/tests/unit/modeling/rules/restoring_rules.spec.ts +9 -5
- package/tests/unit/modeling/validation/api_model_rules.spec.ts +324 -0
- package/tests/unit/runtime/runners/http_assertion_runner.spec.ts +1 -1
- package/tests/unit/runtime/runners/http_flow_runner.spec.ts +1 -1
- package/tests/unit/runtime/runners/project_runner.spec.ts +1 -1
- package/tests/unit/runtime/runners/request_runner.spec.ts +1 -1
- package/tests/unit/runtime/runners/serial_runner.spec.ts +1 -1
- package/tsconfig.browser.json +1 -1
- package/tsconfig.node.json +1 -1
- package/bin/test-web.ts +0 -6
- package/build/src/amf/AmfMixin.d.ts +0 -396
- package/build/src/amf/AmfMixin.d.ts.map +0 -1
- package/build/src/amf/AmfMixin.js +0 -1138
- package/build/src/amf/AmfMixin.js.map +0 -1
- package/build/src/amf/AmfSerializer.d.ts +0 -137
- package/build/src/amf/AmfSerializer.d.ts.map +0 -1
- package/build/src/amf/AmfSerializer.js +0 -1947
- package/build/src/amf/AmfSerializer.js.map +0 -1
- package/build/src/amf/AmfTypes.d.ts +0 -25
- package/build/src/amf/AmfTypes.d.ts.map +0 -1
- package/build/src/amf/AmfTypes.js +0 -143
- package/build/src/amf/AmfTypes.js.map +0 -1
- package/build/src/amf/ApiExampleGenerator.d.ts +0 -40
- package/build/src/amf/ApiExampleGenerator.d.ts.map +0 -1
- package/build/src/amf/ApiExampleGenerator.js +0 -112
- package/build/src/amf/ApiExampleGenerator.js.map +0 -1
- package/build/src/amf/ApiMonacoSchemaGenerator.d.ts +0 -68
- package/build/src/amf/ApiMonacoSchemaGenerator.d.ts.map +0 -1
- package/build/src/amf/ApiMonacoSchemaGenerator.js +0 -248
- package/build/src/amf/ApiMonacoSchemaGenerator.js.map +0 -1
- package/build/src/amf/ApiSchemaGenerator.d.ts +0 -56
- package/build/src/amf/ApiSchemaGenerator.d.ts.map +0 -1
- package/build/src/amf/ApiSchemaGenerator.js +0 -94
- package/build/src/amf/ApiSchemaGenerator.js.map +0 -1
- package/build/src/amf/ApiSchemaValues.d.ts +0 -111
- package/build/src/amf/ApiSchemaValues.d.ts.map +0 -1
- package/build/src/amf/ApiSchemaValues.js +0 -463
- package/build/src/amf/ApiSchemaValues.js.map +0 -1
- package/build/src/amf/DataValueGenerator.d.ts.map +0 -1
- package/build/src/amf/DataValueGenerator.js.map +0 -1
- package/build/src/amf/Parsing.d.ts +0 -48
- package/build/src/amf/Parsing.d.ts.map +0 -1
- package/build/src/amf/Parsing.js +0 -2
- package/build/src/amf/Parsing.js.map +0 -1
- package/build/src/amf/Utils.d.ts +0 -37
- package/build/src/amf/Utils.d.ts.map +0 -1
- package/build/src/amf/Utils.js +0 -169
- package/build/src/amf/Utils.js.map +0 -1
- package/build/src/amf/data-node/DataNodeBase.d.ts +0 -34
- package/build/src/amf/data-node/DataNodeBase.d.ts.map +0 -1
- package/build/src/amf/data-node/DataNodeBase.js +0 -77
- package/build/src/amf/data-node/DataNodeBase.js.map +0 -1
- package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts +0 -15
- package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts.map +0 -1
- package/build/src/amf/data-node/JsonDataNodeGenerator.js +0 -23
- package/build/src/amf/data-node/JsonDataNodeGenerator.js.map +0 -1
- package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts +0 -14
- package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts.map +0 -1
- package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js +0 -48
- package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js.map +0 -1
- package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts +0 -22
- package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts.map +0 -1
- package/build/src/amf/data-node/XmlDataNodeGenerator.js +0 -34
- package/build/src/amf/data-node/XmlDataNodeGenerator.js.map +0 -1
- package/build/src/amf/definitions/Amf.d.ts +0 -363
- package/build/src/amf/definitions/Amf.d.ts.map +0 -1
- package/build/src/amf/definitions/Amf.js +0 -3
- package/build/src/amf/definitions/Amf.js.map +0 -1
- package/build/src/amf/definitions/Api.d.ts +0 -383
- package/build/src/amf/definitions/Api.d.ts.map +0 -1
- package/build/src/amf/definitions/Api.js +0 -2
- package/build/src/amf/definitions/Api.js.map +0 -1
- package/build/src/amf/definitions/Base.d.ts +0 -12
- package/build/src/amf/definitions/Base.d.ts.map +0 -1
- package/build/src/amf/definitions/Base.js +0 -2
- package/build/src/amf/definitions/Base.js.map +0 -1
- package/build/src/amf/definitions/Namespace.d.ts +0 -327
- package/build/src/amf/definitions/Namespace.d.ts.map +0 -1
- package/build/src/amf/definitions/Namespace.js +0 -346
- package/build/src/amf/definitions/Namespace.js.map +0 -1
- package/build/src/amf/definitions/Shapes.d.ts +0 -312
- package/build/src/amf/definitions/Shapes.d.ts.map +0 -1
- package/build/src/amf/definitions/Shapes.js +0 -87
- package/build/src/amf/definitions/Shapes.js.map +0 -1
- package/build/src/amf/models/AmfDataNode.d.ts +0 -67
- package/build/src/amf/models/AmfDataNode.d.ts.map +0 -1
- package/build/src/amf/models/AmfDataNode.js +0 -192
- package/build/src/amf/models/AmfDataNode.js.map +0 -1
- package/build/src/amf/shape/ShapeBase.d.ts +0 -74
- package/build/src/amf/shape/ShapeBase.d.ts.map +0 -1
- package/build/src/amf/shape/ShapeBase.js +0 -93
- package/build/src/amf/shape/ShapeBase.js.map +0 -1
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts +0 -47
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts.map +0 -1
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.js +0 -420
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +0 -1
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts +0 -85
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts.map +0 -1
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js +0 -852
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +0 -1
- package/build/src/events/amf/AmfEventTypes.d.ts +0 -7
- package/build/src/events/amf/AmfEventTypes.d.ts.map +0 -1
- package/build/src/events/amf/AmfEventTypes.js +0 -7
- package/build/src/events/amf/AmfEventTypes.js.map +0 -1
- package/build/src/events/amf/AmfEvents.d.ts +0 -34
- package/build/src/events/amf/AmfEvents.d.ts.map +0 -1
- package/build/src/events/amf/AmfEvents.js +0 -63
- package/build/src/events/amf/AmfEvents.js.map +0 -1
- package/build/src/mocking/RandExp.d.ts +0 -55
- package/build/src/mocking/RandExp.d.ts.map +0 -1
- package/build/src/mocking/RandExp.js +0 -302
- package/build/src/mocking/RandExp.js.map +0 -1
- package/build/src/mocking/lib/ret.d.ts +0 -16
- package/build/src/mocking/lib/ret.d.ts.map +0 -1
- package/build/src/mocking/lib/ret.js +0 -284
- package/build/src/mocking/lib/ret.js.map +0 -1
- package/data/apis/APIC-187/APIC-187.raml +0 -21
- package/data/apis/APIC-187/dataType.raml +0 -132
- package/data/apis/APIC-187/example.raml +0 -84
- package/data/apis/APIC-188/APIC-188.raml +0 -21
- package/data/apis/APIC-188/dataType.raml +0 -132
- package/data/apis/APIC-188/example.raml +0 -84
- package/data/apis/APIC-233/APIC-233.raml +0 -15
- package/data/apis/APIC-391/APIC-391.raml +0 -44
- package/data/apis/APIC-391/examples/post-body-request-example.raml +0 -7
- package/data/apis/APIC-483/APIC-483.raml +0 -16
- package/data/apis/APIC-483/example/list-of-bank-succ.json +0 -32
- package/data/apis/APIC-483/schema/response-retrieve-list-bank.json +0 -68
- package/data/apis/APIC-487/APIC-487.raml +0 -36
- package/data/apis/APIC-655/APIC-655.raml +0 -44
- package/data/apis/APIC-655/delivery.json +0 -12
- package/data/apis/APIC-689/APIC-689.raml +0 -20
- package/data/apis/APIC-690/APIC-690.raml +0 -17
- package/data/apis/APIC-690/datatypes/Address.raml +0 -10
- package/data/apis/APIC-690/datatypes/Customer.raml +0 -17
- package/data/apis/APIC-690/examples/CustomerExample2.raml +0 -17
- package/data/apis/APIC-690/examples/CustomersExample.raml +0 -34
- package/data/apis/SE-10469/Purchase-Order-oagis-id-dd32f9c6c01048a19e15c423c9c741ae.json +0 -1383
- package/data/apis/SE-10469/SE-10469.raml +0 -11
- package/data/apis/SE-13092/Examples/PersonExample.raml +0 -7
- package/data/apis/SE-13092/SE-13092.raml +0 -37
- package/data/apis/SE-13092/datatypes/Address.raml +0 -5
- package/data/apis/SE-13092/datatypes/InlineType.raml +0 -5
- package/data/apis/SE-13092/datatypes/Person.raml +0 -15
- package/data/apis/SE-22063/SE-22063.raml +0 -14
- package/data/apis/SE-22063/stock.raml +0 -41
- package/data/apis/amf-helper-api/amf-helper-api.raml +0 -1024
- package/data/apis/amf-helper-api/examples/comment-example.json +0 -42
- package/data/apis/amf-helper-api/examples/commentCreateRequest-example.json +0 -7
- package/data/apis/amf-helper-api/examples/commentList-example.json +0 -48
- package/data/apis/amf-helper-api/examples/person.json +0 -14
- package/data/apis/amf-helper-api/examples/person.raml +0 -13
- package/data/apis/amf-helper-api/examples/person.xml +0 -14
- package/data/apis/amf-helper-api/libraries/comment-lib.raml +0 -143
- package/data/apis/amf-helper-api/library.raml +0 -7
- package/data/apis/amf-helper-api/schemas/person.json +0 -104
- package/data/apis/amf-helper-api/schemas/person.xsd +0 -26
- package/data/apis/amf-helper-api/traits/file.raml +0 -33
- package/data/apis/amf-helper-api/traits/pagination.raml +0 -80
- package/data/apis/amf-helper-api/traits/results.raml +0 -19
- package/data/apis/amf-helper-api/traits/visibility.raml +0 -14
- package/data/apis/amf-helper-api/types/app-person.raml +0 -101
- package/data/apis/amf-helper-api/types/dimensions.raml +0 -24
- package/data/apis/amf-helper-api/types/external-type.raml +0 -7
- package/data/apis/amf-helper-api/types/image.raml +0 -23
- package/data/apis/amf-helper-api/types/product.raml +0 -52
- package/data/apis/amf-helper-api/types/resource.raml +0 -11
- package/data/apis/amf-helper-api/types/standard-request.raml +0 -50
- package/data/apis/amf-helper-api/types/user.raml +0 -37
- package/data/apis/arc-demo-api/arc-demo-api.raml +0 -468
- package/data/apis/arc-demo-api/examples/e400.xml +0 -4
- package/data/apis/arc-demo-api/examples/e401.xml +0 -4
- package/data/apis/arc-demo-api/examples/e404.xml +0 -4
- package/data/apis/arc-demo-api/examples/image.xml +0 -5
- package/data/apis/arc-demo-api/examples/messages-example.json +0 -22
- package/data/apis/arc-demo-api/examples/messages-sent-example.json +0 -15
- package/data/apis/arc-demo-api/examples/person.json +0 -14
- package/data/apis/arc-demo-api/examples/person.url.encoded +0 -1
- package/data/apis/arc-demo-api/examples/person.xml +0 -14
- package/data/apis/arc-demo-api/examples/product.xml +0 -9
- package/data/apis/arc-demo-api/library.raml +0 -36
- package/data/apis/arc-demo-api/resourceTypes/app-person.raml +0 -49
- package/data/apis/arc-demo-api/resourceTypes/example-types.raml +0 -45
- package/data/apis/arc-demo-api/resourceTypes/image.raml +0 -23
- package/data/apis/arc-demo-api/resourceTypes/message-sent-type.raml +0 -23
- package/data/apis/arc-demo-api/resourceTypes/message-type.raml +0 -33
- package/data/apis/arc-demo-api/resourceTypes/product.raml +0 -52
- package/data/apis/arc-demo-api/resourceTypes/resource.raml +0 -11
- package/data/apis/arc-demo-api/schemas/error-response.xsd +0 -11
- package/data/apis/arc-demo-api/schemas/image.xsd +0 -11
- package/data/apis/arc-demo-api/schemas/person.json +0 -104
- package/data/apis/arc-demo-api/schemas/person.xsd +0 -26
- package/data/apis/arc-demo-api/schemas/product.xsd +0 -17
- package/data/apis/arc-demo-api/securitySchemes/basic.raml +0 -5
- package/data/apis/arc-demo-api/securitySchemes/oauth_2_0.raml +0 -29
- package/data/apis/arc-demo-api/securitySchemes/x-custom.raml +0 -26
- package/data/apis/arc-demo-api/traits/adminable.raml +0 -23
- package/data/apis/arc-demo-api/traits/pagination.raml +0 -83
- package/data/apis/arc-demo-api/traits/rate-limited.raml +0 -9
- package/data/apis/async-api/async-api.yaml +0 -96
- package/data/apis/example-generator-api/contact-email-example.raml +0 -6
- package/data/apis/example-generator-api/contact-example.raml +0 -5
- package/data/apis/example-generator-api/contact-fax-example.raml +0 -5
- package/data/apis/example-generator-api/contact-website-example.raml +0 -2
- package/data/apis/example-generator-api/example-1.raml +0 -6
- package/data/apis/example-generator-api/example-2.raml +0 -9
- package/data/apis/example-generator-api/example-3.raml +0 -4
- package/data/apis/example-generator-api/example-4.raml +0 -2
- package/data/apis/example-generator-api/example-5.raml +0 -4
- package/data/apis/example-generator-api/example-6.raml +0 -2
- package/data/apis/example-generator-api/example-7.raml +0 -5
- package/data/apis/example-generator-api/example-generator-api.raml +0 -423
- package/data/apis/example-generator-api/example.json +0 -14
- package/data/apis/example-generator-api/example.xml +0 -15
- package/data/apis/example-generator-api/example.xsd +0 -26
- package/data/apis/example-generator-api/examples/employee.raml +0 -7
- package/data/apis/example-generator-api/examples/employees.raml +0 -7
- package/data/apis/example-generator-api/linked-named-example.raml +0 -21
- package/data/apis/example-generator-api/named-example-with-link.raml +0 -5
- package/data/apis/example-generator-api/named-example.raml +0 -9
- package/data/apis/example-generator-api/user-json-example.raml +0 -17
- package/data/apis/example-generator-api/user-raml-example.raml +0 -37
- package/data/apis/example-generator-api/user.json +0 -8
- package/data/apis/example-generator-api/user.raml +0 -18
- package/data/apis/example-generator-api/users-json-example.raml +0 -17
- package/data/apis/example-generator-api/users-raml-example.raml +0 -32
- package/data/apis/example-generator-api/users.json +0 -8
- package/data/apis/expanded-api/expanded-api.raml +0 -8
- package/data/apis/flattened-api/flattened-api.raml +0 -8
- package/data/apis/multiple-servers/multiple-servers.yaml +0 -112
- package/data/apis/oas-3-api/oas-3-api.yaml +0 -356
- package/data/apis/oas-date/oas-date.yaml +0 -28
- package/data/apis/oas-types/oas-types.yaml +0 -159
- package/data/apis/oas-unions/oas-unions.yaml +0 -75
- package/data/apis/petstore/petstore.yaml +0 -954
- package/data/apis/raml-date/raml-date.raml +0 -28
- package/data/apis/recursive/recursive.raml +0 -14
- package/data/apis/schema-api/examples/person.json +0 -14
- package/data/apis/schema-api/examples/person.raml +0 -14
- package/data/apis/schema-api/examples/person.url.encoded +0 -1
- package/data/apis/schema-api/examples/person.xml +0 -14
- package/data/apis/schema-api/library/demo-types.raml +0 -43
- package/data/apis/schema-api/schema-api.raml +0 -656
- package/data/apis/schema-api/schemas/person.json +0 -104
- package/data/apis/schema-api/schemas/person.xsd +0 -26
- package/data/apis/schema-api/types/DemoPerson.raml +0 -67
- package/data/apis/secured-api/oauth-2-custom-settings.raml +0 -143
- package/data/apis/secured-api/oauth2-header-delivery.raml +0 -13
- package/data/apis/secured-api/oauth2-no-delivery.raml +0 -8
- package/data/apis/secured-api/oauth2-no-grants.raml +0 -12
- package/data/apis/secured-api/oauth2-pkce.raml +0 -13
- package/data/apis/secured-api/oauth2-query-delivery.raml +0 -13
- package/data/apis/secured-api/oauth_1_0.raml +0 -8
- package/data/apis/secured-api/oauth_1_0_no-settings.raml +0 -3
- package/data/apis/secured-api/oauth_1_0_no-signature.raml +0 -7
- package/data/apis/secured-api/oauth_1_0_signature.raml +0 -8
- package/data/apis/secured-api/passthrough-querystring.raml +0 -16
- package/data/apis/secured-api/passthrough.raml +0 -24
- package/data/apis/secured-api/secured-api.raml +0 -231
- package/data/apis/secured-api/x-custom.raml +0 -33
- package/data/apis/secured-api/x-other.raml +0 -29
- package/data/apis/secured-api/x-query-string.raml +0 -16
- package/data/apis/tracked-examples/datatypes/employee.raml +0 -5
- package/data/apis/tracked-examples/examples/employee.raml +0 -4
- package/data/apis/tracked-examples/examples/employees.raml +0 -8
- package/data/apis/tracked-examples/tracked-to-linked.raml +0 -28
- package/data/model.js +0 -129
- package/data/models/APIC-187.json +0 -11416
- package/data/models/APIC-188.json +0 -11416
- package/data/models/APIC-233.json +0 -539
- package/data/models/APIC-391.json +0 -1903
- package/data/models/APIC-483.json +0 -3110
- package/data/models/APIC-487.json +0 -1225
- package/data/models/APIC-655.json +0 -3145
- package/data/models/APIC-689.json +0 -797
- package/data/models/APIC-690.json +0 -5992
- package/data/models/SE-10469.json +0 -22898
- package/data/models/SE-13092.json +0 -2769
- package/data/models/SE-22063.json +0 -2314
- package/data/models/amf-helper-api.json +0 -84457
- package/data/models/arc-demo-api.json +0 -52041
- package/data/models/async-api.json +0 -3227
- package/data/models/example-generator-api.json +0 -45209
- package/data/models/expanded-api.json +0 -251
- package/data/models/flattened-api.json +0 -251
- package/data/models/multiple-servers.json +0 -2769
- package/data/models/oas-3-api.json +0 -10590
- package/data/models/oas-date.json +0 -637
- package/data/models/oas-types.json +0 -5352
- package/data/models/oas-unions.json +0 -1935
- package/data/models/petstore.json +0 -27712
- package/data/models/raml-date.json +0 -1114
- package/data/models/recursive.json +0 -610
- package/data/models/schema-api.json +0 -35527
- package/data/models/secured-api.json +0 -21071
- package/data/models/tracked-to-linked.json +0 -1914
- package/src/amf/AmfMixin.ts +0 -1726
- package/src/amf/AmfSerializer.ts +0 -2358
- package/src/amf/AmfTypes.ts +0 -147
- package/src/amf/ApiExampleGenerator.ts +0 -122
- package/src/amf/ApiMonacoSchemaGenerator.ts +0 -332
- package/src/amf/ApiSchemaGenerator.ts +0 -115
- package/src/amf/ApiSchemaValues.ts +0 -509
- package/src/amf/Parsing.ts +0 -50
- package/src/amf/Utils.ts +0 -172
- package/src/amf/data-node/DataNodeBase.ts +0 -83
- package/src/amf/data-node/JsonDataNodeGenerator.ts +0 -24
- package/src/amf/data-node/README.md +0 -3
- package/src/amf/data-node/UrlEncodedDataNodeGenerator.ts +0 -49
- package/src/amf/data-node/XmlDataNodeGenerator.ts +0 -46
- package/src/amf/definitions/Amf.ts +0 -440
- package/src/amf/definitions/Api.ts +0 -445
- package/src/amf/definitions/Base.ts +0 -13
- package/src/amf/definitions/Namespace.ts +0 -357
- package/src/amf/definitions/Shapes.ts +0 -438
- package/src/amf/models/AmfDataNode.ts +0 -210
- package/src/amf/shape/README.md +0 -4
- package/src/amf/shape/ShapeBase.ts +0 -174
- package/src/amf/shape/ShapeJsonSchemaGenerator.ts +0 -457
- package/src/amf/shape/ShapeXmlSchemaGenerator.ts +0 -933
- package/src/events/amf/AmfEventTypes.ts +0 -6
- package/src/events/amf/AmfEvents.ts +0 -78
- package/src/mocking/RandExp.ts +0 -335
- package/src/mocking/lib/ret.ts +0 -279
- package/tests/unit/amf/APIC-187.spec.ts +0 -41
- package/tests/unit/amf/APIC-188.spec.ts +0 -30
- package/tests/unit/amf/APIC-233.spec.ts +0 -32
- package/tests/unit/amf/APIC-391.spec.ts +0 -39
- package/tests/unit/amf/APIC-487.spec.ts +0 -44
- package/tests/unit/amf/APIC-655.spec.ts +0 -41
- package/tests/unit/amf/APIC-689.spec.ts +0 -28
- package/tests/unit/amf/APIC-690.spec.ts +0 -93
- package/tests/unit/amf/AmfLoader.ts +0 -538
- package/tests/unit/amf/AmfMixin.spec.ts +0 -1707
- package/tests/unit/amf/ApiExampleGenerator.spec.ts +0 -250
- package/tests/unit/amf/ApiMonacoSchemaGenerator.spec.ts +0 -183
- package/tests/unit/amf/ApiSchemaValues.spec.ts +0 -602
- package/tests/unit/amf/Namepsace.spec.ts +0 -494
- package/tests/unit/amf/SE-10469.spec.ts +0 -35
- package/tests/unit/amf/SE-13092.spec.ts +0 -64
- package/tests/unit/amf/SE-22063.spec.ts +0 -45
- package/tests/unit/amf/raml-examples.spec.ts +0 -43
- package/tests/unit/amf/schema_gen_array.spec.ts +0 -199
- package/tests/unit/amf/schema_gen_oas.spec.ts +0 -140
- package/tests/unit/amf/schema_gen_object.spec.ts +0 -279
- package/tests/unit/amf/schema_gen_scalar.spec.ts +0 -143
- package/tests/unit/amf/schema_gen_union.spec.ts +0 -401
- package/tests/unit/amf/schema_gen_unknown.spec.ts +0 -42
- package/tests/unit/amf/schema_gen_xml.spec.ts +0 -726
- package/tests/unit/amf/serializer/APIC-483.spec.ts +0 -36
- package/tests/unit/amf/serializer/Anotations.spec.ts +0 -50
- package/tests/unit/amf/serializer/Api.spec.ts +0 -210
- package/tests/unit/amf/serializer/Documentation.spec.ts +0 -52
- package/tests/unit/amf/serializer/Endpoints.spec.ts +0 -172
- package/tests/unit/amf/serializer/Operations.spec.ts +0 -330
- package/tests/unit/amf/serializer/Parameters.spec.ts +0 -149
- package/tests/unit/amf/serializer/PayloadExamples.spec.ts +0 -152
- package/tests/unit/amf/serializer/Security.spec.ts +0 -626
- package/tests/unit/amf/serializer/Server.spec.ts +0 -78
- package/tests/unit/amf/serializer/Shapes.spec.ts +0 -304
- package/tests/unit/amf/serializer/SourceMaps.spec.ts +0 -52
- package/tests/unit/amf/shapes/ShapeXmlSchemaGenerator.spec.ts +0 -28
- package/tests/unit/amf/tracked-to-linked.spec.ts +0 -90
- package/tests/unit/amf/xml-data-processing.spec.ts +0 -217
- package/tests/unit/events/amf.spec.ts +0 -151
|
@@ -48,7 +48,7 @@ let ExposedEntity = (() => {
|
|
|
48
48
|
_resourcePath_decorators = [observed()];
|
|
49
49
|
_actions_decorators = [observed({ deep: true })];
|
|
50
50
|
_accessRule_decorators = [observed({ deep: true })];
|
|
51
|
-
_rateLimiting_decorators = [observed(
|
|
51
|
+
_rateLimiting_decorators = [observed()];
|
|
52
52
|
__esDecorate(this, null, _entity_decorators, { kind: "accessor", name: "entity", static: false, private: false, access: { has: obj => "entity" in obj, get: obj => obj.entity, set: (obj, value) => { obj.entity = value; } }, metadata: _metadata }, _entity_initializers, _entity_extraInitializers);
|
|
53
53
|
__esDecorate(this, null, _collectionPath_decorators, { kind: "accessor", name: "collectionPath", static: false, private: false, access: { has: obj => "collectionPath" in obj, get: obj => obj.collectionPath, set: (obj, value) => { obj.collectionPath = value; } }, metadata: _metadata }, _collectionPath_initializers, _collectionPath_extraInitializers);
|
|
54
54
|
__esDecorate(this, null, _resourcePath_decorators, { kind: "accessor", name: "resourcePath", static: false, private: false, access: { has: obj => "resourcePath" in obj, get: obj => obj.resourcePath, set: (obj, value) => { obj.resourcePath = value; } }, metadata: _metadata }, _resourcePath_initializers, _resourcePath_extraInitializers);
|
|
@@ -200,7 +200,7 @@ let ExposedEntity = (() => {
|
|
|
200
200
|
this.isRoot = init.isRoot;
|
|
201
201
|
this.parent = init.parent;
|
|
202
202
|
this.exposeOptions = init.exposeOptions;
|
|
203
|
-
this.actions = init.actions ? init.actions.map((a) => restoreAction(a)) : [];
|
|
203
|
+
this.actions = init.actions ? init.actions.map((a) => restoreAction(this, a)) : [];
|
|
204
204
|
this.accessRule = init.accessRule ? init.accessRule.map((ar) => restoreAccessRule(ar)) : [];
|
|
205
205
|
this.rateLimiting = init.rateLimiting ? new RateLimitingConfiguration(init.rateLimiting) : undefined;
|
|
206
206
|
this.truncated = init.truncated;
|
|
@@ -271,7 +271,7 @@ let ExposedEntity = (() => {
|
|
|
271
271
|
const normalizedCollection = `/${segments[0]}`;
|
|
272
272
|
// Check for collision if this is a root entity
|
|
273
273
|
if (this.isRoot) {
|
|
274
|
-
const collision = this.api.
|
|
274
|
+
const collision = this.api.findCollectionPathCollision(normalizedCollection, this.key);
|
|
275
275
|
if (collision) {
|
|
276
276
|
throw new Error(`Collection path "${normalizedCollection}" is already in use by another root entity.`);
|
|
277
277
|
}
|
|
@@ -332,7 +332,7 @@ let ExposedEntity = (() => {
|
|
|
332
332
|
}
|
|
333
333
|
// Check for collision if this is a root entity (singleton case)
|
|
334
334
|
if (this.isRoot) {
|
|
335
|
-
const collision = this.api.
|
|
335
|
+
const collision = this.api.findResourcePathCollision(cleaned, this.key);
|
|
336
336
|
if (collision) {
|
|
337
337
|
throw new Error(`Resource path "${cleaned}" is already in use by another root entity.`);
|
|
338
338
|
}
|
|
@@ -352,7 +352,7 @@ let ExposedEntity = (() => {
|
|
|
352
352
|
// Traverse parents, always joining with the parent's resource path
|
|
353
353
|
let parentKey = this.parent?.key;
|
|
354
354
|
while (parentKey) {
|
|
355
|
-
const parent = this.api.exposes.
|
|
355
|
+
const parent = this.api.exposes.get(parentKey);
|
|
356
356
|
if (!parent)
|
|
357
357
|
break;
|
|
358
358
|
const parentResource = ensureLeadingSlash(parent.resourcePath);
|
|
@@ -375,7 +375,7 @@ let ExposedEntity = (() => {
|
|
|
375
375
|
// Traverse parents, always joining with the parent's resource path
|
|
376
376
|
let parentKey = this.parent?.key;
|
|
377
377
|
while (parentKey) {
|
|
378
|
-
const parent = this.api.exposes.
|
|
378
|
+
const parent = this.api.exposes.get(parentKey);
|
|
379
379
|
if (!parent)
|
|
380
380
|
break;
|
|
381
381
|
const parentResource = ensureLeadingSlash(parent.resourcePath);
|
|
@@ -384,6 +384,59 @@ let ExposedEntity = (() => {
|
|
|
384
384
|
}
|
|
385
385
|
return absolute;
|
|
386
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* Returns all access rules for this exposure, including the ones from all the parents up to the API.
|
|
389
|
+
*/
|
|
390
|
+
getAllRules() {
|
|
391
|
+
const rules = [];
|
|
392
|
+
this.api.accessRule.forEach((rule) => rules.push(rule));
|
|
393
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
394
|
+
let current = this;
|
|
395
|
+
while (current) {
|
|
396
|
+
if (current.accessRule) {
|
|
397
|
+
rules.push(...current.accessRule);
|
|
398
|
+
}
|
|
399
|
+
current = current.parent ? this.api.exposes.get(current.parent.key) : undefined;
|
|
400
|
+
}
|
|
401
|
+
return rules;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Returns all rate limiters for this exposure, including the ones from all the parents up to the API.
|
|
405
|
+
*/
|
|
406
|
+
getAllRateLimiters() {
|
|
407
|
+
const rateLimiters = [];
|
|
408
|
+
if (this.api.rateLimiting) {
|
|
409
|
+
rateLimiters.push(this.api.rateLimiting);
|
|
410
|
+
}
|
|
411
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
412
|
+
let current = this;
|
|
413
|
+
while (current) {
|
|
414
|
+
if (current.rateLimiting) {
|
|
415
|
+
rateLimiters.push(current.rateLimiting);
|
|
416
|
+
}
|
|
417
|
+
current = current.parent ? this.api.exposes.get(current.parent.key) : undefined;
|
|
418
|
+
}
|
|
419
|
+
return rateLimiters;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Returns all rate limiter rules for this exposure, including the ones from all the parents up to the API.
|
|
423
|
+
* Similar to the getAllRules() method, but it flattens the rate limiters into a single list of rules.
|
|
424
|
+
*/
|
|
425
|
+
getAllRateLimiterRules() {
|
|
426
|
+
const rules = [];
|
|
427
|
+
if (this.api.rateLimiting) {
|
|
428
|
+
rules.push(...this.api.rateLimiting.rules);
|
|
429
|
+
}
|
|
430
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
431
|
+
let current = this;
|
|
432
|
+
while (current) {
|
|
433
|
+
if (current.rateLimiting) {
|
|
434
|
+
rules.push(...current.rateLimiting.rules);
|
|
435
|
+
}
|
|
436
|
+
current = current.parent ? this.api.exposes.get(current.parent.key) : undefined;
|
|
437
|
+
}
|
|
438
|
+
return rules;
|
|
439
|
+
}
|
|
387
440
|
};
|
|
388
441
|
})();
|
|
389
442
|
export { ExposedEntity };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExposedEntity.js","sourceRoot":"","sources":["../../../src/modeling/ExposedEntity.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAE5E,OAAO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AAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA;gBAChE,IAAI,CAAC,MAAM;oBAAE,MAAK;gBAClB,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;gBAC9D,QAAQ,GAAG,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAA;gBAC9C,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAA;YAChC,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC;QAED;;;;;;WAMG;QACH,yBAAyB;YACvB,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,cAAc;gBAAE,OAAO,SAAS,CAAA;YACjE,IAAI,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;YACtD,mEAAmE;YACnE,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,CAAA;YAChC,OAAO,SAAS,EAAE,CAAC;gBACjB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA;gBAChE,IAAI,CAAC,MAAM;oBAAE,MAAK;gBAClB,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;gBAC9D,QAAQ,GAAG,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAA;gBAC9C,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAA;YAChC,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC;;;SAnWU,aAAa","sourcesContent":["import { observed } from '../decorators/observed.js'\nimport { ExposedEntityKind } from '../models/kinds.js'\nimport { nanoid } from '../nanoid.js'\nimport { Action } from './actions/Action.js'\nimport { restoreAction } from './actions/index.js'\nimport type { ApiModel } from './ApiModel.js'\nimport { ensureLeadingSlash, joinPaths } from './helpers/endpointHelpers.js'\nimport { AccessRule } from './rules/AccessRule.js'\nimport { restoreAccessRule } from './rules/index.js'\nimport { RateLimitingConfiguration } from './rules/RateLimitingConfiguration.js'\nimport type { AssociationTarget, ExposeOptions, ExposeParentRef, ExposedEntitySchema } from './types.js'\n\n/**\n * A class that specializes in representing an exposed Data Entity within an API Model.\n *\n * ## Design Note\n * This class enforces strict path constraints (e.g., single-segment collection paths like `/users`,\n * two-segment resource paths like `/users/{id}`).\n * This is an intentional design choice to support a UI paradigm for non-technical users, ensuring that\n * path segments are configured individually at each level of the exposure hierarchy.\n *\n * Flexibility is achieved by chaining exposed entities (parent/child relationships), where the final\n * absolute path is composed of all ancestral paths. See `getAbsoluteResourcePath()` and `getAbsoluteCollectionPath()`.\n *\n * @fires change - Emitted when the exposed entity has changed.\n */\nexport class ExposedEntity extends EventTarget {\n /**\n * The exposed entity kind recognizable by the ecosystem.\n */\n kind: typeof ExposedEntityKind\n\n /**\n * The unique key of the exposed entity.\n * This is a stable identifier that does not change across versions.\n */\n key: string\n\n /**\n * A pointer to a Data Entity from the Data Domain.\n */\n @observed() accessor entity: AssociationTarget\n\n /**\n * Indicates whether this exposure has a collection endpoint.\n * A collection endpoint is optional for nested exposures where the association is 1:1\n * and the schema is embedded directly under the parent resource.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n hasCollection: boolean\n\n /**\n * Path to the collection endpoint for this exposure.\n * Starts with '/'. Not set for 1:1 nested exposures where collection does not exist.\n */\n @observed() accessor collectionPath: string | undefined\n\n /**\n * Path to the resource endpoint for this exposure.\n * Starts with '/'. For 1:1 nested exposures the resource path typically does not include an id segment.\n */\n @observed() accessor resourcePath: string\n\n /**\n * Whether this exposure is a root exposure (top-level collection).\n * If this is set then the `parent` reference must be populated.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n isRoot?: boolean\n\n /**\n * Parent reference when this exposure was created via following an association.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n parent?: ExposeParentRef\n\n /**\n * Expose-time config used to create this exposure (persisted for auditing/UI).\n * This is only populated for the root exposure. All children exposures inherit this config.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n exposeOptions?: ExposeOptions\n\n /**\n * The list of enabled API actions for this exposure (List/Read/Create/etc.)\n */\n @observed({ deep: true }) accessor actions: Action[]\n\n /**\n * Optional array of access rules that define the access control policies for this exposure.\n */\n @observed({ deep: true }) accessor accessRule: AccessRule[] | undefined\n\n /**\n * Optional configuration for rate limiting for this exposure.\n */\n @observed({ deep: true }) accessor rateLimiting: RateLimitingConfiguration | undefined\n\n /**\n * When true, generation for this exposure hit configured limits\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n truncated?: boolean\n\n /**\n * When the notifying flag is set to true,\n * the domain is pending a notification.\n * No other notifications will be sent until\n * the current notification is sent.\n */\n #notifying = false\n /**\n * When the initializing flag is set to true,\n * the domain is not notified of changes.\n */\n #initializing = true\n /**\n * A reference to the parent API Model instance.\n */\n api: ApiModel\n\n static createSchema(input: Partial<ExposedEntitySchema> = {}): ExposedEntitySchema {\n const {\n key = nanoid(),\n entity = { key: '' },\n collectionPath,\n resourcePath = '/',\n hasCollection = true,\n isRoot,\n parent,\n exposeOptions,\n actions = [],\n accessRule,\n rateLimiting,\n truncated,\n } = input\n const result: ExposedEntitySchema = {\n kind: ExposedEntityKind,\n key,\n entity: { ...entity },\n hasCollection,\n resourcePath,\n actions: actions.map((a) => ({ ...a })),\n }\n if (collectionPath !== undefined) {\n result.collectionPath = collectionPath\n }\n if (isRoot !== undefined) {\n result.isRoot = isRoot\n }\n if (parent !== undefined) {\n result.parent = { ...parent }\n }\n if (exposeOptions !== undefined) {\n result.exposeOptions = { ...exposeOptions }\n }\n if (Array.isArray(accessRule)) {\n result.accessRule = accessRule.map((ar) => ({ ...ar }))\n }\n if (rateLimiting !== undefined) {\n result.rateLimiting = { ...rateLimiting }\n }\n if (truncated !== undefined) {\n result.truncated = truncated\n }\n return result\n }\n\n constructor(model: ApiModel, state?: Partial<ExposedEntitySchema>) {\n super()\n this.api = model\n const init = ExposedEntity.createSchema(state)\n this.kind = init.kind\n this.key = init.key\n this.entity = init.entity\n this.hasCollection = init.hasCollection\n this.collectionPath = init.collectionPath\n this.resourcePath = init.resourcePath\n this.isRoot = init.isRoot\n this.parent = init.parent\n this.exposeOptions = init.exposeOptions\n this.actions = init.actions ? init.actions.map((a) => restoreAction(a)) : []\n this.accessRule = init.accessRule ? init.accessRule.map((ar) => restoreAccessRule(ar)) : []\n this.rateLimiting = init.rateLimiting ? new RateLimitingConfiguration(init.rateLimiting) : undefined\n this.truncated = init.truncated\n this.#initializing = false\n }\n\n notifyChange() {\n if (this.#notifying || this.#initializing) {\n return\n }\n this.#notifying = true\n queueMicrotask(() => {\n this.#notifying = false\n const event = new Event('change')\n this.dispatchEvent(event)\n })\n }\n\n toJSON(): ExposedEntitySchema {\n const result: ExposedEntitySchema = {\n kind: this.kind,\n key: this.key,\n entity: { ...this.entity },\n resourcePath: this.resourcePath,\n actions: this.actions.map((a) => a.toJSON()),\n hasCollection: this.hasCollection,\n }\n if (this.collectionPath !== undefined) {\n result.collectionPath = this.collectionPath\n }\n if (this.isRoot !== undefined) {\n result.isRoot = this.isRoot\n }\n if (this.parent !== undefined) {\n result.parent = { ...this.parent }\n }\n if (this.exposeOptions !== undefined) {\n result.exposeOptions = { ...this.exposeOptions }\n }\n if (Array.isArray(this.accessRule) && this.accessRule.length > 0) {\n result.accessRule = this.accessRule.map((ar) => ar.toJSON())\n }\n if (this.rateLimiting !== undefined) {\n result.rateLimiting = this.rateLimiting.toJSON()\n }\n if (this.truncated !== undefined) {\n result.truncated = this.truncated\n }\n return result\n }\n\n /**\n * Sets a new collection path for this exposed entity.\n *\n * It:\n * - updates the collectionPath property\n * - updates the absoluteCollectionPath property accordingly\n * - updates the resourcePath accordingly.\n * @param path The new path to set.\n */\n setCollectionPath(path: string) {\n if (!this.hasCollection) {\n throw new Error(`Cannot set collection path on an exposure that does not have a collection`)\n }\n const cleaned = ensureLeadingSlash(path)\n // Ensure exactly one non-empty segment\n const segments = cleaned.split('/').filter(Boolean)\n if (segments.length !== 1) {\n throw new Error(`Collection path must contain exactly one segment. Received: \"${path}\"`)\n }\n const normalizedCollection = `/${segments[0]}`\n\n // Check for collision if this is a root entity\n if (this.isRoot) {\n const collision = this.api.exposes.find(\n (e) => e.isRoot && e.key !== this.key && e.collectionPath === normalizedCollection\n )\n if (collision) {\n throw new Error(`Collection path \"${normalizedCollection}\" is already in use by another root entity.`)\n }\n }\n\n // Preserve current parameter name if present, otherwise default to {id}\n let param = '{id}'\n if (this.resourcePath) {\n const curSegments = this.resourcePath.split('/').filter(Boolean)\n const maybeParam = curSegments[1]\n if (maybeParam && /^\\{[A-Za-z_][A-Za-z0-9_]*\\}$/.test(maybeParam)) {\n param = maybeParam\n }\n }\n const nextResource = `${normalizedCollection}/${param}`\n this.collectionPath = normalizedCollection\n this.resourcePath = nextResource\n // rely on ApiModel.exposes deep observation to notify on property sets\n }\n\n /**\n * Sets a new resource path for this exposed entity.\n *\n * Rules:\n * - Must start with '/'.\n * - If this exposure has a collection, the path must be exactly the collection path plus a single\n * parameter segment (e.g. `/products/{productId}`) and only the parameter name may vary.\n * - If this exposure does NOT have a collection, the path can be any two segments (e.g. `/profile/{id}` or `/a/b`).\n */\n setResourcePath(path: string) {\n const cleaned = ensureLeadingSlash(path)\n const segments = cleaned.split('/').filter(Boolean)\n\n if (this.hasCollection) {\n if (!this.collectionPath) {\n throw new Error('Cannot set resource path: missing collection path for this exposure')\n }\n const colSegments = this.collectionPath.split('/').filter(Boolean)\n if (colSegments.length !== 1) {\n throw new Error(`Invalid stored collection path \"${this.collectionPath}\"`)\n }\n if (segments.length !== 2) {\n throw new Error(`Resource path must be exactly two segments (collection + parameter). Received: \"${cleaned}\"`)\n }\n const [s1, s2] = segments\n if (s1 !== colSegments[0]) {\n throw new Error(`Resource path must start with the collection segment \"${colSegments[0]}\". Received: \"${s1}\"`)\n }\n // s2 must be a parameter segment {name}\n if (!/^\\{[A-Za-z_][A-Za-z0-9_]*\\}$/.test(s2)) {\n throw new Error(`The second segment must be a parameter in braces, e.g. {id}. Received: \"${s2}\"`)\n }\n if (this.resourcePath !== cleaned) {\n this.resourcePath = `/${s1}/${s2}`\n }\n return\n }\n\n // No collection: allow any two segments\n if (segments.length !== 2) {\n throw new Error(\n `Resource path must contain exactly two segments when no collection is present. Received: \"${cleaned}\"`\n )\n }\n // Check for collision if this is a root entity (singleton case)\n if (this.isRoot) {\n const collision = this.api.exposes.find((e) => e.isRoot && e.key !== this.key && e.resourcePath === cleaned)\n if (collision) {\n throw new Error(`Resource path \"${cleaned}\" is already in use by another root entity.`)\n }\n }\n\n if (this.resourcePath !== cleaned) {\n this.resourcePath = `/${segments[0]}/${segments[1]}`\n }\n }\n\n /**\n * Computes the absolute path for this exposure's resource endpoint by\n * walking up the exposure tree using `parent.key` until reaching a root exposure.\n * The absolute path is composed by concatenating each ancestor's resource path\n * with this exposure's resource path.\n */\n getAbsoluteResourcePath(): string {\n let absolute = ensureLeadingSlash(this.resourcePath)\n // Traverse parents, always joining with the parent's resource path\n let parentKey = this.parent?.key\n while (parentKey) {\n const parent = this.api.exposes.find((e) => e.key === parentKey)\n if (!parent) break\n const parentResource = ensureLeadingSlash(parent.resourcePath)\n absolute = joinPaths(parentResource, absolute)\n parentKey = parent.parent?.key\n }\n return absolute\n }\n\n /**\n * Computes the absolute path for this exposure's collection endpoint (if any)\n * by walking up the exposure tree using `parent.key` until reaching a root exposure.\n * The absolute path is composed by concatenating each ancestor's resource path\n * with this exposure's collection path.\n * Returns undefined if this exposure has no collection.\n */\n getAbsoluteCollectionPath(): string | undefined {\n if (!this.hasCollection || !this.collectionPath) return undefined\n let absolute = ensureLeadingSlash(this.collectionPath)\n // Traverse parents, always joining with the parent's resource path\n let parentKey = this.parent?.key\n while (parentKey) {\n const parent = this.api.exposes.find((e) => e.key === parentKey)\n if (!parent) break\n const parentResource = ensureLeadingSlash(parent.resourcePath)\n absolute = joinPaths(parentResource, absolute)\n parentKey = parent.parent?.key\n }\n return absolute\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ExposedEntity.js","sourceRoot":"","sources":["../../../src/modeling/ExposedEntity.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAE5E,OAAO,EAAsB,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAGhF;;;;;;;;;;;;;GAaG;IACU,aAAa;sBAAS,WAAW;;;;;;;;;;;;;;;;;;;iBAAjC,aAAc,SAAQ,WAAW;;;kCAe3C,QAAQ,EAAE;0CAeV,QAAQ,EAAE;wCAMV,QAAQ,EAAE;mCA4BV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;sCAKxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;wCAKxB,QAAQ,EAAE;YA3DC,uKAAS,MAAM,6BAAN,MAAM,uFAAmB;YAelC,+LAAS,cAAc,6BAAd,cAAc,uGAAoB;YAM3C,yLAAS,YAAY,6BAAZ,YAAY,mGAAQ;YA4Bf,0KAAS,OAAO,6BAAP,OAAO,yFAAU;YAK1B,mLAAS,UAAU,6BAAV,UAAU,+FAA0B;YAK3D,yLAAS,YAAY,6BAAZ,YAAY,mGAAuC;;;QAzExE;;WAEG;QACH,IAAI,CAA0B;QAE9B;;;WAGG;QACH,GA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C;YACD,OAAO,YAAY,CAAA;QACrB,CAAC;QAED;;;WAGG;QACH,sBAAsB;YACpB,MAAM,KAAK,GAAoB,EAAE,CAAA;YACjC,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;gBAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YAC5C,CAAC;YACD,4DAA4D;YAC5D,IAAI,OAAO,GAA8B,IAAI,CAAA;YAC7C,OAAO,OAAO,EAAE,CAAC;gBACf,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;oBACzB,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;gBAC3C,CAAC;gBACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YACjF,CAAC;YACD,OAAO,KAAK,CAAA;QACd,CAAC;;;SAzZU,aAAa","sourcesContent":["import { observed } from '../decorators/observed.js'\nimport { ExposedEntityKind } from '../models/kinds.js'\nimport { nanoid } from '../nanoid.js'\nimport { Action } from './actions/Action.js'\nimport { restoreAction } from './actions/index.js'\nimport type { ApiModel } from './ApiModel.js'\nimport { ensureLeadingSlash, joinPaths } from './helpers/endpointHelpers.js'\nimport { AccessRule } from './rules/AccessRule.js'\nimport { type RateLimitRule, restoreAccessRule } from './rules/index.js'\nimport { RateLimitingConfiguration } from './rules/RateLimitingConfiguration.js'\nimport type { AssociationTarget, ExposeOptions, ExposeParentRef, ExposedEntitySchema } from './types.js'\n\n/**\n * A class that specializes in representing an exposed Data Entity within an API Model.\n *\n * ## Design Note\n * This class enforces strict path constraints (e.g., single-segment collection paths like `/users`,\n * two-segment resource paths like `/users/{id}`).\n * This is an intentional design choice to support a UI paradigm for non-technical users, ensuring that\n * path segments are configured individually at each level of the exposure hierarchy.\n *\n * Flexibility is achieved by chaining exposed entities (parent/child relationships), where the final\n * absolute path is composed of all ancestral paths. See `getAbsoluteResourcePath()` and `getAbsoluteCollectionPath()`.\n *\n * @fires change - Emitted when the exposed entity has changed.\n */\nexport class ExposedEntity extends EventTarget {\n /**\n * The exposed entity kind recognizable by the ecosystem.\n */\n kind: typeof ExposedEntityKind\n\n /**\n * The unique key of the exposed entity.\n * This is a stable identifier that does not change across versions.\n */\n key: string\n\n /**\n * A pointer to a Data Entity from the Data Domain.\n */\n @observed() accessor entity: AssociationTarget\n\n /**\n * Indicates whether this exposure has a collection endpoint.\n * A collection endpoint is optional for nested exposures where the association is 1:1\n * and the schema is embedded directly under the parent resource.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n hasCollection: boolean\n\n /**\n * Path to the collection endpoint for this exposure.\n * Starts with '/'. Not set for 1:1 nested exposures where collection does not exist.\n */\n @observed() accessor collectionPath: string | undefined\n\n /**\n * Path to the resource endpoint for this exposure.\n * Starts with '/'. For 1:1 nested exposures the resource path typically does not include an id segment.\n */\n @observed() accessor resourcePath: string\n\n /**\n * Whether this exposure is a root exposure (top-level collection).\n * If this is set then the `parent` reference must be populated.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n isRoot?: boolean\n\n /**\n * Parent reference when this exposure was created via following an association.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n parent?: ExposeParentRef\n\n /**\n * Expose-time config used to create this exposure (persisted for auditing/UI).\n * This is only populated for the root exposure. All children exposures inherit this config.\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n exposeOptions?: ExposeOptions\n\n /**\n * The list of enabled API actions for this exposure (List/Read/Create/etc.)\n */\n @observed({ deep: true }) accessor actions: Action[]\n\n /**\n * Optional array of access rules that define the access control policies for this exposure.\n */\n @observed({ deep: true }) accessor accessRule: AccessRule[] | undefined\n\n /**\n * Optional configuration for rate limiting for this exposure.\n */\n @observed() accessor rateLimiting: RateLimitingConfiguration | undefined\n\n /**\n * When true, generation for this exposure hit configured limits\n *\n * Note that this property is not observed for changes as it is immutable after creation.\n */\n truncated?: boolean\n\n /**\n * When the notifying flag is set to true,\n * the domain is pending a notification.\n * No other notifications will be sent until\n * the current notification is sent.\n */\n #notifying = false\n /**\n * When the initializing flag is set to true,\n * the domain is not notified of changes.\n */\n #initializing = true\n /**\n * A reference to the parent API Model instance.\n */\n api: ApiModel\n\n static createSchema(input: Partial<ExposedEntitySchema> = {}): ExposedEntitySchema {\n const {\n key = nanoid(),\n entity = { key: '' },\n collectionPath,\n resourcePath = '/',\n hasCollection = true,\n isRoot,\n parent,\n exposeOptions,\n actions = [],\n accessRule,\n rateLimiting,\n truncated,\n } = input\n const result: ExposedEntitySchema = {\n kind: ExposedEntityKind,\n key,\n entity: { ...entity },\n hasCollection,\n resourcePath,\n actions: actions.map((a) => ({ ...a })),\n }\n if (collectionPath !== undefined) {\n result.collectionPath = collectionPath\n }\n if (isRoot !== undefined) {\n result.isRoot = isRoot\n }\n if (parent !== undefined) {\n result.parent = { ...parent }\n }\n if (exposeOptions !== undefined) {\n result.exposeOptions = { ...exposeOptions }\n }\n if (Array.isArray(accessRule)) {\n result.accessRule = accessRule.map((ar) => ({ ...ar }))\n }\n if (rateLimiting !== undefined) {\n result.rateLimiting = { ...rateLimiting }\n }\n if (truncated !== undefined) {\n result.truncated = truncated\n }\n return result\n }\n\n constructor(model: ApiModel, state?: Partial<ExposedEntitySchema>) {\n super()\n this.api = model\n const init = ExposedEntity.createSchema(state)\n this.kind = init.kind\n this.key = init.key\n this.entity = init.entity\n this.hasCollection = init.hasCollection\n this.collectionPath = init.collectionPath\n this.resourcePath = init.resourcePath\n this.isRoot = init.isRoot\n this.parent = init.parent\n this.exposeOptions = init.exposeOptions\n this.actions = init.actions ? init.actions.map((a) => restoreAction(this, a)) : []\n this.accessRule = init.accessRule ? init.accessRule.map((ar) => restoreAccessRule(ar)) : []\n this.rateLimiting = init.rateLimiting ? new RateLimitingConfiguration(init.rateLimiting) : undefined\n this.truncated = init.truncated\n this.#initializing = false\n }\n\n notifyChange() {\n if (this.#notifying || this.#initializing) {\n return\n }\n this.#notifying = true\n queueMicrotask(() => {\n this.#notifying = false\n const event = new Event('change')\n this.dispatchEvent(event)\n })\n }\n\n toJSON(): ExposedEntitySchema {\n const result: ExposedEntitySchema = {\n kind: this.kind,\n key: this.key,\n entity: { ...this.entity },\n resourcePath: this.resourcePath,\n actions: this.actions.map((a) => a.toJSON()),\n hasCollection: this.hasCollection,\n }\n if (this.collectionPath !== undefined) {\n result.collectionPath = this.collectionPath\n }\n if (this.isRoot !== undefined) {\n result.isRoot = this.isRoot\n }\n if (this.parent !== undefined) {\n result.parent = { ...this.parent }\n }\n if (this.exposeOptions !== undefined) {\n result.exposeOptions = { ...this.exposeOptions }\n }\n if (Array.isArray(this.accessRule) && this.accessRule.length > 0) {\n result.accessRule = this.accessRule.map((ar) => ar.toJSON())\n }\n if (this.rateLimiting !== undefined) {\n result.rateLimiting = this.rateLimiting.toJSON()\n }\n if (this.truncated !== undefined) {\n result.truncated = this.truncated\n }\n return result\n }\n\n /**\n * Sets a new collection path for this exposed entity.\n *\n * It:\n * - updates the collectionPath property\n * - updates the absoluteCollectionPath property accordingly\n * - updates the resourcePath accordingly.\n * @param path The new path to set.\n */\n setCollectionPath(path: string) {\n if (!this.hasCollection) {\n throw new Error(`Cannot set collection path on an exposure that does not have a collection`)\n }\n const cleaned = ensureLeadingSlash(path)\n // Ensure exactly one non-empty segment\n const segments = cleaned.split('/').filter(Boolean)\n if (segments.length !== 1) {\n throw new Error(`Collection path must contain exactly one segment. Received: \"${path}\"`)\n }\n const normalizedCollection = `/${segments[0]}`\n\n // Check for collision if this is a root entity\n if (this.isRoot) {\n const collision = this.api.findCollectionPathCollision(normalizedCollection, this.key)\n if (collision) {\n throw new Error(`Collection path \"${normalizedCollection}\" is already in use by another root entity.`)\n }\n }\n\n // Preserve current parameter name if present, otherwise default to {id}\n let param = '{id}'\n if (this.resourcePath) {\n const curSegments = this.resourcePath.split('/').filter(Boolean)\n const maybeParam = curSegments[1]\n if (maybeParam && /^\\{[A-Za-z_][A-Za-z0-9_]*\\}$/.test(maybeParam)) {\n param = maybeParam\n }\n }\n const nextResource = `${normalizedCollection}/${param}`\n this.collectionPath = normalizedCollection\n this.resourcePath = nextResource\n // rely on ApiModel.exposes deep observation to notify on property sets\n }\n\n /**\n * Sets a new resource path for this exposed entity.\n *\n * Rules:\n * - Must start with '/'.\n * - If this exposure has a collection, the path must be exactly the collection path plus a single\n * parameter segment (e.g. `/products/{productId}`) and only the parameter name may vary.\n * - If this exposure does NOT have a collection, the path can be any two segments (e.g. `/profile/{id}` or `/a/b`).\n */\n setResourcePath(path: string) {\n const cleaned = ensureLeadingSlash(path)\n const segments = cleaned.split('/').filter(Boolean)\n\n if (this.hasCollection) {\n if (!this.collectionPath) {\n throw new Error('Cannot set resource path: missing collection path for this exposure')\n }\n const colSegments = this.collectionPath.split('/').filter(Boolean)\n if (colSegments.length !== 1) {\n throw new Error(`Invalid stored collection path \"${this.collectionPath}\"`)\n }\n if (segments.length !== 2) {\n throw new Error(`Resource path must be exactly two segments (collection + parameter). Received: \"${cleaned}\"`)\n }\n const [s1, s2] = segments\n if (s1 !== colSegments[0]) {\n throw new Error(`Resource path must start with the collection segment \"${colSegments[0]}\". Received: \"${s1}\"`)\n }\n // s2 must be a parameter segment {name}\n if (!/^\\{[A-Za-z_][A-Za-z0-9_]*\\}$/.test(s2)) {\n throw new Error(`The second segment must be a parameter in braces, e.g. {id}. Received: \"${s2}\"`)\n }\n if (this.resourcePath !== cleaned) {\n this.resourcePath = `/${s1}/${s2}`\n }\n return\n }\n\n // No collection: allow any two segments\n if (segments.length !== 2) {\n throw new Error(\n `Resource path must contain exactly two segments when no collection is present. Received: \"${cleaned}\"`\n )\n }\n // Check for collision if this is a root entity (singleton case)\n if (this.isRoot) {\n const collision = this.api.findResourcePathCollision(cleaned, this.key)\n if (collision) {\n throw new Error(`Resource path \"${cleaned}\" is already in use by another root entity.`)\n }\n }\n\n if (this.resourcePath !== cleaned) {\n this.resourcePath = `/${segments[0]}/${segments[1]}`\n }\n }\n\n /**\n * Computes the absolute path for this exposure's resource endpoint by\n * walking up the exposure tree using `parent.key` until reaching a root exposure.\n * The absolute path is composed by concatenating each ancestor's resource path\n * with this exposure's resource path.\n */\n getAbsoluteResourcePath(): string {\n let absolute = ensureLeadingSlash(this.resourcePath)\n // Traverse parents, always joining with the parent's resource path\n let parentKey = this.parent?.key\n while (parentKey) {\n const parent = this.api.exposes.get(parentKey)\n if (!parent) break\n const parentResource = ensureLeadingSlash(parent.resourcePath)\n absolute = joinPaths(parentResource, absolute)\n parentKey = parent.parent?.key\n }\n return absolute\n }\n\n /**\n * Computes the absolute path for this exposure's collection endpoint (if any)\n * by walking up the exposure tree using `parent.key` until reaching a root exposure.\n * The absolute path is composed by concatenating each ancestor's resource path\n * with this exposure's collection path.\n * Returns undefined if this exposure has no collection.\n */\n getAbsoluteCollectionPath(): string | undefined {\n if (!this.hasCollection || !this.collectionPath) return undefined\n let absolute = ensureLeadingSlash(this.collectionPath)\n // Traverse parents, always joining with the parent's resource path\n let parentKey = this.parent?.key\n while (parentKey) {\n const parent = this.api.exposes.get(parentKey)\n if (!parent) break\n const parentResource = ensureLeadingSlash(parent.resourcePath)\n absolute = joinPaths(parentResource, absolute)\n parentKey = parent.parent?.key\n }\n return absolute\n }\n\n /**\n * Returns all access rules for this exposure, including the ones from all the parents up to the API.\n */\n getAllRules(): AccessRule[] {\n const rules: AccessRule[] = []\n this.api.accessRule.forEach((rule) => rules.push(rule))\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let current: ExposedEntity | undefined = this\n while (current) {\n if (current.accessRule) {\n rules.push(...current.accessRule)\n }\n current = current.parent ? this.api.exposes.get(current.parent.key) : undefined\n }\n return rules\n }\n\n /**\n * Returns all rate limiters for this exposure, including the ones from all the parents up to the API.\n */\n getAllRateLimiters(): RateLimitingConfiguration[] {\n const rateLimiters: RateLimitingConfiguration[] = []\n if (this.api.rateLimiting) {\n rateLimiters.push(this.api.rateLimiting)\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let current: ExposedEntity | undefined = this\n while (current) {\n if (current.rateLimiting) {\n rateLimiters.push(current.rateLimiting)\n }\n current = current.parent ? this.api.exposes.get(current.parent.key) : undefined\n }\n return rateLimiters\n }\n\n /**\n * Returns all rate limiter rules for this exposure, including the ones from all the parents up to the API.\n * Similar to the getAllRules() method, but it flattens the rate limiters into a single list of rules.\n */\n getAllRateLimiterRules(): RateLimitRule[] {\n const rules: RateLimitRule[] = []\n if (this.api.rateLimiting) {\n rules.push(...this.api.rateLimiting.rules)\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let current: ExposedEntity | undefined = this\n while (current) {\n if (current.rateLimiting) {\n rules.push(...current.rateLimiting.rules)\n }\n current = current.parent ? this.api.exposes.get(current.parent.key) : undefined\n }\n return rules\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AccessRule, AccessRuleSchema } from '../rules/AccessRule.js';
|
|
2
2
|
import { RateLimitingConfiguration, RateLimitingConfigurationSchema } from '../rules/RateLimitingConfiguration.js';
|
|
3
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
3
4
|
/**
|
|
4
5
|
* A base interface for common properties across all actions.
|
|
5
6
|
*/
|
|
@@ -34,8 +35,17 @@ export declare class Action extends EventTarget implements ActionSchema {
|
|
|
34
35
|
accessor kind: string;
|
|
35
36
|
accessor accessRule: AccessRule[];
|
|
36
37
|
accessor rateLimiting: RateLimitingConfiguration | undefined;
|
|
37
|
-
|
|
38
|
+
protected parent: ExposedEntity;
|
|
39
|
+
constructor(parent: ExposedEntity, state?: Partial<ActionSchema>);
|
|
38
40
|
notifyChange(): void;
|
|
39
41
|
toJSON(): ActionSchema;
|
|
42
|
+
/**
|
|
43
|
+
* Returns all access rules for this action, including the ones from all the parents up to the API.
|
|
44
|
+
*/
|
|
45
|
+
getAllRules(): AccessRule[];
|
|
46
|
+
/**
|
|
47
|
+
* Returns all rate limiters for this action, including the ones from all the parents up to the API.
|
|
48
|
+
*/
|
|
49
|
+
getAllRateLimiters(): RateLimitingConfiguration[];
|
|
40
50
|
}
|
|
41
51
|
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAA;
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAA;AAGlH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,+BAA+B,CAAA;CAC/C;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAY,YAAW,YAAY;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACP,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE,CAAA;IAC/C,QAAQ,CAAC,YAAY,EAAE,yBAAyB,GAAG,SAAS,CAAA;IAExE,SAAS,CAAC,MAAM,EAAE,aAAa,CAAA;gBAEnB,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,YAAY,CAAM;IAQpE,YAAY;IAIZ,MAAM,IAAI,YAAY;IAatB;;OAEG;IACH,WAAW,IAAI,UAAU,EAAE;IAK3B;;OAEG;IACH,kBAAkB,IAAI,yBAAyB,EAAE;CAOlD"}
|
|
@@ -21,7 +21,7 @@ let Action = (() => {
|
|
|
21
21
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
22
22
|
_kind_decorators = [observed()];
|
|
23
23
|
_accessRule_decorators = [observed({ deep: true })];
|
|
24
|
-
_rateLimiting_decorators = [observed(
|
|
24
|
+
_rateLimiting_decorators = [observed()];
|
|
25
25
|
__esDecorate(this, null, _kind_decorators, { kind: "accessor", name: "kind", static: false, private: false, access: { has: obj => "kind" in obj, get: obj => obj.kind, set: (obj, value) => { obj.kind = value; } }, metadata: _metadata }, _kind_initializers, _kind_extraInitializers);
|
|
26
26
|
__esDecorate(this, null, _accessRule_decorators, { kind: "accessor", name: "accessRule", static: false, private: false, access: { has: obj => "accessRule" in obj, get: obj => obj.accessRule, set: (obj, value) => { obj.accessRule = value; } }, metadata: _metadata }, _accessRule_initializers, _accessRule_extraInitializers);
|
|
27
27
|
__esDecorate(this, null, _rateLimiting_decorators, { kind: "accessor", name: "rateLimiting", static: false, private: false, access: { has: obj => "rateLimiting" in obj, get: obj => obj.rateLimiting, set: (obj, value) => { obj.rateLimiting = value; } }, metadata: _metadata }, _rateLimiting_initializers, _rateLimiting_extraInitializers);
|
|
@@ -36,9 +36,10 @@ let Action = (() => {
|
|
|
36
36
|
#rateLimiting_accessor_storage = (__runInitializers(this, _accessRule_extraInitializers), __runInitializers(this, _rateLimiting_initializers, void 0));
|
|
37
37
|
get rateLimiting() { return this.#rateLimiting_accessor_storage; }
|
|
38
38
|
set rateLimiting(value) { this.#rateLimiting_accessor_storage = value; }
|
|
39
|
-
|
|
39
|
+
parent = __runInitializers(this, _rateLimiting_extraInitializers);
|
|
40
|
+
constructor(parent, state = {}) {
|
|
40
41
|
super();
|
|
41
|
-
|
|
42
|
+
this.parent = parent;
|
|
42
43
|
this.kind = state.kind || '';
|
|
43
44
|
this.accessRule = state.accessRule ? state.accessRule.map((rule) => restoreAccessRule(rule)) : [];
|
|
44
45
|
this.rateLimiting = state.rateLimiting ? new RateLimitingConfiguration(state.rateLimiting) : undefined;
|
|
@@ -58,6 +59,23 @@ let Action = (() => {
|
|
|
58
59
|
}
|
|
59
60
|
return result;
|
|
60
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns all access rules for this action, including the ones from all the parents up to the API.
|
|
64
|
+
*/
|
|
65
|
+
getAllRules() {
|
|
66
|
+
const rules = [...this.parent.getAllRules(), ...this.accessRule];
|
|
67
|
+
return rules;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns all rate limiters for this action, including the ones from all the parents up to the API.
|
|
71
|
+
*/
|
|
72
|
+
getAllRateLimiters() {
|
|
73
|
+
const rateLimiters = this.parent.getAllRateLimiters();
|
|
74
|
+
if (this.rateLimiting) {
|
|
75
|
+
rateLimiters.push(this.rateLimiting);
|
|
76
|
+
}
|
|
77
|
+
return rateLimiters;
|
|
78
|
+
}
|
|
61
79
|
};
|
|
62
80
|
})();
|
|
63
81
|
export { Action };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uCAAuC,CAAA;AAClH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/modeling/actions/Action.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,yBAAyB,EAAmC,MAAM,uCAAuC,CAAA;AAClH,OAAO,EAAE,QAAQ,EAAE,M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,MAAM,MAAM,GAAiB;gBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAA;YACD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;gBAC3B,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;YAClE,CAAC;YACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAA;YAClD,CAAC;YACD,OAAO,MAAM,CAAA;QACf,CAAC;QAED;;WAEG;QACH,WAAW;YACT,MAAM,KAAK,GAAiB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;YAC9E,OAAO,KAAK,CAAA;QACd,CAAC;QAED;;WAEG;QACH,kBAAkB;YAChB,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAA;YACrD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACtB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;YACtC,CAAC;YACD,OAAO,YAAY,CAAA;QACrB,CAAC;;;SAjDU,MAAM","sourcesContent":["import { AccessRule, AccessRuleSchema } from '../rules/AccessRule.js'\nimport { RateLimitingConfiguration, RateLimitingConfigurationSchema } from '../rules/RateLimitingConfiguration.js'\nimport { observed } from '../../decorators/observed.js'\nimport { restoreAccessRule } from '../rules/index.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * A base interface for common properties across all actions.\n */\nexport interface ActionSchema {\n /**\n * The specific kind of action (e.g., 'List', 'Read', etc.)\n */\n kind: string\n /**\n * Access control rules defining who can perform this action. It is only applied if the\n * authorization strategy is set to 'RBAC'.\n * If no rules grant access, it's denied by default making it essentially private.\n *\n * Note, the API can defined top level access rules that apply to all actions. If this property is set,\n * it overrides the top level access rules for this specific action.\n *\n * It is an ordered list, meaning the first rule that matches the user will be applied.\n * If multiple rules match, the first one in the list takes precedence.\n * If no rules match, the action is denied.\n */\n accessRule?: AccessRuleSchema[]\n /**\n * Optional configuration for action-wide rate limiting and throttling.\n * Defines rules to protect the action from overuse.\n */\n rateLimiting?: RateLimitingConfigurationSchema\n}\n\n/**\n * A base class for common properties across all actions.\n */\nexport class Action extends EventTarget implements ActionSchema {\n @observed() accessor kind: string\n @observed({ deep: true }) accessor accessRule: AccessRule[]\n @observed() accessor rateLimiting: RateLimitingConfiguration | undefined\n\n protected parent: ExposedEntity\n\n constructor(parent: ExposedEntity, state: Partial<ActionSchema> = {}) {\n super()\n this.parent = parent\n this.kind = state.kind || ''\n this.accessRule = state.accessRule ? state.accessRule.map((rule) => restoreAccessRule(rule)) : []\n this.rateLimiting = state.rateLimiting ? new RateLimitingConfiguration(state.rateLimiting) : undefined\n }\n\n notifyChange() {\n this.dispatchEvent(new Event('change'))\n }\n\n toJSON(): ActionSchema {\n const result: ActionSchema = {\n kind: this.kind,\n }\n if (this.accessRule.length) {\n result.accessRule = this.accessRule.map((rule) => rule.toJSON())\n }\n if (this.rateLimiting) {\n result.rateLimiting = this.rateLimiting.toJSON()\n }\n return result\n }\n\n /**\n * Returns all access rules for this action, including the ones from all the parents up to the API.\n */\n getAllRules(): AccessRule[] {\n const rules: AccessRule[] = [...this.parent.getAllRules(), ...this.accessRule]\n return rules\n }\n\n /**\n * Returns all rate limiters for this action, including the ones from all the parents up to the API.\n */\n getAllRateLimiters(): RateLimitingConfiguration[] {\n const rateLimiters = this.parent.getAllRateLimiters()\n if (this.rateLimiting) {\n rateLimiters.push(this.rateLimiting)\n }\n return rateLimiters\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
2
3
|
/**
|
|
3
4
|
* Enables adding a new resource to a collection.
|
|
4
5
|
* Endpoint: POST /[entity-collection-name]
|
|
@@ -12,7 +13,7 @@ export interface CreateActionSchema extends ActionSchema {
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class CreateAction extends Action implements CreateActionSchema {
|
|
14
15
|
accessor kind: 'create';
|
|
15
|
-
constructor(state?: Partial<CreateActionSchema>);
|
|
16
|
+
constructor(parent: ExposedEntity, state?: Partial<CreateActionSchema>);
|
|
16
17
|
toJSON(): CreateActionSchema;
|
|
17
18
|
static isCreateAction(action: Action): action is CreateAction;
|
|
18
19
|
static isCreateActionSchema(schema: ActionSchema): schema is CreateActionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"CreateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;CACf;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;gBAEhC,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAKjE,MAAM,IAAI,kBAAkB;IAOrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
|
|
@@ -20,8 +20,8 @@ let CreateAction = (() => {
|
|
|
20
20
|
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
21
21
|
get kind() { return this.#kind_accessor_storage; }
|
|
22
22
|
set kind(value) { this.#kind_accessor_storage = value; }
|
|
23
|
-
constructor(state = {}) {
|
|
24
|
-
super(state);
|
|
23
|
+
constructor(parent, state = {}) {
|
|
24
|
+
super(parent, state);
|
|
25
25
|
__runInitializers(this, _kind_extraInitializers);
|
|
26
26
|
this.kind = 'create';
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"CreateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/CreateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAWvD;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;YAAC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;;;QAAhC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAE5C,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;SACrB;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;aACf,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SArBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport interface CreateActionSchema extends ActionSchema {\n kind: 'create'\n}\n\n/**\n * Enables adding a new resource to a collection.\n * Endpoint: POST /[entity-collection-name]\n */\nexport class CreateAction extends Action implements CreateActionSchema {\n @observed() override accessor kind: 'create'\n\n constructor(parent: ExposedEntity, state: Partial<CreateActionSchema> = {}) {\n super(parent, state)\n this.kind = 'create'\n }\n\n override toJSON(): CreateActionSchema {\n return {\n ...(super.toJSON() as CreateActionSchema),\n kind: 'create',\n }\n }\n\n static isCreateAction(action: Action): action is CreateAction {\n return action.kind === 'create'\n }\n\n static isCreateActionSchema(schema: ActionSchema): schema is CreateActionSchema {\n return schema.kind === 'create'\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
2
3
|
export type DeleteStrategy = 'soft' | 'hard';
|
|
3
4
|
/**
|
|
4
5
|
* Enables removing an existing resource.
|
|
@@ -28,7 +29,7 @@ export declare class DeleteAction extends Action implements DeleteActionSchema {
|
|
|
28
29
|
accessor kind: 'delete';
|
|
29
30
|
accessor strategy: DeleteStrategy;
|
|
30
31
|
accessor retentionPeriod: number;
|
|
31
|
-
constructor(state?: Partial<DeleteActionSchema>);
|
|
32
|
+
constructor(parent: ExposedEntity, state?: Partial<DeleteActionSchema>);
|
|
32
33
|
toJSON(): DeleteActionSchema;
|
|
33
34
|
static isDeleteAction(action: Action): action is DeleteAction;
|
|
34
35
|
static isDeleteActionSchema(schema: ActionSchema): schema is DeleteActionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"DeleteAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5C;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAChC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;gBAEhC,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAOjE,MAAM,IAAI,kBAAkB;IASrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
|
|
@@ -36,8 +36,8 @@ let DeleteAction = (() => {
|
|
|
36
36
|
#retentionPeriod_accessor_storage = (__runInitializers(this, _strategy_extraInitializers), __runInitializers(this, _retentionPeriod_initializers, void 0));
|
|
37
37
|
get retentionPeriod() { return this.#retentionPeriod_accessor_storage; }
|
|
38
38
|
set retentionPeriod(value) { this.#retentionPeriod_accessor_storage = value; }
|
|
39
|
-
constructor(state = {}) {
|
|
40
|
-
super(state);
|
|
39
|
+
constructor(parent, state = {}) {
|
|
40
|
+
super(parent, state);
|
|
41
41
|
__runInitializers(this, _retentionPeriod_extraInitializers);
|
|
42
42
|
this.kind = 'delete';
|
|
43
43
|
this.strategy = state.strategy || 'soft';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"DeleteAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/DeleteAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AA0BvD;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;oCACV,QAAQ,EAAE;2CACV,QAAQ,EAAE;YAFC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAChC,6KAAS,QAAQ,6BAAR,QAAQ,2FAAgB;YACjC,kMAAS,eAAe,6BAAf,eAAe,yGAAQ;;;QAFhC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAChC,yIAAiC;QAAjC,IAAS,QAAQ,8CAAgB;QAAjC,IAAS,QAAQ,oDAAgB;QACjC,2JAAgC;QAAhC,IAAS,eAAe,qDAAQ;QAAhC,IAAS,eAAe,2DAAQ;QAE5C,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAA;YACxC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAA;SACnD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,eAAe,EAAE,IAAI,CAAC,eAAe;aACtC,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SA3BU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\nexport type DeleteStrategy = 'soft' | 'hard'\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport interface DeleteActionSchema extends ActionSchema {\n kind: 'delete'\n /**\n * The strategy for deletion. Default: Soft Delete.\n *\n * @default 'soft'\n */\n strategy?: DeleteStrategy\n /**\n * The data retention period (in days) for soft-deleted resources.\n * This defines how long the data should be kept before it is permanently deleted.\n *\n * @default 30\n */\n retentionPeriod?: number\n}\n\n/**\n * Enables removing an existing resource.\n * Endpoint: DELETE /[entity-collection-name]/{id}\n */\nexport class DeleteAction extends Action implements DeleteActionSchema {\n @observed() override accessor kind: 'delete'\n @observed() accessor strategy: DeleteStrategy\n @observed() accessor retentionPeriod: number\n\n constructor(parent: ExposedEntity, state: Partial<DeleteActionSchema> = {}) {\n super(parent, state)\n this.kind = 'delete'\n this.strategy = state.strategy || 'soft'\n this.retentionPeriod = state.retentionPeriod ?? 30\n }\n\n override toJSON(): DeleteActionSchema {\n return {\n ...(super.toJSON() as DeleteActionSchema),\n kind: 'delete',\n strategy: this.strategy,\n retentionPeriod: this.retentionPeriod,\n }\n }\n\n static isDeleteAction(action: Action): action is DeleteAction {\n return action.kind === 'delete'\n }\n\n static isDeleteActionSchema(schema: ActionSchema): schema is DeleteActionSchema {\n return schema.kind === 'delete'\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PaginationStrategy } from '../types.js';
|
|
2
2
|
import { Action, type ActionSchema } from './Action.js';
|
|
3
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
3
4
|
/**
|
|
4
5
|
* Enables retrieving a collection of resources.
|
|
5
6
|
* Endpoint: GET /[entity-collection-name]
|
|
@@ -31,7 +32,7 @@ export declare class ListAction extends Action implements ListActionSchema {
|
|
|
31
32
|
accessor pagination: PaginationStrategy;
|
|
32
33
|
accessor filterableFields: string[];
|
|
33
34
|
accessor sortableFields: string[];
|
|
34
|
-
constructor(state?: Partial<ListActionSchema>);
|
|
35
|
+
constructor(parent: ExposedEntity, state?: Partial<ListActionSchema>);
|
|
35
36
|
toJSON(): ListActionSchema;
|
|
36
37
|
static isListAction(action: Action): action is ListAction;
|
|
37
38
|
static isListActionSchema(schema: ActionSchema): schema is ListActionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ListAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ListAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ListAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,UAAU,EAAE,kBAAkB,CAAA;IAC9B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B;;OAEG;IACH,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,MAAO,YAAW,gBAAgB;IAChE,SAA8B,IAAI,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAK;IACxC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAK;gBAEpD,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAY/D,MAAM,IAAI,gBAAgB;IASnC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,UAAU;IAIzD,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,gBAAgB;CAG5E"}
|
|
@@ -44,8 +44,8 @@ let ListAction = (() => {
|
|
|
44
44
|
#sortableFields_accessor_storage = (__runInitializers(this, _filterableFields_extraInitializers), __runInitializers(this, _sortableFields_initializers, []));
|
|
45
45
|
get sortableFields() { return this.#sortableFields_accessor_storage; }
|
|
46
46
|
set sortableFields(value) { this.#sortableFields_accessor_storage = value; }
|
|
47
|
-
constructor(state = {}) {
|
|
48
|
-
super(state);
|
|
47
|
+
constructor(parent, state = {}) {
|
|
48
|
+
super(parent, state);
|
|
49
49
|
__runInitializers(this, _sortableFields_extraInitializers);
|
|
50
50
|
this.kind = state.kind || 'list';
|
|
51
51
|
this.pagination = state.pagination
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ListAction.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"ListAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ListAction.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AA0B9D;;;GAGG;IACU,UAAU;sBAAS,MAAM;;;;;;;;;;;;;iBAAzB,UAAW,SAAQ,WAAM;;;gCACnC,QAAQ,EAAE;sCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;4CACxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;0CACxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAHb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAQ;YAChB,mLAAS,UAAU,6BAAV,UAAU,+FAAoB;YACvC,qMAAS,gBAAgB,6BAAhB,gBAAgB,2GAAe;YACxC,+LAAS,cAAc,6BAAd,cAAc,uGAAe;;;QAHpD,6EAA8B;QAA9B,IAAkB,IAAI,0CAAQ;QAA9B,IAAkB,IAAI,gDAAQ;QAChB,6IAAuC;QAAvC,IAAS,UAAU,gDAAoB;QAAvC,IAAS,UAAU,sDAAoB;QACvC,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B;YAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;;;SAjCU,UAAU","sourcesContent":["import type { PaginationStrategy } from '../types.js'\nimport { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables retrieving a collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport interface ListActionSchema extends ActionSchema {\n kind: 'list'\n /**\n * The pagination strategy used for this action.\n * This defines how the results are paginated when retrieving a collection of resources.\n * It can be either 'cursor' or 'offset'.\n */\n pagination: PaginationStrategy\n /**\n * Fields from the entity that can be used for filtering.\n * Must be marked as \"indexable\" in the Data Model.\n */\n filterableFields: string[]\n /**\n * Fields from the entity that can be used for sorting.\n */\n sortableFields: string[]\n}\n\n/**\n * Enables retrieving a collection of resources.\n * Endpoint: GET /[entity-collection-name]\n */\nexport class ListAction extends Action implements ListActionSchema {\n @observed() override accessor kind: 'list'\n @observed({ deep: true }) accessor pagination: PaginationStrategy\n @observed({ deep: true }) accessor filterableFields: string[] = []\n @observed({ deep: true }) accessor sortableFields: string[] = []\n\n constructor(parent: ExposedEntity, state: Partial<ListActionSchema> = {}) {\n super(parent, state)\n this.kind = state.kind || 'list'\n this.pagination = state.pagination\n ? { ...state.pagination }\n : {\n kind: 'offset',\n }\n this.filterableFields = state.filterableFields ? [...state.filterableFields] : []\n this.sortableFields = state.sortableFields ? [...state.sortableFields] : []\n }\n\n override toJSON(): ListActionSchema {\n return {\n ...(super.toJSON() as ListActionSchema),\n pagination: structuredClone(toRaw(this, this.pagination)) as PaginationStrategy,\n filterableFields: structuredClone(toRaw(this, this.filterableFields)) as string[],\n sortableFields: structuredClone(toRaw(this, this.sortableFields)) as string[],\n }\n }\n\n static isListAction(action: Action): action is ListAction {\n return action.kind === 'list'\n }\n\n static isListActionSchema(schema: ActionSchema): schema is ListActionSchema {\n return schema.kind === 'list'\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
2
3
|
/**
|
|
3
4
|
* Enables retrieving a single resource by its ID.
|
|
4
5
|
* Endpoint: GET /[entity-collection-name]/{id}
|
|
@@ -12,7 +13,7 @@ export interface ReadActionSchema extends ActionSchema {
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class ReadAction extends Action implements ReadActionSchema {
|
|
14
15
|
accessor kind: 'read';
|
|
15
|
-
constructor(state?: Partial<ReadActionSchema>);
|
|
16
|
+
constructor(parent: ExposedEntity, state?: Partial<ReadActionSchema>);
|
|
16
17
|
toJSON(): ReadActionSchema;
|
|
17
18
|
static isReadAction(action: Action): action is ReadAction;
|
|
18
19
|
static isReadActionSchema(schema: ActionSchema): schema is ReadActionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ReadAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,IAAI,EAAE,MAAM,CAAA;CAGb;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,MAAO,YAAW,gBAAgB;IAChE,SAA8B,IAAI,EAAE,MAAM,CAAA;gBAE9B,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM;IAK/D,MAAM,IAAI,gBAAgB;IAOnC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,UAAU;IAIzD,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,gBAAgB;CAG5E"}
|
|
@@ -20,8 +20,8 @@ let ReadAction = (() => {
|
|
|
20
20
|
#kind_accessor_storage = __runInitializers(this, _kind_initializers, void 0);
|
|
21
21
|
get kind() { return this.#kind_accessor_storage; }
|
|
22
22
|
set kind(value) { this.#kind_accessor_storage = value; }
|
|
23
|
-
constructor(state = {}) {
|
|
24
|
-
super(state);
|
|
23
|
+
constructor(parent, state = {}) {
|
|
24
|
+
super(parent, state);
|
|
25
25
|
__runInitializers(this, _kind_extraInitializers);
|
|
26
26
|
this.kind = 'read';
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"ReadAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/ReadAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAavD;;;GAGG;IACU,UAAU;sBAAS,MAAM;;;;iBAAzB,UAAW,SAAQ,WAAM;;;gCACnC,QAAQ,EAAE;YAAC,iKAAkB,IAAI,6BAAJ,IAAI,mFAAQ;;;QAA9B,6EAA8B;QAA9B,IAAkB,IAAI,0CAAQ;QAA9B,IAAkB,IAAI,gDAAQ;QAE1C,YAAY,MAAqB,EAAE,QAAmC,EAAE;YACtE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAA;SACnB;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAuB;gBACvC,IAAI,EAAE,MAAM;aACb,CAAA;QACH,CAAC;QAED,MAAM,CAAC,YAAY,CAAC,MAAc;YAChC,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;QAED,MAAM,CAAC,kBAAkB,CAAC,MAAoB;YAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAA;QAC/B,CAAC;;;SArBU,UAAU","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport interface ReadActionSchema extends ActionSchema {\n kind: 'read'\n // Association handling (Link IDs vs. Embed) is defined on the\n // data association itself in the Data Modeler.\n}\n\n/**\n * Enables retrieving a single resource by its ID.\n * Endpoint: GET /[entity-collection-name]/{id}\n */\nexport class ReadAction extends Action implements ReadActionSchema {\n @observed() override accessor kind: 'read'\n\n constructor(parent: ExposedEntity, state: Partial<ReadActionSchema> = {}) {\n super(parent, state)\n this.kind = 'read'\n }\n\n override toJSON(): ReadActionSchema {\n return {\n ...(super.toJSON() as ReadActionSchema),\n kind: 'read',\n }\n }\n\n static isReadAction(action: Action): action is ReadAction {\n return action.kind === 'read'\n }\n\n static isReadActionSchema(schema: ActionSchema): schema is ReadActionSchema {\n return schema.kind === 'read'\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Action, type ActionSchema } from './Action.js';
|
|
2
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
2
3
|
/**
|
|
3
4
|
* Enables keyword-based search across specified fields.
|
|
4
5
|
* Endpoint: GET /[entity-collection-name]/search
|
|
@@ -18,7 +19,7 @@ export interface SearchActionSchema extends ActionSchema {
|
|
|
18
19
|
export declare class SearchAction extends Action implements SearchActionSchema {
|
|
19
20
|
accessor kind: 'search';
|
|
20
21
|
accessor fields: string[];
|
|
21
|
-
constructor(state?: Partial<SearchActionSchema>);
|
|
22
|
+
constructor(parent: ExposedEntity, state?: Partial<SearchActionSchema>);
|
|
22
23
|
toJSON(): SearchActionSchema;
|
|
23
24
|
static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema;
|
|
24
25
|
static isSearchAction(action: Action): action is SearchAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"SearchAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAA;gBAEvC,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAMjE,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;IAI/E,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;CAG9D"}
|
|
@@ -28,8 +28,8 @@ let SearchAction = (() => {
|
|
|
28
28
|
#fields_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _fields_initializers, void 0));
|
|
29
29
|
get fields() { return this.#fields_accessor_storage; }
|
|
30
30
|
set fields(value) { this.#fields_accessor_storage = value; }
|
|
31
|
-
constructor(state = {}) {
|
|
32
|
-
super(state);
|
|
31
|
+
constructor(parent, state = {}) {
|
|
32
|
+
super(parent, state);
|
|
33
33
|
__runInitializers(this, _fields_extraInitializers);
|
|
34
34
|
this.kind = 'search';
|
|
35
35
|
this.fields = state.fields ? [...state.fields] : [];
|