@itwin/workspace-editor 5.0.0-dev.98 → 5.1.0-dev.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/lib/WorkspaceEditor.js +6 -6
- package/package.json +5 -5
package/lib/WorkspaceEditor.js
CHANGED
|
@@ -80,10 +80,10 @@ function getCloudContainer(args) {
|
|
|
80
80
|
return cloudContainer;
|
|
81
81
|
}
|
|
82
82
|
function fixVersionArg(args) {
|
|
83
|
-
const dbParts =
|
|
83
|
+
const dbParts = core_backend_1.CloudSqlite.parseDbFileName(args.dbName);
|
|
84
84
|
args.dbName = dbParts.dbName;
|
|
85
85
|
args.version = args.version ?? dbParts.version;
|
|
86
|
-
args.dbFileName =
|
|
86
|
+
args.dbFileName = core_backend_1.CloudSqlite.makeSemverName(dbParts.dbName, dbParts.version);
|
|
87
87
|
}
|
|
88
88
|
/** Open for write, call a function to process, then close a WorkspaceDb */
|
|
89
89
|
async function editWorkspace(args, fn) {
|
|
@@ -287,7 +287,7 @@ async function importWorkspaceDb(args) {
|
|
|
287
287
|
async function exportWorkspaceDb(args) {
|
|
288
288
|
if (!(0, path_1.extname)(args.localFileName))
|
|
289
289
|
args.localFileName = `${args.localFileName}.${WorkspaceImpl_1.workspaceDbFileExt}`;
|
|
290
|
-
const dbParts =
|
|
290
|
+
const dbParts = core_backend_1.CloudSqlite.parseDbFileName(args.dbName);
|
|
291
291
|
if (!dbParts.version)
|
|
292
292
|
throw new Error("exportDb requires a version");
|
|
293
293
|
await performTransfer(getCloudContainer(args), "download", args);
|
|
@@ -334,9 +334,9 @@ async function detachWorkspace(args) {
|
|
|
334
334
|
async function copyWorkspaceDb(args) {
|
|
335
335
|
const container = getContainer(args);
|
|
336
336
|
const oldName = container.resolveDbFileName(args);
|
|
337
|
-
const newVersion =
|
|
338
|
-
|
|
339
|
-
const newName =
|
|
337
|
+
const newVersion = core_backend_1.CloudSqlite.parseDbFileName(args.newDbName);
|
|
338
|
+
core_backend_1.CloudSqlite.validateDbName(newVersion.dbName);
|
|
339
|
+
const newName = core_backend_1.CloudSqlite.makeSemverName(newVersion.dbName, core_backend_1.CloudSqlite.validateDbVersion(newVersion.version));
|
|
340
340
|
const cloudContainer = getCloudContainer(args);
|
|
341
341
|
await core_backend_1.CloudSqlite.withWriteLock({ ...args, container: cloudContainer }, async () => cloudContainer.copyDatabase(oldName, newName));
|
|
342
342
|
showMessage(`copied WorkspaceDb [${oldName}] to [${newName}] in ${sayContainer(args)}`);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@itwin/workspace-editor",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "lib/WorkspaceEditor.js",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.1.0-dev.0",
|
|
6
6
|
"bin": {
|
|
7
7
|
"WorkspaceEditor": "./lib/WorkspaceEditor.js"
|
|
8
8
|
},
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"glob": "^10.3.12",
|
|
19
19
|
"yargs": "^17.4.0",
|
|
20
|
-
"@itwin/core-common": "5.
|
|
21
|
-
"@itwin/core-
|
|
22
|
-
"@itwin/core-
|
|
20
|
+
"@itwin/core-common": "5.1.0-dev.0",
|
|
21
|
+
"@itwin/core-backend": "5.1.0-dev.0",
|
|
22
|
+
"@itwin/core-bentley": "5.1.0-dev.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@itwin/eslint-plugin": "5.0.0-dev.1",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"mocha": "^11.1.0",
|
|
32
32
|
"rimraf": "^6.0.1",
|
|
33
33
|
"typescript": "~5.6.2",
|
|
34
|
-
"@itwin/build-tools": "5.
|
|
34
|
+
"@itwin/build-tools": "5.1.0-dev.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc 1>&2",
|