@api-client/core 0.14.10 → 0.15.0
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/RELEASE.md +163 -0
- package/RELEASE_SETUP.md +235 -0
- package/build/src/events/authorization/AuthorizationEvents.d.ts +1 -1
- package/build/src/events/authorization/AuthorizationEvents.d.ts.map +1 -1
- package/build/src/events/authorization/AuthorizationEvents.js +1 -1
- package/build/src/events/authorization/AuthorizationEvents.js.map +1 -1
- package/build/src/events/cookies/CookieEvents.d.ts +1 -1
- package/build/src/events/cookies/CookieEvents.d.ts.map +1 -1
- package/build/src/events/cookies/CookieEvents.js +1 -1
- package/build/src/events/cookies/CookieEvents.js.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.d.ts +22 -119
- package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.js +49 -155
- package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
- package/build/src/modeling/DomainValidation.d.ts +8 -0
- package/build/src/modeling/DomainValidation.d.ts.map +1 -0
- package/build/src/modeling/DomainValidation.js +99 -0
- package/build/src/modeling/DomainValidation.js.map +1 -0
- package/build/src/modeling/types.d.ts +70 -0
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/modeling/validation/rules.d.ts +2 -3
- package/build/src/modeling/validation/rules.d.ts.map +1 -1
- package/build/src/modeling/validation/rules.js.map +1 -1
- package/build/src/modeling/validation/semantic_validation.d.ts +31 -0
- package/build/src/modeling/validation/semantic_validation.d.ts.map +1 -0
- package/build/src/modeling/validation/semantic_validation.js +126 -0
- package/build/src/modeling/validation/semantic_validation.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/noop.ts +3 -0
- package/package.json +9 -4
- package/src/events/authorization/AuthorizationEvents.ts +1 -1
- package/src/events/cookies/CookieEvents.ts +1 -1
- package/src/modeling/DomainImpactAnalysis.ts +54 -239
- package/src/modeling/DomainValidation.ts +105 -0
- package/src/modeling/types.ts +86 -0
- package/src/modeling/validation/rules.ts +2 -4
- package/src/modeling/validation/semantic_validation.ts +145 -0
- package/tests/unit/events/EventsTestHelpers.ts +16 -0
- package/tests/unit/events/amf.spec.ts +151 -0
- package/tests/unit/events/authorization.spec.ts +150 -0
- package/tests/unit/events/cookie.spec.ts +274 -0
- package/tests/unit/events/encryption.spec.ts +108 -0
- package/tests/unit/events/events_polyfills.ts +77 -0
- package/tests/unit/events/process.spec.ts +120 -0
- package/tests/unit/events/reporting.spec.ts +82 -0
- package/tests/unit/events/telemetry.spec.ts +224 -0
- package/tests/unit/events/transport.spec.ts +139 -0
- package/tests/unit/modeling/domain_impact_analysis.spec.ts +0 -110
- package/tests/unit/modeling/domain_validation.spec.ts +94 -0
- package/tests/unit/modeling/validation/semantic_validation.spec.ts +91 -0
- package/tests/unit/models/environment.spec.ts +574 -0
- package/tests/unit/models/error_response.spec.ts +183 -0
- package/tests/unit/models/headers_array.spec.ts +86 -0
- package/tests/unit/models/http-actions/assertion/equal_assertion.spec.ts +103 -0
- package/tests/unit/models/http-actions/assertion/greater_than_assertion.spec.ts +91 -0
- package/tests/unit/models/http-actions/assertion/includes_assertion.spec.ts +71 -0
- package/tests/unit/models/http-actions/assertion/less_than_assertion.spec.ts +91 -0
- package/tests/unit/models/http-actions/assertion/matches_assertion.spec.ts +71 -0
- package/tests/unit/models/http-actions/assertion/matches_schema_assertion.spec.ts +117 -0
- package/tests/unit/models/http-actions/assertion/not_equal_assertion.spec.ts +103 -0
- package/tests/unit/models/http-actions/assertion/not_includes_assertion.spec.ts +71 -0
- package/tests/unit/models/http-actions/assertion/not_ok_assertion.spec.ts +47 -0
- package/tests/unit/models/http-actions/assertion/not_to_be_assertion.spec.ts +72 -0
- package/tests/unit/models/http-actions/assertion/ok_assertion.spec.ts +44 -0
- package/tests/unit/models/http-actions/assertion/to_be_assertion.spec.ts +71 -0
- package/tests/unit/models/http-actions/transformation/as_lower_case_step.spec.ts +47 -0
- package/tests/unit/models/http-actions/transformation/as_number_step.spec.ts +47 -0
- package/tests/unit/models/http-actions/transformation/as_upper_case_step.spec.ts +47 -0
- package/tests/unit/models/http-actions/transformation/round_step.spec.ts +69 -0
- package/tests/unit/models/http-actions/transformation/substring_step.spec.ts +85 -0
- package/tests/unit/models/http-actions/transformation/trim_step.spec.ts +44 -0
- package/tests/unit/models/http_cookie.spec.ts +516 -0
- package/tests/unit/models/http_history.spec.ts +443 -0
- package/tests/unit/models/project_folder.spec.ts +926 -0
- package/tests/unit/models/project_item.spec.ts +137 -0
- package/tests/unit/models/project_request.spec.ts +1047 -0
- package/tests/unit/models/project_schema.spec.ts +236 -0
- package/tests/unit/models/property.spec.ts +625 -0
- package/tests/unit/models/provider.spec.ts +102 -0
- package/tests/unit/models/request.spec.ts +1206 -0
- package/tests/unit/models/request_log.spec.ts +308 -0
- package/tests/unit/models/request_time.spec.ts +138 -0
- package/tests/unit/models/response_redirect.spec.ts +303 -0
- package/tests/unit/models/sent_request.spec.ts +206 -0
- package/tests/unit/models/server.spec.ts +195 -0
- package/tests/unit/models/thing.spec.ts +154 -0
- package/build/oauth-popup.html +0 -33
- /package/tests/unit/models/{Certificate.spec.ts → certificate.spec.ts} +0 -0
- /package/tests/unit/models/{HostRule.spec.ts → host_rule.spec.ts} +0 -0
- /package/tests/unit/models/{HttpProject.spec.ts → http_project.spec.ts} +0 -0
- /package/tests/unit/models/{HttpRequest.spec.ts → http_request.spec.ts} +0 -0
- /package/tests/unit/models/{HttpResponse.spec.ts → http_response.spec.ts} +0 -0
- /package/tests/unit/models/{License.spec.ts → license.spec.ts} +0 -0
- /package/tests/unit/models/{Response.spec.ts → response.spec.ts} +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { test } from '@japa/runner'
|
|
2
|
+
import { Provider, IProvider, Kind as ProviderKind } from '../../../src/models/Provider.js'
|
|
3
|
+
|
|
4
|
+
test.group('Models > Provider > constructor()', () => {
|
|
5
|
+
test('creates a default instance', ({ assert }) => {
|
|
6
|
+
const result = new Provider()
|
|
7
|
+
assert.equal(result.kind, ProviderKind)
|
|
8
|
+
assert.isUndefined(result.url)
|
|
9
|
+
assert.isUndefined(result.name)
|
|
10
|
+
assert.isUndefined(result.email)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('creates an instance from a schema', ({ assert }) => {
|
|
14
|
+
const init: IProvider = {
|
|
15
|
+
kind: ProviderKind,
|
|
16
|
+
name: 'test name',
|
|
17
|
+
url: 'https://dot.com',
|
|
18
|
+
email: 'a@b.c',
|
|
19
|
+
}
|
|
20
|
+
const result = new Provider(init)
|
|
21
|
+
assert.equal(result.kind, ProviderKind)
|
|
22
|
+
assert.equal(result.url, init.url)
|
|
23
|
+
assert.equal(result.name, init.name)
|
|
24
|
+
assert.equal(result.email, init.email)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
test('creates an instance from a JSON schema string', ({ assert }) => {
|
|
28
|
+
const init: IProvider = {
|
|
29
|
+
kind: ProviderKind,
|
|
30
|
+
name: 'test name',
|
|
31
|
+
url: 'https://dot.com',
|
|
32
|
+
email: 'a@b.c',
|
|
33
|
+
}
|
|
34
|
+
const result = new Provider(JSON.stringify(init))
|
|
35
|
+
assert.equal(result.kind, ProviderKind)
|
|
36
|
+
assert.equal(result.url, init.url)
|
|
37
|
+
assert.equal(result.name, init.name)
|
|
38
|
+
assert.equal(result.email, init.email)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
test.group('Models > Provider > new()', (group) => {
|
|
43
|
+
let instance: Provider
|
|
44
|
+
group.each.setup(() => {
|
|
45
|
+
instance = new Provider()
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test('throws when invalid schema', ({ assert }) => {
|
|
49
|
+
assert.throws(() => {
|
|
50
|
+
// @ts-expect-error Used in testing
|
|
51
|
+
instance.new({})
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
test('sets the URL', ({ assert }) => {
|
|
56
|
+
const schema = instance.toJSON()
|
|
57
|
+
schema.url = 'https://dot.com'
|
|
58
|
+
instance.new(schema)
|
|
59
|
+
assert.equal(instance.url, 'https://dot.com')
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
test('sets the name', ({ assert }) => {
|
|
63
|
+
const schema = instance.toJSON()
|
|
64
|
+
schema.name = 'test name'
|
|
65
|
+
instance.new(schema)
|
|
66
|
+
assert.equal(instance.name, 'test name')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
test('sets the email', ({ assert }) => {
|
|
70
|
+
const schema = instance.toJSON()
|
|
71
|
+
schema.email = 'a@b.c'
|
|
72
|
+
instance.new(schema)
|
|
73
|
+
assert.equal(instance.email, 'a@b.c')
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
test.group('Models > Provider > toJSON()', (group) => {
|
|
78
|
+
let instance: Provider
|
|
79
|
+
group.each.setup(() => {
|
|
80
|
+
instance = new Provider()
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const properties: (keyof IProvider)[] = ['url', 'name', 'email']
|
|
84
|
+
|
|
85
|
+
test('serializes the kind', ({ assert }) => {
|
|
86
|
+
const result = instance.toJSON()
|
|
87
|
+
assert.equal(result.kind, ProviderKind)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
properties.forEach((prop) => {
|
|
91
|
+
test(`does not serialize the ${prop} when missing`, ({ assert }) => {
|
|
92
|
+
const result = instance.toJSON()
|
|
93
|
+
assert.isUndefined(result[prop])
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
test(`serializes the ${prop}`, ({ assert }) => {
|
|
97
|
+
instance[prop] = `test ${prop}`
|
|
98
|
+
const result = instance.toJSON()
|
|
99
|
+
assert.equal(result[prop], `test ${prop}`)
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|