@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"SearchAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAgB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;kCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,uKAAS,MAAM,6BAAN,MAAM,uFAAU;;;QADvC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qIAAyB;QAAzB,IAAS,MAAM,4CAAU;QAAzB,IAAS,MAAM,kDAAU;QAEnD,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SACpD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAa;aAC9D,CAAA;QACH,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchActionSchema extends ActionSchema {\n kind: 'search'\n /**\n * The fields within the entity to be included in the search scope.\n * Must be \"indexable\" and typically text-based.\n */\n fields: string[]\n}\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport class SearchAction extends Action implements SearchActionSchema {\n @observed() override accessor kind: 'search'\n @observed({ deep: true }) accessor fields: string[]\n\n constructor(parent: ExposedEntity, state: Partial<SearchActionSchema> = {}) {\n super(parent, state)\n this.kind = 'search'\n this.fields = state.fields ? [...state.fields] : []\n }\n\n override toJSON(): SearchActionSchema {\n return {\n ...(super.toJSON() as SearchActionSchema),\n kind: 'search',\n fields: structuredClone(toRaw(this, this.fields)) as string[],\n }\n }\n\n static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema {\n return schema.kind === 'search'\n }\n\n static isSearchAction(action: Action): action is SearchAction {\n return action.kind === 'search'\n }\n}\n"]}
|
|
@@ -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 modifying an existing resource.
|
|
4
5
|
* Endpoints: PUT or PATCH /[entity-collection-name]/{id}
|
|
@@ -21,7 +22,7 @@ export interface UpdateActionSchema extends ActionSchema {
|
|
|
21
22
|
export declare class UpdateAction extends Action implements UpdateActionSchema {
|
|
22
23
|
accessor kind: 'update';
|
|
23
24
|
accessor allowedMethods: ('PUT' | 'PATCH')[];
|
|
24
|
-
constructor(state?: Partial<UpdateActionSchema>);
|
|
25
|
+
constructor(parent: ExposedEntity, state?: Partial<UpdateActionSchema>);
|
|
25
26
|
toJSON(): UpdateActionSchema;
|
|
26
27
|
static isUpdateAction(action: Action): action is UpdateAction;
|
|
27
28
|
static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"UpdateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;gBAE1D,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAMjE,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
|
|
@@ -28,8 +28,8 @@ let UpdateAction = (() => {
|
|
|
28
28
|
#allowedMethods_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _allowedMethods_initializers, void 0));
|
|
29
29
|
get allowedMethods() { return this.#allowedMethods_accessor_storage; }
|
|
30
30
|
set allowedMethods(value) { this.#allowedMethods_accessor_storage = value; }
|
|
31
|
-
constructor(state = {}) {
|
|
32
|
-
super(state);
|
|
31
|
+
constructor(parent, state = {}) {
|
|
32
|
+
super(parent, state);
|
|
33
33
|
__runInitializers(this, _allowedMethods_extraInitializers);
|
|
34
34
|
this.kind = 'update';
|
|
35
35
|
this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"UpdateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAmB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;0CACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,+LAAS,cAAc,6BAAd,cAAc,uGAAqB;;;QAD1D,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qJAA4C;QAA5C,IAAS,cAAc,oDAAqB;QAA5C,IAAS,cAAc,0DAAqB;QAEtE,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACnF;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAwB;aACzF,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateActionSchema extends ActionSchema {\n kind: 'update'\n /**\n * The allowed HTTP methods for updates. Default: PATCH only.\n *\n * These two methods represent the two common ways to update a resource:\n * - PUT: Replaces the entire resource with the provided data.\n * - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.\n */\n allowedMethods: ('PUT' | 'PATCH')[]\n}\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport class UpdateAction extends Action implements UpdateActionSchema {\n @observed() override accessor kind: 'update'\n @observed({ deep: true }) accessor allowedMethods: ('PUT' | 'PATCH')[]\n\n constructor(parent: ExposedEntity, state: Partial<UpdateActionSchema> = {}) {\n super(parent, state)\n this.kind = 'update'\n this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH']\n }\n\n override toJSON(): UpdateActionSchema {\n return {\n ...(super.toJSON() as UpdateActionSchema),\n kind: 'update',\n allowedMethods: structuredClone(toRaw(this, this.allowedMethods)) as ('PUT' | 'PATCH')[],\n }\n }\n\n static isUpdateAction(action: Action): action is UpdateAction {\n return action.kind === 'update'\n }\n\n static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema {\n return schema.kind === 'update'\n }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ import { ReadAction, type ReadActionSchema } from './ReadAction.js';
|
|
|
6
6
|
import { SearchAction, type SearchActionSchema } from './SearchAction.js';
|
|
7
7
|
import { UpdateAction, type UpdateActionSchema } from './UpdateAction.js';
|
|
8
8
|
import type { ActionSchema } from './Action.js';
|
|
9
|
+
import type { ExposedEntity } from '../ExposedEntity.js';
|
|
9
10
|
export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction };
|
|
10
11
|
export type { CreateActionSchema, DeleteActionSchema, ListActionSchema, ReadActionSchema, SearchActionSchema, UpdateActionSchema, };
|
|
11
12
|
/**
|
|
@@ -30,5 +31,5 @@ export type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'sea
|
|
|
30
31
|
* @param schema The schema to restore the action from.
|
|
31
32
|
* @returns The restored action.
|
|
32
33
|
*/
|
|
33
|
-
export declare function restoreAction(schema: ActionSchema): ApiAction;
|
|
34
|
+
export declare function restoreAction(parent: ExposedEntity, schema: ActionSchema): ApiAction;
|
|
34
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY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BAAkB,CAAA;AAEtB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEpF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,SAAS,CAoBpF"}
|
|
@@ -15,20 +15,20 @@ export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, Updat
|
|
|
15
15
|
* @param schema The schema to restore the action from.
|
|
16
16
|
* @returns The restored action.
|
|
17
17
|
*/
|
|
18
|
-
export function restoreAction(schema) {
|
|
18
|
+
export function restoreAction(parent, schema) {
|
|
19
19
|
switch (schema.kind) {
|
|
20
20
|
case 'list':
|
|
21
|
-
return new ListAction(schema);
|
|
21
|
+
return new ListAction(parent, schema);
|
|
22
22
|
case 'read':
|
|
23
|
-
return new ReadAction(schema);
|
|
23
|
+
return new ReadAction(parent, schema);
|
|
24
24
|
case 'create':
|
|
25
|
-
return new CreateAction(schema);
|
|
25
|
+
return new CreateAction(parent, schema);
|
|
26
26
|
case 'update':
|
|
27
|
-
return new UpdateAction(schema);
|
|
27
|
+
return new UpdateAction(parent, schema);
|
|
28
28
|
case 'delete':
|
|
29
|
-
return new DeleteAction(schema);
|
|
29
|
+
return new DeleteAction(parent, schema);
|
|
30
30
|
case 'search':
|
|
31
|
-
return new SearchAction(schema);
|
|
31
|
+
return new SearchAction(parent, schema);
|
|
32
32
|
default:
|
|
33
33
|
throw new Exception('Unknown action kind', {
|
|
34
34
|
code: 'E_UNKNOWN_ACTION_KIND',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,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,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D;YACE,MAAM,IAAI,SAAS,CAAC,qBAAqB,EAAE;gBACzC,IAAI,EAAE,uBAAuB;gBAC7B,MAAM,EAAE,GAAG;aACZ,CAAC,CAAA;IACN,CAAC;AACH,CAAC","sourcesContent":["export { Action, type ActionSchema } from './Action.js'\nimport { CreateAction, type CreateActionSchema } from './CreateAction.js'\nimport { DeleteAction, type DeleteActionSchema } from './DeleteAction.js'\nimport { ListAction, type ListActionSchema } from './ListAction.js'\nimport { ReadAction, type ReadActionSchema } from './ReadAction.js'\nimport { SearchAction, type SearchActionSchema } from './SearchAction.js'\nimport { UpdateAction, type UpdateActionSchema } from './UpdateAction.js'\nimport { Exception } from '../../exceptions/exception.js'\nimport type { ActionSchema } from './Action.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\nexport { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction }\nexport type {\n CreateActionSchema,\n DeleteActionSchema,\n ListActionSchema,\n ReadActionSchema,\n SearchActionSchema,\n UpdateActionSchema,\n}\n\n/**\n * Represents a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiAction = CreateAction | DeleteAction | ListAction | ReadAction | SearchAction | UpdateAction\n\n/**\n * Schema representation of a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiActionSchema =\n | CreateActionSchema\n | DeleteActionSchema\n | ListActionSchema\n | ReadActionSchema\n | SearchActionSchema\n | UpdateActionSchema\n\n/**\n * The kind of action to perform.\n */\nexport type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search'\n\n/**\n * Restores an action from a schema.\n *\n * It is a helper function to restore actions from schema.\n *\n * @param schema The schema to restore the action from.\n * @returns The restored action.\n */\nexport function restoreAction(parent: ExposedEntity, schema: ActionSchema): ApiAction {\n switch (schema.kind) {\n case 'list':\n return new ListAction(parent, schema as ListActionSchema)\n case 'read':\n return new ReadAction(parent, schema as ReadActionSchema)\n case 'create':\n return new CreateAction(parent, schema as CreateActionSchema)\n case 'update':\n return new UpdateAction(parent, schema as UpdateActionSchema)\n case 'delete':\n return new DeleteAction(parent, schema as DeleteActionSchema)\n case 'search':\n return new SearchAction(parent, schema as SearchActionSchema)\n default:\n throw new Exception('Unknown action kind', {\n code: 'E_UNKNOWN_ACTION_KIND',\n status: 422,\n })\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Shapes } from '@api-client/amf-core';
|
|
2
2
|
import type { Exception } from '../../exceptions/exception.js';
|
|
3
3
|
import type { AiSessionSchema } from '../../models/AiSession.js';
|
|
4
4
|
import type { DomainPropertyType } from '../DataFormat.js';
|
|
@@ -142,7 +142,7 @@ export interface AiDomainAssociation {
|
|
|
142
142
|
multiple?: boolean;
|
|
143
143
|
onDelete?: OnDeleteRule;
|
|
144
144
|
semantics?: AiDomainSemantic[];
|
|
145
|
-
schema?: IApiAssociationShape;
|
|
145
|
+
schema?: Shapes.IApiAssociationShape;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* The core structure representing a set of modifications (a delta) proposed by the AI.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,O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,cAAc;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,CAAN,IAAY,IAiCX;AAjCD,WAAY,IAAI;IACd;;OAEG;IACH,6CAAqC,CAAA;IACrC;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,uBAAe,CAAA;IACf;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,qBAAa,CAAA;AACf,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,CAAN,IAAY,IAiCX;AAjCD,WAAY,IAAI;IACd;;OAEG;IACH,6CAAqC,CAAA;IACrC;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,uBAAe,CAAA;IACf;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,qBAAa,CAAA;AACf,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf","sourcesContent":["import type { Shapes } from '@api-client/amf-core'\nimport type { Exception } from '../../exceptions/exception.js'\nimport type { AiSessionSchema } from '../../models/AiSession.js'\nimport type { DomainPropertyType } from '../DataFormat.js'\nimport type { OnDeleteRule } from '../index.js'\nimport { SemanticType } from '../Semantics.js'\nimport type { AssociationTarget, PropertySchema } from '../types.js'\nimport type { AiModelMessageSchema, AiModelMessage, AiUserMessageSchema } from '../../models/AiMessage.js'\n\n/**\n * A copy of the `Type` enum from the `@google/genai` package.\n * It's here so we don't need to import the nodejs only package.\n */\nexport enum Type {\n /**\n * Not specified, should not be used.\n */\n TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED',\n /**\n * OpenAPI string type\n */\n STRING = 'STRING',\n /**\n * OpenAPI number type\n */\n NUMBER = 'NUMBER',\n /**\n * OpenAPI integer type\n */\n INTEGER = 'INTEGER',\n /**\n * OpenAPI boolean type\n */\n BOOLEAN = 'BOOLEAN',\n /**\n * OpenAPI array type\n */\n ARRAY = 'ARRAY',\n /**\n * OpenAPI object type\n */\n OBJECT = 'OBJECT',\n /**\n * Null type\n */\n NULL = 'NULL',\n}\n\n/**\n * A lightweight representation of the `DataDomain` used specifically for serializing\n * the current domain state and sending it as context to the AI endpoint.\n * It omits complex internal graph structures, including only essential keys, names,\n * descriptions, and the hierarchical structure of models and entities.\n */\nexport interface AiDataDomainSchema {\n key: string\n name: string\n models: AiDataModelSchema[]\n entities: AiDomainEntitySchema[]\n}\n\n/**\n * A stripped-down representation of a `DomainModel` sent to the AI as part of the\n * domain context. It provides the AI with the existing model hierarchy and descriptions.\n */\nexport interface AiDataModelSchema {\n key: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a semantic annotation applied to an entity, property, or association\n * within the AI's understanding or response. It defines the \"meaning\" of a field\n * (e.g., \"Email\", \"Password\", \"Address\").\n */\nexport interface AiDomainSemantic {\n id: SemanticType\n config?: Record<string, unknown>\n}\n\n/**\n * Represents a full or partial entity schema as generated by the AI in its response delta.\n * It defines a new entity or updates to an existing one, including its properties,\n * associations, semantics, and tags. This is also used by the `get_entity_details` tool\n * to send detailed serialized entity information back to the AI.\n */\nexport interface AiDomainEntityResponseSchema {\n key: string\n modelKey: string\n name?: string\n displayName?: string\n description?: string\n tags?: string[]\n semantics?: AiDomainSemantic[]\n properties?: AiDomainProperty[]\n associations?: AiDomainAssociation[]\n}\n\n/**\n * A minimal representation of an entity used purely for context-setting when\n * sending the current domain structure to the AI. It excludes deeply nested\n * properties and associations to save token space.\n */\nexport interface AiDomainEntitySchema {\n key: string\n modelKey: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a property definition generated by the AI. It maps the complex internal\n * domain property structure into a simpler, flat structure that the AI generates,\n * including data types, constraints, schema metadata, and semantics.\n */\nexport interface AiDomainProperty {\n key?: string\n name?: string\n displayName?: string\n description?: string\n type: DomainPropertyType\n constraints?: {\n required?: boolean\n unique?: boolean\n index?: boolean\n primary?: boolean\n multiple?: boolean\n readOnly?: boolean\n writeOnly?: boolean\n }\n deprecated?: boolean\n schema?: PropertySchema\n semantics?: AiDomainSemantic[]\n tags?: string[] | null\n}\n\n/**\n * Represents an association definition generated by the AI, linking an entity\n * to one or more target entities. It includes relationship rules (like onDelete)\n * and semantic annotations.\n */\nexport interface AiDomainAssociation {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets: AssociationTarget[]\n required?: boolean\n multiple?: boolean\n onDelete?: OnDeleteRule\n semantics?: AiDomainSemantic[]\n schema?: Shapes.IApiAssociationShape\n}\n\n/**\n * The core structure representing a set of modifications (a delta) proposed by the AI.\n * It contains arrays of models and entities to add, delete, or modify. The application\n * processes this delta to transition the data domain to the new requested state.\n */\nexport interface AiDomainDelta {\n /**\n * Models to add to the domain.\n */\n addedModels?: AiDataModelSchema[]\n /**\n * Keys of models to delete from the domain.\n */\n deletedModelKeys?: string[]\n /**\n * Models to modify in the domain.\n */\n modifiedModels?: AiDataModelSchema[]\n /**\n * Entities to add to the domain.\n */\n addedEntities?: AiDomainEntityResponseSchema[]\n /**\n * Keys of entities to delete from the domain.\n */\n deletedEntityKeys?: string[]\n /**\n * Entities to modify in the domain.\n */\n modifiedEntities?: AiDomainEntityDelta[]\n}\n\n/**\n * The expected JSON schema structure returned by the AI endpoint when performing\n * data domain manipulation. It includes the AI's step-by-step reasoning and the\n * actionable delta to be applied.\n */\nexport interface AiDomainDeltaResponse {\n /**\n * The LLM reasoning.\n */\n reasoning: string\n /**\n * Domain changes delta\n */\n delta?: AiDomainDelta\n}\n\n/**\n * Union type for progressive SSE stream chunks\n * received from the AI generation endpoint.\n */\nexport type AiStreamEvent =\n | { event: 'user-message'; data: AiUserMessageSchema }\n | { event: 'agent-message'; data: AiModelMessageSchema }\n | { event: 'thought-chunk'; data: string }\n | { event: 'text-chunk'; data: string }\n | { event: 'done'; data: AiModelMessageSchema }\n | { event: 'error'; data: Exception }\n | { event: 'session-updated'; data: AiSessionSchema }\n\n/**\n * Represents a targeted modification to an existing entity generated by the AI.\n * Instead of providing the full entity state, the AI provides explicit arrays\n * of properties, associations, and semantics to add, modify, or delete, enabling\n * precise, non-destructive updates.\n */\nexport interface AiDomainEntityDelta {\n key: string\n modelKey?: string // Provide to move the entity to a different model\n name?: string\n displayName?: string\n description?: string\n tags?: string[] | null\n // Entity semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n // Explicit deltas so the LLM doesn't have to list untouched properties\n addedProperties?: AiDomainProperty[]\n modifiedProperties?: AiDomainPropertyDelta[]\n deletedPropertyKeys?: string[]\n addedAssociations?: AiDomainAssociation[]\n modifiedAssociations?: AiDomainAssociationDelta[]\n deletedAssociationKeys?: string[]\n}\n\nexport type NullablePropertySchema = {\n [K in keyof PropertySchema]?: PropertySchema[K] | null\n}\n\n/**\n * Represents a targeted modification to an existing property generated by the AI.\n * It captures changes to superficial properties (name, description), type changes,\n * constraint updates, and semantic alterations.\n */\nexport interface AiDomainPropertyDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n type?: DomainPropertyType\n constraints?: {\n required?: boolean | null\n unique?: boolean | null\n index?: boolean | null\n primary?: boolean | null\n multiple?: boolean | null\n readOnly?: boolean | null\n writeOnly?: boolean | null\n } | null\n deprecated?: boolean | null\n // Property semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n schema?: NullablePropertySchema\n}\n\n/**\n * Represents a targeted modification to an existing association generated by the AI.\n * It captures updates to relationship cardinality, target entities, deletion rules,\n * and applied semantics.\n */\nexport interface AiDomainAssociationDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets?: AssociationTarget[]\n required?: boolean | null\n multiple?: boolean | null\n onDelete?: OnDeleteRule | null\n // Association semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n}\n\n/**\n * An enriched, in-memory representation of a model's message that includes the globally\n * parsed `AiDomainDelta` object.\n * This is not stored directly in the datastore as-is; instead, the raw JSON text is stored,\n * and this structure is assembled at runtime when the chat history is loaded into the UI.\n */\nexport interface AiModelMessageWithDelta extends AiModelMessage {\n /**\n * The delta of the message, if any.\n */\n delta?: AiDomainDelta\n /**\n * The reasoning of the delta.\n * Format in markdown.\n */\n reasoning?: string\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataValueGenerator.d.ts","sourceRoot":"","sources":["../../../../src/modeling/amf/DataValueGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,eAAO,MAAM,OAAO,eAAoB,CAAA;AAExC;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B;;;OAGG;IACH,SAAS,CAAC,SAAS,SAAI;IACvB;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,SAAU;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,MAAM,GAAG,OAAO,OAAO;IAmBvE;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAY7D;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAS7D;;;;;OAKG;IACH,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAa3D;;;;OAIG;IACH,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAa3D;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;CAehE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { nanoid } from '
|
|
2
|
-
import uuidV4 from '../lib/uuid.js';
|
|
1
|
+
import { nanoid } from '../../nanoid.js';
|
|
3
2
|
export const noValue = Symbol('noValue');
|
|
4
3
|
/**
|
|
5
4
|
* A class to be used for generating values from pre-defined functions.
|
|
@@ -51,7 +50,7 @@ export class DataValueGenerator {
|
|
|
51
50
|
// TODO: we need more settings controlling the random string generation.
|
|
52
51
|
return nanoid(8);
|
|
53
52
|
case 'uuid-v4':
|
|
54
|
-
return
|
|
53
|
+
return crypto.randomUUID();
|
|
55
54
|
default:
|
|
56
55
|
return noValue;
|
|
57
56
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataValueGenerator.js","sourceRoot":"","sources":["../../../../src/modeling/amf/DataValueGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGxC,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AAExC;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;;OAGG;IACO,SAAS,GAAG,CAAC,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAU,OAAO,GAAG,OAAO,CAAA;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAU,EAAE,IAAwB;QAC3C,IAAI,IAAI,KAAK,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AAC,CAAC,EAAE,GAAG,CAAC,CAAA;YACpD,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YAC7C,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YACnD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YACnD,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;QAC9D,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC","sourcesContent":["import { nanoid } from '../../nanoid.js'\nimport { DomainPropertyType } from '../DataFormat.js'\n\nexport const noValue = Symbol('noValue')\n\n/**\n * A class to be used for generating values from pre-defined functions.\n * This is used to provide default values for data properties based on specified functions.\n */\nexport class DataValueGenerator {\n /**\n * The current value for the `number.incremental` function.\n * This counter is incremented each time an incremental number is generated.\n */\n protected increment = 0\n /**\n * A symbol representing the absence of a value.\n * Used as a return value when a function cannot generate a value of the requested type.\n */\n static readonly noValue = noValue\n\n /**\n * Generates a value based on the provided function name and data type.\n * @param fn The name of the function to use for value generation (e.g., 'random', 'uuid-v4', 'incremental').\n * @param type The data type of the value to generate (e.g., 'string', 'number', 'date', 'time', 'datetime').\n * @returns The generated value, or the `noValue` symbol if the function or type is not supported.\n */\n generate(fn: string, type: DomainPropertyType): string | typeof noValue {\n if (type === 'string') {\n return this.generateString(fn)\n }\n if (type === 'number') {\n return this.generateNumber(fn)\n }\n if (type === 'date') {\n return this.generateDate(fn)\n }\n if (type === 'time') {\n return this.generateTime(fn)\n }\n if (type === 'datetime') {\n return this.generateDateTime(fn)\n }\n return noValue\n }\n\n /**\n * Generates a string value based on the function name.\n * @param fn The name of the string generation function.\n * @returns The generated string value, or `noValue` if the function is not supported.\n */\n protected generateString(fn: string): string | typeof noValue {\n switch (fn) {\n case 'random':\n // TODO: we need more settings controlling the random string generation.\n return nanoid(8)\n case 'uuid-v4':\n return crypto.randomUUID()\n default:\n return noValue\n }\n }\n\n /**\n * Generates a number value based on the function name.\n * @param fn The name of the number generation function.\n * @returns The generated number value (as a string), or `noValue` if the function is not supported.\n */\n protected generateNumber(fn: string): string | typeof noValue {\n switch (fn) {\n case 'incremental':\n return `${this.increment++}`\n default:\n return noValue\n }\n }\n\n /**\n * Generates a date value based on the function name.\n * @param fn The name of the date generation function.\n * @returns The generated date value (as a string in YYYY-MM-DD format),\n * or `noValue` if the function is not supported.\n */\n protected generateDate(fn: string): string | typeof noValue {\n if (fn === 'now') {\n // Returns YYYY-MM-DD\n // @TODO: Replace with Temporal when widely available.\n const d = new Date()\n const year = d.getFullYear()\n const month = `${d.getMonth() + 1}`.padStart(2, '0')\n const day = `${d.getDate()}`.padStart(2, '0')\n return `${year}-${month}-${day}`\n }\n return noValue\n }\n\n /**\n * Generates a time value based on the function name.\n * @param fn The name of the time generation function.\n * @returns The generated time value (as a string in HH:mm:ss format), or `noValue` if the function is not supported.\n */\n protected generateTime(fn: string): string | typeof noValue {\n if (fn === 'now') {\n // Returns HH:mm:ss\n // @TODO: Replace with Temporal when widely available.\n const d = new Date()\n const hour = `${d.getHours()}`.padStart(2, '0')\n const minute = `${d.getMinutes()}`.padStart(2, '0')\n const second = `${d.getSeconds()}`.padStart(2, '0')\n return `${hour}:${minute}:${second}`\n }\n return noValue\n }\n\n /**\n * Generates a datetime value based on the function name.\n * @param fn The name of the datetime generation function.\n * @returns The generated datetime value (as a string in YYYY-MM-DDTHH:mm:ss format),\n * or `noValue` if the function is not supported.\n */\n protected generateDateTime(fn: string): string | typeof noValue {\n if (fn === 'now') {\n // Returns YYYY-MM-DDTHH:mm:ss\n // @TODO: Replace with Temporal when widely available.\n const d = new Date()\n const year = d.getFullYear()\n const month = `${d.getMonth() + 1}`.padStart(2, '0')\n const day = `${d.getDate()}`.padStart(2, '0')\n const hour = `${d.getHours()}`.padStart(2, '0')\n const minute = `${d.getMinutes()}`.padStart(2, '0')\n const second = `${d.getSeconds()}`.padStart(2, '0')\n return `${year}-${month}-${day}T${hour}:${minute}:${second}`\n }\n return noValue\n }\n}\n"]}
|
|
@@ -2,8 +2,8 @@ import { type PropertyWebBindings } from '../Bindings.js';
|
|
|
2
2
|
import type { DomainAssociation } from '../DomainAssociation.js';
|
|
3
3
|
import type { DomainProperty } from '../DomainProperty.js';
|
|
4
4
|
import type { DomainEntity } from '../DomainEntity.js';
|
|
5
|
-
import {
|
|
6
|
-
import { DataValueGenerator } from '
|
|
5
|
+
import { type Shapes } from '@api-client/amf-core';
|
|
6
|
+
import { DataValueGenerator } from './DataValueGenerator.js';
|
|
7
7
|
import type { PropertySchema } from '../types.js';
|
|
8
8
|
/**
|
|
9
9
|
* Serializes Data Domain elements (DomainEntity, DomainProperty, DomainAssociation)
|
|
@@ -65,7 +65,7 @@ export declare class ShapeGenerator {
|
|
|
65
65
|
* const amfShape = generator.entity(myDomainEntity);
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
|
-
entity(input: DomainEntity, visited?: Set<string>): IApiNodeShape | IApiRecursiveShape;
|
|
68
|
+
entity(input: DomainEntity, visited?: Set<string>): Shapes.IApiNodeShape | Shapes.IApiRecursiveShape;
|
|
69
69
|
/**
|
|
70
70
|
* Serializes a `DomainProperty` to an AMF property shape.
|
|
71
71
|
*
|
|
@@ -81,7 +81,7 @@ export declare class ShapeGenerator {
|
|
|
81
81
|
* const amfShape = generator.property(myDomainProperty);
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
|
-
property(input: DomainProperty): IApiPropertyShape;
|
|
84
|
+
property(input: DomainProperty): Shapes.IApiPropertyShape;
|
|
85
85
|
/**
|
|
86
86
|
* Serializes a `DomainAssociation` to an AMF property shape, handling the
|
|
87
87
|
* association's target entity or entities.
|
|
@@ -102,7 +102,7 @@ export declare class ShapeGenerator {
|
|
|
102
102
|
* const amfShape = generator.associationProperty(myDomainAssociation);
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
|
-
associationProperty(input: DomainAssociation, visited?: Set<string>): IApiPropertyShape;
|
|
105
|
+
associationProperty(input: DomainAssociation, visited?: Set<string>): Shapes.IApiPropertyShape;
|
|
106
106
|
/**
|
|
107
107
|
* Generates a shape for an association. Most likely you want to use the `associationProperty()` method instead.
|
|
108
108
|
*
|
|
@@ -111,20 +111,20 @@ export declare class ShapeGenerator {
|
|
|
111
111
|
* recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.
|
|
112
112
|
* @returns The range value for the PropertyShape.
|
|
113
113
|
*/
|
|
114
|
-
associationShape(input: DomainAssociation, visited?: Set<string>): IShapeUnion | undefined;
|
|
114
|
+
associationShape(input: DomainAssociation, visited?: Set<string>): Shapes.IShapeUnion | undefined;
|
|
115
115
|
/**
|
|
116
116
|
* @param input The data association instance.
|
|
117
117
|
* @returns An AMF API scalar shape with the link to the schema.
|
|
118
118
|
*/
|
|
119
|
-
protected createLinkedShape(input: DomainAssociation): IApiScalarShape;
|
|
120
|
-
protected createUnionShape(input: DomainAssociation, items: IShapeUnion[]): IApiUnionShape | IApiArrayShape;
|
|
119
|
+
protected createLinkedShape(input: DomainAssociation): Shapes.IApiScalarShape;
|
|
120
|
+
protected createUnionShape(input: DomainAssociation, items: Shapes.IShapeUnion[]): Shapes.IApiUnionShape | Shapes.IApiArrayShape;
|
|
121
121
|
/**
|
|
122
122
|
* Generates a shape list for an union. Most likely you want to use the `associationProperty()` method instead.
|
|
123
123
|
*
|
|
124
124
|
* @param input The data association instance.
|
|
125
125
|
* @returns The range value for the PropertyShape.
|
|
126
126
|
*/
|
|
127
|
-
associationUnion(input: DomainAssociation, visited?: Set<string>): IShapeUnion | IShapeUnion[] | undefined;
|
|
127
|
+
associationUnion(input: DomainAssociation, visited?: Set<string>): Shapes.IShapeUnion | Shapes.IShapeUnion[] | undefined;
|
|
128
128
|
/**
|
|
129
129
|
* The DomainProperty may have both the `schema` and the `bindings`. For AMF shape we read `schema` for
|
|
130
130
|
* default value, examples, and enum values. We also look for the `web`
|
|
@@ -132,7 +132,7 @@ export declare class ShapeGenerator {
|
|
|
132
132
|
*
|
|
133
133
|
* @param input
|
|
134
134
|
*/
|
|
135
|
-
protected getRange(input: DomainProperty): IApiArrayShape | IApiFileShape | IApiScalarShape;
|
|
135
|
+
protected getRange(input: DomainProperty): Shapes.IApiArrayShape | Shapes.IApiFileShape | Shapes.IApiScalarShape;
|
|
136
136
|
/**
|
|
137
137
|
* Normally this would be part of generating a scalar schema but the the property is an array this
|
|
138
138
|
* is generated on the array and not on the range.
|
|
@@ -142,15 +142,15 @@ export declare class ShapeGenerator {
|
|
|
142
142
|
* @param type The data type of the parent property as set on the `range`
|
|
143
143
|
* @param isArray Whether the DomainProperty is multiple
|
|
144
144
|
*/
|
|
145
|
-
protected setShapeSchema(input: DomainProperty, result: IApiAnyShape, schema: PropertySchema, type: string, isArray?: boolean): void;
|
|
146
|
-
protected createArrayShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): IApiArrayShape;
|
|
147
|
-
protected createScalarShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): IApiScalarShape;
|
|
148
|
-
protected createExamples(examples: string[], type: string): IApiDataExample[];
|
|
149
|
-
protected createArrayExamples(examples: string[], type: string): IApiDataExample[];
|
|
150
|
-
protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): IApiFileShape;
|
|
151
|
-
protected setScalarCommonProperties(result: IApiFileShape | IApiScalarShape, input: DomainProperty, bindings?: PropertyWebBindings): void;
|
|
152
|
-
protected updateBaseProperties(input: DomainProperty | DomainAssociation | DomainEntity, target: IApiShape): void;
|
|
153
|
-
protected createRecursiveShape(input: DomainEntity): IApiRecursiveShape;
|
|
145
|
+
protected setShapeSchema(input: DomainProperty, result: Shapes.IApiAnyShape, schema: PropertySchema, type: string, isArray?: boolean): void;
|
|
146
|
+
protected createArrayShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): Shapes.IApiArrayShape;
|
|
147
|
+
protected createScalarShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): Shapes.IApiScalarShape;
|
|
148
|
+
protected createExamples(examples: string[], type: string): Shapes.IApiDataExample[];
|
|
149
|
+
protected createArrayExamples(examples: string[], type: string): Shapes.IApiDataExample[];
|
|
150
|
+
protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): Shapes.IApiFileShape;
|
|
151
|
+
protected setScalarCommonProperties(result: Shapes.IApiFileShape | Shapes.IApiScalarShape, input: DomainProperty, bindings?: PropertyWebBindings): void;
|
|
152
|
+
protected updateBaseProperties(input: DomainProperty | DomainAssociation | DomainEntity, target: Shapes.IApiShape): void;
|
|
153
|
+
protected createRecursiveShape(input: DomainEntity): Shapes.IApiRecursiveShape;
|
|
154
154
|
/**
|
|
155
155
|
* Translates the shape to an array shape. This happens when data model property
|
|
156
156
|
* is changed from 'multiple' to not-multiple and back.
|
|
@@ -159,6 +159,6 @@ export declare class ShapeGenerator {
|
|
|
159
159
|
* @param shape The shape to wrap as an array.
|
|
160
160
|
* @returns Array shape.
|
|
161
161
|
*/
|
|
162
|
-
protected refactorShapeToArray(id: string, shape: IShapeUnion): IApiArrayShape;
|
|
162
|
+
protected refactorShapeToArray(id: string, shape: Shapes.IShapeUnion): Shapes.IApiArrayShape;
|
|
163
163
|
}
|
|
164
164
|
//# sourceMappingURL=ShapeGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeGenerator.d.ts","sourceRoot":"","sources":["../../../../src/modeling/amf/ShapeGenerator.ts"],"names":[],"mappings":"AAAA,OA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AE,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE;IAepF,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE;IAgBzF,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,MAAM,CAAC,aAAa;IAetG,SAAS,CAAC,yBAAyB,CACjC,MAAM,EAAE,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,eAAe,EACrD,KAAK,EAAE,cAAc,EACrB,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,IAAI;IAgEP,SAAS,CAAC,oBAAoB,CAC5B,KAAK,EAAE,cAAc,GAAG,iBAAiB,GAAG,YAAY,EACxD,MAAM,EAAE,MAAM,CAAC,SAAS,GACvB,IAAI;IAWP,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,kBAAkB;IAI9E;;;;;;;OAOG;IACH,SAAS,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,cAAc;CAK7F"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AmfNamespace } from '
|
|
3
|
-
import {
|
|
4
|
-
import { AmfDataNode } from '../../amf/models/AmfDataNode.js';
|
|
5
|
-
import { DataValueGenerator } from '../../amf/DataValueGenerator.js';
|
|
1
|
+
import { modelTypeToAmfDataType } from './core_types.js';
|
|
2
|
+
import { AmfNamespace, AmfDataNode, AmfTypes, ShapeHelpers } from '@api-client/amf-core';
|
|
3
|
+
import { DataValueGenerator } from './DataValueGenerator.js';
|
|
6
4
|
import { nanoid } from '../../nanoid.js';
|
|
7
5
|
import { DomainEntityKind, DomainPropertyKind } from '../../models/kinds.js';
|
|
8
6
|
const UNION_TYPE_ANY_OF = 'anyOf';
|
|
@@ -84,7 +82,7 @@ export class ShapeGenerator {
|
|
|
84
82
|
return this.createRecursiveShape(input);
|
|
85
83
|
}
|
|
86
84
|
visited.add(input.key);
|
|
87
|
-
const result = nodeShape(input.key);
|
|
85
|
+
const result = ShapeHelpers.nodeShape(input.key);
|
|
88
86
|
result.id = input.key;
|
|
89
87
|
this.updateBaseProperties(input, result);
|
|
90
88
|
result.properties = [];
|
|
@@ -130,7 +128,7 @@ export class ShapeGenerator {
|
|
|
130
128
|
*/
|
|
131
129
|
property(input) {
|
|
132
130
|
const { required, key } = input;
|
|
133
|
-
const result = propertyShape(key);
|
|
131
|
+
const result = ShapeHelpers.propertyShape(key);
|
|
134
132
|
result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`;
|
|
135
133
|
if (required) {
|
|
136
134
|
result.minCount = 1;
|
|
@@ -167,7 +165,7 @@ export class ShapeGenerator {
|
|
|
167
165
|
*/
|
|
168
166
|
associationProperty(input, visited = new Set()) {
|
|
169
167
|
const { required, key } = input;
|
|
170
|
-
const result = propertyShape(key);
|
|
168
|
+
const result = ShapeHelpers.propertyShape(key);
|
|
171
169
|
result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`;
|
|
172
170
|
if (required) {
|
|
173
171
|
result.minCount = 1;
|
|
@@ -200,7 +198,7 @@ export class ShapeGenerator {
|
|
|
200
198
|
if (unionType === UNION_TYPE_NOT) {
|
|
201
199
|
// Need to investigate more about "not" union type.
|
|
202
200
|
// AMF supports it, but I am not sure how to handle it.
|
|
203
|
-
const wrapper = anyShape(input.key);
|
|
201
|
+
const wrapper = ShapeHelpers.anyShape(input.key);
|
|
204
202
|
wrapper.id = `not-shape-${input.key}`;
|
|
205
203
|
wrapper.not = items;
|
|
206
204
|
return wrapper;
|
|
@@ -217,13 +215,13 @@ export class ShapeGenerator {
|
|
|
217
215
|
createLinkedShape(input) {
|
|
218
216
|
// This is a link to the schema. In an API that would be the id
|
|
219
217
|
// of a resource to request the data from.
|
|
220
|
-
const range = scalarShape(input.key);
|
|
218
|
+
const range = ShapeHelpers.scalarShape(input.key);
|
|
221
219
|
range.id = `link-${input.key}`;
|
|
222
220
|
range.dataType = modelTypeToAmfDataType(DATA_TYPE_STRING);
|
|
223
221
|
return range;
|
|
224
222
|
}
|
|
225
223
|
createUnionShape(input, items) {
|
|
226
|
-
const range = unionShape(input.key);
|
|
224
|
+
const range = ShapeHelpers.unionShape(input.key);
|
|
227
225
|
this.updateBaseProperties(input, range);
|
|
228
226
|
range.anyOf = [];
|
|
229
227
|
const unionType = (input.schema && input.schema.unionType) || UNION_TYPE_ANY_OF;
|
|
@@ -326,7 +324,7 @@ export class ShapeGenerator {
|
|
|
326
324
|
}
|
|
327
325
|
}
|
|
328
326
|
createArrayShape(input, schema, bindings) {
|
|
329
|
-
const result = arrayShape(input.key);
|
|
327
|
+
const result = ShapeHelpers.arrayShape(input.key);
|
|
330
328
|
const { type } = input;
|
|
331
329
|
if (type === DATA_TYPE_BINARY) {
|
|
332
330
|
// we do not pass schema to the range generator as we set schema's properties on the array shape.
|
|
@@ -342,7 +340,7 @@ export class ShapeGenerator {
|
|
|
342
340
|
return result;
|
|
343
341
|
}
|
|
344
342
|
createScalarShape(input, schema, bindings) {
|
|
345
|
-
const result = scalarShape(input.key);
|
|
343
|
+
const result = ShapeHelpers.scalarShape(input.key);
|
|
346
344
|
this.updateBaseProperties(input, result);
|
|
347
345
|
this.setScalarCommonProperties(result, input, bindings);
|
|
348
346
|
if (!result.dataType) {
|
|
@@ -360,7 +358,7 @@ export class ShapeGenerator {
|
|
|
360
358
|
id: nanoid(),
|
|
361
359
|
customDomainProperties: [],
|
|
362
360
|
strict: true,
|
|
363
|
-
types: IAmfExampleTypes,
|
|
361
|
+
types: [...AmfTypes.IAmfExampleTypes],
|
|
364
362
|
structuredValue: AmfDataNode.scalar(current, type).toJSON(),
|
|
365
363
|
};
|
|
366
364
|
result.push(item);
|
|
@@ -372,7 +370,7 @@ export class ShapeGenerator {
|
|
|
372
370
|
id: nanoid(),
|
|
373
371
|
customDomainProperties: [],
|
|
374
372
|
strict: true,
|
|
375
|
-
types: IAmfExampleTypes,
|
|
373
|
+
types: [...AmfTypes.IAmfExampleTypes],
|
|
376
374
|
};
|
|
377
375
|
const value = new AmfDataNode('array');
|
|
378
376
|
for (const item of examples) {
|
|
@@ -383,7 +381,7 @@ export class ShapeGenerator {
|
|
|
383
381
|
return [item];
|
|
384
382
|
}
|
|
385
383
|
createFileShape(input, bindings) {
|
|
386
|
-
const result = fileShape(input.key);
|
|
384
|
+
const result = ShapeHelpers.fileShape(input.key);
|
|
387
385
|
this.updateBaseProperties(input, result);
|
|
388
386
|
if (bindings) {
|
|
389
387
|
if (Array.isArray(bindings.fileTypes)) {
|
|
@@ -473,7 +471,7 @@ export class ShapeGenerator {
|
|
|
473
471
|
}
|
|
474
472
|
}
|
|
475
473
|
createRecursiveShape(input) {
|
|
476
|
-
return recursiveShape(input.key, input.key);
|
|
474
|
+
return ShapeHelpers.recursiveShape(input.key, input.key);
|
|
477
475
|
}
|
|
478
476
|
/**
|
|
479
477
|
* Translates the shape to an array shape. This happens when data model property
|
|
@@ -484,7 +482,7 @@ export class ShapeGenerator {
|
|
|
484
482
|
* @returns Array shape.
|
|
485
483
|
*/
|
|
486
484
|
refactorShapeToArray(id, shape) {
|
|
487
|
-
const result = arrayShape(id);
|
|
485
|
+
const result = ShapeHelpers.arrayShape(id);
|
|
488
486
|
result.items = shape;
|
|
489
487
|
return result;
|
|
490
488
|
}
|