@scalar/workspace-store 0.7.0 → 0.9.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 (186) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +86 -1
  3. package/dist/client.d.ts +46 -45152
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +173 -14
  6. package/dist/client.js.map +2 -2
  7. package/dist/helpers/apply-selective-updates.d.ts +17 -0
  8. package/dist/helpers/apply-selective-updates.d.ts.map +1 -0
  9. package/dist/helpers/apply-selective-updates.js +13 -0
  10. package/dist/helpers/apply-selective-updates.js.map +7 -0
  11. package/dist/helpers/general.d.ts +58 -0
  12. package/dist/helpers/general.d.ts.map +1 -1
  13. package/dist/helpers/general.js +18 -1
  14. package/dist/helpers/general.js.map +2 -2
  15. package/dist/helpers/proxy.d.ts +1 -1
  16. package/dist/helpers/proxy.d.ts.map +1 -1
  17. package/dist/helpers/proxy.js.map +2 -2
  18. package/dist/mutators/cookie.d.ts +17 -0
  19. package/dist/mutators/cookie.d.ts.map +1 -0
  20. package/dist/mutators/cookie.js +31 -0
  21. package/dist/mutators/cookie.js.map +7 -0
  22. package/dist/mutators/environment.d.ts +17 -0
  23. package/dist/mutators/environment.d.ts.map +1 -0
  24. package/dist/mutators/environment.js +31 -0
  25. package/dist/mutators/environment.js.map +7 -0
  26. package/dist/mutators/helpers.d.ts +34580 -0
  27. package/dist/mutators/helpers.d.ts.map +1 -0
  28. package/dist/mutators/helpers.js +11 -0
  29. package/dist/mutators/helpers.js.map +7 -0
  30. package/dist/mutators/index.d.ts +108 -0
  31. package/dist/mutators/index.d.ts.map +1 -0
  32. package/dist/mutators/index.js +67 -0
  33. package/dist/mutators/index.js.map +7 -0
  34. package/dist/mutators/request-example.d.ts +21 -0
  35. package/dist/mutators/request-example.d.ts.map +1 -0
  36. package/dist/mutators/request-example.js +58 -0
  37. package/dist/mutators/request-example.js.map +7 -0
  38. package/dist/mutators/request.d.ts +22 -0
  39. package/dist/mutators/request.d.ts.map +1 -0
  40. package/dist/mutators/request.js +53 -0
  41. package/dist/mutators/request.js.map +7 -0
  42. package/dist/mutators/security-schemes.d.ts +14 -0
  43. package/dist/mutators/security-schemes.d.ts.map +1 -0
  44. package/dist/mutators/security-schemes.js +27 -0
  45. package/dist/mutators/security-schemes.js.map +7 -0
  46. package/dist/mutators/server.d.ts +12 -0
  47. package/dist/mutators/server.d.ts.map +1 -0
  48. package/dist/mutators/server.js +24 -0
  49. package/dist/mutators/server.js.map +7 -0
  50. package/dist/navigation/helpers/traverse-description.d.ts +2 -1
  51. package/dist/navigation/helpers/traverse-description.d.ts.map +1 -1
  52. package/dist/navigation/helpers/traverse-description.js.map +2 -2
  53. package/dist/navigation/helpers/traverse-document.d.ts +89 -2
  54. package/dist/navigation/helpers/traverse-document.d.ts.map +1 -1
  55. package/dist/navigation/helpers/traverse-document.js.map +2 -2
  56. package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
  57. package/dist/navigation/helpers/traverse-paths.js.map +2 -2
  58. package/dist/navigation/helpers/traverse-schemas.d.ts +2 -1
  59. package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
  60. package/dist/navigation/helpers/traverse-schemas.js.map +2 -2
  61. package/dist/navigation/helpers/traverse-tags.d.ts +2 -1
  62. package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
  63. package/dist/navigation/helpers/traverse-tags.js.map +2 -2
  64. package/dist/navigation/helpers/traverse-webhooks.d.ts +2 -1
  65. package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
  66. package/dist/navigation/helpers/traverse-webhooks.js.map +2 -2
  67. package/dist/navigation/types.d.ts +1 -39
  68. package/dist/navigation/types.d.ts.map +1 -1
  69. package/dist/schemas/compose.d.ts.map +1 -0
  70. package/dist/schemas/{v3.1/compose.js.map → compose.js.map} +1 -1
  71. package/dist/schemas/inmemory-workspace.d.ts +68 -0
  72. package/dist/schemas/inmemory-workspace.d.ts.map +1 -0
  73. package/dist/schemas/inmemory-workspace.js +14 -0
  74. package/dist/schemas/inmemory-workspace.js.map +7 -0
  75. package/dist/schemas/navigation.d.ts +148 -0
  76. package/dist/schemas/navigation.d.ts.map +1 -0
  77. package/dist/schemas/navigation.js +76 -0
  78. package/dist/schemas/navigation.js.map +7 -0
  79. package/dist/schemas/reference-config/index.d.ts +1 -1
  80. package/dist/schemas/v3.1/strict/callback.js +1 -1
  81. package/dist/schemas/v3.1/strict/callback.js.map +1 -1
  82. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.d.ts +16 -0
  83. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.d.ts.map +1 -0
  84. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.js +13 -0
  85. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.js.map +7 -0
  86. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.d.ts +27 -0
  87. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.d.ts.map +1 -0
  88. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.js +23 -0
  89. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-environments.js.map +7 -0
  90. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.d.ts +38 -0
  91. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.d.ts.map +1 -0
  92. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.js +45 -0
  93. package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-request-example.js.map +7 -0
  94. package/dist/schemas/v3.1/strict/components.d.ts +45 -7948
  95. package/dist/schemas/v3.1/strict/components.d.ts.map +1 -1
  96. package/dist/schemas/v3.1/strict/components.js +4 -2
  97. package/dist/schemas/v3.1/strict/components.js.map +2 -2
  98. package/dist/schemas/v3.1/strict/contact.js +1 -1
  99. package/dist/schemas/v3.1/strict/contact.js.map +1 -1
  100. package/dist/schemas/v3.1/strict/discriminator.js +1 -1
  101. package/dist/schemas/v3.1/strict/discriminator.js.map +1 -1
  102. package/dist/schemas/v3.1/strict/encoding.js +1 -1
  103. package/dist/schemas/v3.1/strict/encoding.js.map +1 -1
  104. package/dist/schemas/v3.1/strict/example.js +1 -1
  105. package/dist/schemas/v3.1/strict/example.js.map +1 -1
  106. package/dist/schemas/v3.1/strict/external-documentation.js +1 -1
  107. package/dist/schemas/v3.1/strict/external-documentation.js.map +1 -1
  108. package/dist/schemas/v3.1/strict/header.js +1 -1
  109. package/dist/schemas/v3.1/strict/header.js.map +1 -1
  110. package/dist/schemas/v3.1/strict/info.js +1 -1
  111. package/dist/schemas/v3.1/strict/info.js.map +1 -1
  112. package/dist/schemas/v3.1/strict/license.js +1 -1
  113. package/dist/schemas/v3.1/strict/license.js.map +1 -1
  114. package/dist/schemas/v3.1/strict/link.js +1 -1
  115. package/dist/schemas/v3.1/strict/link.js.map +1 -1
  116. package/dist/schemas/v3.1/strict/media-type.js +1 -1
  117. package/dist/schemas/v3.1/strict/media-type.js.map +1 -1
  118. package/dist/schemas/v3.1/strict/oauth-flow.js +1 -1
  119. package/dist/schemas/v3.1/strict/oauth-flow.js.map +1 -1
  120. package/dist/schemas/v3.1/strict/oauthflows.js +1 -1
  121. package/dist/schemas/v3.1/strict/oauthflows.js.map +1 -1
  122. package/dist/schemas/v3.1/strict/openapi-document.d.ts +63 -0
  123. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  124. package/dist/schemas/v3.1/strict/openapi-document.js +12 -2
  125. package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
  126. package/dist/schemas/v3.1/strict/operation.d.ts +18 -0
  127. package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
  128. package/dist/schemas/v3.1/strict/operation.js +8 -1
  129. package/dist/schemas/v3.1/strict/operation.js.map +2 -2
  130. package/dist/schemas/v3.1/strict/parameter.js +1 -1
  131. package/dist/schemas/v3.1/strict/parameter.js.map +1 -1
  132. package/dist/schemas/v3.1/strict/path-item.d.ts +6 -0
  133. package/dist/schemas/v3.1/strict/path-item.d.ts.map +1 -1
  134. package/dist/schemas/v3.1/strict/path-item.js +7 -1
  135. package/dist/schemas/v3.1/strict/path-item.js.map +2 -2
  136. package/dist/schemas/v3.1/strict/path-operations.d.ts +3975 -228
  137. package/dist/schemas/v3.1/strict/path-operations.d.ts.map +1 -1
  138. package/dist/schemas/v3.1/strict/paths.d.ts +1864 -1
  139. package/dist/schemas/v3.1/strict/paths.d.ts.map +1 -1
  140. package/dist/schemas/v3.1/strict/paths.js +1 -1
  141. package/dist/schemas/v3.1/strict/paths.js.map +1 -1
  142. package/dist/schemas/v3.1/strict/reference.js +1 -1
  143. package/dist/schemas/v3.1/strict/reference.js.map +1 -1
  144. package/dist/schemas/v3.1/strict/request-body.js +1 -1
  145. package/dist/schemas/v3.1/strict/request-body.js.map +1 -1
  146. package/dist/schemas/v3.1/strict/response.js +1 -1
  147. package/dist/schemas/v3.1/strict/response.js.map +1 -1
  148. package/dist/schemas/v3.1/strict/responses.js +1 -1
  149. package/dist/schemas/v3.1/strict/responses.js.map +1 -1
  150. package/dist/schemas/v3.1/strict/schema.js +1 -1
  151. package/dist/schemas/v3.1/strict/schema.js.map +1 -1
  152. package/dist/schemas/v3.1/strict/security-requirement.js +1 -1
  153. package/dist/schemas/v3.1/strict/security-requirement.js.map +1 -1
  154. package/dist/schemas/v3.1/strict/security-scheme.js +1 -1
  155. package/dist/schemas/v3.1/strict/security-scheme.js.map +1 -1
  156. package/dist/schemas/v3.1/strict/server-variable.js +1 -1
  157. package/dist/schemas/v3.1/strict/server-variable.js.map +1 -1
  158. package/dist/schemas/v3.1/strict/server.js +1 -1
  159. package/dist/schemas/v3.1/strict/server.js.map +1 -1
  160. package/dist/schemas/v3.1/strict/tag.js +1 -1
  161. package/dist/schemas/v3.1/strict/tag.js.map +1 -1
  162. package/dist/schemas/v3.1/strict/xml.js +1 -1
  163. package/dist/schemas/v3.1/strict/xml.js.map +1 -1
  164. package/dist/schemas/workspace-specification/config.d.ts +48 -0
  165. package/dist/schemas/workspace-specification/config.d.ts.map +1 -0
  166. package/dist/schemas/workspace-specification/config.js +11 -0
  167. package/dist/schemas/workspace-specification/config.js.map +7 -0
  168. package/dist/schemas/workspace-specification/index.d.ts +210 -0
  169. package/dist/schemas/workspace-specification/index.d.ts.map +1 -0
  170. package/dist/schemas/workspace-specification/index.js +27 -0
  171. package/dist/schemas/workspace-specification/index.js.map +7 -0
  172. package/dist/schemas/workspace-specification/info.d.ts +5 -0
  173. package/dist/schemas/workspace-specification/info.d.ts.map +1 -0
  174. package/dist/schemas/workspace-specification/info.js +9 -0
  175. package/dist/schemas/workspace-specification/info.js.map +7 -0
  176. package/dist/schemas/workspace.d.ts +147 -79
  177. package/dist/schemas/workspace.d.ts.map +1 -1
  178. package/dist/schemas/workspace.js +19 -4
  179. package/dist/schemas/workspace.js.map +2 -2
  180. package/dist/server.d.ts +860 -188
  181. package/dist/server.d.ts.map +1 -1
  182. package/dist/server.js.map +1 -1
  183. package/package.json +12 -10
  184. package/dist/schemas/v3.1/compose.d.ts.map +0 -1
  185. /package/dist/schemas/{v3.1/compose.d.ts → compose.d.ts} +0 -0
  186. /package/dist/schemas/{v3.1/compose.js → compose.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAa,MAAM,qBAAqB,CAAA;AAM1F,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAK7E,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAIzF;;;;;GAKG;AACH,KAAK,0BAA0B,GAAG;IAChC,wEAAwE;IACxE,IAAI,CAAC,EAAE,qBAAqB,CAAA;IAC5B,kD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8FAA8F;IAC9F,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,SAAS,CAAA;IACzD,2DAA2D;IAC3D,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IACjD,qCAAqC;IACrC,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1C,mGAAmG;IACnG,eAAe,IAAI,MAAM,CAAA;IACzB,yDAAyD;IACzD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACnC,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,oBAAqB,cAAc,KAAG,cAmatE,CAAA;AAGD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA"}
package/dist/client.js CHANGED
@@ -1,15 +1,18 @@
1
- import { createMagicProxy } from "./helpers/proxy.js";
2
- import { isObject } from "./helpers/general.js";
3
- import { getValueByPath } from "./helpers/json-path-utils.js";
1
+ import YAML from "yaml";
2
+ import { reactive, toRaw } from "vue";
4
3
  import { bundle, upgrade } from "@scalar/openapi-parser";
5
4
  import { fetchUrls } from "@scalar/openapi-parser/plugins-browser";
6
5
  import { createNavigation } from "./navigation/index.js";
6
+ import { createMagicProxy, getRaw } from "./helpers/proxy.js";
7
+ import { deepClone, isObject, safeAssign } from "./helpers/general.js";
8
+ import { mergeObjects } from "./helpers/merge-object.js";
9
+ import { applySelectiveUpdates } from "./helpers/apply-selective-updates.js";
10
+ import { getValueByPath } from "./helpers/json-path-utils.js";
7
11
  import { extensions } from "./schemas/extensions.js";
8
- import { reactive } from "vue";
9
12
  import { coerceValue } from "./schemas/typebox-coerce.js";
10
13
  import { OpenAPIDocumentSchema } from "./schemas/v3.1/strict/openapi-document.js";
11
14
  import { defaultReferenceConfig } from "./schemas/reference-config/index.js";
12
- import { mergeObjects } from "./helpers/merge-object.js";
15
+ import { InMemoryWorkspaceSchema } from "./schemas/inmemory-workspace.js";
13
16
  const defaultConfig = {
14
17
  "x-scalar-reference-config": defaultReferenceConfig
15
18
  };
@@ -22,7 +25,10 @@ async function loadDocument(workspaceDocument) {
22
25
  data: workspaceDocument.document
23
26
  };
24
27
  }
25
- function createWorkspaceStore(workspaceProps) {
28
+ const createWorkspaceStore = (workspaceProps) => {
29
+ const originalDocuments = {};
30
+ const intermediateDocuments = {};
31
+ const documentConfigs = {};
26
32
  const workspace = reactive({
27
33
  ...workspaceProps?.meta,
28
34
  documents: {},
@@ -38,14 +44,18 @@ function createWorkspaceStore(workspaceProps) {
38
44
  return workspace.documents[activeDocumentKey];
39
45
  }
40
46
  });
41
- const documentConfigs = {};
47
+ function getActiveDocumentName() {
48
+ return workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? "";
49
+ }
42
50
  function addDocumentSync(input) {
43
51
  const { name, meta } = input;
44
52
  const document = coerceValue(OpenAPIDocumentSchema, upgrade(input.document).specification);
53
+ originalDocuments[name] = deepClone({ ...document, ...meta });
54
+ intermediateDocuments[name] = deepClone({ ...document, ...meta });
55
+ documentConfigs[name] = input.config ?? {};
45
56
  if (document[extensions.document.navigation] === void 0) {
46
57
  document[extensions.document.navigation] = createNavigation(document, input.config ?? {}).entries;
47
58
  }
48
- documentConfigs[name] = input.config ?? {};
49
59
  workspace.documents[name] = createMagicProxy({ ...document, ...meta });
50
60
  }
51
61
  workspaceProps?.documents?.forEach(addDocumentSync);
@@ -84,7 +94,7 @@ function createWorkspaceStore(workspaceProps) {
84
94
  * updateDocument('document-name', 'x-scalar-active-auth', 'Bearer')
85
95
  */
86
96
  updateDocument(name, key, value) {
87
- const currentDocument = workspace.documents[name === "active" ? workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? "" : name];
97
+ const currentDocument = workspace.documents[name === "active" ? getActiveDocumentName() : name];
88
98
  if (!currentDocument) {
89
99
  throw "Please select a valid document";
90
100
  }
@@ -150,7 +160,12 @@ function createWorkspaceStore(workspaceProps) {
150
160
  if (!resolve.ok || !isObject(resolve.data)) {
151
161
  console.error(`Can not load the document '${name}'`);
152
162
  workspace.documents[name] = {
153
- ...meta
163
+ ...meta,
164
+ info: {
165
+ title: `Document '${name}' could not be loaded`,
166
+ version: "unknown"
167
+ },
168
+ openapi: "3.1.0"
154
169
  };
155
170
  return;
156
171
  }
@@ -187,15 +202,159 @@ function createWorkspaceStore(workspaceProps) {
187
202
  * falling back to the first document if none is specified.
188
203
  */
189
204
  get config() {
190
- const activeDocumentKey = workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? "";
191
205
  return mergeObjects(
192
206
  mergeObjects(defaultConfig, workspaceProps?.config ?? {}),
193
- documentConfigs[activeDocumentKey] ?? {}
207
+ documentConfigs[getActiveDocumentName()] ?? {}
208
+ );
209
+ },
210
+ /**
211
+ * Exports the specified document in the requested format.
212
+ *
213
+ * This method serializes the most recently saved local version of the document (from the intermediateDocuments map)
214
+ * to either JSON or YAML. The exported document reflects the last locally saved state, including any edits
215
+ * that have been saved but not yet synced to a remote registry. Runtime/in-memory changes that have not been saved
216
+ * will not be included.
217
+ *
218
+ * @param documentName - The name of the document to export.
219
+ * @param format - The output format: 'json' for a JSON string, or 'yaml' for a YAML string.
220
+ * @returns The document as a string in the requested format, or undefined if the document does not exist.
221
+ *
222
+ * @example
223
+ * // Export a document as JSON
224
+ * const jsonString = store.exportDocument('api', 'json')
225
+ *
226
+ * // Export a document as YAML
227
+ * const yamlString = store.exportDocument('api', 'yaml')
228
+ */
229
+ exportDocument: (documentName, format) => {
230
+ const intermediateDocument = intermediateDocuments[documentName];
231
+ if (!intermediateDocument) {
232
+ return;
233
+ }
234
+ if (format === "json") {
235
+ return JSON.stringify(intermediateDocument);
236
+ }
237
+ return YAML.stringify(intermediateDocument);
238
+ },
239
+ /**
240
+ * Saves the current state of the specified document to the intermediate documents map.
241
+ *
242
+ * This function captures the latest (reactive) state of the document from the workspace and
243
+ * applies its changes to the corresponding entry in the `intermediateDocuments` map.
244
+ * The `intermediateDocuments` map represents the most recently "saved" local version of the document,
245
+ * which may include edits not yet synced to the remote registry.
246
+ *
247
+ * The update is performed in-place. A deep clone of the current document
248
+ * state is used to avoid mutating the reactive object directly.
249
+ *
250
+ * @param documentName - The name of the document to save.
251
+ * @returns An array of diffs that were excluded from being applied (such as changes to ignored keys),
252
+ * or undefined if the document does not exist or cannot be updated.
253
+ *
254
+ * @example
255
+ * // Save the current state of the document named 'api'
256
+ * const excludedDiffs = store.saveDocument('api')
257
+ */
258
+ saveDocument(documentName) {
259
+ const intermediateDocument = intermediateDocuments[documentName];
260
+ const updatedDocument = toRaw(getRaw(workspace.documents[documentName]));
261
+ if (!intermediateDocument || !updatedDocument) {
262
+ return;
263
+ }
264
+ const excludedDiffs = applySelectiveUpdates(intermediateDocument, updatedDocument);
265
+ return excludedDiffs;
266
+ },
267
+ /**
268
+ * Restores the specified document to its last locally saved state.
269
+ *
270
+ * This method updates the current reactive document (in the workspace) with the contents of the
271
+ * corresponding intermediate document (from the `intermediateDocuments` map), effectively discarding
272
+ * any unsaved in-memory changes and reverting to the last saved version.
273
+ * Vue reactivity is preserved by updating the existing reactive object in place.
274
+ *
275
+ * **Warning:** This operation will discard all unsaved (in-memory) changes to the specified document.
276
+ *
277
+ * @param documentName - The name of the document to restore.
278
+ * @returns void
279
+ *
280
+ * @example
281
+ * // Restore the document named 'api' to its last saved state
282
+ * store.revertDocumentChanges('api')
283
+ */
284
+ revertDocumentChanges(documentName) {
285
+ const intermediateDocument = intermediateDocuments[documentName];
286
+ const updatedDocument = getRaw(workspace.documents[documentName]);
287
+ if (!intermediateDocument || !updatedDocument) {
288
+ return;
289
+ }
290
+ applySelectiveUpdates(updatedDocument, intermediateDocument);
291
+ },
292
+ /**
293
+ * Commits the specified document.
294
+ *
295
+ * This method is intended to finalize and persist the current state of the document,
296
+ * potentially syncing it with a remote registry or marking it as the latest committed version.
297
+ *
298
+ * @param documentName - The name of the document to commit.
299
+ * @remarks
300
+ * The actual commit logic is not implemented yet.
301
+ */
302
+ commitDocument(documentName) {
303
+ console.warn(`Commit operation for document '${documentName}' is not implemented yet.`);
304
+ },
305
+ /**
306
+ * Serializes the current workspace state to a JSON string for backup, persistence, or sharing.
307
+ *
308
+ * This method exports all workspace documents (removing Vue reactivity proxies), workspace metadata,
309
+ * document configurations, and both the original and intermediate document states. The resulting JSON
310
+ * can be imported later to fully restore the workspace to this exact state, including all documents
311
+ * and their configurations.
312
+ *
313
+ * @returns A JSON string representing the complete workspace state.
314
+ */
315
+ exportWorkspace() {
316
+ return JSON.stringify({
317
+ documents: {
318
+ ...Object.fromEntries(
319
+ Object.entries(workspace.documents).map(([name, doc]) => [
320
+ name,
321
+ // Extract the raw document data for export, removing any Vue reactivity wrappers.
322
+ // When importing, the document can be wrapped again in a magic proxy.
323
+ toRaw(getRaw(doc))
324
+ ])
325
+ )
326
+ },
327
+ meta: workspaceProps?.meta ?? {},
328
+ documentConfigs,
329
+ originalDocuments,
330
+ intermediateDocuments
331
+ });
332
+ },
333
+ /**
334
+ * Imports a workspace from a serialized JSON string.
335
+ *
336
+ * This method parses the input string using the InMemoryWorkspaceSchema,
337
+ * then updates the current workspace state, including documents, metadata,
338
+ * and configuration, with the imported values.
339
+ *
340
+ * @param input - The serialized workspace JSON string to import.
341
+ */
342
+ loadWorkspace(input) {
343
+ const result = coerceValue(InMemoryWorkspaceSchema, JSON.parse(input));
344
+ safeAssign(
345
+ workspace.documents,
346
+ Object.fromEntries(Object.entries(result.documents).map(([name, doc]) => [name, createMagicProxy(doc)]))
194
347
  );
348
+ safeAssign(originalDocuments, result.originalDocuments);
349
+ safeAssign(intermediateDocuments, result.intermediateDocuments);
350
+ safeAssign(documentConfigs, result.documentConfigs);
351
+ safeAssign(workspace, result.meta);
195
352
  }
196
353
  };
197
- }
354
+ };
355
+ import { generateClientMutators } from "./mutators/index.js";
198
356
  export {
199
- createWorkspaceStore
357
+ createWorkspaceStore,
358
+ generateClientMutators
200
359
  };
201
360
  //# sourceMappingURL=client.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/client.ts"],
4
- "sourcesContent": ["import type { WorkspaceMeta, WorkspaceDocumentMeta, Workspace } from './schemas/workspace'\nimport { createMagicProxy } from './helpers/proxy'\nimport { isObject } from '@/helpers/general'\nimport { getValueByPath } from '@/helpers/json-path-utils'\nimport { bundle, upgrade } from '@scalar/openapi-parser'\nimport { fetchUrls } from '@scalar/openapi-parser/plugins-browser'\nimport { createNavigation, type createNavigationOptions } from '@/navigation'\nimport { extensions } from '@/schemas/extensions'\nimport { reactive } from 'vue'\nimport { coerceValue } from '@/schemas/typebox-coerce'\nimport { OpenAPIDocumentSchema } from '@/schemas/v3.1/strict/openapi-document'\nimport { defaultReferenceConfig, type ReferenceConfig } from '@/schemas/reference-config'\nimport { mergeObjects } from '@/helpers/merge-object'\nimport type { DeepTransform } from '@/types'\n\n/**\n * Input type for workspace document metadata and configuration.\n * This type defines the required and optional fields for initializing a document in the workspace.\n *\n * TODO: merge navigation options with the document config\n */\ntype WorkspaceDocumentMetaInput = {\n /** Optional metadata about the document like title, description, etc */\n meta?: WorkspaceDocumentMeta\n /** Required unique identifier for the document */\n name: string\n /** Optional configuration for generating navigation structure */\n config?: Config & Partial<createNavigationOptions>\n}\n\n/**\n * Represents a document that is loaded from a URL.\n * This type extends WorkspaceDocumentMetaInput to include URL-specific properties.\n */\ntype UrlDoc = {\n /** URL to fetch the OpenAPI document from */\n url: string\n /** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */\n fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>\n} & WorkspaceDocumentMetaInput\n\n/** Represents a document that is provided directly as an object rather than loaded from a URL */\ntype ObjectDoc = {\n /** The OpenAPI document object containing the API specification */\n document: Record<string, unknown>\n} & WorkspaceDocumentMetaInput\n\n/** Union type representing the possible input formats for a workspace document:\n * - UrlDoc: Document loaded from a URL with optional fetch configuration\n * - ObjectDoc: Direct document object with metadata\n */\ntype WorkspaceDocumentInput = UrlDoc | ObjectDoc\n\n/**\n * Configuration object for workspace documents.\n */\ntype Config = {\n 'x-scalar-reference-config'?: ReferenceConfig\n}\n\nconst defaultConfig: DeepTransform<Config, 'NonNullable'> = {\n 'x-scalar-reference-config': defaultReferenceConfig,\n}\n\n/**\n * Resolves a workspace document from various input sources (URL, local file, or direct document object).\n *\n * @param workspaceDocument - The document input to resolve, which can be:\n * - A URL to fetch the document from\n * - A direct document object\n * @returns A promise that resolves to an object containing:\n * - ok: boolean indicating if the resolution was successful\n * - data: The resolved document data\n *\n * @example\n * // Resolve from URL\n * const urlDoc = await loadDocument({ name: 'api', url: 'https://api.example.com/openapi.json' })\n *\n * // Resolve direct document\n * const directDoc = await loadDocument({\n * name: 'inline',\n * document: { openapi: '3.0.0', paths: {} }\n * })\n */\nasync function loadDocument(workspaceDocument: WorkspaceDocumentInput) {\n if ('url' in workspaceDocument) {\n return fetchUrls({ fetch: workspaceDocument.fetch }).exec(workspaceDocument.url)\n }\n\n return {\n ok: true as const,\n data: workspaceDocument.document,\n }\n}\n\n/**\n * Configuration object for initializing a workspace store.\n * Defines the initial state and documents for the workspace.\n */\ntype WorkspaceProps = {\n /** Optional metadata for the workspace including theme, active document, etc */\n meta?: WorkspaceMeta\n /** In-mem open api documents. Async source documents (like URLs) can be loaded after initialization */\n documents?: ObjectDoc[]\n config?: Config\n}\n\n/**\n * Creates a reactive workspace store that manages documents and their metadata.\n * The store provides functionality for accessing, updating, and resolving document references.\n *\n * @param workspaceProps - Configuration object for the workspace\n * @param workspaceProps.meta - Optional metadata for the workspace\n * @param workspaceProps.documents - Optional record of documents to initialize the workspace with\n * Documents that require asynchronous loading must be added using `addDocument` after the store is created\n * this allows atomic awaiting and does not block page load for the store initialization\n * @returns An object containing methods and getters for managing the workspace\n */\nexport function createWorkspaceStore(workspaceProps?: WorkspaceProps) {\n // Create a reactive workspace object with proxied documents\n // Each document is wrapped in a proxy to enable reactive updates and reference resolution\n const workspace = reactive<Workspace>({\n ...workspaceProps?.meta,\n documents: {},\n /**\n * Returns the currently active document from the workspace.\n * The active document is determined by the 'x-scalar-active-document' metadata field,\n * falling back to the first document in the workspace if no active document is specified.\n *\n * @returns The active document or undefined if no document is found\n */\n get activeDocument(): NonNullable<Workspace['activeDocument']> | undefined {\n const activeDocumentKey =\n workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? ''\n return workspace.documents[activeDocumentKey]\n },\n })\n\n /**\n * A map of document configurations keyed by document name.\n * This stores the configuration options for each document in the workspace,\n * allowing for document-specific settings like navigation options, appearance,\n * and other reference configuration.\n */\n const documentConfigs: Record<string, Config> = {}\n\n // Add a document to the store synchronously from and in-mem open api document\n function addDocumentSync(input: ObjectDoc) {\n const { name, meta } = input\n\n const document = coerceValue(OpenAPIDocumentSchema, upgrade(input.document).specification)\n\n // Skip navigation generation if the document already has a server-side generated navigation structure\n if (document[extensions.document.navigation] === undefined) {\n document[extensions.document.navigation] = createNavigation(document, input.config ?? {}).entries\n }\n\n // Add the document config to the documentConfigs map\n documentConfigs[name] = input.config ?? {}\n\n workspace.documents[name] = createMagicProxy({ ...document, ...meta })\n }\n\n // Add any initial documents to the store\n workspaceProps?.documents?.forEach(addDocumentSync)\n\n // Cache to track visited nodes during reference resolution to prevent bundling the same subtree multiple times\n // This is needed because we are doing partial bundle operations\n const visitedNodesCache = new Set()\n\n return {\n /**\n * Returns the reactive workspace object with an additional activeDocument getter\n */\n get workspace() {\n return workspace\n },\n /**\n * Updates a specific metadata field in the workspace\n * @param key - The metadata field to update\n * @param value - The new value for the field\n * @example\n * // Update the workspace title\n * update('x-scalar-active-document', 'document-name')\n */\n update<K extends keyof WorkspaceMeta>(key: K, value: WorkspaceMeta[K]) {\n // @ts-ignore\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n throw new Error('Invalid key: cannot modify prototype')\n }\n Object.assign(workspace, { [key]: value })\n },\n /**\n * Updates a specific metadata field in a document\n * @param name - The name of the document to update ('active' or a specific document name)\n * @param key - The metadata field to update\n * @param value - The new value for the field\n * @throws Error if the specified document doesn't exist\n * @example\n * // Update the auth of the active document\n * updateDocument('active', 'x-scalar-active-auth', 'Bearer')\n * // Update the auth of a specific document\n * updateDocument('document-name', 'x-scalar-active-auth', 'Bearer')\n */\n updateDocument<K extends keyof WorkspaceDocumentMeta>(\n name: 'active' | (string & {}),\n key: K,\n value: WorkspaceDocumentMeta[K],\n ) {\n const currentDocument =\n workspace.documents[\n name === 'active'\n ? (workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? '')\n : name\n ]\n\n if (!currentDocument) {\n throw 'Please select a valid document'\n }\n\n Object.assign(currentDocument, { [key]: value })\n },\n /**\n * Resolves a reference in the active document by following the provided path and resolving any external $ref references.\n * This method traverses the document structure following the given path and resolves any $ref references it encounters.\n * During resolution, it sets a loading status and updates the reference with the resolved content.\n *\n * @param path - Array of strings representing the path to the reference (e.g. ['paths', '/users', 'get', 'responses', '200'])\n * @throws Error if the path is invalid or empty\n * @example\n * // Resolve a reference in the active document\n * resolve(['paths', '/users', 'get', 'responses', '200'])\n */\n resolve: async (path: string[]) => {\n const activeDocument = workspace.activeDocument\n\n const target = getValueByPath(activeDocument, path)\n\n if (!isObject(target)) {\n console.error(\n `Invalid path provided for resolution. Path: [${path.join(', ')}]. Found value of type: ${typeof target}. Expected an object.`,\n )\n return\n }\n\n // Bundle the target document with the active document as root, resolving any external references\n // and tracking resolution status through hooks\n return bundle(target, {\n root: activeDocument,\n treeShake: false,\n plugins: [fetchUrls()],\n urlMap: false,\n hooks: {\n onResolveStart: (node) => {\n node['$status'] = 'loading'\n },\n onResolveError: (node) => {\n node['$status'] = 'error'\n },\n },\n visitedNodes: visitedNodesCache,\n })\n },\n /**\n * Adds a new document to the workspace\n * @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format\n * @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta\n * @example\n * // Add a new OpenAPI document to the workspace\n * store.addDocument({\n * name: 'name',\n * document: {\n * openapi: '3.0.0',\n * info: { title: 'title' },\n * },\n * meta: {\n * 'x-scalar-active-auth': 'Bearer',\n * 'x-scalar-active-server': 'production'\n * }\n * })\n */\n addDocument: async (input: WorkspaceDocumentInput) => {\n const { name, meta, config } = input\n\n const resolve = await loadDocument(input)\n\n if (!resolve.ok || !isObject(resolve.data)) {\n console.error(`Can not load the document '${name}'`)\n workspace.documents[name] = {\n ...meta,\n }\n return\n }\n\n addDocumentSync({ document: resolve.data, name, meta, config })\n },\n /**\n * Similar to addDocument but requires and in-mem object to be provided and loads the document synchronously\n * @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format\n * @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta\n * @example\n * // Add a new OpenAPI document to the workspace\n * store.addDocument({\n * name: 'name',\n * document: {\n * openapi: '3.0.0',\n * info: { title: 'title' },\n * },\n * meta: {\n * 'x-scalar-active-auth': 'Bearer',\n * 'x-scalar-active-server': 'production'\n * }\n * })\n */\n addDocumentSync,\n /**\n * Returns the merged configuration for the active document.\n *\n * This getter merges configurations in the following order of precedence:\n * 1. Document-specific configuration (highest priority)\n * 2. Workspace-level configuration\n * 3. Default configuration (lowest priority)\n *\n * The active document is determined by the workspace's activeDocument extension,\n * falling back to the first document if none is specified.\n */\n get config() {\n const activeDocumentKey =\n workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? ''\n\n return mergeObjects<typeof defaultConfig>(\n mergeObjects(defaultConfig, workspaceProps?.config ?? {}),\n documentConfigs[activeDocumentKey] ?? {},\n )\n },\n }\n}\n\nexport type WorkspaceStore = ReturnType<typeof createWorkspaceStore>\n"],
5
- "mappings": "AACA,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,QAAQ,eAAe;AAChC,SAAS,iBAAiB;AAC1B,SAAS,wBAAsD;AAC/D,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACz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c;AAAA,MAChB,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAmBA,aAAa,OAAO,UAAkC;AACpD,YAAM,EAAE,MAAM,MAAM,OAAO,IAAI;AAE/B,YAAM,UAAU,MAAM,aAAa,KAAK;AAExC,UAAI,CAAC,QAAQ,MAAM,CAAC,SAAS,QAAQ,IAAI,GAAG;AAC1C,gBAAQ,MAAM,8BAA8B,IAAI,GAAG;AACnD,kBAAU,UAAU,IAAI,IAAI;AAAA,UAC1B,GAAG;AAAA,QACL;AACA;AAAA,MACF;AAEA,sBAAgB,EAAE,UAAU,QAAQ,MAAM,MAAM,MAAM,OAAO,CAAC;AAAA,IAChE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAmBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYA,IAAI,SAAS;AACX,YAAM,oBACJ,UAAU,WAAW,UAAU,cAAc,KAAK,OAAO,KAAK,UAAU,SAAS,EAAE,CAAC,KAAK;AAE3F,aAAO;AAAA,QACL,aAAa,eAAe,gBAAgB,UAAU,CAAC,CAAC;AAAA,QACxD,gBAAgB,iBAAiB,KAAK,CAAC;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import YAML from 'yaml'\nimport { reactive, toRaw } from 'vue'\nimport { bundle, upgrade } from '@scalar/openapi-parser'\nimport { fetchUrls } from '@scalar/openapi-parser/plugins-browser'\n\nimport { createNavigation, type createNavigationOptions } from '@/navigation'\nimport type { DeepTransform } from '@/types'\nimport { createMagicProxy, getRaw } from '@/helpers/proxy'\nimport { deepClone, isObject, safeAssign } from '@/helpers/general'\nimport { mergeObjects } from '@/helpers/merge-object'\nimport { applySelectiveUpdates } from '@/helpers/apply-selective-updates'\nimport { getValueByPath } from '@/helpers/json-path-utils'\nimport type { WorkspaceMeta, WorkspaceDocumentMeta, Workspace } from '@/schemas/workspace'\nimport { extensions } from '@/schemas/extensions'\nimport { coerceValue } from '@/schemas/typebox-coerce'\nimport { OpenAPIDocumentSchema } from '@/schemas/v3.1/strict/openapi-document'\nimport { defaultReferenceConfig } from '@/schemas/reference-config'\nimport type { Config } from '@/schemas/workspace-specification/config'\nimport { InMemoryWorkspaceSchema, type InMemoryWorkspace } from '@/schemas/inmemory-workspace'\n\n/**\n * Input type for workspace document metadata and configuration.\n * This type defines the required and optional fields for initializing a document in the workspace.\n *\n * TODO: merge navigation options with the document config\n */\ntype WorkspaceDocumentMetaInput = {\n /** Optional metadata about the document like title, description, etc */\n meta?: WorkspaceDocumentMeta\n /** Required unique identifier for the document */\n name: string\n /** Optional configuration for generating navigation structure */\n config?: Config & Partial<createNavigationOptions>\n}\n\n/**\n * Represents a document that is loaded from a URL.\n * This type extends WorkspaceDocumentMetaInput to include URL-specific properties.\n */\nexport type UrlDoc = {\n /** URL to fetch the OpenAPI document from */\n url: string\n /** Optional custom fetch implementation to use when retrieving the document. By default the global fetch implementation will be used */\n fetch?: (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>\n} & WorkspaceDocumentMetaInput\n\n/** Represents a document that is provided directly as an object rather than loaded from a URL */\nexport type ObjectDoc = {\n /** The OpenAPI document object containing the API specification */\n document: Record<string, unknown>\n} & WorkspaceDocumentMetaInput\n\n/**\n * Union type representing the possible input formats for a workspace document:\n * - UrlDoc: Document loaded from a URL with optional fetch configuration\n * - ObjectDoc: Direct document object with metadata\n */\nexport type WorkspaceDocumentInput = UrlDoc | ObjectDoc\n\nconst defaultConfig: DeepTransform<Config, 'NonNullable'> = {\n 'x-scalar-reference-config': defaultReferenceConfig,\n}\n\n/**\n * Resolves a workspace document from various input sources (URL, local file, or direct document object).\n *\n * @param workspaceDocument - The document input to resolve, which can be:\n * - A URL to fetch the document from\n * - A direct document object\n * @returns A promise that resolves to an object containing:\n * - ok: boolean indicating if the resolution was successful\n * - data: The resolved document data\n *\n * @example\n * // Resolve from URL\n * const urlDoc = await loadDocument({ name: 'api', url: 'https://api.example.com/openapi.json' })\n *\n * // Resolve direct document\n * const directDoc = await loadDocument({\n * name: 'inline',\n * document: { openapi: '3.0.0', paths: {} }\n * })\n */\nasync function loadDocument(workspaceDocument: WorkspaceDocumentInput) {\n if ('url' in workspaceDocument) {\n return fetchUrls({ fetch: workspaceDocument.fetch }).exec(workspaceDocument.url)\n }\n\n return {\n ok: true as const,\n data: workspaceDocument.document,\n }\n}\n\n/**\n * Configuration object for initializing a workspace store.\n * Defines the initial state and documents for the workspace.\n */\ntype WorkspaceProps = {\n /** Optional metadata for the workspace including theme, active document, etc */\n meta?: WorkspaceMeta\n /** In-mem open api documents. Async source documents (like URLs) can be loaded after initialization */\n documents?: ObjectDoc[]\n /** Workspace configuration */\n config?: Config\n}\n\n/**\n * Type definition for the workspace store return object.\n * This explicit type is needed to avoid TypeScript inference limits.\n *\n * @see https://github.com/microsoft/TypeScript/issues/43817#issuecomment-827746462\n */\nexport type WorkspaceStore = {\n /** Returns the reactive workspace object with an additional activeDocument getter */\n readonly workspace: Workspace\n /** Updates a specific metadata field in the workspace */\n update<K extends keyof WorkspaceMeta>(key: K, value: WorkspaceMeta[K]): void\n /** Updates a specific metadata field in a document */\n updateDocument<K extends keyof WorkspaceDocumentMeta>(\n name: 'active' | (string & {}),\n key: K,\n value: WorkspaceDocumentMeta[K],\n ): void\n /** Resolves a reference in the active document by following the provided path and resolving any external $ref references */\n resolve(path: string[]): Promise<unknown>\n /** Adds a new document to the workspace */\n addDocument(input: WorkspaceDocumentInput): Promise<void>\n /** Similar to addDocument but requires and in-mem object to be provided and loads the document synchronously */\n addDocumentSync(input: ObjectDoc): void\n /** Returns the merged configuration for the active document */\n readonly config: typeof defaultConfig\n /** Downloads the specified document in the requested format */\n exportDocument(documentName: string, format: 'json' | 'yaml'): string | undefined\n /** Persists the current state of the specified document back to the original documents map */\n saveDocument(documentName: string): unknown[] | undefined\n /** Reverts the specified document to its original state */\n revertDocumentChanges(documentName: string): void\n /** Commits the specified document */\n commitDocument(documentName: string): void\n /** Serializes the current workspace state to a JSON string for backup, persistence, or sharing. */\n exportWorkspace(): string\n /** Imports a workspace from a serialized JSON string. */\n loadWorkspace(input: string): void\n}\n\n/**\n * Creates a reactive workspace store that manages documents and their metadata.\n * The store provides functionality for accessing, updating, and resolving document references.\n *\n * @param workspaceProps - Configuration object for the workspace\n * @param workspaceProps.meta - Optional metadata for the workspace\n * @param workspaceProps.documents - Optional record of documents to initialize the workspace with\n * Documents that require asynchronous loading must be added using `addDocument` after the store is created\n * this allows atomic awaiting and does not block page load for the store initialization\n * @returns An object containing methods and getters for managing the workspace\n */\nexport const createWorkspaceStore = (workspaceProps?: WorkspaceProps): WorkspaceStore => {\n /**\n * Holds the original, unmodified documents as they were initially loaded into the workspace.\n * These documents are stored in their raw form\u2014prior to any reactive wrapping, dereferencing, or bundling.\n * This map preserves the pristine structure of each document, using deep clones to ensure that\n * subsequent mutations in the workspace do not affect the originals.\n * The originals are retained so that we can restore, compare, or sync with the remote registry as needed.\n */\n const originalDocuments = {} as Workspace['documents']\n\n /**\n * Stores the intermediate state of documents after local edits but before syncing with the remote registry.\n *\n * This map acts as a local \"saved\" version of the document, reflecting the user's changes after they hit \"save\".\n * The `originalDocuments` map, by contrast, always mirrors the document as it exists in the remote registry.\n *\n * Use this map to stage local changes that are ready to be propagated back to the remote registry.\n * This separation allows us to distinguish between:\n * - The last known remote version (`originalDocuments`)\n * - The latest locally saved version (`intermediateDocuments`)\n * - The current in-memory (possibly unsaved) workspace document (`workspace.documents`)\n */\n const intermediateDocuments = {} as Workspace['documents']\n /**\n * A map of document configurations keyed by document name.\n * This stores the configuration options for each document in the workspace,\n * allowing for document-specific settings like navigation options, appearance,\n * and other reference configuration.\n */\n const documentConfigs: Record<string, Config> = {}\n\n // Create a reactive workspace object with proxied documents\n // Each document is wrapped in a proxy to enable reactive updates and reference resolution\n const workspace = reactive<Workspace>({\n ...workspaceProps?.meta,\n documents: {},\n /**\n * Returns the currently active document from the workspace.\n * The active document is determined by the 'x-scalar-active-document' metadata field,\n * falling back to the first document in the workspace if no active document is specified.\n *\n * @returns The active document or undefined if no document is found\n */\n get activeDocument(): NonNullable<Workspace['activeDocument']> | undefined {\n const activeDocumentKey =\n workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? ''\n return workspace.documents[activeDocumentKey]\n },\n })\n\n /**\n * Returns the name of the currently active document in the workspace.\n * The active document is determined by the 'x-scalar-active-document' metadata field,\n * falling back to the first document in the workspace if no active document is specified.\n *\n * @returns The name of the active document or an empty string if no document is found\n */\n function getActiveDocumentName() {\n return workspace[extensions.workspace.activeDocument] ?? Object.keys(workspace.documents)[0] ?? ''\n }\n\n // Add a document to the store synchronously from an in-memory OpenAPI document\n function addDocumentSync(input: ObjectDoc) {\n const { name, meta } = input\n\n const document = coerceValue(OpenAPIDocumentSchema, upgrade(input.document).specification)\n\n // Store the original document in the originalDocuments map\n // This is used to track the original state of the document as it was loaded into the workspace\n originalDocuments[name] = deepClone({ ...document, ...meta })\n // Store the intermediate document state for local edits\n // This is used to track the last saved state of the document\n // It allows us to differentiate between the original document and the latest saved version\n // This is important for local edits that are not yet synced with the remote registry\n // The intermediate document is used to store the latest saved state of the document\n // This allows us to track changes and revert to the last saved state if needed\n intermediateDocuments[name] = deepClone({ ...document, ...meta })\n // Add the document config to the documentConfigs map\n documentConfigs[name] = input.config ?? {}\n\n // Skip navigation generation if the document already has a server-side generated navigation structure\n if (document[extensions.document.navigation] === undefined) {\n document[extensions.document.navigation] = createNavigation(document, input.config ?? {}).entries\n }\n\n workspace.documents[name] = createMagicProxy({ ...document, ...meta })\n }\n\n // Add any initial documents to the store\n workspaceProps?.documents?.forEach(addDocumentSync)\n\n // Cache to track visited nodes during reference resolution to prevent bundling the same subtree multiple times\n // This is needed because we are doing partial bundle operations\n const visitedNodesCache = new Set()\n\n return {\n /**\n * Returns the reactive workspace object with an additional activeDocument getter\n */\n get workspace() {\n return workspace\n },\n /**\n * Updates a specific metadata field in the workspace\n * @param key - The metadata field to update\n * @param value - The new value for the field\n * @example\n * // Update the workspace title\n * update('x-scalar-active-document', 'document-name')\n */\n update<K extends keyof WorkspaceMeta>(key: K, value: WorkspaceMeta[K]) {\n // @ts-ignore\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n throw new Error('Invalid key: cannot modify prototype')\n }\n Object.assign(workspace, { [key]: value })\n },\n /**\n * Updates a specific metadata field in a document\n * @param name - The name of the document to update ('active' or a specific document name)\n * @param key - The metadata field to update\n * @param value - The new value for the field\n * @throws Error if the specified document doesn't exist\n * @example\n * // Update the auth of the active document\n * updateDocument('active', 'x-scalar-active-auth', 'Bearer')\n * // Update the auth of a specific document\n * updateDocument('document-name', 'x-scalar-active-auth', 'Bearer')\n */\n updateDocument<K extends keyof WorkspaceDocumentMeta>(\n name: 'active' | (string & {}),\n key: K,\n value: WorkspaceDocumentMeta[K],\n ) {\n const currentDocument = workspace.documents[name === 'active' ? getActiveDocumentName() : name]\n\n if (!currentDocument) {\n throw 'Please select a valid document'\n }\n\n Object.assign(currentDocument, { [key]: value })\n },\n /**\n * Resolves a reference in the active document by following the provided path and resolving any external $ref references.\n * This method traverses the document structure following the given path and resolves any $ref references it encounters.\n * During resolution, it sets a loading status and updates the reference with the resolved content.\n *\n * @param path - Array of strings representing the path to the reference (e.g. ['paths', '/users', 'get', 'responses', '200'])\n * @throws Error if the path is invalid or empty\n * @example\n * // Resolve a reference in the active document\n * resolve(['paths', '/users', 'get', 'responses', '200'])\n */\n resolve: async (path: string[]) => {\n const activeDocument = workspace.activeDocument\n\n const target = getValueByPath(activeDocument, path)\n\n if (!isObject(target)) {\n console.error(\n `Invalid path provided for resolution. Path: [${path.join(', ')}]. Found value of type: ${typeof target}. Expected an object.`,\n )\n return\n }\n\n // Bundle the target document with the active document as root, resolving any external references\n // and tracking resolution status through hooks\n return bundle(target, {\n root: activeDocument,\n treeShake: false,\n plugins: [fetchUrls()],\n urlMap: false,\n hooks: {\n onResolveStart: (node) => {\n node['$status'] = 'loading'\n },\n onResolveError: (node) => {\n node['$status'] = 'error'\n },\n },\n visitedNodes: visitedNodesCache,\n })\n },\n /**\n * Adds a new document to the workspace\n * @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format\n * @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta\n * @example\n * // Add a new OpenAPI document to the workspace\n * store.addDocument({\n * name: 'name',\n * document: {\n * openapi: '3.0.0',\n * info: { title: 'title' },\n * },\n * meta: {\n * 'x-scalar-active-auth': 'Bearer',\n * 'x-scalar-active-server': 'production'\n * }\n * })\n */\n addDocument: async (input: WorkspaceDocumentInput) => {\n const { name, meta, config } = input\n\n const resolve = await loadDocument(input)\n\n if (!resolve.ok || !isObject(resolve.data)) {\n console.error(`Can not load the document '${name}'`)\n workspace.documents[name] = {\n ...meta,\n info: {\n title: `Document '${name}' could not be loaded`,\n version: 'unknown',\n },\n openapi: '3.1.0',\n }\n return\n }\n\n addDocumentSync({ document: resolve.data, name, meta, config })\n },\n /**\n * Similar to addDocument but requires and in-mem object to be provided and loads the document synchronously\n * @param document - The document content to add. This should be a valid OpenAPI/Swagger document or other supported format\n * @param meta - Metadata for the document, including its name and other properties defined in WorkspaceDocumentMeta\n * @example\n * // Add a new OpenAPI document to the workspace\n * store.addDocument({\n * name: 'name',\n * document: {\n * openapi: '3.0.0',\n * info: { title: 'title' },\n * },\n * meta: {\n * 'x-scalar-active-auth': 'Bearer',\n * 'x-scalar-active-server': 'production'\n * }\n * })\n */\n addDocumentSync,\n /**\n * Returns the merged configuration for the active document.\n *\n * This getter merges configurations in the following order of precedence:\n * 1. Document-specific configuration (highest priority)\n * 2. Workspace-level configuration\n * 3. Default configuration (lowest priority)\n *\n * The active document is determined by the workspace's activeDocument extension,\n * falling back to the first document if none is specified.\n */\n get config() {\n return mergeObjects<typeof defaultConfig>(\n mergeObjects(defaultConfig, workspaceProps?.config ?? {}),\n documentConfigs[getActiveDocumentName()] ?? {},\n )\n },\n /**\n * Exports the specified document in the requested format.\n *\n * This method serializes the most recently saved local version of the document (from the intermediateDocuments map)\n * to either JSON or YAML. The exported document reflects the last locally saved state, including any edits\n * that have been saved but not yet synced to a remote registry. Runtime/in-memory changes that have not been saved\n * will not be included.\n *\n * @param documentName - The name of the document to export.\n * @param format - The output format: 'json' for a JSON string, or 'yaml' for a YAML string.\n * @returns The document as a string in the requested format, or undefined if the document does not exist.\n *\n * @example\n * // Export a document as JSON\n * const jsonString = store.exportDocument('api', 'json')\n *\n * // Export a document as YAML\n * const yamlString = store.exportDocument('api', 'yaml')\n */\n exportDocument: (documentName: string, format: 'json' | 'yaml') => {\n const intermediateDocument = intermediateDocuments[documentName]\n\n if (!intermediateDocument) {\n return\n }\n\n if (format === 'json') {\n return JSON.stringify(intermediateDocument)\n }\n\n return YAML.stringify(intermediateDocument)\n },\n /**\n * Saves the current state of the specified document to the intermediate documents map.\n *\n * This function captures the latest (reactive) state of the document from the workspace and\n * applies its changes to the corresponding entry in the `intermediateDocuments` map.\n * The `intermediateDocuments` map represents the most recently \"saved\" local version of the document,\n * which may include edits not yet synced to the remote registry.\n *\n * The update is performed in-place. A deep clone of the current document\n * state is used to avoid mutating the reactive object directly.\n *\n * @param documentName - The name of the document to save.\n * @returns An array of diffs that were excluded from being applied (such as changes to ignored keys),\n * or undefined if the document does not exist or cannot be updated.\n *\n * @example\n * // Save the current state of the document named 'api'\n * const excludedDiffs = store.saveDocument('api')\n */\n saveDocument(documentName: string) {\n const intermediateDocument = intermediateDocuments[documentName]\n // Obtain the raw state of the current document to ensure accurate diffing\n const updatedDocument = toRaw(getRaw(workspace.documents[documentName]))\n\n // If either the intermediate or updated document is missing, do nothing\n if (!intermediateDocument || !updatedDocument) {\n return\n }\n\n // Apply changes from the current document to the intermediate document in place\n const excludedDiffs = applySelectiveUpdates(intermediateDocument, updatedDocument)\n return excludedDiffs\n },\n /**\n * Restores the specified document to its last locally saved state.\n *\n * This method updates the current reactive document (in the workspace) with the contents of the\n * corresponding intermediate document (from the `intermediateDocuments` map), effectively discarding\n * any unsaved in-memory changes and reverting to the last saved version.\n * Vue reactivity is preserved by updating the existing reactive object in place.\n *\n * **Warning:** This operation will discard all unsaved (in-memory) changes to the specified document.\n *\n * @param documentName - The name of the document to restore.\n * @returns void\n *\n * @example\n * // Restore the document named 'api' to its last saved state\n * store.revertDocumentChanges('api')\n */\n revertDocumentChanges(documentName: string) {\n const intermediateDocument = intermediateDocuments[documentName]\n // Get the raw state of the current document to avoid diffing resolved references.\n // This ensures we update the actual data, not the references.\n // Note: We keep the Vue proxy for reactivity by updating the object in place.\n const updatedDocument = getRaw(workspace.documents[documentName])\n\n if (!intermediateDocument || !updatedDocument) {\n return\n }\n\n // Overwrite the current document with the last saved state, discarding unsaved changes.\n applySelectiveUpdates(updatedDocument, intermediateDocument)\n },\n /**\n * Commits the specified document.\n *\n * This method is intended to finalize and persist the current state of the document,\n * potentially syncing it with a remote registry or marking it as the latest committed version.\n *\n * @param documentName - The name of the document to commit.\n * @remarks\n * The actual commit logic is not implemented yet.\n */\n commitDocument(documentName: string) {\n // TODO: Implement commit logic\n console.warn(`Commit operation for document '${documentName}' is not implemented yet.`)\n },\n /**\n * Serializes the current workspace state to a JSON string for backup, persistence, or sharing.\n *\n * This method exports all workspace documents (removing Vue reactivity proxies), workspace metadata,\n * document configurations, and both the original and intermediate document states. The resulting JSON\n * can be imported later to fully restore the workspace to this exact state, including all documents\n * and their configurations.\n *\n * @returns A JSON string representing the complete workspace state.\n */\n exportWorkspace() {\n return JSON.stringify({\n documents: {\n ...Object.fromEntries(\n Object.entries(workspace.documents).map(([name, doc]) => [\n name,\n // Extract the raw document data for export, removing any Vue reactivity wrappers.\n // When importing, the document can be wrapped again in a magic proxy.\n toRaw(getRaw(doc)),\n ]),\n ),\n },\n meta: workspaceProps?.meta ?? {},\n documentConfigs,\n originalDocuments,\n intermediateDocuments,\n } as InMemoryWorkspace)\n },\n /**\n * Imports a workspace from a serialized JSON string.\n *\n * This method parses the input string using the InMemoryWorkspaceSchema,\n * then updates the current workspace state, including documents, metadata,\n * and configuration, with the imported values.\n *\n * @param input - The serialized workspace JSON string to import.\n */\n loadWorkspace(input: string) {\n const result = coerceValue(InMemoryWorkspaceSchema, JSON.parse(input))\n\n // Assign the magic proxy to the documents\n safeAssign(\n workspace.documents,\n Object.fromEntries(Object.entries(result.documents).map(([name, doc]) => [name, createMagicProxy(doc)])),\n )\n\n safeAssign(originalDocuments, result.originalDocuments)\n safeAssign(intermediateDocuments, result.intermediateDocuments)\n safeAssign(documentConfigs, result.documentConfigs)\n safeAssign(workspace, result.meta)\n },\n }\n}\n\n// biome-ignore lint/performance/noBarrelFile: <explanation>\nexport { generateClientMutators } from '@/mutators'\n"],
5
+ "mappings": "AAAA,OAAO,UAAU;AACjB,SAAS,UAAU,aAAa;AAChC,SAAS,QAAQ,eAAe;AAChC,SAAS,iBAAiB;AAE1B,SAAS,wBAAsD;AAE/D,SAAS,kBAAkB,cAAc;AACzC,SAAS,WAAW,UAAU,kBAAkB;AAChD,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AAEvC,SAAS,+BAAuD;AAyChE,MAAM,gBAAsD;AAAA,EAC1D,6BAA6B;AAC/B;AAsBA,eAAe,aAAa,mBAA2C;AACrE,MAAI,SAAS,mBAAmB;AAC9B,WAAO,UAAU,EAAE,OAAO,kBAAkB,MAAM,CAAC,EAAE,KAAK,kBAAkB,GAAG;AAAA,EACjF;AAEA,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAM,kBAAkB;AAAA,EAC1B;AACF;AAiEO,MAAM,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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUA,cAAc,OAAe;AAC3B,YAAM,SAAS,YAAY,yBAAyB,KAAK,MAAM,KAAK,CAAC;AAGrE;AAAA,QACE,UAAU;AAAA,QACV,OAAO,YAAY,OAAO,QAAQ,OAAO,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,CAAC;AAAA,MACzG;AAEA,iBAAW,mBAAmB,OAAO,iBAAiB;AACtD,iBAAW,uBAAuB,OAAO,qBAAqB;AAC9D,iBAAW,iBAAiB,OAAO,eAAe;AAClD,iBAAW,WAAW,OAAO,IAAI;AAAA,IACnC;AAAA,EACF;AACF;AAGA,SAAS,8BAA8B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,17 @@
1
+ import { type UnknownObject } from '../helpers/general.js';
2
+ import { type Difference } from '@scalar/json-diff';
3
+ /**
4
+ * Applies updates from an updated document to an original document, while excluding changes to certain metadata keys.
5
+ *
6
+ * This function computes the differences between the original and updated documents,
7
+ * filters out any diffs that affect excluded keys (such as navigation, external references, or status fields),
8
+ * and applies only the allowed changes to the original document in place.
9
+ *
10
+ * Note: The originalDocument is mutated directly.
11
+ *
12
+ * @param originalDocument - The document to be updated (mutated in place)
13
+ * @param updatedDocument - The document containing the desired changes
14
+ * @returns A tuple: [the updated original document, array of excluded diffs that were not applied]
15
+ */
16
+ export declare const applySelectiveUpdates: (originalDocument: UnknownObject, updatedDocument: UnknownObject) => (UnknownObject | Difference[])[];
17
+ //# sourceMappingURL=apply-selective-updates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-selective-updates.d.ts","sourceRoot":"","sources":["../../src/helpers/apply-selective-updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAMhE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,qBAAsB,aAAa,mBAAmB,aAAa,qCAQpG,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { split } from "../helpers/general.js";
2
+ import { apply, diff } from "@scalar/json-diff";
3
+ const excludeKeys = /* @__PURE__ */ new Set(["x-scalar-navigation", "x-ext", "x-ext-urls", "$ref", "$status"]);
4
+ const applySelectiveUpdates = (originalDocument, updatedDocument) => {
5
+ const diffs = diff(originalDocument, updatedDocument);
6
+ const [writableDiffs, excludedDiffs] = split(diffs, (d) => !d.path.some((p) => excludeKeys.has(p)));
7
+ apply(originalDocument, writableDiffs);
8
+ return [originalDocument, excludedDiffs];
9
+ };
10
+ export {
11
+ applySelectiveUpdates
12
+ };
13
+ //# sourceMappingURL=apply-selective-updates.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/helpers/apply-selective-updates.ts"],
4
+ "sourcesContent": ["import { split, type UnknownObject } from '@/helpers/general'\nimport { apply, diff, type Difference } from '@scalar/json-diff'\n\n// Keys to exclude from the diff - these are metadata fields that should not be persisted\n// when applying updates to the original document\nconst excludeKeys = new Set(['x-scalar-navigation', 'x-ext', 'x-ext-urls', '$ref', '$status'])\n\n/**\n * Applies updates from an updated document to an original document, while excluding changes to certain metadata keys.\n *\n * This function computes the differences between the original and updated documents,\n * filters out any diffs that affect excluded keys (such as navigation, external references, or status fields),\n * and applies only the allowed changes to the original document in place.\n *\n * Note: The originalDocument is mutated directly.\n *\n * @param originalDocument - The document to be updated (mutated in place)\n * @param updatedDocument - The document containing the desired changes\n * @returns A tuple: [the updated original document, array of excluded diffs that were not applied]\n */\nexport const applySelectiveUpdates = (originalDocument: UnknownObject, updatedDocument: UnknownObject) => {\n const diffs: Difference[] = diff(originalDocument, updatedDocument)\n\n const [writableDiffs, excludedDiffs] = split(diffs, (d) => !d.path.some((p) => excludeKeys.has(p)))\n\n apply(originalDocument, writableDiffs)\n\n return [originalDocument, excludedDiffs]\n}\n"],
5
+ "mappings": "AAAA,SAAS,aAAiC;AAC1C,SAAS,OAAO,YAA6B;AAI7C,MAAM,cAAc,oBAAI,IAAI,CAAC,uBAAuB,SAAS,cAAc,QAAQ,SAAS,CAAC;AAetF,MAAM,wBAAwB,CAAC,kBAAiC,oBAAmC;AACxG,QAAM,QAAsB,KAAK,kBAAkB,eAAe;AAElE,QAAM,CAAC,eAAe,aAAa,IAAI,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,MAAM,YAAY,IAAI,CAAC,CAAC,CAAC;AAElG,QAAM,kBAAkB,aAAa;AAErC,SAAO,CAAC,kBAAkB,aAAa;AACzC;",
6
+ "names": []
7
+ }
@@ -23,4 +23,62 @@ export declare function isObject(value: unknown): value is UnknownObject;
23
23
  */
24
24
  export declare function isLocalRef(value: string): boolean;
25
25
  export declare function keyOf<T extends Record<string, unknown>>(value: T): (keyof T)[];
26
+ /**
27
+ * Deep clones a value using JSON serialization.
28
+ *
29
+ * @param value - The value to deep clone
30
+ * @template T - The type of the value
31
+ * @returns A deep clone of the value
32
+ */
33
+ export declare const deepClone: <T>(value: T) => T;
34
+ /**
35
+ * Splits an array into two arrays based on a condition.
36
+ *
37
+ * This function takes an array and a predicate function, then returns a tuple containing
38
+ * two arrays: the first contains elements that pass the condition, and the second contains
39
+ * elements that fail the condition.
40
+ *
41
+ * @param array - The array to split
42
+ * @param condition - A predicate function that determines which array each element belongs to
43
+ * @returns A tuple of two arrays: [passingElements, failingElements]
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const numbers = [1, 2, 3, 4, 5, 6]
48
+ * const [evens, odds] = split(numbers, (n) => n % 2 === 0)
49
+ * // evens: [2, 4, 6]
50
+ * // odds: [1, 3, 5]
51
+ *
52
+ * const words = ['apple', 'banana', 'cherry', 'date']
53
+ * const [longWords, shortWords] = split(words, (word) => word.length > 5)
54
+ * // longWords: ['banana', 'cherry']
55
+ * // shortWords: ['apple', 'date']
56
+ * ```
57
+ */
58
+ export declare const split: <T>(array: T[], condition: (element: T) => boolean) => [T[], T[]];
59
+ /**
60
+ * Safely assigns properties from a source object to a target object.
61
+ *
62
+ * This function uses Object.assign to copy enumerable properties from the source object
63
+ * to the target object. It's a type-safe wrapper around Object.assign that ensures
64
+ * the source object is compatible with the target object's type.
65
+ *
66
+ * @param target - The target object to assign properties to
67
+ * @param source - The source object containing properties to assign
68
+ * @template T - The type of the target object
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const target = { name: 'John', age: 30 }
73
+ * const source = { age: 31, city: 'New York' }
74
+ * safeAssign(target, source)
75
+ * // target is now: { name: 'John', age: 31, city: 'New York' }
76
+ *
77
+ * const config = { theme: 'dark', language: 'en' }
78
+ * const updates = { theme: 'light' }
79
+ * safeAssign(config, updates)
80
+ * // config is now: { theme: 'light', language: 'en' }
81
+ * ```
82
+ */
83
+ export declare const safeAssign: <T extends Record<string, unknown>>(target: T, source: Partial<T>) => void;
26
84
  //# sourceMappingURL=general.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/helpers/general.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEnD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAE/D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAClC,CAAC,MAAM,CAAC,CAAC,EAAE,CACzC"}
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/helpers/general.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEnD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAE/D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAClC,CAAC,MAAM,CAAC,CAAC,EAAE,CACzC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,CAAC,KAAG,CAEvC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,eAOtE,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,OAAO,CAAC,CAAC,CAAC,SAE1F,CAAA"}
@@ -7,9 +7,26 @@ function isLocalRef(value) {
7
7
  function keyOf(value) {
8
8
  return Object.keys(value);
9
9
  }
10
+ const deepClone = (value) => {
11
+ return JSON.parse(JSON.stringify(value));
12
+ };
13
+ const split = (array, condition) => {
14
+ return array.reduce(
15
+ ([pass, fail], item) => {
16
+ return condition(item) ? [[...pass, item], fail] : [pass, [...fail, item]];
17
+ },
18
+ [[], []]
19
+ );
20
+ };
21
+ const safeAssign = (target, source) => {
22
+ Object.assign(target, source);
23
+ };
10
24
  export {
25
+ deepClone,
11
26
  isLocalRef,
12
27
  isObject,
13
- keyOf
28
+ keyOf,
29
+ safeAssign,
30
+ split
14
31
  };
15
32
  //# sourceMappingURL=general.js.map