@api-client/core 0.11.11 → 0.12.1
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/Testing.md +1 -1
- package/bin/plugins/events/EventPlugin.ts +61 -0
- package/bin/plugins/events/assert.ts +193 -0
- package/bin/plugins/events/types.ts +6 -0
- package/bin/test.ts +8 -1
- package/build/src/amf/AmfShapeGenerator.d.ts +6 -3
- package/build/src/amf/AmfShapeGenerator.d.ts.map +1 -1
- package/build/src/amf/AmfShapeGenerator.js +7 -4
- package/build/src/amf/AmfShapeGenerator.js.map +1 -1
- package/build/src/amf/AmfTypes.d.ts +2 -2
- package/build/src/amf/AmfTypes.d.ts.map +1 -1
- package/build/src/amf/AmfTypes.js.map +1 -1
- package/build/src/amf/DataValueGenerator.d.ts +15 -15
- package/build/src/amf/DataValueGenerator.d.ts.map +1 -1
- package/build/src/amf/DataValueGenerator.js +17 -16
- package/build/src/amf/DataValueGenerator.js.map +1 -1
- package/build/src/amf/models/AmfDataNode.d.ts.map +1 -1
- package/build/src/amf/models/AmfDataNode.js +2 -2
- package/build/src/amf/models/AmfDataNode.js.map +1 -1
- package/build/src/browser.d.ts +12 -9
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +11 -8
- package/build/src/browser.js.map +1 -1
- package/build/src/exceptions/attach_exception.d.ts +11 -0
- package/build/src/exceptions/attach_exception.d.ts.map +1 -0
- package/build/src/exceptions/attach_exception.js +11 -0
- package/build/src/exceptions/attach_exception.js.map +1 -0
- package/build/src/exceptions/detach_exception.d.ts +11 -0
- package/build/src/exceptions/detach_exception.d.ts.map +1 -0
- package/build/src/exceptions/detach_exception.js +11 -0
- package/build/src/exceptions/detach_exception.js.map +1 -0
- package/build/src/exceptions/remove_model_exception.d.ts +8 -0
- package/build/src/exceptions/remove_model_exception.d.ts.map +1 -0
- package/build/src/exceptions/remove_model_exception.js +8 -0
- package/build/src/exceptions/remove_model_exception.js.map +1 -0
- package/build/src/exceptions/remove_namespace_exception.d.ts +8 -0
- package/build/src/exceptions/remove_namespace_exception.d.ts.map +1 -0
- package/build/src/exceptions/remove_namespace_exception.js +8 -0
- package/build/src/exceptions/remove_namespace_exception.js.map +1 -0
- package/build/src/index.d.ts +12 -9
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +11 -8
- package/build/src/index.js.map +1 -1
- package/build/src/legacy.d.ts +8 -0
- package/build/src/legacy.d.ts.map +1 -1
- package/build/src/legacy.js +9 -0
- package/build/src/legacy.js.map +1 -1
- package/build/src/lib/uuid.d.ts +1 -1
- package/build/src/lib/uuid.js +1 -1
- package/build/src/lib/uuid.js.map +1 -1
- package/build/src/mocking/lib/History.js +8 -8
- package/build/src/mocking/lib/History.js.map +1 -1
- package/build/src/mocking/lib/HostRules.js +1 -1
- package/build/src/mocking/lib/HostRules.js.map +1 -1
- package/build/src/mocking/lib/User.js +2 -2
- package/build/src/mocking/lib/User.js.map +1 -1
- package/build/src/modeling/Bindings.d.ts +2 -2
- package/build/src/modeling/Bindings.d.ts.map +1 -1
- package/build/src/modeling/Bindings.js.map +1 -1
- package/build/src/modeling/DataDomain.d.ts +601 -0
- package/build/src/modeling/DataDomain.d.ts.map +1 -0
- package/build/src/modeling/DataDomain.js +1141 -0
- package/build/src/modeling/DataDomain.js.map +1 -0
- package/build/src/modeling/DataFormat.d.ts +42 -41
- package/build/src/modeling/DataFormat.d.ts.map +1 -1
- package/build/src/modeling/DataFormat.js +30 -131
- package/build/src/modeling/DataFormat.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts +281 -0
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -0
- package/build/src/modeling/DomainAssociation.js +440 -0
- package/build/src/modeling/DomainAssociation.js.map +1 -0
- package/build/src/modeling/DomainElement.d.ts +33 -0
- package/build/src/modeling/DomainElement.d.ts.map +1 -0
- package/build/src/modeling/DomainElement.js +32 -0
- package/build/src/modeling/DomainElement.js.map +1 -0
- package/build/src/modeling/DomainEntity.d.ts +383 -0
- package/build/src/modeling/DomainEntity.d.ts.map +1 -0
- package/build/src/modeling/DomainEntity.js +718 -0
- package/build/src/modeling/DomainEntity.js.map +1 -0
- package/build/src/modeling/DomainFile.d.ts +25 -0
- package/build/src/modeling/DomainFile.d.ts.map +1 -0
- package/build/src/modeling/DomainFile.js +86 -0
- package/build/src/modeling/DomainFile.js.map +1 -0
- package/build/src/modeling/DomainImpactAnalysis.d.ts +60 -47
- package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.js +201 -132
- package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
- package/build/src/modeling/DomainModel.d.ts +226 -0
- package/build/src/modeling/DomainModel.d.ts.map +1 -0
- package/build/src/modeling/DomainModel.js +401 -0
- package/build/src/modeling/DomainModel.js.map +1 -0
- package/build/src/modeling/DomainNamespace.d.ts +268 -0
- package/build/src/modeling/DomainNamespace.d.ts.map +1 -0
- package/build/src/modeling/DomainNamespace.js +512 -0
- package/build/src/modeling/DomainNamespace.js.map +1 -0
- package/build/src/modeling/DomainProperty.d.ts +281 -0
- package/build/src/modeling/DomainProperty.d.ts.map +1 -0
- package/build/src/modeling/DomainProperty.js +560 -0
- package/build/src/modeling/DomainProperty.js.map +1 -0
- package/build/src/modeling/DomainSerialization.d.ts +40 -0
- package/build/src/modeling/DomainSerialization.d.ts.map +1 -0
- package/build/src/modeling/DomainSerialization.js +288 -0
- package/build/src/modeling/DomainSerialization.js.map +1 -0
- package/build/src/modeling/DomainVersioning.d.ts +17 -0
- package/build/src/modeling/DomainVersioning.d.ts.map +1 -0
- package/build/src/modeling/DomainVersioning.js +124 -0
- package/build/src/modeling/DomainVersioning.js.map +1 -0
- package/build/src/modeling/GraphUtils.d.ts +8 -0
- package/build/src/modeling/GraphUtils.d.ts.map +1 -0
- package/build/src/modeling/GraphUtils.js +26 -0
- package/build/src/modeling/GraphUtils.js.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts +164 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.js +492 -0
- package/build/src/modeling/amf/ShapeGenerator.js.map +1 -0
- package/build/src/modeling/{DataAssociation.d.ts → legacy/DataAssociation.d.ts} +10 -5
- package/build/src/modeling/legacy/DataAssociation.d.ts.map +1 -0
- package/build/src/modeling/{DataAssociation.js → legacy/DataAssociation.js} +11 -8
- package/build/src/modeling/legacy/DataAssociation.js.map +1 -0
- package/build/src/modeling/{DataEntity.d.ts → legacy/DataEntity.d.ts} +12 -7
- package/build/src/modeling/legacy/DataEntity.d.ts.map +1 -0
- package/build/src/modeling/{DataEntity.js → legacy/DataEntity.js} +21 -20
- package/build/src/modeling/legacy/DataEntity.js.map +1 -0
- package/build/src/modeling/{DataEntityBuilder.d.ts → legacy/DataEntityBuilder.d.ts} +3 -2
- package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +1 -0
- package/build/src/modeling/{DataEntityBuilder.js → legacy/DataEntityBuilder.js} +4 -3
- package/build/src/modeling/legacy/DataEntityBuilder.js.map +1 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +298 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +1 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.js +441 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.js.map +1 -0
- package/build/src/modeling/{DataModel.d.ts → legacy/DataModel.d.ts} +6 -4
- package/build/src/modeling/legacy/DataModel.d.ts.map +1 -0
- package/build/src/modeling/{DataModel.js → legacy/DataModel.js} +9 -8
- package/build/src/modeling/legacy/DataModel.js.map +1 -0
- package/build/src/modeling/{DataNamespace.d.ts → legacy/DataNamespace.d.ts} +22 -3
- package/build/src/modeling/legacy/DataNamespace.d.ts.map +1 -0
- package/build/src/modeling/{DataNamespace.js → legacy/DataNamespace.js} +9 -5
- package/build/src/modeling/legacy/DataNamespace.js.map +1 -0
- package/build/src/modeling/{DataProperty.d.ts → legacy/DataProperty.d.ts} +13 -5
- package/build/src/modeling/legacy/DataProperty.d.ts.map +1 -0
- package/build/src/modeling/{DataProperty.js → legacy/DataProperty.js} +10 -7
- package/build/src/modeling/legacy/DataProperty.js.map +1 -0
- package/build/src/modeling/observed.d.ts +67 -0
- package/build/src/modeling/observed.d.ts.map +1 -0
- package/build/src/modeling/observed.js +230 -0
- package/build/src/modeling/observed.js.map +1 -0
- package/build/src/modeling/types.d.ts +165 -1
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/models/AuthorizationData.js +3 -3
- package/build/src/models/AuthorizationData.js.map +1 -1
- package/build/src/models/CertificateFile.js +2 -2
- package/build/src/models/CertificateFile.js.map +1 -1
- package/build/src/models/ClientCertificate.js +5 -5
- package/build/src/models/ClientCertificate.js.map +1 -1
- package/build/src/models/Environment.js +6 -6
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/Folder.js +2 -2
- package/build/src/models/Folder.js.map +1 -1
- package/build/src/models/HostRule.js +4 -4
- package/build/src/models/HostRule.js.map +1 -1
- package/build/src/models/HttpProject.js +12 -12
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/Project.d.ts.map +1 -1
- package/build/src/models/Project.js +2 -2
- package/build/src/models/Project.js.map +1 -1
- package/build/src/models/ProjectFolder.d.ts.map +1 -1
- package/build/src/models/ProjectFolder.js +6 -6
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts.map +1 -1
- package/build/src/models/ProjectRequest.js +8 -8
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/ProjectSchema.js +6 -6
- package/build/src/models/ProjectSchema.js.map +1 -1
- package/build/src/models/Thing.d.ts +26 -5
- package/build/src/models/Thing.d.ts.map +1 -1
- package/build/src/models/Thing.js +193 -91
- package/build/src/models/Thing.js.map +1 -1
- package/build/src/models/kinds.d.ts +31 -6
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +31 -6
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/models/store/DataFile.d.ts +3 -1
- package/build/src/models/store/DataFile.d.ts.map +1 -1
- package/build/src/models/store/DataFile.js +4 -2
- package/build/src/models/store/DataFile.js.map +1 -1
- package/build/src/models/store/File.d.ts.map +1 -1
- package/build/src/models/store/File.js +3 -3
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/models/store/Organization.js +3 -3
- package/build/src/models/store/Organization.js.map +1 -1
- package/build/src/models/store/Permission.js +7 -7
- package/build/src/models/store/Permission.js.map +1 -1
- package/build/src/models/store/UserIdentity.js +3 -3
- package/build/src/models/store/UserIdentity.js.map +1 -1
- package/build/src/models/transformers/ArcDexieTransformer.js +4 -4
- package/build/src/models/transformers/ArcDexieTransformer.js.map +1 -1
- package/build/src/models/transformers/ArcLegacyTransformer.js +3 -3
- package/build/src/models/transformers/ArcLegacyTransformer.js.map +1 -1
- package/build/src/models/transformers/ArcPouchTransformer.js +2 -2
- package/build/src/models/transformers/ArcPouchTransformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV21Transformer.js +2 -2
- package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV2Transformer.js +2 -2
- package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
- package/build/src/models/types.d.ts +12 -0
- package/build/src/models/types.d.ts.map +1 -0
- package/build/src/models/types.js +2 -0
- package/build/src/models/types.js.map +1 -0
- package/build/src/patch/PatchClient.js +2 -2
- package/build/src/patch/PatchClient.js.map +1 -1
- package/build/src/runtime/store/FilesSdk.d.ts +2 -2
- package/build/src/runtime/store/FilesSdk.d.ts.map +1 -1
- package/build/src/runtime/store/FilesSdk.js +3 -3
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/data/models/example-generator-api.json +8 -8
- package/package.json +20 -6
- package/readme.md +1 -1
- package/src/amf/AmfShapeGenerator.ts +10 -7
- package/src/amf/AmfTypes.ts +2 -2
- package/src/amf/DataValueGenerator.ts +24 -23
- package/src/amf/models/AmfDataNode.ts +2 -2
- package/src/exceptions/attach_exception.ts +11 -0
- package/src/exceptions/detach_exception.ts +11 -0
- package/src/exceptions/remove_model_exception.ts +8 -0
- package/src/exceptions/remove_namespace_exception.ts +8 -0
- package/src/lib/uuid.ts +1 -1
- package/src/mocking/lib/History.ts +8 -8
- package/src/mocking/lib/HostRules.ts +1 -1
- package/src/mocking/lib/User.ts +2 -2
- package/src/modeling/Bindings.ts +2 -2
- package/src/modeling/DataDomain.ts +1220 -0
- package/src/modeling/DataFormat.ts +54 -163
- package/src/modeling/DomainAssociation.ts +476 -0
- package/src/modeling/DomainElement.ts +50 -0
- package/src/modeling/DomainEntity.ts +769 -0
- package/src/modeling/DomainFile.ts +94 -0
- package/src/modeling/DomainImpactAnalysis.ts +218 -144
- package/src/modeling/DomainModel.ts +421 -0
- package/src/modeling/DomainNamespace.ts +537 -0
- package/src/modeling/DomainProperty.ts +548 -0
- package/src/modeling/DomainSerialization.ts +312 -0
- package/src/modeling/DomainVersioning.ts +144 -0
- package/src/modeling/GraphUtils.ts +28 -0
- package/src/modeling/amf/ShapeGenerator.ts +552 -0
- package/src/modeling/graph.md +115 -0
- package/src/modeling/{DataAssociation.ts → legacy/DataAssociation.ts} +15 -10
- package/src/modeling/{DataEntity.ts → legacy/DataEntity.ts} +30 -25
- package/src/modeling/{DataEntityBuilder.ts → legacy/DataEntityBuilder.ts} +5 -4
- package/src/modeling/legacy/DataImpactAnalysis.ts +530 -0
- package/src/modeling/{DataModel.ts → legacy/DataModel.ts} +12 -10
- package/src/modeling/{DataNamespace.ts → legacy/DataNamespace.ts} +25 -7
- package/src/modeling/{DataProperty.ts → legacy/DataProperty.ts} +17 -9
- package/src/modeling/observed.ts +267 -0
- package/src/modeling/types.ts +174 -1
- package/src/models/AuthorizationData.ts +3 -3
- package/src/models/CertificateFile.ts +2 -2
- package/src/models/ClientCertificate.ts +5 -5
- package/src/models/Environment.ts +6 -6
- package/src/models/Folder.ts +2 -2
- package/src/models/HostRule.ts +4 -4
- package/src/models/HttpProject.ts +12 -12
- package/src/models/Project.ts +2 -2
- package/src/models/ProjectFolder.ts +6 -6
- package/src/models/ProjectRequest.ts +8 -8
- package/src/models/ProjectSchema.ts +6 -6
- package/src/models/Thing.ts +70 -5
- package/src/models/kinds.ts +32 -6
- package/src/models/store/DataFile.ts +5 -3
- package/src/models/store/File.ts +3 -3
- package/src/models/store/Organization.ts +3 -3
- package/src/models/store/Permission.ts +7 -7
- package/src/models/store/UserIdentity.ts +3 -3
- package/src/models/transformers/ArcDexieTransformer.ts +4 -4
- package/src/models/transformers/ArcLegacyTransformer.ts +3 -3
- package/src/models/transformers/ArcPouchTransformer.ts +2 -2
- package/src/models/transformers/PostmanV21Transformer.ts +2 -2
- package/src/models/transformers/PostmanV2Transformer.ts +2 -2
- package/src/models/types.ts +11 -0
- package/src/patch/PatchClient.ts +2 -2
- package/src/runtime/store/FilesSdk.ts +5 -5
- package/tests/unit/amf/data_value_generator.spec.ts +15 -15
- package/tests/unit/legacy-transformers/ARC-legacy-import.spec.ts +1 -1
- package/tests/unit/modeling/amf/shape_generator.spec.ts +1174 -0
- package/tests/unit/modeling/data_domain.spec.ts +444 -0
- package/tests/unit/modeling/data_domain_associations.spec.ts +279 -0
- package/tests/unit/modeling/data_domain_change_observers.spec.ts +681 -0
- package/tests/unit/modeling/data_domain_entities.spec.ts +449 -0
- package/tests/unit/modeling/data_domain_foreign.spec.ts +355 -0
- package/tests/unit/modeling/data_domain_models.spec.ts +658 -0
- package/tests/unit/modeling/data_domain_namespaces.spec.ts +668 -0
- package/tests/unit/modeling/data_domain_property.spec.ts +264 -0
- package/tests/unit/modeling/data_domain_serialization.spec.ts +294 -0
- package/tests/unit/modeling/domain.property.spec.ts +822 -0
- package/tests/unit/modeling/domain_asociation.spec.ts +643 -0
- package/tests/unit/modeling/domain_asociation_targets.spec.ts +350 -0
- package/tests/unit/modeling/domain_entity.spec.ts +730 -0
- package/tests/unit/modeling/domain_entity_associations.spec.ts +330 -0
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +988 -0
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1451 -0
- package/tests/unit/modeling/domain_entity_fields.spec.ts +113 -0
- package/tests/unit/modeling/domain_entity_generators.spec.ts +20 -0
- package/tests/unit/modeling/domain_entity_parents.spec.ts +291 -0
- package/tests/unit/modeling/domain_entity_properties.spec.ts +305 -0
- package/tests/unit/modeling/{data_file.spec.ts → domain_file.spec.ts} +29 -85
- package/tests/unit/modeling/domain_impact_analysis.spec.ts +452 -0
- package/tests/unit/modeling/domain_model.spec.ts +568 -0
- package/tests/unit/modeling/domain_model_entities.spec.ts +408 -0
- package/tests/unit/modeling/domain_namespace.spec.ts +514 -0
- package/tests/unit/modeling/domain_namespace_models.spec.ts +324 -0
- package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +404 -0
- package/tests/unit/modeling/domain_versioning.spec.ts +140 -0
- package/tests/unit/{amf → modeling/legacy}/amf_shape_generator.spec.ts +11 -11
- package/tests/unit/modeling/{data_association.spec.ts → legacy/data_association.spec.ts} +3 -11
- package/tests/unit/modeling/{data_entity.spec.ts → legacy/data_entity.spec.ts} +10 -8
- package/tests/unit/modeling/{data_entity_generator_json.spec.ts → legacy/data_entity_generator_json.spec.ts} +1 -1
- package/tests/unit/modeling/{data_entity_generator_xml.spec.ts → legacy/data_entity_generator_xml.spec.ts} +1 -1
- package/tests/unit/modeling/{data_model.spec.ts → legacy/data_model.spec.ts} +3 -3
- package/tests/unit/modeling/{data_namespace.spec.ts → legacy/data_namespace.spec.ts} +3 -10
- package/tests/unit/modeling/{data_property.spec.ts → legacy/data_property.spec.ts} +3 -6
- package/tests/unit/modeling/{impact_analysis.spec.ts → legacy/impact_analysis.spec.ts} +9 -9
- package/tests/unit/models/File/new.spec.ts +1 -1
- package/tests/unit/models/HttpProject.spec.ts +3 -3
- package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +8 -8
- package/tsconfig.node.json +35 -0
- package/build/src/modeling/DataAssociation.d.ts.map +0 -1
- package/build/src/modeling/DataAssociation.js.map +0 -1
- package/build/src/modeling/DataEntity.d.ts.map +0 -1
- package/build/src/modeling/DataEntity.js.map +0 -1
- package/build/src/modeling/DataEntityBuilder.d.ts.map +0 -1
- package/build/src/modeling/DataEntityBuilder.js.map +0 -1
- package/build/src/modeling/DataModel.d.ts.map +0 -1
- package/build/src/modeling/DataModel.js.map +0 -1
- package/build/src/modeling/DataNamespace.d.ts.map +0 -1
- package/build/src/modeling/DataNamespace.js.map +0 -1
- package/build/src/modeling/DataProperty.d.ts.map +0 -1
- package/build/src/modeling/DataProperty.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { nanoid } from 'nanoid'
|
|
2
2
|
import { BaseTransformer, dataValue } from './BaseTransformer.js'
|
|
3
3
|
import { Creator, Browser, Page, Entry, Header } from './har.js'
|
|
4
4
|
import {
|
|
@@ -131,7 +131,7 @@ export class ArcDexieTransformer extends BaseTransformer {
|
|
|
131
131
|
updateData: item.requestIds,
|
|
132
132
|
legacyProject: {
|
|
133
133
|
kind: 'ARC#Project',
|
|
134
|
-
key:
|
|
134
|
+
key: nanoid(),
|
|
135
135
|
name: item.name,
|
|
136
136
|
order: item.order,
|
|
137
137
|
updated: item.updateTime,
|
|
@@ -205,7 +205,7 @@ export class ArcDexieTransformer extends BaseTransformer {
|
|
|
205
205
|
const updated = { ...item }
|
|
206
206
|
updated.updateTime = updated.updateTime || Date.now()
|
|
207
207
|
const obj: ExportArcHistoryRequest = {
|
|
208
|
-
key:
|
|
208
|
+
key: nanoid(),
|
|
209
209
|
method: updated.method,
|
|
210
210
|
url: updated.url,
|
|
211
211
|
updated: new Date(updated.updateTime).getTime(),
|
|
@@ -245,7 +245,7 @@ export class ArcDexieTransformer extends BaseTransformer {
|
|
|
245
245
|
url: item.url,
|
|
246
246
|
type: 'saved',
|
|
247
247
|
kind: 'ARC#HttpRequest',
|
|
248
|
-
key:
|
|
248
|
+
key: nanoid(),
|
|
249
249
|
}
|
|
250
250
|
// payload and headers
|
|
251
251
|
const harIndex = item.referenceEntry || 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import
|
|
2
|
+
import { nanoid } from 'nanoid'
|
|
3
3
|
import { BaseTransformer, dataValue } from './BaseTransformer.js'
|
|
4
4
|
import { ArcExportObject, ExportArcProjects, ExportArcSavedRequest } from '../legacy/DataExport.js'
|
|
5
5
|
|
|
@@ -113,7 +113,7 @@ export class ArcLegacyTransformer extends BaseTransformer {
|
|
|
113
113
|
}
|
|
114
114
|
return {
|
|
115
115
|
kind: 'ARC#ProjectData',
|
|
116
|
-
key:
|
|
116
|
+
key: nanoid(),
|
|
117
117
|
created,
|
|
118
118
|
name: item.name || 'unnamed',
|
|
119
119
|
order: 0,
|
|
@@ -153,7 +153,7 @@ export class ArcLegacyTransformer extends BaseTransformer {
|
|
|
153
153
|
|
|
154
154
|
const project = this.findProject(item.project, projects)
|
|
155
155
|
const projectId = project ? project.key : undefined
|
|
156
|
-
const id =
|
|
156
|
+
const id = nanoid()
|
|
157
157
|
let created = Number(item.time)
|
|
158
158
|
if (Number.isNaN(created)) {
|
|
159
159
|
created = Date.now()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { nanoid } from 'nanoid'
|
|
4
4
|
import { BaseTransformer, dataValue } from './BaseTransformer.js'
|
|
5
5
|
import {
|
|
6
6
|
ArcExportObject,
|
|
@@ -91,7 +91,7 @@ export class ArcPouchTransformer extends BaseTransformer {
|
|
|
91
91
|
return projects.map((item) => {
|
|
92
92
|
const project = { ...item }
|
|
93
93
|
if (!project.key) {
|
|
94
|
-
project.key =
|
|
94
|
+
project.key = nanoid()
|
|
95
95
|
}
|
|
96
96
|
return updateItemTimings(project)
|
|
97
97
|
})
|
|
@@ -4,7 +4,7 @@ import { HttpProject, IHttpProject, Kind as ProjectKind } from '../HttpProject.j
|
|
|
4
4
|
import { ProjectFolder } from '../ProjectFolder.js'
|
|
5
5
|
import { ProjectRequest } from '../ProjectRequest.js'
|
|
6
6
|
import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js'
|
|
7
|
-
import
|
|
7
|
+
import { nanoid } from 'nanoid'
|
|
8
8
|
import { Environment } from '../Environment.js'
|
|
9
9
|
import { Thing } from '../Thing.js'
|
|
10
10
|
|
|
@@ -137,7 +137,7 @@ export class PostmanV21Transformer extends PostmanTransformer {
|
|
|
137
137
|
definitions: {},
|
|
138
138
|
info: Thing.fromName(info.name || 'Unnamed Postman project').toJSON(),
|
|
139
139
|
items: [],
|
|
140
|
-
key: info._postman_id ||
|
|
140
|
+
key: info._postman_id || nanoid(),
|
|
141
141
|
}
|
|
142
142
|
if (info.description) {
|
|
143
143
|
init.info.description = info.description
|
|
@@ -4,7 +4,7 @@ import { HttpProject, IHttpProject, Kind as HttpProjectKind } from '../HttpProje
|
|
|
4
4
|
import { ProjectFolder } from '../ProjectFolder.js'
|
|
5
5
|
import { ProjectRequest } from '../ProjectRequest.js'
|
|
6
6
|
import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js'
|
|
7
|
-
import
|
|
7
|
+
import { nanoid } from 'nanoid'
|
|
8
8
|
import { Environment } from '../Environment.js'
|
|
9
9
|
import { Thing } from '../Thing.js'
|
|
10
10
|
|
|
@@ -137,7 +137,7 @@ export class PostmanV2Transformer extends PostmanTransformer {
|
|
|
137
137
|
definitions: {},
|
|
138
138
|
info: Thing.fromName(info.name || 'Unnamed Postman project').toJSON(),
|
|
139
139
|
items: [],
|
|
140
|
-
key: info._postman_id ||
|
|
140
|
+
key: info._postman_id || nanoid(),
|
|
141
141
|
}
|
|
142
142
|
if (info.description) {
|
|
143
143
|
init.info.description = info.description
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ModelValidationOptions {
|
|
2
|
+
/**
|
|
3
|
+
* When true, the validation will perform a strict validation.
|
|
4
|
+
*
|
|
5
|
+
* This means that the validation will check for the following:
|
|
6
|
+
* - The `kind` property is set to the correct value.
|
|
7
|
+
*
|
|
8
|
+
* In all kinds of validation, required properties are always checked.
|
|
9
|
+
*/
|
|
10
|
+
strict?: boolean
|
|
11
|
+
}
|
package/src/patch/PatchClient.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Operation, JsonDocument } from '@api-client/json'
|
|
2
|
-
import
|
|
2
|
+
import { nanoid } from 'nanoid'
|
|
3
3
|
import type { MediaPatchInfo, PatchInfo } from './types.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -78,7 +78,7 @@ export class PatchClient<T extends object> extends JsonDocument<T> {
|
|
|
78
78
|
patch: operations,
|
|
79
79
|
app: this.app,
|
|
80
80
|
appVersion: this.appVersion,
|
|
81
|
-
id:
|
|
81
|
+
id: nanoid(),
|
|
82
82
|
}
|
|
83
83
|
if (this.version !== undefined) {
|
|
84
84
|
const casted = result as MediaPatchInfo
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { RouteBuilder } from './RouteBuilder.js'
|
|
10
10
|
import { IUser } from '../../models/store/User.js'
|
|
11
11
|
import { FileBreadcrumb, IFile } from '../../models/store/File.js'
|
|
12
|
-
import { FolderKind, CertificateFileKind, ProjectKind,
|
|
12
|
+
import { FolderKind, CertificateFileKind, ProjectKind, DomainFileKind } from '../../models/kinds.js'
|
|
13
13
|
import { SdkError } from './Errors.js'
|
|
14
14
|
import {
|
|
15
15
|
ContextListResult,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
ContextListOptions,
|
|
19
19
|
} from '../../events/BaseEvents.js'
|
|
20
20
|
import { IAccessAddOperation, IAccessRemoveOperation, PermissionRole } from '../../models/store/Permission.js'
|
|
21
|
-
import
|
|
21
|
+
import { nanoid } from 'nanoid'
|
|
22
22
|
import { Folder, type IFolder } from '../../models/Folder.js'
|
|
23
23
|
import type { AccessPatchInfo, MediaPatchInfo, MediaPatchRevision, PatchInfo } from '../../patch/types.js'
|
|
24
24
|
|
|
@@ -40,7 +40,7 @@ export interface IMediaCreateOptions {
|
|
|
40
40
|
|
|
41
41
|
export interface IFileCreateOptions extends IMetaCreateOptions, IMediaCreateOptions {}
|
|
42
42
|
|
|
43
|
-
export type ListFileKind = typeof ProjectKind | typeof FolderKind | typeof
|
|
43
|
+
export type ListFileKind = typeof ProjectKind | typeof FolderKind | typeof DomainFileKind | typeof CertificateFileKind
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* In the store, the file is represented by the meta and the media.
|
|
@@ -549,7 +549,7 @@ export class FilesSdk extends SdkBase {
|
|
|
549
549
|
}
|
|
550
550
|
const patch: AccessPatchInfo = {
|
|
551
551
|
patch: [op],
|
|
552
|
-
id:
|
|
552
|
+
id: nanoid(),
|
|
553
553
|
}
|
|
554
554
|
return this.patchUsers(organization, key, patch, request)
|
|
555
555
|
}
|
|
@@ -569,7 +569,7 @@ export class FilesSdk extends SdkBase {
|
|
|
569
569
|
}
|
|
570
570
|
const patch: AccessPatchInfo = {
|
|
571
571
|
patch: [op],
|
|
572
|
-
id:
|
|
572
|
+
id: nanoid(),
|
|
573
573
|
}
|
|
574
574
|
return this.patchUsers(organization, key, patch, request)
|
|
575
575
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataValueGenerator,
|
|
3
|
-
import type {
|
|
2
|
+
import { DataValueGenerator, noValue } from '../../../src/amf/DataValueGenerator.js'
|
|
3
|
+
import type { DomainPropertyType } from '../../../src/modeling/DataFormat.js'
|
|
4
4
|
|
|
5
5
|
test.group('DataValueGenerator', (group) => {
|
|
6
6
|
let generator: DataValueGenerator
|
|
@@ -9,9 +9,9 @@ test.group('DataValueGenerator', (group) => {
|
|
|
9
9
|
generator = new DataValueGenerator()
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
test('generate() returns
|
|
13
|
-
const result = generator.generate('random', 'unknown' as
|
|
14
|
-
assert.equal(result,
|
|
12
|
+
test('generate() returns noValue for unsupported types', ({ assert }) => {
|
|
13
|
+
const result = generator.generate('random', 'unknown' as DomainPropertyType)
|
|
14
|
+
assert.equal(result, noValue)
|
|
15
15
|
})
|
|
16
16
|
|
|
17
17
|
test('generateString() returns random string for "random" function', ({ assert }) => {
|
|
@@ -28,9 +28,9 @@ test.group('DataValueGenerator', (group) => {
|
|
|
28
28
|
assert.match(result as string, /^[0-9a-f-]+$/)
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
-
test('generateString() returns
|
|
31
|
+
test('generateString() returns noValue for unsupported function', ({ assert }) => {
|
|
32
32
|
const result = generator.generate('unsupported', 'string')
|
|
33
|
-
assert.equal(result,
|
|
33
|
+
assert.equal(result, noValue)
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
test('generateNumber() returns incremental number for "incremental" function', ({ assert }) => {
|
|
@@ -42,9 +42,9 @@ test.group('DataValueGenerator', (group) => {
|
|
|
42
42
|
assert.equal(parseInt(result2 as string), 1)
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
-
test('generateNumber() returns
|
|
45
|
+
test('generateNumber() returns noValue for unsupported function', ({ assert }) => {
|
|
46
46
|
const result = generator.generate('unsupported', 'number')
|
|
47
|
-
assert.equal(result,
|
|
47
|
+
assert.equal(result, noValue)
|
|
48
48
|
})
|
|
49
49
|
|
|
50
50
|
test('generateDate() returns current date for "now" function', ({ assert }) => {
|
|
@@ -53,9 +53,9 @@ test.group('DataValueGenerator', (group) => {
|
|
|
53
53
|
assert.match(result as string, /^\d{4}-\d{2}-\d{2}$/)
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
test('generateDate() returns
|
|
56
|
+
test('generateDate() returns noValue for unsupported function', ({ assert }) => {
|
|
57
57
|
const result = generator.generate('unsupported', 'date')
|
|
58
|
-
assert.equal(result,
|
|
58
|
+
assert.equal(result, noValue)
|
|
59
59
|
})
|
|
60
60
|
|
|
61
61
|
test('generateTime() returns current time for "now" function', ({ assert }) => {
|
|
@@ -64,9 +64,9 @@ test.group('DataValueGenerator', (group) => {
|
|
|
64
64
|
assert.match(result as string, /^\d{2}:\d{2}:\d{2}$/)
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
test('generateTime() returns
|
|
67
|
+
test('generateTime() returns noValue for unsupported function', ({ assert }) => {
|
|
68
68
|
const result = generator.generate('unsupported', 'time')
|
|
69
|
-
assert.equal(result,
|
|
69
|
+
assert.equal(result, noValue)
|
|
70
70
|
})
|
|
71
71
|
|
|
72
72
|
test('generateDateTime() returns current datetime for "now" function', ({ assert }) => {
|
|
@@ -75,8 +75,8 @@ test.group('DataValueGenerator', (group) => {
|
|
|
75
75
|
assert.match(result as string, /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/)
|
|
76
76
|
})
|
|
77
77
|
|
|
78
|
-
test('generateDateTime() returns
|
|
78
|
+
test('generateDateTime() returns noValue for unsupported function', ({ assert }) => {
|
|
79
79
|
const result = generator.generate('unsupported', 'datetime')
|
|
80
|
-
assert.equal(result,
|
|
80
|
+
assert.equal(result, noValue)
|
|
81
81
|
})
|
|
82
82
|
})
|
|
@@ -41,7 +41,7 @@ test.group('ARC legacy import: Importing exported ARC 17 file', (group) => {
|
|
|
41
41
|
assert.equal(def.kind, ProjectRequestKind)
|
|
42
42
|
const request = def as ProjectRequest
|
|
43
43
|
assert.typeOf(request.expects, 'object')
|
|
44
|
-
assert.typeOf(request.info, '
|
|
44
|
+
assert.typeOf(request.info, 'EventTarget')
|
|
45
45
|
assert.typeOf(request.log, 'object')
|
|
46
46
|
})
|
|
47
47
|
})
|