@scalar/oas-utils 0.11.1 → 0.12.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.
Files changed (126) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/helpers/index.d.ts +0 -82
  3. package/dist/helpers/index.d.ts.map +1 -1
  4. package/dist/helpers/index.js +0 -78
  5. package/dist/migrations/migrate-to-indexdb.d.ts.map +1 -1
  6. package/dist/migrations/migrate-to-indexdb.js +1 -1
  7. package/dist/migrations/v-2.5.0/types.generated.d.ts +428 -34
  8. package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
  9. package/package.json +7 -61
  10. package/dist/entities/cookie/cookie.d.ts +0 -15
  11. package/dist/entities/cookie/cookie.d.ts.map +0 -1
  12. package/dist/entities/cookie/cookie.js +0 -12
  13. package/dist/entities/cookie/index.d.ts +0 -2
  14. package/dist/entities/cookie/index.d.ts.map +0 -1
  15. package/dist/entities/cookie/index.js +0 -1
  16. package/dist/entities/environment/environment.d.ts +0 -12
  17. package/dist/entities/environment/environment.d.ts.map +0 -1
  18. package/dist/entities/environment/environment.js +0 -8
  19. package/dist/entities/environment/index.d.ts +0 -2
  20. package/dist/entities/environment/index.d.ts.map +0 -1
  21. package/dist/entities/environment/index.js +0 -1
  22. package/dist/entities/hotkeys/hotkeys.d.ts +0 -15
  23. package/dist/entities/hotkeys/hotkeys.d.ts.map +0 -1
  24. package/dist/entities/hotkeys/hotkeys.js +0 -118
  25. package/dist/entities/hotkeys/index.d.ts +0 -2
  26. package/dist/entities/hotkeys/index.d.ts.map +0 -1
  27. package/dist/entities/hotkeys/index.js +0 -1
  28. package/dist/entities/shared/index.d.ts +0 -2
  29. package/dist/entities/shared/index.d.ts.map +0 -1
  30. package/dist/entities/shared/index.js +0 -1
  31. package/dist/entities/shared/utility.d.ts +0 -5
  32. package/dist/entities/shared/utility.d.ts.map +0 -1
  33. package/dist/entities/shared/utility.js +0 -9
  34. package/dist/entities/spec/collection.d.ts +0 -133
  35. package/dist/entities/spec/collection.d.ts.map +0 -1
  36. package/dist/entities/spec/collection.js +0 -95
  37. package/dist/entities/spec/index.d.ts +0 -12
  38. package/dist/entities/spec/index.d.ts.map +0 -1
  39. package/dist/entities/spec/index.js +0 -10
  40. package/dist/entities/spec/operation.d.ts +0 -99
  41. package/dist/entities/spec/operation.d.ts.map +0 -1
  42. package/dist/entities/spec/operation.js +0 -6
  43. package/dist/entities/spec/parameters.d.ts +0 -44
  44. package/dist/entities/spec/parameters.d.ts.map +0 -1
  45. package/dist/entities/spec/parameters.js +0 -41
  46. package/dist/entities/spec/request-examples.d.ts +0 -380
  47. package/dist/entities/spec/request-examples.d.ts.map +0 -1
  48. package/dist/entities/spec/request-examples.js +0 -449
  49. package/dist/entities/spec/requests.d.ts +0 -137
  50. package/dist/entities/spec/requests.d.ts.map +0 -1
  51. package/dist/entities/spec/requests.js +0 -123
  52. package/dist/entities/spec/server.d.ts +0 -15
  53. package/dist/entities/spec/server.d.ts.map +0 -1
  54. package/dist/entities/spec/server.js +0 -67
  55. package/dist/entities/spec/spec-objects.d.ts +0 -171
  56. package/dist/entities/spec/spec-objects.d.ts.map +0 -1
  57. package/dist/entities/spec/spec-objects.js +0 -134
  58. package/dist/entities/spec/x-scalar-environments.d.ts +0 -22
  59. package/dist/entities/spec/x-scalar-environments.d.ts.map +0 -1
  60. package/dist/entities/spec/x-scalar-environments.js +0 -22
  61. package/dist/entities/spec/x-scalar-secrets.d.ts +0 -6
  62. package/dist/entities/spec/x-scalar-secrets.d.ts.map +0 -1
  63. package/dist/entities/spec/x-scalar-secrets.js +0 -8
  64. package/dist/entities/workspace/index.d.ts +0 -2
  65. package/dist/entities/workspace/index.d.ts.map +0 -1
  66. package/dist/entities/workspace/index.js +0 -1
  67. package/dist/entities/workspace/workspace.d.ts +0 -236
  68. package/dist/entities/workspace/workspace.d.ts.map +0 -1
  69. package/dist/entities/workspace/workspace.js +0 -49
  70. package/dist/helpers/fetch-document.d.ts +0 -7
  71. package/dist/helpers/fetch-document.d.ts.map +0 -1
  72. package/dist/helpers/fetch-document.js +0 -32
  73. package/dist/helpers/fetch-with-proxy-fallback.d.ts +0 -15
  74. package/dist/helpers/fetch-with-proxy-fallback.d.ts.map +0 -1
  75. package/dist/helpers/fetch-with-proxy-fallback.js +0 -29
  76. package/dist/helpers/normalize-mime-type-object.d.ts +0 -8
  77. package/dist/helpers/normalize-mime-type-object.d.ts.map +0 -1
  78. package/dist/helpers/normalize-mime-type-object.js +0 -21
  79. package/dist/helpers/normalize-mime-type.d.ts +0 -10
  80. package/dist/helpers/normalize-mime-type.d.ts.map +0 -1
  81. package/dist/helpers/normalize-mime-type.js +0 -12
  82. package/dist/helpers/operation-stability.d.ts +0 -19
  83. package/dist/helpers/operation-stability.d.ts.map +0 -1
  84. package/dist/helpers/operation-stability.js +0 -24
  85. package/dist/helpers/schema-model.d.ts +0 -5
  86. package/dist/helpers/schema-model.d.ts.map +0 -1
  87. package/dist/helpers/schema-model.js +0 -14
  88. package/dist/helpers/security/get-schemes.d.ts +0 -97
  89. package/dist/helpers/security/get-schemes.d.ts.map +0 -1
  90. package/dist/helpers/security/get-schemes.js +0 -8
  91. package/dist/helpers/security/has-token.d.ts +0 -4
  92. package/dist/helpers/security/has-token.d.ts.map +0 -1
  93. package/dist/helpers/security/has-token.js +0 -19
  94. package/dist/helpers/security/index.d.ts +0 -3
  95. package/dist/helpers/security/index.d.ts.map +0 -1
  96. package/dist/helpers/security/index.js +0 -2
  97. package/dist/helpers/servers.d.ts +0 -24
  98. package/dist/helpers/servers.d.ts.map +0 -1
  99. package/dist/helpers/servers.js +0 -146
  100. package/dist/helpers/should-ignore-entity.d.ts +0 -8
  101. package/dist/helpers/should-ignore-entity.d.ts.map +0 -1
  102. package/dist/helpers/should-ignore-entity.js +0 -4
  103. package/dist/migrations/generate-types.d.ts +0 -2
  104. package/dist/migrations/generate-types.d.ts.map +0 -1
  105. package/dist/migrations/generate-types.js +0 -53
  106. package/dist/spec-getters/get-example-from-schema.d.ts +0 -36
  107. package/dist/spec-getters/get-example-from-schema.d.ts.map +0 -1
  108. package/dist/spec-getters/get-example-from-schema.js +0 -521
  109. package/dist/spec-getters/get-parameters-from-operation.d.ts +0 -17
  110. package/dist/spec-getters/get-parameters-from-operation.d.ts.map +0 -1
  111. package/dist/spec-getters/get-parameters-from-operation.js +0 -40
  112. package/dist/spec-getters/get-request-body-from-operation.d.ts +0 -14
  113. package/dist/spec-getters/get-request-body-from-operation.d.ts.map +0 -1
  114. package/dist/spec-getters/get-request-body-from-operation.js +0 -176
  115. package/dist/spec-getters/get-server-variable-examples.d.ts +0 -4
  116. package/dist/spec-getters/get-server-variable-examples.d.ts.map +0 -1
  117. package/dist/spec-getters/get-server-variable-examples.js +0 -12
  118. package/dist/spec-getters/index.d.ts +0 -5
  119. package/dist/spec-getters/index.d.ts.map +0 -1
  120. package/dist/spec-getters/index.js +0 -4
  121. package/dist/transforms/import-spec.d.ts +0 -64
  122. package/dist/transforms/import-spec.d.ts.map +0 -1
  123. package/dist/transforms/import-spec.js +0 -397
  124. package/dist/transforms/index.d.ts +0 -2
  125. package/dist/transforms/index.d.ts.map +0 -1
  126. package/dist/transforms/index.js +0 -1
@@ -1,12 +0,0 @@
1
- /** Re-exported here for ease of use but we should use the other ones directly */
2
- export { type Oauth2Flow, type Oauth2FlowPayload, type SecuritySchemaHttp, type SecuritySchemaOpenId, type SecurityScheme, type SecuritySchemeApiKey, type SecuritySchemeOauth2, type SecuritySchemeOauth2Payload, type SecuritySchemePayload, oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema, } from '@scalar/types/entities';
3
- export { type Collection, type CollectionPayload, collectionSchema } from './collection.js';
4
- export { type Operation, type OperationPayload, operationSchema, } from './operation.js';
5
- export { type RequestParameter, type RequestParameterPayload, oasParameterSchema } from './parameters.js';
6
- export { type RequestExample, type RequestExampleParameter, createExampleFromRequest, requestExampleParametersSchema, requestExampleSchema, } from './request-examples.js';
7
- export { type Request, type RequestEvent, type RequestMethod, type RequestPayload, type ResponseInstance, requestSchema, } from './requests.js';
8
- export type { PostResponseScript, PostResponseScripts, } from './requests.ts';
9
- export { type Server, type ServerPayload, serverSchema } from './server.js';
10
- export { type Tag, type TagPayload, oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, tagSchema, } from './spec-objects.js';
11
- export { type XScalarEnvironment, type XScalarEnvironments, xScalarEnvironmentsSchema, } from './x-scalar-environments.js';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtG,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,aAAa,GACd,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACxE,OAAO,EACL,KAAK,GAAG,EACR,KAAK,UAAU,EACf,gBAAgB,EAChB,8BAA8B,EAC9B,aAAa,EACb,gBAAgB,EAChB,SAAS,GACV,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAA"}
@@ -1,10 +0,0 @@
1
- /** Re-exported here for ease of use but we should use the other ones directly */
2
- export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema, } from '@scalar/types/entities';
3
- export { collectionSchema } from './collection.js';
4
- export { operationSchema, } from './operation.js';
5
- export { oasParameterSchema } from './parameters.js';
6
- export { createExampleFromRequest, requestExampleParametersSchema, requestExampleSchema, } from './request-examples.js';
7
- export { requestSchema, } from './requests.js';
8
- export { serverSchema } from './server.js';
9
- export { oasContactSchema, oasExternalDocumentationSchema, oasInfoSchema, oasLicenseSchema, tagSchema, } from './spec-objects.js';
10
- export { xScalarEnvironmentsSchema, } from './x-scalar-environments.js';
@@ -1,99 +0,0 @@
1
- /**
2
- * Aliases Request to Operation which is closer to the spec,
3
- * also will not conflict with the builtin Request class
4
- */
5
- import { type RequestPayload, type Request as RequestType } from './requests.js';
6
- export type Operation = RequestType;
7
- export type OperationPayload = RequestPayload;
8
- export declare const operationSchema: import("zod").ZodObject<{
9
- description: import("zod").ZodOptional<import("zod").ZodString>;
10
- summary: import("zod").ZodOptional<import("zod").ZodString>;
11
- externalDocs: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodObject<{
12
- description: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
13
- url: import("zod").ZodString;
14
- }, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
15
- url: string;
16
- description?: string | undefined;
17
- }, {
18
- url: string;
19
- description?: string | undefined;
20
- }>>>;
21
- 'x-internal': import("zod").ZodOptional<import("zod").ZodBoolean>;
22
- 'x-scalar-ignore': import("zod").ZodOptional<import("zod").ZodBoolean>;
23
- security: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>>>>;
24
- tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
25
- deprecated: import("zod").ZodOptional<import("zod").ZodBoolean>;
26
- operationId: import("zod").ZodOptional<import("zod").ZodString>;
27
- requestBody: import("zod").ZodOptional<import("zod").ZodAny>;
28
- parameters: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
29
- in: import("zod").ZodEnum<{
30
- cookie: "cookie";
31
- path: "path";
32
- query: "query";
33
- header: "header";
34
- }>;
35
- name: import("zod").ZodString;
36
- description: import("zod").ZodOptional<import("zod").ZodString>;
37
- required: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
38
- deprecated: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
39
- schema: import("zod").ZodOptional<import("zod").ZodUnknown>;
40
- content: import("zod").ZodOptional<import("zod").ZodUnknown>;
41
- style: import("zod").ZodOptional<import("zod").ZodEnum<{
42
- matrix: "matrix";
43
- label: "label";
44
- form: "form";
45
- simple: "simple";
46
- spaceDelimited: "spaceDelimited";
47
- pipeDelimited: "pipeDelimited";
48
- deepObject: "deepObject";
49
- }>>;
50
- explode: import("zod").ZodOptional<import("zod").ZodBoolean>;
51
- example: import("zod").ZodOptional<import("zod").ZodUnknown>;
52
- examples: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
53
- value: import("zod").ZodOptional<import("zod").ZodUnknown>;
54
- summary: import("zod").ZodOptional<import("zod").ZodString>;
55
- externalValue: import("zod").ZodOptional<import("zod").ZodString>;
56
- }, import("zod/v4/core").$strip>>, import("zod").ZodArray<import("zod").ZodUnknown>]>>;
57
- }, import("zod/v4/core").$strip>>>;
58
- responses: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
59
- callbacks: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>>;
60
- 'x-codeSamples': import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
61
- lang: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
62
- label: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
63
- source: import("zod").ZodString;
64
- }, import("zod/v4/core").$strip>>>>;
65
- 'x-code-samples': import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
66
- lang: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
67
- label: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
68
- source: import("zod").ZodString;
69
- }, import("zod/v4/core").$strip>>>>;
70
- 'x-custom-examples': import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
71
- lang: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
72
- label: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodString>>;
73
- source: import("zod").ZodString;
74
- }, import("zod/v4/core").$strip>>>>;
75
- 'x-scalar-stability': import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodEnum<{
76
- deprecated: import("@scalar/types/legacy").XScalarStability.Deprecated;
77
- experimental: import("@scalar/types/legacy").XScalarStability.Experimental;
78
- stable: import("@scalar/types/legacy").XScalarStability.Stable;
79
- }>>>;
80
- type: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodLiteral<"request">>>;
81
- uid: import("zod/v4/core").$ZodBranded<import("zod").ZodDefault<import("zod").ZodString>, "operation", "out">;
82
- path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
83
- method: import("zod").ZodDefault<import("zod").ZodEnum<{
84
- delete: "delete";
85
- get: "get";
86
- head: "head";
87
- options: "options";
88
- patch: "patch";
89
- post: "post";
90
- put: "put";
91
- trace: "trace";
92
- }>>;
93
- servers: import("zod").ZodDefault<import("zod").ZodArray<import("zod/v4/core").$ZodBranded<import("zod").ZodString, "server", "out">>>;
94
- selectedServerUid: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod/v4/core").$ZodBranded<import("zod").ZodString, "server", "out">>>>;
95
- examples: import("zod").ZodDefault<import("zod").ZodArray<import("zod/v4/core").$ZodBranded<import("zod").ZodString, "example", "out">>>;
96
- selectedSecuritySchemeUids: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod/v4/core").$ZodBranded<import("zod").ZodString, "securityScheme", "out">, import("zod").ZodArray<import("zod/v4/core").$ZodBranded<import("zod").ZodString, "securityScheme", "out">>]>>>;
97
- 'x-post-response': import("zod").ZodOptional<import("zod").ZodString>;
98
- }, import("zod/v4/core").$strip>;
99
- //# sourceMappingURL=operation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,IAAI,WAAW,EAAiB,MAAM,YAAY,CAAA;AAE5F,MAAM,MAAM,SAAS,GAAG,WAAW,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAC7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAgB,CAAA"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Aliases Request to Operation which is closer to the spec,
3
- * also will not conflict with the builtin Request class
4
- */
5
- import { requestSchema } from './requests.js';
6
- export const operationSchema = requestSchema;
@@ -1,44 +0,0 @@
1
- import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
- import { z } from 'zod';
3
- import type { RequestExampleParameter } from './request-examples.js';
4
- export type ParameterContent = Record<string, {
5
- schema?: OpenAPIV3_1.Document;
6
- examples?: Record<string, RequestExampleParameter>;
7
- example?: RequestExampleParameter;
8
- }>;
9
- /**
10
- * OpenAPI compliant parameters object
11
- */
12
- export declare const oasParameterSchema: z.ZodObject<{
13
- in: z.ZodEnum<{
14
- cookie: "cookie";
15
- path: "path";
16
- query: "query";
17
- header: "header";
18
- }>;
19
- name: z.ZodString;
20
- description: z.ZodOptional<z.ZodString>;
21
- required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
22
- deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
23
- schema: z.ZodOptional<z.ZodUnknown>;
24
- content: z.ZodOptional<z.ZodUnknown>;
25
- style: z.ZodOptional<z.ZodEnum<{
26
- matrix: "matrix";
27
- label: "label";
28
- form: "form";
29
- simple: "simple";
30
- spaceDelimited: "spaceDelimited";
31
- pipeDelimited: "pipeDelimited";
32
- deepObject: "deepObject";
33
- }>>;
34
- explode: z.ZodOptional<z.ZodBoolean>;
35
- example: z.ZodOptional<z.ZodUnknown>;
36
- examples: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodObject<{
37
- value: z.ZodOptional<z.ZodUnknown>;
38
- summary: z.ZodOptional<z.ZodString>;
39
- externalValue: z.ZodOptional<z.ZodString>;
40
- }, z.core.$strip>>, z.ZodArray<z.ZodUnknown>]>>;
41
- }, z.core.$strip>;
42
- export type RequestParameter = z.infer<typeof oasParameterSchema>;
43
- export type RequestParameterPayload = z.input<typeof oasParameterSchema>;
44
- //# sourceMappingURL=parameters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/parameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAkB,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAkBjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CACnC,MAAM,EACN;IACE,MAAM,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IAClD,OAAO,CAAC,EAAE,uBAAuB,CAAA;CAClC,CACF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BU,CAAA;AAEzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AACjE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
@@ -1,41 +0,0 @@
1
- import { z } from 'zod';
2
- const parameterTypeSchema = z.enum(['path', 'query', 'header', 'cookie']);
3
- // not used but kept for consistency
4
- // export type ParamType = z.infer<typeof parameterTypeSchema>
5
- const parameterStyleSchema = z.enum([
6
- 'matrix',
7
- 'simple',
8
- 'form',
9
- 'label',
10
- 'spaceDelimited',
11
- 'pipeDelimited',
12
- 'deepObject',
13
- ]);
14
- /**
15
- * OpenAPI compliant parameters object
16
- */
17
- export const oasParameterSchema = z.object({
18
- in: parameterTypeSchema,
19
- name: z.string(),
20
- description: z.string().optional(),
21
- /** Defaulted to false */
22
- required: z.boolean().optional().default(false),
23
- /** Defaulted to false */
24
- deprecated: z.boolean().optional().default(false),
25
- schema: z.unknown().optional(),
26
- content: z.unknown().optional(),
27
- /** Defaulted according to @url https://spec.openapis.org/oas/v3.1.0#parameter-object */
28
- style: parameterStyleSchema.optional(),
29
- explode: z.boolean().optional(),
30
- example: z.unknown().optional(),
31
- examples: z
32
- .union([
33
- z.record(z.string(), z.object({
34
- value: z.unknown().optional(),
35
- summary: z.string().optional(),
36
- externalValue: z.string().optional(),
37
- })),
38
- z.array(z.unknown()),
39
- ])
40
- .optional(),
41
- });
@@ -1,380 +0,0 @@
1
- import { z } from 'zod';
2
- import type { RequestParameter } from './parameters.js';
3
- import type { Request } from './requests.js';
4
- import type { Server } from './server.js';
5
- /**
6
- * TODO: Deprecate this.
7
- *
8
- * The request schema should be stored in the request and any
9
- * parameters should be validated against that
10
- */
11
- export declare const requestExampleParametersSchema: z.ZodPipe<z.ZodObject<{
12
- key: z.ZodDefault<z.ZodString>;
13
- value: z.ZodDefault<z.ZodCoercedString<unknown>>;
14
- enabled: z.ZodDefault<z.ZodBoolean>;
15
- file: z.ZodOptional<z.ZodAny>;
16
- description: z.ZodOptional<z.ZodString>;
17
- required: z.ZodOptional<z.ZodBoolean>;
18
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
- examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
20
- type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
21
- format: z.ZodOptional<z.ZodString>;
22
- minimum: z.ZodOptional<z.ZodNumber>;
23
- maximum: z.ZodOptional<z.ZodNumber>;
24
- default: z.ZodOptional<z.ZodAny>;
25
- nullable: z.ZodOptional<z.ZodBoolean>;
26
- }, z.core.$strip>, z.ZodTransform<{
27
- key: string;
28
- value: string;
29
- enabled: boolean;
30
- file?: any;
31
- description?: string | undefined;
32
- required?: boolean | undefined;
33
- enum?: string[] | undefined;
34
- examples?: any[] | undefined;
35
- type?: string | string[] | undefined;
36
- format?: string | undefined;
37
- minimum?: number | undefined;
38
- maximum?: number | undefined;
39
- default?: any;
40
- nullable?: boolean | undefined;
41
- }, {
42
- key: string;
43
- value: string;
44
- enabled: boolean;
45
- file?: any;
46
- description?: string | undefined;
47
- required?: boolean | undefined;
48
- enum?: string[] | undefined;
49
- examples?: any[] | undefined;
50
- type?: string | string[] | undefined;
51
- format?: string | undefined;
52
- minimum?: number | undefined;
53
- maximum?: number | undefined;
54
- default?: any;
55
- nullable?: boolean | undefined;
56
- }>>;
57
- /** Convert the array of parameters to an object keyed by the parameter name */
58
- export declare const parameterArrayToObject: (params: RequestExampleParameter[]) => Record<string, string>;
59
- /** Request examples - formerly known as instances - are "children" of requests */
60
- export type RequestExampleParameter = z.infer<typeof requestExampleParametersSchema>;
61
- export declare const requestExampleSchema: z.ZodObject<{
62
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "example", "out">;
63
- type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"requestExample">>>;
64
- requestUid: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "operation", "out">>;
65
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
66
- body: z.ZodDefault<z.ZodOptional<z.ZodObject<{
67
- raw: z.ZodOptional<z.ZodObject<{
68
- encoding: z.ZodEnum<{
69
- xml: "xml";
70
- json: "json";
71
- html: "html";
72
- text: "text";
73
- javascript: "javascript";
74
- yaml: "yaml";
75
- edn: "edn";
76
- }>;
77
- value: z.ZodDefault<z.ZodString>;
78
- mimeType: z.ZodOptional<z.ZodString>;
79
- }, z.core.$strip>>;
80
- formData: z.ZodOptional<z.ZodObject<{
81
- encoding: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"form-data">, z.ZodLiteral<"urlencoded">]>>;
82
- value: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
83
- key: z.ZodDefault<z.ZodString>;
84
- value: z.ZodDefault<z.ZodCoercedString<unknown>>;
85
- enabled: z.ZodDefault<z.ZodBoolean>;
86
- file: z.ZodOptional<z.ZodAny>;
87
- description: z.ZodOptional<z.ZodString>;
88
- required: z.ZodOptional<z.ZodBoolean>;
89
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
- examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
91
- type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
92
- format: z.ZodOptional<z.ZodString>;
93
- minimum: z.ZodOptional<z.ZodNumber>;
94
- maximum: z.ZodOptional<z.ZodNumber>;
95
- default: z.ZodOptional<z.ZodAny>;
96
- nullable: z.ZodOptional<z.ZodBoolean>;
97
- }, z.core.$strip>, z.ZodTransform<{
98
- key: string;
99
- value: string;
100
- enabled: boolean;
101
- file?: any;
102
- description?: string | undefined;
103
- required?: boolean | undefined;
104
- enum?: string[] | undefined;
105
- examples?: any[] | undefined;
106
- type?: string | string[] | undefined;
107
- format?: string | undefined;
108
- minimum?: number | undefined;
109
- maximum?: number | undefined;
110
- default?: any;
111
- nullable?: boolean | undefined;
112
- }, {
113
- key: string;
114
- value: string;
115
- enabled: boolean;
116
- file?: any;
117
- description?: string | undefined;
118
- required?: boolean | undefined;
119
- enum?: string[] | undefined;
120
- examples?: any[] | undefined;
121
- type?: string | string[] | undefined;
122
- format?: string | undefined;
123
- minimum?: number | undefined;
124
- maximum?: number | undefined;
125
- default?: any;
126
- nullable?: boolean | undefined;
127
- }>>>>;
128
- }, z.core.$strip>>;
129
- binary: z.ZodOptional<z.ZodCustom<Blob, Blob>>;
130
- activeBody: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"raw">, z.ZodLiteral<"formData">, z.ZodLiteral<"binary">]>>;
131
- }, z.core.$strip>>>;
132
- parameters: z.ZodDefault<z.ZodOptional<z.ZodObject<{
133
- path: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
134
- key: z.ZodDefault<z.ZodString>;
135
- value: z.ZodDefault<z.ZodCoercedString<unknown>>;
136
- enabled: z.ZodDefault<z.ZodBoolean>;
137
- file: z.ZodOptional<z.ZodAny>;
138
- description: z.ZodOptional<z.ZodString>;
139
- required: z.ZodOptional<z.ZodBoolean>;
140
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
141
- examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
142
- type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
143
- format: z.ZodOptional<z.ZodString>;
144
- minimum: z.ZodOptional<z.ZodNumber>;
145
- maximum: z.ZodOptional<z.ZodNumber>;
146
- default: z.ZodOptional<z.ZodAny>;
147
- nullable: z.ZodOptional<z.ZodBoolean>;
148
- }, z.core.$strip>, z.ZodTransform<{
149
- key: string;
150
- value: string;
151
- enabled: boolean;
152
- file?: any;
153
- description?: string | undefined;
154
- required?: boolean | undefined;
155
- enum?: string[] | undefined;
156
- examples?: any[] | undefined;
157
- type?: string | string[] | undefined;
158
- format?: string | undefined;
159
- minimum?: number | undefined;
160
- maximum?: number | undefined;
161
- default?: any;
162
- nullable?: boolean | undefined;
163
- }, {
164
- key: string;
165
- value: string;
166
- enabled: boolean;
167
- file?: any;
168
- description?: string | undefined;
169
- required?: boolean | undefined;
170
- enum?: string[] | undefined;
171
- examples?: any[] | undefined;
172
- type?: string | string[] | undefined;
173
- format?: string | undefined;
174
- minimum?: number | undefined;
175
- maximum?: number | undefined;
176
- default?: any;
177
- nullable?: boolean | undefined;
178
- }>>>>;
179
- query: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
180
- key: z.ZodDefault<z.ZodString>;
181
- value: z.ZodDefault<z.ZodCoercedString<unknown>>;
182
- enabled: z.ZodDefault<z.ZodBoolean>;
183
- file: z.ZodOptional<z.ZodAny>;
184
- description: z.ZodOptional<z.ZodString>;
185
- required: z.ZodOptional<z.ZodBoolean>;
186
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
187
- examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
188
- type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
189
- format: z.ZodOptional<z.ZodString>;
190
- minimum: z.ZodOptional<z.ZodNumber>;
191
- maximum: z.ZodOptional<z.ZodNumber>;
192
- default: z.ZodOptional<z.ZodAny>;
193
- nullable: z.ZodOptional<z.ZodBoolean>;
194
- }, z.core.$strip>, z.ZodTransform<{
195
- key: string;
196
- value: string;
197
- enabled: boolean;
198
- file?: any;
199
- description?: string | undefined;
200
- required?: boolean | undefined;
201
- enum?: string[] | undefined;
202
- examples?: any[] | undefined;
203
- type?: string | string[] | undefined;
204
- format?: string | undefined;
205
- minimum?: number | undefined;
206
- maximum?: number | undefined;
207
- default?: any;
208
- nullable?: boolean | undefined;
209
- }, {
210
- key: string;
211
- value: string;
212
- enabled: boolean;
213
- file?: any;
214
- description?: string | undefined;
215
- required?: boolean | undefined;
216
- enum?: string[] | undefined;
217
- examples?: any[] | undefined;
218
- type?: string | string[] | undefined;
219
- format?: string | undefined;
220
- minimum?: number | undefined;
221
- maximum?: number | undefined;
222
- default?: any;
223
- nullable?: boolean | undefined;
224
- }>>>>;
225
- headers: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
226
- key: z.ZodDefault<z.ZodString>;
227
- value: z.ZodDefault<z.ZodCoercedString<unknown>>;
228
- enabled: z.ZodDefault<z.ZodBoolean>;
229
- file: z.ZodOptional<z.ZodAny>;
230
- description: z.ZodOptional<z.ZodString>;
231
- required: z.ZodOptional<z.ZodBoolean>;
232
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
233
- examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
234
- type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
235
- format: z.ZodOptional<z.ZodString>;
236
- minimum: z.ZodOptional<z.ZodNumber>;
237
- maximum: z.ZodOptional<z.ZodNumber>;
238
- default: z.ZodOptional<z.ZodAny>;
239
- nullable: z.ZodOptional<z.ZodBoolean>;
240
- }, z.core.$strip>, z.ZodTransform<{
241
- key: string;
242
- value: string;
243
- enabled: boolean;
244
- file?: any;
245
- description?: string | undefined;
246
- required?: boolean | undefined;
247
- enum?: string[] | undefined;
248
- examples?: any[] | undefined;
249
- type?: string | string[] | undefined;
250
- format?: string | undefined;
251
- minimum?: number | undefined;
252
- maximum?: number | undefined;
253
- default?: any;
254
- nullable?: boolean | undefined;
255
- }, {
256
- key: string;
257
- value: string;
258
- enabled: boolean;
259
- file?: any;
260
- description?: string | undefined;
261
- required?: boolean | undefined;
262
- enum?: string[] | undefined;
263
- examples?: any[] | undefined;
264
- type?: string | string[] | undefined;
265
- format?: string | undefined;
266
- minimum?: number | undefined;
267
- maximum?: number | undefined;
268
- default?: any;
269
- nullable?: boolean | undefined;
270
- }>>>>;
271
- cookies: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
272
- key: z.ZodDefault<z.ZodString>;
273
- value: z.ZodDefault<z.ZodCoercedString<unknown>>;
274
- enabled: z.ZodDefault<z.ZodBoolean>;
275
- file: z.ZodOptional<z.ZodAny>;
276
- description: z.ZodOptional<z.ZodString>;
277
- required: z.ZodOptional<z.ZodBoolean>;
278
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
279
- examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
280
- type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
281
- format: z.ZodOptional<z.ZodString>;
282
- minimum: z.ZodOptional<z.ZodNumber>;
283
- maximum: z.ZodOptional<z.ZodNumber>;
284
- default: z.ZodOptional<z.ZodAny>;
285
- nullable: z.ZodOptional<z.ZodBoolean>;
286
- }, z.core.$strip>, z.ZodTransform<{
287
- key: string;
288
- value: string;
289
- enabled: boolean;
290
- file?: any;
291
- description?: string | undefined;
292
- required?: boolean | undefined;
293
- enum?: string[] | undefined;
294
- examples?: any[] | undefined;
295
- type?: string | string[] | undefined;
296
- format?: string | undefined;
297
- minimum?: number | undefined;
298
- maximum?: number | undefined;
299
- default?: any;
300
- nullable?: boolean | undefined;
301
- }, {
302
- key: string;
303
- value: string;
304
- enabled: boolean;
305
- file?: any;
306
- description?: string | undefined;
307
- required?: boolean | undefined;
308
- enum?: string[] | undefined;
309
- examples?: any[] | undefined;
310
- type?: string | string[] | undefined;
311
- format?: string | undefined;
312
- minimum?: number | undefined;
313
- maximum?: number | undefined;
314
- default?: any;
315
- nullable?: boolean | undefined;
316
- }>>>>;
317
- }, z.core.$strip>>>;
318
- serverVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
319
- }, z.core.$strip>;
320
- export type RequestExample = z.infer<typeof requestExampleSchema>;
321
- /** Schema for the OAS serialization of request examples */
322
- export declare const xScalarExampleSchema: z.ZodObject<{
323
- name: z.ZodOptional<z.ZodString>;
324
- body: z.ZodOptional<z.ZodObject<{
325
- encoding: z.ZodEnum<{
326
- binary: "binary";
327
- "application/json": "application/json";
328
- "text/plain": "text/plain";
329
- "text/html": "text/html";
330
- "application/javascript": "application/javascript";
331
- "application/xml": "application/xml";
332
- "application/yaml": "application/yaml";
333
- "application/edn": "application/edn";
334
- "application/octet-stream": "application/octet-stream";
335
- "application/x-www-form-urlencoded": "application/x-www-form-urlencoded";
336
- "multipart/form-data": "multipart/form-data";
337
- }>;
338
- content: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodString]>;
339
- file: z.ZodOptional<z.ZodNullable<z.ZodObject<{
340
- url: z.ZodString;
341
- base64: z.ZodOptional<z.ZodString>;
342
- }, z.core.$strip>>>;
343
- }, z.core.$strip>>;
344
- parameters: z.ZodObject<{
345
- path: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
346
- query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
347
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
348
- cookies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
349
- }, z.core.$strip>;
350
- }, z.core.$strip>;
351
- /**
352
- * Convert a request example to the xScalar serialized format
353
- *
354
- * TODO: The base format should be migrated to align MUCH closer to the serialized format
355
- */
356
- export declare function convertExampleToXScalar(example: RequestExample): {
357
- parameters: {
358
- path?: Record<string, string> | undefined;
359
- query?: Record<string, string> | undefined;
360
- headers?: Record<string, string> | undefined;
361
- cookies?: Record<string, string> | undefined;
362
- };
363
- name?: string | undefined;
364
- body?: {
365
- encoding: "binary" | "application/json" | "text/plain" | "text/html" | "application/javascript" | "application/xml" | "application/yaml" | "application/edn" | "application/octet-stream" | "application/x-www-form-urlencoded" | "multipart/form-data";
366
- content: string | Record<string, any>;
367
- file?: {
368
- url: string;
369
- base64?: string | undefined;
370
- } | null | undefined;
371
- } | undefined;
372
- };
373
- /** Create new instance parameter from a request parameter */
374
- export declare function createParamInstance(param: RequestParameter): RequestExampleParameter;
375
- /**
376
- * Create new request example from a request
377
- * Iterates the name of the example if provided
378
- */
379
- export declare function createExampleFromRequest(request: Request, name: string, server?: Server): RequestExample;
380
- //# sourceMappingURL=request-examples.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/request-examples.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAKtC;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCvC,CAAA;AAEJ,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,GAAI,QAAQ,uBAAuB,EAAE,2BAIhE,CAAA;AAER,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAoHpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsB/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAKjE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU/B,CAAA;AAIF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;EAqD9D;AAKD,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,uBAAuB,CAsHpF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CA2HxG"}