@scalar/api-client 2.42.0 → 2.43.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.
- package/CHANGELOG.md +11 -0
- package/dist/libs/normalize-headers.d.ts.map +1 -1
- package/dist/libs/normalize-headers.js +1 -0
- package/dist/libs/normalize-headers.js.map +1 -1
- package/dist/style.css +76 -35
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +23 -2
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js +32 -9
- package/dist/v2/blocks/response-block/components/ResponseCookies.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +8 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.script.js +9 -4
- package/dist/v2/components/sidebar/Sidebar.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +8 -0
- package/dist/v2/features/app/app-events.js.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.script.js +19 -10
- package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts +3 -0
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.script.js +30 -30
- package/dist/v2/features/app/components/SidebarItemMenu.vue.script.js.map +1 -1
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts +14 -0
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/create-temp-operation.js +52 -0
- package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.script.js +1 -1
- package/package.json +12 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-temp-operation.js","names":[],"sources":["../../../../../src/v2/features/app/helpers/create-temp-operation.ts"],"sourcesContent":["import type { WorkspaceEventBus } from '@scalar/workspace-store/events'\n\n/**\n * Generates a unique temporary operation path for a new operation.\n * Tries up to 10 times to generate a non-colliding path, then falls back to a static path.\n *\n * Example:\n * const existingPaths = new Set(['/tempabcd1234', '/tempdeadbeef']);\n * const newPath = generateUniquePath('my-doc', existingPaths); // e.g. \"/tempa1b2c3d4\"\n *\n * @param existingPaths - Set of paths already present in the document to avoid collisions\n * @param attempts - Used internally to limit recursion (default: 0)\n * @returns A unique operation path (e.g., \"/temp1234abcd\")\n */\nconst generateUniquePath = (existingPaths: Set<string>, attempts: number = 0) => {\n if (attempts > 10) {\n // After 10 failed attempts, fallback to a generic path\n return '/temp-path'\n }\n\n // Generate a random path using a truncated UUID for uniqueness\n const path = `/temp${crypto.randomUUID().slice(0, 8)}`\n\n if (existingPaths.has(path)) {\n // If path exists, try again recursively with incremented attempts\n return generateUniquePath(existingPaths, attempts + 1)\n }\n\n return path\n}\n\n/**\n * Creates a temporary operation with a unique path, emits its creation on the event bus,\n * then navigates to the operation and focuses the address bar if successful.\n * @param documentName - The name of the document to add the operation to\n * @param existingPaths - Set of existing operation paths for uniqueness checking\n * @param eventBus - The workspace event bus to emit events on\n */\nexport const createTempOperation = (\n documentName: string,\n options: {\n existingPaths: Set<string>\n eventBus: WorkspaceEventBus\n tags?: string[]\n },\n) => {\n const uniquePath = generateUniquePath(options.existingPaths)\n\n options.eventBus.emit('operation:create:operation', {\n documentName,\n path: uniquePath,\n method: 'get',\n operation: {\n tags: options.tags ?? [],\n },\n callback: (success) => {\n if (success) {\n options.eventBus.emit('ui:navigate', {\n page: 'example',\n documentSlug: documentName,\n path: uniquePath,\n method: 'get',\n exampleName: 'default',\n callback: async () => {\n await new Promise((resolve) => requestAnimationFrame(resolve))\n // Focus the address bar, clearing its contents after navigation\n options.eventBus.emit('ui:focus:address-bar', {\n clear: true,\n })\n },\n })\n }\n },\n })\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,IAAM,sBAAsB,eAA4B,WAAmB,MAAM;AAC/E,KAAI,WAAW,GAEb,QAAO;CAIT,MAAM,OAAO,QAAQ,OAAO,YAAY,CAAC,MAAM,GAAG,EAAE;AAEpD,KAAI,cAAc,IAAI,KAAK,CAEzB,QAAO,mBAAmB,eAAe,WAAW,EAAE;AAGxD,QAAO;;;;;;;;;AAUT,IAAa,uBACX,cACA,YAKG;CACH,MAAM,aAAa,mBAAmB,QAAQ,cAAc;AAE5D,SAAQ,SAAS,KAAK,8BAA8B;EAClD;EACA,MAAM;EACN,QAAQ;EACR,WAAW,EACT,MAAM,QAAQ,QAAQ,EAAE,EACzB;EACD,WAAW,YAAY;AACrB,OAAI,QACF,SAAQ,SAAS,KAAK,eAAe;IACnC,MAAM;IACN,cAAc;IACd,MAAM;IACN,QAAQ;IACR,aAAa;IACb,UAAU,YAAY;AACpB,WAAM,IAAI,SAAS,YAAY,sBAAsB,QAAQ,CAAC;AAE9D,aAAQ,SAAS,KAAK,wBAAwB,EAC5C,OAAO,MACR,CAAC;;IAEL,CAAC;;EAGP,CAAC"}
|
|
@@ -45,7 +45,7 @@ var ResponseEmpty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
45
45
|
const handleHotKey = (event) => {
|
|
46
46
|
if (event?.createNew && route.name === "request") addRequest();
|
|
47
47
|
};
|
|
48
|
-
const packageVersion = "2.
|
|
48
|
+
const packageVersion = "2.43.0";
|
|
49
49
|
onMounted(() => events.hotKeys.on(handleHotKey));
|
|
50
50
|
onBeforeUnmount(() => events.hotKeys.off(handleHotKey));
|
|
51
51
|
return (_ctx, _cache) => {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.
|
|
21
|
+
"version": "2.43.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
@@ -323,6 +323,7 @@
|
|
|
323
323
|
"@types/har-format": "^1.2.16",
|
|
324
324
|
"@vueuse/core": "13.9.0",
|
|
325
325
|
"@vueuse/integrations": "13.9.0",
|
|
326
|
+
"cookie": "1.1.1",
|
|
326
327
|
"focus-trap": "^7.8.0",
|
|
327
328
|
"fuse.js": "^7.1.0",
|
|
328
329
|
"js-base64": "^3.7.8",
|
|
@@ -333,6 +334,7 @@
|
|
|
333
334
|
"posthog-js": "1.363.2",
|
|
334
335
|
"pretty-ms": "^9.3.0",
|
|
335
336
|
"radix-vue": "^1.9.17",
|
|
337
|
+
"set-cookie-parser": "3.1.0",
|
|
336
338
|
"shell-quote": "^1.8.3",
|
|
337
339
|
"type-fest": "^5.3.1",
|
|
338
340
|
"vite-plugin-monaco-editor": "^1.1.0",
|
|
@@ -341,24 +343,24 @@
|
|
|
341
343
|
"whatwg-mimetype": "4.0.0",
|
|
342
344
|
"yaml": "^2.8.0",
|
|
343
345
|
"zod": "^4.3.5",
|
|
344
|
-
"@scalar/components": "0.21.
|
|
345
|
-
"@scalar/icons": "0.7.2",
|
|
346
|
+
"@scalar/components": "0.21.4",
|
|
346
347
|
"@scalar/draggable": "0.4.1",
|
|
347
348
|
"@scalar/helpers": "0.4.3",
|
|
348
|
-
"@scalar/
|
|
349
|
+
"@scalar/icons": "0.7.2",
|
|
350
|
+
"@scalar/oas-utils": "0.11.1",
|
|
349
351
|
"@scalar/json-magic": "0.12.5",
|
|
350
|
-
"@scalar/
|
|
352
|
+
"@scalar/import": "0.5.4",
|
|
351
353
|
"@scalar/object-utils": "1.3.4",
|
|
352
354
|
"@scalar/openapi-types": "0.7.0",
|
|
355
|
+
"@scalar/sidebar": "0.9.0",
|
|
353
356
|
"@scalar/postman-to-openapi": "0.6.1",
|
|
354
357
|
"@scalar/snippetz": "0.8.0",
|
|
355
|
-
"@scalar/themes": "0.15.
|
|
358
|
+
"@scalar/themes": "0.15.3",
|
|
356
359
|
"@scalar/types": "0.8.0",
|
|
357
|
-
"@scalar/sidebar": "0.8.19",
|
|
358
360
|
"@scalar/use-hooks": "0.4.2",
|
|
359
|
-
"@scalar/
|
|
361
|
+
"@scalar/use-codemirror": "0.14.11",
|
|
360
362
|
"@scalar/use-toasts": "0.10.1",
|
|
361
|
-
"@scalar/
|
|
363
|
+
"@scalar/workspace-store": "0.45.0"
|
|
362
364
|
},
|
|
363
365
|
"devDependencies": {
|
|
364
366
|
"@tailwindcss/vite": "^4.2.0",
|
|
@@ -374,7 +376,7 @@
|
|
|
374
376
|
"vite-svg-loader": "5.1.1",
|
|
375
377
|
"vitest": "4.1.0",
|
|
376
378
|
"@scalar/galaxy": "0.6.2",
|
|
377
|
-
"@scalar/pre-post-request-scripts": "0.4.
|
|
379
|
+
"@scalar/pre-post-request-scripts": "0.4.1"
|
|
378
380
|
},
|
|
379
381
|
"scripts": {
|
|
380
382
|
"build": "vite build && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|