@api-client/core 0.14.10 → 0.15.1

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 (95) hide show
  1. package/RELEASE.md +163 -0
  2. package/RELEASE_SETUP.md +235 -0
  3. package/build/src/events/authorization/AuthorizationEvents.d.ts +1 -1
  4. package/build/src/events/authorization/AuthorizationEvents.d.ts.map +1 -1
  5. package/build/src/events/authorization/AuthorizationEvents.js +1 -1
  6. package/build/src/events/authorization/AuthorizationEvents.js.map +1 -1
  7. package/build/src/events/cookies/CookieEvents.d.ts +1 -1
  8. package/build/src/events/cookies/CookieEvents.d.ts.map +1 -1
  9. package/build/src/events/cookies/CookieEvents.js +1 -1
  10. package/build/src/events/cookies/CookieEvents.js.map +1 -1
  11. package/build/src/modeling/DomainImpactAnalysis.d.ts +22 -119
  12. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  13. package/build/src/modeling/DomainImpactAnalysis.js +49 -155
  14. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  15. package/build/src/modeling/DomainValidation.d.ts +8 -0
  16. package/build/src/modeling/DomainValidation.d.ts.map +1 -0
  17. package/build/src/modeling/DomainValidation.js +99 -0
  18. package/build/src/modeling/DomainValidation.js.map +1 -0
  19. package/build/src/modeling/types.d.ts +70 -0
  20. package/build/src/modeling/types.d.ts.map +1 -1
  21. package/build/src/modeling/types.js.map +1 -1
  22. package/build/src/modeling/validation/rules.d.ts +2 -3
  23. package/build/src/modeling/validation/rules.d.ts.map +1 -1
  24. package/build/src/modeling/validation/rules.js.map +1 -1
  25. package/build/src/modeling/validation/semantic_validation.d.ts +31 -0
  26. package/build/src/modeling/validation/semantic_validation.d.ts.map +1 -0
  27. package/build/src/modeling/validation/semantic_validation.js +126 -0
  28. package/build/src/modeling/validation/semantic_validation.js.map +1 -0
  29. package/build/tsconfig.tsbuildinfo +1 -1
  30. package/noop.ts +3 -0
  31. package/package.json +9 -4
  32. package/src/events/authorization/AuthorizationEvents.ts +1 -1
  33. package/src/events/cookies/CookieEvents.ts +1 -1
  34. package/src/modeling/DomainImpactAnalysis.ts +54 -239
  35. package/src/modeling/DomainValidation.ts +105 -0
  36. package/src/modeling/types.ts +86 -0
  37. package/src/modeling/validation/rules.ts +2 -4
  38. package/src/modeling/validation/semantic_validation.ts +145 -0
  39. package/tests/unit/events/EventsTestHelpers.ts +16 -0
  40. package/tests/unit/events/amf.spec.ts +151 -0
  41. package/tests/unit/events/authorization.spec.ts +150 -0
  42. package/tests/unit/events/cookie.spec.ts +274 -0
  43. package/tests/unit/events/encryption.spec.ts +108 -0
  44. package/tests/unit/events/events_polyfills.ts +77 -0
  45. package/tests/unit/events/process.spec.ts +120 -0
  46. package/tests/unit/events/reporting.spec.ts +82 -0
  47. package/tests/unit/events/telemetry.spec.ts +224 -0
  48. package/tests/unit/events/transport.spec.ts +139 -0
  49. package/tests/unit/modeling/domain_impact_analysis.spec.ts +0 -110
  50. package/tests/unit/modeling/domain_validation.spec.ts +94 -0
  51. package/tests/unit/modeling/validation/semantic_validation.spec.ts +91 -0
  52. package/tests/unit/models/environment.spec.ts +574 -0
  53. package/tests/unit/models/error_response.spec.ts +183 -0
  54. package/tests/unit/models/headers_array.spec.ts +86 -0
  55. package/tests/unit/models/http-actions/assertion/equal_assertion.spec.ts +103 -0
  56. package/tests/unit/models/http-actions/assertion/greater_than_assertion.spec.ts +91 -0
  57. package/tests/unit/models/http-actions/assertion/includes_assertion.spec.ts +71 -0
  58. package/tests/unit/models/http-actions/assertion/less_than_assertion.spec.ts +91 -0
  59. package/tests/unit/models/http-actions/assertion/matches_assertion.spec.ts +71 -0
  60. package/tests/unit/models/http-actions/assertion/matches_schema_assertion.spec.ts +117 -0
  61. package/tests/unit/models/http-actions/assertion/not_equal_assertion.spec.ts +103 -0
  62. package/tests/unit/models/http-actions/assertion/not_includes_assertion.spec.ts +71 -0
  63. package/tests/unit/models/http-actions/assertion/not_ok_assertion.spec.ts +47 -0
  64. package/tests/unit/models/http-actions/assertion/not_to_be_assertion.spec.ts +72 -0
  65. package/tests/unit/models/http-actions/assertion/ok_assertion.spec.ts +44 -0
  66. package/tests/unit/models/http-actions/assertion/to_be_assertion.spec.ts +71 -0
  67. package/tests/unit/models/http-actions/transformation/as_lower_case_step.spec.ts +47 -0
  68. package/tests/unit/models/http-actions/transformation/as_number_step.spec.ts +47 -0
  69. package/tests/unit/models/http-actions/transformation/as_upper_case_step.spec.ts +47 -0
  70. package/tests/unit/models/http-actions/transformation/round_step.spec.ts +69 -0
  71. package/tests/unit/models/http-actions/transformation/substring_step.spec.ts +85 -0
  72. package/tests/unit/models/http-actions/transformation/trim_step.spec.ts +44 -0
  73. package/tests/unit/models/http_cookie.spec.ts +516 -0
  74. package/tests/unit/models/http_history.spec.ts +443 -0
  75. package/tests/unit/models/project_folder.spec.ts +926 -0
  76. package/tests/unit/models/project_item.spec.ts +137 -0
  77. package/tests/unit/models/project_request.spec.ts +1047 -0
  78. package/tests/unit/models/project_schema.spec.ts +236 -0
  79. package/tests/unit/models/property.spec.ts +625 -0
  80. package/tests/unit/models/provider.spec.ts +102 -0
  81. package/tests/unit/models/request.spec.ts +1206 -0
  82. package/tests/unit/models/request_log.spec.ts +308 -0
  83. package/tests/unit/models/request_time.spec.ts +138 -0
  84. package/tests/unit/models/response_redirect.spec.ts +303 -0
  85. package/tests/unit/models/sent_request.spec.ts +206 -0
  86. package/tests/unit/models/server.spec.ts +195 -0
  87. package/tests/unit/models/thing.spec.ts +154 -0
  88. package/build/oauth-popup.html +0 -33
  89. /package/tests/unit/models/{Certificate.spec.ts → certificate.spec.ts} +0 -0
  90. /package/tests/unit/models/{HostRule.spec.ts → host_rule.spec.ts} +0 -0
  91. /package/tests/unit/models/{HttpProject.spec.ts → http_project.spec.ts} +0 -0
  92. /package/tests/unit/models/{HttpRequest.spec.ts → http_request.spec.ts} +0 -0
  93. /package/tests/unit/models/{HttpResponse.spec.ts → http_response.spec.ts} +0 -0
  94. /package/tests/unit/models/{License.spec.ts → license.spec.ts} +0 -0
  95. /package/tests/unit/models/{Response.spec.ts → response.spec.ts} +0 -0
@@ -0,0 +1,154 @@
1
+ import { test } from '@japa/runner'
2
+ import { ThingKind } from '../../../src/models/kinds.js'
3
+ import { Thing, IThing } from '../../../src/models/Thing.js'
4
+
5
+ test.group('Models > Thing > Thing.fromName()', () => {
6
+ test('sets the kind', ({ assert }) => {
7
+ const result = Thing.fromName('a name')
8
+ assert.equal(result.kind, ThingKind)
9
+ })
10
+
11
+ test('sets the name', ({ assert }) => {
12
+ const result = Thing.fromName('a name')
13
+ assert.equal(result.name, 'a name')
14
+ })
15
+
16
+ test('ignores other properties', ({ assert }) => {
17
+ const result = Thing.fromName('a name')
18
+ assert.isUndefined(result.description)
19
+ assert.isUndefined(result.version)
20
+ })
21
+ })
22
+
23
+ test.group('Models > Thing > constructor()', () => {
24
+ test('creates an empty Thing', ({ assert }) => {
25
+ const result = new Thing()
26
+ assert.equal(result.kind, ThingKind)
27
+ assert.isUndefined(result.name)
28
+ assert.isUndefined(result.description)
29
+ assert.isUndefined(result.version)
30
+ })
31
+
32
+ test('creates a Thing from the schema values', ({ assert }) => {
33
+ const schema: IThing = {
34
+ kind: ThingKind,
35
+ name: 'a name',
36
+ displayName: 'a displayName',
37
+ description: 'a desc',
38
+ version: 'a ver',
39
+ }
40
+ const result = new Thing(schema)
41
+ assert.equal(result.kind, ThingKind)
42
+ assert.equal(result.name, 'a name')
43
+ assert.equal(result.displayName, 'a displayName')
44
+ assert.equal(result.description, 'a desc')
45
+ assert.equal(result.version, 'a ver')
46
+ })
47
+
48
+ test('creates a Thing from the JSON schema string', ({ assert }) => {
49
+ const schema: IThing = {
50
+ kind: ThingKind,
51
+ name: 'a name',
52
+ displayName: 'a displayName',
53
+ description: 'a desc',
54
+ version: 'a ver',
55
+ }
56
+ const result = new Thing(JSON.stringify(schema))
57
+ assert.equal(result.kind, ThingKind)
58
+ assert.equal(result.name, 'a name')
59
+ assert.equal(result.displayName, 'a displayName')
60
+ assert.equal(result.description, 'a desc')
61
+ assert.equal(result.version, 'a ver')
62
+ })
63
+
64
+ test('throws when invalid schema', ({ assert }) => {
65
+ assert.throws(() => {
66
+ new Thing(
67
+ JSON.stringify({
68
+ name: 'a name',
69
+ })
70
+ )
71
+ })
72
+ })
73
+ })
74
+
75
+ test.group('Models > Thing > toJSON()', (group) => {
76
+ let thing: Thing
77
+ group.each.setup(() => {
78
+ thing = new Thing()
79
+ })
80
+
81
+ test('serializes the kind', ({ assert }) => {
82
+ const result = thing.toJSON()
83
+ assert.equal(result.kind, ThingKind)
84
+ })
85
+
86
+ test('serializes the name', ({ assert }) => {
87
+ thing.name = 'a name'
88
+ const result = thing.toJSON()
89
+ assert.equal(result.name, 'a name')
90
+ })
91
+
92
+ test('does not serialize name when missing', ({ assert }) => {
93
+ const result = thing.toJSON()
94
+ assert.isUndefined(result.name)
95
+ })
96
+
97
+ test('serializes the displayName', ({ assert }) => {
98
+ thing.displayName = 'a displayName'
99
+ const result = thing.toJSON()
100
+ assert.equal(result.displayName, 'a displayName')
101
+ })
102
+
103
+ test('does not serialize displayName when missing', ({ assert }) => {
104
+ const result = thing.toJSON()
105
+ assert.isUndefined(result.displayName)
106
+ })
107
+
108
+ test('serializes the description', ({ assert }) => {
109
+ thing.description = 'a description'
110
+ const result = thing.toJSON()
111
+ assert.equal(result.description, 'a description')
112
+ })
113
+
114
+ test('does not serialize description when missing', ({ assert }) => {
115
+ const result = thing.toJSON()
116
+ assert.isUndefined(result.description)
117
+ })
118
+
119
+ test('serializes the version', ({ assert }) => {
120
+ thing.version = 'a version'
121
+ const result = thing.toJSON()
122
+ assert.equal(result.version, 'a version')
123
+ })
124
+
125
+ test('does not serialize version when missing', ({ assert }) => {
126
+ const result = thing.toJSON()
127
+ assert.isUndefined(result.version)
128
+ })
129
+ })
130
+
131
+ test.group('Models > Thing > getLabel()', () => {
132
+ test('returns the default value', ({ assert }) => {
133
+ const t = new Thing()
134
+ assert.equal(t.getLabel(), 'Unnamed object')
135
+ })
136
+
137
+ test('returns the passed default value', ({ assert }) => {
138
+ const t = new Thing()
139
+ assert.equal(t.getLabel('xyz'), 'xyz')
140
+ })
141
+
142
+ test('returns the name value', ({ assert }) => {
143
+ const t = new Thing()
144
+ t.name = 'a thing'
145
+ assert.equal(t.getLabel(), 'a thing')
146
+ })
147
+
148
+ test('returns the displayName when set', ({ assert }) => {
149
+ const t = new Thing()
150
+ t.name = 'a thing'
151
+ t.displayName = 'better thing'
152
+ assert.equal(t.getLabel(), 'better thing')
153
+ })
154
+ })
@@ -1,33 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>Oauth2 callback window</title>
6
- <style>
7
- *[hidden] {
8
- display: none;
9
- }
10
- </style>
11
- </head>
12
- <body>
13
- <h1>Sending the authorization data to the application</h1>
14
- <p id="general-error" hidden>
15
- The window wasn't opened as a popup and therefore it can't pass the authorization information.<br />
16
- This is an error.
17
- </p>
18
- <script>
19
- const messageTarget = window.opener || window.parent || window.top
20
- if (!messageTarget || messageTarget === window || !messageTarget.postMessage) {
21
- const elm = document.getElementById('general-error')
22
- elm.removeAttribute('hidden')
23
- } else {
24
- const search = window.location.search.substr(1)
25
- if (search) {
26
- messageTarget.postMessage(search, '*')
27
- } else {
28
- messageTarget.postMessage(window.location.hash.substr(1), '*')
29
- }
30
- }
31
- </script>
32
- </body>
33
- </html>