@api-client/core 0.19.32 → 0.19.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/authorization/index.d.ts +10 -0
- package/build/src/authorization/index.d.ts.map +1 -0
- package/build/src/authorization/index.js +10 -0
- package/build/src/authorization/index.js.map +1 -0
- package/build/src/browser.d.ts +13 -143
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +10 -144
- package/build/src/browser.js.map +1 -1
- package/build/src/data/DataExtractor.d.ts +1 -2
- package/build/src/data/DataExtractor.d.ts.map +1 -1
- package/build/src/data/DataExtractor.js.map +1 -1
- package/build/src/data/index.d.ts +10 -0
- package/build/src/data/index.d.ts.map +1 -0
- package/build/src/data/index.js +10 -0
- package/build/src/data/index.js.map +1 -0
- package/build/src/events/Events.d.ts +3 -3
- package/build/src/events/index.d.ts +11 -0
- package/build/src/events/index.d.ts.map +1 -0
- package/build/src/events/index.js +4 -0
- package/build/src/events/index.js.map +1 -0
- package/build/src/exceptions/index.d.ts +8 -0
- package/build/src/exceptions/index.d.ts.map +1 -0
- package/build/src/exceptions/index.js +8 -0
- package/build/src/exceptions/index.js.map +1 -0
- package/build/src/index.d.ts +10 -138
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +11 -142
- package/build/src/index.js.map +1 -1
- package/build/src/mocking/lib/User.d.ts.map +1 -1
- package/build/src/mocking/lib/User.js +1 -1
- package/build/src/mocking/lib/User.js.map +1 -1
- package/build/src/modeling/ai/DataDomainDelta.d.ts +3 -3
- package/build/src/modeling/ai/DataDomainDelta.d.ts.map +1 -1
- package/build/src/modeling/ai/DataDomainDelta.js +3 -3
- package/build/src/modeling/ai/DataDomainDelta.js.map +1 -1
- package/build/src/modeling/amf/index.d.ts +4 -0
- package/build/src/modeling/amf/index.d.ts.map +1 -0
- package/build/src/modeling/amf/index.js +4 -0
- package/build/src/modeling/amf/index.js.map +1 -0
- package/build/src/modeling/index.d.ts +18 -1
- package/build/src/modeling/index.d.ts.map +1 -1
- package/build/src/modeling/index.js +14 -1
- package/build/src/modeling/index.js.map +1 -1
- package/build/src/models/index.d.ts +64 -0
- package/build/src/models/index.d.ts.map +1 -0
- package/build/src/models/index.js +68 -0
- package/build/src/models/index.js.map +1 -0
- package/build/src/models/store/CustomDomain.d.ts +1 -1
- package/build/src/models/store/CustomDomain.d.ts.map +1 -1
- package/build/src/models/store/CustomDomain.js +2 -2
- package/build/src/models/store/CustomDomain.js.map +1 -1
- package/build/src/models/store/{data_catalog.d.ts → DataCatalog.d.ts} +1 -1
- package/build/src/models/store/DataCatalog.d.ts.map +1 -0
- package/build/src/models/store/DataCatalog.js +2 -0
- package/build/src/models/store/DataCatalog.js.map +1 -0
- package/build/src/models/store/DeploymentCustomDomain.d.ts +1 -1
- package/build/src/models/store/DeploymentCustomDomain.d.ts.map +1 -1
- package/build/src/models/store/DeploymentCustomDomain.js +2 -2
- package/build/src/models/store/DeploymentCustomDomain.js.map +1 -1
- package/build/src/models/store/File.d.ts.map +1 -1
- package/build/src/models/store/File.js +1 -2
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/models/store/User.d.ts +3 -3
- package/build/src/models/store/User.d.ts.map +1 -1
- package/build/src/models/store/User.js +1 -1
- package/build/src/models/store/User.js.map +1 -1
- package/build/src/models/store/index.d.ts +17 -0
- package/build/src/models/store/index.d.ts.map +1 -0
- package/build/src/models/store/index.js +10 -0
- package/build/src/models/store/index.js.map +1 -0
- package/build/src/patch/index.d.ts +3 -0
- package/build/src/patch/index.d.ts.map +1 -0
- package/build/src/patch/index.js +2 -0
- package/build/src/patch/index.js.map +1 -0
- package/build/src/sdk/DeploymentsSdk.d.ts +1 -1
- package/build/src/sdk/DeploymentsSdk.d.ts.map +1 -1
- package/build/src/sdk/DeploymentsSdk.js +2 -1
- package/build/src/sdk/DeploymentsSdk.js.map +1 -1
- package/build/src/sdk/GroupsSdk.d.ts +1 -1
- package/build/src/sdk/GroupsSdk.d.ts.map +1 -1
- package/build/src/sdk/GroupsSdk.js.map +1 -1
- package/build/src/sdk/StoreSdkNode.d.ts +0 -4
- package/build/src/sdk/StoreSdkNode.d.ts.map +1 -1
- package/build/src/sdk/StoreSdkNode.js.map +1 -1
- package/build/src/sdk/StoreSdkWeb.d.ts +1 -5
- package/build/src/sdk/StoreSdkWeb.d.ts.map +1 -1
- package/build/src/sdk/StoreSdkWeb.js +1 -1
- package/build/src/sdk/StoreSdkWeb.js.map +1 -1
- package/build/src/sdk/index.d.ts +8 -0
- package/build/src/sdk/index.d.ts.map +1 -0
- package/build/src/sdk/index.js +3 -0
- package/build/src/sdk/index.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/data/DataExtractor.ts +1 -1
- package/src/mocking/lib/User.ts +2 -1
- package/src/modeling/ai/DataDomainDelta.ts +5 -11
- package/src/models/store/CustomDomain.ts +2 -2
- package/src/models/store/DeploymentCustomDomain.ts +2 -2
- package/src/models/store/File.ts +2 -2
- package/src/models/store/User.ts +3 -4
- package/src/sdk/DeploymentsSdk.ts +3 -1
- package/src/sdk/GroupsSdk.ts +1 -1
- package/src/sdk/StoreSdkNode.ts +0 -11
- package/src/sdk/StoreSdkWeb.ts +1 -12
- package/tests/unit/authorization/SecurityProcessor.spec.ts +2 -1
- package/tests/unit/data/JmesparthReader.spec.ts +1 -1
- package/tests/unit/data/JsonReader.spec.ts +1 -1
- package/tests/unit/data/PayloadPointer.spec.ts +1 -1
- package/tests/unit/data/RequestDataExtractor.spec.ts +9 -13
- package/tests/unit/data/UrlEncodedReader.spec.ts +1 -1
- package/tests/unit/data/XmlReader.spec.ts +1 -1
- package/tests/unit/mocking/current/Certificates.spec.ts +1 -1
- package/tests/unit/mocking/current/HostRules.spec.ts +1 -1
- package/tests/unit/mocking/current/Urls.spec.ts +1 -1
- package/tests/unit/mocking/current/User.spec.ts +2 -2
- package/tests/unit/modeling/ai/DataDomainDelta.spec.ts +1 -1
- package/tests/unit/modeling/ai/DomainSerialization.spec.ts +1 -1
- package/tests/unit/modeling/ai/tools/DataDomain.tools.spec.ts +1 -1
- package/tests/unit/modeling/amf/shape_generator.spec.ts +1 -1
- package/tests/unit/modeling/api_model.spec.ts +2 -3
- package/tests/unit/modeling/api_model_expose_entity.spec.ts +1 -1
- package/tests/unit/modeling/api_model_remove_entity.spec.ts +1 -1
- package/tests/unit/modeling/data_domain.spec.ts +2 -1
- package/tests/unit/modeling/data_domain_change_observers.spec.ts +1 -1
- package/tests/unit/modeling/data_domain_serialization.spec.ts +2 -2
- package/tests/unit/modeling/definitions/phone.spec.ts +1 -1
- package/tests/unit/modeling/domain_asociation.spec.ts +34 -34
- package/tests/unit/modeling/domain_asociation_targets.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity.spec.ts +3 -9
- package/tests/unit/modeling/domain_entity_associations.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_fields.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_generators.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_parents.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_properties.spec.ts +2 -1
- package/tests/unit/modeling/domain_file.spec.ts +2 -1
- package/tests/unit/modeling/domain_impact_analysis.spec.ts +5 -3
- package/tests/unit/modeling/domain_model.spec.ts +3 -8
- package/tests/unit/modeling/domain_model_entities.spec.ts +2 -1
- package/tests/unit/modeling/domain_namespace.spec.ts +3 -9
- package/tests/unit/modeling/domain_namespace_models.spec.ts +1 -1
- package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +1 -1
- package/tests/unit/modeling/domain_property.spec.ts +3 -1
- package/tests/unit/modeling/domain_validation.spec.ts +1 -1
- package/tests/unit/modeling/domain_versioning.spec.ts +1 -1
- package/tests/unit/modeling/exposed_entity.spec.ts +1 -1
- package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
- package/tests/unit/modeling/helpers/intellisense.spec.ts +1 -1
- package/tests/unit/modeling/importers/json_schema_importer.spec.ts +1 -1
- package/tests/unit/modeling/validation/association_validation.spec.ts +1 -1
- package/tests/unit/modeling/validation/entity_validation.spec.ts +1 -1
- package/tests/unit/modeling/validation/property_validation.spec.ts +1 -1
- package/tests/unit/models/Certificate/from_name.spec.ts +2 -1
- package/tests/unit/models/File/addLabel.spec.ts +1 -1
- package/tests/unit/models/File/constructor.spec.ts +2 -1
- package/tests/unit/models/File/createFileCapabilities.spec.ts +1 -1
- package/tests/unit/models/File/new.spec.ts +2 -1
- package/tests/unit/models/File/setDeleted.spec.ts +1 -1
- package/tests/unit/models/File/setLastModified.spec.ts +1 -1
- package/tests/unit/models/File/shortcutTo.spec.ts +1 -1
- package/tests/unit/models/File/toJSON.spec.ts +2 -1
- package/tests/unit/models/File/updateByMeMeta.spec.ts +1 -1
- package/tests/unit/models/Folder/consume.spec.ts +2 -1
- package/tests/unit/models/Folder/create.spec.ts +2 -1
- package/tests/unit/models/Permission/all.spec.ts +1 -1
- package/tests/unit/models/Project/consume.spec.ts +1 -1
- package/tests/unit/models/Project/create.spec.ts +1 -1
- package/tests/unit/models/certificate.spec.ts +2 -7
- package/tests/unit/models/host_rule.spec.ts +1 -1
- package/tests/unit/models/http_project.spec.ts +1 -1
- package/tests/unit/models/http_request.spec.ts +2 -9
- package/tests/unit/models/http_response.spec.ts +2 -1
- package/tests/unit/models/license.spec.ts +1 -1
- package/tests/unit/models/response.spec.ts +2 -2
- package/tests/unit/models/store/CustomDomain.spec.ts +8 -8
- package/tests/unit/models/store/DeploymentCustomDomain.spec.ts +9 -9
- package/tests/unit/models/store/Invitation.spec.ts +1 -1
- package/tests/unit/runtime/http-engine/abort.spec.ts +2 -8
- package/tests/unit/runtime/http-engine/auth.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/certificates.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/cleanup.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/compression.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/core_engine.spec.ts +7 -11
- package/tests/unit/runtime/http-engine/events.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/headers.spec.ts +2 -9
- package/tests/unit/runtime/http-engine/hosts.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/http-get.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/http-post.spec.ts +2 -9
- package/tests/unit/runtime/http-engine/logger.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/message.spec.ts +2 -8
- package/tests/unit/runtime/http-engine/params.spec.ts +2 -10
- package/tests/unit/runtime/http-engine/proxy.spec.ts +2 -10
- package/tests/unit/runtime/http-engine/redirects.spec.ts +4 -6
- package/tests/unit/runtime/http-engine/request_utils.spec.ts +2 -1
- package/tests/unit/runtime/http-engine/responses.spec.ts +2 -10
- package/tests/unit/runtime/http-engine/timeout.spec.ts +2 -8
- package/tests/unit/runtime/http-engine/timings.spec.ts +2 -1
- package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +3 -8
- package/tests/unit/runtime/proxy/RequestProxy.spec.ts +6 -7
- package/tests/unit/runtime/reporters/project_run_cli_reporter.spec.ts +2 -7
- package/tests/unit/runtime/runners/http_assertion_runner.spec.ts +2 -2
- package/tests/unit/runtime/runners/http_flow_runner.spec.ts +2 -2
- package/tests/unit/runtime/runners/parallel_runner.spec.ts +2 -2
- package/tests/unit/runtime/runners/project_runner.spec.ts +2 -5
- package/tests/unit/runtime/runners/request_runner.spec.ts +2 -5
- package/tests/unit/runtime/runners/serial_runner.spec.ts +2 -3
- package/tests/unit/runtime/variables/variables_processor.spec.ts +2 -1
- package/tsconfig.browser.json +3 -4
- package/tsconfig.node.json +1 -3
- package/build/src/models/store/data_catalog.d.ts.map +0 -1
- package/build/src/models/store/data_catalog.js +0 -2
- package/build/src/models/store/data_catalog.js.map +0 -1
- /package/src/models/store/{data_catalog.ts → DataCatalog.ts} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
2
|
import {
|
|
3
3
|
DomainAssociation,
|
|
4
|
-
DomainAssociationKind,
|
|
5
|
-
Thing,
|
|
6
4
|
AssociationBinding,
|
|
7
5
|
DataDomain,
|
|
8
6
|
DataFormat,
|
|
9
|
-
|
|
7
|
+
Semantics,
|
|
10
8
|
type OnDeleteRule,
|
|
11
9
|
type AssociationSchema,
|
|
12
|
-
} from '../../../src/index.js'
|
|
10
|
+
} from '../../../src/modeling/index.js'
|
|
11
|
+
import { DomainAssociationKind } from '../../../src/models/kinds.js'
|
|
12
|
+
import { Thing } from '../../../src/models/index.js'
|
|
13
13
|
|
|
14
14
|
test.group('DomainAssociation.createSchema()', () => {
|
|
15
15
|
test('creates a valid schema with default values', ({ assert }) => {
|
|
@@ -41,7 +41,7 @@ test.group('DomainAssociation.createSchema()', () => {
|
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
test('creates a schema with provided semantics', ({ assert }) => {
|
|
44
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
44
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
45
45
|
const schema = DomainAssociation.createSchema({ semantics })
|
|
46
46
|
assert.deepEqual(schema.semantics, semantics)
|
|
47
47
|
})
|
|
@@ -93,7 +93,7 @@ test.group('DomainAssociation.createSchema()', () => {
|
|
|
93
93
|
const required = true
|
|
94
94
|
const bindings: AssociationBinding[] = [{ type: 'web', schema: { hidden: false } }]
|
|
95
95
|
const targets = [{ key: 'target1', domain: 'domain1' }, { key: 'target2' }]
|
|
96
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
96
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
97
97
|
const readOnly = true
|
|
98
98
|
const onDelete: OnDeleteRule = 'restrict'
|
|
99
99
|
|
|
@@ -130,7 +130,7 @@ test.group('DomainAssociation.createSchema()', () => {
|
|
|
130
130
|
})
|
|
131
131
|
|
|
132
132
|
test('creates a schema with cloned semantics', ({ assert }) => {
|
|
133
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
133
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
134
134
|
const schema = DomainAssociation.createSchema({ semantics })
|
|
135
135
|
assert.deepEqual(schema.semantics, semantics)
|
|
136
136
|
assert.notStrictEqual(schema.semantics, semantics)
|
|
@@ -180,7 +180,7 @@ test.group('DomainAssociation.constructor()', () => {
|
|
|
180
180
|
test('creates an instance with provided semantics', ({ assert }) => {
|
|
181
181
|
const dataDomain = new DataDomain()
|
|
182
182
|
const parentKey = 'test-parent'
|
|
183
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
183
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
184
184
|
const association = new DomainAssociation(dataDomain, parentKey, { semantics })
|
|
185
185
|
assert.deepEqual(association.semantics, semantics)
|
|
186
186
|
})
|
|
@@ -257,7 +257,7 @@ test.group('DomainAssociation.constructor()', () => {
|
|
|
257
257
|
const required = true
|
|
258
258
|
const bindings: AssociationBinding[] = [{ type: 'web', schema: { hidden: false } }]
|
|
259
259
|
const targets = [{ key: 'target1', domain: 'domain1' }, { key: 'target2' }]
|
|
260
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
260
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
261
261
|
const readOnly = false
|
|
262
262
|
const onDelete: OnDeleteRule = 'cascade'
|
|
263
263
|
|
|
@@ -298,7 +298,7 @@ test.group('DomainAssociation.constructor()', () => {
|
|
|
298
298
|
test('creates an instance with cloned semantics', ({ assert }) => {
|
|
299
299
|
const dataDomain = new DataDomain()
|
|
300
300
|
const parentKey = 'test-parent'
|
|
301
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
301
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
302
302
|
const association = new DomainAssociation(dataDomain, parentKey, { semantics })
|
|
303
303
|
assert.deepEqual(association.semantics, semantics)
|
|
304
304
|
assert.notStrictEqual(association.semantics, semantics)
|
|
@@ -354,7 +354,7 @@ test.group('DomainAssociation.toJSON()', () => {
|
|
|
354
354
|
test('returns a JSON representation with provided semantics', ({ assert }) => {
|
|
355
355
|
const dataDomain = new DataDomain()
|
|
356
356
|
const parentKey = 'test-parent'
|
|
357
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
357
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
358
358
|
const association = new DomainAssociation(dataDomain, parentKey, { semantics })
|
|
359
359
|
const json = association.toJSON()
|
|
360
360
|
assert.deepEqual(json.semantics, semantics, 'Semantics are serialized')
|
|
@@ -443,7 +443,7 @@ test.group('DomainAssociation.toJSON()', () => {
|
|
|
443
443
|
const required = true
|
|
444
444
|
const bindings: AssociationBinding[] = [{ type: 'web', schema: { hidden: false } }]
|
|
445
445
|
const targets = [{ key: 'target1', domain: 'domain1' }, { key: 'target2' }]
|
|
446
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
446
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
447
447
|
const readOnly = true
|
|
448
448
|
const onDelete: OnDeleteRule = 'restrict'
|
|
449
449
|
|
|
@@ -488,7 +488,7 @@ test.group('DomainAssociation.toJSON()', () => {
|
|
|
488
488
|
const dataDomain = new DataDomain()
|
|
489
489
|
const parentKey = 'test-parent'
|
|
490
490
|
const association = new DomainAssociation(dataDomain, parentKey)
|
|
491
|
-
const semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
491
|
+
const semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
492
492
|
association.semantics = semantics
|
|
493
493
|
const json = association.toJSON()
|
|
494
494
|
assert.deepEqual(json.semantics, semantics, 'Semantics are serialized after creation')
|
|
@@ -826,7 +826,7 @@ test.group('DomainAssociation.addSemantic()', () => {
|
|
|
826
826
|
test('adds a new semantic to the association', ({ assert }) => {
|
|
827
827
|
const dataDomain = new DataDomain()
|
|
828
828
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
829
|
-
const semantic = { id: SemanticType.ResourceOwnerIdentifier }
|
|
829
|
+
const semantic = { id: Semantics.SemanticType.ResourceOwnerIdentifier }
|
|
830
830
|
association.addSemantic(semantic)
|
|
831
831
|
assert.deepInclude(association.semantics, semantic)
|
|
832
832
|
})
|
|
@@ -834,8 +834,8 @@ test.group('DomainAssociation.addSemantic()', () => {
|
|
|
834
834
|
test('updates an existing semantic', ({ assert }) => {
|
|
835
835
|
const dataDomain = new DataDomain()
|
|
836
836
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
837
|
-
const semantic1 = { id: SemanticType.ResourceOwnerIdentifier, config: { value: 'old' } }
|
|
838
|
-
const semantic2 = { id: SemanticType.ResourceOwnerIdentifier, config: { value: 'new' } }
|
|
837
|
+
const semantic1 = { id: Semantics.SemanticType.ResourceOwnerIdentifier, config: { value: 'old' } }
|
|
838
|
+
const semantic2 = { id: Semantics.SemanticType.ResourceOwnerIdentifier, config: { value: 'new' } }
|
|
839
839
|
association.addSemantic(semantic1)
|
|
840
840
|
association.addSemantic(semantic2)
|
|
841
841
|
assert.lengthOf(association.semantics, 1)
|
|
@@ -845,16 +845,16 @@ test.group('DomainAssociation.addSemantic()', () => {
|
|
|
845
845
|
test('throws an error if the semantic is not an association semantic', ({ assert }) => {
|
|
846
846
|
const dataDomain = new DataDomain()
|
|
847
847
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
848
|
-
const semantic = { id: SemanticType.User } // User is an Entity semantic
|
|
848
|
+
const semantic = { id: Semantics.SemanticType.User } // User is an Entity semantic
|
|
849
849
|
assert.throws(() => {
|
|
850
850
|
association.addSemantic(semantic)
|
|
851
|
-
}, `Invalid semantic type: ${SemanticType.User}. Expected an association semantic.`)
|
|
851
|
+
}, `Invalid semantic type: ${Semantics.SemanticType.User}. Expected an association semantic.`)
|
|
852
852
|
})
|
|
853
853
|
|
|
854
854
|
test('notifies change when adding a new semantic', async ({ assert }) => {
|
|
855
855
|
const dataDomain = new DataDomain()
|
|
856
856
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
857
|
-
const semantic = { id: SemanticType.ResourceOwnerIdentifier }
|
|
857
|
+
const semantic = { id: Semantics.SemanticType.ResourceOwnerIdentifier }
|
|
858
858
|
association.addSemantic(semantic)
|
|
859
859
|
await assert.dispatches(dataDomain, 'change', { timeout: 20 })
|
|
860
860
|
})
|
|
@@ -862,8 +862,8 @@ test.group('DomainAssociation.addSemantic()', () => {
|
|
|
862
862
|
test('notifies change when updating an existing semantic', async ({ assert }) => {
|
|
863
863
|
const dataDomain = new DataDomain()
|
|
864
864
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
865
|
-
const semantic1 = { id: SemanticType.ResourceOwnerIdentifier, config: { value: 'old' } }
|
|
866
|
-
const semantic2 = { id: SemanticType.ResourceOwnerIdentifier, config: { value: 'new' } }
|
|
865
|
+
const semantic1 = { id: Semantics.SemanticType.ResourceOwnerIdentifier, config: { value: 'old' } }
|
|
866
|
+
const semantic2 = { id: Semantics.SemanticType.ResourceOwnerIdentifier, config: { value: 'new' } }
|
|
867
867
|
association.addSemantic(semantic1)
|
|
868
868
|
// Clear the event queue before the second add
|
|
869
869
|
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
@@ -876,10 +876,10 @@ test.group('DomainAssociation.removeSemantic()', () => {
|
|
|
876
876
|
test('removes an existing semantic from the association', ({ assert }) => {
|
|
877
877
|
const dataDomain = new DataDomain()
|
|
878
878
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
879
|
-
const semantic = { id: SemanticType.ResourceOwnerIdentifier }
|
|
879
|
+
const semantic = { id: Semantics.SemanticType.ResourceOwnerIdentifier }
|
|
880
880
|
association.addSemantic(semantic)
|
|
881
881
|
assert.deepInclude(association.semantics, semantic)
|
|
882
|
-
association.removeSemantic(SemanticType.ResourceOwnerIdentifier)
|
|
882
|
+
association.removeSemantic(Semantics.SemanticType.ResourceOwnerIdentifier)
|
|
883
883
|
assert.notDeepInclude(association.semantics, semantic)
|
|
884
884
|
assert.lengthOf(association.semantics, 0)
|
|
885
885
|
})
|
|
@@ -887,21 +887,21 @@ test.group('DomainAssociation.removeSemantic()', () => {
|
|
|
887
887
|
test('does nothing if the semantic to remove does not exist', ({ assert }) => {
|
|
888
888
|
const dataDomain = new DataDomain()
|
|
889
889
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
890
|
-
const semantic = { id: SemanticType.ResourceOwnerIdentifier }
|
|
890
|
+
const semantic = { id: Semantics.SemanticType.ResourceOwnerIdentifier }
|
|
891
891
|
association.addSemantic(semantic)
|
|
892
892
|
const initialSemantics = [...association.semantics]
|
|
893
|
-
association.removeSemantic('non-existent-semantic-id' as SemanticType)
|
|
893
|
+
association.removeSemantic('non-existent-semantic-id' as Semantics.SemanticType)
|
|
894
894
|
assert.deepEqual(association.semantics, initialSemantics)
|
|
895
895
|
})
|
|
896
896
|
|
|
897
897
|
test('notifies change when a semantic is removed', async ({ assert }) => {
|
|
898
898
|
const dataDomain = new DataDomain()
|
|
899
899
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
900
|
-
const semantic = { id: SemanticType.ResourceOwnerIdentifier }
|
|
900
|
+
const semantic = { id: Semantics.SemanticType.ResourceOwnerIdentifier }
|
|
901
901
|
association.addSemantic(semantic)
|
|
902
902
|
// Clear the event queue before removal
|
|
903
903
|
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
904
|
-
association.removeSemantic(SemanticType.ResourceOwnerIdentifier)
|
|
904
|
+
association.removeSemantic(Semantics.SemanticType.ResourceOwnerIdentifier)
|
|
905
905
|
await assert.dispatches(dataDomain, 'change', { timeout: 20 })
|
|
906
906
|
})
|
|
907
907
|
|
|
@@ -910,7 +910,7 @@ test.group('DomainAssociation.removeSemantic()', () => {
|
|
|
910
910
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
911
911
|
// Clear the event queue before removal
|
|
912
912
|
await new Promise((resolve) => setTimeout(resolve, 0))
|
|
913
|
-
association.removeSemantic('non-existent-semantic-id' as SemanticType)
|
|
913
|
+
association.removeSemantic('non-existent-semantic-id' as Semantics.SemanticType)
|
|
914
914
|
await assert.notDispatches(dataDomain, 'change', { timeout: 20 })
|
|
915
915
|
})
|
|
916
916
|
})
|
|
@@ -919,21 +919,21 @@ test.group('DomainAssociation.hasSemantic()', () => {
|
|
|
919
919
|
test('returns true if the association has the specified semantic', ({ assert }) => {
|
|
920
920
|
const dataDomain = new DataDomain()
|
|
921
921
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
922
|
-
const semantic = { id: SemanticType.ResourceOwnerIdentifier }
|
|
922
|
+
const semantic = { id: Semantics.SemanticType.ResourceOwnerIdentifier }
|
|
923
923
|
association.addSemantic(semantic)
|
|
924
|
-
assert.isTrue(association.hasSemantic(SemanticType.ResourceOwnerIdentifier))
|
|
924
|
+
assert.isTrue(association.hasSemantic(Semantics.SemanticType.ResourceOwnerIdentifier))
|
|
925
925
|
})
|
|
926
926
|
|
|
927
927
|
test('returns false if the association does not have the specified semantic', ({ assert }) => {
|
|
928
928
|
const dataDomain = new DataDomain()
|
|
929
929
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
930
|
-
assert.isFalse(association.hasSemantic(SemanticType.ResourceOwnerIdentifier))
|
|
930
|
+
assert.isFalse(association.hasSemantic(Semantics.SemanticType.ResourceOwnerIdentifier))
|
|
931
931
|
})
|
|
932
932
|
|
|
933
933
|
test('returns false for an empty semantics array', ({ assert }) => {
|
|
934
934
|
const dataDomain = new DataDomain()
|
|
935
935
|
const association = new DomainAssociation(dataDomain, 'test-parent')
|
|
936
|
-
assert.isFalse(association.hasSemantic(SemanticType.ResourceOwnerIdentifier))
|
|
936
|
+
assert.isFalse(association.hasSemantic(Semantics.SemanticType.ResourceOwnerIdentifier))
|
|
937
937
|
})
|
|
938
938
|
})
|
|
939
939
|
|
|
@@ -1082,7 +1082,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1082
1082
|
association.multiple = true
|
|
1083
1083
|
association.readOnly = true
|
|
1084
1084
|
association.onDelete = 'cascade'
|
|
1085
|
-
association.semantics = [{ id: SemanticType.ResourceOwnerIdentifier }]
|
|
1085
|
+
association.semantics = [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }]
|
|
1086
1086
|
association.schema = { embedded: true, unionType: 'allOf' }
|
|
1087
1087
|
association.bindings = [{ type: 'web', schema: { hidden: true } }]
|
|
1088
1088
|
|
|
@@ -1094,7 +1094,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1094
1094
|
assert.equal(duplicate.multiple, true)
|
|
1095
1095
|
assert.equal(duplicate.readOnly, true)
|
|
1096
1096
|
assert.equal(duplicate.onDelete, 'cascade')
|
|
1097
|
-
assert.deepEqual(duplicate.semantics, [{ id: SemanticType.ResourceOwnerIdentifier }])
|
|
1097
|
+
assert.deepEqual(duplicate.semantics, [{ id: Semantics.SemanticType.ResourceOwnerIdentifier }])
|
|
1098
1098
|
assert.deepEqual(duplicate.schema, { embedded: true, unionType: 'allOf' })
|
|
1099
1099
|
assert.deepEqual(duplicate.bindings, [{ type: 'web', schema: { hidden: true } }])
|
|
1100
1100
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DomainAssociation, DataDomain } from '../../../src/index.js'
|
|
2
|
+
import { DomainAssociation, DataDomain } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainAssociation.addTarget()', () => {
|
|
5
5
|
test('adds a target entity to the association', ({ assert }) => {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
DomainEntityKind,
|
|
6
|
-
DomainModelKind,
|
|
7
|
-
DomainNamespaceKind,
|
|
8
|
-
DomainEntity,
|
|
9
|
-
Thing,
|
|
10
|
-
} from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainEntity } from '../../../src/modeling/index.js'
|
|
3
|
+
import { Thing } from '../../../src/models/index.js'
|
|
4
|
+
import { DataDomainKind, DomainEntityKind, DomainModelKind, DomainNamespaceKind } from '../../../src/models/kinds.js'
|
|
11
5
|
import type { EntityOrderedItem } from '../../../src/modeling/DomainEntity.js'
|
|
12
6
|
import { SemanticType } from '../../../src/modeling/Semantics.js'
|
|
13
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainAssociation } from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainAssociation } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainEntity.addAssociation()', () => {
|
|
5
5
|
test('adds an association to the entity', ({ assert }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import { test } from '@japa/runner'
|
|
3
|
-
import { DataDomain, DomainEntity, DomainModel, DomainProperty } from '../../../src/index.js'
|
|
3
|
+
import { DataDomain, DomainEntity, DomainModel, DomainProperty } from '../../../src/modeling/index.js'
|
|
4
4
|
|
|
5
5
|
// const rfc2616Re =
|
|
6
6
|
// /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), ([0-3][0-9]) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{4}) ([01][0-9]|2[0-3])(:[0-5][0-9]){2} GMT$/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
2
|
import { JSDOM } from 'jsdom'
|
|
3
|
-
import { DataDomain, DomainEntity, DomainModel, DomainProperty } from '../../../src/index.js'
|
|
3
|
+
import { DataDomain, DomainEntity, DomainModel, DomainProperty } from '../../../src/modeling/index.js'
|
|
4
4
|
|
|
5
5
|
const rfc3339Re = /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z$/
|
|
6
6
|
const dateRe = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainAssociation, DomainProperty } from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainAssociation, DomainProperty } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainEntity.listFields()', () => {
|
|
5
5
|
test('lists all fields (properties and associations) of this entity', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainEntity } from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainEntity } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainEntity.listParents()', () => {
|
|
5
5
|
test('lists all parent entities', ({ assert }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain,
|
|
2
|
+
import { DataDomain, DomainProperty } from '../../../src/modeling/index.js'
|
|
3
|
+
import { DomainPropertyKind } from '../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('DomainEntity.addProperty()', () => {
|
|
5
6
|
test('adds a property to the entity', ({ assert }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DomainFile, type DomainFileSchema,
|
|
2
|
+
import { DomainFile, type DomainFileSchema, DataDomain } from '../../../src/modeling/index.js'
|
|
3
|
+
import { ThingKind, DomainFileKind } from '../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('DomainFile.fromDataDomain()', () => {
|
|
5
6
|
test('sets the kind', ({ assert }) => {
|
|
@@ -6,13 +6,15 @@ import {
|
|
|
6
6
|
DomainModelKind,
|
|
7
7
|
DomainPropertyKind,
|
|
8
8
|
DomainAssociationKind,
|
|
9
|
+
} from '../../../src/models/kinds.js'
|
|
10
|
+
import {
|
|
9
11
|
DataDomain,
|
|
10
|
-
DomainNamespace,
|
|
11
|
-
DomainModel,
|
|
12
12
|
DomainEntity,
|
|
13
|
+
DomainModel,
|
|
14
|
+
DomainNamespace,
|
|
13
15
|
DomainProperty,
|
|
14
16
|
DomainAssociation,
|
|
15
|
-
} from '../../../src/index.js'
|
|
17
|
+
} from '../../../src/modeling/index.js'
|
|
16
18
|
|
|
17
19
|
test.group('DomainImpactAnalysis', (group) => {
|
|
18
20
|
let analyzer: DomainImpactAnalysis
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import {
|
|
3
|
-
DataDomain,
|
|
4
|
-
DomainModel,
|
|
5
|
-
DomainModelKind,
|
|
6
|
-
Thing,
|
|
7
|
-
DomainNamespaceKind,
|
|
8
|
-
DataDomainKind,
|
|
9
|
-
} from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainModel } from '../../../src/modeling/index.js'
|
|
10
3
|
import type { ModelOrderedItem } from '../../../src/modeling/DomainModel.js'
|
|
4
|
+
import { DomainModelKind, DomainNamespaceKind, DataDomainKind } from '../../../src/models/kinds.js'
|
|
5
|
+
import { Thing } from '../../../src/models/Thing.js'
|
|
11
6
|
|
|
12
7
|
test.group('DomainModel.createSchema()', () => {
|
|
13
8
|
test('creates a schema with default values', ({ assert }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainEntity,
|
|
2
|
+
import { DataDomain, DomainEntity, DomainModel } from '../../../src/modeling/index.js'
|
|
3
|
+
import { DomainEntityKind } from '../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('DomainModel.addEntity()', () => {
|
|
5
6
|
test('adds an entity to the model', ({ assert }) => {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Thing,
|
|
6
|
-
DomainNamespaceKind,
|
|
7
|
-
DomainModel,
|
|
8
|
-
type DomainNamespaceSchema,
|
|
9
|
-
DomainModelKind,
|
|
10
|
-
} from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainNamespace, DomainModel, type DomainNamespaceSchema } from '../../../src/modeling/index.js'
|
|
3
|
+
import { DomainModelKind, DomainNamespaceKind } from '../../../src/models/kinds.js'
|
|
4
|
+
import { Thing } from '../../../src/models/Thing.js'
|
|
11
5
|
|
|
12
6
|
test.group('DomainNamespace - general', () => {
|
|
13
7
|
test('constructor sets default values', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainModel } from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainModel } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainNamespace.addModel()', () => {
|
|
5
5
|
test('adds a model to the data domain', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainNamespace } from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainNamespace } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainNamespace.addNamespace()', () => {
|
|
5
5
|
test('adds a namespace to the data domain', ({ assert }) => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain,
|
|
2
|
+
import { DataDomain, DomainProperty, DataFormat } from '../../../src/modeling/index.js'
|
|
3
3
|
import { SemanticType } from '../../../src/modeling/Semantics.js'
|
|
4
|
+
import { DomainPropertyKind } from '../../../src/models/kinds.js'
|
|
5
|
+
import { Thing } from '../../../src/models/Thing.js'
|
|
4
6
|
|
|
5
7
|
test.group('DomainProperty.createSchema()', () => {
|
|
6
8
|
test('creates a schema with default values', ({ assert }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
2
|
import { DomainValidation } from '../../../src/modeling/DomainValidation.js'
|
|
3
|
-
import { DataDomain } from '../../../src/index.js'
|
|
3
|
+
import { DataDomain } from '../../../src/modeling/index.js'
|
|
4
4
|
import { SemanticType } from '../../../src/modeling/Semantics.js'
|
|
5
5
|
|
|
6
6
|
test.group('DomainImpactAnalysis.validate()', (group) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainVersioning } from '../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainVersioning } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('DomainVersioning', () => {
|
|
5
5
|
test('should serialize a domain with only local nodes', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { ApiModel, DataDomain, ExposedEntity, type ExposedEntitySchema } from '../../../src/index.js'
|
|
2
|
+
import { ApiModel, DataDomain, ExposedEntity, type ExposedEntitySchema } from '../../../src/modeling/index.js'
|
|
3
3
|
import { AccessRule, RateLimitingConfiguration } from '../../../src/modeling/index.js'
|
|
4
4
|
import { ExposedEntityKind } from '../../../src/models/kinds.js'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { ApiModel, DataDomain } from '../../../src/index.js'
|
|
2
|
+
import { ApiModel, DataDomain } from '../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('ExposedEntity Path Setter Validation', () => {
|
|
5
5
|
test('throws when setting collection path that collides with another root entity', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, DomainEntity, DomainProperty, DomainAssociation } from '../../../../src/index.js'
|
|
2
|
+
import { DataDomain, DomainEntity, DomainProperty, DomainAssociation } from '../../../../src/modeling/index.js'
|
|
3
3
|
import {
|
|
4
4
|
addAutoField,
|
|
5
5
|
addIdField,
|
|
@@ -6,7 +6,7 @@ import { type InMemorySchema, JsonSchemaImporter } from '../../../../src/modelin
|
|
|
6
6
|
import { DataDomain } from '../../../../src/modeling/DataDomain.js'
|
|
7
7
|
import type { JSONSchema7 } from 'json-schema'
|
|
8
8
|
import type { DomainEntity } from '../../../../src/modeling/DomainEntity.js'
|
|
9
|
-
import { DomainAssociation, DomainProperty } from '../../../../src/
|
|
9
|
+
import { DomainAssociation, DomainProperty } from '../../../../src/modeling/index.js'
|
|
10
10
|
import Person from '../../../fixtures/schemas/person.json' with { type: 'json' }
|
|
11
11
|
import Arrays from '../../../fixtures/schemas/arrays.json' with { type: 'json' }
|
|
12
12
|
import EnumValues from '../../../fixtures/schemas/enumerated_values.json' with { type: 'json' }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, AssociationValidation } from '../../../../src/index.js'
|
|
2
|
+
import { DataDomain, AssociationValidation } from '../../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('AssociationValidation', (group) => {
|
|
5
5
|
let domain: DataDomain
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import { test } from '@japa/runner'
|
|
3
|
-
import { DataDomain, EntityValidation } from '../../../../src/index.js'
|
|
3
|
+
import { DataDomain, EntityValidation } from '../../../../src/modeling/index.js'
|
|
4
4
|
|
|
5
5
|
test.group('EntityValidation', (group) => {
|
|
6
6
|
let domain: DataDomain
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { DataDomain, PropertyValidation } from '../../../../src/index.js'
|
|
2
|
+
import { DataDomain, PropertyValidation } from '../../../../src/modeling/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('PropertyValidation', (group) => {
|
|
5
5
|
let domain: DataDomain
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { CertificateFile
|
|
2
|
+
import { CertificateFile } from '../../../../src/models/index.js'
|
|
3
|
+
import { CertificateFileKind } from '../../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('CertificateFile.fromName()', () => {
|
|
5
6
|
test('sets the kind', ({ assert }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { File
|
|
2
|
+
import { File } from '../../../../src/models/index.js'
|
|
3
|
+
import { ThingKind } from '../../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('File.constructor()', () => {
|
|
5
6
|
test('creates a default File', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { File, Folder, CapabilitiesSchema, PermissionRole
|
|
2
|
+
import { File, Folder, Project, type CapabilitiesSchema, type PermissionRole } from '../../../../src/models/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('File.createFileCapabilities()', () => {
|
|
5
5
|
test('{$i} correctly sets file capabilities')
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { File,
|
|
2
|
+
import { File, type FileSchema } from '../../../../src/models/index.js'
|
|
3
|
+
import { ThingKind } from '../../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('File.new()', (group) => {
|
|
5
6
|
let file: File
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { File,
|
|
2
|
+
import { File, type FileSchema } from '../../../../src/models/index.js'
|
|
3
|
+
import { ThingKind } from '../../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('File.toJSON()', (group) => {
|
|
5
6
|
let file: File
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { File, Folder } from '../../../../src/index.js'
|
|
2
|
+
import { File, Folder } from '../../../../src/models/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('File.updateByMeMeta()', () => {
|
|
5
5
|
test('sets deletedInfo.byMe for the same user', ({ assert }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { Folder
|
|
2
|
+
import { Folder } from '../../../../src/models/index.js'
|
|
3
|
+
import { FolderKind } from '../../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('Folder.toJSON()', () => {
|
|
5
6
|
test('serializes the kind', ({ assert }) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { Folder,
|
|
2
|
+
import { Folder, type FolderSchema } from '../../../../src/models/index.js'
|
|
3
|
+
import { FolderKind, ThingKind } from '../../../../src/models/kinds.js'
|
|
3
4
|
|
|
4
5
|
test.group('Folder.fromName()', () => {
|
|
5
6
|
test('sets the kind', ({ assert }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { test } from '@japa/runner'
|
|
2
|
-
import { PermissionSchema, Permission, PermissionKind, PermissionRole } from '../../../../src/index.js'
|
|
2
|
+
import { PermissionSchema, Permission, PermissionKind, PermissionRole } from '../../../../src/models/index.js'
|
|
3
3
|
|
|
4
4
|
test.group('Permission', () => {
|
|
5
5
|
test('creates a default Permission', ({ assert }) => {
|