@itwin/core-backend 5.9.0-dev.1 → 5.9.0-dev.3
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 +18 -1
- package/lib/cjs/IModelHost.d.ts +36 -1
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +80 -0
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts +18 -3
- package/lib/cjs/internal/workspace/SettingsEditorImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/SettingsEditorImpl.js +49 -242
- package/lib/cjs/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts +0 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +70 -41
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +11 -5
- package/lib/cjs/workspace/Settings.d.ts.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsDb.d.ts +20 -99
- package/lib/cjs/workspace/SettingsDb.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsDb.js +23 -7
- package/lib/cjs/workspace/SettingsDb.js.map +1 -1
- package/lib/cjs/workspace/SettingsEditor.d.ts +40 -226
- package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsEditor.js +86 -25
- package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +7 -11
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.d.ts +14 -0
- package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +36 -1
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +82 -2
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts +18 -3
- package/lib/esm/internal/workspace/SettingsEditorImpl.d.ts.map +1 -1
- package/lib/esm/internal/workspace/SettingsEditorImpl.js +52 -246
- package/lib/esm/internal/workspace/SettingsEditorImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.d.ts.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.d.ts +0 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js +71 -41
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/test/standalone/ITwinWorkspace.test.d.ts +2 -0
- package/lib/esm/test/standalone/ITwinWorkspace.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/ITwinWorkspace.test.js +236 -0
- package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -0
- package/lib/esm/test/standalone/Settings.test.js +19 -0
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js +52 -4
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/test/workspace/SettingsDb.test.js +28 -456
- package/lib/esm/test/workspace/SettingsDb.test.js.map +1 -1
- package/lib/esm/workspace/Settings.d.ts +11 -5
- package/lib/esm/workspace/Settings.d.ts.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsDb.d.ts +20 -99
- package/lib/esm/workspace/SettingsDb.d.ts.map +1 -1
- package/lib/esm/workspace/SettingsDb.js +20 -6
- package/lib/esm/workspace/SettingsDb.js.map +1 -1
- package/lib/esm/workspace/SettingsEditor.d.ts +40 -226
- package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -1
- package/lib/esm/workspace/SettingsEditor.js +85 -24
- package/lib/esm/workspace/SettingsEditor.js.map +1 -1
- package/lib/esm/workspace/Workspace.d.ts +7 -11
- package/lib/esm/workspace/Workspace.d.ts.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.d.ts +14 -0
- package/lib/esm/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +14 -14
- package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts +0 -38
- package/lib/cjs/internal/workspace/SettingsDbImpl.d.ts.map +0 -1
- package/lib/cjs/internal/workspace/SettingsDbImpl.js +0 -108
- package/lib/cjs/internal/workspace/SettingsDbImpl.js.map +0 -1
- package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts +0 -14
- package/lib/cjs/internal/workspace/SettingsSqliteDb.d.ts.map +0 -1
- package/lib/cjs/internal/workspace/SettingsSqliteDb.js +0 -40
- package/lib/cjs/internal/workspace/SettingsSqliteDb.js.map +0 -1
- package/lib/esm/internal/workspace/SettingsDbImpl.d.ts +0 -38
- package/lib/esm/internal/workspace/SettingsDbImpl.d.ts.map +0 -1
- package/lib/esm/internal/workspace/SettingsDbImpl.js +0 -104
- package/lib/esm/internal/workspace/SettingsDbImpl.js.map +0 -1
- package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts +0 -14
- package/lib/esm/internal/workspace/SettingsSqliteDb.d.ts.map +0 -1
- package/lib/esm/internal/workspace/SettingsSqliteDb.js +0 -36
- package/lib/esm/internal/workspace/SettingsSqliteDb.js.map +0 -1
|
@@ -1,250 +1,64 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Workspace
|
|
3
3
|
*/
|
|
4
|
-
import { LocalFileName } from "@itwin/core-common";
|
|
5
4
|
import { GuidString } from "@itwin/core-bentley";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { WorkspaceContainerId, WorkspaceDbSettingsProps } from "./Workspace";
|
|
6
|
+
import { EditableWorkspaceContainer, WorkspaceEditor } from "./WorkspaceEditor";
|
|
7
|
+
/** The default resource name used to store settings in a [[WorkspaceDb]].
|
|
8
|
+
* This is the key under which all settings are stored in the SQLite `strings` table.
|
|
9
|
+
* When loading settings at runtime via [[Workspace.loadSettingsDictionary]], the `resourceName` defaults
|
|
10
|
+
* to this value, ensuring the read and write paths always agree on which key to use.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare const settingsResourceName = "settingsDictionary";
|
|
14
|
+
/** @internal */
|
|
13
15
|
export declare namespace SettingsEditor {
|
|
16
|
+
/** The type of workspace container used to store settings. */
|
|
17
|
+
const containerType = "settings";
|
|
14
18
|
/**
|
|
15
19
|
* Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.
|
|
16
20
|
* @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.
|
|
17
21
|
* @note It is illegal to have more than one SettingsEditor active in a single session.
|
|
18
22
|
*/
|
|
19
|
-
function
|
|
23
|
+
function constructForITwin(iTwinId: GuidString): Promise<{
|
|
24
|
+
editor: WorkspaceEditor;
|
|
25
|
+
container: EditableWorkspaceContainer;
|
|
26
|
+
}>;
|
|
20
27
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @
|
|
23
|
-
*
|
|
28
|
+
* Obtain a [[SettingsEditor]] for the existing settings container associated with an iTwin.
|
|
29
|
+
* @returns The editor and container, or `undefined` if no settings container exists for the iTwin.
|
|
30
|
+
* @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.
|
|
31
|
+
* @note It is illegal to have more than one SettingsEditor active in a single session.
|
|
24
32
|
*/
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
function getForITwin(iTwinId: GuidString): Promise<{
|
|
34
|
+
editor: WorkspaceEditor;
|
|
35
|
+
container: EditableWorkspaceContainer;
|
|
36
|
+
} | undefined>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Help locate and obtain access to known containers with type "settings".
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare namespace SettingsContainers {
|
|
43
|
+
/** Arguments for [[SettingsContainers.queryContainers]]. */
|
|
44
|
+
interface QueryArgs {
|
|
31
45
|
/** The iTwinId whose settings containers should be queried. */
|
|
32
46
|
iTwinId: GuidString;
|
|
33
|
-
/** Optional iModelId to further scope the query to containers associated with a specific iModel. */
|
|
34
|
-
iModelId?: GuidString;
|
|
35
47
|
/** Optional label filter. */
|
|
36
48
|
label?: string;
|
|
37
49
|
}
|
|
38
50
|
/**
|
|
39
|
-
* Query the [[BlobContainer]] service for
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @param args - The query arguments including the iTwinId.
|
|
43
|
-
* @returns A promise that resolves to the matching container metadata entries.
|
|
44
|
-
* @note Requires [[IModelHost.authorizationClient]] to be configured.
|
|
45
|
-
*/
|
|
46
|
-
function queryContainers(args: QuerySettingsContainersArgs): Promise<BlobContainer.MetadataResponse[]>;
|
|
47
|
-
}
|
|
48
|
-
/** Arguments supplied to [[SettingsEditor.createNewCloudContainer]] to create a new [[EditableSettingsCloudContainer]].
|
|
49
|
-
* The created container will automatically have `containerType: "settings"` in its metadata, enabling discovery
|
|
50
|
-
* via `BlobContainer.service.queryContainersMetadata({ containerType: "settings" })`.
|
|
51
|
-
* @beta
|
|
52
|
-
*/
|
|
53
|
-
export interface CreateNewSettingsContainerArgs {
|
|
54
|
-
/**
|
|
55
|
-
* The scope of the container. This determines the ownership of the container, how RBAC rights are assigned,
|
|
56
|
-
* and the location of the datacenter.
|
|
57
|
-
*/
|
|
58
|
-
scope: BlobContainer.Scope;
|
|
59
|
-
/** The manifest to be stored in the default SettingsDb in the new container. */
|
|
60
|
-
manifest: SettingsDbManifest;
|
|
61
|
-
/** Metadata stored by the BlobContainer service. The `containerType` field is omitted here because it is
|
|
62
|
-
* automatically set to `"settings"` when the container is created (mirroring the `"workspace"` convention for WorkspaceDb containers).
|
|
63
|
-
*/
|
|
64
|
-
metadata: Omit<BlobContainer.Metadata, "containerType">;
|
|
65
|
-
/** The name of the default [[SettingsDb]] created inside the new container.
|
|
66
|
-
* Default: "settings-db";
|
|
67
|
-
*/
|
|
68
|
-
dbName?: WorkspaceDbName;
|
|
69
|
-
}
|
|
70
|
-
/** Arguments supplied to [[EditableSettingsCloudContainer.createNewSettingsDbVersion]].
|
|
71
|
-
* @beta
|
|
72
|
-
*/
|
|
73
|
-
export interface CreateNewSettingsDbVersionArgs {
|
|
74
|
-
/**
|
|
75
|
-
* The properties that determine the source [[SettingsDb]] to serve as the basis for the new version.
|
|
76
|
-
* This is usually the latest version, but it is possible to create patches to older versions.
|
|
77
|
-
*/
|
|
78
|
-
fromProps?: SettingsDbProps;
|
|
79
|
-
/** The type of version increment to apply to the source version. */
|
|
80
|
-
versionType: CloudSqlite.SemverIncrement;
|
|
81
|
-
/** For prerelease versions, a string that becomes part of the version name. */
|
|
82
|
-
identifier?: string;
|
|
83
|
-
}
|
|
84
|
-
/** The result of creating a new version of a [[SettingsDb]].
|
|
85
|
-
* @beta
|
|
86
|
-
*/
|
|
87
|
-
export interface SettingsDbVersionResult {
|
|
88
|
-
/** The name and version of the source SettingsDb. */
|
|
89
|
-
oldDb: WorkspaceDbNameAndVersion;
|
|
90
|
-
/** The name and version of the newly-created SettingsDb. */
|
|
91
|
-
newDb: WorkspaceDbNameAndVersion;
|
|
92
|
-
}
|
|
93
|
-
/** Arguments supplied to [[EditableSettingsCloudContainer.createDb]] to create a new [[SettingsDb]] in a container.
|
|
94
|
-
* @beta
|
|
95
|
-
*/
|
|
96
|
-
export interface CreateSettingsDbArgs {
|
|
97
|
-
/** The name of the new SettingsDb. Default: `"settings-db"`. */
|
|
98
|
-
dbName?: WorkspaceDbName;
|
|
99
|
-
/** The initial version of the new SettingsDb. Default: `"0.0.0"`. */
|
|
100
|
-
version?: WorkspaceDbVersion;
|
|
101
|
-
/** The manifest for the new SettingsDb. */
|
|
102
|
-
manifest: SettingsDbManifest;
|
|
103
|
-
}
|
|
104
|
-
/** Arguments supplied to [[EditableSettingsDb.updateSetting]] to add or update a single [[Setting]].
|
|
105
|
-
* @beta
|
|
106
|
-
*/
|
|
107
|
-
export interface UpdateSettingArgs {
|
|
108
|
-
/** The [[SettingName]] of the setting to add or update. */
|
|
109
|
-
readonly settingName: SettingName;
|
|
110
|
-
/** The new value for the setting. */
|
|
111
|
-
readonly value: Setting;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* A [[CloudSqliteContainer]] opened for editing settings by a [[SettingsEditor]].
|
|
115
|
-
* You can create new [[SettingsDb]]s or new versions of existing [[SettingsDb]]s inside it.
|
|
116
|
-
* Before actually making any changes to the container's contents, you must first obtain an exclusive write lock on it via
|
|
117
|
-
* [[acquireWriteLock]]. Only one user can hold the write lock at any given time. When you have finished making changes,
|
|
118
|
-
* you can use [[releaseWriteLock]] to publish your changes, or [[abandonChanges]] to discard them.
|
|
119
|
-
* @note Settings containers are separate from workspace containers, providing independent write locks.
|
|
120
|
-
* Editing settings does not block workspace resource editing, and vice versa.
|
|
121
|
-
* @beta
|
|
122
|
-
*/
|
|
123
|
-
export interface EditableSettingsCloudContainer extends CloudSqliteContainer {
|
|
124
|
-
/**
|
|
125
|
-
* Create a copy of an existing [[SettingsDb]] in this container with a new [[WorkspaceDbVersion]].
|
|
126
|
-
* The copy should be modified with new content before the write lock is released,
|
|
127
|
-
* and thereafter may never be modified again.
|
|
128
|
-
* @param args - The properties that determine the source SettingsDb and the version increment to apply.
|
|
129
|
-
* @returns A promise that resolves to an object containing the old and new SettingsDb names and versions.
|
|
130
|
-
*/
|
|
131
|
-
createNewSettingsDbVersion(args: CreateNewSettingsDbVersionArgs): Promise<SettingsDbVersionResult>;
|
|
132
|
-
/**
|
|
133
|
-
* Create a new, empty [[SettingsDb]].
|
|
134
|
-
* @param args - The arguments for creating the new SettingsDb.
|
|
135
|
-
* @returns A promise that resolves to an EditableSettingsDb.
|
|
136
|
-
*/
|
|
137
|
-
createDb(args: CreateSettingsDbArgs): Promise<EditableSettingsDb>;
|
|
138
|
-
/**
|
|
139
|
-
* Get the cloud properties of this container.
|
|
51
|
+
* Query the [[BlobContainer]] service for the single settings container associated with a given iTwin.
|
|
52
|
+
* @returns The containerId, or `undefined` if no container exists.
|
|
53
|
+
* @throws if more than one settings container is found.
|
|
140
54
|
*/
|
|
141
|
-
|
|
55
|
+
function getITwinContainerId(iTwinId: GuidString): Promise<WorkspaceContainerId | undefined>;
|
|
142
56
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* @param props - The properties of the SettingsDb.
|
|
146
|
-
* @returns An EditableSettingsDb for modifying settings.
|
|
147
|
-
* @throws if the targeted SettingsDb has already been published and is immutable. Use [[createNewSettingsDbVersion]] first to create an editable version.
|
|
148
|
-
*/
|
|
149
|
-
getEditableDb(props?: SettingsDbProps): EditableSettingsDb;
|
|
150
|
-
/**
|
|
151
|
-
* Acquire the write lock on the container. Use [[releaseWriteLock]] to release the lock after publishing your changes, or
|
|
152
|
-
* [[abandonChanges]] to release the lock and discard your changes.
|
|
153
|
-
* Only one user can hold the write lock at any given time. However, readers can continue to read the published contents of the container while
|
|
154
|
-
* a writer holds the write lock. Readers will only see the writer's changes after they are published by [[releaseWriteLock]].
|
|
155
|
-
* @param user - The name of the user acquiring the write lock.
|
|
156
|
-
* @throws if the write lock is already held by another user.
|
|
157
|
-
*/
|
|
158
|
-
acquireWriteLock(user: string): void;
|
|
159
|
-
/**
|
|
160
|
-
* Release the write lock on the container. This should be called after all changes to the container's contents are complete. It
|
|
161
|
-
* publishes and uploads the changes made to any [[SettingsDb]]s while the lock was held, after which those dbs become immutable.
|
|
162
|
-
*/
|
|
163
|
-
releaseWriteLock(): void;
|
|
164
|
-
/**
|
|
165
|
-
* Abandon any changes made to the container and release the write lock. Any newly created versions of SettingsDbs are discarded.
|
|
166
|
-
*/
|
|
167
|
-
abandonChanges(): void;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* An editable [[SettingsDb]]. This is used only by tools to allow administrators to create and modify SettingsDbs.
|
|
171
|
-
* For cloud-based SettingsDbs, the container's write token must be obtained via [[EditableSettingsCloudContainer.acquireWriteLock]] before the methods in this interface may be used.
|
|
172
|
-
* Normally, only admins will have write access.
|
|
173
|
-
* Only one admin at a time may be editing a settings container.
|
|
174
|
-
* @note Unlike [[EditableWorkspaceDb]], this interface only supports settings operations — no blob, file, or string resource methods.
|
|
175
|
-
* @beta
|
|
176
|
-
*/
|
|
177
|
-
export interface EditableSettingsDb extends SettingsDb {
|
|
178
|
-
/** The editable container that owns this SettingsDb. */
|
|
179
|
-
readonly container: EditableSettingsCloudContainer;
|
|
180
|
-
/**
|
|
181
|
-
* Update the contents of the manifest in this SettingsDb.
|
|
182
|
-
* @note This replaces the stored manifest entirely; omitted fields are lost.
|
|
183
|
-
* @param manifest - The updated manifest.
|
|
184
|
-
*/
|
|
185
|
-
updateManifest(manifest: SettingsDbManifest): void;
|
|
186
|
-
/**
|
|
187
|
-
* Replace all settings in this SettingsDb with the given container.
|
|
188
|
-
* @param settings - The settings object to store.
|
|
189
|
-
*/
|
|
190
|
-
updateSettings(settings: SettingsContainer): void;
|
|
191
|
-
/**
|
|
192
|
-
* Add or update a single [[Setting]] by name.
|
|
193
|
-
* If a setting with the given name already exists, its value is replaced.
|
|
194
|
-
* If it does not exist, it is added. Other settings are preserved.
|
|
195
|
-
* @param args - The arguments specifying the setting name and value.
|
|
196
|
-
*/
|
|
197
|
-
updateSetting(args: UpdateSettingArgs): void;
|
|
198
|
-
/**
|
|
199
|
-
* Remove a single [[Setting]] by name. Other settings are preserved.
|
|
200
|
-
* @param settingName - The name of the setting to remove.
|
|
201
|
-
*/
|
|
202
|
-
removeSetting(settingName: SettingName): void;
|
|
203
|
-
}
|
|
204
|
-
/** An object that permits administrators to modify the contents of settings containers.
|
|
205
|
-
* Use [[SettingsEditor.construct]] to obtain a SettingsEditor, and [[close]] when finished using it.
|
|
206
|
-
* Only one SettingsEditor may be in use at any given time.
|
|
207
|
-
* Use [[getContainer]] to edit an existing container, or [[createNewCloudContainer]] to create a new container.
|
|
208
|
-
* @beta
|
|
209
|
-
*/
|
|
210
|
-
export interface SettingsEditor {
|
|
211
|
-
/** @internal */
|
|
212
|
-
[_implementationProhibited]: unknown;
|
|
213
|
-
/**
|
|
214
|
-
* The workspace dedicated to this editor.
|
|
215
|
-
* @note This workspace is independent from [[IModelHost.appWorkspace]] and all [[IModelDb.workspace]]s.
|
|
216
|
-
*/
|
|
217
|
-
readonly workspace: Workspace;
|
|
218
|
-
/**
|
|
219
|
-
* Retrieves a container for the editor with the specified properties and access token.
|
|
220
|
-
*/
|
|
221
|
-
getContainer(args: GetWorkspaceContainerArgs): EditableSettingsCloudContainer;
|
|
222
|
-
/**
|
|
223
|
-
* Asynchronously retrieves a container for the editor with the specified properties.
|
|
224
|
-
*/
|
|
225
|
-
getContainerAsync(props: WorkspaceContainerProps): Promise<EditableSettingsCloudContainer>;
|
|
226
|
-
/**
|
|
227
|
-
* Creates a new cloud container for holding SettingsDbs, from the [[BlobContainer]] service.
|
|
228
|
-
* The container is automatically assigned `containerType: "settings"` in its metadata and
|
|
229
|
-
* initialized with a default [[SettingsDb]].
|
|
230
|
-
* @param args - The arguments for creating the container, including scope, metadata, and manifest.
|
|
231
|
-
* @returns A promise that resolves to the new EditableSettingsCloudContainer.
|
|
232
|
-
* @note The current user must have administrator rights for the iTwin for the container.
|
|
57
|
+
* Look up the settings container for an iTwin and obtain a read-only access token.
|
|
58
|
+
* @returns container props needed by [[IModelHost.getITwinWorkspace]].
|
|
233
59
|
* @note Requires [[IModelHost.authorizationClient]] to be configured.
|
|
60
|
+
* @note Requires [[BlobContainer.service]] to be configured.
|
|
234
61
|
*/
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Find and open existing settings containers by querying the [[BlobContainer]] service.
|
|
238
|
-
* This is a convenience method that queries for all settings containers matching the given iTwinId
|
|
239
|
-
* (and optionally iModelId), requests write access tokens, and opens each matching container.
|
|
240
|
-
* @param args - The query arguments including iTwinId and optionally iModelId and label.
|
|
241
|
-
* @returns A promise that resolves to an array of opened [[EditableSettingsCloudContainer]]s.
|
|
242
|
-
* @note Requires [[IModelHost.authorizationClient]] and [[BlobContainer.service]] to be configured.
|
|
243
|
-
*/
|
|
244
|
-
findContainers(args: SettingsEditor.QuerySettingsContainersArgs): Promise<EditableSettingsCloudContainer[]>;
|
|
245
|
-
/**
|
|
246
|
-
* Closes this editor. All settings containers are dropped.
|
|
247
|
-
*/
|
|
248
|
-
close(): void;
|
|
62
|
+
function getITwinSettingsSources(iTwinId: GuidString): Promise<WorkspaceDbSettingsProps[] | undefined>;
|
|
249
63
|
}
|
|
250
64
|
//# sourceMappingURL=SettingsEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsEditor.d.ts","sourceRoot":"","sources":["../../../src/workspace/SettingsEditor.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"SettingsEditor.d.ts","sourceRoot":"","sources":["../../../src/workspace/SettingsEditor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAI7E,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIhF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAEzD,gBAAgB;AAChB,yBAAiB,cAAc,CAAC;IAC9B,8DAA8D;IACvD,MAAM,aAAa,aAAa,CAAC;IAExC;;;;OAIG;IACH,SAAsB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,SAAS,EAAE,0BAA0B,CAAA;KAAE,CAAC,CAExI;IAED;;;;;OAKG;IACH,SAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,SAAS,EAAE,0BAA0B,CAAA;KAAE,GAAG,SAAS,CAAC,CAE9I;CACF;AAED;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC,4DAA4D;IAC5D,UAAiB,SAAS;QACxB,+DAA+D;QAC/D,OAAO,EAAE,UAAU,CAAC;QACpB,6BAA6B;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;IAeD;;;;OAIG;IACH,SAAsB,mBAAmB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CASxG;IAED;;;;;OAKG;IACH,SAAsB,uBAAuB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,wBAAwB,EAAE,GAAG,SAAS,CAAC,CAwBlH;CACF"}
|
|
@@ -1,50 +1,111 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Workspace
|
|
7
7
|
*/
|
|
8
|
+
import { ITwinSettingsError } from "@itwin/core-common";
|
|
8
9
|
import { BlobContainer } from "../BlobContainerService";
|
|
9
|
-
import { SettingsSqliteDb } from "../internal/workspace/SettingsSqliteDb";
|
|
10
|
-
import { constructSettingsEditor } from "../internal/workspace/SettingsEditorImpl";
|
|
11
|
-
import { _implementationProhibited } from "../internal/Symbols";
|
|
12
10
|
import { IModelHost } from "../IModelHost";
|
|
13
|
-
|
|
11
|
+
import { constructSettingsEditorForITwin, getSettingsEditorForITwin } from "../internal/workspace/SettingsEditorImpl";
|
|
12
|
+
import { SettingsPriority } from "./Settings";
|
|
13
|
+
import { settingsWorkspaceDbName } from "./SettingsDb";
|
|
14
|
+
/** The default resource name used to store settings in a [[WorkspaceDb]].
|
|
15
|
+
* This is the key under which all settings are stored in the SQLite `strings` table.
|
|
16
|
+
* When loading settings at runtime via [[Workspace.loadSettingsDictionary]], the `resourceName` defaults
|
|
17
|
+
* to this value, ensuring the read and write paths always agree on which key to use.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export const settingsResourceName = "settingsDictionary";
|
|
21
|
+
/** @internal */
|
|
14
22
|
export var SettingsEditor;
|
|
15
23
|
(function (SettingsEditor) {
|
|
24
|
+
/** The type of workspace container used to store settings. */
|
|
25
|
+
SettingsEditor.containerType = "settings";
|
|
16
26
|
/**
|
|
17
27
|
* Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.
|
|
18
28
|
* @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.
|
|
19
29
|
* @note It is illegal to have more than one SettingsEditor active in a single session.
|
|
20
30
|
*/
|
|
21
|
-
function
|
|
22
|
-
return
|
|
31
|
+
async function constructForITwin(iTwinId) {
|
|
32
|
+
return constructSettingsEditorForITwin(iTwinId);
|
|
23
33
|
}
|
|
24
|
-
SettingsEditor.
|
|
34
|
+
SettingsEditor.constructForITwin = constructForITwin;
|
|
25
35
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
36
|
+
* Obtain a [[SettingsEditor]] for the existing settings container associated with an iTwin.
|
|
37
|
+
* @returns The editor and container, or `undefined` if no settings container exists for the iTwin.
|
|
38
|
+
* @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.
|
|
39
|
+
* @note It is illegal to have more than one SettingsEditor active in a single session.
|
|
29
40
|
*/
|
|
30
|
-
function
|
|
31
|
-
|
|
41
|
+
async function getForITwin(iTwinId) {
|
|
42
|
+
return getSettingsEditorForITwin(iTwinId);
|
|
32
43
|
}
|
|
33
|
-
SettingsEditor.
|
|
44
|
+
SettingsEditor.getForITwin = getForITwin;
|
|
45
|
+
})(SettingsEditor || (SettingsEditor = {}));
|
|
46
|
+
/**
|
|
47
|
+
* Help locate and obtain access to known containers with type "settings".
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
export var SettingsContainers;
|
|
51
|
+
(function (SettingsContainers) {
|
|
34
52
|
/**
|
|
35
53
|
* Query the [[BlobContainer]] service for all settings containers associated with a given iTwin.
|
|
36
|
-
*
|
|
37
|
-
* automatically filters by `containerType: "settings"`.
|
|
38
|
-
* @param args - The query arguments including the iTwinId.
|
|
39
|
-
* @returns A promise that resolves to the matching container metadata entries.
|
|
54
|
+
* Automatically filters by `containerType: "settings"`.
|
|
40
55
|
* @note Requires [[IModelHost.authorizationClient]] to be configured.
|
|
41
56
|
*/
|
|
42
57
|
async function queryContainers(args) {
|
|
43
58
|
if (undefined === BlobContainer.service)
|
|
44
|
-
|
|
59
|
+
ITwinSettingsError.throwError("blob-service-unavailable", { message: "BlobContainer.service is not available." });
|
|
45
60
|
const userToken = await IModelHost.getAccessToken();
|
|
46
|
-
return BlobContainer.service.queryContainersMetadata(userToken, { ...args, containerType:
|
|
61
|
+
return BlobContainer.service.queryContainersMetadata(userToken, { ...args, containerType: SettingsEditor.containerType });
|
|
47
62
|
}
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Query the [[BlobContainer]] service for the single settings container associated with a given iTwin.
|
|
65
|
+
* @returns The containerId, or `undefined` if no container exists.
|
|
66
|
+
* @throws if more than one settings container is found.
|
|
67
|
+
*/
|
|
68
|
+
async function getITwinContainerId(iTwinId) {
|
|
69
|
+
const containers = await queryContainers({ iTwinId });
|
|
70
|
+
if (containers.length > 1) {
|
|
71
|
+
ITwinSettingsError.throwError("multiple-itwin-settings-containers", {
|
|
72
|
+
message: `Multiple iTwin settings containers were found for '${iTwinId}', so a container cannot be automatically selected.`,
|
|
73
|
+
iTwinId,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return containers[0]?.containerId;
|
|
77
|
+
}
|
|
78
|
+
SettingsContainers.getITwinContainerId = getITwinContainerId;
|
|
79
|
+
/**
|
|
80
|
+
* Look up the settings container for an iTwin and obtain a read-only access token.
|
|
81
|
+
* @returns container props needed by [[IModelHost.getITwinWorkspace]].
|
|
82
|
+
* @note Requires [[IModelHost.authorizationClient]] to be configured.
|
|
83
|
+
* @note Requires [[BlobContainer.service]] to be configured.
|
|
84
|
+
*/
|
|
85
|
+
async function getITwinSettingsSources(iTwinId) {
|
|
86
|
+
if (undefined === BlobContainer.service)
|
|
87
|
+
ITwinSettingsError.throwError("blob-service-unavailable", { message: "BlobContainer.service is not available." });
|
|
88
|
+
const userToken = await IModelHost.getAccessToken();
|
|
89
|
+
const containers = await queryContainers({ iTwinId });
|
|
90
|
+
if (!containers || containers.length === 0)
|
|
91
|
+
return undefined;
|
|
92
|
+
if (containers.length > 1) {
|
|
93
|
+
ITwinSettingsError.throwError("multiple-itwin-settings-containers", {
|
|
94
|
+
message: `Multiple iTwin settings containers were found for '${iTwinId}', so a container cannot be automatically selected.`,
|
|
95
|
+
iTwinId,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const tokenProps = await BlobContainer.service.requestToken({ containerId: containers[0].containerId, accessLevel: "read", userToken });
|
|
99
|
+
return [{
|
|
100
|
+
baseUri: tokenProps.baseUri,
|
|
101
|
+
containerId: containers[0].containerId,
|
|
102
|
+
storageType: tokenProps.provider,
|
|
103
|
+
accessToken: tokenProps.token,
|
|
104
|
+
priority: SettingsPriority.iTwin,
|
|
105
|
+
dbName: settingsWorkspaceDbName,
|
|
106
|
+
includePrerelease: true,
|
|
107
|
+
}];
|
|
108
|
+
}
|
|
109
|
+
SettingsContainers.getITwinSettingsSources = getITwinSettingsSources;
|
|
110
|
+
})(SettingsContainers || (SettingsContainers = {}));
|
|
50
111
|
//# sourceMappingURL=SettingsEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsEditor.js","sourceRoot":"","sources":["../../../src/workspace/SettingsEditor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAKH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,YAAY;AACZ,MAAM,KAAW,cAAc,CA0C9B;AA1CD,WAAiB,cAAc;IAC7B;;;;OAIG;IACH,SAAgB,SAAS;QACvB,OAAO,uBAAuB,EAAE,CAAC;IACnC,CAAC;IAFe,wBAAS,YAExB,CAAA;IAED;;;;OAIG;IACH,SAAgB,aAAa,CAAC,IAAoE;QAChG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAFe,4BAAa,gBAE5B,CAAA;IAYD;;;;;;;OAOG;IACI,KAAK,UAAU,eAAe,CAAC,IAAiC;QACrE,IAAI,SAAS,KAAK,aAAa,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACjK,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC;QACpD,OAAO,aAAa,CAAC,OAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1G,CAAC;IAJqB,8BAAe,kBAIpC,CAAA;AACH,CAAC,EA1CgB,cAAc,KAAd,cAAc,QA0C9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Workspace\n */\n\nimport { LocalFileName } from \"@itwin/core-common\";\nimport { GuidString } from \"@itwin/core-bentley\";\nimport { Setting, SettingName, SettingsContainer } from \"./Settings\";\nimport { BlobContainer } from \"../BlobContainerService\";\nimport { CloudSqliteContainer, GetWorkspaceContainerArgs, Workspace, WorkspaceContainerProps, WorkspaceDbName, WorkspaceDbNameAndVersion, WorkspaceDbVersion } from \"./Workspace\";\nimport { SettingsDb, SettingsDbManifest, SettingsDbProps } from \"./SettingsDb\";\nimport { SettingsSqliteDb } from \"../internal/workspace/SettingsSqliteDb\";\nimport { constructSettingsEditor } from \"../internal/workspace/SettingsEditorImpl\";\nimport { _implementationProhibited } from \"../internal/Symbols\";\nimport { CloudSqlite } from \"../CloudSqlite\";\nimport { IModelHost } from \"../IModelHost\";\n\n/** @beta */\nexport namespace SettingsEditor {\n /**\n * Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.\n * @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.\n * @note It is illegal to have more than one SettingsEditor active in a single session.\n */\n export function construct(): SettingsEditor {\n return constructSettingsEditor();\n }\n\n /**\n * Create a new, empty, [[SettingsDb]] file on the local filesystem for importing settings dictionaries.\n * @note Do not pass an untrusted or unintended path in `localFileName`.\n * This helper creates or overwrites the file at that location; callers that need fail-if-exists behavior should check first.\n */\n export function createEmptyDb(args: { localFileName: LocalFileName; manifest: SettingsDbManifest }): void {\n SettingsSqliteDb.createNewDb(args.localFileName, args);\n }\n\n /** Arguments for [[SettingsEditor.queryContainers]] and [[SettingsEditor.findContainers]]. */\n export interface QuerySettingsContainersArgs {\n /** The iTwinId whose settings containers should be queried. */\n iTwinId: GuidString;\n /** Optional iModelId to further scope the query to containers associated with a specific iModel. */\n iModelId?: GuidString;\n /** Optional label filter. */\n label?: string;\n }\n\n /**\n * Query the [[BlobContainer]] service for all settings containers associated with a given iTwin.\n * This is a convenience wrapper around `BlobContainer.service.queryContainersMetadata` that\n * automatically filters by `containerType: \"settings\"`.\n * @param args - The query arguments including the iTwinId.\n * @returns A promise that resolves to the matching container metadata entries.\n * @note Requires [[IModelHost.authorizationClient]] to be configured.\n */\n export async function queryContainers(args: QuerySettingsContainersArgs): Promise<BlobContainer.MetadataResponse[]> {\n if (undefined === BlobContainer.service) throw new Error(\"BlobContainer.service is not available. Ensure IModelHost is initialized with a valid configuration.\");\n const userToken = await IModelHost.getAccessToken();\n return BlobContainer.service.queryContainersMetadata(userToken, { ...args, containerType: \"settings\" });\n }\n}\n\n/** Arguments supplied to [[SettingsEditor.createNewCloudContainer]] to create a new [[EditableSettingsCloudContainer]].\n * The created container will automatically have `containerType: \"settings\"` in its metadata, enabling discovery\n * via `BlobContainer.service.queryContainersMetadata({ containerType: \"settings\" })`.\n * @beta\n */\nexport interface CreateNewSettingsContainerArgs {\n /**\n * The scope of the container. This determines the ownership of the container, how RBAC rights are assigned,\n * and the location of the datacenter.\n */\n scope: BlobContainer.Scope;\n /** The manifest to be stored in the default SettingsDb in the new container. */\n manifest: SettingsDbManifest;\n /** Metadata stored by the BlobContainer service. The `containerType` field is omitted here because it is\n * automatically set to `\"settings\"` when the container is created (mirroring the `\"workspace\"` convention for WorkspaceDb containers).\n */\n metadata: Omit<BlobContainer.Metadata, \"containerType\">;\n /** The name of the default [[SettingsDb]] created inside the new container.\n * Default: \"settings-db\";\n */\n dbName?: WorkspaceDbName;\n}\n\n/** Arguments supplied to [[EditableSettingsCloudContainer.createNewSettingsDbVersion]].\n * @beta\n */\nexport interface CreateNewSettingsDbVersionArgs {\n /**\n * The properties that determine the source [[SettingsDb]] to serve as the basis for the new version.\n * This is usually the latest version, but it is possible to create patches to older versions.\n */\n fromProps?: SettingsDbProps;\n /** The type of version increment to apply to the source version. */\n versionType: CloudSqlite.SemverIncrement;\n /** For prerelease versions, a string that becomes part of the version name. */\n identifier?: string;\n}\n\n/** The result of creating a new version of a [[SettingsDb]].\n * @beta\n */\nexport interface SettingsDbVersionResult {\n /** The name and version of the source SettingsDb. */\n oldDb: WorkspaceDbNameAndVersion;\n /** The name and version of the newly-created SettingsDb. */\n newDb: WorkspaceDbNameAndVersion;\n}\n\n/** Arguments supplied to [[EditableSettingsCloudContainer.createDb]] to create a new [[SettingsDb]] in a container.\n * @beta\n */\nexport interface CreateSettingsDbArgs {\n /** The name of the new SettingsDb. Default: `\"settings-db\"`. */\n dbName?: WorkspaceDbName;\n /** The initial version of the new SettingsDb. Default: `\"0.0.0\"`. */\n version?: WorkspaceDbVersion;\n /** The manifest for the new SettingsDb. */\n manifest: SettingsDbManifest;\n}\n\n/** Arguments supplied to [[EditableSettingsDb.updateSetting]] to add or update a single [[Setting]].\n * @beta\n */\nexport interface UpdateSettingArgs {\n /** The [[SettingName]] of the setting to add or update. */\n readonly settingName: SettingName;\n /** The new value for the setting. */\n readonly value: Setting;\n}\n\n/**\n * A [[CloudSqliteContainer]] opened for editing settings by a [[SettingsEditor]].\n * You can create new [[SettingsDb]]s or new versions of existing [[SettingsDb]]s inside it.\n * Before actually making any changes to the container's contents, you must first obtain an exclusive write lock on it via\n * [[acquireWriteLock]]. Only one user can hold the write lock at any given time. When you have finished making changes,\n * you can use [[releaseWriteLock]] to publish your changes, or [[abandonChanges]] to discard them.\n * @note Settings containers are separate from workspace containers, providing independent write locks.\n * Editing settings does not block workspace resource editing, and vice versa.\n * @beta\n */\nexport interface EditableSettingsCloudContainer extends CloudSqliteContainer {\n /**\n * Create a copy of an existing [[SettingsDb]] in this container with a new [[WorkspaceDbVersion]].\n * The copy should be modified with new content before the write lock is released,\n * and thereafter may never be modified again.\n * @param args - The properties that determine the source SettingsDb and the version increment to apply.\n * @returns A promise that resolves to an object containing the old and new SettingsDb names and versions.\n */\n createNewSettingsDbVersion(args: CreateNewSettingsDbVersionArgs): Promise<SettingsDbVersionResult>;\n\n /**\n * Create a new, empty [[SettingsDb]].\n * @param args - The arguments for creating the new SettingsDb.\n * @returns A promise that resolves to an EditableSettingsDb.\n */\n createDb(args: CreateSettingsDbArgs): Promise<EditableSettingsDb>;\n\n /**\n * Get the cloud properties of this container.\n */\n readonly cloudProps: WorkspaceContainerProps | undefined;\n\n /**\n * Get an editable [[SettingsDb]] to add, delete, or update settings *within a newly created version* of a SettingsDb.\n * Repeated calls that resolve to the same SettingsDb return the same cached instance.\n * @param props - The properties of the SettingsDb.\n * @returns An EditableSettingsDb for modifying settings.\n * @throws if the targeted SettingsDb has already been published and is immutable. Use [[createNewSettingsDbVersion]] first to create an editable version.\n */\n getEditableDb(props?: SettingsDbProps): EditableSettingsDb;\n\n /**\n * Acquire the write lock on the container. Use [[releaseWriteLock]] to release the lock after publishing your changes, or\n * [[abandonChanges]] to release the lock and discard your changes.\n * Only one user can hold the write lock at any given time. However, readers can continue to read the published contents of the container while\n * a writer holds the write lock. Readers will only see the writer's changes after they are published by [[releaseWriteLock]].\n * @param user - The name of the user acquiring the write lock.\n * @throws if the write lock is already held by another user.\n */\n acquireWriteLock(user: string): void;\n\n /**\n * Release the write lock on the container. This should be called after all changes to the container's contents are complete. It\n * publishes and uploads the changes made to any [[SettingsDb]]s while the lock was held, after which those dbs become immutable.\n */\n releaseWriteLock(): void;\n\n /**\n * Abandon any changes made to the container and release the write lock. Any newly created versions of SettingsDbs are discarded.\n */\n abandonChanges(): void;\n}\n\n/**\n * An editable [[SettingsDb]]. This is used only by tools to allow administrators to create and modify SettingsDbs.\n * For cloud-based SettingsDbs, the container's write token must be obtained via [[EditableSettingsCloudContainer.acquireWriteLock]] before the methods in this interface may be used.\n * Normally, only admins will have write access.\n * Only one admin at a time may be editing a settings container.\n * @note Unlike [[EditableWorkspaceDb]], this interface only supports settings operations — no blob, file, or string resource methods.\n * @beta\n */\nexport interface EditableSettingsDb extends SettingsDb {\n /** The editable container that owns this SettingsDb. */\n readonly container: EditableSettingsCloudContainer;\n\n /**\n * Update the contents of the manifest in this SettingsDb.\n * @note This replaces the stored manifest entirely; omitted fields are lost.\n * @param manifest - The updated manifest.\n */\n updateManifest(manifest: SettingsDbManifest): void;\n\n /**\n * Replace all settings in this SettingsDb with the given container.\n * @param settings - The settings object to store.\n */\n updateSettings(settings: SettingsContainer): void;\n\n /**\n * Add or update a single [[Setting]] by name.\n * If a setting with the given name already exists, its value is replaced.\n * If it does not exist, it is added. Other settings are preserved.\n * @param args - The arguments specifying the setting name and value.\n */\n updateSetting(args: UpdateSettingArgs): void;\n\n /**\n * Remove a single [[Setting]] by name. Other settings are preserved.\n * @param settingName - The name of the setting to remove.\n */\n removeSetting(settingName: SettingName): void;\n}\n\n/** An object that permits administrators to modify the contents of settings containers.\n * Use [[SettingsEditor.construct]] to obtain a SettingsEditor, and [[close]] when finished using it.\n * Only one SettingsEditor may be in use at any given time.\n * Use [[getContainer]] to edit an existing container, or [[createNewCloudContainer]] to create a new container.\n * @beta\n */\nexport interface SettingsEditor {\n /** @internal */\n [_implementationProhibited]: unknown;\n\n /**\n * The workspace dedicated to this editor.\n * @note This workspace is independent from [[IModelHost.appWorkspace]] and all [[IModelDb.workspace]]s.\n */\n readonly workspace: Workspace;\n\n /**\n * Retrieves a container for the editor with the specified properties and access token.\n */\n getContainer(args: GetWorkspaceContainerArgs): EditableSettingsCloudContainer;\n\n /**\n * Asynchronously retrieves a container for the editor with the specified properties.\n */\n getContainerAsync(props: WorkspaceContainerProps): Promise<EditableSettingsCloudContainer>;\n\n /**\n * Creates a new cloud container for holding SettingsDbs, from the [[BlobContainer]] service.\n * The container is automatically assigned `containerType: \"settings\"` in its metadata and\n * initialized with a default [[SettingsDb]].\n * @param args - The arguments for creating the container, including scope, metadata, and manifest.\n * @returns A promise that resolves to the new EditableSettingsCloudContainer.\n * @note The current user must have administrator rights for the iTwin for the container.\n * @note Requires [[IModelHost.authorizationClient]] to be configured.\n */\n createNewCloudContainer(args: CreateNewSettingsContainerArgs): Promise<EditableSettingsCloudContainer>;\n\n /**\n * Find and open existing settings containers by querying the [[BlobContainer]] service.\n * This is a convenience method that queries for all settings containers matching the given iTwinId\n * (and optionally iModelId), requests write access tokens, and opens each matching container.\n * @param args - The query arguments including iTwinId and optionally iModelId and label.\n * @returns A promise that resolves to an array of opened [[EditableSettingsCloudContainer]]s.\n * @note Requires [[IModelHost.authorizationClient]] and [[BlobContainer.service]] to be configured.\n */\n findContainers(args: SettingsEditor.QuerySettingsContainersArgs): Promise<EditableSettingsCloudContainer[]>;\n\n /**\n * Closes this editor. All settings containers are dropped.\n */\n close(): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SettingsEditor.js","sourceRoot":"","sources":["../../../src/workspace/SettingsEditor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAEtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD,gBAAgB;AAChB,MAAM,KAAW,c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ACpC,CAAC;IATqB,sCAAmB,sBASxC,CAAA;IAED;;;;;OAKG;IACI,KAAK,UAAU,uBAAuB,CAAC,OAAmB;QAC/D,IAAI,SAAS,KAAK,aAAa,CAAC,OAAO;YACrC,kBAAkB,CAAC,UAAU,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,CAAC,CAAC;QAEpH,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC;QACpD,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAC7D,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,kBAAkB,CAAC,UAAU,CAAC,oCAAoC,EAAE;gBAClE,OAAO,EAAE,sDAAsD,OAAO,qDAAqD;gBAC3H,OAAO;aACR,CAAC,CAAC;QACL,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QACxI,OAAO,CAAC;gBACN,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW;gBACtC,WAAW,EAAE,UAAU,CAAC,QAAQ;gBAChC,WAAW,EAAE,UAAU,CAAC,KAAK;gBAC7B,QAAQ,EAAE,gBAAgB,CAAC,KAAK;gBAChC,MAAM,EAAE,uBAAuB;gBAC/B,iBAAiB,EAAE,IAAI;aACxB,CAAC,CAAC;IACL,CAAC;IAxBqB,0CAAuB,0BAwB5C,CAAA;AACH,CAAC,EArEgB,kBAAkB,KAAlB,kBAAkB,QAqElC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Workspace\n */\n\nimport { ITwinSettingsError } from \"@itwin/core-common\";\nimport { GuidString } from \"@itwin/core-bentley\";\nimport { WorkspaceContainerId, WorkspaceDbSettingsProps } from \"./Workspace\";\nimport { BlobContainer } from \"../BlobContainerService\";\nimport { IModelHost } from \"../IModelHost\";\nimport { constructSettingsEditorForITwin, getSettingsEditorForITwin } from \"../internal/workspace/SettingsEditorImpl\";\nimport { EditableWorkspaceContainer, WorkspaceEditor } from \"./WorkspaceEditor\";\nimport { SettingsPriority } from \"./Settings\";\nimport { settingsWorkspaceDbName } from \"./SettingsDb\";\n\n/** The default resource name used to store settings in a [[WorkspaceDb]].\n * This is the key under which all settings are stored in the SQLite `strings` table.\n * When loading settings at runtime via [[Workspace.loadSettingsDictionary]], the `resourceName` defaults\n * to this value, ensuring the read and write paths always agree on which key to use.\n * @internal\n */\nexport const settingsResourceName = \"settingsDictionary\";\n\n/** @internal */\nexport namespace SettingsEditor {\n /** The type of workspace container used to store settings. */\n export const containerType = \"settings\";\n\n /**\n * Create a new [[SettingsEditor]] for creating new versions of [[SettingsDb]]s.\n * @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.\n * @note It is illegal to have more than one SettingsEditor active in a single session.\n */\n export async function constructForITwin(iTwinId: GuidString): Promise<{ editor: WorkspaceEditor; container: EditableWorkspaceContainer }> {\n return constructSettingsEditorForITwin(iTwinId);\n }\n\n /**\n * Obtain a [[SettingsEditor]] for the existing settings container associated with an iTwin.\n * @returns The editor and container, or `undefined` if no settings container exists for the iTwin.\n * @note The caller becomes the owner of the SettingsEditor and is responsible for calling [[SettingsEditor.close]] on it when finished.\n * @note It is illegal to have more than one SettingsEditor active in a single session.\n */\n export async function getForITwin(iTwinId: GuidString): Promise<{ editor: WorkspaceEditor; container: EditableWorkspaceContainer } | undefined> {\n return getSettingsEditorForITwin(iTwinId);\n }\n}\n\n/**\n * Help locate and obtain access to known containers with type \"settings\".\n * @internal\n */\nexport namespace SettingsContainers {\n /** Arguments for [[SettingsContainers.queryContainers]]. */\n export interface QueryArgs {\n /** The iTwinId whose settings containers should be queried. */\n iTwinId: GuidString;\n /** Optional label filter. */\n label?: string;\n }\n\n /**\n * Query the [[BlobContainer]] service for all settings containers associated with a given iTwin.\n * Automatically filters by `containerType: \"settings\"`.\n * @note Requires [[IModelHost.authorizationClient]] to be configured.\n */\n async function queryContainers(args: QueryArgs): Promise<BlobContainer.MetadataResponse[]> {\n if (undefined === BlobContainer.service)\n ITwinSettingsError.throwError(\"blob-service-unavailable\", { message: \"BlobContainer.service is not available.\" });\n\n const userToken = await IModelHost.getAccessToken();\n return BlobContainer.service.queryContainersMetadata(userToken, { ...args, containerType: SettingsEditor.containerType });\n }\n\n /**\n * Query the [[BlobContainer]] service for the single settings container associated with a given iTwin.\n * @returns The containerId, or `undefined` if no container exists.\n * @throws if more than one settings container is found.\n */\n export async function getITwinContainerId(iTwinId: GuidString): Promise<WorkspaceContainerId | undefined> {\n const containers = await queryContainers({ iTwinId });\n if (containers.length > 1) {\n ITwinSettingsError.throwError(\"multiple-itwin-settings-containers\", {\n message: `Multiple iTwin settings containers were found for '${iTwinId}', so a container cannot be automatically selected.`,\n iTwinId,\n });\n }\n return containers[0]?.containerId;\n }\n\n /**\n * Look up the settings container for an iTwin and obtain a read-only access token.\n * @returns container props needed by [[IModelHost.getITwinWorkspace]].\n * @note Requires [[IModelHost.authorizationClient]] to be configured.\n * @note Requires [[BlobContainer.service]] to be configured.\n */\n export async function getITwinSettingsSources(iTwinId: GuidString): Promise<WorkspaceDbSettingsProps[] | undefined> {\n if (undefined === BlobContainer.service)\n ITwinSettingsError.throwError(\"blob-service-unavailable\", { message: \"BlobContainer.service is not available.\" });\n\n const userToken = await IModelHost.getAccessToken();\n const containers = await queryContainers({ iTwinId });\n if (!containers || containers.length === 0) return undefined;\n if (containers.length > 1) {\n ITwinSettingsError.throwError(\"multiple-itwin-settings-containers\", {\n message: `Multiple iTwin settings containers were found for '${iTwinId}', so a container cannot be automatically selected.`,\n iTwinId,\n });\n }\n\n const tokenProps = await BlobContainer.service.requestToken({ containerId: containers[0].containerId, accessLevel: \"read\", userToken });\n return [{\n baseUri: tokenProps.baseUri,\n containerId: containers[0].containerId,\n storageType: tokenProps.provider,\n accessToken: tokenProps.token,\n priority: SettingsPriority.iTwin,\n dbName: settingsWorkspaceDbName,\n includePrerelease: true,\n }];\n }\n}\n"]}
|
|
@@ -6,7 +6,6 @@ import { DbCloudContainerInfo, LocalDirName, LocalFileName } from "@itwin/core-c
|
|
|
6
6
|
import { CloudSqlite } from "../CloudSqlite";
|
|
7
7
|
import { SQLiteDb } from "../SQLiteDb";
|
|
8
8
|
import { SettingName, Settings, SettingsDictionary, SettingsPriority } from "./Settings";
|
|
9
|
-
import { GetSettingsDbArgs, SettingsDb } from "./SettingsDb";
|
|
10
9
|
import type { IModelJsNative } from "@bentley/imodeljs-native";
|
|
11
10
|
import { _implementationProhibited } from "../internal/Symbols";
|
|
12
11
|
/** The unique identifier of a [[WorkspaceContainer]]. This becomes the base name for a local file directory holding the container's [[WorkspaceDb]]s.
|
|
@@ -144,8 +143,8 @@ export interface WorkspaceDbLoadErrors extends ITwinError {
|
|
|
144
143
|
*/
|
|
145
144
|
export interface WorkspaceDbSettingsProps extends WorkspaceDbCloudProps {
|
|
146
145
|
/** The name of the resource holding the stringified JSON of the [[SettingsDictionary]].
|
|
147
|
-
* Defaults to `"
|
|
148
|
-
* [[
|
|
146
|
+
* Defaults to `"settingsDictionary"`, which matches the key used by
|
|
147
|
+
* [[EditableWorkspaceDb.updateSettingsResource]] to write settings. You should generally omit this
|
|
149
148
|
* field unless you need to load settings stored under a non-standard key.
|
|
150
149
|
*/
|
|
151
150
|
resourceName?: string;
|
|
@@ -283,6 +282,10 @@ export interface GetWorkspaceContainerArgs extends WorkspaceContainerProps {
|
|
|
283
282
|
export interface Workspace {
|
|
284
283
|
/** @internal */
|
|
285
284
|
[_implementationProhibited]: unknown;
|
|
285
|
+
/** The settings db sources used to populate this workspace, if available.
|
|
286
|
+
* Useful for reloading the same workspace data later without querying container discovery services.
|
|
287
|
+
*/
|
|
288
|
+
settingsSources?: WorkspaceDbSettingsProps | WorkspaceDbSettingsProps[];
|
|
286
289
|
/** The directory for local WorkspaceDb files with the name `${containerId}/${dbId}.itwin-workspace`.
|
|
287
290
|
* @internal
|
|
288
291
|
*/
|
|
@@ -324,13 +327,6 @@ export interface Workspace {
|
|
|
324
327
|
problems?: WorkspaceDbLoadError[]): Promise<void>;
|
|
325
328
|
/** Get a single [[WorkspaceDb]]. */
|
|
326
329
|
getWorkspaceDb(props: WorkspaceDbCloudProps): Promise<WorkspaceDb>;
|
|
327
|
-
/** Get a [[SettingsDb]] from a previously-loaded settings container in this workspace.
|
|
328
|
-
* @param args The arguments identifying which SettingsDb to retrieve.
|
|
329
|
-
* @returns The SettingsDb from the matching container.
|
|
330
|
-
* @throws if no container matching [[GetSettingsDbArgs.containerId]] has been loaded into this workspace, or if the container does not hold a SettingsDb.
|
|
331
|
-
* @note The container must already be loaded via [[getContainer]] or [[getContainerAsync]] before calling this method.
|
|
332
|
-
*/
|
|
333
|
-
getSettingsDb(args: GetSettingsDbArgs): SettingsDb;
|
|
334
330
|
/**
|
|
335
331
|
* Resolve the value of all [[Setting]]s from this workspace with the supplied `settingName` into an array of [[WorkspaceDbCloudProps]]
|
|
336
332
|
* that can be used to query or load workspace resources. The settings must each be an array of type [[WorkspaceDbSettingsProps]].
|
|
@@ -360,7 +356,7 @@ export interface Workspace {
|
|
|
360
356
|
}): Promise<WorkspaceDb[]>;
|
|
361
357
|
}
|
|
362
358
|
/**
|
|
363
|
-
* Base interface for containers backed by [[CloudSqlite]] that hold versioned databases (e.g. [[WorkspaceDb]]s
|
|
359
|
+
* Base interface for containers backed by [[CloudSqlite]] that hold versioned databases (e.g. [[WorkspaceDb]]s).
|
|
364
360
|
* Provides the shared infrastructure for cloud access, local file caching, and semver-based database resolution.
|
|
365
361
|
* @note Not every container is associated with a [[CloudSqlite.CloudContainer]] — containers may also be loaded from the local file system.
|
|
366
362
|
* In this case, [[cloudContainer]] will be `undefined`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../src/workspace/Workspace.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAU,QAAQ,EAAoB,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,
|
|
1
|
+
{"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../src/workspace/Workspace.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAU,QAAQ,EAAoB,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qB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