@scalar/oas-utils 0.15.0 → 0.15.2
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-to-indexdb.d.ts","sourceRoot":"","sources":["../../src/migrations/migrate-to-indexdb.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate-to-indexdb.d.ts","sourceRoot":"","sources":["../../src/migrations/migrate-to-indexdb.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAA;AAOrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAgB3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAOnE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,qBA6CxC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GACjC,sBAAsB,OAAO,CAAC,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,WAAW,CAAC,KAC7F,OAAO,CAAC,OAAO,CAiBjB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,GAAU,YAAY;IAC/D,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CAC/B;;;;IA8IA,CAAA"}
|
|
@@ -3,6 +3,7 @@ import { extractConfigSecrets, removeSecretFields } from '@scalar/helpers/genera
|
|
|
3
3
|
import { CONTENT_TYPES } from '@scalar/helpers/http/content-types';
|
|
4
4
|
import { objectEntries } from '@scalar/helpers/object/object-entries';
|
|
5
5
|
import { toJsonCompatible } from '@scalar/helpers/object/to-json-compatible';
|
|
6
|
+
import { slugger } from '@scalar/helpers/string/slugger';
|
|
6
7
|
import { extractServerFromPath } from '@scalar/helpers/url/extract-server-from-path';
|
|
7
8
|
import { presets } from '@scalar/themes';
|
|
8
9
|
import { createWorkspaceStore } from '@scalar/workspace-store/client';
|
|
@@ -12,7 +13,6 @@ import { xScalarEnvironmentSchema, } from '@scalar/workspace-store/schemas/exten
|
|
|
12
13
|
import { xScalarCookieSchema } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
13
14
|
import { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce';
|
|
14
15
|
import { ColorModeSchema } from '@scalar/workspace-store/schemas/workspace';
|
|
15
|
-
import GithubSlugger from 'github-slugger';
|
|
16
16
|
import { migrator } from '../migrations/migrator.js';
|
|
17
17
|
const DRAFTS_DOCUMENT_NAME = 'drafts';
|
|
18
18
|
const MAX_CONCURRENT_DB_WRITES = 100;
|
|
@@ -102,7 +102,7 @@ export const transformLegacyDataToWorkspace = async (legacyData) => {
|
|
|
102
102
|
/** Grab auth from the collections */
|
|
103
103
|
const workspaceAuth = {};
|
|
104
104
|
/** Create a slugger instance per workspace to handle duplicate document names */
|
|
105
|
-
const
|
|
105
|
+
const { slug } = slugger();
|
|
106
106
|
/** Each collection becomes a document in the new system and grab the auth as well */
|
|
107
107
|
const documents = workspace.collections.flatMap((uid) => {
|
|
108
108
|
const collection = legacyData.records.collections[uid];
|
|
@@ -114,7 +114,7 @@ export const transformLegacyDataToWorkspace = async (legacyData) => {
|
|
|
114
114
|
// Normalize document name to match the store (lowercase "Drafts" → "drafts")
|
|
115
115
|
const normalizedName = documentName === 'Drafts' ? 'drafts' : documentName;
|
|
116
116
|
// Use GitHubSlugger to ensure unique document names
|
|
117
|
-
const uniqueName =
|
|
117
|
+
const uniqueName = slug(normalizedName);
|
|
118
118
|
workspaceAuth[uniqueName] = auth;
|
|
119
119
|
return { name: uniqueName, document };
|
|
120
120
|
});
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"specification",
|
|
17
17
|
"yaml"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.15.
|
|
19
|
+
"version": "0.15.2",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -41,13 +41,12 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"flatted": "^3.4.0",
|
|
44
|
-
"github-slugger": "2.0.0",
|
|
45
44
|
"vue": "^3.5.30",
|
|
46
45
|
"yaml": "^2.8.3",
|
|
47
|
-
"@scalar/helpers": "0.5.4",
|
|
48
46
|
"@scalar/themes": "0.15.3",
|
|
49
|
-
"@scalar/
|
|
50
|
-
"@scalar/
|
|
47
|
+
"@scalar/types": "0.9.6",
|
|
48
|
+
"@scalar/workspace-store": "0.49.2",
|
|
49
|
+
"@scalar/helpers": "0.6.0"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
52
|
"@types/node": "^24.1.0",
|