@redocly/config 0.41.0 → 0.41.2

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.
@@ -83,6 +83,9 @@ export const ssoConfigSchema = {
83
83
  },
84
84
  ],
85
85
  };
86
+ const requiresLoginSchema = { type: 'boolean' };
87
+ const logoutReturnUrlSchema = { type: 'string', pattern: '^https?://.*' };
88
+ const residencySchema = { type: 'string', pattern: '^https?://.*' };
86
89
  export const redirectConfigSchema = {
87
90
  type: 'object',
88
91
  properties: {
@@ -425,6 +428,17 @@ const mcpConfigSchema = {
425
428
  },
426
429
  },
427
430
  };
431
+ export const accessConfigSchema = {
432
+ type: 'object',
433
+ properties: {
434
+ requiresLogin: requiresLoginSchema,
435
+ logoutReturnUrl: logoutReturnUrlSchema,
436
+ residency: residencySchema,
437
+ sso: ssoConfigSchema,
438
+ rbac: rbacConfigSchema,
439
+ },
440
+ additionalProperties: false,
441
+ };
428
442
  export const redoclyConfigSchema = {
429
443
  type: 'object',
430
444
  properties: Object.assign(Object.assign(Object.assign(Object.assign({
@@ -434,7 +448,7 @@ export const redoclyConfigSchema = {
434
448
  imports: {
435
449
  type: 'array',
436
450
  items: { type: 'string' },
437
- }, licenseKey: { type: 'string' }, redirects: redirectsConfigSchema, seo: seoConfigSchema, rbac: rbacConfigSchema, apiFunctions: apiFunctionsConfigSchema, requiresLogin: { type: 'boolean' }, responseHeaders: {
451
+ }, licenseKey: { type: 'string' }, redirects: redirectsConfigSchema, seo: seoConfigSchema, rbac: rbacConfigSchema, apiFunctions: apiFunctionsConfigSchema, requiresLogin: requiresLoginSchema, responseHeaders: {
438
452
  type: 'object',
439
453
  additionalProperties: {
440
454
  type: 'array',
@@ -452,7 +466,7 @@ export const redoclyConfigSchema = {
452
466
  }, apis: {
453
467
  type: 'object',
454
468
  additionalProperties: apiConfigSchema,
455
- }, extends: { type: 'array', items: { type: 'string' } } }, ruleSchemas), decoratorsSchemas), preprocessorSchemas), { ssoDirect: ssoDirectConfigSchema, sso: ssoConfigSchema, residency: { type: 'string', pattern: '^https?://.*' }, developerOnboarding: devOnboardingConfigSchema, removeAttribution: { type: 'boolean' }, i18n: l10nConfigSchema, l10n: l10nConfigSchema, metadata: metadataConfigSchema, metadataGlobs: metadataGlobsConfigSchema, ignore: { type: 'array', items: { type: 'string' } },
469
+ }, extends: { type: 'array', items: { type: 'string' } } }, ruleSchemas), decoratorsSchemas), preprocessorSchemas), { ssoDirect: ssoDirectConfigSchema, sso: ssoConfigSchema, residency: residencySchema, logoutReturnUrl: logoutReturnUrlSchema, access: accessConfigSchema, developerOnboarding: devOnboardingConfigSchema, removeAttribution: { type: 'boolean' }, i18n: l10nConfigSchema, l10n: l10nConfigSchema, metadata: metadataConfigSchema, metadataGlobs: metadataGlobsConfigSchema, ignore: { type: 'array', items: { type: 'string' } },
456
470
  /**
457
471
  * @deprecated properties moved to the root of the config
458
472
  */
@@ -41,12 +41,11 @@ export type ApiFunctionsContext = {
41
41
  };
42
42
  } & ApiFunctionsContextMethods;
43
43
  export type KvService = {
44
- get: <T extends KvValue = KvValue>(key: KvKey) => Promise<KvReadSchema<T> | null>;
45
- getMany: <T extends KvValue = KvValue>(keys: KvKey[]) => Promise<(KvReadSchema<T> | null)[]>;
44
+ get: <T extends KvValue = KvValue>(key: KvKey) => Promise<T | null>;
45
+ getMany: <T extends KvValue = KvValue>(keys: KvKey[]) => Promise<(KvListEntry<T> | null)[]>;
46
46
  list: <T extends KvValue = KvValue>(selector: KvListSelector, options?: KvListOptions) => Promise<KvListResponse<T>>;
47
- set: <T extends KvValue = KvValue>(key: KvKey, value: T, options?: KvSetOptions) => Promise<string | null>;
48
- delete: (key: KvKey) => Promise<boolean>;
49
- clearExpired: () => Promise<void>;
47
+ set: <T extends KvValue = KvValue>(key: KvKey, value: T, options?: KvSetOptions) => Promise<KvListEntry<T> | null>;
48
+ delete: (key: KvKey) => Promise<void>;
50
49
  transaction: <T>(operation: (tx: KvTransaction) => Promise<T>) => Promise<T>;
51
50
  };
52
51
  export type KvValue = Record<string, unknown> | unknown[] | unknown;
@@ -55,7 +54,7 @@ export type KvKey = KvKeyPart[];
55
54
  export type KvSetOptions = {
56
55
  ttlInSeconds?: number;
57
56
  };
58
- export type KvReadSchema<T extends KvValue = KvValue> = {
57
+ export type KvListEntry<T extends KvValue = KvValue> = {
59
58
  key: KvKey;
60
59
  value: T | null;
61
60
  };
@@ -77,15 +76,15 @@ export type KvListOptions = {
77
76
  cursor?: string;
78
77
  };
79
78
  export type KvListResponse<T extends KvValue = KvValue> = {
80
- items: KvReadSchema<T>[];
79
+ items: KvListEntry<T>[];
81
80
  total: number;
82
81
  cursor: string | null;
83
82
  };
84
83
  export type KvTransaction = {
85
- get: <T extends KvValue = KvValue>(key: KvKey) => Promise<KvReadSchema<T> | null>;
86
- getMany: <T extends KvValue = KvValue>(keys: KvKey[]) => Promise<(KvReadSchema<T> | null)[]>;
87
- set: <T extends KvValue = KvValue>(key: KvKey, value: T, options?: KvSetOptions) => Promise<string | null>;
88
- delete: (key: KvKey) => Promise<boolean>;
84
+ get: <T extends KvValue = KvValue>(key: KvKey) => Promise<T | null>;
85
+ getMany: <T extends KvValue = KvValue>(keys: KvKey[]) => Promise<(KvListEntry<T> | null)[]>;
86
+ set: <T extends KvValue = KvValue>(key: KvKey, value: T, options?: KvSetOptions) => Promise<KvListEntry<T> | null>;
87
+ delete: (key: KvKey) => Promise<void>;
89
88
  };
90
89
  export type ApiRoutesHandler = (request: Request, context: ApiFunctionsContext,
91
90
  /**
@@ -54,7 +54,7 @@ export type EntityLinkFileSchema = FromSchema<typeof entityLinkFileSchema>;
54
54
  export type EntityRelationFileSchema = FromSchema<typeof entityRelationFileSchema>;
55
55
  export type EntityBaseFileSchema = {
56
56
  version?: string | null;
57
- revision?: string | null;
57
+ revision?: string;
58
58
  key: string;
59
59
  title: string;
60
60
  summary?: string | null;
@@ -151,7 +151,8 @@ export type ResolvedSidebar = {
151
151
  items: ResolvedNavItem[];
152
152
  catalogEntity?: {
153
153
  key: string;
154
- catalogConfig: CatalogEntityConfig;
154
+ version?: string;
155
+ catalogConfig?: CatalogEntityConfig;
155
156
  };
156
157
  };
157
158
  export type CompilationError = {
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@redocly/config",
3
- "version": "0.41.0",
3
+ "version": "0.41.2",
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.5.2",
10
+ "@redocly/openapi-core": "2.14.3",
10
11
  "@types/node": "22.18.13",
11
12
  "@types/react": "^19.2.7",
13
+ "@vitest/coverage-v8": "4.0.10",
12
14
  "react-router-dom": "^6.21.1",
13
15
  "rimraf": "5.0.7",
14
- "typescript": "5.9.3"
16
+ "typescript": "5.9.3",
17
+ "vitest": "4.0.10"
15
18
  },
16
19
  "dependencies": {
17
20
  "json-schema-to-ts": "2.7.2"
@@ -19,6 +22,7 @@
19
22
  "scripts": {
20
23
  "clean": "rimraf lib",
21
24
  "compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.lib-esm.json",
22
- "build": "npm run clean && npm run compile"
25
+ "build": "npm run clean && npm run compile",
26
+ "test": "vitest run src"
23
27
  }
24
28
  }