@api-client/core 0.19.30 → 0.19.32

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 (55) hide show
  1. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  2. package/build/src/modeling/ApiModel.js +0 -8
  3. package/build/src/modeling/ApiModel.js.map +1 -1
  4. package/build/src/modeling/DomainAssociation.d.ts +4 -4
  5. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  6. package/build/src/modeling/DomainAssociation.js.map +1 -1
  7. package/build/src/modeling/RuntimeApiModel.d.ts +16 -0
  8. package/build/src/modeling/RuntimeApiModel.d.ts.map +1 -1
  9. package/build/src/modeling/RuntimeApiModel.js +31 -0
  10. package/build/src/modeling/RuntimeApiModel.js.map +1 -1
  11. package/build/src/modeling/ai/domain_response_schema.d.ts +4 -2
  12. package/build/src/modeling/ai/domain_response_schema.d.ts.map +1 -1
  13. package/build/src/modeling/ai/domain_response_schema.js +1 -1
  14. package/build/src/modeling/ai/domain_response_schema.js.map +1 -1
  15. package/build/src/modeling/ai/types.d.ts +2 -3
  16. package/build/src/modeling/ai/types.d.ts.map +1 -1
  17. package/build/src/modeling/ai/types.js.map +1 -1
  18. package/build/src/modeling/amf/ShapeGenerator.js +1 -1
  19. package/build/src/modeling/amf/ShapeGenerator.js.map +1 -1
  20. package/build/src/modeling/generators/oas_312/OasGenerator.js +1 -1
  21. package/build/src/modeling/generators/oas_312/OasGenerator.js.map +1 -1
  22. package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js +3 -3
  23. package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js.map +1 -1
  24. package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js +3 -3
  25. package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js.map +1 -1
  26. package/build/src/modeling/types.d.ts +55 -15
  27. package/build/src/modeling/types.d.ts.map +1 -1
  28. package/build/src/modeling/types.js.map +1 -1
  29. package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -1
  30. package/build/src/modeling/validation/api_model_rules.js +49 -46
  31. package/build/src/modeling/validation/api_model_rules.js.map +1 -1
  32. package/build/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +1 -1
  34. package/src/modeling/ApiModel.ts +0 -10
  35. package/src/modeling/DomainAssociation.ts +4 -4
  36. package/src/modeling/RuntimeApiModel.ts +46 -0
  37. package/src/modeling/ai/domain_response_schema.ts +1 -1
  38. package/src/modeling/ai/types.ts +2 -3
  39. package/src/modeling/amf/ShapeGenerator.ts +1 -1
  40. package/src/modeling/generators/oas_312/OasGenerator.ts +1 -1
  41. package/src/modeling/generators/oas_312/OasSchemaGenerator.ts +3 -3
  42. package/src/modeling/generators/oas_320/OasSchemaGenerator.ts +3 -3
  43. package/src/modeling/readme.md +2 -2
  44. package/src/modeling/types.ts +56 -15
  45. package/src/modeling/validation/api_model_rules.ts +50 -48
  46. package/src/modeling/validation/api_model_validation_rules.md +2 -2
  47. package/tests/unit/modeling/RuntimeApiModel.spec.ts +31 -0
  48. package/tests/unit/modeling/amf/shape_generator.spec.ts +32 -14
  49. package/tests/unit/modeling/api_model.spec.ts +6 -6
  50. package/tests/unit/modeling/data_domain_change_observers.spec.ts +1 -1
  51. package/tests/unit/modeling/domain_asociation.spec.ts +18 -18
  52. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +68 -23
  53. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +32 -9
  54. package/tests/unit/modeling/generators/OasGenerator.spec.ts +3 -5
  55. package/tests/unit/modeling/validation/api_model_rules.spec.ts +12 -12
@@ -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' },
@@ -113,7 +113,7 @@ test.group('OasGenerator', (group) => {
113
113
  info: { name: 'author' },
114
114
  targets: [{ key: user.key }],
115
115
  multiple: false,
116
- schema: { linked: true },
116
+ schema: { embedded: false },
117
117
  semantics: [{ id: SemanticType.ResourceOwnerIdentifier }],
118
118
  })
119
119
 
@@ -127,7 +127,7 @@ test.group('OasGenerator', (group) => {
127
127
  name: 'API Admin',
128
128
  url: 'https://api.com',
129
129
  }
130
- api.accessRule = [new AllowAuthenticatedAccessRule()]
130
+ api.accessRule = [new AllowAuthenticatedAccessRule(api)]
131
131
  api.session = {
132
132
  properties: [email.key],
133
133
  secret: 'test-secret',
@@ -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 })
@@ -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'],