@api-client/core 0.14.9 → 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.
Files changed (110) 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/DataDomain.d.ts +45 -3
  12. package/build/src/modeling/DataDomain.d.ts.map +1 -1
  13. package/build/src/modeling/DataDomain.js +81 -3
  14. package/build/src/modeling/DataDomain.js.map +1 -1
  15. package/build/src/modeling/DomainElement.d.ts +7 -0
  16. package/build/src/modeling/DomainElement.d.ts.map +1 -1
  17. package/build/src/modeling/DomainElement.js +14 -0
  18. package/build/src/modeling/DomainElement.js.map +1 -1
  19. package/build/src/modeling/DomainImpactAnalysis.d.ts +22 -119
  20. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  21. package/build/src/modeling/DomainImpactAnalysis.js +49 -155
  22. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  23. package/build/src/modeling/DomainValidation.d.ts +8 -0
  24. package/build/src/modeling/DomainValidation.d.ts.map +1 -0
  25. package/build/src/modeling/DomainValidation.js +99 -0
  26. package/build/src/modeling/DomainValidation.js.map +1 -0
  27. package/build/src/modeling/types.d.ts +70 -0
  28. package/build/src/modeling/types.d.ts.map +1 -1
  29. package/build/src/modeling/types.js.map +1 -1
  30. package/build/src/modeling/validation/entity_validation.js +1 -1
  31. package/build/src/modeling/validation/entity_validation.js.map +1 -1
  32. package/build/src/modeling/validation/rules.d.ts +2 -3
  33. package/build/src/modeling/validation/rules.d.ts.map +1 -1
  34. package/build/src/modeling/validation/rules.js.map +1 -1
  35. package/build/src/modeling/validation/semantic_validation.d.ts +31 -0
  36. package/build/src/modeling/validation/semantic_validation.d.ts.map +1 -0
  37. package/build/src/modeling/validation/semantic_validation.js +126 -0
  38. package/build/src/modeling/validation/semantic_validation.js.map +1 -0
  39. package/build/tsconfig.tsbuildinfo +1 -1
  40. package/data/models/example-generator-api.json +12 -12
  41. package/noop.ts +3 -0
  42. package/package.json +9 -4
  43. package/src/events/authorization/AuthorizationEvents.ts +1 -1
  44. package/src/events/cookies/CookieEvents.ts +1 -1
  45. package/src/modeling/DataDomain.ts +84 -3
  46. package/src/modeling/DomainElement.ts +16 -0
  47. package/src/modeling/DomainImpactAnalysis.ts +54 -239
  48. package/src/modeling/DomainValidation.ts +105 -0
  49. package/src/modeling/types.ts +86 -0
  50. package/src/modeling/validation/entity_validation.ts +1 -1
  51. package/src/modeling/validation/rules.ts +2 -4
  52. package/src/modeling/validation/semantic_validation.ts +145 -0
  53. package/tests/unit/events/EventsTestHelpers.ts +16 -0
  54. package/tests/unit/events/amf.spec.ts +151 -0
  55. package/tests/unit/events/authorization.spec.ts +150 -0
  56. package/tests/unit/events/cookie.spec.ts +274 -0
  57. package/tests/unit/events/encryption.spec.ts +108 -0
  58. package/tests/unit/events/events_polyfills.ts +77 -0
  59. package/tests/unit/events/process.spec.ts +120 -0
  60. package/tests/unit/events/reporting.spec.ts +82 -0
  61. package/tests/unit/events/telemetry.spec.ts +224 -0
  62. package/tests/unit/events/transport.spec.ts +139 -0
  63. package/tests/unit/modeling/data_domain_foreign.spec.ts +244 -0
  64. package/tests/unit/modeling/domain_impact_analysis.spec.ts +0 -110
  65. package/tests/unit/modeling/domain_validation.spec.ts +94 -0
  66. package/tests/unit/modeling/validation/semantic_validation.spec.ts +91 -0
  67. package/tests/unit/models/environment.spec.ts +574 -0
  68. package/tests/unit/models/error_response.spec.ts +183 -0
  69. package/tests/unit/models/headers_array.spec.ts +86 -0
  70. package/tests/unit/models/http-actions/assertion/equal_assertion.spec.ts +103 -0
  71. package/tests/unit/models/http-actions/assertion/greater_than_assertion.spec.ts +91 -0
  72. package/tests/unit/models/http-actions/assertion/includes_assertion.spec.ts +71 -0
  73. package/tests/unit/models/http-actions/assertion/less_than_assertion.spec.ts +91 -0
  74. package/tests/unit/models/http-actions/assertion/matches_assertion.spec.ts +71 -0
  75. package/tests/unit/models/http-actions/assertion/matches_schema_assertion.spec.ts +117 -0
  76. package/tests/unit/models/http-actions/assertion/not_equal_assertion.spec.ts +103 -0
  77. package/tests/unit/models/http-actions/assertion/not_includes_assertion.spec.ts +71 -0
  78. package/tests/unit/models/http-actions/assertion/not_ok_assertion.spec.ts +47 -0
  79. package/tests/unit/models/http-actions/assertion/not_to_be_assertion.spec.ts +72 -0
  80. package/tests/unit/models/http-actions/assertion/ok_assertion.spec.ts +44 -0
  81. package/tests/unit/models/http-actions/assertion/to_be_assertion.spec.ts +71 -0
  82. package/tests/unit/models/http-actions/transformation/as_lower_case_step.spec.ts +47 -0
  83. package/tests/unit/models/http-actions/transformation/as_number_step.spec.ts +47 -0
  84. package/tests/unit/models/http-actions/transformation/as_upper_case_step.spec.ts +47 -0
  85. package/tests/unit/models/http-actions/transformation/round_step.spec.ts +69 -0
  86. package/tests/unit/models/http-actions/transformation/substring_step.spec.ts +85 -0
  87. package/tests/unit/models/http-actions/transformation/trim_step.spec.ts +44 -0
  88. package/tests/unit/models/http_cookie.spec.ts +516 -0
  89. package/tests/unit/models/http_history.spec.ts +443 -0
  90. package/tests/unit/models/project_folder.spec.ts +926 -0
  91. package/tests/unit/models/project_item.spec.ts +137 -0
  92. package/tests/unit/models/project_request.spec.ts +1047 -0
  93. package/tests/unit/models/project_schema.spec.ts +236 -0
  94. package/tests/unit/models/property.spec.ts +625 -0
  95. package/tests/unit/models/provider.spec.ts +102 -0
  96. package/tests/unit/models/request.spec.ts +1206 -0
  97. package/tests/unit/models/request_log.spec.ts +308 -0
  98. package/tests/unit/models/request_time.spec.ts +138 -0
  99. package/tests/unit/models/response_redirect.spec.ts +303 -0
  100. package/tests/unit/models/sent_request.spec.ts +206 -0
  101. package/tests/unit/models/server.spec.ts +195 -0
  102. package/tests/unit/models/thing.spec.ts +154 -0
  103. package/build/oauth-popup.html +0 -33
  104. /package/tests/unit/models/{Certificate.spec.ts → certificate.spec.ts} +0 -0
  105. /package/tests/unit/models/{HostRule.spec.ts → host_rule.spec.ts} +0 -0
  106. /package/tests/unit/models/{HttpProject.spec.ts → http_project.spec.ts} +0 -0
  107. /package/tests/unit/models/{HttpRequest.spec.ts → http_request.spec.ts} +0 -0
  108. /package/tests/unit/models/{HttpResponse.spec.ts → http_response.spec.ts} +0 -0
  109. /package/tests/unit/models/{License.spec.ts → license.spec.ts} +0 -0
  110. /package/tests/unit/models/{Response.spec.ts → response.spec.ts} +0 -0
@@ -0,0 +1,137 @@
1
+ import { test } from '@japa/runner'
2
+ import { ProjectItem } from '../../../src/models/ProjectItem.js'
3
+ import { HttpProject } from '../../../src/models/HttpProject.js'
4
+ import { Kind as ProjectRequestKind } from '../../../src/models/ProjectRequest.js'
5
+ import { ProjectFolderKind } from '../../../src/models/kinds.js'
6
+
7
+ test.group('ProjectItem.projectRequest()', () => {
8
+ test('creates the item', ({ assert }) => {
9
+ const project = HttpProject.fromName('test')
10
+ const item = ProjectItem.projectRequest(project, 'r1')
11
+ assert.equal(item.kind, ProjectRequestKind)
12
+ assert.equal(item.key, 'r1')
13
+ })
14
+ })
15
+
16
+ test.group('ProjectItem.projectFolder()', () => {
17
+ test('creates the item', ({ assert }) => {
18
+ const project = HttpProject.fromName('test')
19
+ const item = ProjectItem.projectFolder(project, 'f1')
20
+ assert.equal(item.kind, ProjectFolderKind)
21
+ assert.equal(item.key, 'f1')
22
+ })
23
+ })
24
+
25
+ test.group('ProjectItem.isProjectItem()', () => {
26
+ test('returns true for a folder item', ({ assert }) => {
27
+ const project = HttpProject.fromName('test')
28
+ const item = ProjectItem.projectFolder(project, 'f1')
29
+ assert.isTrue(ProjectItem.isProjectItem(item))
30
+ })
31
+
32
+ test('returns true for a request item', ({ assert }) => {
33
+ const project = HttpProject.fromName('test')
34
+ const item = ProjectItem.projectRequest(project, 'r1')
35
+ assert.isTrue(ProjectItem.isProjectItem(item))
36
+ })
37
+
38
+ test('returns false when not an item', ({ assert }) => {
39
+ assert.isFalse(ProjectItem.isProjectItem({} as ProjectItem))
40
+ })
41
+ })
42
+
43
+ test.group('ProjectItem > constructor()', (group) => {
44
+ let project: HttpProject
45
+ group.each.setup(() => {
46
+ project = HttpProject.fromName('test')
47
+ })
48
+
49
+ test('creates a default item for "http-request" type', ({ assert }) => {
50
+ const item = new ProjectItem(project, 'http-request')
51
+ assert.equal(item.kind, ProjectRequestKind)
52
+ assert.equal(item.key, '')
53
+ })
54
+
55
+ test('creates a default item for "folder" type', ({ assert }) => {
56
+ const item = new ProjectItem(project, 'folder')
57
+ assert.equal(item.kind, ProjectFolderKind)
58
+ assert.equal(item.key, '')
59
+ })
60
+
61
+ test('creates an instance from a schema', ({ assert }) => {
62
+ const schema = ProjectItem.projectRequest(project, 'r1').toJSON()
63
+ const item = new ProjectItem(project, schema)
64
+ assert.equal(item.kind, ProjectRequestKind)
65
+ assert.equal(item.key, 'r1')
66
+ })
67
+
68
+ test('creates an instance from a serialized schema', ({ assert }) => {
69
+ const schema = JSON.stringify(ProjectItem.projectRequest(project, 'r1'))
70
+ const item = new ProjectItem(project, schema)
71
+ assert.equal(item.kind, ProjectRequestKind)
72
+ assert.equal(item.key, 'r1')
73
+ })
74
+
75
+ test('throws when input is not defined', ({ assert }) => {
76
+ assert.throws(() => {
77
+ // @ts-expect-error Used in testing
78
+ new ProjectItem(project, undefined)
79
+ })
80
+ })
81
+ })
82
+
83
+ test.group('ProjectItem > toJSON()', (group) => {
84
+ let project: HttpProject
85
+ group.each.setup(() => {
86
+ project = HttpProject.fromName('test')
87
+ })
88
+
89
+ test('sets the kind', ({ assert }) => {
90
+ const item = ProjectItem.projectRequest(project, 'r1').toJSON()
91
+ assert.equal(item.kind, ProjectRequestKind)
92
+ })
93
+
94
+ test('sets the key', ({ assert }) => {
95
+ const item = ProjectItem.projectRequest(project, 'r1').toJSON()
96
+ assert.equal(item.key, 'r1')
97
+ })
98
+ })
99
+
100
+ test.group('ProjectItem > getItem()', (group) => {
101
+ let project: HttpProject
102
+ group.each.setup(() => {
103
+ project = HttpProject.fromName('test')
104
+ })
105
+
106
+ test('returns a definition of a request', ({ assert }) => {
107
+ const created = project.addRequest('https://api.com')
108
+ const definition = project.items[0].getItem()
109
+ assert.deepEqual(definition, created)
110
+ })
111
+
112
+ test('returns a definition of a folder', ({ assert }) => {
113
+ const created = project.addFolder('a folder')
114
+ const definition = project.items[0].getItem()
115
+ assert.deepEqual(definition, created)
116
+ })
117
+ })
118
+
119
+ test.group('ProjectItem > getParent()', (group) => {
120
+ let project: HttpProject
121
+ group.each.setup(() => {
122
+ project = HttpProject.fromName('test')
123
+ })
124
+
125
+ test('returns the project for a root level items', ({ assert }) => {
126
+ project.addRequest('https://api.com')
127
+ const definition = project.items[0].getParent()
128
+ assert.isTrue(definition === project)
129
+ })
130
+
131
+ test('returns a parent folder', ({ assert }) => {
132
+ const f1 = project.addFolder('f1')
133
+ f1.addFolder('f2') // This creates an item in f1.items
134
+ const definition = f1.items[0].getParent()
135
+ assert.isTrue(definition === f1)
136
+ })
137
+ })