@redocly/config 0.20.3 → 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";
@@ -66,7 +66,7 @@ exports.reuniteConfigSchema = {
66
66
  },
67
67
  agent: {
68
68
  type: 'string',
69
- enum: ['spot'],
69
+ enum: ['respect'],
70
70
  },
71
71
  trigger: jobTriggerSchema,
72
72
  inputs: jobInputsSchema,
@@ -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";
@@ -22424,6 +22448,18 @@ export declare const rootRedoclyConfigSchema: {
22424
22448
  };
22425
22449
  type: "object";
22426
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
+ };
22427
22463
  requiresLogin: {
22428
22464
  type: "boolean";
22429
22465
  };
@@ -26460,7 +26496,7 @@ export declare const rootRedoclyConfigSchema: {
26460
26496
  required: "event"[];
26461
26497
  };
26462
26498
  agent: {
26463
- enum: "spot"[];
26499
+ enum: "respect"[];
26464
26500
  type: "string";
26465
26501
  };
26466
26502
  inputs: {
@@ -29682,6 +29718,18 @@ export declare const rootRedoclyConfigSchema: {
29682
29718
  };
29683
29719
  };
29684
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
+ };
29685
29733
  readonly requiresLogin: {
29686
29734
  readonly type: "boolean";
29687
29735
  };
@@ -38716,7 +38764,7 @@ export declare const rootRedoclyConfigSchema: {
38716
38764
  };
38717
38765
  readonly agent: {
38718
38766
  readonly type: "string";
38719
- readonly enum: readonly ["spot"];
38767
+ readonly enum: readonly ["respect"];
38720
38768
  };
38721
38769
  readonly trigger: {
38722
38770
  readonly type: "object";
@@ -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";
@@ -63,7 +63,7 @@ export const reuniteConfigSchema = {
63
63
  },
64
64
  agent: {
65
65
  type: 'string',
66
- enum: ['spot'],
66
+ enum: ['respect'],
67
67
  },
68
68
  trigger: jobTriggerSchema,
69
69
  inputs: jobInputsSchema,
@@ -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";
@@ -22424,6 +22448,18 @@ export declare const rootRedoclyConfigSchema: {
22424
22448
  };
22425
22449
  type: "object";
22426
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
+ };
22427
22463
  requiresLogin: {
22428
22464
  type: "boolean";
22429
22465
  };
@@ -26460,7 +26496,7 @@ export declare const rootRedoclyConfigSchema: {
26460
26496
  required: "event"[];
26461
26497
  };
26462
26498
  agent: {
26463
- enum: "spot"[];
26499
+ enum: "respect"[];
26464
26500
  type: "string";
26465
26501
  };
26466
26502
  inputs: {
@@ -29682,6 +29718,18 @@ export declare const rootRedoclyConfigSchema: {
29682
29718
  };
29683
29719
  };
29684
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
+ };
29685
29733
  readonly requiresLogin: {
29686
29734
  readonly type: "boolean";
29687
29735
  };
@@ -38716,7 +38764,7 @@ export declare const rootRedoclyConfigSchema: {
38716
38764
  };
38717
38765
  readonly agent: {
38718
38766
  readonly type: "string";
38719
- readonly enum: readonly ["spot"];
38767
+ readonly enum: readonly ["respect"];
38720
38768
  };
38721
38769
  readonly trigger: {
38722
38770
  readonly type: "object";
@@ -163,6 +163,13 @@ export const seoConfigSchema = {
163
163
  },
164
164
  additionalProperties: false,
165
165
  };
166
+ export const apiFunctionsConfigSchema = {
167
+ type: 'object',
168
+ properties: {
169
+ folders: { type: 'array', items: { type: 'string' } },
170
+ },
171
+ additionalProperties: false,
172
+ };
166
173
  export const rbacScopeItemsSchema = {
167
174
  type: 'object',
168
175
  additionalProperties: { type: 'string' },
@@ -323,6 +330,7 @@ export const redoclyConfigSchema = {
323
330
  redirects: redirectsConfigSchema,
324
331
  seo: seoConfigSchema,
325
332
  rbac: rbacConfigSchema,
333
+ apiFunctions: apiFunctionsConfigSchema,
326
334
  requiresLogin: { type: 'boolean' },
327
335
  responseHeaders: {
328
336
  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,2 @@
1
+ export {};
2
+ //# 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';
@@ -1,3 +1,4 @@
1
+ export * from './api-functions-types';
1
2
  export * from './config-types';
2
3
  export * from './portal-shared-types';
3
4
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@redocly/config",
3
- "version": "0.20.3",
3
+ "version": "0.21.0",
4
4
  "license": "MIT",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "devDependencies": {
9
9
  "@markdoc/markdoc": "0.4.0",
10
+ "@types/node": "^22.10.7",
10
11
  "@types/react": "18.3.9",
11
- "react-router-dom": "6.21.1",
12
12
  "json-schema-to-ts": "2.7.2",
13
+ "react-router-dom": "6.21.1",
13
14
  "rimraf": "5.0.7",
14
15
  "typescript": "5.6.2"
15
16
  },