@scalar/api-client 3.0.0 → 3.1.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 +14 -0
- package/README.md +41 -0
- package/dist/plugins/posthog/index.d.ts +23 -0
- package/dist/plugins/posthog/index.d.ts.map +1 -0
- package/dist/plugins/posthog/index.js +58 -0
- package/dist/plugins/posthog/index.js.map +1 -0
- package/dist/style.css +78 -18
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +14 -12
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +5 -2
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +5 -2
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts +8 -9
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +8 -10
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +2 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +7 -3
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +19 -12
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +3 -2
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +12 -6
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts +2 -0
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +34 -14
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/process-response-body.d.ts +1 -1
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -3
- package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts +11 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js +44 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts +14 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +13 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js.map +1 -1
- package/dist/v2/features/app/App.vue.script.js +15 -3
- package/dist/v2/features/app/App.vue.script.js.map +1 -1
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-temp-operation.js +4 -1
- package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +1 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js +26 -21
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts +14 -0
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js +19 -0
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +1 -1
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js.map +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/package.json +19 -14
- package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +0 -11
- package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js +0 -24
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js.map +0 -1
- package/dist/v2/posthog.d.ts +0 -3
- package/dist/v2/posthog.d.ts.map +0 -1
- package/dist/v2/posthog.js +0 -20
- package/dist/v2/posthog.js.map +0 -1
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "3.
|
|
21
|
+
"version": "3.1.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
@@ -39,6 +39,11 @@
|
|
|
39
39
|
"require": "./dist/css/*.css",
|
|
40
40
|
"default": "./dist/css/*.css"
|
|
41
41
|
},
|
|
42
|
+
"./plugins/posthog": {
|
|
43
|
+
"import": "./dist/plugins/posthog/index.js",
|
|
44
|
+
"types": "./dist/plugins/posthog/index.d.ts",
|
|
45
|
+
"default": "./dist/plugins/posthog/index.js"
|
|
46
|
+
},
|
|
42
47
|
"./components/Server": {
|
|
43
48
|
"import": "./dist/components/Server/index.js",
|
|
44
49
|
"types": "./dist/components/Server/index.d.ts",
|
|
@@ -318,7 +323,6 @@
|
|
|
318
323
|
"monaco-editor": "0.55.1",
|
|
319
324
|
"monaco-yaml": "5.4.1",
|
|
320
325
|
"nanoid": "^5.1.6",
|
|
321
|
-
"posthog-js": "1.363.2",
|
|
322
326
|
"pretty-ms": "^9.3.0",
|
|
323
327
|
"radix-vue": "^1.9.17",
|
|
324
328
|
"set-cookie-parser": "3.1.0",
|
|
@@ -328,21 +332,21 @@
|
|
|
328
332
|
"vue-router": "5.0.4",
|
|
329
333
|
"yaml": "^2.8.0",
|
|
330
334
|
"zod": "^4.3.5",
|
|
331
|
-
"@scalar/components": "0.22.
|
|
332
|
-
"@scalar/
|
|
335
|
+
"@scalar/components": "0.22.1",
|
|
336
|
+
"@scalar/json-magic": "0.12.7",
|
|
337
|
+
"@scalar/oas-utils": "0.13.0",
|
|
333
338
|
"@scalar/icons": "0.7.2",
|
|
334
|
-
"@scalar/json-magic": "0.12.6",
|
|
335
|
-
"@scalar/oas-utils": "0.12.0",
|
|
336
339
|
"@scalar/openapi-types": "0.7.0",
|
|
337
|
-
"@scalar/
|
|
338
|
-
"@scalar/
|
|
339
|
-
"@scalar/snippetz": "0.9.
|
|
340
|
-
"@scalar/use-codemirror": "0.14.11",
|
|
341
|
-
"@scalar/types": "0.9.0",
|
|
340
|
+
"@scalar/postman-to-openapi": "0.6.3",
|
|
341
|
+
"@scalar/sidebar": "0.9.2",
|
|
342
|
+
"@scalar/snippetz": "0.9.1",
|
|
342
343
|
"@scalar/themes": "0.15.3",
|
|
344
|
+
"@scalar/types": "0.9.1",
|
|
345
|
+
"@scalar/use-codemirror": "0.14.11",
|
|
343
346
|
"@scalar/use-hooks": "0.4.2",
|
|
344
|
-
"@scalar/
|
|
345
|
-
"@scalar/
|
|
347
|
+
"@scalar/use-toasts": "0.10.1",
|
|
348
|
+
"@scalar/workspace-store": "0.46.1",
|
|
349
|
+
"@scalar/helpers": "0.5.1"
|
|
346
350
|
},
|
|
347
351
|
"devDependencies": {
|
|
348
352
|
"@tailwindcss/vite": "^4.2.0",
|
|
@@ -352,11 +356,12 @@
|
|
|
352
356
|
"fake-indexeddb": "6.2.3",
|
|
353
357
|
"fastify": "^5.8.1",
|
|
354
358
|
"jsdom": "27.4.0",
|
|
359
|
+
"posthog-js": "1.363.2",
|
|
355
360
|
"tailwindcss": "^4.1.18",
|
|
356
361
|
"vite": "8.0.0",
|
|
357
362
|
"vite-svg-loader": "5.1.1",
|
|
358
363
|
"vitest": "4.1.0",
|
|
359
|
-
"@scalar/pre-post-request-scripts": "0.4.
|
|
364
|
+
"@scalar/pre-post-request-scripts": "0.4.3"
|
|
360
365
|
},
|
|
361
366
|
"scripts": {
|
|
362
367
|
"build": "vite build && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the given string content is a Postman collection.
|
|
3
|
-
*
|
|
4
|
-
* Validates by checking for the `_postman_id` in the info object
|
|
5
|
-
* and ensuring the schema URL's host matches 'schema.getpostman.com'.
|
|
6
|
-
*
|
|
7
|
-
* @param content - The JSON string which may be a Postman collection
|
|
8
|
-
* @returns True if the content is a valid Postman collection
|
|
9
|
-
*/
|
|
10
|
-
export declare const isPostmanCollection: (content: string) => boolean;
|
|
11
|
-
//# sourceMappingURL=is-postman-collection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-postman-collection.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/helpers/is-postman-collection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,OAWrD,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//#region src/v2/features/command-palette/helpers/is-postman-collection.ts
|
|
2
|
-
/**
|
|
3
|
-
* Checks if the given string content is a Postman collection.
|
|
4
|
-
*
|
|
5
|
-
* Validates by checking for the `_postman_id` in the info object
|
|
6
|
-
* and ensuring the schema URL's host matches 'schema.getpostman.com'.
|
|
7
|
-
*
|
|
8
|
-
* @param content - The JSON string which may be a Postman collection
|
|
9
|
-
* @returns True if the content is a valid Postman collection
|
|
10
|
-
*/
|
|
11
|
-
var isPostmanCollection = (content) => {
|
|
12
|
-
try {
|
|
13
|
-
const parsed = JSON.parse(content);
|
|
14
|
-
const hasPostmanId = parsed.info?._postman_id !== void 0;
|
|
15
|
-
const hasValidSchema = parsed.info?.schema && new URL(parsed.info.schema).host === "schema.getpostman.com";
|
|
16
|
-
return hasPostmanId && hasValidSchema;
|
|
17
|
-
} catch {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
//#endregion
|
|
22
|
-
export { isPostmanCollection };
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=is-postman-collection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-postman-collection.js","names":[],"sources":["../../../../../src/v2/features/command-palette/helpers/is-postman-collection.ts"],"sourcesContent":["/**\n * Checks if the given string content is a Postman collection.\n *\n * Validates by checking for the `_postman_id` in the info object\n * and ensuring the schema URL's host matches 'schema.getpostman.com'.\n *\n * @param content - The JSON string which may be a Postman collection\n * @returns True if the content is a valid Postman collection\n */\nexport const isPostmanCollection = (content: string): boolean => {\n try {\n const parsed = JSON.parse(content)\n\n const hasPostmanId = parsed.info?._postman_id !== undefined\n const hasValidSchema = parsed.info?.schema && new URL(parsed.info.schema).host === 'schema.getpostman.com'\n\n return hasPostmanId && hasValidSchema\n } catch {\n return false\n }\n}\n"],"mappings":";;;;;;;;;;AASA,IAAa,uBAAuB,YAA6B;AAC/D,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,QAAQ;EAElC,MAAM,eAAe,OAAO,MAAM,gBAAgB,KAAA;EAClD,MAAM,iBAAiB,OAAO,MAAM,UAAU,IAAI,IAAI,OAAO,KAAK,OAAO,CAAC,SAAS;AAEnF,SAAO,gBAAgB;SACjB;AACN,SAAO"}
|
package/dist/v2/posthog.d.ts
DELETED
package/dist/v2/posthog.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posthog.d.ts","sourceRoot":"","sources":["../../src/v2/posthog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAS,MAAM,KAAK,CAAA;AAarC,eAAO,MAAM,UAAU,GAAI,SAAS,GAAG,CAAC,OAAO,CAAC,SAY/C,CAAA"}
|
package/dist/v2/posthog.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { watch } from "vue";
|
|
2
|
-
import ph from "posthog-js";
|
|
3
|
-
//#region src/v2/posthog.ts
|
|
4
|
-
var posthog = ph.init("phc_3elIjSOvGOo5aEwg6krzIY9IcQiRubsBtglOXsQ4Uu4", {
|
|
5
|
-
api_host: "https://magic.scalar.com",
|
|
6
|
-
ui_host: "https://us.posthog.com",
|
|
7
|
-
defaults: "2025-11-30",
|
|
8
|
-
opt_out_capturing_by_default: true
|
|
9
|
-
});
|
|
10
|
-
posthog.register({ product: "api-client" });
|
|
11
|
-
var usePosthog = (enabled) => {
|
|
12
|
-
watch(enabled, (value) => {
|
|
13
|
-
if (value) posthog.opt_in_capturing();
|
|
14
|
-
else posthog.opt_out_capturing();
|
|
15
|
-
}, { immediate: true });
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { usePosthog };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=posthog.js.map
|
package/dist/v2/posthog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posthog.js","names":[],"sources":["../../src/v2/posthog.ts"],"sourcesContent":["import ph from 'posthog-js'\nimport { type Ref, watch } from 'vue'\n\nconst posthog = ph.init('phc_3elIjSOvGOo5aEwg6krzIY9IcQiRubsBtglOXsQ4Uu4', {\n api_host: 'https://magic.scalar.com',\n ui_host: 'https://us.posthog.com',\n defaults: '2025-11-30',\n opt_out_capturing_by_default: true,\n})\n\nposthog.register({\n product: 'api-client',\n})\n\nexport const usePosthog = (enabled: Ref<boolean>) => {\n watch(\n enabled,\n (value) => {\n if (value) {\n posthog.opt_in_capturing()\n } else {\n posthog.opt_out_capturing()\n }\n },\n { immediate: true },\n )\n}\n"],"mappings":";;;AAGA,IAAM,UAAU,GAAG,KAAK,mDAAmD;CACzE,UAAU;CACV,SAAS;CACT,UAAU;CACV,8BAA8B;CAC/B,CAAC;AAEF,QAAQ,SAAS,EACf,SAAS,cACV,CAAC;AAEF,IAAa,cAAc,YAA0B;AACnD,OACE,UACC,UAAU;AACT,MAAI,MACF,SAAQ,kBAAkB;MAE1B,SAAQ,mBAAmB;IAG/B,EAAE,WAAW,MAAM,CACpB"}
|