@scalar/types 0.7.5 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @scalar/types
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#8695](https://github.com/scalar/scalar/pull/8695): feat: suport pre/post request scripts
8
+
9
+ ## 0.7.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [#8661](https://github.com/scalar/scalar/pull/8661): fix(api-client): support OAuth redirect callback override for Electron-friendly flows
14
+ - [#8664](https://github.com/scalar/scalar/pull/8664): refactor: replace wildcard export barrels with explicit named re-exports
15
+
3
16
  ## 0.7.5
4
17
 
5
18
  ### Patch Changes
@@ -4,6 +4,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
4
4
  baseServerURL: z.ZodOptional<z.ZodString>;
5
5
  hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
6
6
  proxyUrl: z.ZodOptional<z.ZodString>;
7
+ oauth2RedirectUri: z.ZodOptional<z.ZodString>;
7
8
  searchHotKey: z.ZodOptional<z.ZodEnum<{
8
9
  a: "a";
9
10
  b: "b";
@@ -106,7 +107,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
106
107
  }, z.core.$strip>>;
107
108
  hooks: z.ZodOptional<z.ZodObject<{
108
109
  onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
109
- request: z.ZodCustom<Request, Request>;
110
+ request: z.ZodAny;
110
111
  }, z.core.$strip>], null>, z.core.$ZodFunctionOut>>;
111
112
  onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
112
113
  response: z.ZodCustom<Response, Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"api-client-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-client-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAA;AAE3G,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
1
+ {"version":3,"file":"api-client-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-client-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAA;AAE3G,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const hooksSchema: z.ZodObject<{
3
3
  onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
4
- request: z.ZodCustom<Request, Request>;
4
+ request: z.ZodAny;
5
5
  }, z.core.$strip>], null>, z.core.$ZodFunctionOut>>;
6
6
  onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
7
7
  response: z.ZodCustom<Response, Response>;
@@ -27,7 +27,7 @@ export declare const apiClientPluginSchema: z.ZodFunction<z.ZodTuple<readonly []
27
27
  }, z.core.$strip>>;
28
28
  hooks: z.ZodOptional<z.ZodObject<{
29
29
  onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
30
- request: z.ZodCustom<Request, Request>;
30
+ request: z.ZodAny;
31
31
  }, z.core.$strip>], null>, z.core.$ZodFunctionOut>>;
32
32
  onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
33
33
  response: z.ZodCustom<Response, Response>;
@@ -12,7 +12,7 @@ const viewsSchema = z.object({
12
12
  export const hooksSchema = z.object({
13
13
  onBeforeRequest: z
14
14
  .function({
15
- input: [z.object({ request: z.instanceof(Request) })],
15
+ input: [z.object({ request: z.any() })],
16
16
  // Why no output? https://github.com/scalar/scalar/pull/7047
17
17
  // output: z.union([z.void(), z.promise(z.void())]),
18
18
  })
@@ -18,6 +18,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
18
18
  baseServerURL: z.ZodOptional<z.ZodString>;
19
19
  hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
20
20
  proxyUrl: z.ZodOptional<z.ZodString>;
21
+ oauth2RedirectUri: z.ZodOptional<z.ZodString>;
21
22
  searchHotKey: z.ZodOptional<z.ZodEnum<{
22
23
  a: "a";
23
24
  b: "b";
@@ -166,6 +167,8 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
166
167
  onLoaded: z.ZodType<((slug: string) => Promise<void> | void) | undefined>;
167
168
  onBeforeRequest: z.ZodType<((a: {
168
169
  request: Request;
170
+ requestBuilder: any;
171
+ envVariables: Record<string, string>;
169
172
  }) => Promise<void> | void) | undefined>;
170
173
  onShowMore: z.ZodType<((a: string) => Promise<void> | void) | undefined>;
171
174
  onSidebarClick: z.ZodType<((a: string) => Promise<void> | void) | undefined>;
@@ -234,6 +237,31 @@ export type ApiReferenceConfiguration = ApiReferenceConfigurationRaw & {
234
237
  * Use the type `ApiReferenceConfigurationWithSource` instead.
235
238
  */
236
239
  content?: SourceConfiguration['content'];
240
+ /**
241
+ * Fired before the outbound request is built and sent. Mutate the **request builder** so the eventual fetch call
242
+ * reflects your changes (method, path, headers, body, and related fields).
243
+ *
244
+ * **Experimental:** The builder matches {@link https://github.com/scalar/scalar/blob/main/packages/workspace-store/src/request-example/builder/request-factory.ts RequestFactory}
245
+ * (`import type { RequestFactory } from '@scalar/workspace-store/request-example'`). That shape is still experimental and may change in minor releases.
246
+ *
247
+ * @param input - Hook argument from the integration layer.
248
+ * @param input.request - **Deprecated** when treated as a fetch API `Request`. Prefer thinking of this value as the
249
+ * mutable builder ({@link https://github.com/scalar/scalar/blob/main/packages/workspace-store/src/request-example/builder/request-factory.ts RequestFactory}).
250
+ * Some call sites only pass this property.
251
+ * @param input.requestBuilder - The same builder when exposed under this name; **prefer** mutating this when your integration provides it.
252
+ * @returns void or a promise that resolves when the hook finishes
253
+ * @example
254
+ * ```ts
255
+ * onBeforeRequest: ({ request: builder }) => {
256
+ * builder.headers.set('Authorization', 'Bearer <token>')
257
+ * }
258
+ * ```
259
+ */
260
+ onBeforeRequest?: (input: {
261
+ request: Request;
262
+ requestBuilder: any;
263
+ envVariables: Record<string, string>;
264
+ }) => void | Promise<void> | undefined;
237
265
  };
238
266
  /** Migrate the configuration through a transform */
239
267
  /** Configuration for the Api Reference */
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,EAAE,KAAK,mBAAmB,EAA6B,MAAM,wBAAwB,CAAA;AAK5F;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAZH,MAAM,GAAG,GAAG,G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AAG,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAA;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA;CACzC,CAAA;AAED,oDAAoD;AAGpD,0CAA0C;AAC1C,eAAO,MAAM,yCAAyC,EAAE,OAAO,CAC7D,IAAI,CAAC,yBAAyB,EAAE,KAAK,GAAG,SAAS,CAAC,GAAG,mBAAmB,CAgExE,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,IAAI,CACpD,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,EAEzD,OAAO,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,CACpD,GAAG;IACF,cAAc,CAAC,EAAE,2BAA2B,CAAA;CAC7C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,4CAA4C,GAAG,mCAAmC,GAAG;IAC/F,OAAO,EAAE,mBAAmB,EAAE,CAAA;CAC/B,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,4BAA4B,GACpC,OAAO,CAAC,mCAAmC,CAAC,GAC5C,OAAO,CAAC,4CAA4C,CAAC,GACrD,OAAO,CAAC,mCAAmC,CAAC,EAAE,GAC9C,OAAO,CAAC,4CAA4C,CAAC,EAAE,CAAA;AAE3D,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,GACrC,QAAQ,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,4CAA4C,CACkC,CAAA"}
1
+ {"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,EAAE,KAAK,mBAAmB,EAA6B,MAAM,wBAAwB,CAAA;AAK5F;;;;;;;;;GASG;AACH,eAAO,MAA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AC,GACrD,OAAO,CAAC,mCAAmC,CAAC,EAAE,GAC9C,OAAO,CAAC,4CAA4C,CAAC,EAAE,CAAA;AAE3D,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,GACrC,QAAQ,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,4CAA4C,CACkC,CAAA"}
@@ -137,10 +137,16 @@ export const apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
137
137
  .optional(),
138
138
  /** Callback fired when the reference is fully loaded */
139
139
  onLoaded: z.function().optional(),
140
- /** onBeforeRequest is fired before the request is sent. You can modify the request here. */
140
+ /** Fired before the outbound request is built; callback receives a mutable request builder (RequestFactory). Experimental API. */
141
141
  onBeforeRequest: z
142
142
  .function({
143
- input: [z.object({ request: z.instanceof(Request) })],
143
+ input: [
144
+ z.object({
145
+ request: z.instanceof(Request),
146
+ requestBuilder: z.unknown(),
147
+ envVariables: z.record(z.string(), z.string()),
148
+ }),
149
+ ],
144
150
  // Why no output? https://github.com/scalar/scalar/pull/7047
145
151
  // output: z.union([z.void(), z.promise(z.void())]),
146
152
  })
@@ -17,6 +17,7 @@ export declare const baseConfigurationSchema: z.ZodObject<{
17
17
  baseServerURL: z.ZodOptional<z.ZodString>;
18
18
  hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
19
19
  proxyUrl: z.ZodOptional<z.ZodString>;
20
+ oauth2RedirectUri: z.ZodOptional<z.ZodString>;
20
21
  searchHotKey: z.ZodOptional<z.ZodEnum<{
21
22
  a: "a";
22
23
  b: "b";
@@ -119,7 +120,7 @@ export declare const baseConfigurationSchema: z.ZodObject<{
119
120
  }, z.core.$strip>>;
120
121
  hooks: z.ZodOptional<z.ZodObject<{
121
122
  onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
122
- request: z.ZodCustom<Request, Request>;
123
+ request: z.ZodAny;
123
124
  }, z.core.$strip>], null>, z.core.$ZodFunctionOut>>;
124
125
  onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
125
126
  response: z.ZodCustom<Response, Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"base-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/base-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,QAAA,MAAM,kBAAkB;;;;;iBAKtB,CAAA;AAEF,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE9D,eAAO,MAAM,aAAa,yCAAyC,CAAA;AACnE,eAAO,MAAM,aAAa,6BAA6B,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmJlC,CAAA"}
1
+ {"version":3,"file":"base-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/base-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,QAAA,MAAM,kBAAkB;;;;;iBAKtB,CAAA;AAEF,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE9D,eAAO,MAAM,aAAa,yCAAyC,CAAA;AACnE,eAAO,MAAM,aAAa,6BAA6B,CAAA;AAEvD,gEAAgE;AAChE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0JlC,CAAA"}
@@ -37,6 +37,13 @@ export const baseConfigurationSchema = z.object({
37
37
  hideClientButton: z.boolean().optional().default(false).catch(false),
38
38
  /** URL to a request proxy for the API client */
39
39
  proxyUrl: z.string().optional(),
40
+ /**
41
+ * Default OAuth 2.0 redirect URI used to prefill auth flows in the API client.
42
+ *
43
+ * This is especially useful in desktop wrappers (for example Electron),
44
+ * where `window.location` can be a `file://` URL that OAuth providers reject.
45
+ */
46
+ oauth2RedirectUri: z.string().optional(),
40
47
  /** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
41
48
  searchHotKey: z
42
49
  .enum([
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * We should not use these exports anymore, but we need them for commonjs compatibility.
3
3
  */
4
- export * from './api-reference/index.js';
4
+ export type { AnyApiReferenceConfiguration, ApiClientConfiguration, ApiClientPlugin, ApiReferenceConfiguration, ApiReferenceConfigurationRaw, ApiReferenceConfigurationWithMultipleSources, ApiReferenceConfigurationWithSource, ApiReferenceInstance, ApiReferencePlugin, AuthenticationConfiguration, CreateApiReference, ExternalUrls, HtmlRenderingConfiguration, SourceConfiguration, SpecificationExtension, ViewComponent, } from './api-reference/index.js';
5
+ export { apiClientConfigurationSchema, apiClientPluginSchema, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourceSchema, hooksSchema, htmlRenderingConfigurationSchema, isConfigurationWithSources, sourceConfigurationSchema, } from './api-reference/index.js';
5
6
  export { XScalarStability } from './legacy/index.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EACf,yBAAyB,EACzB,4BAA4B,EAC5B,4CAA4C,EAC5C,mCAAmC,EACnC,oBAAoB,EACpB,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,YAAY,EACZ,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,GACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,+BAA+B,EAC/B,yCAAyC,EACzC,WAAW,EACX,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -1,6 +1,2 @@
1
- /**
2
- * We should not use these exports anymore, but we need them for commonjs compatibility.
3
- */
4
- // biome-ignore lint/performance/noReExportAll: leave this to avoid copy exports
5
- export * from './api-reference/index.js';
1
+ export { apiClientConfigurationSchema, apiClientPluginSchema, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourceSchema, hooksSchema, htmlRenderingConfigurationSchema, isConfigurationWithSources, sourceConfigurationSchema, } from './api-reference/index.js';
6
2
  export { XScalarStability } from './legacy/index.js';
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "scalar",
17
17
  "references"
18
18
  ],
19
- "version": "0.7.5",
19
+ "version": "0.8.0",
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
@@ -62,7 +62,7 @@
62
62
  "nanoid": "^5.1.6",
63
63
  "type-fest": "^5.3.1",
64
64
  "zod": "^4.3.5",
65
- "@scalar/helpers": "0.4.2"
65
+ "@scalar/helpers": "0.4.3"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/har-format": "^1.2.16",