@bitblit/ratchet-epsilon-common 6.0.146-alpha → 6.0.148-alpha

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 (165) hide show
  1. package/lib/config/cron/abstract-cron-entry.d.ts +1 -1
  2. package/package.json +11 -10
  3. package/src/background/background-dynamo-log-table-handler.ts +44 -0
  4. package/src/background/background-entry.ts +4 -0
  5. package/src/background/background-execution-event-type.ts +9 -0
  6. package/src/background/background-execution-event.ts +9 -0
  7. package/src/background/background-execution-listener.ts +6 -0
  8. package/src/background/background-handler.ts +352 -0
  9. package/src/background/background-http-adapter-handler.ts +166 -0
  10. package/src/background/background-meta-response-internal.ts +5 -0
  11. package/src/background/background-process-handling.ts +6 -0
  12. package/src/background/background-process-log-table-entry.ts +11 -0
  13. package/src/background/background-queue-response-internal.ts +9 -0
  14. package/src/background/background-validator.ts +105 -0
  15. package/src/background/epsilon-background-process-error.ts +110 -0
  16. package/src/background/internal-background-entry.ts +10 -0
  17. package/src/background/manager/abstract-background-manager.ts +120 -0
  18. package/src/background/manager/aws-large-payload-s3-sqs-sns-background-manager.ts +87 -0
  19. package/src/background/manager/aws-sqs-sns-background-manager.ts +201 -0
  20. package/src/background/manager/background-manager-like.ts +44 -0
  21. package/src/background/manager/background-manager.spec.ts +89 -0
  22. package/src/background/manager/single-thread-local-background-manager.ts +58 -0
  23. package/src/background/s3-background-transaction-logger.ts +65 -0
  24. package/src/build/ratchet-epsilon-common-info.ts +19 -0
  25. package/src/built-in/background/echo-processor.ts +17 -0
  26. package/src/built-in/background/log-and-enqueue-echo-processor.ts +14 -0
  27. package/src/built-in/background/log-message-background-error-processor.ts +10 -0
  28. package/src/built-in/background/no-op-processor.ts +12 -0
  29. package/src/built-in/background/retry-processor.ts +51 -0
  30. package/src/built-in/background/sample-delay-processor.ts +15 -0
  31. package/src/built-in/background/sample-input-validated-processor-data.ts +4 -0
  32. package/src/built-in/background/sample-input-validated-processor.ts +14 -0
  33. package/src/built-in/built-in-trace-id-generators.ts +22 -0
  34. package/src/built-in/daemon/daemon-authorizer-function.ts +4 -0
  35. package/src/built-in/daemon/daemon-config.ts +9 -0
  36. package/src/built-in/daemon/daemon-group-selection-function.ts +3 -0
  37. package/src/built-in/daemon/daemon-handler.ts +87 -0
  38. package/src/built-in/daemon/daemon-process-state-list.ts +9 -0
  39. package/src/built-in/http/apollo/apollo-util.ts +43 -0
  40. package/src/built-in/http/apollo/default-epsilon-apollo-context.ts +11 -0
  41. package/src/built-in/http/apollo/epsilon-apollo-context-builder-options.ts +5 -0
  42. package/src/built-in/http/apollo/epsilon-lambda-apollo-context-function-argument.ts +6 -0
  43. package/src/built-in/http/apollo/epsilon-lambda-apollo-options.ts +11 -0
  44. package/src/built-in/http/apollo-filter.ts +151 -0
  45. package/src/built-in/http/built-in-auth-filters.ts +73 -0
  46. package/src/built-in/http/built-in-authorizers.ts +22 -0
  47. package/src/built-in/http/built-in-filters.spec.ts +26 -0
  48. package/src/built-in/http/built-in-filters.ts +300 -0
  49. package/src/built-in/http/built-in-handlers.ts +85 -0
  50. package/src/built-in/http/log-level-manipulation-filter.ts +26 -0
  51. package/src/built-in/http/run-handler-as-filter.spec.ts +67 -0
  52. package/src/built-in/http/run-handler-as-filter.ts +102 -0
  53. package/src/cli/ratchet-cli-handler.ts +23 -0
  54. package/src/cli/run-background-process-from-command-line.ts +32 -0
  55. package/src/config/background/background-aws-config.ts +8 -0
  56. package/src/config/background/background-config.ts +15 -0
  57. package/src/config/background/background-error-processor.ts +5 -0
  58. package/src/config/background/background-processor.ts +14 -0
  59. package/src/config/background/background-transaction-log.ts +9 -0
  60. package/src/config/background/background-transaction-logger.ts +6 -0
  61. package/src/config/cron/abstract-cron-entry.ts +17 -0
  62. package/src/config/cron/cron-background-entry.ts +17 -0
  63. package/src/config/cron/cron-config.ts +10 -0
  64. package/src/config/dynamo-db-config.ts +6 -0
  65. package/src/config/epsilon-config.ts +30 -0
  66. package/src/config/epsilon-lambda-event-handler.ts +12 -0
  67. package/src/config/epsilon-logger-config.ts +23 -0
  68. package/src/config/espilon-server-mode.ts +10 -0
  69. package/src/config/generic-aws-event-handler-function.ts +1 -0
  70. package/src/config/http/authorizer-function.ts +9 -0
  71. package/src/config/http/epsilon-authorization-context.ts +5 -0
  72. package/src/config/http/epsilon-cors-approach.ts +7 -0
  73. package/src/config/http/extended-api-gateway-event.ts +8 -0
  74. package/src/config/http/filter-chain-context.ts +15 -0
  75. package/src/config/http/filter-function.ts +3 -0
  76. package/src/config/http/handler-function.ts +4 -0
  77. package/src/config/http/http-config.ts +27 -0
  78. package/src/config/http/http-processing-config.ts +23 -0
  79. package/src/config/http/mapped-http-processing-config.ts +12 -0
  80. package/src/config/http/null-returned-object-handling.ts +7 -0
  81. package/src/config/inter-api/inter-api-aws-config.ts +5 -0
  82. package/src/config/inter-api/inter-api-config.ts +7 -0
  83. package/src/config/inter-api/inter-api-process-mapping.ts +11 -0
  84. package/src/config/local-server/local-server-event-logging-style.ts +8 -0
  85. package/src/config/local-server/local-server-http-method-handling.ts +7 -0
  86. package/src/config/local-server/local-server-options.ts +12 -0
  87. package/src/config/logging-trace-id-generator.ts +3 -0
  88. package/src/config/no-handlers-found-error.ts +6 -0
  89. package/src/config/open-api/open-api-document-components.ts +4 -0
  90. package/src/config/open-api/open-api-document.ts +7 -0
  91. package/src/config/s3-config.ts +8 -0
  92. package/src/config/sns-config.ts +7 -0
  93. package/src/config/sqs-config.ts +7 -0
  94. package/src/epsilon-build-properties.ts +21 -0
  95. package/src/epsilon-constants.ts +62 -0
  96. package/src/epsilon-global-handler.ts +238 -0
  97. package/src/epsilon-instance.ts +20 -0
  98. package/src/epsilon-logging-extension-processor.ts +19 -0
  99. package/src/http/auth/api-gateway-adapter-authentication-handler.ts +95 -0
  100. package/src/http/auth/auth0-web-token-manipulator.ts +69 -0
  101. package/src/http/auth/basic-auth-token.ts +7 -0
  102. package/src/http/auth/google-web-token-manipulator.spec.ts +15 -0
  103. package/src/http/auth/google-web-token-manipulator.ts +80 -0
  104. package/src/http/auth/jwt-ratchet-local-web-token-manipulator.ts +37 -0
  105. package/src/http/auth/local-web-token-manipulator.spec.ts +34 -0
  106. package/src/http/auth/local-web-token-manipulator.ts +114 -0
  107. package/src/http/auth/web-token-manipulator.ts +9 -0
  108. package/src/http/error/bad-gateway.ts +11 -0
  109. package/src/http/error/bad-request-error.ts +11 -0
  110. package/src/http/error/conflict-error.ts +12 -0
  111. package/src/http/error/forbidden-error.ts +12 -0
  112. package/src/http/error/gateway-timeout.ts +12 -0
  113. package/src/http/error/method-not-allowed-error.ts +12 -0
  114. package/src/http/error/misconfigured-error.ts +12 -0
  115. package/src/http/error/not-found-error.ts +12 -0
  116. package/src/http/error/not-implemented.ts +12 -0
  117. package/src/http/error/request-timeout-error.ts +12 -0
  118. package/src/http/error/service-unavailable.ts +12 -0
  119. package/src/http/error/too-many-requests-error.ts +12 -0
  120. package/src/http/error/unauthorized-error.ts +12 -0
  121. package/src/http/event-util.spec.ts +190 -0
  122. package/src/http/event-util.ts +272 -0
  123. package/src/http/response-util.spec.ts +117 -0
  124. package/src/http/response-util.ts +164 -0
  125. package/src/http/route/epsilon-router.ts +9 -0
  126. package/src/http/route/extended-auth-response-context.ts +7 -0
  127. package/src/http/route/route-and-parse.ts +8 -0
  128. package/src/http/route/route-mapping.ts +21 -0
  129. package/src/http/route/route-validator-config.ts +5 -0
  130. package/src/http/route/router-util.spec.ts +33 -0
  131. package/src/http/route/router-util.ts +314 -0
  132. package/src/http/web-handler.spec.ts +99 -0
  133. package/src/http/web-handler.ts +157 -0
  134. package/src/http/web-v2-handler.ts +34 -0
  135. package/src/inter-api/inter-api-entry.ts +8 -0
  136. package/src/inter-api/inter-api-util.spec.ts +77 -0
  137. package/src/inter-api/inter-api-util.ts +71 -0
  138. package/src/inter-api-manager.ts +75 -0
  139. package/src/lambda-event-handler/cron-epsilon-lambda-event-handler.spec.ts +130 -0
  140. package/src/lambda-event-handler/cron-epsilon-lambda-event-handler.ts +132 -0
  141. package/src/lambda-event-handler/dynamo-epsilon-lambda-event-handler.ts +42 -0
  142. package/src/lambda-event-handler/generic-sns-epsilon-lambda-event-handler.ts +38 -0
  143. package/src/lambda-event-handler/generic-sqs-epsilon-lambda-event-handler.ts +43 -0
  144. package/src/lambda-event-handler/inter-api-epsilon-lambda-event-handler.ts +33 -0
  145. package/src/lambda-event-handler/s3-epsilon-lambda-event-handler.ts +50 -0
  146. package/src/local-container-server.ts +128 -0
  147. package/src/local-server.spec.ts +16 -0
  148. package/src/local-server.ts +426 -0
  149. package/src/open-api-util/open-api-doc-modifications.ts +9 -0
  150. package/src/open-api-util/open-api-doc-modifier.spec.ts +22 -0
  151. package/src/open-api-util/open-api-doc-modifier.ts +90 -0
  152. package/src/open-api-util/yaml-combiner.spec.ts +26 -0
  153. package/src/open-api-util/yaml-combiner.ts +35 -0
  154. package/src/sample/sample-server-components-with-apollo.ts +87 -0
  155. package/src/sample/sample-server-components.ts +183 -0
  156. package/src/sample/sample-server-static-files.ts +614 -0
  157. package/src/sample/test-error-server.ts +140 -0
  158. package/src/util/aws-util.ts +89 -0
  159. package/src/util/context-global-data.ts +13 -0
  160. package/src/util/context-util.ts +156 -0
  161. package/src/util/cron-util.spec.ts +190 -0
  162. package/src/util/cron-util.ts +86 -0
  163. package/src/util/epsilon-config-parser.ts +90 -0
  164. package/src/util/epsilon-server-util.spec.ts +18 -0
  165. package/src/util/epsilon-server-util.ts +16 -0
@@ -0,0 +1,614 @@
1
+ export class SampleServerStaticFiles {
2
+ // Prevent instantiation
3
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
4
+ private constructor() {}
5
+
6
+ public static readonly SAMPLE_OPEN_API_DOC: string =
7
+ 'openapi: 3.0.0\n' +
8
+ 'info:\n' +
9
+ ' version: v0\n' +
10
+ ' title: SampleAPI\n' +
11
+ 'tags:\n' +
12
+ ' - name: CORS\n' +
13
+ ' description: These endpoints are here to support CORS\n' +
14
+ ' - name: Public\n' +
15
+ ' description: These endpoints can be called without setting the authorization header\n' +
16
+ ' - name: Secure\n' +
17
+ ' description: Authentication and authorization of the API\n' +
18
+ 'paths:\n' +
19
+ ' /:\n' +
20
+ ' get:\n' +
21
+ ' description: Redirects to the /meta/server endpoint\n' +
22
+ ' tags:\n' +
23
+ ' - Meta\n' +
24
+ ' - Public\n' +
25
+ ' responses:\n' +
26
+ " '301':\n" +
27
+ ' description: Redirects to the /meta/server endpoint\n' +
28
+ ' options:\n' +
29
+ ' tags:\n' +
30
+ ' - CORS\n' +
31
+ ' responses:\n' +
32
+ " '200':\n" +
33
+ ' description: Standard CORS header response\n' +
34
+ ' /event:\n' +
35
+ ' get:\n' +
36
+ ' description: Tests URL parsing and returns event as JSON\n' +
37
+ ' tags:\n' +
38
+ ' - Meta\n' +
39
+ ' - Public\n' +
40
+ ' responses:\n' +
41
+ " '200':\n" +
42
+ ' description: The parsed event, as JSON\n' +
43
+ ' options:\n' +
44
+ ' tags:\n' +
45
+ ' - CORS\n' +
46
+ ' responses:\n' +
47
+ " '200':\n" +
48
+ ' description: Standard CORS header response\n' +
49
+ ' /meta/server:\n' +
50
+ ' get:\n' +
51
+ ' description: >\n' +
52
+ ' Returns information about the current build and time. Can be used to\n' +
53
+ ' test error-handling code by passing a specific http error code in the\n' +
54
+ ' error query parameter. Can also be used to process specific named tests\n' +
55
+ ' by passing those names to the test parameter.\n' +
56
+ ' tags:\n' +
57
+ ' - Public\n' +
58
+ ' parameters:\n' +
59
+ ' - name: error\n' +
60
+ ' in: query\n' +
61
+ ' description: >-\n' +
62
+ ' If set, throw a specific error for testing (valid are\n' +
63
+ ' 500,400,403,404)\n' +
64
+ ' required: false\n' +
65
+ ' schema:\n' +
66
+ ' type: number\n' +
67
+ ' - name: test\n' +
68
+ ' in: query\n' +
69
+ ' description: Run a specific named test (currently none are publicly available)\n' +
70
+ ' required: false\n' +
71
+ ' schema:\n' +
72
+ ' type: string\n' +
73
+ ' responses:\n' +
74
+ " '200':\n" +
75
+ ' description: Success\n' +
76
+ " '400':\n" +
77
+ ' description: Simulated bad request\n' +
78
+ ' content:\n' +
79
+ " '*/*':\n" +
80
+ ' schema:\n' +
81
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
82
+ " '403':\n" +
83
+ ' description: Simulated unauthorized\n' +
84
+ ' content:\n' +
85
+ " '*/*':\n" +
86
+ ' schema:\n' +
87
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
88
+ " '404':\n" +
89
+ ' description: Simulated not found\n' +
90
+ ' content:\n' +
91
+ " '*/*':\n" +
92
+ ' schema:\n' +
93
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
94
+ " '500':\n" +
95
+ ' description: Simulated internal server error\n' +
96
+ ' content:\n' +
97
+ " '*/*':\n" +
98
+ ' schema:\n' +
99
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
100
+ ' options:\n' +
101
+ ' tags:\n' +
102
+ ' - CORS\n' +
103
+ ' responses:\n' +
104
+ " '200':\n" +
105
+ ' description: Standard CORS header response\n' +
106
+ ' /meta/user:\n' +
107
+ ' get:\n' +
108
+ ' description: >\n' +
109
+ ' When logged in, returns the contents of the JWT token as the server\n' +
110
+ ' parses it. This should match what you get when you process the token\n' +
111
+ ' returned from the "POST /access-token" endpoint through a standard JWT\n' +
112
+ ' token processor.\n' +
113
+ ' tags:\n' +
114
+ ' - Meta\n' +
115
+ ' security:\n' +
116
+ ' - SampleAuthorizer: []\n' +
117
+ ' responses:\n' +
118
+ " '200':\n" +
119
+ ' description: Success\n' +
120
+ ' content:\n' +
121
+ " '*/*':\n" +
122
+ ' schema:\n' +
123
+ " $ref: '#/components/schemas/AccessTokenContents'\n" +
124
+ " '401':\n" +
125
+ ' description: Unauthorized\n' +
126
+ ' content:\n' +
127
+ " '*/*':\n" +
128
+ ' schema:\n' +
129
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
130
+ ' options:\n' +
131
+ ' tags:\n' +
132
+ ' - CORS\n' +
133
+ ' responses:\n' +
134
+ " '200':\n" +
135
+ ' description: Success\n' +
136
+ " '401':\n" +
137
+ ' description: Unauthorized\n' +
138
+ ' content:\n' +
139
+ " '*/*':\n" +
140
+ ' schema:\n' +
141
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
142
+ ' /meta/item/{itemId}:\n' +
143
+ ' get:\n' +
144
+ ' description: >\n' +
145
+ ' Example of a path param\n' +
146
+ ' parameters:\n' +
147
+ ' - name: itemId\n' +
148
+ ' in: path\n' +
149
+ ' description: A sample item id\n' +
150
+ ' required: true\n' +
151
+ ' schema:\n' +
152
+ ' type: string\n' +
153
+ ' tags:\n' +
154
+ ' - Meta\n' +
155
+ ' responses:\n' +
156
+ " '200':\n" +
157
+ ' description: Success\n' +
158
+ ' content:\n' +
159
+ " '*/*':\n" +
160
+ ' schema:\n' +
161
+ " $ref: '#/components/schemas/Empty'\n" +
162
+ " '401':\n" +
163
+ ' description: Unauthorized\n' +
164
+ ' content:\n' +
165
+ " '*/*':\n" +
166
+ ' schema:\n' +
167
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
168
+ ' options:\n' +
169
+ ' tags:\n' +
170
+ ' - CORS\n' +
171
+ ' parameters:\n' +
172
+ ' - name: itemId\n' +
173
+ ' in: path\n' +
174
+ ' description: A sample item id\n' +
175
+ ' required: true\n' +
176
+ ' schema:\n' +
177
+ ' type: string\n' +
178
+ ' responses:\n' +
179
+ " '200':\n" +
180
+ ' description: Success\n' +
181
+ " '401':\n" +
182
+ ' description: Unauthorized\n' +
183
+ ' content:\n' +
184
+ " '*/*':\n" +
185
+ ' schema:\n' +
186
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
187
+ '\n' +
188
+ ' /meta/sample-item:\n' +
189
+ ' get:\n' +
190
+ ' description: >\n' +
191
+ ' Example of an object returned\n' +
192
+ ' parameters:\n' +
193
+ ' - name: num\n' +
194
+ ' in: path\n' +
195
+ ' description: Number to return in the number value\n' +
196
+ ' required: false\n' +
197
+ ' schema:\n' +
198
+ ' type: number\n' +
199
+ ' tags:\n' +
200
+ ' - Meta\n' +
201
+ ' responses:\n' +
202
+ " '200':\n" +
203
+ ' description: Success\n' +
204
+ ' content:\n' +
205
+ " 'application/json':\n" +
206
+ ' schema:\n' +
207
+ " $ref: '#/components/schemas/BackgroundSampleInputValidatedProcessorData'\n" +
208
+ ' post:\n' +
209
+ ' description: >\n' +
210
+ ' Example of an object posted\n' +
211
+ ' requestBody:\n' +
212
+ ' content:\n' +
213
+ ' application/json:\n' +
214
+ ' schema:\n' +
215
+ " $ref: '#/components/schemas/BackgroundSampleInputValidatedProcessorData'\n" +
216
+ ' description: Request to refresh the access token or change active user\n' +
217
+ ' required: true\n' +
218
+ ' tags:\n' +
219
+ ' - Meta\n' +
220
+ ' responses:\n' +
221
+ " '200':\n" +
222
+ ' description: Success\n' +
223
+ ' content:\n' +
224
+ " 'application/json':\n" +
225
+ ' schema:\n' +
226
+ " $ref: '#/components/schemas/BackgroundSampleInputValidatedProcessorData'\n" +
227
+ ' options:\n' +
228
+ ' tags:\n' +
229
+ ' - CORS\n' +
230
+ ' responses:\n' +
231
+ " '200':\n" +
232
+ ' description: Success\n' +
233
+ '\n' +
234
+ ' /secure/access-token:\n' +
235
+ ' post:\n' +
236
+ ' tags:\n' +
237
+ ' - Secure\n' +
238
+ ' - Public\n' +
239
+ ' responses:\n' +
240
+ " '200':\n" +
241
+ ' description: Success\n' +
242
+ ' content:\n' +
243
+ ' application/json:\n' +
244
+ ' schema:\n' +
245
+ " $ref: '#/components/schemas/AccessTokenResponse'\n" +
246
+ " '400':\n" +
247
+ ' description: Invalid request\n' +
248
+ ' content:\n' +
249
+ ' application/json:\n' +
250
+ ' schema:\n' +
251
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
252
+ " '403':\n" +
253
+ ' description: Invalid credentials\n' +
254
+ ' content:\n' +
255
+ ' application/json:\n' +
256
+ ' schema:\n' +
257
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
258
+ ' requestBody:\n' +
259
+ ' content:\n' +
260
+ ' application/json:\n' +
261
+ ' schema:\n' +
262
+ " $ref: '#/components/schemas/AccessTokenRequest'\n" +
263
+ ' description: Request to refresh the access token or change active user\n' +
264
+ ' required: true\n' +
265
+ ' options:\n' +
266
+ ' tags:\n' +
267
+ ' - CORS\n' +
268
+ ' responses:\n' +
269
+ " '200':\n" +
270
+ ' description: Standard CORS header response\n' +
271
+ ' /multi/fixed:\n' +
272
+ ' get:\n' +
273
+ ' description: Tests path matching from most specific to least (this is most)\n' +
274
+ ' tags:\n' +
275
+ ' - Public\n' +
276
+ ' responses:\n' +
277
+ " '200':\n" +
278
+ ' description: Success\n' +
279
+ ' options:\n' +
280
+ ' tags:\n' +
281
+ ' - CORS\n' +
282
+ ' responses:\n' +
283
+ " '200':\n" +
284
+ ' description: Standard CORS header response\n' +
285
+ ' /multi/{v}:\n' +
286
+ ' get:\n' +
287
+ ' description: Tests path matching from most specific to least (this is least)\n' +
288
+ ' tags:\n' +
289
+ ' - Public\n' +
290
+ ' parameters:\n' +
291
+ ' - name: v\n' +
292
+ ' in: path\n' +
293
+ ' description: A variable\n' +
294
+ ' required: true\n' +
295
+ ' schema:\n' +
296
+ ' type: string\n' +
297
+ ' responses:\n' +
298
+ " '200':\n" +
299
+ ' description: Success\n' +
300
+ ' options:\n' +
301
+ ' tags:\n' +
302
+ ' - CORS\n' +
303
+ ' parameters:\n' +
304
+ ' - name: v\n' +
305
+ ' in: path\n' +
306
+ ' description: A variable\n' +
307
+ ' required: true\n' +
308
+ ' schema:\n' +
309
+ ' type: string\n' +
310
+ ' responses:\n' +
311
+ " '200':\n" +
312
+ ' description: Standard CORS header response\n' +
313
+ '\n' +
314
+ ' /err/{code}:\n' +
315
+ ' get:\n' +
316
+ ' description: Tests path matching from most specific to least (this is least)\n' +
317
+ ' tags:\n' +
318
+ ' - Public\n' +
319
+ ' parameters:\n' +
320
+ ' - name: code\n' +
321
+ ' in: path\n' +
322
+ ' description: Error code\n' +
323
+ ' required: true\n' +
324
+ ' schema:\n' +
325
+ ' type: number\n' +
326
+ ' responses:\n' +
327
+ " '200':\n" +
328
+ ' description: Success\n' +
329
+ ' options:\n' +
330
+ ' tags:\n' +
331
+ ' - CORS\n' +
332
+ ' parameters:\n' +
333
+ ' - name: code\n' +
334
+ ' in: path\n' +
335
+ ' description: A variable\n' +
336
+ ' required: true\n' +
337
+ ' schema:\n' +
338
+ ' type: number\n' +
339
+ ' responses:\n' +
340
+ " '200':\n" +
341
+ ' description: Standard CORS header response\n' +
342
+ '\n' +
343
+ ' /background:\n' +
344
+ ' post:\n' +
345
+ ' responses:\n' +
346
+ " '200':\n" +
347
+ ' description: Success\n' +
348
+ ' content:\n' +
349
+ ' application/json:\n' +
350
+ ' schema:\n' +
351
+ " $ref: '#/components/schemas/BackgroundQueueResponse'\n" +
352
+ " '400':\n" +
353
+ ' description: Invalid request\n' +
354
+ ' content:\n' +
355
+ ' application/json:\n' +
356
+ ' schema:\n' +
357
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
358
+ " '403':\n" +
359
+ ' description: Invalid credentials\n' +
360
+ ' content:\n' +
361
+ ' application/json:\n' +
362
+ ' schema:\n' +
363
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
364
+ ' requestBody:\n' +
365
+ ' content:\n' +
366
+ ' application/json:\n' +
367
+ ' schema:\n' +
368
+ " $ref: '#/components/schemas/Empty'\n" +
369
+ ' description: Content to echo\n' +
370
+ ' required: true\n' +
371
+ ' options:\n' +
372
+ ' tags:\n' +
373
+ ' - CORS\n' +
374
+ ' responses:\n' +
375
+ " '200':\n" +
376
+ ' description: Standard CORS header response\n' +
377
+ '\n' +
378
+ ' /background/meta:\n' +
379
+ ' get:\n' +
380
+ ' responses:\n' +
381
+ " '200':\n" +
382
+ ' description: Success\n' +
383
+ ' content:\n' +
384
+ ' application/json:\n' +
385
+ ' schema:\n' +
386
+ " $ref: '#/components/schemas/BackgroundMetaResponse'\n" +
387
+ " '400':\n" +
388
+ ' description: Invalid request\n' +
389
+ ' content:\n' +
390
+ ' application/json:\n' +
391
+ ' schema:\n' +
392
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
393
+ " '403':\n" +
394
+ ' description: Invalid credentials\n' +
395
+ ' content:\n' +
396
+ ' application/json:\n' +
397
+ ' schema:\n' +
398
+ " $ref: '#/components/schemas/ApiErrorResponse'\n" +
399
+ ' options:\n' +
400
+ ' tags:\n' +
401
+ ' - CORS\n' +
402
+ ' responses:\n' +
403
+ " '200':\n" +
404
+ ' description: Standard CORS header response\n' +
405
+ '\n' +
406
+ 'x-amazon-apigateway-binary-media-types:\n' +
407
+ " - '*/*'\n" +
408
+ 'x-amazon-apigateway-gateway-responses:\n' +
409
+ ' UNAUTHORIZED:\n' +
410
+ ' statusCode: 401\n' +
411
+ ' responseParameters:\n' +
412
+ ' gatewayresponse.header.Access-Control-Allow-Origin: "\'*\'"\n' +
413
+ ' responseTemplates:\n' +
414
+ ' application/json: \'{"errors":["Unauthorized"], "httpStatusCode": 401}\'\n' +
415
+ ' MISSING_AUTHENTICATION_TOKEN:\n' +
416
+ ' statusCode: 404\n' +
417
+ ' responseParameters:\n' +
418
+ ' gatewayresponse.header.Access-Control-Allow-Origin: "\'*\'"\n' +
419
+ ' responseTemplates:\n' +
420
+ ' application/json: \'{"errors":["No such endpoint"], "httpStatusCode": 404}\'\n' +
421
+ ' INTEGRATION_TIMEOUT:\n' +
422
+ ' statusCode: 504\n' +
423
+ ' responseParameters:\n' +
424
+ ' gatewayresponse.header.Access-Control-Allow-Origin: "\'*\'"\n' +
425
+ ' responseTemplates:\n' +
426
+ ' application/json: \'{"errors":["Timeout"], "httpStatusCode": 504}\'\n' +
427
+ ' DEFAULT_5XX:\n' +
428
+ ' statusCode: 500\n' +
429
+ ' responseParameters:\n' +
430
+ ' gatewayresponse.header.Access-Control-Allow-Origin: "\'*\'"\n' +
431
+ ' responseTemplates:\n' +
432
+ ' application/json: \'{"errors":["Internal Server Error"], "httpStatusCode": 500}\'\n' +
433
+ '\n' +
434
+ 'servers:\n' +
435
+ " - url: 'https://api.sample.com/dev'\n" +
436
+ 'components:\n' +
437
+ ' securitySchemes:\n' +
438
+ ' SampleAuthorizer:\n' +
439
+ ' type: apiKey\n' +
440
+ ' name: Authorization\n' +
441
+ ' in: header\n' +
442
+ ' schemas:\n' +
443
+ ' Empty:\n' +
444
+ ' type: object\n' +
445
+ ' title: Empty Schema\n' +
446
+ '\n' +
447
+ ' AccessTokenRequest:\n' +
448
+ ' type: object\n' +
449
+ ' title: Access Token Request\n' +
450
+ ' required:\n' +
451
+ ' - email\n' +
452
+ ' - password\n' +
453
+ ' - scope\n' +
454
+ ' properties:\n' +
455
+ ' email:\n' +
456
+ ' type: string\n' +
457
+ ' description: Email address of the account to authenticate\n' +
458
+ ' format: email\n' +
459
+ ' minLength: 7\n' +
460
+ ' password:\n' +
461
+ ' type: string\n' +
462
+ ' description: Password of the account to authenticate\n' +
463
+ ' minLength: 6\n' +
464
+ ' scope:\n' +
465
+ ' type: string\n' +
466
+ ' enum:\n' +
467
+ ' - OWNER\n' +
468
+ ' - ADVERTISER\n' +
469
+ ' - GLOBAL\n' +
470
+ ' - RUN_AS_OWNER\n' +
471
+ ' - RUN_AS_ADVERTISER\n' +
472
+ ' description: |\n' +
473
+ ' What style of account to authenticate:\n' +
474
+ ' * `OWNER` - A device owner account\n' +
475
+ ' * `ADVERTISER` - A advertising account\n' +
476
+ ' * `GLOBAL` - Used by Adomni customer service\n' +
477
+ ' * `RUN_AS_OWNER` - Used by Adomni customer service\n' +
478
+ ' * `RUN_AS_ADVERTISER` - Used by Adomni customer service\n' +
479
+ ' default: OWNER\n' +
480
+ ' runAs:\n' +
481
+ ' type: string\n' +
482
+ ' description: Used by Adomni customer service\n' +
483
+ ' format: email\n' +
484
+ ' expirationSeconds:\n' +
485
+ ' type: number\n' +
486
+ ' minimum: 10\n' +
487
+ ' maximum: 3600\n' +
488
+ ' default: 3600\n' +
489
+ ' AccessTokenResponse:\n' +
490
+ ' type: object\n' +
491
+ ' title: Access Token Response\n' +
492
+ ' required:\n' +
493
+ ' - token\n' +
494
+ ' - expires\n' +
495
+ ' properties:\n' +
496
+ ' token:\n' +
497
+ ' type: string\n' +
498
+ ' description: A JWT access token for the API\n' +
499
+ ' expires:\n' +
500
+ ' type: number\n' +
501
+ ' format: int64\n' +
502
+ " description: 'The time this token will expire, expressed in epoch ms'\n" +
503
+ ' AccessTokenContents:\n' +
504
+ ' type: object\n' +
505
+ ' title: Access Token Contents\n' +
506
+ ' description: The contents of the JWT token\n' +
507
+ ' required:\n' +
508
+ ' - exp\n' +
509
+ ' - iss\n' +
510
+ ' - sub\n' +
511
+ ' - iat\n' +
512
+ ' - user\n' +
513
+ ' properties:\n' +
514
+ ' exp:\n' +
515
+ ' type: number\n' +
516
+ ' description: >-\n' +
517
+ ' Expiration claim - The time this token will expire, expressed in\n' +
518
+ ' epoch ms\n' +
519
+ ' iss:\n' +
520
+ ' type: string\n' +
521
+ ' description: Issuer claim - Who created the token\n' +
522
+ ' sub:\n' +
523
+ ' type: string\n' +
524
+ ' description: Subject claim - The target of the token (typically user email)\n' +
525
+ ' iat:\n' +
526
+ ' type: number\n' +
527
+ ' description: >-\n' +
528
+ ' Issued at claim - The time this token was created, expressed in\n' +
529
+ ' epoch ms\n' +
530
+ ' user:\n' +
531
+ ' type: object\n' +
532
+ ' description: Object describing the user authenticated by this token\n' +
533
+ ' ApiErrorResponse:\n' +
534
+ ' type: object\n' +
535
+ ' title: API Error Response\n' +
536
+ ' required:\n' +
537
+ ' - errors\n' +
538
+ ' - httpStatusCode\n' +
539
+ ' properties:\n' +
540
+ ' errors:\n' +
541
+ ' type: array\n' +
542
+ ' items:\n' +
543
+ ' type: string\n' +
544
+ ' description: List of the errors that occurred\n' +
545
+ ' httpStatusCode:\n' +
546
+ ' type: number\n' +
547
+ ' description: Http status code of this error\n' +
548
+ ' detailCode:\n' +
549
+ ' type: number\n' +
550
+ ' description: Adomni detail status code for this error\n' +
551
+ ' BackgroundQueueResponse:\n' +
552
+ ' type: object\n' +
553
+ ' title: Background Queue Response\n' +
554
+ ' description: When any of the background endpoints are hit, this is what will be returned\n' +
555
+ ' required:\n' +
556
+ ' - resultId\n' +
557
+ ' - success\n' +
558
+ ' properties:\n' +
559
+ ' processHandling:\n' +
560
+ ' type: string\n' +
561
+ " enum: ['Queued', 'Immediate']\n" +
562
+ ' success:\n' +
563
+ ' type: boolean\n' +
564
+ ' resultId:\n' +
565
+ ' type: string\n' +
566
+ ' BackgroundMetaResponse:\n' +
567
+ ' type: object\n' +
568
+ ' title: Background Meta Response\n' +
569
+ ' description: If\n' +
570
+ ' properties:\n' +
571
+ ' validTypes:\n' +
572
+ ' type: array\n' +
573
+ ' items:\n' +
574
+ ' type: string\n' +
575
+ ' currentQueueLength:\n' +
576
+ ' type: number\n' +
577
+ '\n' +
578
+ ' BackgroundSampleInputValidatedProcessorData:\n' +
579
+ ' type: object\n' +
580
+ ' title: BackgroundSampleInputValidatedProcessorData\n' +
581
+ ' description: This is used for testing the background validator\n' +
582
+ ' required:\n' +
583
+ ' - nameParam\n' +
584
+ ' - numberParam\n' +
585
+ ' properties:\n' +
586
+ ' nameParam:\n' +
587
+ ' type: string\n' +
588
+ ' description: A sample name parameter\n' +
589
+ ' minimum: 0\n' +
590
+ ' maximum: 10\n' +
591
+ ' numberParam:\n' +
592
+ ' type: number\n' +
593
+ ' description: A sample number parameter\n';
594
+
595
+ public static readonly SAMPLE_SERVER_GRAPHQL: string =
596
+ 'schema {\n' +
597
+ ' query: RootQueryType\n' +
598
+ '}\n' +
599
+ '\n' +
600
+ 'type RootQueryType {\n' +
601
+ ' serverMeta: ServerMeta\n' +
602
+ ' forceTimeout: ForceTimeout\n' +
603
+ '}\n' +
604
+ '\n' +
605
+ 'type ServerMeta {\n' +
606
+ ' version: String\n' +
607
+ ' serverTime: String\n' +
608
+ ' status: String\n' +
609
+ '}\n' +
610
+ '\n' +
611
+ 'type ForceTimeout {\n' +
612
+ ' placeholder: String\n' +
613
+ '}\n';
614
+ }