@api-client/core 0.19.31 → 0.19.33

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.
Files changed (232) hide show
  1. package/build/src/authorization/index.d.ts +10 -0
  2. package/build/src/authorization/index.d.ts.map +1 -0
  3. package/build/src/authorization/index.js +10 -0
  4. package/build/src/authorization/index.js.map +1 -0
  5. package/build/src/browser.d.ts +13 -143
  6. package/build/src/browser.d.ts.map +1 -1
  7. package/build/src/browser.js +10 -144
  8. package/build/src/browser.js.map +1 -1
  9. package/build/src/data/DataExtractor.d.ts +1 -2
  10. package/build/src/data/DataExtractor.d.ts.map +1 -1
  11. package/build/src/data/DataExtractor.js.map +1 -1
  12. package/build/src/data/index.d.ts +10 -0
  13. package/build/src/data/index.d.ts.map +1 -0
  14. package/build/src/data/index.js +10 -0
  15. package/build/src/data/index.js.map +1 -0
  16. package/build/src/events/Events.d.ts +3 -3
  17. package/build/src/events/index.d.ts +11 -0
  18. package/build/src/events/index.d.ts.map +1 -0
  19. package/build/src/events/index.js +4 -0
  20. package/build/src/events/index.js.map +1 -0
  21. package/build/src/exceptions/index.d.ts +8 -0
  22. package/build/src/exceptions/index.d.ts.map +1 -0
  23. package/build/src/exceptions/index.js +8 -0
  24. package/build/src/exceptions/index.js.map +1 -0
  25. package/build/src/index.d.ts +10 -138
  26. package/build/src/index.d.ts.map +1 -1
  27. package/build/src/index.js +11 -142
  28. package/build/src/index.js.map +1 -1
  29. package/build/src/mocking/lib/User.d.ts.map +1 -1
  30. package/build/src/mocking/lib/User.js +1 -1
  31. package/build/src/mocking/lib/User.js.map +1 -1
  32. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  33. package/build/src/modeling/ApiModel.js +0 -8
  34. package/build/src/modeling/ApiModel.js.map +1 -1
  35. package/build/src/modeling/RuntimeApiModel.d.ts +16 -0
  36. package/build/src/modeling/RuntimeApiModel.d.ts.map +1 -1
  37. package/build/src/modeling/RuntimeApiModel.js +31 -0
  38. package/build/src/modeling/RuntimeApiModel.js.map +1 -1
  39. package/build/src/modeling/ai/DataDomainDelta.d.ts +3 -3
  40. package/build/src/modeling/ai/DataDomainDelta.d.ts.map +1 -1
  41. package/build/src/modeling/ai/DataDomainDelta.js +3 -3
  42. package/build/src/modeling/ai/DataDomainDelta.js.map +1 -1
  43. package/build/src/modeling/amf/index.d.ts +4 -0
  44. package/build/src/modeling/amf/index.d.ts.map +1 -0
  45. package/build/src/modeling/amf/index.js +4 -0
  46. package/build/src/modeling/amf/index.js.map +1 -0
  47. package/build/src/modeling/index.d.ts +18 -1
  48. package/build/src/modeling/index.d.ts.map +1 -1
  49. package/build/src/modeling/index.js +14 -1
  50. package/build/src/modeling/index.js.map +1 -1
  51. package/build/src/modeling/types.d.ts +0 -15
  52. package/build/src/modeling/types.d.ts.map +1 -1
  53. package/build/src/modeling/types.js.map +1 -1
  54. package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -1
  55. package/build/src/modeling/validation/api_model_rules.js +49 -46
  56. package/build/src/modeling/validation/api_model_rules.js.map +1 -1
  57. package/build/src/models/index.d.ts +64 -0
  58. package/build/src/models/index.d.ts.map +1 -0
  59. package/build/src/models/index.js +68 -0
  60. package/build/src/models/index.js.map +1 -0
  61. package/build/src/models/store/CustomDomain.d.ts +1 -1
  62. package/build/src/models/store/CustomDomain.d.ts.map +1 -1
  63. package/build/src/models/store/CustomDomain.js +2 -2
  64. package/build/src/models/store/CustomDomain.js.map +1 -1
  65. package/build/src/models/store/{data_catalog.d.ts → DataCatalog.d.ts} +1 -1
  66. package/build/src/models/store/DataCatalog.d.ts.map +1 -0
  67. package/build/src/models/store/DataCatalog.js +2 -0
  68. package/build/src/models/store/DataCatalog.js.map +1 -0
  69. package/build/src/models/store/DeploymentCustomDomain.d.ts +1 -1
  70. package/build/src/models/store/DeploymentCustomDomain.d.ts.map +1 -1
  71. package/build/src/models/store/DeploymentCustomDomain.js +2 -2
  72. package/build/src/models/store/DeploymentCustomDomain.js.map +1 -1
  73. package/build/src/models/store/File.d.ts.map +1 -1
  74. package/build/src/models/store/File.js +1 -2
  75. package/build/src/models/store/File.js.map +1 -1
  76. package/build/src/models/store/User.d.ts +3 -3
  77. package/build/src/models/store/User.d.ts.map +1 -1
  78. package/build/src/models/store/User.js +1 -1
  79. package/build/src/models/store/User.js.map +1 -1
  80. package/build/src/models/store/index.d.ts +17 -0
  81. package/build/src/models/store/index.d.ts.map +1 -0
  82. package/build/src/models/store/index.js +10 -0
  83. package/build/src/models/store/index.js.map +1 -0
  84. package/build/src/patch/index.d.ts +3 -0
  85. package/build/src/patch/index.d.ts.map +1 -0
  86. package/build/src/patch/index.js +2 -0
  87. package/build/src/patch/index.js.map +1 -0
  88. package/build/src/sdk/GroupsSdk.d.ts +1 -1
  89. package/build/src/sdk/GroupsSdk.d.ts.map +1 -1
  90. package/build/src/sdk/GroupsSdk.js.map +1 -1
  91. package/build/src/sdk/StoreSdkNode.d.ts +0 -4
  92. package/build/src/sdk/StoreSdkNode.d.ts.map +1 -1
  93. package/build/src/sdk/StoreSdkNode.js.map +1 -1
  94. package/build/src/sdk/StoreSdkWeb.d.ts +1 -5
  95. package/build/src/sdk/StoreSdkWeb.d.ts.map +1 -1
  96. package/build/src/sdk/StoreSdkWeb.js +1 -1
  97. package/build/src/sdk/StoreSdkWeb.js.map +1 -1
  98. package/build/src/sdk/index.d.ts +8 -0
  99. package/build/src/sdk/index.d.ts.map +1 -0
  100. package/build/src/sdk/index.js +3 -0
  101. package/build/src/sdk/index.js.map +1 -0
  102. package/build/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +1 -1
  104. package/src/data/DataExtractor.ts +1 -1
  105. package/src/mocking/lib/User.ts +2 -1
  106. package/src/modeling/ApiModel.ts +0 -10
  107. package/src/modeling/RuntimeApiModel.ts +46 -0
  108. package/src/modeling/ai/DataDomainDelta.ts +5 -11
  109. package/src/modeling/readme.md +2 -2
  110. package/src/modeling/types.ts +0 -15
  111. package/src/modeling/validation/api_model_rules.ts +50 -48
  112. package/src/modeling/validation/api_model_validation_rules.md +2 -2
  113. package/src/models/store/CustomDomain.ts +2 -2
  114. package/src/models/store/DeploymentCustomDomain.ts +2 -2
  115. package/src/models/store/File.ts +2 -2
  116. package/src/models/store/User.ts +3 -4
  117. package/src/sdk/GroupsSdk.ts +1 -1
  118. package/src/sdk/StoreSdkNode.ts +0 -11
  119. package/src/sdk/StoreSdkWeb.ts +1 -12
  120. package/tests/unit/authorization/SecurityProcessor.spec.ts +2 -1
  121. package/tests/unit/data/JmesparthReader.spec.ts +1 -1
  122. package/tests/unit/data/JsonReader.spec.ts +1 -1
  123. package/tests/unit/data/PayloadPointer.spec.ts +1 -1
  124. package/tests/unit/data/RequestDataExtractor.spec.ts +9 -13
  125. package/tests/unit/data/UrlEncodedReader.spec.ts +1 -1
  126. package/tests/unit/data/XmlReader.spec.ts +1 -1
  127. package/tests/unit/mocking/current/Certificates.spec.ts +1 -1
  128. package/tests/unit/mocking/current/HostRules.spec.ts +1 -1
  129. package/tests/unit/mocking/current/Urls.spec.ts +1 -1
  130. package/tests/unit/mocking/current/User.spec.ts +2 -2
  131. package/tests/unit/modeling/RuntimeApiModel.spec.ts +31 -0
  132. package/tests/unit/modeling/ai/DataDomainDelta.spec.ts +1 -1
  133. package/tests/unit/modeling/ai/DomainSerialization.spec.ts +1 -1
  134. package/tests/unit/modeling/ai/tools/DataDomain.tools.spec.ts +1 -1
  135. package/tests/unit/modeling/amf/shape_generator.spec.ts +1 -1
  136. package/tests/unit/modeling/api_model.spec.ts +8 -9
  137. package/tests/unit/modeling/api_model_expose_entity.spec.ts +1 -1
  138. package/tests/unit/modeling/api_model_remove_entity.spec.ts +1 -1
  139. package/tests/unit/modeling/data_domain.spec.ts +2 -1
  140. package/tests/unit/modeling/data_domain_change_observers.spec.ts +1 -1
  141. package/tests/unit/modeling/data_domain_serialization.spec.ts +2 -2
  142. package/tests/unit/modeling/definitions/phone.spec.ts +1 -1
  143. package/tests/unit/modeling/domain_asociation.spec.ts +34 -34
  144. package/tests/unit/modeling/domain_asociation_targets.spec.ts +1 -1
  145. package/tests/unit/modeling/domain_entity.spec.ts +3 -9
  146. package/tests/unit/modeling/domain_entity_associations.spec.ts +1 -1
  147. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +1 -1
  148. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1 -1
  149. package/tests/unit/modeling/domain_entity_fields.spec.ts +1 -1
  150. package/tests/unit/modeling/domain_entity_generators.spec.ts +1 -1
  151. package/tests/unit/modeling/domain_entity_parents.spec.ts +1 -1
  152. package/tests/unit/modeling/domain_entity_properties.spec.ts +2 -1
  153. package/tests/unit/modeling/domain_file.spec.ts +2 -1
  154. package/tests/unit/modeling/domain_impact_analysis.spec.ts +5 -3
  155. package/tests/unit/modeling/domain_model.spec.ts +3 -8
  156. package/tests/unit/modeling/domain_model_entities.spec.ts +2 -1
  157. package/tests/unit/modeling/domain_namespace.spec.ts +3 -9
  158. package/tests/unit/modeling/domain_namespace_models.spec.ts +1 -1
  159. package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +1 -1
  160. package/tests/unit/modeling/domain_property.spec.ts +3 -1
  161. package/tests/unit/modeling/domain_validation.spec.ts +1 -1
  162. package/tests/unit/modeling/domain_versioning.spec.ts +1 -1
  163. package/tests/unit/modeling/exposed_entity.spec.ts +1 -1
  164. package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
  165. package/tests/unit/modeling/generators/OasGenerator.spec.ts +1 -3
  166. package/tests/unit/modeling/helpers/intellisense.spec.ts +1 -1
  167. package/tests/unit/modeling/importers/json_schema_importer.spec.ts +1 -1
  168. package/tests/unit/modeling/validation/api_model_rules.spec.ts +12 -12
  169. package/tests/unit/modeling/validation/association_validation.spec.ts +1 -1
  170. package/tests/unit/modeling/validation/entity_validation.spec.ts +1 -1
  171. package/tests/unit/modeling/validation/property_validation.spec.ts +1 -1
  172. package/tests/unit/models/Certificate/from_name.spec.ts +2 -1
  173. package/tests/unit/models/File/addLabel.spec.ts +1 -1
  174. package/tests/unit/models/File/constructor.spec.ts +2 -1
  175. package/tests/unit/models/File/createFileCapabilities.spec.ts +1 -1
  176. package/tests/unit/models/File/new.spec.ts +2 -1
  177. package/tests/unit/models/File/setDeleted.spec.ts +1 -1
  178. package/tests/unit/models/File/setLastModified.spec.ts +1 -1
  179. package/tests/unit/models/File/shortcutTo.spec.ts +1 -1
  180. package/tests/unit/models/File/toJSON.spec.ts +2 -1
  181. package/tests/unit/models/File/updateByMeMeta.spec.ts +1 -1
  182. package/tests/unit/models/Folder/consume.spec.ts +2 -1
  183. package/tests/unit/models/Folder/create.spec.ts +2 -1
  184. package/tests/unit/models/Permission/all.spec.ts +1 -1
  185. package/tests/unit/models/Project/consume.spec.ts +1 -1
  186. package/tests/unit/models/Project/create.spec.ts +1 -1
  187. package/tests/unit/models/certificate.spec.ts +2 -7
  188. package/tests/unit/models/host_rule.spec.ts +1 -1
  189. package/tests/unit/models/http_project.spec.ts +1 -1
  190. package/tests/unit/models/http_request.spec.ts +2 -9
  191. package/tests/unit/models/http_response.spec.ts +2 -1
  192. package/tests/unit/models/license.spec.ts +1 -1
  193. package/tests/unit/models/response.spec.ts +2 -2
  194. package/tests/unit/models/store/CustomDomain.spec.ts +8 -8
  195. package/tests/unit/models/store/DeploymentCustomDomain.spec.ts +9 -9
  196. package/tests/unit/models/store/Invitation.spec.ts +1 -1
  197. package/tests/unit/runtime/http-engine/abort.spec.ts +2 -8
  198. package/tests/unit/runtime/http-engine/auth.spec.ts +2 -1
  199. package/tests/unit/runtime/http-engine/certificates.spec.ts +2 -1
  200. package/tests/unit/runtime/http-engine/cleanup.spec.ts +2 -1
  201. package/tests/unit/runtime/http-engine/compression.spec.ts +2 -1
  202. package/tests/unit/runtime/http-engine/core_engine.spec.ts +7 -11
  203. package/tests/unit/runtime/http-engine/events.spec.ts +2 -1
  204. package/tests/unit/runtime/http-engine/headers.spec.ts +2 -9
  205. package/tests/unit/runtime/http-engine/hosts.spec.ts +2 -1
  206. package/tests/unit/runtime/http-engine/http-get.spec.ts +2 -1
  207. package/tests/unit/runtime/http-engine/http-post.spec.ts +2 -9
  208. package/tests/unit/runtime/http-engine/logger.spec.ts +2 -1
  209. package/tests/unit/runtime/http-engine/message.spec.ts +2 -8
  210. package/tests/unit/runtime/http-engine/params.spec.ts +2 -10
  211. package/tests/unit/runtime/http-engine/proxy.spec.ts +2 -10
  212. package/tests/unit/runtime/http-engine/redirects.spec.ts +4 -6
  213. package/tests/unit/runtime/http-engine/request_utils.spec.ts +2 -1
  214. package/tests/unit/runtime/http-engine/responses.spec.ts +2 -10
  215. package/tests/unit/runtime/http-engine/timeout.spec.ts +2 -8
  216. package/tests/unit/runtime/http-engine/timings.spec.ts +2 -1
  217. package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +3 -8
  218. package/tests/unit/runtime/proxy/RequestProxy.spec.ts +6 -7
  219. package/tests/unit/runtime/reporters/project_run_cli_reporter.spec.ts +2 -7
  220. package/tests/unit/runtime/runners/http_assertion_runner.spec.ts +2 -2
  221. package/tests/unit/runtime/runners/http_flow_runner.spec.ts +2 -2
  222. package/tests/unit/runtime/runners/parallel_runner.spec.ts +2 -2
  223. package/tests/unit/runtime/runners/project_runner.spec.ts +2 -5
  224. package/tests/unit/runtime/runners/request_runner.spec.ts +2 -5
  225. package/tests/unit/runtime/runners/serial_runner.spec.ts +2 -3
  226. package/tests/unit/runtime/variables/variables_processor.spec.ts +2 -1
  227. package/tsconfig.browser.json +3 -4
  228. package/tsconfig.node.json +1 -3
  229. package/build/src/models/store/data_catalog.d.ts.map +0 -1
  230. package/build/src/models/store/data_catalog.js +0 -2
  231. package/build/src/models/store/data_catalog.js.map +0 -1
  232. /package/src/models/store/{data_catalog.ts → DataCatalog.ts} +0 -0
@@ -1,6 +1,8 @@
1
1
  import { test } from '@japa/runner'
2
- import { DataDomain, DomainPropertyKind, DomainProperty, Thing, DataFormat } from '../../../src/index.js'
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 }) => {
@@ -32,7 +32,7 @@ test.group('OasGenerator', (group) => {
32
32
  info: { name: 'email' },
33
33
  semantics: [{ id: SemanticType.Email }, { id: SemanticType.Username }],
34
34
  })
35
- const passwd = user.addProperty({
35
+ user.addProperty({
36
36
  type: 'string',
37
37
  required: true,
38
38
  info: { name: 'password' },
@@ -148,11 +148,9 @@ test.group('OasGenerator', (group) => {
148
148
  }
149
149
  api.authentication = {
150
150
  strategy: 'UsernamePassword',
151
- passwordKey: passwd.key,
152
151
  }
153
152
  api.authorization = {
154
153
  strategy: 'RBAC',
155
- roleKey: role.key,
156
154
  }
157
155
  api.pagination = { kind: 'cursor', defaultLimit: 50, maxLimit: 70 }
158
156
  const userExposure = api.exposeEntity({ key: user.key })
@@ -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/browser.js'
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' }
@@ -63,8 +63,8 @@ test.group('ApiModel Validation', () => {
63
63
 
64
64
  const model = new ApiModel(
65
65
  {
66
- authentication: { strategy: 'UsernamePassword', passwordKey: 'pass' } as UsernamePasswordConfiguration,
67
- authorization: { strategy: 'RBAC', roleKey: 'role' } as RolesBasedAccessControl,
66
+ authentication: { strategy: 'UsernamePassword' } as UsernamePasswordConfiguration,
67
+ authorization: { strategy: 'RBAC' } as RolesBasedAccessControl,
68
68
  session: {
69
69
  secret: 'super-secret',
70
70
  properties: ['id', 'role'],
@@ -91,8 +91,8 @@ test.group('ApiModel Validation', () => {
91
91
  const domain = new DataDomain({ info: { version: '1.0.0' } })
92
92
  const model = new ApiModel(
93
93
  {
94
- authentication: { strategy: 'UsernamePassword', passwordKey: 'pass' } as UsernamePasswordConfiguration,
95
- authorization: { strategy: 'RBAC', roleKey: 'role' } as RolesBasedAccessControl,
94
+ authentication: { strategy: 'UsernamePassword' } as UsernamePasswordConfiguration,
95
+ authorization: { strategy: 'RBAC' } as RolesBasedAccessControl,
96
96
  session: {
97
97
  secret: 'super-secret',
98
98
  properties: [],
@@ -126,8 +126,8 @@ test.group('ApiModel Validation', () => {
126
126
 
127
127
  const model = new ApiModel(
128
128
  {
129
- authentication: { strategy: 'UsernamePassword', passwordKey: 'pass' } as UsernamePasswordConfiguration,
130
- authorization: { strategy: 'RBAC', roleKey: 'role' } as RolesBasedAccessControl,
129
+ authentication: { strategy: 'UsernamePassword' } as UsernamePasswordConfiguration,
130
+ authorization: { strategy: 'RBAC' } as RolesBasedAccessControl,
131
131
  session: { secret: 'secret', properties: [] },
132
132
  user: { key: userEntity.key, domain: domain.key },
133
133
  },
@@ -148,8 +148,8 @@ test.group('ApiModel Validation', () => {
148
148
 
149
149
  const model = new ApiModel(
150
150
  {
151
- authentication: { strategy: 'UsernamePassword', passwordKey: 'pass' } as UsernamePasswordConfiguration,
152
- authorization: { strategy: 'RBAC', roleKey: 'role' } as RolesBasedAccessControl,
151
+ authentication: { strategy: 'UsernamePassword' } as UsernamePasswordConfiguration,
152
+ authorization: { strategy: 'RBAC' } as RolesBasedAccessControl,
153
153
  session: { secret: 'secret', properties: [] },
154
154
  user: { key: userEntity.key, domain: domain.key },
155
155
  },
@@ -170,8 +170,8 @@ test.group('ApiModel Validation', () => {
170
170
 
171
171
  const model = new ApiModel(
172
172
  {
173
- authentication: { strategy: 'UsernamePassword', passwordKey: 'pass' } as UsernamePasswordConfiguration,
174
- authorization: { strategy: 'RBAC', roleKey: 'role' } as RolesBasedAccessControl,
173
+ authentication: { strategy: 'UsernamePassword' } as UsernamePasswordConfiguration,
174
+ authorization: { strategy: 'RBAC' } as RolesBasedAccessControl,
175
175
  session: { secret: 'secret', properties: [] },
176
176
  user: { key: userEntity.key, domain: domain.key },
177
177
  },
@@ -397,8 +397,8 @@ test.group('ApiModel Validation', () => {
397
397
  const model = new ApiModel(
398
398
  {
399
399
  info: { name: 'Valid API', description: 'A test definition' },
400
- authentication: { strategy: 'UsernamePassword', passwordKey: 'pass' } as UsernamePasswordConfiguration,
401
- authorization: { strategy: 'RBAC', roleKey: 'role' } as RolesBasedAccessControl,
400
+ authentication: { strategy: 'UsernamePassword' } as UsernamePasswordConfiguration,
401
+ authorization: { strategy: 'RBAC' } as RolesBasedAccessControl,
402
402
  session: {
403
403
  secret: 'super-secret',
404
404
  properties: ['id', 'role'],
@@ -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, CertificateFileKind } from '../../../../src/index.js'
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,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { File } from '../../../../src/index.js'
2
+ import { File } from '../../../../src/models/index.js'
3
3
 
4
4
  test.group('File.addLabel()', () => {
5
5
  const label = 'test-label'
@@ -1,5 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import { File, ThingKind } from '../../../../src/index.js'
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, Project } from '../../../../src/index.js'
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, ThingKind, FileSchema } from '../../../../src/index.js'
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,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { File, UserSchema } from '../../../../src/index.js'
2
+ import { File, type UserSchema } from '../../../../src/models/index.js'
3
3
 
4
4
  test.group('File.setDeleted()', () => {
5
5
  const user: UserSchema = {
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { File, UserSchema } from '../../../../src/index.js'
2
+ import { File, type UserSchema } from '../../../../src/models/index.js'
3
3
 
4
4
  test.group('File.setLastModified()', () => {
5
5
  const user: UserSchema = {
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { File } from '../../../../src/index.js'
2
+ import { File } from '../../../../src/models/index.js'
3
3
 
4
4
  test.group('File.shortcutTo()', () => {
5
5
  test('sets the shortcutTarget property', ({ assert }) => {
@@ -1,5 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import { File, ThingKind, FileSchema } from '../../../../src/index.js'
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, FolderKind } from '../../../../src/index.js'
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, FolderKind, FolderSchema, ThingKind } from '../../../../src/index.js'
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 }) => {
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { Project, ProjectKind } from '../../../../src/index.js'
2
+ import { Project, ProjectKind } from '../../../../src/models/index.js'
3
3
 
4
4
  test.group('Project.toJSON()', () => {
5
5
  test('serializes the kind', ({ assert }) => {
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { HttpProject, IProject, Project, ProjectKind, ThingKind } from '../../../../src/index.js'
2
+ import { HttpProject, IProject, Project, ProjectKind, ThingKind } from '../../../../src/models/index.js'
3
3
 
4
4
  test.group('Project.fromProject()', () => {
5
5
  test('sets the kind', ({ assert }) => {
@@ -1,11 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import {
3
- Certificate,
4
- CertificateKind,
5
- IP12Certificate,
6
- IPemCertificate,
7
- Buffer as CoreBuffer,
8
- } from '../../../src/index.js'
2
+ import { Certificate, CertificateKind, IP12Certificate, IPemCertificate } from '../../../src/models/index.js'
3
+ import { Buffer as CoreBuffer } from '../../../src/index.js'
9
4
  import { fileToBuffer } from '../../../src/lib/Buffer.js'
10
5
 
11
6
  const { bufferToBase64 } = CoreBuffer
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { HostRule, HostRuleKind, IHostRule } from '../../../src/index.js'
2
+ import { HostRule, HostRuleKind, IHostRule } from '../../../src/models/index.js'
3
3
 
4
4
  test.group('Default project initialization', () => {
5
5
  test('initializes a default rule', ({ assert }) => {
@@ -14,7 +14,7 @@ import {
14
14
  ProviderKind,
15
15
  ServerKind,
16
16
  ThingKind,
17
- } from '../../../src/index.js'
17
+ } from '../../../src/models/index.js'
18
18
  import { ArcLegacyProject, ARCSavedRequest, LegacyMock } from '../../../src/legacy.js'
19
19
 
20
20
  const generator = new LegacyMock()
@@ -1,13 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import {
3
- HeadersArray,
4
- HttpRequest,
5
- HttpRequestKind,
6
- IHttpRequest,
7
- ISafePayload,
8
- PayloadSerializer,
9
- Property,
10
- } from '../../../src/index.js'
2
+ import { HeadersArray, HttpRequest, HttpRequestKind, IHttpRequest, Property } from '../../../src/models/index.js'
3
+ import { ISafePayload, PayloadSerializer } from '../../../src/index.js'
11
4
 
12
5
  test.group('Default request initialization', () => {
13
6
  test('initializes a default project', ({ assert }) => {
@@ -1,5 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import { HttpResponse, HttpResponseKind, IHttpResponse, ISafePayload, PayloadSerializer } from '../../../src/index.js'
2
+ import { HttpResponse, HttpResponseKind, IHttpResponse } from '../../../src/models/index.js'
3
+ import { ISafePayload, PayloadSerializer } from '../../../src/index.js'
3
4
 
4
5
  test.group('Default response initialization', () => {
5
6
  test('initializes a default project', ({ assert }) => {
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { ILicense, License, LicenseKind, Property } from '../../../src/index.js'
2
+ import { ILicense, License, LicenseKind, Property } from '../../../src/models/index.js'
3
3
 
4
4
  test.group('Default project initialization', () => {
5
5
  test('initializes a default rule', ({ assert }) => {
@@ -3,10 +3,10 @@ import {
3
3
  ErrorResponse,
4
4
  Response,
5
5
  IResponse,
6
- ISafePayload,
7
6
  ResponseAuthorizationKind,
8
7
  ResponseKind,
9
- } from '../../../src/index.js'
8
+ } from '../../../src/models/index.js'
9
+ import { ISafePayload } from '../../../src/index.js'
10
10
 
11
11
  test.group('Default response initialization', () => {
12
12
  test('initializes a default project', ({ assert }) => {
@@ -1,10 +1,10 @@
1
1
  import { test } from '@japa/runner'
2
- import { CustomDomainModel } from '../../../../src/models/store/CustomDomain.js'
2
+ import { CustomDomain } from '../../../../src/models/store/CustomDomain.js'
3
3
  import type { CustomDomainSchema } from '../../../../src/models/store/CustomDomain.js'
4
4
 
5
5
  test.group('CustomDomain model', () => {
6
6
  test('createSchema() returns default values', ({ assert }) => {
7
- const result = CustomDomainModel.createSchema()
7
+ const result = CustomDomain.createSchema()
8
8
  assert.isString(result.id)
9
9
  assert.equal(result.orgId, '')
10
10
  assert.equal(result.domain, '')
@@ -26,7 +26,7 @@ test.group('CustomDomain model', () => {
26
26
  createdAt: 12345,
27
27
  updatedAt: 67890,
28
28
  }
29
- const result = CustomDomainModel.createSchema(init)
29
+ const result = CustomDomain.createSchema(init)
30
30
  assert.equal(result.id, 'test-id')
31
31
  assert.equal(result.orgId, 'org-1')
32
32
  assert.equal(result.domain, 'api.example.com')
@@ -38,7 +38,7 @@ test.group('CustomDomain model', () => {
38
38
  })
39
39
 
40
40
  test('constructor() initializes with default values', ({ assert }) => {
41
- const model = new CustomDomainModel()
41
+ const model = new CustomDomain()
42
42
  assert.isString(model.id)
43
43
  assert.equal(model.orgId, '')
44
44
  assert.equal(model.domain, '')
@@ -55,7 +55,7 @@ test.group('CustomDomain model', () => {
55
55
  domain: 'api.example.com',
56
56
  dnsVerified: true,
57
57
  }
58
- const model = new CustomDomainModel(init)
58
+ const model = new CustomDomain(init)
59
59
  assert.equal(model.orgId, 'org-1')
60
60
  assert.equal(model.domain, 'api.example.com')
61
61
  assert.isTrue(model.dnsVerified)
@@ -72,7 +72,7 @@ test.group('CustomDomain model', () => {
72
72
  createdAt: 12345,
73
73
  updatedAt: 67890,
74
74
  }
75
- const model = new CustomDomainModel(init)
75
+ const model = new CustomDomain(init)
76
76
  const result = model.toJSON()
77
77
  assert.deepEqual(result, {
78
78
  id: 'test-id',
@@ -87,7 +87,7 @@ test.group('CustomDomain model', () => {
87
87
  })
88
88
 
89
89
  test('validate() returns errors for empty fields', ({ assert }) => {
90
- const model = new CustomDomainModel({
90
+ const model = new CustomDomain({
91
91
  domain: '',
92
92
  orgId: '',
93
93
  dnsTarget: '',
@@ -100,7 +100,7 @@ test.group('CustomDomain model', () => {
100
100
  })
101
101
 
102
102
  test('validate() returns no errors for valid model', ({ assert }) => {
103
- const model = new CustomDomainModel({
103
+ const model = new CustomDomain({
104
104
  domain: 'api.example.com',
105
105
  orgId: 'org-1',
106
106
  dnsTarget: 'target.example.com',
@@ -1,10 +1,10 @@
1
1
  import { test } from '@japa/runner'
2
- import { DeploymentCustomDomainModel, SslStatus } from '../../../../src/models/store/DeploymentCustomDomain.js'
2
+ import { DeploymentCustomDomain, SslStatus } from '../../../../src/models/store/DeploymentCustomDomain.js'
3
3
  import type { DeploymentCustomDomainSchema } from '../../../../src/models/store/DeploymentCustomDomain.js'
4
4
 
5
5
  test.group('DeploymentCustomDomain model', () => {
6
6
  test('createSchema() returns default values', ({ assert }) => {
7
- const result = DeploymentCustomDomainModel.createSchema()
7
+ const result = DeploymentCustomDomain.createSchema()
8
8
  assert.isString(result.id)
9
9
  assert.equal(result.deploymentId, '')
10
10
  assert.equal(result.customDomainId, '')
@@ -24,7 +24,7 @@ test.group('DeploymentCustomDomain model', () => {
24
24
  createdAt: 12345,
25
25
  updatedAt: 67890,
26
26
  }
27
- const result = DeploymentCustomDomainModel.createSchema(init)
27
+ const result = DeploymentCustomDomain.createSchema(init)
28
28
  assert.equal(result.id, 'test-id')
29
29
  assert.equal(result.deploymentId, 'dep-1')
30
30
  assert.equal(result.customDomainId, 'dom-1')
@@ -35,7 +35,7 @@ test.group('DeploymentCustomDomain model', () => {
35
35
  })
36
36
 
37
37
  test('constructor() initializes with default values', ({ assert }) => {
38
- const model = new DeploymentCustomDomainModel()
38
+ const model = new DeploymentCustomDomain()
39
39
  assert.isString(model.id)
40
40
  assert.equal(model.deploymentId, '')
41
41
  assert.equal(model.customDomainId, '')
@@ -51,7 +51,7 @@ test.group('DeploymentCustomDomain model', () => {
51
51
  customDomainId: 'dom-1',
52
52
  basePath: '/api',
53
53
  }
54
- const model = new DeploymentCustomDomainModel(init)
54
+ const model = new DeploymentCustomDomain(init)
55
55
  assert.equal(model.deploymentId, 'dep-1')
56
56
  assert.equal(model.customDomainId, 'dom-1')
57
57
  assert.equal(model.basePath, '/api')
@@ -67,7 +67,7 @@ test.group('DeploymentCustomDomain model', () => {
67
67
  createdAt: 12345,
68
68
  updatedAt: 67890,
69
69
  }
70
- const model = new DeploymentCustomDomainModel(init)
70
+ const model = new DeploymentCustomDomain(init)
71
71
  const result = model.toJSON()
72
72
  assert.deepEqual(result, {
73
73
  id: 'test-id',
@@ -81,7 +81,7 @@ test.group('DeploymentCustomDomain model', () => {
81
81
  })
82
82
 
83
83
  test('validate() returns errors for empty and invalid fields', ({ assert }) => {
84
- const model = new DeploymentCustomDomainModel({
84
+ const model = new DeploymentCustomDomain({
85
85
  basePath: '',
86
86
  deploymentId: '',
87
87
  customDomainId: '',
@@ -96,7 +96,7 @@ test.group('DeploymentCustomDomain model', () => {
96
96
  rule: 'notEmpty',
97
97
  })
98
98
 
99
- const modelInvalidPath = new DeploymentCustomDomainModel({
99
+ const modelInvalidPath = new DeploymentCustomDomain({
100
100
  basePath: 'api/path',
101
101
  deploymentId: 'dep-1',
102
102
  customDomainId: 'dom-1',
@@ -111,7 +111,7 @@ test.group('DeploymentCustomDomain model', () => {
111
111
  })
112
112
 
113
113
  test('validate() returns no errors for valid model', ({ assert }) => {
114
- const model = new DeploymentCustomDomainModel({
114
+ const model = new DeploymentCustomDomain({
115
115
  deploymentId: 'dep-1',
116
116
  customDomainId: 'dom-1',
117
117
  basePath: '/api',
@@ -1,5 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import { Invitation, InvitationKind, type InvitationSchema, type DeletionSchema } from '../../../../src/index.js'
2
+ import { Invitation, InvitationKind, type InvitationSchema, type DeletionSchema } from '../../../../src/models/index.js'
3
3
  import { OperationType } from '@api-client/json/patch/types.js'
4
4
 
5
5
  const baseInput: Partial<InvitationSchema> = {
@@ -1,13 +1,7 @@
1
1
  import { test } from '@japa/runner'
2
2
  import net from 'net'
3
- import {
4
- createLogger,
5
- CoreEngine,
6
- IHttpRequest,
7
- HttpEngineOptions,
8
- IErrorResponse,
9
- ISerializedError,
10
- } from '../../../../src/index.js'
3
+ import { createLogger, CoreEngine, HttpEngineOptions } from '../../../../src/index.js'
4
+ import { IErrorResponse, IHttpRequest, ISerializedError } from '../../../../src/models/index.js'
11
5
 
12
6
  const logger = createLogger()
13
7
 
@@ -1,5 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import { CoreEngine, createLogger, IResponse, Response, RequestAuthorizationKind } from '../../../../src/index.js'
2
+ import { CoreEngine, createLogger } from '../../../../src/index.js'
3
+ import { IResponse, Response, RequestAuthorizationKind } from '../../../../src/models/index.js'
3
4
 
4
5
  const logger = createLogger()
5
6
 
@@ -1,6 +1,7 @@
1
1
  import { test } from '@japa/runner'
2
2
  import fs from 'fs'
3
- import { IResponse, Response, CoreEngine, HttpCertificate, createLogger } from '../../../../src/index.js'
3
+ import { CoreEngine, createLogger } from '../../../../src/index.js'
4
+ import { HttpCertificate, IResponse, Response } from '../../../../src/models/index.js'
4
5
 
5
6
  const logger = createLogger()
6
7
 
@@ -1,5 +1,6 @@
1
1
  import { test } from '@japa/runner'
2
- import { Response, CoreEngine, IHttpRequest, Headers, ResponseRedirect } from '../../../../src/index.js'
2
+ import { CoreEngine, Headers } from '../../../../src/index.js'
3
+ import { IHttpRequest, Response, ResponseRedirect } from '../../../../src/models/index.js'
3
4
 
4
5
  test.group('Cleaning up', (group) => {
5
6
  let request: IHttpRequest
@@ -1,6 +1,7 @@
1
1
  import { test } from '@japa/runner'
2
2
  import zlib from 'zlib'
3
- import { IResponse, Response, createLogger, CoreEngine, IHttpRequest, Headers } from '../../../../src/index.js'
3
+ import { CoreEngine, createLogger, Headers } from '../../../../src/index.js'
4
+ import { IHttpRequest, IResponse, Response } from '../../../../src/models/index.js'
4
5
 
5
6
  const logger = createLogger()
6
7
 
@@ -1,20 +1,16 @@
1
1
  import { test } from '@japa/runner'
2
+ import { CoreEngine, HttpEngineOptions, Headers, PayloadSerializer, createLogger } from '../../../../src/index.js'
3
+ import { HttpEngineErrorFactory } from '../../../../src/runtime/http-engine/errors/index.js'
4
+ import { MessageBuilder } from '../../../../src/runtime/http-engine/message/index.js'
5
+ import { AuthManager } from '../../../../src/runtime/http-engine/auth/index.js'
6
+ import { ConnectionManager } from '../../../../src/runtime/http-engine/connections/index.js'
2
7
  import {
8
+ IHttpRequest,
3
9
  IResponse,
4
10
  Response,
5
- IHttpRequest,
6
11
  RequestTime,
7
- CoreEngine,
8
- HttpEngineOptions,
9
- Headers,
10
- PayloadSerializer,
11
12
  RequestAuthorizationKind,
12
- createLogger,
13
- } from '../../../../src/index.js'
14
- import { HttpEngineErrorFactory } from '../../../../src/runtime/http-engine/errors/index.js'
15
- import { MessageBuilder } from '../../../../src/runtime/http-engine/message/index.js'
16
- import { AuthManager } from '../../../../src/runtime/http-engine/auth/index.js'
17
- import { ConnectionManager } from '../../../../src/runtime/http-engine/connections/index.js'
13
+ } from '../../../../src/models/index.js'
18
14
 
19
15
  const logger = createLogger()
20
16