@redocly/config 0.6.0 → 0.6.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.
Files changed (67) hide show
  1. package/lib/default-theme-config-schema.d.ts +300 -1
  2. package/lib/default-theme-config-schema.js +2 -1
  3. package/lib/feedback-config-schema.d.ts +102 -0
  4. package/lib/feedback-config-schema.js +71 -0
  5. package/lib/graphql-config-schema.d.ts +303 -0
  6. package/lib/graphql-config-schema.js +129 -0
  7. package/lib/graphql-types.d.ts +9 -0
  8. package/lib/graphql-types.js +3 -0
  9. package/lib/index.d.ts +1 -1
  10. package/lib/index.js +2 -1
  11. package/lib/redoc-config-schema.js +2 -67
  12. package/lib/root-config-schema.d.ts +3587 -1837
  13. package/lib/root-config-schema.js +11 -7
  14. package/lib/types.d.ts +2 -0
  15. package/lib-esm/default-theme-config-schema.d.ts +300 -1
  16. package/lib-esm/default-theme-config-schema.js +2 -1
  17. package/lib-esm/feedback-config-schema.d.ts +102 -0
  18. package/lib-esm/feedback-config-schema.js +68 -0
  19. package/lib-esm/graphql-config-schema.d.ts +303 -0
  20. package/lib-esm/graphql-config-schema.js +126 -0
  21. package/lib-esm/graphql-types.d.ts +9 -0
  22. package/lib-esm/graphql-types.js +2 -0
  23. package/lib-esm/index.d.ts +1 -1
  24. package/lib-esm/index.js +1 -1
  25. package/lib-esm/redoc-config-schema.js +2 -67
  26. package/lib-esm/root-config-schema.d.ts +3587 -1837
  27. package/lib-esm/root-config-schema.js +11 -7
  28. package/lib-esm/types.d.ts +2 -0
  29. package/package.json +3 -2
  30. package/CHANGELOG.md +0 -74
  31. package/README_INTERNAL.md +0 -36
  32. package/lib/.tsbuildinfo +0 -1
  33. package/lib/constants.js.map +0 -1
  34. package/lib/default-theme-config-schema.js.map +0 -1
  35. package/lib/index.js.map +0 -1
  36. package/lib/portal-shared-types.js.map +0 -1
  37. package/lib/redoc-config-schema.js.map +0 -1
  38. package/lib/redoc-types.js.map +0 -1
  39. package/lib/remove-property-recursively.js.map +0 -1
  40. package/lib/reunite-config-schema.js.map +0 -1
  41. package/lib/root-config-schema.js.map +0 -1
  42. package/lib/types.js.map +0 -1
  43. package/lib-esm/.tsbuildinfo +0 -1
  44. package/lib-esm/constants.js.map +0 -1
  45. package/lib-esm/default-theme-config-schema.js.map +0 -1
  46. package/lib-esm/index.js.map +0 -1
  47. package/lib-esm/portal-shared-types.js.map +0 -1
  48. package/lib-esm/redoc-config-schema.js.map +0 -1
  49. package/lib-esm/redoc-types.js.map +0 -1
  50. package/lib-esm/remove-property-recursively.js.map +0 -1
  51. package/lib-esm/reunite-config-schema.js.map +0 -1
  52. package/lib-esm/root-config-schema.js.map +0 -1
  53. package/lib-esm/types.js.map +0 -1
  54. package/src/constants.ts +0 -18
  55. package/src/default-theme-config-schema.ts +0 -757
  56. package/src/index.ts +0 -14
  57. package/src/portal-shared-types.ts +0 -330
  58. package/src/redoc-config-schema.ts +0 -183
  59. package/src/redoc-types.ts +0 -80
  60. package/src/remove-property-recursively.ts +0 -39
  61. package/src/reunite-config-schema.ts +0 -7
  62. package/src/root-config-schema.ts +0 -404
  63. package/src/types.ts +0 -86
  64. package/tsconfig.build.json +0 -12
  65. package/tsconfig.json +0 -10
  66. package/tsconfig.lib-esm.json +0 -15
  67. /package/{LICENSE.md → LICENSE} +0 -0
@@ -115,6 +115,12 @@ exports.redirectsConfigSchema = {
115
115
  additionalProperties: exports.redirectConfigSchema,
116
116
  default: {},
117
117
  };
118
+ const rulesSchema = {
119
+ type: 'object',
120
+ additionalProperties: {
121
+ oneOf: [{ type: 'string' }, { type: 'object' }],
122
+ },
123
+ };
118
124
  exports.apiConfigSchema = {
119
125
  type: 'object',
120
126
  properties: {
@@ -131,7 +137,7 @@ exports.apiConfigSchema = {
131
137
  },
132
138
  title: { type: 'string' },
133
139
  metadata: { type: 'object', additionalProperties: true },
134
- rules: { type: 'object', additionalProperties: true },
140
+ rules: rulesSchema,
135
141
  decorators: { type: 'object', additionalProperties: true },
136
142
  preprocessors: { type: 'object', additionalProperties: true },
137
143
  },
@@ -300,6 +306,7 @@ exports.redoclyConfigSchema = {
300
306
  redirects: exports.redirectsConfigSchema,
301
307
  seo: exports.seoConfigSchema,
302
308
  rbac: exports.rbacConfigSchema,
309
+ requiresLogin: { type: 'boolean' },
303
310
  responseHeaders: {
304
311
  type: 'object',
305
312
  additionalProperties: {
@@ -321,12 +328,9 @@ exports.redoclyConfigSchema = {
321
328
  type: 'object',
322
329
  additionalProperties: exports.apiConfigSchema,
323
330
  },
324
- rules: {
325
- type: 'object',
326
- additionalProperties: {
327
- oneOf: [{ type: 'string' }, { type: 'object' }],
328
- },
329
- },
331
+ rules: rulesSchema,
332
+ decorators: { type: 'object', additionalProperties: true },
333
+ preprocessors: { type: 'object', additionalProperties: true },
330
334
  ssoOnPrem: exports.ssoOnPremConfigSchema,
331
335
  sso: exports.ssoConfigSchema,
332
336
  residency: { type: 'string' },
package/lib/types.d.ts CHANGED
@@ -2,11 +2,13 @@ import type { FromSchema } from 'json-schema-to-ts';
2
2
  import type { amplitudeAnalyticsConfigSchema, catalogFilterSchema, catalogSchema, googleAnalyticsConfigSchema, gtmAnalyticsConfigSchema, markdownConfigSchema, productConfigSchema, productGoogleAnalyticsConfigSchema, rudderstackAnalyticsConfigSchema, scorecardConfigSchema, segmentAnalyticsConfigSchema, themeConfigSchema } from './default-theme-config-schema';
3
3
  import type { apiConfigSchema, apigeeAdapterAuthOauth2Schema, apigeeAdapterAuthServiceAccountSchema, apigeeEdgeAdapterConfigSchema, apigeeXAdapterConfigSchema, authProviderConfigSchema, basicAuthProviderConfigSchema, devOnboardingAdapterConfigSchema, graviteeAdapterConfigSchema, i18ConfigSchema, oidcIssuerMetadataSchema, oidcProviderConfigSchema, rbacConfigSchema, rbacScopeItemsSchema, redirectConfigSchema, redirectsConfigSchema, rootRedoclyConfigSchema, saml2ProviderConfigSchema, seoConfigSchema, ssoOnPremConfigSchema } from './root-config-schema';
4
4
  import type { RedocConfigTypes } from './redoc-types';
5
+ import type { GraphQLConfigTypes } from './graphql-types';
5
6
  /**
6
7
  * Theme
7
8
  */
8
9
  export type ThemeConfig = FromSchema<typeof themeConfigSchema>;
9
10
  export type RedocConfig = RedocConfigTypes;
11
+ export type GraphQLConfig = GraphQLConfigTypes;
10
12
  export type ProductConfig = FromSchema<typeof productConfigSchema>;
11
13
  export type ProductGoogleAnalyticsConfig = FromSchema<typeof productGoogleAnalyticsConfigSchema>;
12
14
  export type MarkdownConfig = FromSchema<typeof markdownConfigSchema>;
@@ -1939,7 +1939,306 @@ export declare const themeConfigSchema: {
1939
1939
  };
1940
1940
  readonly graphql: {
1941
1941
  readonly type: "object";
1942
- readonly additionalProperties: true;
1942
+ readonly properties: {
1943
+ readonly pagination: {
1944
+ readonly type: "string";
1945
+ readonly enum: readonly ["none", "section", "item"];
1946
+ };
1947
+ readonly navigation: {
1948
+ readonly type: "object";
1949
+ readonly properties: {
1950
+ readonly contentPrefix: {
1951
+ readonly type: "string";
1952
+ };
1953
+ readonly menuPrefix: {
1954
+ readonly type: "string";
1955
+ };
1956
+ };
1957
+ };
1958
+ readonly hidePaginationButtons: {
1959
+ readonly type: "boolean";
1960
+ };
1961
+ readonly menu: {
1962
+ readonly type: "object";
1963
+ readonly properties: {
1964
+ readonly requireExactGroups: {
1965
+ readonly type: "boolean";
1966
+ };
1967
+ readonly groups: {
1968
+ readonly type: "array";
1969
+ readonly items: {
1970
+ readonly type: "object";
1971
+ readonly properties: {
1972
+ readonly name: {
1973
+ readonly type: "string";
1974
+ };
1975
+ readonly items: {
1976
+ readonly type: "object";
1977
+ readonly properties: {
1978
+ readonly includeByName: {
1979
+ readonly type: "array";
1980
+ readonly items: {
1981
+ readonly type: "string";
1982
+ };
1983
+ };
1984
+ readonly excludeByName: {
1985
+ readonly type: "array";
1986
+ readonly items: {
1987
+ readonly type: "string";
1988
+ };
1989
+ };
1990
+ };
1991
+ readonly additionalProperties: false;
1992
+ };
1993
+ readonly queries: {
1994
+ readonly type: "object";
1995
+ readonly properties: {
1996
+ readonly includeByName: {
1997
+ readonly type: "array";
1998
+ readonly items: {
1999
+ readonly type: "string";
2000
+ };
2001
+ };
2002
+ readonly excludeByName: {
2003
+ readonly type: "array";
2004
+ readonly items: {
2005
+ readonly type: "string";
2006
+ };
2007
+ };
2008
+ };
2009
+ readonly additionalProperties: false;
2010
+ };
2011
+ readonly mutations: {
2012
+ readonly type: "object";
2013
+ readonly properties: {
2014
+ readonly includeByName: {
2015
+ readonly type: "array";
2016
+ readonly items: {
2017
+ readonly type: "string";
2018
+ };
2019
+ };
2020
+ readonly excludeByName: {
2021
+ readonly type: "array";
2022
+ readonly items: {
2023
+ readonly type: "string";
2024
+ };
2025
+ };
2026
+ };
2027
+ readonly additionalProperties: false;
2028
+ };
2029
+ readonly subscriptions: {
2030
+ readonly type: "object";
2031
+ readonly properties: {
2032
+ readonly includeByName: {
2033
+ readonly type: "array";
2034
+ readonly items: {
2035
+ readonly type: "string";
2036
+ };
2037
+ };
2038
+ readonly excludeByName: {
2039
+ readonly type: "array";
2040
+ readonly items: {
2041
+ readonly type: "string";
2042
+ };
2043
+ };
2044
+ };
2045
+ readonly additionalProperties: false;
2046
+ };
2047
+ readonly types: {
2048
+ readonly type: "object";
2049
+ readonly properties: {
2050
+ readonly includeByName: {
2051
+ readonly type: "array";
2052
+ readonly items: {
2053
+ readonly type: "string";
2054
+ };
2055
+ };
2056
+ readonly excludeByName: {
2057
+ readonly type: "array";
2058
+ readonly items: {
2059
+ readonly type: "string";
2060
+ };
2061
+ };
2062
+ };
2063
+ readonly additionalProperties: false;
2064
+ };
2065
+ readonly directives: {
2066
+ readonly type: "object";
2067
+ readonly properties: {
2068
+ readonly includeByName: {
2069
+ readonly type: "array";
2070
+ readonly items: {
2071
+ readonly type: "string";
2072
+ };
2073
+ };
2074
+ readonly excludeByName: {
2075
+ readonly type: "array";
2076
+ readonly items: {
2077
+ readonly type: "string";
2078
+ };
2079
+ };
2080
+ };
2081
+ readonly additionalProperties: false;
2082
+ };
2083
+ };
2084
+ readonly required: readonly ["name"];
2085
+ readonly additionalProperties: false;
2086
+ };
2087
+ };
2088
+ readonly otherItemsGroupName: {
2089
+ readonly type: "string";
2090
+ };
2091
+ readonly initialLoadState: {
2092
+ readonly type: "string";
2093
+ readonly enum: readonly ["all-expanded", "default"];
2094
+ };
2095
+ };
2096
+ readonly additionalProperties: false;
2097
+ };
2098
+ readonly sidebar: {
2099
+ readonly type: "object";
2100
+ readonly properties: {
2101
+ readonly hide: {
2102
+ readonly type: "boolean";
2103
+ };
2104
+ };
2105
+ };
2106
+ readonly apiLogo: {
2107
+ readonly type: "object";
2108
+ readonly properties: {
2109
+ readonly imageUrl: {
2110
+ readonly type: "string";
2111
+ };
2112
+ readonly href: {
2113
+ readonly type: "string";
2114
+ };
2115
+ readonly altText: {
2116
+ readonly type: "string";
2117
+ };
2118
+ readonly backgroundColor: {
2119
+ readonly type: "string";
2120
+ };
2121
+ };
2122
+ };
2123
+ readonly jsonSamplesExpandLevel: {
2124
+ readonly type: "number";
2125
+ };
2126
+ readonly sampleMaxInlineArgs: {
2127
+ readonly type: "number";
2128
+ };
2129
+ readonly licenseKey: {
2130
+ readonly type: "string";
2131
+ };
2132
+ readonly fieldExpandLevel: {
2133
+ readonly type: "number";
2134
+ };
2135
+ readonly baseUrlPath: {
2136
+ readonly type: "string";
2137
+ };
2138
+ readonly feedback: {
2139
+ readonly type: "object";
2140
+ readonly properties: {
2141
+ readonly hide: {
2142
+ readonly type: "boolean";
2143
+ readonly default: false;
2144
+ };
2145
+ readonly type: {
2146
+ readonly type: "string";
2147
+ readonly enum: readonly ["rating", "sentiment", "comment", "reasons", "mood", "scale"];
2148
+ readonly default: "sentiment";
2149
+ };
2150
+ readonly settings: {
2151
+ readonly type: "object";
2152
+ readonly properties: {
2153
+ readonly label: {
2154
+ readonly type: "string";
2155
+ };
2156
+ readonly submitText: {
2157
+ readonly type: "string";
2158
+ };
2159
+ readonly buttonText: {
2160
+ readonly type: "string";
2161
+ };
2162
+ readonly component: {
2163
+ readonly type: "string";
2164
+ readonly enum: readonly ["radio", "checkbox"];
2165
+ readonly default: "checkbox";
2166
+ };
2167
+ readonly items: {
2168
+ readonly type: "array";
2169
+ readonly items: {
2170
+ readonly type: "string";
2171
+ };
2172
+ readonly minItems: 1;
2173
+ };
2174
+ readonly leftScaleLabel: {
2175
+ readonly type: "string";
2176
+ };
2177
+ readonly rightScaleLabel: {
2178
+ readonly type: "string";
2179
+ };
2180
+ readonly reasons: {
2181
+ readonly type: "object";
2182
+ readonly properties: {
2183
+ readonly hide: {
2184
+ readonly type: "boolean";
2185
+ readonly default: false;
2186
+ };
2187
+ readonly component: {
2188
+ readonly type: "string";
2189
+ readonly enum: readonly ["radio", "checkbox"];
2190
+ readonly default: "checkbox";
2191
+ };
2192
+ readonly label: {
2193
+ readonly type: "string";
2194
+ };
2195
+ readonly items: {
2196
+ readonly type: "array";
2197
+ readonly items: {
2198
+ readonly type: "string";
2199
+ };
2200
+ };
2201
+ };
2202
+ readonly additionalProperties: false;
2203
+ };
2204
+ readonly comment: {
2205
+ readonly type: "object";
2206
+ readonly properties: {
2207
+ readonly hide: {
2208
+ readonly type: "boolean";
2209
+ readonly default: false;
2210
+ };
2211
+ readonly label: {
2212
+ readonly type: "string";
2213
+ };
2214
+ readonly likeLabel: {
2215
+ readonly type: "string";
2216
+ };
2217
+ readonly dislikeLabel: {
2218
+ readonly type: "string";
2219
+ };
2220
+ readonly satisfiedLabel: {
2221
+ readonly type: "string";
2222
+ };
2223
+ readonly neutralLabel: {
2224
+ readonly type: "string";
2225
+ };
2226
+ readonly dissatisfiedLabel: {
2227
+ readonly type: "string";
2228
+ };
2229
+ };
2230
+ readonly additionalProperties: false;
2231
+ };
2232
+ };
2233
+ readonly additionalProperties: false;
2234
+ };
2235
+ };
2236
+ readonly additionalProperties: false;
2237
+ readonly default: null;
2238
+ readonly nullable: true;
2239
+ };
2240
+ };
2241
+ readonly additionalProperties: false;
1943
2242
  };
1944
2243
  readonly analytics: {
1945
2244
  readonly type: "object";
@@ -1,4 +1,5 @@
1
1
  import { redocConfigSchema } from './redoc-config-schema';
2
+ import { graphqlConfigSchema } from './graphql-config-schema';
2
3
  const logoConfigSchema = {
3
4
  type: 'object',
4
5
  properties: {
@@ -563,7 +564,7 @@ export const themeConfigSchema = {
563
564
  },
564
565
  markdown: markdownConfigSchema,
565
566
  openapi: redocConfigSchema,
566
- graphql: { type: 'object', additionalProperties: true },
567
+ graphql: graphqlConfigSchema,
567
568
  analytics: {
568
569
  type: 'object',
569
570
  properties: {
@@ -0,0 +1,102 @@
1
+ export declare const feedbackConfigSchema: {
2
+ readonly type: "object";
3
+ readonly properties: {
4
+ readonly hide: {
5
+ readonly type: "boolean";
6
+ readonly default: false;
7
+ };
8
+ readonly type: {
9
+ readonly type: "string";
10
+ readonly enum: readonly ["rating", "sentiment", "comment", "reasons", "mood", "scale"];
11
+ readonly default: "sentiment";
12
+ };
13
+ readonly settings: {
14
+ readonly type: "object";
15
+ readonly properties: {
16
+ readonly label: {
17
+ readonly type: "string";
18
+ };
19
+ readonly submitText: {
20
+ readonly type: "string";
21
+ };
22
+ readonly buttonText: {
23
+ readonly type: "string";
24
+ };
25
+ readonly component: {
26
+ readonly type: "string";
27
+ readonly enum: readonly ["radio", "checkbox"];
28
+ readonly default: "checkbox";
29
+ };
30
+ readonly items: {
31
+ readonly type: "array";
32
+ readonly items: {
33
+ readonly type: "string";
34
+ };
35
+ readonly minItems: 1;
36
+ };
37
+ readonly leftScaleLabel: {
38
+ readonly type: "string";
39
+ };
40
+ readonly rightScaleLabel: {
41
+ readonly type: "string";
42
+ };
43
+ readonly reasons: {
44
+ readonly type: "object";
45
+ readonly properties: {
46
+ readonly hide: {
47
+ readonly type: "boolean";
48
+ readonly default: false;
49
+ };
50
+ readonly component: {
51
+ readonly type: "string";
52
+ readonly enum: readonly ["radio", "checkbox"];
53
+ readonly default: "checkbox";
54
+ };
55
+ readonly label: {
56
+ readonly type: "string";
57
+ };
58
+ readonly items: {
59
+ readonly type: "array";
60
+ readonly items: {
61
+ readonly type: "string";
62
+ };
63
+ };
64
+ };
65
+ readonly additionalProperties: false;
66
+ };
67
+ readonly comment: {
68
+ readonly type: "object";
69
+ readonly properties: {
70
+ readonly hide: {
71
+ readonly type: "boolean";
72
+ readonly default: false;
73
+ };
74
+ readonly label: {
75
+ readonly type: "string";
76
+ };
77
+ readonly likeLabel: {
78
+ readonly type: "string";
79
+ };
80
+ readonly dislikeLabel: {
81
+ readonly type: "string";
82
+ };
83
+ readonly satisfiedLabel: {
84
+ readonly type: "string";
85
+ };
86
+ readonly neutralLabel: {
87
+ readonly type: "string";
88
+ };
89
+ readonly dissatisfiedLabel: {
90
+ readonly type: "string";
91
+ };
92
+ };
93
+ readonly additionalProperties: false;
94
+ };
95
+ };
96
+ readonly additionalProperties: false;
97
+ };
98
+ };
99
+ readonly additionalProperties: false;
100
+ readonly default: null;
101
+ readonly nullable: true;
102
+ };
@@ -0,0 +1,68 @@
1
+ export const feedbackConfigSchema = {
2
+ type: 'object',
3
+ properties: {
4
+ hide: {
5
+ type: 'boolean',
6
+ default: false,
7
+ },
8
+ type: {
9
+ type: 'string',
10
+ enum: ['rating', 'sentiment', 'comment', 'reasons', 'mood', 'scale'],
11
+ default: 'sentiment',
12
+ },
13
+ settings: {
14
+ type: 'object',
15
+ properties: {
16
+ label: { type: 'string' },
17
+ submitText: { type: 'string' },
18
+ buttonText: { type: 'string' },
19
+ component: {
20
+ type: 'string',
21
+ enum: ['radio', 'checkbox'],
22
+ default: 'checkbox',
23
+ },
24
+ items: { type: 'array', items: { type: 'string' }, minItems: 1 },
25
+ leftScaleLabel: { type: 'string' },
26
+ rightScaleLabel: { type: 'string' },
27
+ reasons: {
28
+ type: 'object',
29
+ properties: {
30
+ hide: {
31
+ type: 'boolean',
32
+ default: false,
33
+ },
34
+ component: {
35
+ type: 'string',
36
+ enum: ['radio', 'checkbox'],
37
+ default: 'checkbox',
38
+ },
39
+ label: { type: 'string' },
40
+ items: { type: 'array', items: { type: 'string' } },
41
+ },
42
+ additionalProperties: false,
43
+ },
44
+ comment: {
45
+ type: 'object',
46
+ properties: {
47
+ hide: {
48
+ type: 'boolean',
49
+ default: false,
50
+ },
51
+ label: { type: 'string' },
52
+ likeLabel: { type: 'string' },
53
+ dislikeLabel: { type: 'string' },
54
+ satisfiedLabel: { type: 'string' },
55
+ neutralLabel: { type: 'string' },
56
+ dissatisfiedLabel: { type: 'string' },
57
+ },
58
+ additionalProperties: false,
59
+ },
60
+ },
61
+ additionalProperties: false,
62
+ },
63
+ },
64
+ additionalProperties: false,
65
+ default: null,
66
+ nullable: true,
67
+ };
68
+ //# sourceMappingURL=feedback-config-schema.js.map