@scalar/openapi-types 0.2.2 → 0.3.1

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,23 @@
1
1
  # @scalar/openapi-types
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4440949: chore: bumping packages
8
+
9
+ ## 0.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 483ca93: chore: require Node 20 (or above)
14
+
15
+ ## 0.2.3
16
+
17
+ ### Patch Changes
18
+
19
+ - cb9428c: Support additional query parameters for the OAuth authorization request (prompt, audience, anything), and handle OAuth authorization denials
20
+
3
21
  ## 0.2.2
4
22
 
5
23
  ### Patch Changes
@@ -6,7 +6,9 @@ export { XScalarIconSchema } from './x-scalar-icon.js';
6
6
  export { XScalarIgnoreSchema } from './x-scalar-ignore.js';
7
7
  export { XScalarRedirectUriSchema } from './x-scalar-redirect-uri.js';
8
8
  export { XScalarSdkInstallationSchema } from './x-scalar-sdk-installation.js';
9
+ export { XScalarSecurityQuery } from './x-scalar-security-query.js';
9
10
  export { XScalarStabilitySchema, XScalarStabilityValues } from './x-scalar-stability.js';
10
11
  export { XTagGroupsSchema, XTagGroupSchema } from './x-tag-groups.js';
11
12
  export { XusePkceSchema, XUsePkceValues } from './x-use-pkce.js';
13
+ export { XPostResponseSchema, PostResponseSchema } from './x-post-response.js';
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,C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mB,CAAA"}
@@ -6,19 +6,24 @@ import { XScalarIconSchema } from "./x-scalar-icon.js";
6
6
  import { XScalarIgnoreSchema } from "./x-scalar-ignore.js";
7
7
  import { XScalarRedirectUriSchema } from "./x-scalar-redirect-uri.js";
8
8
  import { XScalarSdkInstallationSchema } from "./x-scalar-sdk-installation.js";
9
+ import { XScalarSecurityQuery } from "./x-scalar-security-query.js";
9
10
  import { XScalarStabilitySchema, XScalarStabilityValues } from "./x-scalar-stability.js";
10
11
  import { XTagGroupsSchema, XTagGroupSchema } from "./x-tag-groups.js";
11
12
  import { XusePkceSchema, XUsePkceValues } from "./x-use-pkce.js";
13
+ import { XPostResponseSchema, PostResponseSchema } from "./x-post-response.js";
12
14
  export {
15
+ PostResponseSchema,
13
16
  XAdditionalPropertiesNameSchema,
14
17
  XCodeSampleSchema,
15
18
  XCodeSamplesSchema,
16
19
  XEnumDescriptionsSchema,
17
20
  XInternalSchema,
21
+ XPostResponseSchema,
18
22
  XScalarIconSchema,
19
23
  XScalarIgnoreSchema,
20
24
  XScalarRedirectUriSchema,
21
25
  XScalarSdkInstallationSchema,
26
+ XScalarSecurityQuery,
22
27
  XScalarStabilitySchema,
23
28
  XScalarStabilityValues,
24
29
  XTagGroupSchema,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/schemas/extensions/index.ts"],
4
- "sourcesContent": ["export { XAdditionalPropertiesNameSchema } from './x-additional-properties-name'\nexport { XCodeSamplesSchema, XCodeSampleSchema } from './x-code-samples'\nexport { XEnumDescriptionsSchema } from './x-enum-descriptions'\nexport { XInternalSchema } from './x-internal'\nexport { XScalarIconSchema } from './x-scalar-icon'\nexport { XScalarIgnoreSchema } from './x-scalar-ignore'\nexport { XScalarRedirectUriSchema } from './x-scalar-redirect-uri'\nexport { XScalarSdkInstallationSchema } from './x-scalar-sdk-installation'\nexport { XScalarStabilitySchema, XScalarStabilityValues } from './x-scalar-stability'\nexport { XTagGroupsSchema, XTagGroupSchema } from './x-tag-groups'\nexport { XusePkceSchema, XUsePkceValues } from './x-use-pkce'\n"],
5
- "mappings": "AAAA,SAAS,uCAAuC;AAChD,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,gCAAgC;AACzC,SAAS,oCAAoC;AAC7C,SAAS,wBAAwB,8BAA8B;AAC/D,SAAS,kBAAkB,uBAAuB;AAClD,SAAS,gBAAgB,sBAAsB;",
4
+ "sourcesContent": ["export { XAdditionalPropertiesNameSchema } from './x-additional-properties-name'\nexport { XCodeSamplesSchema, XCodeSampleSchema } from './x-code-samples'\nexport { XEnumDescriptionsSchema } from './x-enum-descriptions'\nexport { XInternalSchema } from './x-internal'\nexport { XScalarIconSchema } from './x-scalar-icon'\nexport { XScalarIgnoreSchema } from './x-scalar-ignore'\nexport { XScalarRedirectUriSchema } from './x-scalar-redirect-uri'\nexport { XScalarSdkInstallationSchema } from './x-scalar-sdk-installation'\nexport { XScalarSecurityQuery } from './x-scalar-security-query'\nexport { XScalarStabilitySchema, XScalarStabilityValues } from './x-scalar-stability'\nexport { XTagGroupsSchema, XTagGroupSchema } from './x-tag-groups'\nexport { XusePkceSchema, XUsePkceValues } from './x-use-pkce'\nexport { XPostResponseSchema, PostResponseSchema } from './x-post-response'\n"],
5
+ "mappings": "AAAA,SAAS,uCAAuC;AAChD,SAAS,oBAAoB,yBAAyB;AACtD,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,gCAAgC;AACzC,SAAS,oCAAoC;AAC7C,SAAS,4BAA4B;AACrC,SAAS,wBAAwB,8BAA8B;AAC/D,SAAS,kBAAkB,uBAAuB;AAClD,SAAS,gBAAgB,sBAAsB;AAC/C,SAAS,qBAAqB,0BAA0B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ /** The code to execute */
3
+ export declare const PostResponseSchema: z.ZodString;
4
+ /**
5
+ * Post response scripts allow to execute arbitrary code after a response is received
6
+ *
7
+ * This is useful for:
8
+ * - Extracting data from the response, or
9
+ * - Testing the response
10
+ *
11
+ * @example
12
+ * ```yaml
13
+ * x-post-response: |
14
+ * pm.test("Status code is 200", () => {
15
+ * pm.response.to.have.status(200)
16
+ * })
17
+ * ```
18
+ */
19
+ export declare const XPostResponseSchema: z.ZodObject<{
20
+ 'x-post-response': z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ 'x-post-response'?: string | undefined;
23
+ }, {
24
+ 'x-post-response'?: string | undefined;
25
+ }>;
26
+ //# sourceMappingURL=x-post-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-post-response.d.ts","sourceRoot":"","sources":["../../../src/schemas/extensions/x-post-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB,aAAa,CAAA;AAE5C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB;;;;;;EAE9B,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ const PostResponseSchema = z.string();
3
+ const XPostResponseSchema = z.object({
4
+ "x-post-response": PostResponseSchema.optional()
5
+ });
6
+ export {
7
+ PostResponseSchema,
8
+ XPostResponseSchema
9
+ };
10
+ //# sourceMappingURL=x-post-response.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/schemas/extensions/x-post-response.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\n/** The code to execute */\nexport const PostResponseSchema = z.string()\n\n/**\n * Post response scripts allow to execute arbitrary code after a response is received\n *\n * This is useful for:\n * - Extracting data from the response, or\n * - Testing the response\n *\n * @example\n * ```yaml\n * x-post-response: |\n * pm.test(\"Status code is 200\", () => {\n * pm.response.to.have.status(200)\n * })\n * ```\n */\nexport const XPostResponseSchema = z.object({\n 'x-post-response': PostResponseSchema.optional(),\n})\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAGX,MAAM,qBAAqB,EAAE,OAAO;AAiBpC,MAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,mBAAmB,mBAAmB,SAAS;AACjD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { XPostResponseSchema } from "./x-post-response.js";
3
+ describe("x-post-response", () => {
4
+ it("validates a valid post response script", () => {
5
+ const result = XPostResponseSchema.parse({
6
+ "x-post-response": 'pm.test("Status code is 200", () => { pm.response.to.have.status(200) })'
7
+ });
8
+ expect(result).toEqual({
9
+ "x-post-response": 'pm.test("Status code is 200", () => { pm.response.to.have.status(200) })'
10
+ });
11
+ });
12
+ it("allows empty object", () => {
13
+ const result = XPostResponseSchema.parse({});
14
+ expect(result).toEqual({ "x-post-response": void 0 });
15
+ });
16
+ it("rejects non-string values", () => {
17
+ expect(
18
+ () => XPostResponseSchema.parse({
19
+ "x-post-response": 123
20
+ })
21
+ ).toThrow();
22
+ });
23
+ });
24
+ //# sourceMappingURL=x-post-response.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/schemas/extensions/x-post-response.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { XPostResponseSchema } from './x-post-response'\n\ndescribe('x-post-response', () => {\n it('validates a valid post response script', () => {\n const result = XPostResponseSchema.parse({\n 'x-post-response': 'pm.test(\"Status code is 200\", () => { pm.response.to.have.status(200) })',\n })\n\n expect(result).toEqual({\n 'x-post-response': 'pm.test(\"Status code is 200\", () => { pm.response.to.have.status(200) })',\n })\n })\n\n it('allows empty object', () => {\n const result = XPostResponseSchema.parse({})\n expect(result).toEqual({ 'x-post-response': undefined })\n })\n\n it('rejects non-string values', () => {\n expect(() =>\n XPostResponseSchema.parse({\n 'x-post-response': 123,\n }),\n ).toThrow()\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,2BAA2B;AAEpC,SAAS,mBAAmB,MAAM;AAChC,KAAG,0CAA0C,MAAM;AACjD,UAAM,SAAS,oBAAoB,MAAM;AAAA,MACvC,mBAAmB;AAAA,IACrB,CAAC;AAED,WAAO,MAAM,EAAE,QAAQ;AAAA,MACrB,mBAAmB;AAAA,IACrB,CAAC;AAAA,EACH,CAAC;AAED,KAAG,uBAAuB,MAAM;AAC9B,UAAM,SAAS,oBAAoB,MAAM,CAAC,CAAC;AAC3C,WAAO,MAAM,EAAE,QAAQ,EAAE,mBAAmB,OAAU,CAAC;AAAA,EACzD,CAAC;AAED,KAAG,6BAA6B,MAAM;AACpC;AAAA,MAAO,MACL,oBAAoB,MAAM;AAAA,QACxB,mBAAmB;AAAA,MACrB,CAAC;AAAA,IACH,EAAE,QAAQ;AAAA,EACZ,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * An OpenAPI extension set any query parameters for the OAuth authorize request
4
+ *
5
+ * @example
6
+ * ```yaml
7
+ * x-scalar-security-query: {
8
+ * prompt: 'consent',
9
+ * audience: 'scalar'
10
+ * }
11
+ * ```
12
+ */
13
+ export declare const XScalarSecurityQuery: z.ZodObject<{
14
+ 'x-scalar-security-query': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ 'x-scalar-security-query'?: Record<string, string> | undefined;
17
+ }, {
18
+ 'x-scalar-security-query'?: Record<string, string> | undefined;
19
+ }>;
20
+ //# sourceMappingURL=x-scalar-security-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-scalar-security-query.d.ts","sourceRoot":"","sources":["../../../src/schemas/extensions/x-scalar-security-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ const XScalarSecurityQuery = z.object({
3
+ "x-scalar-security-query": z.record(z.string(), z.string()).optional()
4
+ });
5
+ export {
6
+ XScalarSecurityQuery
7
+ };
8
+ //# sourceMappingURL=x-scalar-security-query.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/schemas/extensions/x-scalar-security-query.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\n/**\n * An OpenAPI extension set any query parameters for the OAuth authorize request\n *\n * @example\n * ```yaml\n * x-scalar-security-query: {\n * prompt: 'consent',\n * audience: 'scalar'\n * }\n * ```\n */\nexport const XScalarSecurityQuery = z.object({\n 'x-scalar-security-query': z.record(z.string(), z.string()).optional(),\n})\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAaX,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,2BAA2B,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;AACvE,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,35 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { XScalarSecurityQuery } from "./x-scalar-security-query.js";
3
+ describe("XScalarSecurityQuery", () => {
4
+ it("allows any property", () => {
5
+ const result = XScalarSecurityQuery.parse({
6
+ "x-scalar-security-query": {
7
+ prompt: "consent"
8
+ }
9
+ });
10
+ expect(result).toEqual({
11
+ "x-scalar-security-query": {
12
+ prompt: "consent"
13
+ }
14
+ });
15
+ });
16
+ it("allows more than one property", () => {
17
+ const result = XScalarSecurityQuery.parse({
18
+ "x-scalar-security-query": {
19
+ prompt: "consent",
20
+ audience: "scalar"
21
+ }
22
+ });
23
+ expect(result).toEqual({
24
+ "x-scalar-security-query": {
25
+ prompt: "consent",
26
+ audience: "scalar"
27
+ }
28
+ });
29
+ });
30
+ it("can be empty, not required", () => {
31
+ const result = XScalarSecurityQuery.parse({});
32
+ expect(result).toEqual({});
33
+ });
34
+ });
35
+ //# sourceMappingURL=x-scalar-security-query.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/schemas/extensions/x-scalar-security-query.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { XScalarSecurityQuery } from './x-scalar-security-query'\n\ndescribe('XScalarSecurityQuery', () => {\n it('allows any property', () => {\n const result = XScalarSecurityQuery.parse({\n 'x-scalar-security-query': {\n prompt: 'consent',\n },\n })\n\n expect(result).toEqual({\n 'x-scalar-security-query': {\n prompt: 'consent',\n },\n })\n })\n\n it('allows more than one property', () => {\n const result = XScalarSecurityQuery.parse({\n 'x-scalar-security-query': {\n prompt: 'consent',\n audience: 'scalar',\n },\n })\n\n expect(result).toEqual({\n 'x-scalar-security-query': {\n prompt: 'consent',\n audience: 'scalar',\n },\n })\n })\n\n it('can be empty, not required', () => {\n const result = XScalarSecurityQuery.parse({})\n\n expect(result).toEqual({})\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,4BAA4B;AAErC,SAAS,wBAAwB,MAAM;AACrC,KAAG,uBAAuB,MAAM;AAC9B,UAAM,SAAS,qBAAqB,MAAM;AAAA,MACxC,2BAA2B;AAAA,QACzB,QAAQ;AAAA,MACV;AAAA,IACF,CAAC;AAED,WAAO,MAAM,EAAE,QAAQ;AAAA,MACrB,2BAA2B;AAAA,QACzB,QAAQ;AAAA,MACV;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,KAAG,iCAAiC,MAAM;AACxC,UAAM,SAAS,qBAAqB,MAAM;AAAA,MACxC,2BAA2B;AAAA,QACzB,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAED,WAAO,MAAM,EAAE,QAAQ;AAAA,MACrB,2BAA2B;AAAA,QACzB,QAAQ;AAAA,QACR,UAAU;AAAA,MACZ;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,KAAG,8BAA8B,MAAM;AACrC,UAAM,SAAS,qBAAqB,MAAM,CAAC,CAAC;AAE5C,WAAO,MAAM,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC3B,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -16,9 +16,9 @@
16
16
  "swagger",
17
17
  "typescript"
18
18
  ],
19
- "version": "0.2.2",
19
+ "version": "0.3.1",
20
20
  "engines": {
21
- "node": ">=18"
21
+ "node": ">=20"
22
22
  },
23
23
  "type": "module",
24
24
  "exports": {
@@ -53,7 +53,7 @@
53
53
  "zod": "3.24.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@scalar/build-tooling": "0.1.19"
56
+ "@scalar/build-tooling": "0.2.0"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "scalar-build-esbuild",