@scalar/oas-utils 0.10.8 → 0.10.9

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 (129) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/entities/cookie/cookie.js +11 -15
  3. package/dist/entities/cookie/index.js +1 -5
  4. package/dist/entities/environment/environment.js +7 -11
  5. package/dist/entities/environment/index.js +1 -5
  6. package/dist/entities/hotkeys/hotkeys.js +116 -111
  7. package/dist/entities/hotkeys/index.js +1 -6
  8. package/dist/entities/shared/index.js +1 -7
  9. package/dist/entities/shared/utility.js +9 -9
  10. package/dist/entities/spec/collection.js +91 -89
  11. package/dist/entities/spec/index.js +10 -59
  12. package/dist/entities/spec/operation.js +6 -6
  13. package/dist/entities/spec/parameters.js +38 -38
  14. package/dist/entities/spec/request-examples.js +421 -331
  15. package/dist/entities/spec/requests.js +102 -84
  16. package/dist/entities/spec/server.js +61 -46
  17. package/dist/entities/spec/spec-objects.js +121 -76
  18. package/dist/entities/spec/x-scalar-environments.js +18 -20
  19. package/dist/entities/spec/x-scalar-secrets.js +6 -8
  20. package/dist/entities/workspace/index.js +1 -7
  21. package/dist/entities/workspace/workspace.js +47 -46
  22. package/dist/helpers/client-plugins.js +13 -13
  23. package/dist/helpers/fetch-document.js +30 -25
  24. package/dist/helpers/fetch-with-proxy-fallback.js +26 -21
  25. package/dist/helpers/index.d.ts +1 -2
  26. package/dist/helpers/index.d.ts.map +1 -1
  27. package/dist/helpers/index.js +80 -119
  28. package/dist/helpers/normalize-mime-type-object.js +19 -18
  29. package/dist/helpers/normalize-mime-type.js +11 -9
  30. package/dist/helpers/operation-stability.js +25 -20
  31. package/dist/helpers/parse.d.ts +0 -4
  32. package/dist/helpers/parse.d.ts.map +1 -1
  33. package/dist/helpers/parse.js +77 -77
  34. package/dist/helpers/schema-model.js +13 -16
  35. package/dist/helpers/security/get-schemes.js +7 -8
  36. package/dist/helpers/security/has-token.js +18 -19
  37. package/dist/helpers/security/index.js +2 -7
  38. package/dist/helpers/servers.js +128 -79
  39. package/dist/helpers/should-ignore-entity.js +4 -5
  40. package/dist/migrations/data-version.js +15 -7
  41. package/dist/migrations/generate-types.js +34 -37
  42. package/dist/migrations/index.js +4 -18
  43. package/dist/migrations/local-storage.js +31 -29
  44. package/dist/migrations/migrate-to-indexdb.js +706 -529
  45. package/dist/migrations/migrator.js +58 -54
  46. package/dist/migrations/semver.js +24 -24
  47. package/dist/migrations/v-0.0.0/types.generated.js +1 -1
  48. package/dist/migrations/v-2.1.0/migration.js +272 -258
  49. package/dist/migrations/v-2.1.0/types.generated.js +1 -1
  50. package/dist/migrations/v-2.2.0/migration.js +99 -96
  51. package/dist/migrations/v-2.2.0/types.generated.js +1 -1
  52. package/dist/migrations/v-2.3.0/migration.js +45 -48
  53. package/dist/migrations/v-2.3.0/types.generated.js +1 -1
  54. package/dist/migrations/v-2.4.0/migration.js +25 -25
  55. package/dist/migrations/v-2.4.0/types.generated.js +1 -1
  56. package/dist/migrations/v-2.5.0/migration.js +122 -139
  57. package/dist/migrations/v-2.5.0/types.generated.js +1 -1
  58. package/dist/spec-getters/get-example-from-schema.js +489 -385
  59. package/dist/spec-getters/get-parameters-from-operation.js +39 -23
  60. package/dist/spec-getters/get-request-body-from-operation.d.ts.map +1 -1
  61. package/dist/spec-getters/get-request-body-from-operation.js +168 -126
  62. package/dist/spec-getters/get-server-variable-examples.js +10 -13
  63. package/dist/spec-getters/index.js +4 -11
  64. package/dist/transforms/import-spec.js +381 -291
  65. package/dist/transforms/index.js +1 -11
  66. package/package.json +15 -19
  67. package/dist/entities/cookie/cookie.js.map +0 -7
  68. package/dist/entities/cookie/index.js.map +0 -7
  69. package/dist/entities/environment/environment.js.map +0 -7
  70. package/dist/entities/environment/index.js.map +0 -7
  71. package/dist/entities/hotkeys/hotkeys.js.map +0 -7
  72. package/dist/entities/hotkeys/index.js.map +0 -7
  73. package/dist/entities/shared/index.js.map +0 -7
  74. package/dist/entities/shared/utility.js.map +0 -7
  75. package/dist/entities/spec/collection.js.map +0 -7
  76. package/dist/entities/spec/index.js.map +0 -7
  77. package/dist/entities/spec/operation.js.map +0 -7
  78. package/dist/entities/spec/parameters.js.map +0 -7
  79. package/dist/entities/spec/request-examples.js.map +0 -7
  80. package/dist/entities/spec/requests.js.map +0 -7
  81. package/dist/entities/spec/server.js.map +0 -7
  82. package/dist/entities/spec/spec-objects.js.map +0 -7
  83. package/dist/entities/spec/x-scalar-environments.js.map +0 -7
  84. package/dist/entities/spec/x-scalar-secrets.js.map +0 -7
  85. package/dist/entities/workspace/index.js.map +0 -7
  86. package/dist/entities/workspace/workspace.js.map +0 -7
  87. package/dist/helpers/client-plugins.js.map +0 -7
  88. package/dist/helpers/fetch-document.js.map +0 -7
  89. package/dist/helpers/fetch-with-proxy-fallback.js.map +0 -7
  90. package/dist/helpers/index.js.map +0 -7
  91. package/dist/helpers/normalize-mime-type-object.js.map +0 -7
  92. package/dist/helpers/normalize-mime-type.js.map +0 -7
  93. package/dist/helpers/operation-stability.js.map +0 -7
  94. package/dist/helpers/parse.js.map +0 -7
  95. package/dist/helpers/pretty-print-json.d.ts +0 -9
  96. package/dist/helpers/pretty-print-json.d.ts.map +0 -1
  97. package/dist/helpers/pretty-print-json.js +0 -38
  98. package/dist/helpers/pretty-print-json.js.map +0 -7
  99. package/dist/helpers/schema-model.js.map +0 -7
  100. package/dist/helpers/security/get-schemes.js.map +0 -7
  101. package/dist/helpers/security/has-token.js.map +0 -7
  102. package/dist/helpers/security/index.js.map +0 -7
  103. package/dist/helpers/servers.js.map +0 -7
  104. package/dist/helpers/should-ignore-entity.js.map +0 -7
  105. package/dist/migrations/data-version.js.map +0 -7
  106. package/dist/migrations/generate-types.js.map +0 -7
  107. package/dist/migrations/index.js.map +0 -7
  108. package/dist/migrations/local-storage.js.map +0 -7
  109. package/dist/migrations/migrate-to-indexdb.js.map +0 -7
  110. package/dist/migrations/migrator.js.map +0 -7
  111. package/dist/migrations/semver.js.map +0 -7
  112. package/dist/migrations/v-0.0.0/types.generated.js.map +0 -7
  113. package/dist/migrations/v-2.1.0/migration.js.map +0 -7
  114. package/dist/migrations/v-2.1.0/types.generated.js.map +0 -7
  115. package/dist/migrations/v-2.2.0/migration.js.map +0 -7
  116. package/dist/migrations/v-2.2.0/types.generated.js.map +0 -7
  117. package/dist/migrations/v-2.3.0/migration.js.map +0 -7
  118. package/dist/migrations/v-2.3.0/types.generated.js.map +0 -7
  119. package/dist/migrations/v-2.4.0/migration.js.map +0 -7
  120. package/dist/migrations/v-2.4.0/types.generated.js.map +0 -7
  121. package/dist/migrations/v-2.5.0/migration.js.map +0 -7
  122. package/dist/migrations/v-2.5.0/types.generated.js.map +0 -7
  123. package/dist/spec-getters/get-example-from-schema.js.map +0 -7
  124. package/dist/spec-getters/get-parameters-from-operation.js.map +0 -7
  125. package/dist/spec-getters/get-request-body-from-operation.js.map +0 -7
  126. package/dist/spec-getters/get-server-variable-examples.js.map +0 -7
  127. package/dist/spec-getters/index.js.map +0 -7
  128. package/dist/transforms/import-spec.js.map +0 -7
  129. package/dist/transforms/index.js.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.10.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#8466](https://github.com/scalar/scalar/pull/8466): chore: new build pipeline
8
+
3
9
  ## 0.10.8
4
10
 
5
11
  ### Patch Changes
@@ -1,16 +1,12 @@
1
- import { z } from "zod";
2
- import { nanoidSchema } from "@scalar/types/utils";
3
- const cookieSchema = z.object({
4
- uid: nanoidSchema.brand(),
5
- /** Defines the cookie name and its value. A cookie definition begins with a name-value pair. */
6
- name: z.string().default(""),
7
- value: z.string().default(""),
8
- /** Defines the host to which the cookie will be sent. */
9
- domain: z.string().optional(),
10
- /** Indicates the path that must exist in the requested URL for the browser to send the Cookie header. */
11
- path: z.string().optional()
1
+ import { z } from 'zod';
2
+ import { nanoidSchema } from '@scalar/types/utils';
3
+ export const cookieSchema = z.object({
4
+ uid: nanoidSchema.brand(),
5
+ /** Defines the cookie name and its value. A cookie definition begins with a name-value pair. */
6
+ name: z.string().default(''),
7
+ value: z.string().default(''),
8
+ /** Defines the host to which the cookie will be sent. */
9
+ domain: z.string().optional(),
10
+ /** Indicates the path that must exist in the requested URL for the browser to send the Cookie header. */
11
+ path: z.string().optional(),
12
12
  });
13
- export {
14
- cookieSchema
15
- };
16
- //# sourceMappingURL=cookie.js.map
@@ -1,5 +1 @@
1
- import { cookieSchema } from "./cookie.js";
2
- export {
3
- cookieSchema
4
- };
5
- //# sourceMappingURL=index.js.map
1
+ export { cookieSchema } from './cookie.js';
@@ -1,12 +1,8 @@
1
- import { z } from "zod";
2
- const environmentSchema = z.object({
3
- uid: z.string().brand(),
4
- name: z.string().optional().default("Default Environment"),
5
- color: z.string().optional().default("#FFFFFF"),
6
- value: z.string().default(""),
7
- isDefault: z.boolean().optional()
1
+ import { z } from 'zod';
2
+ export const environmentSchema = z.object({
3
+ uid: z.string().brand(),
4
+ name: z.string().optional().default('Default Environment'),
5
+ color: z.string().optional().default('#FFFFFF'),
6
+ value: z.string().default(''),
7
+ isDefault: z.boolean().optional(),
8
8
  });
9
- export {
10
- environmentSchema
11
- };
12
- //# sourceMappingURL=environment.js.map
@@ -1,5 +1 @@
1
- import { environmentSchema } from "./environment.js";
2
- export {
3
- environmentSchema
4
- };
5
- //# sourceMappingURL=index.js.map
1
+ export { environmentSchema } from './environment.js';
@@ -1,113 +1,118 @@
1
- const HOTKEY_EVENT_NAMES = [
2
- "addTopNav",
3
- "closeModal",
4
- "closeTopNav",
5
- "createNew",
6
- "executeRequest",
7
- "focusAddressBar",
8
- "focusRequestSearch",
9
- "jumpToLastTab",
10
- "jumpToTab",
11
- "navigateSearchResultsDown",
12
- "navigateSearchResultsUp",
13
- "navigateTopNavLeft",
14
- "navigateTopNavRight",
15
- "openCommandPalette",
16
- "selectSearchResult",
17
- "toggleSidebar"
1
+ /**
2
+ * Array of all of the events that we support
3
+ */
4
+ export const HOTKEY_EVENT_NAMES = [
5
+ 'addTopNav',
6
+ 'closeModal',
7
+ 'closeTopNav',
8
+ 'createNew',
9
+ 'executeRequest',
10
+ 'focusAddressBar',
11
+ 'focusRequestSearch',
12
+ 'jumpToLastTab',
13
+ 'jumpToTab',
14
+ 'navigateSearchResultsDown',
15
+ 'navigateSearchResultsUp',
16
+ 'navigateTopNavLeft',
17
+ 'navigateTopNavRight',
18
+ 'openCommandPalette',
19
+ 'selectSearchResult',
20
+ 'toggleSidebar',
18
21
  ];
19
- const KEYDOWN_KEYS = [
20
- "Space",
21
- "Backspace",
22
- "Tab",
23
- "Enter",
24
- "Escape",
25
- "ArrowDown",
26
- "ArrowLeft",
27
- "ArrowRight",
28
- "ArrowUp",
29
- "End",
30
- "Home",
31
- "PageDown",
32
- "PageUp",
33
- "Delete",
34
- "0",
35
- "1",
36
- "2",
37
- "3",
38
- "4",
39
- "5",
40
- "6",
41
- "7",
42
- "8",
43
- "9",
44
- "a",
45
- "b",
46
- "c",
47
- "d",
48
- "e",
49
- "f",
50
- "g",
51
- "h",
52
- "i",
53
- "j",
54
- "k",
55
- "l",
56
- "m",
57
- "n",
58
- "o",
59
- "p",
60
- "q",
61
- "r",
62
- "s",
63
- "t",
64
- "u",
65
- "v",
66
- "w",
67
- "x",
68
- "y",
69
- "z",
70
- "0",
71
- "1",
72
- "2",
73
- "3",
74
- "4",
75
- "5",
76
- "6",
77
- "7",
78
- "8",
79
- "9",
80
- "*",
81
- "+",
82
- "-",
83
- ".",
84
- "/",
85
- "F1",
86
- "F2",
87
- "F3",
88
- "F4",
89
- "F5",
90
- "F6",
91
- "F7",
92
- "F8",
93
- "F9",
94
- "F10",
95
- "F11",
96
- "F12",
97
- ";",
98
- "=",
99
- ",",
100
- "-",
101
- ".",
102
- "/",
103
- "`",
104
- "[",
105
- "\\",
106
- "]",
107
- ""
22
+ /**
23
+ * Array of all of the hotkeys that we support
24
+ *
25
+ * Space is a special case because its actually ' ' but we name it space here and will handle it separately
26
+ * If you need more
27
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
28
+ */
29
+ export const KEYDOWN_KEYS = [
30
+ 'Space',
31
+ 'Backspace',
32
+ 'Tab',
33
+ 'Enter',
34
+ 'Escape',
35
+ 'ArrowDown',
36
+ 'ArrowLeft',
37
+ 'ArrowRight',
38
+ 'ArrowUp',
39
+ 'End',
40
+ 'Home',
41
+ 'PageDown',
42
+ 'PageUp',
43
+ 'Delete',
44
+ '0',
45
+ '1',
46
+ '2',
47
+ '3',
48
+ '4',
49
+ '5',
50
+ '6',
51
+ '7',
52
+ '8',
53
+ '9',
54
+ 'a',
55
+ 'b',
56
+ 'c',
57
+ 'd',
58
+ 'e',
59
+ 'f',
60
+ 'g',
61
+ 'h',
62
+ 'i',
63
+ 'j',
64
+ 'k',
65
+ 'l',
66
+ 'm',
67
+ 'n',
68
+ 'o',
69
+ 'p',
70
+ 'q',
71
+ 'r',
72
+ 's',
73
+ 't',
74
+ 'u',
75
+ 'v',
76
+ 'w',
77
+ 'x',
78
+ 'y',
79
+ 'z',
80
+ '0',
81
+ '1',
82
+ '2',
83
+ '3',
84
+ '4',
85
+ '5',
86
+ '6',
87
+ '7',
88
+ '8',
89
+ '9',
90
+ '*',
91
+ '+',
92
+ '-',
93
+ '.',
94
+ '/',
95
+ 'F1',
96
+ 'F2',
97
+ 'F3',
98
+ 'F4',
99
+ 'F5',
100
+ 'F6',
101
+ 'F7',
102
+ 'F8',
103
+ 'F9',
104
+ 'F10',
105
+ 'F11',
106
+ 'F12',
107
+ ';',
108
+ '=',
109
+ ',',
110
+ '-',
111
+ '.',
112
+ '/',
113
+ '`',
114
+ '[',
115
+ '\\',
116
+ ']',
117
+ '',
108
118
  ];
109
- export {
110
- HOTKEY_EVENT_NAMES,
111
- KEYDOWN_KEYS
112
- };
113
- //# sourceMappingURL=hotkeys.js.map
@@ -1,6 +1 @@
1
- import { HOTKEY_EVENT_NAMES, KEYDOWN_KEYS } from "./hotkeys.js";
2
- export {
3
- HOTKEY_EVENT_NAMES,
4
- KEYDOWN_KEYS
5
- };
6
- //# sourceMappingURL=index.js.map
1
+ export { HOTKEY_EVENT_NAMES, KEYDOWN_KEYS } from './hotkeys.js';
@@ -1,7 +1 @@
1
- import {
2
- selectedSecuritySchemeUidSchema
3
- } from "./utility.js";
4
- export {
5
- selectedSecuritySchemeUidSchema
6
- };
7
- //# sourceMappingURL=index.js.map
1
+ export { selectedSecuritySchemeUidSchema, } from './utility.js';
@@ -1,9 +1,9 @@
1
- import { z } from "zod";
2
- const selectedSecuritySchemeUidSchema = z.union([
3
- z.string().brand(),
4
- z.string().brand().array()
5
- ]).array().default([]);
6
- export {
7
- selectedSecuritySchemeUidSchema
8
- };
9
- //# sourceMappingURL=utility.js.map
1
+ import { z } from 'zod';
2
+ /** Schema for selectedSecuritySchemeUids */
3
+ export const selectedSecuritySchemeUidSchema = z
4
+ .union([
5
+ z.string().brand(),
6
+ z.string().brand().array(),
7
+ ])
8
+ .array()
9
+ .default([]);
@@ -1,93 +1,95 @@
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";
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
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.union([z.string(), z.literal("3.0.0"), z.literal("3.1.0"), z.literal("4.0.0")]).optional().default("3.1.0"),
15
- "jsonSchemaDialect": z.string().optional(),
16
- "info": oasInfoSchema.catch({
17
- title: "API",
18
- version: "1.0"
19
- }),
20
- /**
21
- * A declaration of which security mechanisms can be used across the API. The list of
22
- * values includes alternative security requirement objects that can be used. Only
23
- * one of the security requirement objects need to be satisfied to authorize a request.
24
- * Individual operations can override this definition. To make security optional, an empty
25
- * security requirement ({}) can be included in the array.
26
- */
27
- "security": z.array(oasSecurityRequirementSchema).optional().default([]),
28
- "externalDocs": oasExternalDocumentationSchema.optional().catch(void 0),
29
- /** TODO: Type these */
30
- "components": z.record(z.string(), z.unknown()).optional(),
31
- /** TODO: Type these */
32
- "webhooks": z.record(z.string(), z.unknown()).optional(),
33
- /** A custom icon representing the collection */
34
- "x-scalar-icon": z.string().optional().default("interface-content-folder"),
35
- "x-scalar-active-environment": z.string().optional(),
36
- "x-scalar-environments": xScalarEnvironmentsSchema.optional(),
37
- "x-scalar-secrets": xScalarSecretsSchema.optional()
38
- // These properties will be stripped out and mapped back as id lists
39
- // servers
40
- // paths/**
41
- // servers
42
- // tags
43
- // security
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
44
47
  });
45
48
  const extendedCollectionSchema = z.object({
46
- uid: nanoidSchema.brand(),
47
- /** A list of security schemes UIDs associated with the collection */
48
- securitySchemes: z.string().array().default([]),
49
- /** List of currently selected security scheme UIDs, these can be overridden per request */
50
- selectedSecuritySchemeUids: selectedSecuritySchemeUidSchema,
51
- /** The currently selected server */
52
- selectedServerUid: z.string().brand().optional(),
53
- /** UIDs which refer to servers on the workspace base */
54
- servers: z.string().brand().array().default([]),
55
- /** Request UIDs associated with a collection */
56
- requests: z.string().brand().array().default([]),
57
- /** Tag UIDs associated with the collection */
58
- tags: z.string().brand().array().default([]),
59
- /** List of requests without tags and top level tag "folders" */
60
- children: z.union([z.string().brand(), z.string().brand()]).array().default([]),
61
- /**
62
- * A link to where this document is stored
63
- *
64
- * - Used for watch mode
65
- * - Possibly useful for Git sync down the line
66
- */
67
- documentUrl: z.string().optional(),
68
- /**
69
- * Enables polling of OpenAPI document urls
70
- *
71
- * @remarks Only effective when `documentUrl` is set
72
- */
73
- watchMode: z.boolean().optional().default(false),
74
- /** Keeps track of which integration is associated with the specific collection */
75
- integration: z.string().nullable().optional(),
76
- /**
77
- * Selected authentication will be set at the collection level instead of the request level
78
- *
79
- * @default false
80
- */
81
- useCollectionSecurity: z.boolean().optional().default(false),
82
- /**
83
- * Status of the watcher from above
84
- *
85
- * @defaults to idle for all collections, doesn't mean that it can watch for changes
86
- */
87
- watchModeStatus: z.enum(["IDLE", "WATCHING", "ERROR"]).optional().default("IDLE")
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'),
88
94
  });
89
- const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
90
- export {
91
- collectionSchema
92
- };
93
- //# sourceMappingURL=collection.js.map
95
+ export const collectionSchema = oasCollectionSchema.merge(extendedCollectionSchema);
@@ -1,59 +1,10 @@
1
- import {
2
- oasSecurityRequirementSchema,
3
- oasSecuritySchemeSchema,
4
- pkceOptions,
5
- securityApiKeySchema,
6
- securityHttpSchema,
7
- securityOauthSchema,
8
- securityOpenIdSchema,
9
- securitySchemeSchema
10
- } from "@scalar/types/entities";
11
- import { collectionSchema } from "./collection.js";
12
- import {
13
- operationSchema
14
- } from "./operation.js";
15
- import { oasParameterSchema } from "./parameters.js";
16
- import {
17
- createExampleFromRequest,
18
- requestExampleParametersSchema,
19
- requestExampleSchema
20
- } from "./request-examples.js";
21
- import {
22
- requestSchema
23
- } from "./requests.js";
24
- import { serverSchema } from "./server.js";
25
- import {
26
- oasContactSchema,
27
- oasExternalDocumentationSchema,
28
- oasInfoSchema,
29
- oasLicenseSchema,
30
- tagSchema
31
- } from "./spec-objects.js";
32
- import {
33
- xScalarEnvironmentsSchema
34
- } from "./x-scalar-environments.js";
35
- export {
36
- collectionSchema,
37
- createExampleFromRequest,
38
- oasContactSchema,
39
- oasExternalDocumentationSchema,
40
- oasInfoSchema,
41
- oasLicenseSchema,
42
- oasParameterSchema,
43
- oasSecurityRequirementSchema,
44
- oasSecuritySchemeSchema,
45
- operationSchema,
46
- pkceOptions,
47
- requestExampleParametersSchema,
48
- requestExampleSchema,
49
- requestSchema,
50
- securityApiKeySchema,
51
- securityHttpSchema,
52
- securityOauthSchema,
53
- securityOpenIdSchema,
54
- securitySchemeSchema,
55
- serverSchema,
56
- tagSchema,
57
- xScalarEnvironmentsSchema
58
- };
59
- //# sourceMappingURL=index.js.map
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,6 +1,6 @@
1
- import { requestSchema } from "./requests.js";
2
- const operationSchema = requestSchema;
3
- export {
4
- operationSchema
5
- };
6
- //# sourceMappingURL=operation.js.map
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;