@scalar/workspace-store 0.18.1 → 0.20.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 +28 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +2 -2
- package/dist/events/definitions/auth.d.ts +77 -14
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/events/definitions/document.d.ts +5 -1
- package/dist/events/definitions/document.d.ts.map +1 -1
- package/dist/events/definitions/index.d.ts +1 -2
- package/dist/events/definitions/index.d.ts.map +1 -1
- package/dist/events/definitions/operation.d.ts +200 -0
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/server.d.ts +20 -28
- package/dist/events/definitions/server.d.ts.map +1 -1
- package/dist/events/definitions/ui.d.ts +5 -0
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js.map +2 -2
- package/dist/helpers/generate-unique-value.d.ts +40 -0
- package/dist/helpers/generate-unique-value.d.ts.map +1 -0
- package/dist/helpers/generate-unique-value.js +42 -0
- package/dist/helpers/generate-unique-value.js.map +7 -0
- package/dist/helpers/overrides-proxy.d.ts.map +1 -1
- package/dist/helpers/overrides-proxy.js +1 -1
- package/dist/helpers/overrides-proxy.js.map +2 -2
- package/dist/helpers/unpack-proxy.d.ts +1 -1
- package/dist/helpers/unpack-proxy.d.ts.map +1 -1
- package/dist/helpers/unpack-proxy.js.map +2 -2
- package/dist/mutators/auth.d.ts +147 -0
- package/dist/mutators/auth.d.ts.map +1 -0
- package/dist/mutators/auth.js +156 -0
- package/dist/mutators/auth.js.map +7 -0
- package/dist/mutators/document.d.ts +6 -0
- package/dist/mutators/document.d.ts.map +1 -0
- package/dist/mutators/document.js +10 -0
- package/dist/mutators/document.js.map +7 -0
- package/dist/mutators/index.d.ts +12 -7
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/index.js +74 -1
- package/dist/mutators/index.js.map +3 -3
- package/dist/mutators/operation.d.ts +313 -0
- package/dist/mutators/operation.d.ts.map +1 -0
- package/dist/mutators/operation.js +340 -0
- package/dist/mutators/operation.js.map +7 -0
- package/dist/mutators/server.d.ts +43 -8
- package/dist/mutators/server.d.ts.map +1 -1
- package/dist/mutators/server.js +112 -20
- package/dist/mutators/server.js.map +2 -2
- package/dist/navigation/helpers/traverse-document.d.ts +1 -0
- package/dist/navigation/helpers/traverse-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-document.js +2 -1
- package/dist/navigation/helpers/traverse-document.js.map +2 -2
- package/dist/plugins/client/persistence.d.ts +2 -1
- package/dist/plugins/client/persistence.d.ts.map +1 -1
- package/dist/plugins/client/persistence.js +11 -9
- package/dist/plugins/client/persistence.js.map +2 -2
- package/dist/schemas/extensions/document/x-scalar-document-security.d.ts +13 -0
- package/dist/schemas/extensions/document/x-scalar-document-security.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-scalar-document-security.js +8 -0
- package/dist/schemas/extensions/document/x-scalar-document-security.js.map +7 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.d.ts +13 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.js +9 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.js.map +7 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.d.ts +21 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js +8 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts +17 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.js +14 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.js.map +7 -0
- package/dist/schemas/extensions/server/x-scalar-selected-server.d.ts +8 -0
- package/dist/schemas/extensions/server/x-scalar-selected-server.d.ts.map +1 -0
- package/dist/schemas/extensions/server/x-scalar-selected-server.js +8 -0
- package/dist/schemas/extensions/server/x-scalar-selected-server.js.map +7 -0
- package/dist/schemas/inmemory-workspace.d.ts +44 -8
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/navigation.d.ts +5 -0
- package/dist/schemas/navigation.d.ts.map +1 -1
- package/dist/schemas/navigation.js +1 -0
- package/dist/schemas/navigation.js.map +2 -2
- package/dist/schemas/reference-config/index.d.ts +22 -4
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +22 -4
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +752 -138
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +12 -1
- package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
- package/dist/schemas/v3.1/strict/operation.d.ts +10 -6
- package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/operation.js +9 -7
- package/dist/schemas/v3.1/strict/operation.js.map +2 -2
- package/dist/schemas/v3.1/strict/request-body.d.ts +6 -3
- package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/request-body.js +15 -8
- package/dist/schemas/v3.1/strict/request-body.js.map +2 -2
- package/dist/schemas/workspace-specification/config.d.ts +22 -4
- package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
- package/dist/schemas/workspace-specification/index.d.ts +22 -4
- package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
- package/dist/schemas/workspace.d.ts +154 -28
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/helpers/debounce.d.ts +0 -28
- package/dist/helpers/debounce.d.ts.map +0 -1
- package/dist/helpers/debounce.js +0 -31
- package/dist/helpers/debounce.js.map +0 -7
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"openapi",
|
|
17
17
|
"scalar"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.
|
|
19
|
+
"version": "0.20.0",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -93,12 +93,12 @@
|
|
|
93
93
|
"type-fest": "5.0.0",
|
|
94
94
|
"vue": "^3.5.21",
|
|
95
95
|
"yaml": "2.8.0",
|
|
96
|
-
"@scalar/helpers": "0.
|
|
97
|
-
"@scalar/
|
|
96
|
+
"@scalar/helpers": "0.1.1",
|
|
97
|
+
"@scalar/code-highlight": "0.2.0",
|
|
98
|
+
"@scalar/json-magic": "0.8.1",
|
|
99
|
+
"@scalar/openapi-upgrader": "0.1.4",
|
|
98
100
|
"@scalar/snippetz": "0.5.2",
|
|
99
101
|
"@scalar/types": "0.4.0",
|
|
100
|
-
"@scalar/openapi-upgrader": "0.1.4",
|
|
101
|
-
"@scalar/code-highlight": "0.2.0",
|
|
102
102
|
"@scalar/themes": "0.13.23"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options for configuring the debounce behavior.
|
|
3
|
-
*/
|
|
4
|
-
export type DebounceOptions = {
|
|
5
|
-
/** The delay in milliseconds before executing the function. Defaults to 100ms. */
|
|
6
|
-
delay?: number;
|
|
7
|
-
/** Custom separator for joining key parts. Defaults to a null byte to prevent collisions. */
|
|
8
|
-
separator?: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Creates a debounced function executor that delays execution until after a specified time.
|
|
12
|
-
* Multiple calls with the same key will cancel previous pending executions.
|
|
13
|
-
*
|
|
14
|
-
* This is useful for batching rapid updates (like auto-save or API calls) to avoid
|
|
15
|
-
* unnecessary processing or network requests.
|
|
16
|
-
*
|
|
17
|
-
* @param options - Configuration options for delay and key separator
|
|
18
|
-
* @returns A function that accepts a key array and callback to execute
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* const debouncedSave = debounce({ delay: 500 })
|
|
22
|
-
* debouncedSave(['user', '123'], () => saveUser(user))
|
|
23
|
-
*/
|
|
24
|
-
export declare const debounce: (options?: DebounceOptions) => {
|
|
25
|
-
execute: (key: readonly string[], fn: () => unknown | Promise<unknown>) => void;
|
|
26
|
-
cleanup: () => void;
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=debounce.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/helpers/debounce.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAS,eAAoB;mBAsB9B,SAAS,MAAM,EAAE,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAG,IAAI;mBAdhE,IAAI;CAyCzB,CAAA"}
|
package/dist/helpers/debounce.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const debounce = (options = {}) => {
|
|
2
|
-
const { delay = 100, separator = "\0" } = options;
|
|
3
|
-
const timeouts = /* @__PURE__ */ new Map();
|
|
4
|
-
const cleanup = () => {
|
|
5
|
-
for (const timeout of timeouts.values()) {
|
|
6
|
-
clearTimeout(timeout);
|
|
7
|
-
}
|
|
8
|
-
timeouts.clear();
|
|
9
|
-
};
|
|
10
|
-
const execute = (key, fn) => {
|
|
11
|
-
const compositeKey = `${key.join(separator)}-${key.length}`;
|
|
12
|
-
const existingTimeout = timeouts.get(compositeKey);
|
|
13
|
-
if (existingTimeout !== void 0) {
|
|
14
|
-
clearTimeout(existingTimeout);
|
|
15
|
-
}
|
|
16
|
-
const timeout = setTimeout(() => {
|
|
17
|
-
try {
|
|
18
|
-
fn();
|
|
19
|
-
} catch {
|
|
20
|
-
} finally {
|
|
21
|
-
timeouts.delete(compositeKey);
|
|
22
|
-
}
|
|
23
|
-
}, delay);
|
|
24
|
-
timeouts.set(compositeKey, timeout);
|
|
25
|
-
};
|
|
26
|
-
return { execute, cleanup };
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
debounce
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=debounce.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/helpers/debounce.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Options for configuring the debounce behavior.\n */\nexport type DebounceOptions = {\n /** The delay in milliseconds before executing the function. Defaults to 100ms. */\n delay?: number\n /** Custom separator for joining key parts. Defaults to a null byte to prevent collisions. */\n separator?: string\n}\n\n/**\n * Creates a debounced function executor that delays execution until after a specified time.\n * Multiple calls with the same key will cancel previous pending executions.\n *\n * This is useful for batching rapid updates (like auto-save or API calls) to avoid\n * unnecessary processing or network requests.\n *\n * @param options - Configuration options for delay and key separator\n * @returns A function that accepts a key array and callback to execute\n *\n * @example\n * const debouncedSave = debounce({ delay: 500 })\n * debouncedSave(['user', '123'], () => saveUser(user))\n */\nexport const debounce = (options: DebounceOptions = {}) => {\n const { delay = 100, separator = '\\0' } = options\n const timeouts = new Map<string, ReturnType<typeof setTimeout>>()\n\n /**\n * Cleanup function to clear all pending timeouts.\n * Call this when you need to cancel all pending operations (e.g., component unmount).\n */\n const cleanup = (): void => {\n for (const timeout of timeouts.values()) {\n clearTimeout(timeout)\n }\n timeouts.clear()\n }\n\n /**\n * Schedules a function to run after the configured delay.\n * If called again with the same key before the delay expires, the previous call is cancelled.\n *\n * @param key - Array of strings to uniquely identify this operation\n * @param fn - The function to execute after the delay\n */\n const execute = (key: readonly string[], fn: () => unknown | Promise<unknown>): void => {\n // Add the length of the key to the composite key to prevent collisions\n const compositeKey = `${key.join(separator)}-${key.length}`\n\n // Cancel any existing timeout for this key\n const existingTimeout = timeouts.get(compositeKey)\n if (existingTimeout !== undefined) {\n clearTimeout(existingTimeout)\n }\n\n // Schedule the new timeout\n const timeout = setTimeout(() => {\n try {\n // biome-ignore lint/nursery/noFloatingPromises: No need to await for the result, fire and forget\n fn()\n } catch {\n // do not throw if the function throws\n } finally {\n // Always clean up the timeout reference, even if fn throws\n timeouts.delete(compositeKey)\n }\n }, delay)\n\n timeouts.set(compositeKey, timeout)\n }\n\n return { execute, cleanup }\n}\n"],
|
|
5
|
-
"mappings": "AAwBO,MAAM,WAAW,CAAC,UAA2B,CAAC,MAAM;AACzD,QAAM,EAAE,QAAQ,KAAK,YAAY,KAAK,IAAI;AAC1C,QAAM,WAAW,oBAAI,IAA2C;AAMhE,QAAM,UAAU,MAAY;AAC1B,eAAW,WAAW,SAAS,OAAO,GAAG;AACvC,mBAAa,OAAO;AAAA,IACtB;AACA,aAAS,MAAM;AAAA,EACjB;AASA,QAAM,UAAU,CAAC,KAAwB,OAA+C;AAEtF,UAAM,eAAe,GAAG,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,MAAM;AAGzD,UAAM,kBAAkB,SAAS,IAAI,YAAY;AACjD,QAAI,oBAAoB,QAAW;AACjC,mBAAa,eAAe;AAAA,IAC9B;AAGA,UAAM,UAAU,WAAW,MAAM;AAC/B,UAAI;AAEF,WAAG;AAAA,MACL,QAAQ;AAAA,MAER,UAAE;AAEA,iBAAS,OAAO,YAAY;AAAA,MAC9B;AAAA,IACF,GAAG,KAAK;AAER,aAAS,IAAI,cAAc,OAAO;AAAA,EACpC;AAEA,SAAO,EAAE,SAAS,QAAQ;AAC5B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|