@redocly/config 0.20.2 → 0.21.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.
@@ -29,7 +29,7 @@ export declare const reuniteConfigSchema: {
29
29
  };
30
30
  readonly agent: {
31
31
  readonly type: "string";
32
- readonly enum: readonly ["spot"];
32
+ readonly enum: readonly ["respect"];
33
33
  };
34
34
  readonly trigger: {
35
35
  readonly type: "object";
@@ -62,6 +62,28 @@ export declare const reuniteConfigSchema: {
62
62
  };
63
63
  };
64
64
  };
65
+ readonly severity: {
66
+ readonly type: "object";
67
+ readonly additionalProperties: false;
68
+ readonly properties: {
69
+ readonly schemaCheck: {
70
+ readonly type: "string";
71
+ readonly enum: readonly ["error", "warn", "off"];
72
+ };
73
+ readonly statusCodeCheck: {
74
+ readonly type: "string";
75
+ readonly enum: readonly ["error", "warn", "off"];
76
+ };
77
+ readonly contentTypeCheck: {
78
+ readonly type: "string";
79
+ readonly enum: readonly ["error", "warn", "off"];
80
+ };
81
+ readonly successCriteriaCheck: {
82
+ readonly type: "string";
83
+ readonly enum: readonly ["error", "warn", "off"];
84
+ };
85
+ };
86
+ };
65
87
  };
66
88
  readonly required: readonly ["path", "trigger", "agent"];
67
89
  readonly additionalProperties: false;
@@ -15,6 +15,20 @@ const jobServersSchema = {
15
15
  },
16
16
  },
17
17
  };
18
+ const severitySchema = {
19
+ type: 'string',
20
+ enum: ['error', 'warn', 'off'],
21
+ };
22
+ const jobSeveritySchema = {
23
+ type: 'object',
24
+ additionalProperties: false,
25
+ properties: {
26
+ schemaCheck: severitySchema,
27
+ statusCodeCheck: severitySchema,
28
+ contentTypeCheck: severitySchema,
29
+ successCriteriaCheck: severitySchema,
30
+ },
31
+ };
18
32
  const jobTriggerSchema = {
19
33
  type: 'object',
20
34
  additionalProperties: false,
@@ -52,11 +66,12 @@ exports.reuniteConfigSchema = {
52
66
  },
53
67
  agent: {
54
68
  type: 'string',
55
- enum: ['spot'],
69
+ enum: ['respect'],
56
70
  },
57
71
  trigger: jobTriggerSchema,
58
72
  inputs: jobInputsSchema,
59
73
  servers: jobServersSchema,
74
+ severity: jobSeveritySchema,
60
75
  },
61
76
  required: ['path', 'trigger', 'agent'],
62
77
  additionalProperties: false,
@@ -5039,6 +5039,18 @@ export declare const seoConfigSchema: {
5039
5039
  };
5040
5040
  readonly additionalProperties: false;
5041
5041
  };
5042
+ export declare const apiFunctionsConfigSchema: {
5043
+ readonly type: "object";
5044
+ readonly properties: {
5045
+ readonly folders: {
5046
+ readonly type: "array";
5047
+ readonly items: {
5048
+ readonly type: "string";
5049
+ };
5050
+ };
5051
+ };
5052
+ readonly additionalProperties: false;
5053
+ };
5042
5054
  export declare const rbacScopeItemsSchema: {
5043
5055
  readonly type: "object";
5044
5056
  readonly additionalProperties: {
@@ -5737,6 +5749,18 @@ export declare const redoclyConfigSchema: {
5737
5749
  };
5738
5750
  };
5739
5751
  };
5752
+ readonly apiFunctions: {
5753
+ readonly type: "object";
5754
+ readonly properties: {
5755
+ readonly folders: {
5756
+ readonly type: "array";
5757
+ readonly items: {
5758
+ readonly type: "string";
5759
+ };
5760
+ };
5761
+ };
5762
+ readonly additionalProperties: false;
5763
+ };
5740
5764
  readonly requiresLogin: {
5741
5765
  readonly type: "boolean";
5742
5766
  };
@@ -14771,7 +14795,7 @@ export declare const redoclyConfigSchema: {
14771
14795
  };
14772
14796
  readonly agent: {
14773
14797
  readonly type: "string";
14774
- readonly enum: readonly ["spot"];
14798
+ readonly enum: readonly ["respect"];
14775
14799
  };
14776
14800
  readonly trigger: {
14777
14801
  readonly type: "object";
@@ -14804,6 +14828,28 @@ export declare const redoclyConfigSchema: {
14804
14828
  };
14805
14829
  };
14806
14830
  };
14831
+ readonly severity: {
14832
+ readonly type: "object";
14833
+ readonly additionalProperties: false;
14834
+ readonly properties: {
14835
+ readonly schemaCheck: {
14836
+ readonly type: "string";
14837
+ readonly enum: readonly ["error", "warn", "off"];
14838
+ };
14839
+ readonly statusCodeCheck: {
14840
+ readonly type: "string";
14841
+ readonly enum: readonly ["error", "warn", "off"];
14842
+ };
14843
+ readonly contentTypeCheck: {
14844
+ readonly type: "string";
14845
+ readonly enum: readonly ["error", "warn", "off"];
14846
+ };
14847
+ readonly successCriteriaCheck: {
14848
+ readonly type: "string";
14849
+ readonly enum: readonly ["error", "warn", "off"];
14850
+ };
14851
+ };
14852
+ };
14807
14853
  };
14808
14854
  readonly required: readonly ["path", "trigger", "agent"];
14809
14855
  readonly additionalProperties: false;
@@ -22402,6 +22448,18 @@ export declare const rootRedoclyConfigSchema: {
22402
22448
  };
22403
22449
  type: "object";
22404
22450
  };
22451
+ apiFunctions: {
22452
+ properties: {
22453
+ folders: {
22454
+ items: {
22455
+ type: "string";
22456
+ };
22457
+ type: "array";
22458
+ };
22459
+ };
22460
+ additionalProperties: false;
22461
+ type: "object";
22462
+ };
22405
22463
  requiresLogin: {
22406
22464
  type: "boolean";
22407
22465
  };
@@ -26438,7 +26496,7 @@ export declare const rootRedoclyConfigSchema: {
26438
26496
  required: "event"[];
26439
26497
  };
26440
26498
  agent: {
26441
- enum: "spot"[];
26499
+ enum: "respect"[];
26442
26500
  type: "string";
26443
26501
  };
26444
26502
  inputs: {
@@ -26457,6 +26515,28 @@ export declare const rootRedoclyConfigSchema: {
26457
26515
  additionalProperties: false;
26458
26516
  type: "object";
26459
26517
  };
26518
+ severity: {
26519
+ properties: {
26520
+ schemaCheck: {
26521
+ enum: ("off" | "error" | "warn")[];
26522
+ type: "string";
26523
+ };
26524
+ statusCodeCheck: {
26525
+ enum: ("off" | "error" | "warn")[];
26526
+ type: "string";
26527
+ };
26528
+ contentTypeCheck: {
26529
+ enum: ("off" | "error" | "warn")[];
26530
+ type: "string";
26531
+ };
26532
+ successCriteriaCheck: {
26533
+ enum: ("off" | "error" | "warn")[];
26534
+ type: "string";
26535
+ };
26536
+ };
26537
+ additionalProperties: false;
26538
+ type: "object";
26539
+ };
26460
26540
  };
26461
26541
  additionalProperties: false;
26462
26542
  type: "object";
@@ -29638,6 +29718,18 @@ export declare const rootRedoclyConfigSchema: {
29638
29718
  };
29639
29719
  };
29640
29720
  };
29721
+ readonly apiFunctions: {
29722
+ readonly type: "object";
29723
+ readonly properties: {
29724
+ readonly folders: {
29725
+ readonly type: "array";
29726
+ readonly items: {
29727
+ readonly type: "string";
29728
+ };
29729
+ };
29730
+ };
29731
+ readonly additionalProperties: false;
29732
+ };
29641
29733
  readonly requiresLogin: {
29642
29734
  readonly type: "boolean";
29643
29735
  };
@@ -38672,7 +38764,7 @@ export declare const rootRedoclyConfigSchema: {
38672
38764
  };
38673
38765
  readonly agent: {
38674
38766
  readonly type: "string";
38675
- readonly enum: readonly ["spot"];
38767
+ readonly enum: readonly ["respect"];
38676
38768
  };
38677
38769
  readonly trigger: {
38678
38770
  readonly type: "object";
@@ -38705,6 +38797,28 @@ export declare const rootRedoclyConfigSchema: {
38705
38797
  };
38706
38798
  };
38707
38799
  };
38800
+ readonly severity: {
38801
+ readonly type: "object";
38802
+ readonly additionalProperties: false;
38803
+ readonly properties: {
38804
+ readonly schemaCheck: {
38805
+ readonly type: "string";
38806
+ readonly enum: readonly ["error", "warn", "off"];
38807
+ };
38808
+ readonly statusCodeCheck: {
38809
+ readonly type: "string";
38810
+ readonly enum: readonly ["error", "warn", "off"];
38811
+ };
38812
+ readonly contentTypeCheck: {
38813
+ readonly type: "string";
38814
+ readonly enum: readonly ["error", "warn", "off"];
38815
+ };
38816
+ readonly successCriteriaCheck: {
38817
+ readonly type: "string";
38818
+ readonly enum: readonly ["error", "warn", "off"];
38819
+ };
38820
+ };
38821
+ };
38708
38822
  };
38709
38823
  readonly required: readonly ["path", "trigger", "agent"];
38710
38824
  readonly additionalProperties: false;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rootRedoclyConfigSchema = exports.redoclyConfigSchema = exports.l10nConfigSchema = exports.devOnboardingAdapterConfigSchema = exports.apigeeEdgeAdapterConfigSchema = exports.apigeeXAdapterConfigSchema = exports.apigeeAdapterAuthServiceAccountSchema = exports.apigeeAdapterAuthOauth2Schema = exports.graviteeAdapterConfigSchema = exports.graviteeAdapterAuthIdpSchema = exports.graviteeAdapterAuthStaticSchema = exports.rbacConfigSchema = exports.rbacScopeItemsSchema = exports.seoConfigSchema = exports.apiConfigSchema = exports.redirectsConfigSchema = exports.redirectConfigSchema = exports.ssoConfigSchema = exports.ssoDirectConfigSchema = exports.authProviderConfigSchema = exports.saml2ProviderConfigSchema = exports.oidcProviderConfigSchema = exports.oidcIssuerMetadataSchema = void 0;
3
+ exports.rootRedoclyConfigSchema = exports.redoclyConfigSchema = exports.l10nConfigSchema = exports.devOnboardingAdapterConfigSchema = exports.apigeeEdgeAdapterConfigSchema = exports.apigeeXAdapterConfigSchema = exports.apigeeAdapterAuthServiceAccountSchema = exports.apigeeAdapterAuthOauth2Schema = exports.graviteeAdapterConfigSchema = exports.graviteeAdapterAuthIdpSchema = exports.graviteeAdapterAuthStaticSchema = exports.rbacConfigSchema = exports.rbacScopeItemsSchema = exports.apiFunctionsConfigSchema = exports.seoConfigSchema = exports.apiConfigSchema = exports.redirectsConfigSchema = exports.redirectConfigSchema = exports.ssoConfigSchema = exports.ssoDirectConfigSchema = exports.authProviderConfigSchema = exports.saml2ProviderConfigSchema = exports.oidcProviderConfigSchema = exports.oidcIssuerMetadataSchema = void 0;
4
4
  const constants_1 = require("./constants");
5
5
  const default_theme_config_schema_1 = require("./default-theme-config-schema");
6
6
  const feedback_config_schema_1 = require("./feedback-config-schema");
@@ -166,6 +166,13 @@ exports.seoConfigSchema = {
166
166
  },
167
167
  additionalProperties: false,
168
168
  };
169
+ exports.apiFunctionsConfigSchema = {
170
+ type: 'object',
171
+ properties: {
172
+ folders: { type: 'array', items: { type: 'string' } },
173
+ },
174
+ additionalProperties: false,
175
+ };
169
176
  exports.rbacScopeItemsSchema = {
170
177
  type: 'object',
171
178
  additionalProperties: { type: 'string' },
@@ -326,6 +333,7 @@ exports.redoclyConfigSchema = {
326
333
  redirects: exports.redirectsConfigSchema,
327
334
  seo: exports.seoConfigSchema,
328
335
  rbac: exports.rbacConfigSchema,
336
+ apiFunctions: exports.apiFunctionsConfigSchema,
329
337
  requiresLogin: { type: 'boolean' },
330
338
  responseHeaders: {
331
339
  type: 'object',
@@ -0,0 +1,41 @@
1
+ import type { RedoclyConfig } from './config-types';
2
+ export type ApiFunctionsRequest = {
3
+ raw: Request;
4
+ headers: Record<string, any>;
5
+ params: Record<string, any>;
6
+ query: Record<string, any>;
7
+ cookies: Record<string, any>;
8
+ body: ReadableStream<Uint8Array> | null;
9
+ };
10
+ export type ApiFunctionsResponse = {
11
+ raw: Response;
12
+ status: (code: number) => ApiFunctionsResponse;
13
+ json: (data: object) => Response;
14
+ text: (data: string, code?: number) => Response;
15
+ send: (data: string | Buffer | object) => Response;
16
+ redirect: (url: string, code?: number) => Response;
17
+ cookie: (name: string, value: string, options?: CookieOptions) => ApiFunctionsResponse;
18
+ clearCookie: (name: string) => ApiFunctionsResponse;
19
+ };
20
+ export type ApiFunctionsContext = {
21
+ user: {
22
+ teams: string[];
23
+ claims: Record<string, any>;
24
+ email: string | undefined;
25
+ idpAccessToken: string | undefined;
26
+ idpId: string | undefined;
27
+ };
28
+ config: RedoclyConfig;
29
+ };
30
+ export interface CookieOptions {
31
+ domain?: string;
32
+ expires?: Date;
33
+ httpOnly?: boolean;
34
+ maxAge?: number;
35
+ path?: string;
36
+ secure?: boolean;
37
+ signed?: boolean;
38
+ sameSite?: 'Strict' | 'Lax' | 'None';
39
+ }
40
+ export type ServerPropsContext = ApiFunctionsContext;
41
+ export type ServerPropsRequest = ApiFunctionsRequest;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=api-functions-types.js.map
@@ -1,2 +1,3 @@
1
+ export * from './api-functions-types';
1
2
  export * from './config-types';
2
3
  export * from './portal-shared-types';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api-functions-types"), exports);
17
18
  __exportStar(require("./config-types"), exports);
18
19
  __exportStar(require("./portal-shared-types"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -29,7 +29,7 @@ export declare const reuniteConfigSchema: {
29
29
  };
30
30
  readonly agent: {
31
31
  readonly type: "string";
32
- readonly enum: readonly ["spot"];
32
+ readonly enum: readonly ["respect"];
33
33
  };
34
34
  readonly trigger: {
35
35
  readonly type: "object";
@@ -62,6 +62,28 @@ export declare const reuniteConfigSchema: {
62
62
  };
63
63
  };
64
64
  };
65
+ readonly severity: {
66
+ readonly type: "object";
67
+ readonly additionalProperties: false;
68
+ readonly properties: {
69
+ readonly schemaCheck: {
70
+ readonly type: "string";
71
+ readonly enum: readonly ["error", "warn", "off"];
72
+ };
73
+ readonly statusCodeCheck: {
74
+ readonly type: "string";
75
+ readonly enum: readonly ["error", "warn", "off"];
76
+ };
77
+ readonly contentTypeCheck: {
78
+ readonly type: "string";
79
+ readonly enum: readonly ["error", "warn", "off"];
80
+ };
81
+ readonly successCriteriaCheck: {
82
+ readonly type: "string";
83
+ readonly enum: readonly ["error", "warn", "off"];
84
+ };
85
+ };
86
+ };
65
87
  };
66
88
  readonly required: readonly ["path", "trigger", "agent"];
67
89
  readonly additionalProperties: false;
@@ -12,6 +12,20 @@ const jobServersSchema = {
12
12
  },
13
13
  },
14
14
  };
15
+ const severitySchema = {
16
+ type: 'string',
17
+ enum: ['error', 'warn', 'off'],
18
+ };
19
+ const jobSeveritySchema = {
20
+ type: 'object',
21
+ additionalProperties: false,
22
+ properties: {
23
+ schemaCheck: severitySchema,
24
+ statusCodeCheck: severitySchema,
25
+ contentTypeCheck: severitySchema,
26
+ successCriteriaCheck: severitySchema,
27
+ },
28
+ };
15
29
  const jobTriggerSchema = {
16
30
  type: 'object',
17
31
  additionalProperties: false,
@@ -49,11 +63,12 @@ export const reuniteConfigSchema = {
49
63
  },
50
64
  agent: {
51
65
  type: 'string',
52
- enum: ['spot'],
66
+ enum: ['respect'],
53
67
  },
54
68
  trigger: jobTriggerSchema,
55
69
  inputs: jobInputsSchema,
56
70
  servers: jobServersSchema,
71
+ severity: jobSeveritySchema,
57
72
  },
58
73
  required: ['path', 'trigger', 'agent'],
59
74
  additionalProperties: false,