@scalar/oas-utils 0.11.0 → 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 +13 -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 +8 -62
  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,95 +0,0 @@
1
- import { oasSecurityRequirementSchema } from '@scalar/types/entities';
2
- import { nanoidSchema } from '@scalar/types/utils';
3
- import { z } from 'zod';
4
- import { selectedSecuritySchemeUidSchema } from '../../entities/shared/utility.js';
5
- import { xScalarEnvironmentsSchema } from '../../entities/spec/x-scalar-environments.js';
6
- import { xScalarSecretsSchema } from '../../entities/spec/x-scalar-secrets.js';
7
- import { oasExternalDocumentationSchema, oasInfoSchema } from './spec-objects.js';
8
- const oasCollectionSchema = z.object({
9
- /**
10
- * @deprecated
11
- * Needs to be remove as it is not a spec property
12
- */
13
- 'type': z.literal('collection').optional().default('collection'),
14
- 'openapi': z
15
- .union([z.string(), z.literal('3.0.0'), z.literal('3.1.0'), z.literal('4.0.0')])
16
- .optional()
17
- .default('3.1.0'),
18
- 'jsonSchemaDialect': z.string().optional(),
19
- 'info': oasInfoSchema.catch({
20
- title: 'API',
21
- version: '1.0',
22
- }),
23
- /**
24
- * A declaration of which security mechanisms can be used across the API. The list of
25
- * values includes alternative security requirement objects that can be used. Only
26
- * one of the security requirement objects need to be satisfied to authorize a request.
27
- * Individual operations can override this definition. To make security optional, an empty
28
- * security requirement ({}) can be included in the array.
29
- */
30
- 'security': z.array(oasSecurityRequirementSchema).optional().default([]),
31
- 'externalDocs': oasExternalDocumentationSchema.optional().catch(undefined),
32
- /** TODO: Type these */
33
- 'components': z.record(z.string(), z.unknown()).optional(),
34
- /** TODO: Type these */
35
- 'webhooks': z.record(z.string(), z.unknown()).optional(),
36
- /** A custom icon representing the collection */
37
- 'x-scalar-icon': z.string().optional().default('interface-content-folder'),
38
- 'x-scalar-active-environment': z.string().optional(),
39
- 'x-scalar-environments': xScalarEnvironmentsSchema.optional(),
40
- 'x-scalar-secrets': xScalarSecretsSchema.optional(),
41
- // These properties will be stripped out and mapped back as id lists
42
- // servers
43
- // paths/**
44
- // servers
45
- // tags
46
- // security
47
- });
48
- const extendedCollectionSchema = z.object({
49
- uid: nanoidSchema.brand(),
50
- /** A list of security schemes UIDs associated with the collection */
51
- securitySchemes: z.string().array().default([]),
52
- /** List of currently selected security scheme UIDs, these can be overridden per request */
53
- selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
54
- /** The currently selected server */
55
- selectedServerUid: z.string().brand().optional(),
56
- /** UIDs which refer to servers on the workspace base */
57
- servers: z.string().brand().array().default([]),
58
- /** Request UIDs associated with a collection */
59
- requests: z.string().brand().array().default([]),
60
- /** Tag UIDs associated with the collection */
61
- tags: z.string().brand().array().default([]),
62
- /** List of requests without tags and top level tag "folders" */
63
- children: z
64
- .union([z.string().brand(), z.string().brand()])
65
- .array()
66
- .default([]),
67
- /**
68
- * A link to where this document is stored
69
- *
70
- * - Used for watch mode
71
- * - Possibly useful for Git sync down the line
72
- */
73
- documentUrl: z.string().optional(),
74
- /**
75
- * Enables polling of OpenAPI document urls
76
- *
77
- * @remarks Only effective when `documentUrl` is set
78
- */
79
- watchMode: z.boolean().optional().default(false),
80
- /** Keeps track of which integration is associated with the specific collection */
81
- integration: z.string().nullable().optional(),
82
- /**
83
- * Selected authentication will be set at the collection level instead of the request level
84
- *
85
- * @default false
86
- */
87
- useCollectionSecurity: z.boolean().optional().default(false),
88
- /**
89
- * Status of the watcher from above
90
- *
91
- * @defaults to idle for all collections, doesn't mean that it can watch for changes
92
- */
93
- watchModeStatus: z.enum(['IDLE', 'WATCHING', 'ERROR']).optional().default('IDLE'),
94
- });
95
- export const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
@@ -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
- });