@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.
- package/build/src/modeling/ApiModel.d.ts.map +1 -1
- package/build/src/modeling/ApiModel.js +0 -8
- package/build/src/modeling/ApiModel.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts +4 -4
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/RuntimeApiModel.d.ts +16 -0
- package/build/src/modeling/RuntimeApiModel.d.ts.map +1 -1
- package/build/src/modeling/RuntimeApiModel.js +31 -0
- package/build/src/modeling/RuntimeApiModel.js.map +1 -1
- package/build/src/modeling/ai/domain_response_schema.d.ts +4 -2
- package/build/src/modeling/ai/domain_response_schema.d.ts.map +1 -1
- package/build/src/modeling/ai/domain_response_schema.js +1 -1
- package/build/src/modeling/ai/domain_response_schema.js.map +1 -1
- package/build/src/modeling/ai/types.d.ts +2 -3
- package/build/src/modeling/ai/types.d.ts.map +1 -1
- package/build/src/modeling/ai/types.js.map +1 -1
- package/build/src/modeling/amf/ShapeGenerator.js +1 -1
- package/build/src/modeling/amf/ShapeGenerator.js.map +1 -1
- package/build/src/modeling/generators/oas_312/OasGenerator.js +1 -1
- package/build/src/modeling/generators/oas_312/OasGenerator.js.map +1 -1
- package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js +3 -3
- package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js.map +1 -1
- package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js +3 -3
- package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js.map +1 -1
- package/build/src/modeling/types.d.ts +55 -15
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -1
- package/build/src/modeling/validation/api_model_rules.js +49 -46
- package/build/src/modeling/validation/api_model_rules.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/modeling/ApiModel.ts +0 -10
- package/src/modeling/DomainAssociation.ts +4 -4
- package/src/modeling/RuntimeApiModel.ts +46 -0
- package/src/modeling/ai/domain_response_schema.ts +1 -1
- package/src/modeling/ai/types.ts +2 -3
- package/src/modeling/amf/ShapeGenerator.ts +1 -1
- package/src/modeling/generators/oas_312/OasGenerator.ts +1 -1
- package/src/modeling/generators/oas_312/OasSchemaGenerator.ts +3 -3
- package/src/modeling/generators/oas_320/OasSchemaGenerator.ts +3 -3
- package/src/modeling/readme.md +2 -2
- package/src/modeling/types.ts +56 -15
- package/src/modeling/validation/api_model_rules.ts +50 -48
- package/src/modeling/validation/api_model_validation_rules.md +2 -2
- package/tests/unit/modeling/RuntimeApiModel.spec.ts +31 -0
- package/tests/unit/modeling/amf/shape_generator.spec.ts +32 -14
- package/tests/unit/modeling/api_model.spec.ts +6 -6
- package/tests/unit/modeling/data_domain_change_observers.spec.ts +1 -1
- package/tests/unit/modeling/domain_asociation.spec.ts +18 -18
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +68 -23
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +32 -9
- package/tests/unit/modeling/generators/OasGenerator.spec.ts +3 -5
- 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
|
-
|
|
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: {
|
|
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'
|
|
67
|
-
authorization: { strategy: 'RBAC'
|
|
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'
|
|
95
|
-
authorization: { strategy: 'RBAC'
|
|
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'
|
|
130
|
-
authorization: { strategy: 'RBAC'
|
|
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'
|
|
152
|
-
authorization: { strategy: 'RBAC'
|
|
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'
|
|
174
|
-
authorization: { strategy: 'RBAC'
|
|
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'
|
|
401
|
-
authorization: { strategy: 'RBAC'
|
|
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'],
|