@zuplo/runtime 5.2153.0 → 5.2154.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 (32) hide show
  1. package/{index.min.cjs → out/cjs/index.js} +1 -1
  2. package/{internal.min.cjs → out/cjs/internal/index.js} +1 -1
  3. package/{mocks.min.cjs → out/cjs/mocks/index.js} +1 -1
  4. package/out/cjs/policies/axiomatics-authz-inbound/exports.js +36 -0
  5. package/out/cjs/policies/axiomatics-authz-inbound/exports.js.LEGAL.txt +10 -0
  6. package/out/esm/chunk-4DUPDUSC.js +26 -0
  7. package/out/esm/chunk-CI735RIK.js +36 -0
  8. package/out/esm/chunk-CI735RIK.js.LEGAL.txt +10 -0
  9. package/out/esm/chunk-HPMPWPKQ.js +26 -0
  10. package/out/esm/chunk-HPMPWPKQ.js.LEGAL.txt +0 -0
  11. package/out/esm/chunk-QSL25HFO.js +26 -0
  12. package/out/esm/chunk-QSL25HFO.js.LEGAL.txt +0 -0
  13. package/out/esm/index.js +65 -0
  14. package/{index.min.js.LEGAL.txt → out/esm/index.js.LEGAL.txt} +0 -10
  15. package/out/esm/internal/index.js +26 -0
  16. package/out/esm/internal/index.js.LEGAL.txt +0 -0
  17. package/out/esm/mocks/index.js +26 -0
  18. package/out/esm/mocks/index.js.LEGAL.txt +0 -0
  19. package/out/esm/policies/axiomatics-authz-inbound/exports.js +26 -0
  20. package/out/esm/policies/axiomatics-authz-inbound/exports.js.LEGAL.txt +0 -0
  21. package/out/types/policies/axiomatics-authz-inbound/exports.d.ts +106 -0
  22. package/package.json +16 -24
  23. package/index.min.js +0 -75
  24. package/mocks.min.js +0 -26
  25. package/types-public.d.ts +0 -3796
  26. /package/{index.min.cjs.LEGAL.txt → out/cjs/index.js.LEGAL.txt} +0 -0
  27. /package/{internal.min.cjs.LEGAL.txt → out/cjs/internal/index.js.LEGAL.txt} +0 -0
  28. /package/{mocks.min.cjs.LEGAL.txt → out/cjs/mocks/index.js.LEGAL.txt} +0 -0
  29. /package/{mocks.min.js.LEGAL.txt → out/esm/chunk-4DUPDUSC.js.LEGAL.txt} +0 -0
  30. /package/{types-beta.d.ts → out/types/index.d.ts} +0 -0
  31. /package/{internal.d.ts → out/types/internal/index.d.ts} +0 -0
  32. /package/{mocks.d.ts → out/types/mocks/index.d.ts} +0 -0
package/types-public.d.ts DELETED
@@ -1,3796 +0,0 @@
1
- import { KeyLike } from 'jose';
2
- import type { ValidateFunction as ValidateFunction_2 } from 'ajv';
3
-
4
- /**
5
- * Amberflo is a usage metering and billing service. This policy allows you to send metering calls for each API to their meter ingest endpoint.
6
- *
7
- * @remarks
8
- * Amberflo {@link https://www.amberflo.io|amberflo.com} is a usage metering and
9
- * billing service. This policy allows you to meter API calls going through Zuplo
10
- * and send them to your Amberflo account using your Amberflo API key.
11
- *
12
- * Add the policy to each route you want to meter. Note you can specify the Meter
13
- * API Name and Meter Value (meter increment) at the policy level.
14
- *
15
- * @title Amberflo Metering / Billing
16
- * @public
17
- * @param request - The ZuploRequest
18
- * @param context - The ZuploContext
19
- * @param options - The policy options set in policies.json
20
- * @param policyName - The name of the policy as set in policies.json
21
- * @returns A Request or a Response
22
- */
23
- export declare function AmberfloMeteringInboundPolicy(request: ZuploRequest, context: ZuploContext, options: AmberfloMeteringInboundPolicyOptions, policyName: string): Promise<ZuploRequest<RequestGeneric>>;
24
-
25
- /**
26
- * The options for this policy. Many of them can be overridden at the code level in a request using the `AmberfloMeteringPolicy.setRequestProperties` method.
27
- */
28
- export declare interface AmberfloMeteringInboundPolicyOptions {
29
- /**
30
- * The API key to use when sending metering calls to Amberflo.
31
- */
32
- apiKey: string;
33
- /**
34
- * The name of the meter to use when sending metering calls to Amberflo (overridable in code).
35
- */
36
- meterApiName?: string;
37
- /**
38
- * The value to use when sending metering calls to Amberflo (overridable in code).
39
- */
40
- meterValue?: number;
41
- /**
42
- * The path to the property on `request.user` contains the customer ID. For example `.data.accountNumber` would read the `request.user.data.accountNumber` property.
43
- */
44
- customerIdPropertyPath?: string;
45
- /**
46
- * The default customerId for all metering calls - overridable in code and by `customerIdPropertyPath`.
47
- */
48
- customerId?: string;
49
- /**
50
- * A dictionary of dimensions to be sent to Amberflo (extensible in code).
51
- */
52
- dimensions?: {
53
- [k: string]: string;
54
- };
55
- /**
56
- * A list of successful status codes and ranges "200-299, 304" that should trigger a metering call to Amberflo.
57
- */
58
- statusCodes?: string | number[];
59
- /**
60
- * The URL to send metering events. This is useful for testing purposes.
61
- */
62
- url?: string;
63
- }
64
-
65
- declare interface AmberfloMeteringIngestPayload {
66
- customerId: string;
67
- meterApiName: string;
68
- meterValue: number;
69
- meterTimeInMillis: number;
70
- dimensions: Record<string, string>;
71
- }
72
-
73
- export declare class AmberfloMeteringPolicy {
74
- static setRequestProperties(context: ZuploContext, properties: AmberfloMeteringProperties): void;
75
- }
76
-
77
- declare interface AmberfloMeteringProperties extends Omit<AmberfloMeteringIngestPayload, "meterTimeInMillis"> {
78
- customerId: string;
79
- }
80
-
81
- /**
82
- * Authenticates requests based on API Keys using Zuplo API Management. You
83
- * can learn more about the Zuplo API Key Service
84
- * [here](https://zuplo.com/docs/articles/api-key-api#buckets)
85
- *
86
- * @remarks
87
- * This policy uses the managed API key storage provided by Zuplo.
88
- * `allowUnauthenticatedRequests` defaults to false and rejects any request without
89
- * a valid API key (returning a `401 - Unauthorized` response). You can override
90
- * (set `"allowUnauthenticatedRequests" : true`) this to support multiple
91
- * authentication methods or support both authenticated and anonymous requests.
92
- *
93
- * @deprecated Please use the new {@link https://zuplo.com/docs/policies/api-key-inbound|API Key Authentication} policy
94
- * instead. This policy will continue to work but will be removed in a future
95
- * version of Zuplo.
96
- * @hidden
97
- * @title API Key Authentication
98
- * @public
99
- * @param request - The ZuploRequest
100
- * @param context - The ZuploContext
101
- * @param unparsedOptions - The policy options set in policies.json
102
- * @param policyName - The name of the policy as set in policies.json
103
- * @returns A Request or a Response
104
- */
105
- export declare const ApiAuthKeyInboundPolicy: typeof ApiKeyInboundPolicy;
106
-
107
- /**
108
- * @deprecated
109
- * The options for this policy.
110
- */
111
- export declare interface ApiAuthKeyInboundPolicyOptions {
112
- /**
113
- * If 'true' allows the request to continue even if authenticated. When 'false' (the default) any unauthenticated request is automatically rejected with a 401.
114
- */
115
- allowUnauthenticatedRequests?: boolean;
116
- }
117
-
118
- /**
119
- * Authenticates requests based on API Keys using Zuplo API Management. You can learn more about the Zuplo API Key Service [here](https://zuplo.com/docs/articles/api-key-api#buckets)
120
- *
121
- * @remarks
122
- * Authenticate requests with Zuplo's fully managed API Key service. This policy is
123
- * the easiest way to secure your API and can be combined with other policies like
124
- * Rate limiting, quotas, and more to build a fully featured API to support your
125
- * partners, developers, or customers.
126
- *
127
- * For more information on Zuplo's API Key Management service and options enabling
128
- * self-serve API Key management see the following resources:
129
- *
130
- * - {@link https://zuplo.com/docs/articles/api-key-management|API Key Authentication Overview}
131
- * - {@link https://zuplo.com/docs/articles/api-key-api|API Key Management API}
132
- *
133
- * @title API Key Authentication
134
- * @public
135
- * @param request - The ZuploRequest
136
- * @param context - The ZuploContext
137
- * @param unparsedOptions - The policy options set in policies.json
138
- * @param policyName - The name of the policy as set in policies.json
139
- * @returns A Request or a Response
140
- */
141
- export declare function ApiKeyInboundPolicy(request: ZuploRequest, context: ZuploContext, unparsedOptions: ApiKeyInboundPolicyOptions, policyName: string): Promise<ZuploRequest<RequestGeneric> | Response>;
142
-
143
- /**
144
- * The options for this policy.
145
- */
146
- export declare interface ApiKeyInboundPolicyOptions {
147
- /**
148
- * The name of the header with the key.
149
- */
150
- authHeader?: string;
151
- /**
152
- * The scheme used on the header.
153
- */
154
- authScheme?: string;
155
- /**
156
- * The name of the API Key service bucket. Defaults to the autogenerated bucket name for your project.
157
- */
158
- bucketName?: string;
159
- /**
160
- * If requests should proceed even if the policy does not successfully authenticate the request. Defaults to false and rejects any request without a valid API key (returning a `401 - Unauthorized` response). Set to `true` to support multiple authentication methods or support both authenticated and anonymous requests.
161
- */
162
- allowUnauthenticatedRequests?: boolean;
163
- /**
164
- * The time to cache authentication results for a particular key. Higher values will decrease latency. Cached results will be valid until the cache expires even in the event the key is deleted, etc.
165
- */
166
- cacheTtlSeconds?: number;
167
- /**
168
- * Zuplo will automatically document your API key header within your OpenAPI specification & Developer Portal. Set this to `true` to disable this behavior.
169
- */
170
- disableAutomaticallyAddingKeyHeaderToOpenApi?: boolean;
171
- }
172
-
173
- /**
174
- * A list of attributes that will be included in the authorization request.
175
- */
176
- declare type Attribute = ({
177
- /**
178
- * The attribute ID that will be used in the PDP request.
179
- */
180
- attributeId: string;
181
- /**
182
- * A JSON path expression that selects the value of the attribute from incoming request.
183
- */
184
- valueSelector: string;
185
- } | {
186
- /**
187
- * The attribute ID that will be used in the PDP request.
188
- */
189
- attributeId: string;
190
- /**
191
- * The value of the attribute.
192
- */
193
- value: string;
194
- })[];
195
-
196
- declare interface Attribute_2 {
197
- AttributeId: string;
198
- Value: string | boolean | number | string[] | boolean[] | number[];
199
- Issuer?: string;
200
- DataType?: string;
201
- IncludeInResult?: boolean;
202
- }
203
-
204
- export declare interface AuditLogDataStaxInit {
205
- url: string;
206
- xCassandraToken: string;
207
- }
208
-
209
- export declare class AuditLogDataStaxProvider implements AuditLogOutputProvider {
210
- #private;
211
- constructor(options: AuditLogDataStaxInit);
212
- writeLogBatch: (entries: AuditLogEntry[]) => Promise<void>;
213
- }
214
-
215
- declare interface AuditLogEntry {
216
- timestamp: Date;
217
- durationMs: number;
218
- routePath: string;
219
- requestId: string;
220
- userSub?: string;
221
- request: {
222
- url: string;
223
- method: HttpMethod;
224
- headers?: Record<string, string>;
225
- body?: string;
226
- };
227
- response: {
228
- status: number;
229
- statusText: string;
230
- headers?: Record<string, string>;
231
- body?: string;
232
- };
233
- }
234
-
235
- export declare interface AuditLogInit {
236
- requestFilter?: AuditLogRequestFilter;
237
- include?: {
238
- request?: {
239
- headers?: boolean;
240
- body?: boolean;
241
- };
242
- response?: {
243
- headers?: boolean;
244
- body?: boolean;
245
- };
246
- };
247
- }
248
-
249
- declare interface AuditLogOutputProvider {
250
- writeLogBatch: (entries: AuditLogEntry[]) => Promise<void>;
251
- }
252
-
253
- export declare class AuditLogPlugin extends SystemRuntimePlugin {
254
- #private;
255
- constructor(outputProvider: AuditLogOutputProvider, init?: AuditLogInit);
256
- initialize(runtimeInit: RuntimeExtensions): Promise<void>;
257
- }
258
-
259
- declare interface AuditLogRequestFilter {
260
- (request: ZuploRequest, context: ZuploContext): Promise<boolean>;
261
- }
262
-
263
- /**
264
- * Authenticate users using Auth0 issued JWT tokens.
265
- *
266
- * @remarks
267
- * Authenticate requests with JWT tokens issued by Auth0. This is a customized
268
- * version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy} specifically
269
- * for Auth0.
270
- *
271
- * @title Auth0 JWT Auth
272
- * @public
273
- * @param request - The ZuploRequest
274
- * @param context - The ZuploContext
275
- * @param options - The policy options set in policies.json
276
- * @param policyName - The name of the policy as set in policies.json
277
- * @returns A Request or a Response
278
- */
279
- export declare const Auth0JwtInboundPolicy: InboundPolicyHandler<Auth0JwtInboundPolicyOptions>;
280
-
281
- /**
282
- * The options for this policy.
283
- */
284
- export declare interface Auth0JwtInboundPolicyOptions {
285
- /**
286
- * Allow unauthenticated requests to proceed. This is use useful if you want to use multiple authentication policies or if you want to allow both authenticated and non-authenticated traffic.
287
- */
288
- allowUnauthenticatedRequests?: boolean;
289
- /**
290
- * Your Auth0 domain. For example, `my-company.auth0.com`.
291
- */
292
- auth0Domain: string;
293
- /**
294
- * The Auth0 audience of your API, for example `https://api.example.com/`.
295
- */
296
- audience?: string;
297
- }
298
-
299
- declare interface AwsLambdaEventV1 {
300
- [key: string]: string | null | undefined | number | boolean | object;
301
- version: "1.0";
302
- resource: string;
303
- path: string;
304
- httpMethod: string;
305
- headers: Record<string, string>;
306
- multiValueHeaders: Record<string, string[]>;
307
- queryStringParameters: Record<string, string>;
308
- multiValueQueryStringParameters: Record<string, string[]>;
309
- requestContext: {
310
- accountId: string | null;
311
- apiId: string | null;
312
- authorizer: {
313
- claims: Record<string, string>;
314
- scopes: string[];
315
- };
316
- domainName: string;
317
- domainPrefix: string | null;
318
- extendedRequestId: string;
319
- httpMethod: string;
320
- identity: {
321
- accessKey: null | string;
322
- accountId: null | string;
323
- caller: null | string;
324
- cognitoAuthenticationProvider: null | string;
325
- cognitoAuthenticationType: null | string;
326
- cognitoIdentityId: null | string;
327
- cognitoIdentityPoolId: null | string;
328
- principalOrgId: null | string;
329
- sourceIp: string | null;
330
- user: null | string;
331
- userAgent: string | null;
332
- userArn: null | string;
333
- clientCert: {
334
- clientCertPem: null | string;
335
- subjectDN: null | string;
336
- issuerDN: null | string;
337
- serialNumber: null | string;
338
- validity: {
339
- notBefore: null | string;
340
- notAfter: null | string;
341
- };
342
- };
343
- };
344
- path: string;
345
- protocol: string;
346
- requestId: string;
347
- requestTime: string;
348
- requestTimeEpoch: number;
349
- resourceId: string | null;
350
- resourcePath: string;
351
- stage: null | string;
352
- };
353
- pathParameters: Record<string, string>;
354
- stageVariables: null | Record<string, string>;
355
- }
356
-
357
- declare interface AwsLambdaEventV2 {
358
- [key: string]: string | null | undefined | number | boolean | object;
359
- version: "2.0";
360
- routeKey: string | null;
361
- rawPath: string;
362
- rawQueryString: string;
363
- cookies: string[];
364
- headers: Record<string, string>;
365
- queryStringParameters: Record<string, string>;
366
- requestContext: {
367
- accountId: string | null;
368
- apiId: string | null;
369
- authentication: {
370
- clientCert: {
371
- clientCertPem: string | null;
372
- subjectDN: string | null;
373
- issuerDN: string | null;
374
- serialNumber: string | null;
375
- validity: {
376
- notBefore: string | null;
377
- notAfter: string | null;
378
- };
379
- };
380
- };
381
- authorizer: {
382
- jwt: {
383
- claims: Record<string, string>;
384
- scopes: string[];
385
- };
386
- };
387
- domainName: string | null;
388
- domainPrefix: string | null;
389
- http: {
390
- method: string;
391
- path: string;
392
- protocol: string;
393
- sourceIp: string | null;
394
- userAgent: string | null;
395
- };
396
- requestId: string;
397
- routeKey: string | null;
398
- stage: null;
399
- time: string;
400
- timeEpoch: number;
401
- };
402
- pathParameters: Record<string, string>;
403
- stageVariables: string | null;
404
- }
405
-
406
- /* Excluded from this release type: awsLambdaHandler */
407
-
408
- export declare const AwsLambdaHandlerExtensions: {
409
- addSendingAwsLambdaEventHook: (hook: OnSendingAwsLambdaEventHook) => void;
410
- };
411
-
412
- declare interface AWSLoggingOptions {
413
- region: string;
414
- accessKeyId: string;
415
- secretAccessKey: string;
416
- logGroupName: string;
417
- logStreamName: string;
418
- }
419
-
420
- export declare class AWSLoggingPlugin extends LogPlugin {
421
- private options;
422
- constructor(options: AWSLoggingOptions);
423
- /* Excluded from this release type: getTransport */
424
- }
425
-
426
- /* Excluded from this release type: AxiomaticsAuthZInboundPolicy */
427
-
428
- /**
429
- * The options for this policy.
430
- */
431
- export declare interface AxiomaticsAuthZInboundPolicyOptions {
432
- /**
433
- * Indicates whether the request should continue if authorization fails. Default is `false` which means unauthorized users will automatically receive a 403 response.
434
- */
435
- allowUnauthorizedRequests?: boolean;
436
- /**
437
- * The URL to which the plugin will make a JSON POST request before proxying the original request.
438
- */
439
- pdpUrl: string;
440
- /**
441
- * The username to use when authenticating with the PDP.
442
- */
443
- pdpUsername: string;
444
- /**
445
- * The password to use when authenticating with the PDP.
446
- */
447
- pdpPassword: string;
448
- /**
449
- * Indicates whether the plugin should include default action attributes in the authorization request.
450
- */
451
- includeDefaultActionAttributes?: boolean;
452
- /**
453
- * Indicates whether the plugin should include default resource attributes in the authorization request.
454
- */
455
- includeDefaultResourceAttributes?: boolean;
456
- /**
457
- * Indicates whether the plugin should include default subject attributes in the authorization request.
458
- */
459
- includeDefaultSubjectAttributes?: boolean;
460
- /**
461
- * The name of the header that carries the JWT.
462
- */
463
- tokenHeaderName?: string;
464
- accessSubjectAttributes?: Attribute;
465
- resourceAttributes?: Attribute;
466
- actionAttributes?: Attribute;
467
- }
468
-
469
- export declare class BackgroundDispatcher<TPayload> {
470
- #private;
471
- constructor(dispatcher: DispatchFunction<TPayload>, options: BatchDispatcherOptions);
472
- enqueue: (payload: TPayload) => void;
473
- }
474
-
475
- export declare class BackgroundLoader<T = unknown> {
476
- #private;
477
- /**
478
- * @deprecated Use constructor(loader: BackgroundLoaderFunction<T>, options: BackgroundLoaderOptions) instead
479
- */
480
- constructor(loader: BackgroundLoaderFunction<T>, ttlSeconds: number);
481
- constructor(loader: BackgroundLoaderFunction<T>, options: BackgroundLoaderOptions);
482
- get(key: string): Promise<T>;
483
- }
484
-
485
- declare interface BackgroundLoaderFunction<T> {
486
- (key: string): Promise<T>;
487
- }
488
-
489
- declare interface BackgroundLoaderOptions {
490
- ttlSeconds: number;
491
- loaderTimeoutSeconds?: number;
492
- }
493
-
494
- /* Excluded from this release type: BaseCryptoBeta */
495
-
496
- /* Excluded from this release type: BaseKeyValueStore */
497
-
498
- /**
499
- * An account object.
500
- */
501
- declare interface BasicAuthAccount {
502
- /**
503
- * The username for the account (this will be the `sub` property on `request.user`.
504
- */
505
- username: string;
506
- /**
507
- * The password for the account - note we recommend storing this in environment variables.
508
- */
509
- password: string;
510
- /**
511
- * The data payload you want associated with this account (this will be the `data` property on `request.user`).
512
- */
513
- data?: {
514
- [k: string]: unknown;
515
- };
516
- }
517
-
518
- /**
519
- * Authenticate requests using basic auth (i.e. username and password)
520
- *
521
- * @remarks
522
- * The Basic Authentication policy allows you to authenticate incoming requests
523
- * using the Basic authentication standard. You can configure multiple accounts
524
- * with different passwords and a different bucket of user 'data'.
525
- *
526
- * The API will expect a Basic Auth header (you can generate samples
527
- * {@link https://www.debugbear.com/basic-auth-header-generator|here}). Requests with
528
- * invalid credentials (or no header) will not be authenticated. Authenticated
529
- * requests will populate the `user` property of the `ZuploRequest` parameter on
530
- * your RequestHandler.
531
- *
532
- * @title Basic Auth
533
- * @public
534
- * @param request - The ZuploRequest
535
- * @param context - The ZuploContext
536
- * @param options - The policy options set in policies.json
537
- * @param policyName - The name of the policy as set in policies.json
538
- * @returns A Request or a Response
539
- */
540
- export declare const BasicAuthInboundPolicy: InboundPolicyHandler<BasicAuthInboundPolicyOptions>;
541
-
542
- /**
543
- * The options for this policy.
544
- */
545
- export declare interface BasicAuthInboundPolicyOptions {
546
- /**
547
- * An array of account objects (username, password and data properties).
548
- */
549
- accounts: BasicAuthAccount[];
550
- /**
551
- * If 'true' allows the request to continue even if authenticated. When 'false' (the default) any unauthenticated request is automatically rejected with a 401.
552
- */
553
- allowUnauthenticatedRequests?: boolean;
554
- }
555
-
556
- /* Excluded from this release type: BatchDispatch */
557
-
558
- declare interface BatchDispatcherOptions {
559
- msDelay: number;
560
- name?: string;
561
- }
562
-
563
- /**
564
- * Authenticate requests based on the mTLS protocol.
565
- *
566
- * @remarks
567
- * The brownout policy allows performing scheduled downtime on your API. This can
568
- * be useful for helping notify clients of an impending deprecation or for
569
- * scheduling maintenance.
570
- *
571
- * This policy uses {@link https://crontab.guru|cron schedules} to check if a request
572
- * should experience a brownout or not. When a request falls into a scheduled
573
- * brownout an error response will be return. The error response can be customized
574
- * by setting the `problem` properties.
575
- *
576
- * For more information using brownouts to alert clients on impending API
577
- * changes/deprecations see our blog post
578
- * {@link https://zuplo.com/blog/2022/05/17/how-to-version-an-api|How to version an API}
579
- *
580
- * @title Brown Out
581
- * @public
582
- * @param request - The ZuploRequest
583
- * @param context - The ZuploContext
584
- * @param options - The policy options set in policies.json
585
- * @param policyName - The name of the policy as set in policies.json
586
- * @returns A Request or a Response
587
- */
588
- export declare class BrownoutInboundPolicy extends InboundPolicy<BrownoutInboundPolicyOptions> {
589
- crons: Cron[];
590
- constructor(options: BrownoutInboundPolicyOptions, policyName: string);
591
- handler(request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest | Response>;
592
- }
593
-
594
- /**
595
- * The options for this policy.
596
- */
597
- export declare interface BrownoutInboundPolicyOptions {
598
- /**
599
- * The cron schedule for when this policy is enabled. This can be a single cron string or an array of multiple cron strings.
600
- */
601
- cronSchedule: string | string[];
602
- /**
603
- * The problem that is returned in the response body when this policy is enabled.
604
- */
605
- problem?: {
606
- /**
607
- * The type of problem.
608
- */
609
- type?: string;
610
- /**
611
- * The title of problem.
612
- */
613
- title?: string;
614
- /**
615
- * The detail of problem.
616
- */
617
- detail?: string;
618
- /**
619
- * Http status code of the problem.
620
- */
621
- status?: number;
622
- [k: string]: unknown;
623
- };
624
- }
625
-
626
- /* Excluded from this release type: BuildEnvironment */
627
-
628
- declare interface BuildRouteConfiguration {
629
- path: string;
630
- methods: HttpMethod[];
631
- /**
632
- /* @deprecated This property is not used and will be removed in future versions
633
- */
634
- label?: string;
635
- /**
636
- /* @deprecated This property is not used and will be removed in future versions
637
- */
638
- key?: string;
639
- handler: HandlerDefinition;
640
- corsPolicy?: CorsPolicy;
641
- /**
642
- /* @deprecated This property is deprecated. Use route.raw() instead.
643
- */
644
- custom?: any;
645
- /**
646
- /* @deprecated This property is not used and will be removed in future versions
647
- */
648
- version: string;
649
- policies?: {
650
- inbound?: string[];
651
- outbound?: string[];
652
- };
653
- /**
654
- /* @deprecated This property is deprecated. Use route.raw() instead.
655
- */
656
- excludeFromOpenApi?: boolean;
657
- pathPattern?: string;
658
- /* Excluded from this release type: raw */
659
- }
660
-
661
- /**
662
- * Internal
663
- */
664
- declare interface CacheOptions {
665
- logger?: Logger;
666
- }
667
-
668
- /**
669
- * Respond to matched incoming requests with cached content
670
- *
671
- * @title Caching
672
- * @public
673
- * @param request - The ZuploRequest
674
- * @param context - The ZuploContext
675
- * @param options - The policy options set in policies.json
676
- * @param policyName - The name of the policy as set in policies.json
677
- * @returns A Request or a Response
678
- */
679
- export declare function CachingInboundPolicy(request: ZuploRequest, context: ZuploContext, options: CachingInboundPolicyOptions, policyName: string): Promise<ZuploRequest<RequestGeneric> | Response>;
680
-
681
- /**
682
- * The options for this policy.
683
- */
684
- export declare interface CachingInboundPolicyOptions {
685
- /**
686
- * Specifies an id or 'key' for this policy to store cache. This is useful for cache-busting. For example, set this property to an env var and if you change that env var value, you invalidate the cache.
687
- */
688
- cacheId?: string;
689
- /**
690
- * By default, the Authorization header is always considered in the caching policy. You can disable by setting this to `true`.
691
- */
692
- dangerouslyIgnoreAuthorizationHeader?: boolean;
693
- /**
694
- * The headers to be considered when caching.
695
- */
696
- headers?: string[];
697
- /**
698
- * HTTP Methods to be cached. Valid methods are: GET, POST, PUT, PATCH, DELETE, HEAD.
699
- */
700
- cacheHttpMethods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD")[];
701
- /**
702
- * The timeout of the cache in seconds.
703
- */
704
- expirationSecondsTtl?: number;
705
- /**
706
- * Response status codes to be cached.
707
- */
708
- statusCodes?: number[];
709
- }
710
-
711
- declare interface Category {
712
- Id?: string;
713
- CategoryId?: string;
714
- Content?: string;
715
- Attribute: Attribute_2[];
716
- }
717
-
718
- /**
719
- * Changes the HTTP method of the incoming request.
720
- *
721
- * @title Change Method
722
- * @public
723
- * @param request - The ZuploRequest
724
- * @param context - The ZuploContext
725
- * @param options - The policy options set in policies.json
726
- * @param policyName - The name of the policy as set in policies.json
727
- * @returns A Request or a Response
728
- */
729
- export declare const ChangeMethodInboundPolicy: InboundPolicyHandler<ChangeMethodInboundPolicyOptions>;
730
-
731
- /**
732
- * The options for this policy.
733
- */
734
- export declare interface ChangeMethodInboundPolicyOptions {
735
- /**
736
- * The HTTP Method to be used, e.g. POST, GET, PUT, PATCH, etc.
737
- */
738
- method: string;
739
- }
740
-
741
- /**
742
- * Removes all headers from the incoming request except for those in the exclude list.
743
- *
744
- * @title Clear Request Headers
745
- * @public
746
- * @param request - The ZuploRequest
747
- * @param context - The ZuploContext
748
- * @param options - The policy options set in policies.json
749
- * @param policyName - The name of the policy as set in policies.json
750
- * @returns A Request or a Response
751
- */
752
- export declare const ClearHeadersInboundPolicy: InboundPolicyHandler<ClearHeadersInboundPolicyOptions>;
753
-
754
- /**
755
- * The options for this policy.
756
- */
757
- export declare interface ClearHeadersInboundPolicyOptions {
758
- /**
759
- * The headers that should not be removed.
760
- */
761
- exclude?: string[];
762
- }
763
-
764
- /**
765
- * Removes all headers from the response except for those in the exclude list.
766
- *
767
- * @title Clear Response Headers
768
- * @public
769
- * @param request - The ZuploRequest
770
- * @param context - The ZuploContext
771
- * @param options - The policy options set in policies.json
772
- * @param policyName - The name of the policy as set in policies.json
773
- * @returns A Request or a Response
774
- */
775
- export declare const ClearHeadersOutboundPolicy: OutboundPolicyHandler<ClearHeadersOutboundPolicyOptions>;
776
-
777
- /**
778
- * The options for this policy.
779
- */
780
- export declare interface ClearHeadersOutboundPolicyOptions {
781
- /**
782
- * The headers that should not be removed.
783
- */
784
- exclude?: string[];
785
- }
786
-
787
- /**
788
- * Authenticate users using Clerk issued JWT tokens.
789
- *
790
- * @remarks
791
- * Authenticate requests with JWT tokens issued by Clerk. This is a customized
792
- * version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy} specifically
793
- * for Clerk.
794
- *
795
- * @title Clerk JWT Auth
796
- * @public
797
- * @param request - The ZuploRequest
798
- * @param context - The ZuploContext
799
- * @param options - The policy options set in policies.json
800
- * @param policyName - The name of the policy as set in policies.json
801
- * @returns A Request or a Response
802
- */
803
- export declare const ClerkJwtInboundPolicy: InboundPolicyHandler<ClerkJwtInboundPolicyOptions>;
804
-
805
- /**
806
- * The options for this policy.
807
- */
808
- export declare interface ClerkJwtInboundPolicyOptions {
809
- /**
810
- * Allow unauthenticated requests to proceed. This is use useful if you want to use multiple authentication policies or if you want to allow both authenticated and non-authenticated traffic.
811
- */
812
- allowUnauthenticatedRequests?: boolean;
813
- /**
814
- * Your Clerk frontend api url, i.e. `https://sensible-skunk-49.clerk.accounts.dev`. Can be found in the Clerk portal: https://dashboard.clerk.com/last-active?path=api-keys.
815
- */
816
- frontendApiUrl: string;
817
- }
818
-
819
- /**
820
- * Authenticate requests with JWT tokens issued by AWS Cognito.
821
- *
822
- * @remarks
823
- * Authenticate requests with JWT tokens issued by AWS Cognito. This is a
824
- * customized version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy}
825
- * specifically for AWS Cognito.
826
- *
827
- * See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
828
- * about OAuth authorization in Zuplo.
829
- *
830
- * @title AWS Cognito JWT Auth
831
- * @public
832
- * @param request - The ZuploRequest
833
- * @param context - The ZuploContext
834
- * @param options - The policy options set in policies.json
835
- * @param policyName - The name of the policy as set in policies.json
836
- * @returns A Request or a Response
837
- */
838
- export declare const CognitoJwtInboundPolicy: InboundPolicyHandler<CognitoJwtInboundPolicyOptions>;
839
-
840
- /**
841
- * The options for this policy.
842
- */
843
- export declare interface CognitoJwtInboundPolicyOptions {
844
- /**
845
- * Allow unauthenticated requests to proceed. This is use useful if you want to use multiple authentication policies or if you want to allow both authenticated and non-authenticated traffic.
846
- */
847
- allowUnauthenticatedRequests?: boolean;
848
- /**
849
- * The AWS region where your Cognito instance is deployed.
850
- */
851
- region: string;
852
- /**
853
- * The user pool identifier.
854
- */
855
- userPoolId: string;
856
- }
857
-
858
- /**
859
- * The compatibility date on which to run the gateway
860
- */
861
- declare type CompatibilityDate = "2023-03-14" | "2024-01-15" | "2024-03-14";
862
-
863
- declare interface CompatibilityFlags {
864
- /**
865
- * Whether or not outbound policies should run if the response from the
866
- * handlers is not `response.ok`
867
- *
868
- * @compatibilityDate 2024-01-15
869
- */
870
- runOutboundPoliciesOnHandlerOnAllStatuses: boolean;
871
- /**
872
- * Whether or not hooks run on system routes
873
- *
874
- * @compatibilityDate 2024-01-15
875
- */
876
- doNotRunHooksOnSystemRoutes: boolean;
877
- /**
878
- * Remove all vendor (cf-, zp-) headers except for the specific
879
- * list of allowed headers
880
- *
881
- * @compatibilityDate 2024-01-15
882
- */
883
- removeAllVendorHeadersExceptListed: boolean;
884
- }
885
-
886
- /**
887
- * Creates a composite, or group policy - composed of other policies. For reuse across routes.
888
- *
889
- * @remarks
890
- * The Composite policy allows you to create groups of other policies, for easy
891
- * reuse across multiple routes. Other policies are referenced by their `name`.
892
- *
893
- * Be careful not to create circular references which can cause your gateway to
894
- * fail.
895
- *
896
- * @title Composite Inbound (Group Policies)
897
- * @public
898
- * @param request - The ZuploRequest
899
- * @param context - The ZuploContext
900
- * @param options - The policy options set in policies.json
901
- * @param policyName - The name of the policy as set in policies.json
902
- * @returns A Request or a Response
903
- */
904
- export declare const CompositeInboundPolicy: InboundPolicyHandler<CompositeInboundPolicyOptions>;
905
-
906
- /**
907
- * The options for this policy.
908
- */
909
- export declare interface CompositeInboundPolicyOptions {
910
- /**
911
- * The list of policy references (beware circular references).
912
- */
913
- policies?: string[];
914
- }
915
-
916
- /**
917
- * Errors caused by invalid user configuration -i.e. invalid parameters on policies,
918
- * handlers that are not functions, etc. This is not for zuplo system configuration errors,
919
- * use SystemError for that.
920
- * @public
921
- */
922
- export declare class ConfigurationError extends RuntimeError {
923
- constructor(message: string, options?: ErrorOptions);
924
- }
925
-
926
- /* Excluded from this release type: ContentTypes */
927
-
928
- /**
929
- * Utility for storing data across the lifecycle of a request. This class is
930
- * useful for storing and retrieving data that is shared between policies.
931
- *
932
- * @public
933
- *
934
- * @example
935
- * Using static methods
936
- * ```
937
- * ContextData.set(context, "my-data", { prop1: "hello world" });
938
- *
939
- * const data = ContextData.get(context, "my-data");
940
- * ContextData.set(context, data);
941
- * ```
942
- *
943
- * @example
944
- * Reusable class shared across modules
945
- *
946
- * The shared module allows other modules to access the same storage without
947
- * passing the string name or type around.
948
- *
949
- * ```
950
- * export const myData =
951
- * new ContextData<{ prop1: string }>("my-data");
952
- * ```
953
- *
954
- * Then use the class in another module.
955
- *
956
- * ```
957
- * import { myData } from "./my-module";
958
- *
959
- *
960
- * const data = myData.get(context)
961
- * myData.set(context, data);
962
- *
963
- * ```
964
- */
965
- export declare class ContextData<T = any> {
966
- #private;
967
- constructor(name: string);
968
- set(context: ZuploContext, data: T): void;
969
- get(context: ZuploContext): T | undefined;
970
- static set<T = any>(context: ZuploContext, name: string, data: T): void;
971
- static get<T = any>(context: ZuploContext, name: string): T | undefined;
972
- }
973
-
974
- /** The 2-letter continent codes Cloudflare uses */
975
- declare type ContinentCode = "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
976
-
977
- export declare type CorsPolicy = string | "anything-goes" | "none";
978
-
979
- export declare interface CorsPolicyConfiguration {
980
- name: string;
981
- allowCredentials?: boolean;
982
- maxAge?: number;
983
- allowedOrigins: string[] | string;
984
- allowedMethods?: HttpMethod[] | string;
985
- allowedHeaders?: string[] | string;
986
- exposeHeaders?: string[] | string;
987
- }
988
-
989
- declare class Cron {
990
- readonly seconds: ReadonlyArray<number>;
991
- readonly minutes: ReadonlyArray<number>;
992
- readonly hours: ReadonlyArray<number>;
993
- readonly days: ReadonlyArray<number>;
994
- readonly months: ReadonlyArray<number>;
995
- readonly weekdays: ReadonlyArray<number>;
996
- readonly reversed: {
997
- seconds: ReadonlyArray<number>;
998
- minutes: ReadonlyArray<number>;
999
- hours: ReadonlyArray<number>;
1000
- days: ReadonlyArray<number>;
1001
- months: ReadonlyArray<number>;
1002
- weekdays: ReadonlyArray<number>;
1003
- };
1004
- constructor({ seconds, minutes, hours, days, months, weekdays, }: CronDefinition);
1005
- /**
1006
- * Find the next or previous hour, starting from the given start hour that matches the hour constraint.
1007
- * startHour itself might also be allowed.
1008
- */
1009
- private findAllowedHour;
1010
- /**
1011
- * Find the next or previous minute, starting from the given start minute that matches the minute constraint.
1012
- * startMinute itself might also be allowed.
1013
- */
1014
- private findAllowedMinute;
1015
- /**
1016
- * Find the next or previous second, starting from the given start second that matches the second constraint.
1017
- * startSecond itself IS NOT allowed.
1018
- */
1019
- private findAllowedSecond;
1020
- /**
1021
- * Find the next or previous time, starting from the given start time that matches the hour, minute
1022
- * and second constraints. startTime itself might also be allowed.
1023
- */
1024
- private findAllowedTime;
1025
- /**
1026
- * Find the next or previous day in the given month, starting from the given startDay
1027
- * that matches either the day or the weekday constraint. startDay itself might also be allowed.
1028
- */
1029
- private findAllowedDayInMonth;
1030
- /** Gets the next date starting from the given start date or now. */
1031
- getNextDate(startDate?: Date): Date;
1032
- /** Gets the specified amount of future dates starting from the given start date or now. */
1033
- getNextDates(amount: number, startDate?: Date): Date[];
1034
- /**
1035
- * Get an ES6 compatible iterator which iterates over the next dates starting from startDate or now.
1036
- * The iterator runs until the optional endDate is reached or forever.
1037
- */
1038
- getNextDatesIterator(startDate?: Date, endDate?: Date): Generator<Date, undefined, undefined>;
1039
- /** Gets the previous date starting from the given start date or now. */
1040
- getPrevDate(startDate?: Date): Date;
1041
- /** Gets the specified amount of previous dates starting from the given start date or now. */
1042
- getPrevDates(amount: number, startDate?: Date): Date[];
1043
- /**
1044
- * Get an ES6 compatible iterator which iterates over the previous dates starting from startDate or now.
1045
- * The iterator runs until the optional endDate is reached or forever.
1046
- */
1047
- getPrevDatesIterator(startDate?: Date, endDate?: Date): Generator<Date, undefined, undefined>;
1048
- /** Returns true when there is a cron date at the given date. */
1049
- matchDate(date: Date): boolean;
1050
- }
1051
-
1052
- /**
1053
- * An object with contains for each element of a date, which values are allowed.
1054
- * Everything starting at 0, except for days.
1055
- */
1056
- declare interface CronDefinition {
1057
- readonly seconds: Set<number>;
1058
- readonly minutes: Set<number>;
1059
- readonly hours: Set<number>;
1060
- readonly days: Set<number>;
1061
- readonly months: Set<number>;
1062
- readonly weekdays: Set<number>;
1063
- }
1064
-
1065
- /* Excluded from this release type: CryptoBeta */
1066
-
1067
- /**
1068
- * Authenticate users using the Curity Phantom Token Pattern.
1069
- *
1070
- * @remarks
1071
- * Authenticate requests with Phantom Tokens issued by Curity. The payload of the
1072
- * Phantom JWT token, if successfully authenticated, with be on the
1073
- * `request.user.data` object accessible to the runtime.
1074
- *
1075
- * @title Curity Phantom Token Auth
1076
- * @public
1077
- * @param request - The ZuploRequest
1078
- * @param context - The ZuploContext
1079
- * @param options - The policy options set in policies.json
1080
- * @param policyName - The name of the policy as set in policies.json
1081
- * @returns A Request or a Response
1082
- */
1083
- export declare const CurityPhantomTokenInboundPolicy: InboundPolicyHandler<CurityPhantomTokenInboundPolicyOptions>;
1084
-
1085
- /**
1086
- * The options for this policy.
1087
- */
1088
- export declare interface CurityPhantomTokenInboundPolicyOptions {
1089
- /**
1090
- * The client ID of the Curity application.
1091
- */
1092
- clientId: string;
1093
- /**
1094
- * The client secret of the Curity application.
1095
- */
1096
- clientSecret: string;
1097
- /**
1098
- * The introspection URL of the Curity application.
1099
- */
1100
- introspectionUrl: string;
1101
- /**
1102
- * The duration in seconds to cache the introspected response.
1103
- */
1104
- cacheDurationSeconds?: number;
1105
- }
1106
-
1107
- /* Excluded from this release type: CustomRateLimitDetails */
1108
-
1109
- declare interface DataDogLoggingOptions {
1110
- url?: string;
1111
- apiKey: string;
1112
- }
1113
-
1114
- export declare class DataDogLoggingPlugin extends LogPlugin {
1115
- private options;
1116
- constructor(options: DataDogLoggingOptions);
1117
- /* Excluded from this release type: getTransport */
1118
- }
1119
-
1120
- declare interface DataDogMetricsContext {
1121
- tags: string[];
1122
- }
1123
-
1124
- declare interface DataDogMetricsOptions {
1125
- url?: string;
1126
- apiKey: string;
1127
- tags?: string[];
1128
- metrics?: MetricsType;
1129
- include?: IncludeMetrics;
1130
- }
1131
-
1132
- export declare class DataDogMetricsPlugin extends MetricsPlugin {
1133
- private options;
1134
- constructor(options: DataDogMetricsOptions);
1135
- /* Excluded from this release type: getTransport */
1136
- static setContext(context: ZuploContext, data: DataDogMetricsContext): void;
1137
- }
1138
-
1139
- /* Excluded from this release type: DevPortalRuntimeConfig */
1140
-
1141
- /**
1142
- * @public
1143
- */
1144
- declare type DispatchFunction<TPayload> = (batch: TPayload[]) => Promise<void>;
1145
-
1146
- declare interface DynaTraceLoggingOptions {
1147
- url: string;
1148
- apiToken: string;
1149
- }
1150
-
1151
- export declare class DynaTraceLoggingPlugin extends LogPlugin {
1152
- private options;
1153
- constructor(options: DynaTraceLoggingOptions);
1154
- /* Excluded from this release type: getTransport */
1155
- }
1156
-
1157
- declare interface DynatraceMetricsContext {
1158
- dimensions: string[];
1159
- }
1160
-
1161
- declare interface DynatraceMetricsOptions {
1162
- url: string;
1163
- apiToken: string;
1164
- dimensions?: string[];
1165
- metrics?: MetricsType;
1166
- include?: IncludeMetrics;
1167
- }
1168
-
1169
- export declare class DynatraceMetricsPlugin extends MetricsPlugin {
1170
- private options;
1171
- constructor(options: DynatraceMetricsOptions);
1172
- /* Excluded from this release type: getTransport */
1173
- static setContext(context: ZuploContext, data: DynatraceMetricsContext): void;
1174
- }
1175
-
1176
- /* Excluded from this release type: environment */
1177
-
1178
- /* Excluded from this release type: ErrorHandler */
1179
-
1180
- /* Excluded from this release type: ErrorObject */
1181
-
1182
- /**
1183
- * Authenticate users using Firebase issued JWT tokens.
1184
- *
1185
- * @remarks
1186
- * Authenticate requests with JWT tokens issued by Firebase. The payload of the JWT
1187
- * token, if successfully authenticated, with be on the `request.user.data` object
1188
- * accessible to the runtime.
1189
- *
1190
- * See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
1191
- * about OAuth authorization in Zuplo.
1192
- *
1193
- * @title Firebase JWT Auth
1194
- * @public
1195
- * @param request - The ZuploRequest
1196
- * @param context - The ZuploContext
1197
- * @param options - The policy options set in policies.json
1198
- * @param policyName - The name of the policy as set in policies.json
1199
- * @returns A Request or a Response
1200
- */
1201
- export declare const FirebaseJwtInboundPolicy: InboundPolicyHandler<FirebaseJwtInboundPolicyOptions>;
1202
-
1203
- /**
1204
- * The options for this policy.
1205
- */
1206
- export declare interface FirebaseJwtInboundPolicyOptions {
1207
- /**
1208
- * Allow unauthenticated requests to proceed. This is use useful if you want to use multiple authentication policies or if you want to allow both authenticated and non-authenticated traffic.
1209
- */
1210
- allowUnauthenticatedRequests?: boolean;
1211
- /**
1212
- * Your Firebase Project ID.
1213
- */
1214
- projectId: string;
1215
- }
1216
-
1217
- /**
1218
- * Converts form data in the incoming request to JSON.
1219
- *
1220
- * @title Form Data to JSON
1221
- * @public
1222
- * @param request - The ZuploRequest
1223
- * @param context - The ZuploContext
1224
- * @param options - The policy options set in policies.json
1225
- * @param policyName - The name of the policy as set in policies.json
1226
- * @returns A Request or a Response
1227
- */
1228
- export declare const FormDataToJsonInboundPolicy: InboundPolicyHandler<FormDataToJsonInboundPolicyOptions>;
1229
-
1230
- /**
1231
- * The options for this policy.
1232
- */
1233
- export declare interface FormDataToJsonInboundPolicyOptions {
1234
- /**
1235
- * Should the policy return an error if the request is not of the type form data.
1236
- */
1237
- badRequestIfNotFormData?: boolean;
1238
- /**
1239
- * The name of the honeypot field. Used to provide basic spam filtering.
1240
- */
1241
- optionalHoneypotName?: string;
1242
- }
1243
-
1244
- /* Excluded from this release type: Gateway */
1245
-
1246
- /**
1247
- * Block requests based on geo-location parameters: country, region code, and ASN
1248
- *
1249
- * @title Geo-location filtering
1250
- * @public
1251
- * @param request - The ZuploRequest
1252
- * @param context - The ZuploContext
1253
- * @param options - The policy options set in policies.json
1254
- * @param policyName - The name of the policy as set in policies.json
1255
- * @returns A Request or a Response
1256
- */
1257
- export declare const GeoFilterInboundPolicy: InboundPolicyHandler<GeoFilterInboundPolicyOptions>;
1258
-
1259
- /**
1260
- * The options for this policy.
1261
- */
1262
- export declare interface GeoFilterInboundPolicyOptions {
1263
- block?: GeoSpec;
1264
- allow?: GeoSpec;
1265
- /**
1266
- * Specifies whether unknown geo-location parameters should be ignored (allowed through).
1267
- */
1268
- ignoreUnknown?: boolean;
1269
- }
1270
-
1271
- declare interface GeoSpec {
1272
- /**
1273
- * comma separated string of country codes to allow (e.g. "US, CA").
1274
- */
1275
- countries?: string;
1276
- /**
1277
- * comma separated string of region codes to allow (e.g. "TX, WA").
1278
- */
1279
- regionCodes?: string;
1280
- /**
1281
- * comma separated string of ASNs to allow (e.g. "395747, 28304").
1282
- */
1283
- asns?: string;
1284
- }
1285
-
1286
- export declare function getIdForParameterSchema(path: string, operation: string, type: string, name: string): string;
1287
-
1288
- export declare function getIdForRefSchema(oasFileName: string, ref: string): string;
1289
-
1290
- export declare function getIdForRequestBodySchema(path: string, operation: string, contentType: string): string;
1291
-
1292
- export declare function getRawOperationDataIdentifierName(oasFileName: string, path: string, operation: string): string;
1293
-
1294
- declare interface GoogleCloudLoggingOptions {
1295
- serviceAccountJson: string;
1296
- logName: string;
1297
- }
1298
-
1299
- export declare class GoogleCloudLoggingPlugin extends LogPlugin {
1300
- private options;
1301
- constructor(options: GoogleCloudLoggingOptions);
1302
- /* Excluded from this release type: getTransport */
1303
- }
1304
-
1305
- /* Excluded from this release type: Handler */
1306
-
1307
- export declare interface HandlerDefinition {
1308
- module: any;
1309
- export: string;
1310
- options?: unknown;
1311
- }
1312
-
1313
- export declare type HttpMethod = "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE" | "PATCH";
1314
-
1315
- /* Excluded from this release type: HttpProblems */
1316
-
1317
- declare class HttpProblemsBase {
1318
- /**
1319
- * Creates a Response in the standard format from a problem detail
1320
- * @param details - The details of the problem
1321
- * @param request - The ZuploRequest object
1322
- * @param context - The ZuploContext object
1323
- * @returns A HTTP Response promise
1324
- */
1325
- static format: (details: ProblemDetails | ProblemResponseDetails, request: ZuploRequest, context: ZuploContext) => Promise<Response>;
1326
- /**
1327
- * Creates a problem from the status code
1328
- */
1329
- static getProblemFromStatus(status: HttpStatusCode, problem?: Partial<Omit<ProblemDetails, "status" | "title">>): ProblemDetails;
1330
- }
1331
-
1332
- /* Excluded from this release type: HttpStatusCode */
1333
-
1334
- declare type HttpStatusCodeRangeDefinition = "1XX" | "2XX" | "3XX" | "4XX" | "5XX";
1335
-
1336
- /* Excluded from this release type: httpStatuses */
1337
-
1338
- /* Excluded from this release type: InboundPolicy */
1339
-
1340
- /**
1341
- * @public
1342
- * A policy that can modify the incoming HTTP request before it is sent to
1343
- * the handler. If a response is returned, the request is short-circuited and
1344
- * the response is returned to the client. If a Request is returned, policies
1345
- * or a handler that follow are executed.
1346
- *
1347
- * @param request - The incoming Request
1348
- * @param context - The current context of the Request
1349
- * @param options - The configuration options for the policy
1350
- * @param policyName - The name set on the policy in the configuration
1351
- * @returns A Response or Request object
1352
- */
1353
- export declare interface InboundPolicyHandler<TOptions = any> {
1354
- (request: ZuploRequest, context: ZuploContext, options: TOptions, policyName: string): Promise<ZuploRequest | Response>;
1355
- }
1356
-
1357
- declare interface IncludeMetrics {
1358
- country?: boolean;
1359
- httpMethod?: boolean;
1360
- statusCode?: boolean;
1361
- path?: boolean;
1362
- }
1363
-
1364
- declare interface IncomingRequestProperties {
1365
- /**
1366
- * ASN of the incoming request, for example, 395747.
1367
- */
1368
- readonly asn: number | undefined;
1369
- /**
1370
- * The organization which owns the ASN of the incoming request,
1371
- * for example, Google Cloud.
1372
- */
1373
- readonly asOrganization: string | undefined;
1374
- /**
1375
- * City of the incoming request, for example, "Austin".
1376
- */
1377
- readonly city: string | undefined;
1378
- /**
1379
- * Continent of the incoming request, for example, "NA".
1380
- */
1381
- readonly continent: ContinentCode | undefined;
1382
- /**
1383
- * The two-letter country code in the request.
1384
- * @see {@link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2|ISO 3166-1 alpha-2}
1385
- */
1386
- readonly country: Iso3166Alpha2Code | undefined;
1387
- /**
1388
- * Latitude of the incoming request, for example, "30.27130".
1389
- */
1390
- readonly latitude: string | undefined;
1391
- /**
1392
- * Longitude of the incoming request, for example, "-97.74260".
1393
- */
1394
- readonly longitude: string | undefined;
1395
- /**
1396
- * The three-letter IATA airport code of the data center that the request hit,
1397
- * for example, "DFW".
1398
- * @see {@link https://en.wikipedia.org/wiki/IATA_airport_code|IATA airport code}
1399
- */
1400
- readonly colo: string | undefined;
1401
- /**
1402
- * Postal code of the incoming request, for example, "78701".
1403
- */
1404
- readonly postalCode: string | undefined;
1405
- /**
1406
- * Metro code (DMA) of the incoming request, for example, "635".
1407
- */
1408
- readonly metroCode: string | undefined;
1409
- /**
1410
- * If known, the ISO 3166-2 name for the first level region associated with
1411
- * the IP address of the incoming request, for example, "Texas".
1412
- * @see {@link https://en.wikipedia.org/wiki/ISO_3166-2|ISO 3166-2}
1413
- */
1414
- readonly region: string | undefined;
1415
- /**
1416
- * If known, the ISO 3166-2 code for the first-level region associated with
1417
- * the IP address of the incoming request, for example, "TX".
1418
- * @see {@link https://en.wikipedia.org/wiki/ISO_3166-2|ISO 3166-2}
1419
- */
1420
- readonly regionCode: string | undefined;
1421
- /**
1422
- * Timezone of the incoming request, for example, "America/Chicago".
1423
- */
1424
- readonly timezone: string | undefined;
1425
- }
1426
-
1427
- /** ISO 3166-1 Alpha-2 codes */
1428
- declare type Iso3166Alpha2Code = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
1429
-
1430
- /**
1431
- * Validates that the JWT token includes specific scopes
1432
- *
1433
- * @title JWT Scope Validation
1434
- * @public
1435
- * @param request - The ZuploRequest
1436
- * @param context - The ZuploContext
1437
- * @param options - The policy options set in policies.json
1438
- * @param policyName - The name of the policy as set in policies.json
1439
- * @returns A Request or a Response
1440
- */
1441
- export declare const JWTScopeValidationInboundPolicy: InboundPolicyHandler<JWTScopeValidationInboundPolicyOptions>;
1442
-
1443
- /**
1444
- * The options for this policy.
1445
- */
1446
- export declare interface JWTScopeValidationInboundPolicyOptions {
1447
- /**
1448
- * An array of of JWT scopes.
1449
- */
1450
- scopes: string[];
1451
- }
1452
-
1453
- /* Excluded from this release type: KevValueStoreGetOptions */
1454
-
1455
- /* Excluded from this release type: KeyValueStore */
1456
-
1457
- /* Excluded from this release type: KeyValueStorePutOptions */
1458
-
1459
- /* Excluded from this release type: LogEntry */
1460
-
1461
- declare interface LogField {
1462
- name: string;
1463
- content: Primitive;
1464
- }
1465
-
1466
- /* Excluded from this release type: LogFormat */
1467
-
1468
- /* Excluded from this release type: Logger */
1469
-
1470
- /* Excluded from this release type: LoggingContext */
1471
-
1472
- declare type LoggingEnvironmentStage = "working-copy" | "preview" | "production" | "local" | "unknown";
1473
-
1474
- /**
1475
- * This type exists mostly because we can't break existing loggers,
1476
- * it is probably better to have environment stage and something indicating
1477
- * runtime (which more closely resembles what we actually use internally)
1478
- */
1479
- declare type LoggingEnvironmentType = "edge" | "working-copy" | "local" | "unknown";
1480
-
1481
- declare interface LogInsightLogEntry {
1482
- text: string;
1483
- timestamp: number;
1484
- fields: LogField[];
1485
- }
1486
-
1487
- /* Excluded from this release type: LogLevel */
1488
-
1489
- /* Excluded from this release type: LogOwnerType */
1490
-
1491
- declare abstract class LogPlugin extends RuntimePlugin {
1492
- /* Excluded from this release type: getTransport */
1493
- }
1494
-
1495
- declare type LogSourceType = "runtime" | "request";
1496
-
1497
- /* Excluded from this release type: LogTransport */
1498
-
1499
- /**
1500
- * A logging plugin that sends logs to a Loki server.
1501
- */
1502
- export declare class LokiLoggingPlugin extends LogPlugin {
1503
- private options;
1504
- constructor(options: LokiLoggingPluginOptions);
1505
- /* Excluded from this release type: getTransport */
1506
- }
1507
-
1508
- /**
1509
- * Options for the Loki logging plugin.
1510
- */
1511
- declare interface LokiLoggingPluginOptions {
1512
- /**
1513
- * The version of the Loki transport to use.
1514
- */
1515
- version?: LokiTransportVersion;
1516
- /**
1517
- * Optional job name to include in the log stream. Defaults to "zuplo".
1518
- */
1519
- job?: string;
1520
- /**
1521
- * The URL of the Loki server.
1522
- */
1523
- url: string;
1524
- /**
1525
- * The username to authenticate with the Loki server.
1526
- */
1527
- username: string;
1528
- /**
1529
- * The password to authenticate with the Loki server.
1530
- */
1531
- password: string;
1532
- }
1533
-
1534
- /**
1535
- * Version 1: requestId is included in the stream object
1536
- * Version 2: requestId is included as a value in the stream object
1537
- */
1538
- declare type LokiTransportVersion = 1 | 2;
1539
-
1540
- /* Excluded from this release type: LookupResult */
1541
-
1542
- export declare class MemoryZoneReadThroughCache<T = unknown> {
1543
- #private;
1544
- constructor(name: string, context: ZuploContext);
1545
- get(key: string): Promise<T | undefined>;
1546
- put(key: string, data: T, ttlSeconds: number): void;
1547
- }
1548
-
1549
- /**
1550
- * Base class for determining type of plugin
1551
- * @public
1552
- */
1553
- declare abstract class MeteringPlugin extends SystemRuntimePlugin {
1554
- }
1555
-
1556
- /* Excluded from this release type: MeteringRegions */
1557
-
1558
- /* Excluded from this release type: MeteringSubscription */
1559
-
1560
- /* Excluded from this release type: MeteringSubscriptionStatus */
1561
-
1562
- /**
1563
- * @public
1564
- */
1565
- declare interface MetricsData {
1566
- timestamp: Date;
1567
- durationMs: number;
1568
- statusCode: number;
1569
- requestContentLength?: number;
1570
- responseContentLength?: number;
1571
- requestId: string;
1572
- routePath: string;
1573
- systemRouteName?: string;
1574
- method: HttpMethod;
1575
- rayId?: string;
1576
- instanceId: string;
1577
- userSub?: string;
1578
- clientIp?: string;
1579
- asn?: number;
1580
- asOrganization?: string;
1581
- colo?: string;
1582
- continent?: string;
1583
- country?: string;
1584
- city?: string;
1585
- latitude?: string;
1586
- longitude?: string;
1587
- deploymentName?: string;
1588
- projectId?: string;
1589
- }
1590
-
1591
- declare abstract class MetricsPlugin extends RuntimePlugin {
1592
- /* Excluded from this release type: getTransport */
1593
- }
1594
-
1595
- declare interface MetricsTransport {
1596
- pushMetrics(entry: MetricsData, context: ZuploContext): void;
1597
- }
1598
-
1599
- declare interface MetricsType {
1600
- latency?: boolean;
1601
- requestContentLength?: boolean;
1602
- responseContentLength?: boolean;
1603
- }
1604
-
1605
- /**
1606
- * The options for this policy.
1607
- */
1608
- export declare interface MockApiInboundOptions {
1609
- /**
1610
- * Indicates whether the response should be selected randomly, from the available examples (that match any filter criteria). If `false` the first matching example is used.
1611
- */
1612
- random?: boolean;
1613
- /**
1614
- * Specifies a prefix to match the responses to select from. Typically this is a status code like "200" or "2XX". If you want the policy to select randomly from all 2XX codes, set this property to "2" and random to `true`.
1615
- */
1616
- responsePrefixFilter?: string;
1617
- /**
1618
- * Specify the content-type of the response to select from. If not specified, the first matching response is used (or random).
1619
- */
1620
- contentType?: string;
1621
- /**
1622
- * Specify the name of the example to select. If not specified, the first matching response is used (or random).
1623
- */
1624
- exampleName?: string;
1625
- }
1626
-
1627
- /**
1628
- * Returns example responses from the OpenAPI document associated with this route.
1629
- *
1630
- * @title Mock API Response
1631
- * @public
1632
- * @param request - The ZuploRequest
1633
- * @param context - The ZuploContext
1634
- * @param options - The policy options set in policies.json
1635
- * @param policyName - The name of the policy as set in policies.json
1636
- * @returns A Request or a Response
1637
- */
1638
- export declare const MockApiInboundPolicy: InboundPolicyHandler<MockApiInboundOptions>;
1639
-
1640
- declare type Modify<T, R> = Omit<T, keyof R> & R;
1641
-
1642
- declare interface MoesifContext {
1643
- apiVersion?: string;
1644
- userId?: string;
1645
- companyId?: string;
1646
- sessionToken?: string;
1647
- metadata?: unknown;
1648
- }
1649
-
1650
- /**
1651
- * Moesif is an API analytics and billing service. This policy allows you to send metering calls for each API to their events batch endpoint.
1652
- *
1653
- * @remarks
1654
- * Moesif {@link https://moesif.com|moesif.com} is an API analytics and monetization
1655
- * platform. This policy allows you to measure (and meter) API calls flowing
1656
- * through your Zuplo gateway.
1657
- *
1658
- * Add the policy to each route you want to meter. Note you can specify the Meter
1659
- * API Name and Meter Value (meter increment) at the policy level.
1660
- *
1661
- * @title Moesif Analytics & Billing
1662
- * @public
1663
- * @param request - The ZuploRequest
1664
- * @param context - The ZuploContext
1665
- * @param options - The policy options set in policies.json
1666
- * @param policyName - The name of the policy as set in policies.json
1667
- * @returns A Request or a Response
1668
- */
1669
- export declare function MoesifInboundPolicy(request: ZuploRequest, context: ZuploContext, passedOptions: MoesifInboundPolicyOptions, policyName: string): Promise<ZuploRequest<RequestGeneric>>;
1670
-
1671
- /**
1672
- * The options for this policy. Many of them can be overridden at the code level in a request using the `AmberfloMeteringPolicy.setRequestProperties` method.
1673
- */
1674
- export declare interface MoesifInboundPolicyOptions {
1675
- /**
1676
- * Your Moesif application ID.
1677
- */
1678
- applicationId: string;
1679
- /**
1680
- * Set to false to disable sending the request body to Moesif.
1681
- */
1682
- logRequestBody?: boolean;
1683
- /**
1684
- * Set to false to disable sending the response body to Moesif.
1685
- */
1686
- logResponseBody?: boolean;
1687
- }
1688
-
1689
- /* Excluded from this release type: MonetizationInboundPolicy */
1690
-
1691
- /**
1692
- * The options for this policy.
1693
- */
1694
- export declare interface MonetizationInboundPolicyOptions {
1695
- /**
1696
- * Indicates if requests without subscription should be allowed or not.
1697
- */
1698
- allowRequestsWithoutSubscription?: boolean;
1699
- /**
1700
- * Indicates which subscription statuses should be allowed.
1701
- */
1702
- allowedSubscriptionStatuses?: ("active" | "inactive" | "incomplete" | "incomplete-expired" | "trialing" | "past-due" | "canceled" | "unpaid")[];
1703
- /**
1704
- * Indicates the bucket to be used, overrides the default one.
1705
- */
1706
- bucketId?: string;
1707
- /**
1708
- * Indicates if requests over quota should be allowed or not.
1709
- */
1710
- allowRequestsOverQuota?: boolean;
1711
- /**
1712
- * The meters to be used by the policy against the subscription quota.
1713
- */
1714
- meters: {
1715
- /**
1716
- * This interface was referenced by `undefined`'s JSON-Schema definition
1717
- * via the `patternProperty` "^.*$".
1718
- */
1719
- [k: string]: number;
1720
- };
1721
- /**
1722
- * A list of successful status codes and ranges "200-299, 304" that should trigger a metering call.
1723
- */
1724
- meterOnStatusCodes?: string | number[];
1725
- }
1726
-
1727
- declare type MonetizationPolicyMeters = {
1728
- [Key in string]: number;
1729
- };
1730
-
1731
- /* Excluded from this release type: MonetizationSubscription */
1732
-
1733
- declare interface MultiRequests {
1734
- RequestReference: RequestReference;
1735
- }
1736
-
1737
- declare interface NotFoundOptions {
1738
- routesMatchedByPathOnly: RouteConfiguration[];
1739
- }
1740
-
1741
- /**
1742
- * Authenticate users using Okta issued JWT tokens.
1743
- *
1744
- * @remarks
1745
- * Authenticate requests with JWT tokens issued by Okta. This is a customized
1746
- * version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy} specifically
1747
- * for Okta.
1748
- *
1749
- * See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
1750
- * about OAuth authorization in Zuplo.
1751
- *
1752
- * @title Okta JWT Auth
1753
- * @public
1754
- * @param request - The ZuploRequest
1755
- * @param context - The ZuploContext
1756
- * @param options - The policy options set in policies.json
1757
- * @param policyName - The name of the policy as set in policies.json
1758
- * @returns A Request or a Response
1759
- */
1760
- export declare const OktaJwtInboundPolicy: InboundPolicyHandler<OktaJwtInboundPolicyOptions>;
1761
-
1762
- /**
1763
- * The options for this policy.
1764
- */
1765
- export declare interface OktaJwtInboundPolicyOptions {
1766
- /**
1767
- * Allow unauthenticated requests to proceed. This is use useful if you want to use multiple authentication policies or if you want to allow both authenticated and non-authenticated traffic.
1768
- */
1769
- allowUnauthenticatedRequests?: boolean;
1770
- /**
1771
- * Your Okta authorization server's issuer URL. For example, `https://dev-12345.okta.com/oauth2/abc`.
1772
- */
1773
- issuerUrl: string;
1774
- /**
1775
- * The Okta audience of your API, for example `api://my-api`.
1776
- */
1777
- audience?: string;
1778
- }
1779
-
1780
- /**
1781
- * @public
1782
- */
1783
- declare interface OnRequestHook {
1784
- (request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest | Response> | (ZuploRequest | Response);
1785
- }
1786
-
1787
- /**
1788
- * @public
1789
- */
1790
- declare interface OnResponseSendingFinalHook {
1791
- (response: Response, request: ZuploRequest, context: ZuploContext): Promise<void> | void;
1792
- }
1793
-
1794
- /**
1795
- * @public
1796
- */
1797
- declare interface OnResponseSendingHook {
1798
- (response: Response, request: ZuploRequest, context: ZuploContext): Promise<Response> | Response;
1799
- }
1800
-
1801
- declare interface OnSendingAwsLambdaEventHook {
1802
- (request: ZuploRequest, context: ZuploContext, event: AwsLambdaEventV1 | AwsLambdaEventV2): Promise<AwsLambdaEventV1 | AwsLambdaEventV2>;
1803
- }
1804
-
1805
- /* Excluded from this release type: openApiSpecHandler */
1806
-
1807
- declare namespace OpenAPIV3 {
1808
- interface Document<T extends {} = {}> {
1809
- openapi: string;
1810
- info: InfoObject;
1811
- servers?: ServerObject[];
1812
- paths: PathsObject<T>;
1813
- components?: ComponentsObject;
1814
- security?: SecurityRequirementObject[];
1815
- tags?: TagObject[];
1816
- externalDocs?: ExternalDocumentationObject;
1817
- 'x-express-openapi-additional-middleware'?: (((request: any, response: any, next: any) => Promise<void>) | ((request: any, response: any, next: any) => void))[];
1818
- 'x-express-openapi-validation-strict'?: boolean;
1819
- }
1820
- interface InfoObject {
1821
- title: string;
1822
- description?: string;
1823
- termsOfService?: string;
1824
- contact?: ContactObject;
1825
- license?: LicenseObject;
1826
- version: string;
1827
- }
1828
- interface ContactObject {
1829
- name?: string;
1830
- url?: string;
1831
- email?: string;
1832
- }
1833
- interface LicenseObject {
1834
- name: string;
1835
- url?: string;
1836
- }
1837
- interface ServerObject {
1838
- url: string;
1839
- description?: string;
1840
- variables?: {
1841
- [variable: string]: ServerVariableObject;
1842
- };
1843
- }
1844
- interface ServerVariableObject {
1845
- enum?: string[];
1846
- default: string;
1847
- description?: string;
1848
- }
1849
- interface PathsObject<T extends {} = {}, P extends {} = {}> {
1850
- [pattern: string]: (PathItemObject<T> & P) | undefined;
1851
- }
1852
- enum HttpMethods {
1853
- GET = "get",
1854
- PUT = "put",
1855
- POST = "post",
1856
- DELETE = "delete",
1857
- OPTIONS = "options",
1858
- HEAD = "head",
1859
- PATCH = "patch",
1860
- TRACE = "trace"
1861
- }
1862
- type PathItemObject<T extends {} = {}> = {
1863
- $ref?: string;
1864
- summary?: string;
1865
- description?: string;
1866
- servers?: ServerObject[];
1867
- parameters?: (ReferenceObject | ParameterObject)[];
1868
- } & {
1869
- [method in HttpMethods]?: OperationObject<T>;
1870
- };
1871
- type OperationObject<T extends {} = {}> = {
1872
- tags?: string[];
1873
- summary?: string;
1874
- description?: string;
1875
- externalDocs?: ExternalDocumentationObject;
1876
- operationId?: string;
1877
- parameters?: (ReferenceObject | ParameterObject)[];
1878
- requestBody?: ReferenceObject | RequestBodyObject;
1879
- responses: ResponsesObject;
1880
- callbacks?: {
1881
- [callback: string]: ReferenceObject | CallbackObject;
1882
- };
1883
- deprecated?: boolean;
1884
- security?: SecurityRequirementObject[];
1885
- servers?: ServerObject[];
1886
- } & T;
1887
- interface ExternalDocumentationObject {
1888
- description?: string;
1889
- url: string;
1890
- }
1891
- interface ParameterObject extends ParameterBaseObject {
1892
- name: string;
1893
- in: string;
1894
- }
1895
- interface HeaderObject extends ParameterBaseObject {
1896
- }
1897
- interface ParameterBaseObject {
1898
- description?: string;
1899
- required?: boolean;
1900
- deprecated?: boolean;
1901
- allowEmptyValue?: boolean;
1902
- style?: string;
1903
- explode?: boolean;
1904
- allowReserved?: boolean;
1905
- schema?: ReferenceObject | SchemaObject;
1906
- example?: any;
1907
- examples?: {
1908
- [media: string]: ReferenceObject | ExampleObject;
1909
- };
1910
- content?: {
1911
- [media: string]: MediaTypeObject;
1912
- };
1913
- }
1914
- type NonArraySchemaObjectType = 'boolean' | 'object' | 'number' | 'string' | 'integer';
1915
- type ArraySchemaObjectType = 'array';
1916
- type SchemaObject = ArraySchemaObject | NonArraySchemaObject;
1917
- interface ArraySchemaObject extends BaseSchemaObject {
1918
- type: ArraySchemaObjectType;
1919
- items: ReferenceObject | SchemaObject;
1920
- }
1921
- interface NonArraySchemaObject extends BaseSchemaObject {
1922
- type?: NonArraySchemaObjectType;
1923
- }
1924
- interface BaseSchemaObject {
1925
- title?: string;
1926
- description?: string;
1927
- format?: string;
1928
- default?: any;
1929
- multipleOf?: number;
1930
- maximum?: number;
1931
- exclusiveMaximum?: boolean;
1932
- minimum?: number;
1933
- exclusiveMinimum?: boolean;
1934
- maxLength?: number;
1935
- minLength?: number;
1936
- pattern?: string;
1937
- additionalProperties?: boolean | ReferenceObject | SchemaObject;
1938
- maxItems?: number;
1939
- minItems?: number;
1940
- uniqueItems?: boolean;
1941
- maxProperties?: number;
1942
- minProperties?: number;
1943
- required?: string[];
1944
- enum?: any[];
1945
- properties?: {
1946
- [name: string]: ReferenceObject | SchemaObject;
1947
- };
1948
- allOf?: (ReferenceObject | SchemaObject)[];
1949
- oneOf?: (ReferenceObject | SchemaObject)[];
1950
- anyOf?: (ReferenceObject | SchemaObject)[];
1951
- not?: ReferenceObject | SchemaObject;
1952
- nullable?: boolean;
1953
- discriminator?: DiscriminatorObject;
1954
- readOnly?: boolean;
1955
- writeOnly?: boolean;
1956
- xml?: XMLObject;
1957
- externalDocs?: ExternalDocumentationObject;
1958
- example?: any;
1959
- deprecated?: boolean;
1960
- }
1961
- interface DiscriminatorObject {
1962
- propertyName: string;
1963
- mapping?: {
1964
- [value: string]: string;
1965
- };
1966
- }
1967
- interface XMLObject {
1968
- name?: string;
1969
- namespace?: string;
1970
- prefix?: string;
1971
- attribute?: boolean;
1972
- wrapped?: boolean;
1973
- }
1974
- interface ReferenceObject {
1975
- $ref: string;
1976
- }
1977
- interface ExampleObject {
1978
- summary?: string;
1979
- description?: string;
1980
- value?: any;
1981
- externalValue?: string;
1982
- }
1983
- interface MediaTypeObject {
1984
- schema?: ReferenceObject | SchemaObject;
1985
- example?: any;
1986
- examples?: {
1987
- [media: string]: ReferenceObject | ExampleObject;
1988
- };
1989
- encoding?: {
1990
- [media: string]: EncodingObject;
1991
- };
1992
- }
1993
- interface EncodingObject {
1994
- contentType?: string;
1995
- headers?: {
1996
- [header: string]: ReferenceObject | HeaderObject;
1997
- };
1998
- style?: string;
1999
- explode?: boolean;
2000
- allowReserved?: boolean;
2001
- }
2002
- interface RequestBodyObject {
2003
- description?: string;
2004
- content: {
2005
- [media: string]: MediaTypeObject;
2006
- };
2007
- required?: boolean;
2008
- }
2009
- interface ResponsesObject {
2010
- [code: string]: ReferenceObject | ResponseObject;
2011
- }
2012
- interface ResponseObject {
2013
- description: string;
2014
- headers?: {
2015
- [header: string]: ReferenceObject | HeaderObject;
2016
- };
2017
- content?: {
2018
- [media: string]: MediaTypeObject;
2019
- };
2020
- links?: {
2021
- [link: string]: ReferenceObject | LinkObject;
2022
- };
2023
- }
2024
- interface LinkObject {
2025
- operationRef?: string;
2026
- operationId?: string;
2027
- parameters?: {
2028
- [parameter: string]: any;
2029
- };
2030
- requestBody?: any;
2031
- description?: string;
2032
- server?: ServerObject;
2033
- }
2034
- interface CallbackObject {
2035
- [url: string]: PathItemObject;
2036
- }
2037
- interface SecurityRequirementObject {
2038
- [name: string]: string[];
2039
- }
2040
- interface ComponentsObject {
2041
- schemas?: {
2042
- [key: string]: ReferenceObject | SchemaObject;
2043
- };
2044
- responses?: {
2045
- [key: string]: ReferenceObject | ResponseObject;
2046
- };
2047
- parameters?: {
2048
- [key: string]: ReferenceObject | ParameterObject;
2049
- };
2050
- examples?: {
2051
- [key: string]: ReferenceObject | ExampleObject;
2052
- };
2053
- requestBodies?: {
2054
- [key: string]: ReferenceObject | RequestBodyObject;
2055
- };
2056
- headers?: {
2057
- [key: string]: ReferenceObject | HeaderObject;
2058
- };
2059
- securitySchemes?: {
2060
- [key: string]: ReferenceObject | SecuritySchemeObject;
2061
- };
2062
- links?: {
2063
- [key: string]: ReferenceObject | LinkObject;
2064
- };
2065
- callbacks?: {
2066
- [key: string]: ReferenceObject | CallbackObject;
2067
- };
2068
- }
2069
- type SecuritySchemeObject = HttpSecurityScheme | ApiKeySecurityScheme | OAuth2SecurityScheme | OpenIdSecurityScheme;
2070
- interface HttpSecurityScheme {
2071
- type: 'http';
2072
- description?: string;
2073
- scheme: string;
2074
- bearerFormat?: string;
2075
- }
2076
- interface ApiKeySecurityScheme {
2077
- type: 'apiKey';
2078
- description?: string;
2079
- name: string;
2080
- in: string;
2081
- }
2082
- interface OAuth2SecurityScheme {
2083
- type: 'oauth2';
2084
- description?: string;
2085
- flows: {
2086
- implicit?: {
2087
- authorizationUrl: string;
2088
- refreshUrl?: string;
2089
- scopes: {
2090
- [scope: string]: string;
2091
- };
2092
- };
2093
- password?: {
2094
- tokenUrl: string;
2095
- refreshUrl?: string;
2096
- scopes: {
2097
- [scope: string]: string;
2098
- };
2099
- };
2100
- clientCredentials?: {
2101
- tokenUrl: string;
2102
- refreshUrl?: string;
2103
- scopes: {
2104
- [scope: string]: string;
2105
- };
2106
- };
2107
- authorizationCode?: {
2108
- authorizationUrl: string;
2109
- tokenUrl: string;
2110
- refreshUrl?: string;
2111
- scopes: {
2112
- [scope: string]: string;
2113
- };
2114
- };
2115
- };
2116
- }
2117
- interface OpenIdSecurityScheme {
2118
- type: 'openIdConnect';
2119
- description?: string;
2120
- openIdConnectUrl: string;
2121
- }
2122
- interface TagObject {
2123
- name: string;
2124
- description?: string;
2125
- externalDocs?: ExternalDocumentationObject;
2126
- }
2127
- }
2128
-
2129
- declare namespace OpenAPIV3_1 {
2130
- type Modify<T, R> = Omit<T, keyof R> & R;
2131
- type PathsWebhooksComponents<T extends {} = {}> = {
2132
- paths: PathsObject<T>;
2133
- webhooks: Record<string, PathItemObject | ReferenceObject>;
2134
- components: ComponentsObject;
2135
- };
2136
- type Document<T extends {} = {}> = Modify<Omit<OpenAPIV3.Document<T>, 'paths' | 'components'>, {
2137
- info: InfoObject;
2138
- jsonSchemaDialect?: string;
2139
- servers?: ServerObject[];
2140
- } & ((Pick<PathsWebhooksComponents<T>, 'paths'> & Omit<Partial<PathsWebhooksComponents<T>>, 'paths'>) | (Pick<PathsWebhooksComponents<T>, 'webhooks'> & Omit<Partial<PathsWebhooksComponents<T>>, 'webhooks'>) | (Pick<PathsWebhooksComponents<T>, 'components'> & Omit<Partial<PathsWebhooksComponents<T>>, 'components'>))>;
2141
- type InfoObject = Modify<OpenAPIV3.InfoObject, {
2142
- summary?: string;
2143
- license?: LicenseObject;
2144
- }>;
2145
- type ContactObject = OpenAPIV3.ContactObject;
2146
- type LicenseObject = Modify<OpenAPIV3.LicenseObject, {
2147
- identifier?: string;
2148
- }>;
2149
- type ServerObject = Modify<OpenAPIV3.ServerObject, {
2150
- url: string;
2151
- description?: string;
2152
- variables?: Record<string, ServerVariableObject>;
2153
- }>;
2154
- type ServerVariableObject = Modify<OpenAPIV3.ServerVariableObject, {
2155
- enum?: [string, ...string[]];
2156
- }>;
2157
- type PathsObject<T extends {} = {}, P extends {} = {}> = Record<string, (PathItemObject<T> & P) | undefined>;
2158
- type HttpMethods = OpenAPIV3.HttpMethods;
2159
- type PathItemObject<T extends {} = {}> = Modify<OpenAPIV3.PathItemObject<T>, {
2160
- servers?: ServerObject[];
2161
- parameters?: (ReferenceObject | ParameterObject)[];
2162
- }> & {
2163
- [method in HttpMethods]?: OperationObject<T>;
2164
- };
2165
- type OperationObject<T extends {} = {}> = Modify<OpenAPIV3.OperationObject<T>, {
2166
- parameters?: (ReferenceObject | ParameterObject)[];
2167
- requestBody?: ReferenceObject | RequestBodyObject;
2168
- responses?: ResponsesObject;
2169
- callbacks?: Record<string, ReferenceObject | CallbackObject>;
2170
- servers?: ServerObject[];
2171
- }> & T;
2172
- type ExternalDocumentationObject = OpenAPIV3.ExternalDocumentationObject;
2173
- type ParameterObject = OpenAPIV3.ParameterObject;
2174
- type HeaderObject = OpenAPIV3.HeaderObject;
2175
- type ParameterBaseObject = OpenAPIV3.ParameterBaseObject;
2176
- type NonArraySchemaObjectType = OpenAPIV3.NonArraySchemaObjectType | 'null';
2177
- type ArraySchemaObjectType = OpenAPIV3.ArraySchemaObjectType;
2178
- /**
2179
- * There is no way to tell typescript to require items when type is either 'array' or array containing 'array' type
2180
- * 'items' will be always visible as optional
2181
- * Casting schema object to ArraySchemaObject or NonArraySchemaObject will work fine
2182
- */
2183
- type SchemaObject = ArraySchemaObject | NonArraySchemaObject | MixedSchemaObject;
2184
- interface ArraySchemaObject extends BaseSchemaObject {
2185
- type: ArraySchemaObjectType;
2186
- items: ReferenceObject | SchemaObject;
2187
- }
2188
- interface NonArraySchemaObject extends BaseSchemaObject {
2189
- type?: NonArraySchemaObjectType;
2190
- }
2191
- interface MixedSchemaObject extends BaseSchemaObject {
2192
- type?: (ArraySchemaObjectType | NonArraySchemaObjectType)[];
2193
- items?: ReferenceObject | SchemaObject;
2194
- }
2195
- type BaseSchemaObject = Modify<Omit<OpenAPIV3.BaseSchemaObject, 'nullable'>, {
2196
- examples?: OpenAPIV3.BaseSchemaObject['example'][];
2197
- exclusiveMinimum?: boolean | number;
2198
- exclusiveMaximum?: boolean | number;
2199
- contentMediaType?: string;
2200
- $schema?: string;
2201
- additionalProperties?: boolean | ReferenceObject | SchemaObject;
2202
- properties?: {
2203
- [name: string]: ReferenceObject | SchemaObject;
2204
- };
2205
- allOf?: (ReferenceObject | SchemaObject)[];
2206
- oneOf?: (ReferenceObject | SchemaObject)[];
2207
- anyOf?: (ReferenceObject | SchemaObject)[];
2208
- not?: ReferenceObject | SchemaObject;
2209
- discriminator?: DiscriminatorObject;
2210
- externalDocs?: ExternalDocumentationObject;
2211
- xml?: XMLObject;
2212
- const?: any;
2213
- }>;
2214
- type DiscriminatorObject = OpenAPIV3.DiscriminatorObject;
2215
- type XMLObject = OpenAPIV3.XMLObject;
2216
- type ReferenceObject = Modify<OpenAPIV3.ReferenceObject, {
2217
- summary?: string;
2218
- description?: string;
2219
- }>;
2220
- type ExampleObject = OpenAPIV3.ExampleObject;
2221
- type MediaTypeObject = Modify<OpenAPIV3.MediaTypeObject, {
2222
- schema?: SchemaObject | ReferenceObject;
2223
- examples?: Record<string, ReferenceObject | ExampleObject>;
2224
- }>;
2225
- type EncodingObject = OpenAPIV3.EncodingObject;
2226
- type RequestBodyObject = Modify<OpenAPIV3.RequestBodyObject, {
2227
- content: {
2228
- [media: string]: MediaTypeObject;
2229
- };
2230
- }>;
2231
- type ResponsesObject = Record<string, ReferenceObject | ResponseObject>;
2232
- type ResponseObject = Modify<OpenAPIV3.ResponseObject, {
2233
- headers?: {
2234
- [header: string]: ReferenceObject | HeaderObject;
2235
- };
2236
- content?: {
2237
- [media: string]: MediaTypeObject;
2238
- };
2239
- links?: {
2240
- [link: string]: ReferenceObject | LinkObject;
2241
- };
2242
- }>;
2243
- type LinkObject = Modify<OpenAPIV3.LinkObject, {
2244
- server?: ServerObject;
2245
- }>;
2246
- type CallbackObject = Record<string, PathItemObject | ReferenceObject>;
2247
- type SecurityRequirementObject = OpenAPIV3.SecurityRequirementObject;
2248
- type ComponentsObject = Modify<OpenAPIV3.ComponentsObject, {
2249
- schemas?: Record<string, SchemaObject>;
2250
- responses?: Record<string, ReferenceObject | ResponseObject>;
2251
- parameters?: Record<string, ReferenceObject | ParameterObject>;
2252
- examples?: Record<string, ReferenceObject | ExampleObject>;
2253
- requestBodies?: Record<string, ReferenceObject | RequestBodyObject>;
2254
- headers?: Record<string, ReferenceObject | HeaderObject>;
2255
- securitySchemes?: Record<string, ReferenceObject | SecuritySchemeObject>;
2256
- links?: Record<string, ReferenceObject | LinkObject>;
2257
- callbacks?: Record<string, ReferenceObject | CallbackObject>;
2258
- pathItems?: Record<string, ReferenceObject | PathItemObject>;
2259
- }>;
2260
- type SecuritySchemeObject = OpenAPIV3.SecuritySchemeObject;
2261
- type HttpSecurityScheme = OpenAPIV3.HttpSecurityScheme;
2262
- type ApiKeySecurityScheme = OpenAPIV3.ApiKeySecurityScheme;
2263
- type OAuth2SecurityScheme = OpenAPIV3.OAuth2SecurityScheme;
2264
- type OpenIdSecurityScheme = OpenAPIV3.OpenIdSecurityScheme;
2265
- type TagObject = OpenAPIV3.TagObject;
2266
- {};
2267
- }
2268
-
2269
- /**
2270
- * The Open ID JWT Authentication policy allows you to authenticate incoming requests using an Open ID compliant bearer token.
2271
- *
2272
- * @remarks
2273
- * The Open ID JWT Authentication policy allows you to authenticate incoming
2274
- * requests using an Open ID-compliant bearer token. It works with common
2275
- * authentication services like Auth0 (sample here) but should also work with any
2276
- * valid Open ID JWT token.
2277
- *
2278
- * When configured, you can have Zuplo check incoming requests for a JWT token and
2279
- * automatically populate the `ZuploRequest` 's `user` property with a user object.
2280
- * This `user` object will have a `sub` property - taking the `sub` id from the JWT
2281
- * token. It will also have a `data` property populated by other data returned in
2282
- * the JWT token (including any claims).
2283
- *
2284
- * See {@link https://zuplo.com/docs/articles/oauth-authentication|this document} for more information
2285
- * about OAuth authorization in Zuplo.
2286
- *
2287
- * @title JWT Auth
2288
- * @public
2289
- * @param request - The ZuploRequest
2290
- * @param context - The ZuploContext
2291
- * @param options - The policy options set in policies.json
2292
- * @param policyName - The name of the policy as set in policies.json
2293
- * @returns A Request or a Response
2294
- */
2295
- export declare const OpenIdJwtInboundPolicy: InboundPolicyHandler<OpenIdJwtInboundPolicyInternalOptions>;
2296
-
2297
- declare interface OpenIdJwtInboundPolicyInternalOptions extends Omit<OpenIdJwtInboundPolicyOptions, "secret"> {
2298
- secret?: string | KeyLike;
2299
- }
2300
-
2301
- /**
2302
- * The options for this policy.
2303
- */
2304
- export declare interface OpenIdJwtInboundPolicyOptions {
2305
- /**
2306
- * The expected issuer claim in the JWT token.
2307
- */
2308
- issuer?: string;
2309
- /**
2310
- * The expected audience claim in the JWT token.
2311
- */
2312
- audience?: string;
2313
- /**
2314
- * the url of the JSON Web Key Set (JWKS) - this is used to validate the JWT token signature (either this or `secret` must be set).
2315
- */
2316
- jwkUrl?: string;
2317
- /**
2318
- * The key used to verify the signature of the JWT token (either this or `jwkUrl` must be set).
2319
- */
2320
- secret?: string;
2321
- /**
2322
- * indicates whether the request should continue if authentication fails. Defaults is `false` which means unauthenticated users will automatically receive a 401 response.
2323
- */
2324
- allowUnauthenticatedRequests?: boolean;
2325
- /**
2326
- * The name of the property in the JWT token that contains the user's unique identifier.
2327
- */
2328
- subPropertyName?: string;
2329
- /**
2330
- * Additional headers to send with the JWK request.
2331
- */
2332
- headers?: {
2333
- [k: string]: string;
2334
- };
2335
- }
2336
-
2337
- /* Excluded from this release type: OutboundPolicy */
2338
-
2339
- /**
2340
- * @public
2341
- * A policy that can modify the outgoing HTTP response before it is returned
2342
- * to the client.
2343
- *
2344
- * @param response - The outgoing Response
2345
- * @param request - The incoming Request
2346
- * @param context - The current context of the Request
2347
- * @param options - The configuration options for the policy
2348
- * @param policyName - The name set on the policy in the configuration
2349
- * @returns A Response object
2350
- */
2351
- export declare interface OutboundPolicyHandler<TOptions = any> {
2352
- (response: Response, request: ZuploRequest, context: ZuploContext, options: TOptions, policyName: string): Promise<Response>;
2353
- }
2354
-
2355
- /* Excluded from this release type: ParameterBaseObject */
2356
-
2357
- /* Excluded from this release type: ParameterDefinition */
2358
-
2359
- /**
2360
- * This is the parsed values of the Cors configuration. All
2361
- * values in the parsed configuration are in the format that the headers
2362
- * use them (i.e. everything is converted to a string)
2363
- */
2364
- declare interface ParsedCorsPolicyConfiguration {
2365
- name: string;
2366
- allowCredentials: string | undefined;
2367
- maxAge: string | undefined;
2368
- allowedOrigins: string[];
2369
- allowedMethods?: string;
2370
- allowedHeaders?: string;
2371
- exposeHeaders?: string;
2372
- }
2373
-
2374
- declare interface ParsedRouteData extends Omit<RouteData, "corsPolicies"> {
2375
- corsPolicies: ParsedCorsPolicyConfiguration[];
2376
- }
2377
-
2378
- /**
2379
- * @public
2380
- * The base class for inbound and outbound policies
2381
- */
2382
- declare abstract class PolicyBase<TOptions = any> {
2383
- options: TOptions;
2384
- policyName: string;
2385
- policyType: string;
2386
- /* Excluded from this release type: __constructor */
2387
- }
2388
-
2389
- export declare interface PolicyConfiguration {
2390
- name: string;
2391
- policyType: string;
2392
- handler: HandlerDefinition;
2393
- options?: unknown;
2394
- }
2395
-
2396
- declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
2397
-
2398
- /* Excluded from this release type: ProblemDetails */
2399
-
2400
- /* Excluded from this release type: ProblemResponseDetails */
2401
-
2402
- /* Excluded from this release type: ProblemResponseFormat */
2403
-
2404
- /* Excluded from this release type: ProblemResponseFormatter */
2405
-
2406
- /**
2407
- * Authenticate users using PropelAuth issued JWT tokens.
2408
- *
2409
- * @remarks
2410
- * Authenticate requests with JWT tokens issued by {@link https://propelauth.com|PropelAuth}.
2411
- * This is a customized version of the {@link https://zuplo.com/docs/policies/open-id-jwt-auth-inbound|OpenId JWT Policy}
2412
- * specifically for PropelAuth.
2413
- *
2414
- * @title PropelAuth JWT Auth
2415
- * @public
2416
- * @param request - The ZuploRequest
2417
- * @param context - The ZuploContext
2418
- * @param options - The policy options set in policies.json
2419
- * @param policyName - The name of the policy as set in policies.json
2420
- * @returns A Request or a Response
2421
- */
2422
- export declare const PropelAuthJwtInboundPolicy: InboundPolicyHandler<PropelAuthJwtInboundPolicyOptions>;
2423
-
2424
- /**
2425
- * The options for this policy.
2426
- */
2427
- export declare interface PropelAuthJwtInboundPolicyOptions {
2428
- /**
2429
- * Allow unauthenticated requests to proceed. This is use useful if you want to use multiple authentication policies or if you want to allow both authenticated and non-authenticated traffic.
2430
- */
2431
- allowUnauthenticatedRequests?: boolean;
2432
- /**
2433
- * Your PropelAuth authUrl. For example, `https://6587563.propelauthtest.com`.
2434
- */
2435
- authUrl: string;
2436
- /**
2437
- * Your public (verifier) key that is used to verify access tokens. This key has a value that begins with '-----BEGIN PUBLIC KEY-----'. Make sure to remove all line breaks from the key before saving the variable.
2438
- */
2439
- verifierKey: string;
2440
- }
2441
-
2442
- /**
2443
- * The identifying element of the request that enforces distinct rate limits. For example, you can limit by `user`, `ip`, `function` or `all` - function allows you to specify a simple function to create a string identifier to create a rate-limit group.
2444
- */
2445
- declare type RateLimitByType = "user" | "ip" | "function" | "all";
2446
-
2447
- /**
2448
- * Adds the retry-after header.
2449
- */
2450
- declare type RateLimitHeaderMode = "none" | "retry-after";
2451
-
2452
- /**
2453
- * The rate-limiting policy is used to limit the number of requests that can be made against your API based on a key.
2454
- *
2455
- * @remarks
2456
- * Rate-limiting allows you to set a maximum rate of requests for your API gateway.
2457
- * This is useful to enforce rate limits agreed with your clients and protect your
2458
- * downstream services.
2459
- *
2460
- * The Zuplo Rate-Limit allows you to limit based on different attributes of the
2461
- * incoming request. For example, you might set a rate limit of 10 requests per
2462
- * second per user, or 20 requests per second for a given IP address.
2463
- *
2464
- * The Zuplo rate-limiter also allows you to set a custom bucket name by which to
2465
- * effect a rate-limit using a function.
2466
- *
2467
- * When a client reaches a rate limit - they will receive a `429` response code.
2468
- *
2469
- * @title Rate Limiting
2470
- * @public
2471
- * @param request - The ZuploRequest
2472
- * @param context - The ZuploContext
2473
- * @param options - The policy options set in policies.json
2474
- * @param policyName - The name of the policy as set in policies.json
2475
- * @returns A Request or a Response
2476
- */
2477
- declare const RateLimitInboundPolicy: InboundPolicyHandler<RateLimitInboundPolicyOptions>;
2478
- export { RateLimitInboundPolicy as BasicRateLimitInboundPolicy }
2479
- export { RateLimitInboundPolicy }
2480
-
2481
- /**
2482
- * The options for this policy.
2483
- */
2484
- declare interface RateLimitInboundPolicyOptions {
2485
- rateLimitBy: RateLimitByType;
2486
- /**
2487
- * The max number of requests allowed in the given time window.
2488
- */
2489
- requestsAllowed: number;
2490
- /**
2491
- * The time window in which the requests are rate-limited. The count restarts after each window expires.
2492
- */
2493
- timeWindowMinutes: number;
2494
- /**
2495
- * The function that returns dynamic configuration data. Used only with `rateLimitBy=function`.
2496
- */
2497
- identifier?: {
2498
- /**
2499
- * used only with rateLimitBy=function. Specifies the export to load your custom bucket function, e.g. `default`, `rateLimitIdentifier`.
2500
- */
2501
- export: string;
2502
- /**
2503
- * Specifies the module to load your custom bucket function, in the format `$import(./modules/my-module)`.
2504
- */
2505
- module: string;
2506
- };
2507
- headerMode?: RateLimitHeaderMode;
2508
- /**
2509
- * If true, the policy will throw an error in the event there is a problem connecting to the rate limit service.
2510
- */
2511
- throwOnFailure?: boolean;
2512
- mode?: RateLimitMode;
2513
- }
2514
- export { RateLimitInboundPolicyOptions as BasicRateLimitInboundPolicyOptions }
2515
- export { RateLimitInboundPolicyOptions }
2516
-
2517
- /**
2518
- * The mode of the policy. If set to `async`, the policy will check if the request is over the rate limit without blocking. This can result in some requests allowed over the rate limit.
2519
- */
2520
- declare type RateLimitMode = "strict" | "async";
2521
-
2522
- /**
2523
- * The options for this policy. Many of them can be overridden at the code level in a request using the `AmberfloMeteringPolicy.setRequestProperties` method.
2524
- */
2525
- declare interface ReadmeMeteringInboundPolicyOptions {
2526
- /**
2527
- * The API key to use when sending metrics calls to Readme.
2528
- */
2529
- apiKey: string;
2530
- /**
2531
- * This is the path to the property on `request.user` that contains the label you want to use. For example `.data.accountNumber` would read the `request.user.data.accountNumber` property.
2532
- */
2533
- userLabelPropertyPath?: string;
2534
- /**
2535
- * This is the path to the property on `request.user` that contains the e-mail of the user. For example `.data.email` would read the `request.user.data.email` property.
2536
- */
2537
- userEmailPropertyPath?: string;
2538
- /**
2539
- * Whether the data should be ingested as 'development' mode or not. Defaults to true for working-copy and false for all other environments.
2540
- */
2541
- development?: boolean;
2542
- /**
2543
- * When true, Zuplo sends the full request path (which might contain sensitive information). By default, we only send the route path which should not contain sensitive information.
2544
- */
2545
- useFullRequestPath?: boolean;
2546
- /**
2547
- * The URL to send metering events. This is useful for testing purposes.
2548
- */
2549
- url?: string;
2550
- }
2551
-
2552
- /**
2553
- * Readme is a developer documentation and API metrics company. This policy pushes logs to their API calls dashboard.
2554
- *
2555
- * @remarks
2556
- * {@link https://readme.com|Readme} is a developer Documentation and
2557
- * metrics service. This policy pushes the request/response data to their ingestion
2558
- * endpoint so you can see your Zuplo API traffic in their API calls dashboard.
2559
- *
2560
- * @title Readme Metrics
2561
- * @public
2562
- * @param request - The ZuploRequest
2563
- * @param context - The ZuploContext
2564
- * @param options - The policy options set in policies.json
2565
- * @param policyName - The name of the policy as set in policies.json
2566
- * @returns A Request or a Response
2567
- */
2568
- export declare function ReadmeMetricsInboundPolicy(request: ZuploRequest, context: ZuploContext, options: ReadmeMeteringInboundPolicyOptions, policyName: string): Promise<ZuploRequest<RequestGeneric>>;
2569
-
2570
- /* Excluded from this release type: redirectHandler */
2571
-
2572
- /**
2573
- * Remove headers from the incoming request.
2574
- *
2575
- * @title Remove Request Headers
2576
- * @public
2577
- * @param request - The ZuploRequest
2578
- * @param context - The ZuploContext
2579
- * @param options - The policy options set in policies.json
2580
- * @param policyName - The name of the policy as set in policies.json
2581
- * @returns A Request or a Response
2582
- */
2583
- export declare const RemoveHeadersInboundPolicy: InboundPolicyHandler<RemoveHeadersInboundPolicyOptions>;
2584
-
2585
- /**
2586
- * The options for this policy.
2587
- */
2588
- export declare interface RemoveHeadersInboundPolicyOptions {
2589
- /**
2590
- * An array of headers to remove from the incoming request.
2591
- */
2592
- headers: string[];
2593
- }
2594
-
2595
- /**
2596
- * Remove configured headers from the outgoing response.
2597
- *
2598
- * @title Remove Response Headers
2599
- * @public
2600
- * @param request - The ZuploRequest
2601
- * @param context - The ZuploContext
2602
- * @param options - The policy options set in policies.json
2603
- * @param policyName - The name of the policy as set in policies.json
2604
- * @returns A Request or a Response
2605
- */
2606
- export declare const RemoveHeadersOutboundPolicy: OutboundPolicyHandler<RemoveHeadersOutboundPolicyOptions>;
2607
-
2608
- /**
2609
- * The options for this policy.
2610
- */
2611
- export declare interface RemoveHeadersOutboundPolicyOptions {
2612
- /**
2613
- * An array of headers to be removed from the outgoing response.
2614
- */
2615
- headers: string[];
2616
- }
2617
-
2618
- /**
2619
- * Remove query parameters from the incoming request
2620
- *
2621
- * @title Remove Query Parameters
2622
- * @public
2623
- * @param request - The ZuploRequest
2624
- * @param context - The ZuploContext
2625
- * @param options - The policy options set in policies.json
2626
- * @param policyName - The name of the policy as set in policies.json
2627
- * @returns A Request or a Response
2628
- */
2629
- export declare const RemoveQueryParamsInboundPolicy: InboundPolicyHandler<RemoveQueryParamsInboundPolicyOptions>;
2630
-
2631
- /**
2632
- * The options for this policy.
2633
- */
2634
- export declare interface RemoveQueryParamsInboundPolicyOptions {
2635
- /**
2636
- * An array of query parameters to be removed from the incoming request.
2637
- */
2638
- params: string[];
2639
- }
2640
-
2641
- /**
2642
- * Replace a string in the incoming request body
2643
- *
2644
- * @title Replace String in Response Body
2645
- * @public
2646
- * @param request - The ZuploRequest
2647
- * @param context - The ZuploContext
2648
- * @param options - The policy options set in policies.json
2649
- * @param policyName - The name of the policy as set in policies.json
2650
- * @returns A Request or a Response
2651
- */
2652
- export declare const ReplaceStringOutboundPolicy: OutboundPolicyHandler<ReplaceStringOutboundPolicyOptions>;
2653
-
2654
- /**
2655
- * The options for this policy.
2656
- */
2657
- export declare interface ReplaceStringOutboundPolicyOptions {
2658
- /**
2659
- * The type of string replacement to perform.
2660
- */
2661
- mode: "regexp" | "string";
2662
- /**
2663
- * The pattern to match.
2664
- */
2665
- match: string;
2666
- /**
2667
- * The value to each match is replaced with.
2668
- */
2669
- replaceWith: string;
2670
- }
2671
-
2672
- /* Excluded from this release type: RequestContext */
2673
-
2674
- /**
2675
- * The types of the properties in a request
2676
- * @public
2677
- */
2678
- export declare interface RequestGeneric extends RequestInitGeneric {
2679
- Query?: RequestQueryDefault;
2680
- }
2681
-
2682
- /* Excluded from this release type: RequestHandlerFunction */
2683
-
2684
- /* Excluded from this release type: RequestHandlerProxy */
2685
-
2686
- /**
2687
- * The types of the properties in a request init object
2688
- * @public
2689
- */
2690
- export declare interface RequestInitGeneric {
2691
- UserData?: UserDataDefault;
2692
- Params?: RequestParamsDefault;
2693
- }
2694
-
2695
- declare type RequestParamsDefault = Record<string, string>;
2696
-
2697
- declare type RequestQueryDefault = Record<string, string>;
2698
-
2699
- declare interface RequestReference {
2700
- ReferenceId: string[];
2701
- }
2702
-
2703
- /**
2704
- * Enforces a maximum size in bytes of the incoming request.
2705
- *
2706
- * @title Request Size Limit
2707
- * @public
2708
- * @param request - The ZuploRequest
2709
- * @param context - The ZuploContext
2710
- * @param options - The policy options set in policies.json
2711
- * @param policyName - The name of the policy as set in policies.json
2712
- * @returns A Request or a Response
2713
- */
2714
- export declare const RequestSizeLimitInboundPolicy: InboundPolicyHandler<RequestSizeLimitInboundPolicyOptions>;
2715
-
2716
- /**
2717
- * The options for this policy.
2718
- */
2719
- export declare interface RequestSizeLimitInboundPolicyOptions {
2720
- /**
2721
- * The maximum size of the request in bytes.
2722
- */
2723
- maxSizeInBytes: number;
2724
- /**
2725
- * If true, the policy will reject any request with a `content-length` header in excess of `maxSizeInBytes` bytes value, but will not verify the actual size of the request. This is more efficient and offers slightly better memory usage but should only be used if you trust/control the clients calling the gateway to send an accurate content-length. If false, the gateway will actually verify the request size and reject any request with a size in excess of the stated maximum.
2726
- */
2727
- trustContentLengthHeader?: boolean;
2728
- }
2729
-
2730
- /**
2731
- * The authorized identity on the incoming request
2732
- * @public
2733
- */
2734
- export declare interface RequestUser<TUserData> {
2735
- sub: string;
2736
- data: TUserData;
2737
- }
2738
-
2739
- /**
2740
- * Validate inbound requests based on Open API specification
2741
- *
2742
- * @remarks
2743
- * The Request Validation policy is used to validate incoming requests based on
2744
- * schemas in OpenAPI specifications.
2745
- *
2746
- * When configured, any requests that do not conform to your OpenAPI schema will be
2747
- * rejected with a `400: Bad Request` response containing a detailed error message
2748
- * (in JSON) explaining why the request was not accepted.
2749
- *
2750
- * @title Request Validation
2751
- * @public
2752
- * @param request - The ZuploRequest
2753
- * @param context - The ZuploContext
2754
- * @param options - The policy options set in policies.json
2755
- * @param policyName - The name of the policy as set in policies.json
2756
- * @returns A Request or a Response
2757
- */
2758
- export declare const RequestValidationInboundPolicy: InboundPolicyHandler<RequestValidationInboundPolicyOptions>;
2759
-
2760
- /**
2761
- * The options for this policy.
2762
- */
2763
- export declare interface RequestValidationInboundPolicyOptions {
2764
- /**
2765
- * The log level to use when logging validation errors.
2766
- */
2767
- logLevel?: "error" | "warn" | "info" | "debug";
2768
- validateBody?: ValidationOptions;
2769
- validateQueryParameters?: ValidationOptions1;
2770
- validatePathParameters?: ValidationOptions2;
2771
- validateHeaders?: ValidationOptions3;
2772
- /**
2773
- * Whether to include the request in the logs.
2774
- */
2775
- includeRequestInLogs?: boolean;
2776
- }
2777
-
2778
- /**
2779
- * Sets an allow-list for an origin header
2780
- *
2781
- * @remarks
2782
- * The Require Origin policy is used to enforce that the client is sending an
2783
- * `origin` header that matches your allow-list specified in the policy options.
2784
- *
2785
- * This is useful if you want to stop any browser traffic from different domains.
2786
- *
2787
- * However, it is important to note that it does not guarantee that traffic is only
2788
- * coming from a browser. Somebody could simulate a browser request from a backend
2789
- * server and set any origin they like.
2790
- *
2791
- * If the incoming origin is missing, or not allowed - a 400 Forbidden Problem
2792
- * Response will be sent to the client. You can customize the `detail` property in
2793
- * the policy options.
2794
- *
2795
- * @title Require Origin
2796
- * @public
2797
- * @param request - The ZuploRequest
2798
- * @param context - The ZuploContext
2799
- * @param options - The policy options set in policies.json
2800
- * @param policyName - The name of the policy as set in policies.json
2801
- * @returns A Request or a Response
2802
- */
2803
- export declare const RequireOriginInboundPolicy: InboundPolicyHandler<RequireOriginInboundPolicyOptions>;
2804
-
2805
- /**
2806
- * The options for this policy.
2807
- */
2808
- export declare interface RequireOriginInboundPolicyOptions {
2809
- /**
2810
- * A comma separated string containing valid origins.
2811
- */
2812
- origins: string;
2813
- /**
2814
- * The `detail` of the HTTP Problem response, if the origin is missing or disallowed.
2815
- */
2816
- failureDetail?: string;
2817
- }
2818
-
2819
- declare type ResolveRequestParams<TParams extends RequestParamsDefault | undefined> = TParams extends RequestParamsDefault ? TParams : RequestParamsDefault;
2820
-
2821
- declare type ResolveRequestQuery<TQuery extends RequestQueryDefault | undefined> = TQuery extends RequestQueryDefault ? TQuery : RequestQueryDefault;
2822
-
2823
- declare type ResolveUserData<TUserData extends UserDataDefault | undefined> = TUserData extends UserDataDefault ? TUserData : UserDataDefault;
2824
-
2825
- /* Excluded from this release type: ResponsesDefinition */
2826
-
2827
- /* Excluded from this release type: ResponseSendingEvent */
2828
-
2829
- /* Excluded from this release type: ResponseSentEvent */
2830
-
2831
- export declare interface RouteConfiguration extends Omit<BuildRouteConfiguration, "raw"> {
2832
- /**
2833
- * @deprecated Please switch to "raw().operationId"
2834
- */
2835
- operationId?: string;
2836
- /**
2837
- * @deprecated Please switch to "raw().summary"
2838
- */
2839
- summary?: string;
2840
- /**
2841
- * @deprecated Please switch to "raw().tags"
2842
- */
2843
- tags?: string[];
2844
- /**
2845
- * @deprecated Please switch to "raw().parameters"
2846
- */
2847
- parameters?: ParameterDefinition[];
2848
- /**
2849
- * @deprecated Please switch to "raw().responses"
2850
- */
2851
- responses?: ResponsesDefinition;
2852
- raw<T>(): T;
2853
- }
2854
-
2855
- export declare interface RouteData {
2856
- /**
2857
- /* @deprecated This property is not used and will be removed in future versions
2858
- */
2859
- info?: OpenAPIV3_1.InfoObject;
2860
- /**
2861
- /* @deprecated This property is not used and will be removed in future versions
2862
- */
2863
- versions: VersionData[];
2864
- /**
2865
- * @minItems 0
2866
- */
2867
- routes: RouteConfiguration[];
2868
- policies?: PolicyConfiguration[];
2869
- corsPolicies?: CorsPolicyConfiguration[];
2870
- requestErrorHandler?: HandlerDefinition;
2871
- }
2872
-
2873
- /* Excluded from this release type: RouteHandler */
2874
-
2875
- /* Excluded from this release type: Router */
2876
-
2877
- /* Excluded from this release type: RouterEntry */
2878
-
2879
- /* Excluded from this release type: RuntimeEnvironment */
2880
-
2881
- /**
2882
- * Used to indicate errors that are caused by user input
2883
- * These errors are shown to the user and logged in user logs
2884
- * These errors are NOT fatal and will not cause monitoring alerts
2885
- * @public
2886
- */
2887
- export declare class RuntimeError extends Error {
2888
- extensionMembers: Record<string, unknown> | undefined;
2889
- constructor(message: string, options?: ErrorOptions);
2890
- constructor(info: {
2891
- message: string;
2892
- extensionMembers?: Record<string, unknown>;
2893
- }, options?: ErrorOptions);
2894
- }
2895
-
2896
- /* Excluded from this release type: RuntimeExtensions */
2897
-
2898
- export declare interface RuntimeExtensionsFunction {
2899
- (runtime: RuntimeExtensions): Promise<void>;
2900
- }
2901
-
2902
- /**
2903
- * @public
2904
- */
2905
- declare abstract class RuntimePlugin {
2906
- }
2907
-
2908
- /* Excluded from this release type: RuntimeSettings */
2909
-
2910
- declare type RuntimeType = "deno" | "cloudflare";
2911
-
2912
- export declare function sanitizedIdentifierName(name: string): string;
2913
-
2914
- /**
2915
- * @deprecated Use RequestValidationInboundPolicy instead
2916
- */
2917
- export declare const SchemaBasedRequestValidation: InboundPolicyHandler<RequestValidationInboundPolicyOptions>;
2918
-
2919
- /* Excluded from this release type: SemanticAttributes */
2920
-
2921
- /* Excluded from this release type: serialize */
2922
-
2923
- /* Excluded from this release type: ServiceProvider */
2924
-
2925
- /* Excluded from this release type: ServiceProviderImpl */
2926
-
2927
- /**
2928
- * Sets the body of the request in the inbound pipeline - make sure to convert a GET/HEAD request to another method when using this policy.
2929
- *
2930
- * @remarks
2931
- * The Set Body policy allows you to set or override the incoming request body.
2932
- * {@link https://zuplo.com/docs/articles/zp-body-removed|GET or HEAD requests do not support bodies on Zuplo},
2933
- * so be sure to use the {@link https://zuplo.com/docs/policies/change-method-inbound|Change Method}
2934
- * policy to update the method to a `POST` or whatever is appropriate. You might
2935
- * also need to use the {@link https://zuplo.com/docs/policies/set-headers-inbound|Set Header} policy to
2936
- * set a `content-type`.
2937
- *
2938
- * @title Set Body
2939
- * @public
2940
- * @param request - The ZuploRequest
2941
- * @param context - The ZuploContext
2942
- * @param options - The policy options set in policies.json
2943
- * @param policyName - The name of the policy as set in policies.json
2944
- * @returns A Request or a Response
2945
- */
2946
- export declare const SetBodyInboundPolicy: InboundPolicyHandler<SetBodyInboundPolicyOptions>;
2947
-
2948
- /**
2949
- * The options for this policy.
2950
- */
2951
- export declare interface SetBodyInboundPolicyOptions {
2952
- /**
2953
- * The value to set for the body.
2954
- */
2955
- body: string;
2956
- }
2957
-
2958
- /**
2959
- * Adds or sets headers on the incoming request.
2960
- *
2961
- * @remarks
2962
- * The set header policy adds a header to the request in the inbound pipeline. This
2963
- * can be used to set a security header required by the downstream service.
2964
- *
2965
- * @title Add or Set Request Headers
2966
- * @public
2967
- * @param request - The ZuploRequest
2968
- * @param context - The ZuploContext
2969
- * @param options - The policy options set in policies.json
2970
- * @param policyName - The name of the policy as set in policies.json
2971
- * @returns A Request or a Response
2972
- */
2973
- export declare const SetHeadersInboundPolicy: InboundPolicyHandler<SetHeadersInboundPolicyOptions>;
2974
-
2975
- /**
2976
- * The options for this policy.
2977
- */
2978
- export declare interface SetHeadersInboundPolicyOptions {
2979
- /**
2980
- * An array of headers to set in the request. By default, headers will be overwritten if they already exists in the request, specify the overwrite property to change this behavior.
2981
- */
2982
- headers: {
2983
- /**
2984
- * The name of the header.
2985
- */
2986
- name: string;
2987
- /**
2988
- * The value of the header.
2989
- */
2990
- value: string;
2991
- /**
2992
- * Overwrite the value if the header is already present in the request.
2993
- */
2994
- overwrite?: boolean;
2995
- }[];
2996
- }
2997
-
2998
- /**
2999
- * Adds or sets headers on the on the outgoing response.
3000
- *
3001
- * @title Set Headers
3002
- * @public
3003
- * @param request - The ZuploRequest
3004
- * @param context - The ZuploContext
3005
- * @param options - The policy options set in policies.json
3006
- * @param policyName - The name of the policy as set in policies.json
3007
- * @returns A Request or a Response
3008
- */
3009
- export declare const SetHeadersOutboundPolicy: OutboundPolicyHandler<SetHeadersOutboundPolicyOptions>;
3010
-
3011
- /**
3012
- * The options for this policy.
3013
- */
3014
- export declare interface SetHeadersOutboundPolicyOptions {
3015
- /**
3016
- * An array of headers to set on the response. By default, headers will be overwritten if they already exists in the response, specify the overwrite property to change this behavior.
3017
- */
3018
- headers: {
3019
- /**
3020
- * The name of the header.
3021
- */
3022
- name: string;
3023
- /**
3024
- * The value of the header.
3025
- */
3026
- value: string;
3027
- /**
3028
- * Overwrite the value if the header is already present in the response.
3029
- */
3030
- overwrite?: boolean;
3031
- }[];
3032
- }
3033
-
3034
- export declare function setMoesifContext(context: ZuploContext, moesifContext: MoesifContext): void;
3035
-
3036
- /**
3037
- * Adds or sets query parameters on the incoming request.
3038
- *
3039
- * @title Add or Set Query Parameters
3040
- * @public
3041
- * @param request - The ZuploRequest
3042
- * @param context - The ZuploContext
3043
- * @param options - The policy options set in policies.json
3044
- * @param policyName - The name of the policy as set in policies.json
3045
- * @returns A Request or a Response
3046
- */
3047
- export declare const SetQueryParamsInboundPolicy: InboundPolicyHandler<SetQueryParamsInboundPolicyOptions>;
3048
-
3049
- /**
3050
- * The options for this policy.
3051
- */
3052
- export declare interface SetQueryParamsInboundPolicyOptions {
3053
- /**
3054
- * An array of query params to set in the request. By default, query parameters will be overwritten if they already exist in the request, specify the overwrite property to change this behavior.
3055
- */
3056
- params: {
3057
- /**
3058
- * The name of the param.
3059
- */
3060
- name: string;
3061
- /**
3062
- * The value of the param.
3063
- */
3064
- value: string;
3065
- /**
3066
- * Overwrite the value if the param is already present in the request.
3067
- */
3068
- overwrite?: boolean;
3069
- }[];
3070
- }
3071
-
3072
- /**
3073
- * Sets the status code on the on the outgoing response.
3074
- *
3075
- * @title Set Status Code
3076
- * @public
3077
- * @param request - The ZuploRequest
3078
- * @param context - The ZuploContext
3079
- * @param options - The policy options set in policies.json
3080
- * @param policyName - The name of the policy as set in policies.json
3081
- * @returns A Request or a Response
3082
- */
3083
- export declare const SetStatusOutboundPolicy: OutboundPolicyHandler<SetStatusOutboundPolicyOptions>;
3084
-
3085
- /**
3086
- * The options for this policy.
3087
- */
3088
- export declare interface SetStatusOutboundPolicyOptions {
3089
- /**
3090
- * The status code to be used in the response.
3091
- */
3092
- status?: number;
3093
- /**
3094
- * The statusText to be used in the response.
3095
- */
3096
- statusText?: string;
3097
- }
3098
-
3099
- /**
3100
- * Add a delay to the incoming request. Useful for testing.
3101
- *
3102
- * @title Sleep / Delay
3103
- * @public
3104
- * @param request - The ZuploRequest
3105
- * @param context - The ZuploContext
3106
- * @param options - The policy options set in policies.json
3107
- * @param policyName - The name of the policy as set in policies.json
3108
- * @returns A Request or a Response
3109
- */
3110
- export declare const SleepInboundPolicy: InboundPolicyHandler<SleepInboundPolicyOptions>;
3111
-
3112
- /**
3113
- * The options for this policy.
3114
- */
3115
- export declare interface SleepInboundPolicyOptions {
3116
- /**
3117
- * The number of milliseconds to delay the request.
3118
- */
3119
- sleepInMs: number;
3120
- }
3121
-
3122
- /* Excluded from this release type: StandardEnv */
3123
-
3124
- /* Excluded from this release type: StripeMonetizationPlugin */
3125
-
3126
- /* Excluded from this release type: StripeMonetizationPluginOptions */
3127
-
3128
- /**
3129
- * The Stripe Webhook policy validates the authenticity of an incoming Stripe webhook.
3130
- *
3131
- * @remarks
3132
- * The Stripe Webhook policy secures your incoming webhooks by validating that
3133
- * the request was sent by Stripe.
3134
- *
3135
- * @title Stripe Webhook Auth
3136
- * @public
3137
- * @param request - The ZuploRequest
3138
- * @param context - The ZuploContext
3139
- * @param options - The policy options set in policies.json
3140
- * @param policyName - The name of the policy as set in policies.json
3141
- * @returns A Request or a Response
3142
- */
3143
- export declare class StripeWebhookVerificationInboundPolicy extends InboundPolicy<StripeWebhookVerificationInboundPolicyOptions> {
3144
- handler(request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest<RequestGeneric> | Response>;
3145
- }
3146
-
3147
- /**
3148
- * The options for this policy.
3149
- */
3150
- export declare interface StripeWebhookVerificationInboundPolicyOptions {
3151
- /**
3152
- * The signing secret for the webhook.
3153
- */
3154
- signingSecret: string;
3155
- /**
3156
- * The allowed clock skew in seconds between the time the webhook signature was crated and the current time.
3157
- */
3158
- tolerance?: number;
3159
- }
3160
-
3161
- /* Excluded from this release type: SubscriptionMeters */
3162
-
3163
- declare interface SumoLogicLoggingOptions {
3164
- url: string;
3165
- name?: string;
3166
- category?: string;
3167
- }
3168
-
3169
- export declare class SumoLogicLoggingPlugin extends LogPlugin {
3170
- private options;
3171
- constructor(options: SumoLogicLoggingOptions);
3172
- /* Excluded from this release type: getTransport */
3173
- }
3174
-
3175
- /**
3176
- * The Supabase JWT Authentication policy supports user JWT tokens created by Supabase.
3177
- *
3178
- * @remarks
3179
- * The Supabase JWT Authentication policy allows you to authenticate incoming
3180
- * requests using a token created by {@link https://supabase.com|supabase.com}.
3181
- *
3182
- * When configured, you can have Zuplo check incoming requests for a JWT token and
3183
- * automatically populate the `ZuploRequest`'s `user` property with a user object.
3184
- *
3185
- * This `user` object will have a `sub` property - taking the `sub` id from the JWT
3186
- * token. It will also have a `data` property populated by other data returned in
3187
- * the JWT token - including all your claims, `user_metadata` and `app_metadata`.
3188
- *
3189
- * You can also require specific claims to have specific values to allow
3190
- * authentication to complete, providing a layer of authorization.
3191
- *
3192
- * @title Supabase JWT Auth
3193
- * @public
3194
- * @param request - The ZuploRequest
3195
- * @param context - The ZuploContext
3196
- * @param options - The policy options set in policies.json
3197
- * @param policyName - The name of the policy as set in policies.json
3198
- * @returns A Request or a Response
3199
- */
3200
- export declare const SupabaseJwtInboundPolicy: InboundPolicyHandler<SupabaseJwtInboundPolicyOptions>;
3201
-
3202
- /**
3203
- * The options for this policy.
3204
- */
3205
- export declare interface SupabaseJwtInboundPolicyOptions {
3206
- /**
3207
- * The key used to verify the signature of the JWT token.
3208
- */
3209
- secret: string;
3210
- /**
3211
- * Indicates whether the request should continue if authentication fails. Default is `false` which means unauthenticated users will automatically receive a 401 response.
3212
- */
3213
- allowUnauthenticatedRequests?: boolean;
3214
- /**
3215
- * Any claims that must be present for authentication to succeed - multiple valid values can be specified for each claim.
3216
- */
3217
- requiredClaims?: {
3218
- [k: string]: string[];
3219
- };
3220
- }
3221
-
3222
- /* Excluded from this release type: SYSTEM_LOGGER */
3223
-
3224
- /* Excluded from this release type: SystemRouteName */
3225
-
3226
- /**
3227
- * Plugins for registering system capabilities
3228
- * @public
3229
- */
3230
- declare abstract class SystemRuntimePlugin extends RuntimePlugin {
3231
- /* Excluded from this release type: initialize */
3232
- /* Excluded from this release type: registerRoutes */
3233
- }
3234
-
3235
- /* Excluded from this release type: TelemetryInitializationOptions */
3236
-
3237
- /**
3238
- * Base class for determining type of plugin
3239
- * @public
3240
- */
3241
- export declare abstract class TelemetryPlugin extends RuntimePlugin {
3242
- /* Excluded from this release type: instrument */
3243
- }
3244
-
3245
- /**
3246
- * Uses Azure Active Directory to add an Authorization header to the request in order to authenticate requests using Azure identity.
3247
- *
3248
- * @remarks
3249
- * This policy adds a `Authorization` header to the upstream request that allows
3250
- * using Azure AD to authenticate requests to your origin server. This is a useful
3251
- * means of securing your origin server so that only your Zuplo gateway can make
3252
- * requests against it.
3253
- *
3254
- * Using this policy allows you to delegate authentication and authorization to
3255
- * your gateway without writing any code on your origin service. For instructions
3256
- * on how to configure Azure AD authentication see
3257
- * {@link https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad | Configure your App Service or Azure Functions app to use Azure AD login}.
3258
- *
3259
- * @title Upstream Azure AD Service Auth
3260
- * @public
3261
- * @param request - The ZuploRequest
3262
- * @param context - The ZuploContext
3263
- * @param options - The policy options set in policies.json
3264
- * @param policyName - The name of the policy as set in policies.json
3265
- * @returns A Request or a Response
3266
- */
3267
- export declare const UpstreamAzureAdServiceAuthInboundPolicy: InboundPolicyHandler<UpstreamAzureAdServiceAuthInboundPolicyOptions>;
3268
-
3269
- /**
3270
- * The options for this policy.
3271
- */
3272
- export declare interface UpstreamAzureAdServiceAuthInboundPolicyOptions {
3273
- /**
3274
- * Azure Active Directory Tenant ID.
3275
- */
3276
- activeDirectoryTenantId: string;
3277
- /**
3278
- * The Application (client) ID of the Azure AD App Registration.
3279
- */
3280
- activeDirectoryClientId: string;
3281
- /**
3282
- * The client secret of the Azure AD App Registration.
3283
- */
3284
- activeDirectoryClientSecret: string;
3285
- /**
3286
- * The number of times to retry fetching the token in the event of a failure..
3287
- */
3288
- tokenRetries?: number;
3289
- /**
3290
- * The number of seconds less than the token expiration to cache the token.
3291
- */
3292
- expirationOffsetSeconds?: number;
3293
- }
3294
-
3295
- /**
3296
- * Creates a Firebase Admin token and attaches it to the outgoing request. Useful when calling Firebase services as an administrator.
3297
- *
3298
- * @remarks
3299
- * This policy adds a Firebase Admin token to the outgoing `Authentication` header
3300
- * allowing requests to Firebase using Service Account admin permissions. This can
3301
- * be useful for calling Firebase services such as Firestore through a Zuplo
3302
- * endpoint that is secured with other means of Authentication such as API keys.
3303
- * Additionally, this policy can be useful for service content to all API users
3304
- * (for example serving a specific Firestore document containing configuration
3305
- * data)
3306
- *
3307
- * We recommend reading the `serviceAccountJson` from environment variables (so it
3308
- * is not checked in to source control) using the `$env(ENV_VAR)` syntax.
3309
- *
3310
- * @title Upstream Firebase Admin Auth
3311
- * @public
3312
- * @param request - The ZuploRequest
3313
- * @param context - The ZuploContext
3314
- * @param options - The policy options set in policies.json
3315
- * @param policyName - The name of the policy as set in policies.json
3316
- * @returns A Request or a Response
3317
- */
3318
- export declare const UpstreamFirebaseAdminAuthInboundPolicy: InboundPolicyHandler<UpstreamFirebaseAdminAuthInboundPolicyOptions>;
3319
-
3320
- /**
3321
- * The options for this policy.
3322
- */
3323
- export declare interface UpstreamFirebaseAdminAuthInboundPolicyOptions {
3324
- /**
3325
- * The Google Service Account key in JSON format. Note you can load this from environment variables using the $env(ENV_VAR) syntax.
3326
- */
3327
- serviceAccountJson: string;
3328
- /**
3329
- * The number of times to retry fetching the token in the event of a failure.
3330
- */
3331
- tokenRetries?: number;
3332
- /**
3333
- * The number of seconds less than the token expiration to cache the token.
3334
- */
3335
- expirationOffsetSeconds?: number;
3336
- }
3337
-
3338
- /**
3339
- * Creates a Firebase custom user token and attaches it to the outgoing request. Useful when calling Firebase services as user.
3340
- *
3341
- * @remarks
3342
- * This policy adds a Firebase Admin token to the outgoing `Authentication` header
3343
- * allowing requests to Firebase using Service Account admin permissions. This can
3344
- * be useful for calling Firebase services such as Firestore through a Zuplo
3345
- * endpoint that is secured with other means of Authentication such as API keys.
3346
- * Additionally, this policy can be useful for service content to all API users
3347
- * (for example serving a specific Firestore document containing configuration
3348
- * data)
3349
- *
3350
- * We recommend reading the `serviceAccountJson` from environment variables (so it
3351
- * is not checked in to source control) using the `$env(ENV_VAR)` syntax.
3352
- *
3353
- * @title Upstream Firebase User Auth
3354
- * @public
3355
- * @param request - The ZuploRequest
3356
- * @param context - The ZuploContext
3357
- * @param options - The policy options set in policies.json
3358
- * @param policyName - The name of the policy as set in policies.json
3359
- * @returns A Request or a Response
3360
- */
3361
- export declare const UpstreamFirebaseUserAuthInboundPolicy: InboundPolicyHandler<UpstreamFirebaseUserAuthInboundPolicyOptions>;
3362
-
3363
- /**
3364
- * The options for this policy.
3365
- */
3366
- export declare interface UpstreamFirebaseUserAuthInboundPolicyOptions {
3367
- /**
3368
- * The Google Service Account key in JSON format. Note you can load this from environment variables using the $env(ENV_VAR) syntax.
3369
- */
3370
- serviceAccountJson: string;
3371
- /**
3372
- * The userId to use as the custom token's subject.
3373
- */
3374
- userId?: string;
3375
- /**
3376
- * The property on the incoming request.user object to retrieve the value of the userId.
3377
- */
3378
- userIdPropertyPath?: string;
3379
- /**
3380
- * Additional claims to include in the custom token's payload.
3381
- */
3382
- developerClaims?: Record<string, string | number | boolean | null>;
3383
- /**
3384
- * The Firebase Web API Key (found in project settings)
3385
- * @see {@link https://firebase.google.com/docs/projects/api-keys|Firebase API Keys}.
3386
- */
3387
- webApiKey: string;
3388
- /**
3389
- * The number of times to retry fetching the token in the event of a failure.
3390
- */
3391
- tokenRetries?: number;
3392
- /**
3393
- * The number of seconds less than the token expiration to cache the token.
3394
- */
3395
- expirationOffsetSeconds?: number;
3396
- }
3397
-
3398
- /**
3399
- * Creates a self-signed JWT token (generated using a Google Service Account JSON) and attaches it to the outgoing request. Useful when calling GCP services like Cloud Endpoints / ESPv2
3400
- *
3401
- * @remarks
3402
- * This policy adds a JWT token to the headers, ready for us in an outgoing request
3403
- * when calling a GCP service (e.g. Cloud Endpoints / ESPv2). We recommend reading
3404
- * the `serviceAccountJson` from environment variables (so it is not checked in to
3405
- * source control) using the `$env(ENV_VAR)` syntax.
3406
- *
3407
- * CAUTION: This policy only works with {@link https://developers.google.com/identity/protocols/oauth2/service-account#jwt-auth | certain Google APIs}.
3408
- * In most cases, the {@link https://zuplo.com/docs/policies/upstream-gcp-service-auth-inbound | Upstream GCP Service Auth}
3409
- * should be used.
3410
- *
3411
- * @title Upstream GCP Self-Signed JWT
3412
- * @public
3413
- * @param request - The ZuploRequest
3414
- * @param context - The ZuploContext
3415
- * @param options - The policy options set in policies.json
3416
- * @param policyName - The name of the policy as set in policies.json
3417
- * @returns A Request or a Response
3418
- */
3419
- export declare const UpstreamGcpJwtInboundPolicy: InboundPolicyHandler<UpstreamGcpJwtInboundPolicyOptions>;
3420
-
3421
- /**
3422
- * The options for this policy.
3423
- */
3424
- export declare interface UpstreamGcpJwtInboundPolicyOptions {
3425
- /**
3426
- * The audience for the minted JWT. See the document {@link https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#google.api.AuthRequirement|AuthRequirement} for details.
3427
- */
3428
- audience: string;
3429
- /**
3430
- * The Google Service Account key in JSON format. Note you can load this from environment variables using the $env(ENV_VAR) syntax.
3431
- */
3432
- serviceAccountJson: string;
3433
- }
3434
-
3435
- /**
3436
- * Creates an ID Token from Google's OAuth service and attaches it to the outgoing request. Useful when calling GCP services or Google APIs that are secured with GCP IAM.
3437
- *
3438
- * @remarks
3439
- * This policy allows you to delegate authentication and authorization to your
3440
- * gateway without writing any code on your origin service by adding a GCP Issued
3441
- * ID Token to outgoing header allowing the service to be secured with GCP IAM.
3442
- * This is a useful means of securing your origin server so that only your Zuplo
3443
- * gateway can make requests against it.
3444
- *
3445
- *
3446
- * This policy works with
3447
- * {@link https://zuplo.com/docs/articles/gke-with-upstream-auth-policy|GCP Identity Aware Proxy}
3448
- * or services like {@link https://cloud.google.com/iap/docs/managing-access|Cloud Run}
3449
- * that natively support IAM authorization.
3450
- *
3451
- * We recommend reading the `serviceAccountJson` from environment variables (so it
3452
- * is not checked in to source control) using the `$env(ENV_VAR)` syntax.
3453
- *
3454
- * For information on how Google's service based auth works see {@link https://cloud.google.com/functions/docs/securing/authenticating|Authenticating for invocation}
3455
- *
3456
- * @title Upstream GCP Service Auth
3457
- * @public
3458
- * @param request - The ZuploRequest
3459
- * @param context - The ZuploContext
3460
- * @param options - The policy options set in policies.json
3461
- * @param policyName - The name of the policy as set in policies.json
3462
- * @returns A Request or a Response
3463
- */
3464
- export declare const UpstreamGcpServiceAuthInboundPolicy: InboundPolicyHandler<UpstreamGcpServiceAuthInboundPolicyOptions>;
3465
-
3466
- /**
3467
- * The options for this policy.
3468
- */
3469
- export declare interface UpstreamGcpServiceAuthInboundPolicyOptions {
3470
- /**
3471
- * The audience for the service to be called. This is typically the URL of your service endpoint like 'https://my-service-a2ev-uc.a.run.app'. If calling a Google API, leave this empty.
3472
- */
3473
- audience?: string;
3474
- /**
3475
- * The scopes to grant the access token. See {@link https://developers.google.com/identity/protocols/oauth2/scopes|documentation} for details. This is only set with calling a Google API. If calling a service like Cloud Run, etc. leave this empty.
3476
- */
3477
- scopes?: string[];
3478
- /**
3479
- * The Google Service Account key in JSON format. Note you can load this from environment variables using the `$env(ENV_VAR)` syntax.
3480
- * @see {@link https://developers.google.com/workspace/guides/create-credentials|Create access credentials}.
3481
- */
3482
- serviceAccountJson: string;
3483
- /**
3484
- * The number of times to retry fetching the token in the event of a failure.
3485
- */
3486
- tokenRetries?: number;
3487
- /**
3488
- * The number of seconds less than the token expiration to cache the token.
3489
- */
3490
- expirationOffsetSeconds?: number;
3491
- /**
3492
- * This is an advanced option that should only be used if you do not want to persist information in ZoneCache.
3493
- */
3494
- useMemoryCacheOnly?: boolean;
3495
- }
3496
-
3497
- /* Excluded from this release type: urlForwardHandler */
3498
-
3499
- /* Excluded from this release type: urlRewriteHandler */
3500
-
3501
- declare type UserDataDefault = any;
3502
-
3503
- /* Excluded from this release type: ValidateFunction */
3504
-
3505
- /**
3506
- * Validates the body of an incoming request based on a JSON schema.
3507
- *
3508
- * @remarks
3509
- * The Validate JSON Schema policy is used to validate the body of incoming
3510
- * requests. It works using JSON Schemas defined in the `Schemas` folder of your
3511
- * project.
3512
- *
3513
- * When configured, any requests that do not have a body conforming to your JSON
3514
- * schema will be rejected with a `400: Bad Request` response containing a detailed
3515
- * error message (in JSON) explaining why the body was not accepted.
3516
- *
3517
- * @title JSON Body Validation
3518
- * @public
3519
- * @deprecated Use the new {@link https://zuplo.com/docs/policies/request-validation-inbound|Request Validation Policy}.
3520
- * The new policy validates JSON bodies like this policy, but also supports validation of parameters, query strings, etc.
3521
- * @param request - The ZuploRequest
3522
- * @param context - The ZuploContext
3523
- * @param options - The policy options set in policies.json
3524
- * @param policyName - The name of the policy as set in policies.json
3525
- * @returns A Request or a Response
3526
- */
3527
- export declare const ValidateJsonSchemaInbound: InboundPolicyHandler<ValidateJsonSchemaInboundInternalOptions>;
3528
-
3529
- /* Excluded from this release type: ValidateJsonSchemaInboundInternalOptions */
3530
-
3531
- /**
3532
- * The options for this policy.
3533
- */
3534
- export declare interface ValidateJsonSchemaInboundOptions {
3535
- /**
3536
- * The JSON schema to validate against.
3537
- */
3538
- validator: string;
3539
- }
3540
-
3541
- /**
3542
- * The action to perform when validation fails.
3543
- */
3544
- declare type ValidationOptions = "none" | "log-only" | "reject-and-log" | "reject-only";
3545
-
3546
- /**
3547
- * The action to perform when validation fails.
3548
- */
3549
- declare type ValidationOptions1 = "none" | "log-only" | "reject-and-log" | "reject-only";
3550
-
3551
- /**
3552
- * The action to perform when validation fails.
3553
- */
3554
- declare type ValidationOptions2 = "none" | "log-only" | "reject-and-log" | "reject-only";
3555
-
3556
- /**
3557
- * The action to perform when validation fails.
3558
- */
3559
- declare type ValidationOptions3 = "none" | "log-only" | "reject-and-log" | "reject-only";
3560
-
3561
- export declare interface VersionData {
3562
- name: string;
3563
- pathPrefix: string;
3564
- info?: OpenAPIV3_1.InfoObject;
3565
- /**
3566
- * The project relative path to the OpenAPI spec.
3567
- */
3568
- openApiFile?: string;
3569
- tags?: Omit<OpenAPIV3_1.TagObject, "externalDocs">[];
3570
- /**
3571
- * If false, OpenAPI documentation will not be generated for this version. If openApiFile is set this setting is ignored.
3572
- */
3573
- excludeFromOpenApi?: boolean;
3574
- /**
3575
- * If true, schema validation found in the OpenAPI spec will be enforced on requests/responses.
3576
- */
3577
- enforceOpenApi?: boolean;
3578
- }
3579
-
3580
- declare interface VMWareLogInsightLoggingOptions {
3581
- url: string;
3582
- /**
3583
- * An array of string tuples to replace within the text field of a log entry.
3584
- * @example
3585
- * ```
3586
- * [
3587
- * ["'", ""],
3588
- * ['"', ""],
3589
- * ["\\n", ""],
3590
- * ["\\", ""],
3591
- * ["*", ""],
3592
- * ["&", ""],
3593
- * [":", "="],
3594
- * ]
3595
- * ```
3596
- */
3597
- textReplacements?: [string, string][];
3598
- /**
3599
- * The unique agent identifier of the logger.
3600
- */
3601
- agentId?: string;
3602
- fields?: Record<string, string | number | boolean>;
3603
- onMessageSending?: (event: LogInsightLogEntry) => LogInsightLogEntry;
3604
- }
3605
-
3606
- export declare class VMWareLogInsightLoggingPlugin extends LogPlugin {
3607
- private options;
3608
- constructor(options: VMWareLogInsightLoggingOptions);
3609
- /* Excluded from this release type: getTransport */
3610
- }
3611
-
3612
- /**
3613
- * @public
3614
- */
3615
- declare interface WaitUntilFunc {
3616
- (promise: Promise<any>): void;
3617
- }
3618
-
3619
- /* Excluded from this release type: webSocketHandler */
3620
-
3621
- /* Excluded from this release type: webSocketPipelineHandler */
3622
-
3623
- /**
3624
- * The request to the PDP
3625
- */
3626
- declare interface XacmlRequest {
3627
- Request: {
3628
- ReturnPolicyIdList?: boolean;
3629
- CombinedDecision?: boolean;
3630
- XPathVersion?: string;
3631
- Category?: Omit<Category, "CategoryId"> & {
3632
- CategoryId: string;
3633
- }[];
3634
- Resource?: Category[];
3635
- Action?: Category[];
3636
- Environment?: Category[];
3637
- AccessSubject?: Category[];
3638
- RecipientSubject?: Category[];
3639
- IntermediarySubject?: Category[];
3640
- RequestingMachine?: Category[];
3641
- CodeBase?: Category[];
3642
- MultiRequests?: MultiRequests;
3643
- };
3644
- }
3645
-
3646
- /**
3647
- * Parses XML and converts it to JSON. This policy is useful for converting
3648
- * legacy XML or SOAP APIs into modern REST APIs. It can be useful to add a
3649
- * custom outbound policy that runs after this policy to further transform the
3650
- * raw converted content into something more user friendly.
3651
- *
3652
- * @title XML to JSON Outbound
3653
- * @public
3654
- * @param request - The ZuploRequest
3655
- * @param context - The ZuploContext
3656
- * @param options - The policy options set in policies.json
3657
- * @param policyName - The name of the policy as set in policies.json
3658
- * @returns A Request or a Response
3659
- */
3660
- export declare class XmlToJsonOutboundPolicy extends OutboundPolicy<XmlToJsonPolicyOptions> {
3661
- private parser;
3662
- private parseOnStatusCodes;
3663
- constructor(options: XmlToJsonPolicyOptions, policyName: string);
3664
- handler(response: Response, request: ZuploRequest, context: ZuploContext): Promise<Response>;
3665
- }
3666
-
3667
- /**
3668
- * The options for this policy.
3669
- */
3670
- export declare interface XmlToJsonPolicyOptions {
3671
- /**
3672
- * Remove namespace string from tag and attribute names.
3673
- */
3674
- removeNSPrefix?: boolean;
3675
- /**
3676
- * Ignore processing instruction tags. i.e. `<?elementnames <fred>, <bert>, <harry> ?>`.
3677
- */
3678
- ignoreProcessingInstructions?: boolean;
3679
- /**
3680
- * Ignore declarations. i.e. `<?xml version="1.0"?>`.
3681
- */
3682
- ignoreDeclarations?: boolean;
3683
- /**
3684
- * Ignore tag attributes.
3685
- */
3686
- ignoreAttributes?: boolean;
3687
- /**
3688
- * At particular point, if you don't want to parse a tag and it's nested tags then you can set their path in stopNodes. You can also set tags which should not be processed irrespective of their path using * as the wildcard.
3689
- */
3690
- stopNodes?: string[];
3691
- /**
3692
- * The prefix of attribute names in the resulting JS object.
3693
- */
3694
- attributeNamePrefix?: string;
3695
- /**
3696
- * Text value of a tag is parsed to #text property by default.
3697
- */
3698
- textNodeName?: string;
3699
- /**
3700
- * Remove surrounding whitespace from tag or attribute value.
3701
- */
3702
- trimValues?: boolean;
3703
- /**
3704
- * A list of status codes and ranges "200-299, 304" that should the XML parser should run on. If not set, the parser will run on all status codes.
3705
- */
3706
- parseOnStatusCodes?: string | number[];
3707
- }
3708
-
3709
- /**
3710
- * This is a simple wrapper around the data-center HTTP cache
3711
- * to enable simple objects to be stored by a string key. This is
3712
- * useful to us and customers and provides a very high-performance
3713
- * read-through cache that stores data in the same data-center. It is
3714
- * not replicated.
3715
- */
3716
- export declare class ZoneCache<T = any> {
3717
- #private;
3718
- constructor(name: string, context: ZuploContext);
3719
- /* Excluded from this release type: __constructor */
3720
- get(key: string): Promise<T | undefined>;
3721
- put(key: string, data: T, ttlSeconds: number): Promise<void>;
3722
- delete(key: string): Promise<void>;
3723
- deleteFallback(key: string): Promise<void>;
3724
- logDebug(...messages: unknown[]): void;
3725
- }
3726
-
3727
- /* Excluded from this release type: ZuploContext */
3728
-
3729
- /* Excluded from this release type: ZuploEventContext */
3730
-
3731
- /**
3732
- * ZuploRequest includes various parsed objects from the
3733
- * incoming Request. This object inherits from the web
3734
- * standard {@link https://developer.mozilla.org/en-US/docs/Web/API/Request | Request}.
3735
- * @public
3736
- */
3737
- export declare class ZuploRequest<TOptions extends RequestGeneric = RequestGeneric> extends Request {
3738
- #private;
3739
- constructor(input: string | Request, init?: ZuploRequestInit<TOptions>);
3740
- /**
3741
- * A dictionary of query-string values
3742
- *
3743
- * @example
3744
- * The url `https://example.com?foo=bar` would return
3745
- * the following query object:
3746
- *
3747
- * ```
3748
- * const foo = request.query.foo;
3749
- * ```
3750
- *
3751
- * @readonly
3752
- */
3753
- get query(): Readonly<ResolveRequestQuery<TOptions["Query"]>>;
3754
- /**
3755
- * If you use tokens in your route’s URL, they are
3756
- * automatically parsed into properties on the params
3757
- * property of your request.
3758
- *
3759
- * @example
3760
- * The route `/products/:productId/vendors/:vendorId`
3761
- * would include two params:
3762
- *
3763
- * ```
3764
- * const productId = request.params.productId;
3765
- * const vendorId = request.params.vendorId;
3766
- * ```
3767
- * @readonly
3768
- */
3769
- get params(): Readonly<ResolveRequestParams<TOptions["Params"]>>;
3770
- /**
3771
- * An optional object identifying a ‘user’.
3772
- *
3773
- * @remarks
3774
- * If undefined this typically means the request is
3775
- * anonymous. If present, the user object will have
3776
- * a sub property that is a unique identifier for
3777
- * that user. There is also an optional data property
3778
- * that is of any type that typically contains other
3779
- * information about the user. When using JWT tokens
3780
- * you’ll usually find all the claims here.
3781
- *
3782
- * @readonly
3783
- */
3784
- user?: RequestUser<ResolveUserData<TOptions["UserData"]>>;
3785
- }
3786
-
3787
- /**
3788
- * The initialization values of a request
3789
- * @public
3790
- */
3791
- export declare interface ZuploRequestInit<TOptions extends RequestInitGeneric = RequestInitGeneric> extends RequestInit {
3792
- params?: ResolveRequestParams<TOptions["Params"]>;
3793
- user?: ResolveUserData<TOptions["UserData"]>;
3794
- }
3795
-
3796
- export { }