@adminide-stack/core 11.0.1-alpha.11 → 11.0.1-alpha.13
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/constants/index.d.ts +0 -2
- package/lib/core/configurations/configuration.d.ts +24 -25
- package/lib/core/configurations/configuration.js +1 -1
- package/lib/core/configurations/configuration.js.map +1 -1
- package/lib/core/configurations/events/ConfigurationChangeEvent.d.ts +1 -1
- package/lib/core/configurations/events/ConfigurationChangeEvent.js +1 -1
- package/lib/core/configurations/events/ConfigurationChangeEvent.js.map +1 -1
- package/lib/core/configurations/helpers/configuration.d.ts +1 -1
- package/lib/core/configurations/helpers/configuration.js +1 -1
- package/lib/core/configurations/helpers/configuration.js.map +1 -1
- package/lib/core/configurations/models/ConfigurationModel.d.ts +3 -3
- package/lib/core/configurations/models/ConfigurationModel.js.map +1 -1
- package/lib/core/organization/configuration.d.ts +1 -2
- package/lib/core/organization/configuration.js +1 -1
- package/lib/core/organization/configuration.js.map +1 -1
- package/lib/core/organization/helpers/organization-helpers.d.ts +1 -1
- package/lib/core/organization/organization.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -1
- package/lib/interfaces/configuration/configuration-server-service.d.ts +1 -1
- package/lib/interfaces/configuration/configuration.d.ts +1 -2
- package/lib/interfaces/configuration/configuration.js +1 -1
- package/lib/interfaces/configuration/configuration.js.map +1 -1
- package/lib/interfaces/configuration/configurationRegistry.d.ts +4 -2
- package/lib/interfaces/configuration/configuraton-service.d.ts +1 -1
- package/lib/interfaces/configuration/defaultSettingSnapshot.d.ts +1 -1
- package/lib/interfaces/index.d.ts +0 -2
- package/lib/interfaces/page-store.d.ts +2 -16
- package/lib/interfaces/preferences-service.d.ts +1 -23
- package/lib/services/abstract-configuration.d.ts +1 -1
- package/lib/services/abstract-configuration.js +1 -1
- package/lib/services/abstract-organization-context-service.d.ts +1 -1
- package/lib/services/abstract-organization-context-service.js +1 -1
- package/lib/services/abstract-organization-context-service.js.map +1 -1
- package/lib/templates/modules/IConfigurationModel.ts.template +92 -0
- package/lib/utils/cdecodeUri.d.ts +1 -1
- package/lib/utils/cdecodeUri.js +107 -43
- package/lib/utils/cdecodeUri.js.map +1 -1
- package/lib/utils/configuration-utils.d.ts +1 -1
- package/lib/utils/generate-uri.d.ts +8 -7
- package/lib/utils/generate-uri.js +17 -13
- package/lib/utils/generate-uri.js.map +1 -1
- package/lib/utils/generated-settings-id.js +1 -1
- package/lib/utils/generated-settings-id.js.map +1 -1
- package/lib/utils/getUserAlias.d.ts +1 -1
- package/lib/utils/getUserAlias.js +1 -1
- package/lib/utils/getUserAlias.js.map +1 -1
- package/lib/utils/nodeContext.d.ts +1 -2
- package/lib/utils/nodeContext.js +1 -1
- package/lib/utils/nodeContext.js.map +1 -1
- package/lib/utils/preferenceUri.d.ts +4 -4
- package/lib/utils/preferenceUri.js +10 -9
- package/lib/utils/preferenceUri.js.map +1 -1
- package/lib/utils/resourceUriConversion.js +21 -11
- package/lib/utils/resourceUriConversion.js.map +1 -1
- package/lib/utils/splitCdecodeUri.d.ts +28 -0
- package/lib/utils/splitCdecodeUri.js +47 -2
- package/lib/utils/splitCdecodeUri.js.map +1 -1
- package/lib/vscodeExport/index.d.ts +3 -0
- package/package.json +10 -3
- package/lib/constants/scheme.d.ts +0 -40
- package/lib/constants/scheme.js +0 -43
- package/lib/constants/scheme.js.map +0 -1
- package/lib/constants/types.d.ts +0 -19
- package/lib/constants/types.js +0 -19
- package/lib/constants/types.js.map +0 -1
- package/lib/enums/connection-status.d.ts +0 -6
- package/lib/enums/connection-status.js +0 -7
- package/lib/enums/connection-status.js.map +0 -1
- package/lib/enums/index.d.ts +0 -6
- package/lib/enums/integration-configuration-status.d.ts +0 -5
- package/lib/enums/integration-configuration-status.js +0 -6
- package/lib/enums/integration-configuration-status.js.map +0 -1
- package/lib/enums/integrations-configuration-steps.d.ts +0 -8
- package/lib/enums/integrations-configuration-steps.js +0 -9
- package/lib/enums/integrations-configuration-steps.js.map +0 -1
- package/lib/enums/integrations-connection-names.d.ts +0 -12
- package/lib/enums/integrations-connection-names.js +0 -14
- package/lib/enums/integrations-connection-names.js.map +0 -1
- package/lib/enums/integrations.d.ts +0 -11
- package/lib/enums/integrations.js +0 -12
- package/lib/enums/integrations.js.map +0 -1
- package/lib/enums/permissions.d.ts +0 -7
- package/lib/enums/permissions.js +0 -8
- package/lib/enums/permissions.js.map +0 -1
- package/lib/interfaces/apollo-context.d.ts +0 -66
- package/lib/interfaces/log/index.d.ts +0 -1
- package/lib/interfaces/log/log-service.d.ts +0 -16
@@ -1,4 +1,4 @@
|
|
1
|
-
import {__decorate,__param,__metadata}from'tslib';import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {Emitter}from'@vscode-alt/monaco-editor/esm/vs/base/common/event.js';import {Disposable}from'@workbench-stack/core/lib/services/lifecycle/disposable.js';import {Barrier}from'@vscode-alt/monaco-editor/esm/vs/base/common/async.js';import {injectable,inject}from'inversify';import {CommonType}from'@common-stack/core';import {isEqual}from'@vscode-alt/monaco-editor/esm/vs/base/common/resources.js';import'../core/disposable.js';import'../core/event.js';import {OrganizationResource,OrganizationContext}from'../core/organization/organization.js';import'@vscode-alt/monaco-editor/esm/vs/base/common/types.js';import'common
|
1
|
+
import {__decorate,__param,__metadata}from'tslib';import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {Emitter}from'@vscode-alt/monaco-editor/esm/vs/base/common/event.js';import {Disposable}from'@workbench-stack/core/lib/services/lifecycle/disposable.js';import {Barrier}from'@vscode-alt/monaco-editor/esm/vs/base/common/async.js';import {injectable,inject}from'inversify';import {CommonType}from'@common-stack/core';import {isEqual}from'@vscode-alt/monaco-editor/esm/vs/base/common/resources.js';import'../core/disposable.js';import'../core/event.js';import {OrganizationResource,OrganizationContext}from'../core/organization/organization.js';import'@vscode-alt/monaco-editor/esm/vs/base/common/types.js';import'common';import'@vscode-alt/monaco-editor/esm/vs/base/common/objects.js';import'@vscode-alt/monaco-editor/esm/vs/base/common/arrays.js';import'@vscode-alt/monaco-editor/esm/vs/base/common/map.js';import'../constants/urls.js';import'../constants/routes.js';import'../interfaces/organization/organization-context.js';import'@workbench-stack/core/lib/constants/extensions.js';import'@workbench-stack/core/lib/interfaces/lifecycle/lifecycle.js';import'../interfaces/permissions.js';import'common/lib/generated/generated-models.js';import {isOrganizationIdentifier,isSingleResourceOrganizationIdentifier}from'../core/organization/helpers/organization-helpers.js';let AbstractOrganizationContextService = class AbstractOrganizationContextService extends Disposable {
|
2
2
|
completeOrganizationBarrier;
|
3
3
|
updateOrganizationBarrier;
|
4
4
|
logger;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"abstract-organization-context-service.js","sources":["../../src/services/abstract-organization-context-service.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"abstract-organization-context-service.js","sources":["../../src/services/abstract-organization-context-service.ts"],"sourcesContent":[null],"names":[],"mappings":"m3CA2BO,IAAe,kCAAkC,GAAjD,MAAe,kCAClB,SAAQ,UAAU,CAAA;AAGR,EAAA,2BAAA;AAEA,EAAA,yBAAA;AAEA,EAAA,MAAA;2BAEkC,GAAA,cAA4C,CAAA,IAChF,OAAA,EAAO,CAA6B;AAG5B,EAAA,wBAAA,OAAiE,CAAA,yBAA0B,CAAA;mCAEvD,GAAA,cAAoD,CAAA,IAChG,OAAA,EAAO,CAAqC;AAGpC,EAAA,gCAAA,OACR,CAAA,iCAAkC,CAAA;8BAEK,GAAA,cAAyB,CAAA,IAAc,OAAA,EAAO,CAAU;AAEvF,EAAA,2BAAA,OAAiD,CAAA,4BAA6B,CAAA;8BAE/C,GAAA,cAAmC,CAAA,IAC1E,OAAA,EAAO,CAAoB;AAGnB,EAAA,2BAAA,OAA2D,CAAA,4BAA6B,CAAA;AAExG,EAAA,WAAA,CAAA,MAEmB,EAAA;AAEf,IAAA,KAAA,EAAA;AACA,IAAA,IAAA,CAAA,MAAK,GAA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{ IOverrides, IIConfigurationModel } from 'common';
|
2
|
+
|
3
|
+
export interface IConfigurationModel extends IIConfigurationModel {
|
4
|
+
/**
|
5
|
+
* Gets the configuration contents
|
6
|
+
*/
|
7
|
+
contents: any;
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Gets the override configurations
|
11
|
+
*/
|
12
|
+
overrides: IOverrides[];
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Gets the configuration keys
|
16
|
+
*/
|
17
|
+
keys: string[];
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Checks if the configuration is empty
|
21
|
+
*/
|
22
|
+
isEmpty(): boolean;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Checks if the configuration is frozen
|
26
|
+
*/
|
27
|
+
isFrozen(): boolean;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Gets a value from the configuration
|
31
|
+
* @param section The configuration section
|
32
|
+
*/
|
33
|
+
getValue<V>(section: string | undefined): V;
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Gets an override value from the configuration
|
37
|
+
* @param section The configuration section
|
38
|
+
* @param overrideIdentifier The override identifier
|
39
|
+
*/
|
40
|
+
getOverrideValue<V>(section: string | undefined, overrideIdentifier: string): V | undefined;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Gets keys for a specific override identifier
|
44
|
+
* @param identifier The override identifier
|
45
|
+
*/
|
46
|
+
getKeysForOverrideIdentifier(identifier: string): string[];
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Gets all override identifiers
|
50
|
+
*/
|
51
|
+
getAllOverrideIdentifiers(): string[];
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Creates a new configuration model with overrides
|
55
|
+
* @param identifier The override identifier
|
56
|
+
*/
|
57
|
+
override(identifier: string): IConfigurationModel;
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Merges multiple configuration models
|
61
|
+
* @param others The configuration models to merge
|
62
|
+
*/
|
63
|
+
merge(...others: IConfigurationModel[]): IConfigurationModel;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Freezes the configuration model
|
67
|
+
*/
|
68
|
+
freeze(): IConfigurationModel;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Creates a clone of the configuration model
|
72
|
+
*/
|
73
|
+
clone(): IConfigurationModel;
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Converts the configuration model to JSON
|
77
|
+
*/
|
78
|
+
toJSON(): IIConfigurationModel;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Sets a value in the configuration
|
82
|
+
* @param key The configuration key
|
83
|
+
* @param value The value to set
|
84
|
+
*/
|
85
|
+
setValue(key: string, value: any): void;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Removes a value from the configuration
|
89
|
+
* @param key The configuration key to remove
|
90
|
+
*/
|
91
|
+
removeValue(key: string): void;
|
92
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
2
|
-
import { ICdecodeUriPathSegment, IAuthorityComponent, ConfigurationTarget, ICdecodeParsedUri } from 'common
|
2
|
+
import { ICdecodeUriPathSegment, IAuthorityComponent, ConfigurationTarget, ICdecodeParsedUri } from 'common';
|
3
3
|
export declare const generateCdecodeUri: (authority: string | IAuthorityComponent, params: ICdecodeUriPathSegment, query?: {
|
4
4
|
[key: string]: string | number;
|
5
5
|
}, fragment?: string) => URI;
|
package/lib/utils/cdecodeUri.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import sortKeys from'sort-keys';import queryString from'query-string';import {Scheme,ConfigCollectionName}from'common';/* eslint-disable prefer-destructuring */
|
2
2
|
/* eslint-disable default-param-last */
|
3
3
|
const generateCdecodeUri = (authority, params, query = {}, fragment) => {
|
4
4
|
let authorityString;
|
@@ -44,7 +44,7 @@ const generateCdecodeUri = (authority, params, query = {}, fragment) => {
|
|
44
44
|
// Conditionally include the leading slash
|
45
45
|
const path = pathSegments.length > 0 ? `/${pathSegments.join('/')}` : '/';
|
46
46
|
return URI.from({
|
47
|
-
scheme:
|
47
|
+
scheme: Scheme.CDECODE,
|
48
48
|
authority: authorityString,
|
49
49
|
path,
|
50
50
|
query: queryInString,
|
@@ -72,18 +72,44 @@ const generateCdecodeUri = (authority, params, query = {}, fragment) => {
|
|
72
72
|
*/
|
73
73
|
function parseCdecodeUri(uriString) {
|
74
74
|
const uri = typeof uriString === 'string' ? URI.parse(uriString) : uriString;
|
75
|
-
|
75
|
+
// Handle null or undefined path
|
76
|
+
const path = uri.path === '/null' || uri.path === '/undefined' ? '/' : uri.path;
|
77
|
+
// Split the path but preserve empty segments by not filtering
|
78
|
+
// Remove the leading empty segment that comes from the first slash
|
79
|
+
const pathSegmentsArray = path.split('/');
|
80
|
+
if (pathSegmentsArray[0] === '') {
|
81
|
+
pathSegmentsArray.shift(); // Remove the first empty segment from leading slash
|
82
|
+
}
|
76
83
|
const pathSegments = {
|
77
|
-
organization:
|
84
|
+
organization: ''
|
78
85
|
};
|
79
86
|
// Parse query and fragment
|
80
|
-
const queryData = queryString.parse(uri?.query);
|
81
|
-
let fragmentData = uri?.fragment;
|
87
|
+
const queryData = queryString.parse(uri?.query || '');
|
88
|
+
let fragmentData = uri?.fragment || '';
|
82
89
|
if (uri?.fragment?.includes('=')) {
|
83
|
-
fragmentData = queryString.parse(uri
|
90
|
+
fragmentData = queryString.parse(uri.fragment);
|
84
91
|
}
|
85
|
-
if (
|
86
|
-
//
|
92
|
+
if (uri.scheme === Scheme.CDECODE_RESOURCE) {
|
93
|
+
// Remove leading slash and get resource type
|
94
|
+
const resourceType = path.substring(1);
|
95
|
+
if (resourceType === ConfigCollectionName.Organizations) {
|
96
|
+
// Organization URI format: /organizations?name=orgName
|
97
|
+
pathSegments.organization = queryData.name || '';
|
98
|
+
} else if (resourceType === ConfigCollectionName.Projects) {
|
99
|
+
// Project URI format: /projects?orgName=org&resourceGroup=group
|
100
|
+
pathSegments.organization = queryData.orgName || '';
|
101
|
+
} else {
|
102
|
+
// Resource URI format: /resourceType?_id=id&orgName=org
|
103
|
+
// or: /resourceType?field=value&orgName=org
|
104
|
+
pathSegments.resourceType = resourceType;
|
105
|
+
pathSegments.organization = queryData.orgName || '';
|
106
|
+
// Handle different ID fields (_id, name, email, etc)
|
107
|
+
if (queryData._id) {
|
108
|
+
pathSegments.resourceId = queryData._id;
|
109
|
+
} else if (queryData.name) {
|
110
|
+
pathSegments.resourceId = `name:${queryData.name}`;
|
111
|
+
}
|
112
|
+
}
|
87
113
|
return {
|
88
114
|
scheme: uri.scheme,
|
89
115
|
authority: uri.authority,
|
@@ -91,43 +117,81 @@ function parseCdecodeUri(uriString) {
|
|
91
117
|
queryData,
|
92
118
|
fragmentData
|
93
119
|
};
|
94
|
-
}
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
120
|
+
} else if (uri.scheme === Scheme.CDECODE) {
|
121
|
+
// Handle empty or invalid path segments
|
122
|
+
if (pathSegmentsArray.length === 0 || pathSegmentsArray.length === 1 && (pathSegmentsArray[0] === 'null' || pathSegmentsArray[0] === 'undefined')) {
|
123
|
+
// Handle the case with no path segments or null/undefined path
|
124
|
+
return {
|
125
|
+
scheme: uri.scheme,
|
126
|
+
authority: uri.authority,
|
127
|
+
pathSegments,
|
128
|
+
queryData,
|
129
|
+
fragmentData
|
130
|
+
};
|
131
|
+
}
|
132
|
+
// Handle empty segments (like `//accounts/resourceId`)
|
133
|
+
if (pathSegmentsArray.length >= 2 && pathSegmentsArray[0] === '') {
|
134
|
+
// Empty organization segment
|
135
|
+
if (pathSegmentsArray.length >= 3 && pathSegmentsArray[1] === '') {
|
136
|
+
// Empty resourceGroup segment also
|
137
|
+
const possibleResourceType = pathSegmentsArray[2];
|
138
|
+
const resourceId = pathSegmentsArray[3];
|
139
|
+
// Validate resourceType exists in ConfigCollectionName
|
140
|
+
const isResourceType = Object.values(ConfigCollectionName).includes(possibleResourceType);
|
141
|
+
if (isResourceType && resourceId) {
|
142
|
+
pathSegments.resourceType = possibleResourceType;
|
143
|
+
pathSegments.resourceId = resourceId;
|
144
|
+
return {
|
145
|
+
scheme: uri.scheme,
|
146
|
+
authority: uri.authority,
|
147
|
+
pathSegments,
|
148
|
+
queryData,
|
149
|
+
fragmentData
|
150
|
+
};
|
151
|
+
}
|
152
|
+
}
|
103
153
|
}
|
104
|
-
//
|
105
|
-
|
106
|
-
|
107
|
-
} else if (pathSegmentsArray.length === 2) {
|
108
|
-
// Case: organization/project or organization/resourceType
|
109
|
-
const possibleResourceTypeOrProject = pathSegmentsArray[1];
|
110
|
-
// Check if it's a valid resourceType
|
111
|
-
const isResourceType = Object.values(ConfigCollectionName).includes(possibleResourceTypeOrProject);
|
112
|
-
if (isResourceType) {
|
113
|
-
// If it's a valid resourceType, validate further
|
114
|
-
throw new Error(`Invalid URI structure: The resourceType "${possibleResourceTypeOrProject}" is missing the resourceId.`);
|
154
|
+
// Non-empty first segment is the organization
|
155
|
+
if (pathSegmentsArray[0] !== '') {
|
156
|
+
pathSegments.organization = pathSegmentsArray[0];
|
115
157
|
}
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
158
|
+
if (pathSegmentsArray.length === 3) {
|
159
|
+
// Case: organization/resourceType/resourceId
|
160
|
+
const possibleResourceType = pathSegmentsArray[1];
|
161
|
+
const resourceId = pathSegmentsArray[2];
|
162
|
+
// Validate the resourceType against ConfigCollectionName
|
163
|
+
const isResourceType = Object.values(ConfigCollectionName).includes(possibleResourceType);
|
164
|
+
if (!isResourceType) {
|
165
|
+
throw new Error(`Invalid URI structure: The resourceType "${possibleResourceType}" is not included in ConfigCollectionName.`);
|
166
|
+
}
|
167
|
+
// Assign resourceType and resourceId
|
168
|
+
pathSegments.resourceType = possibleResourceType;
|
169
|
+
pathSegments.resourceId = resourceId;
|
170
|
+
} else if (pathSegmentsArray.length === 2) {
|
171
|
+
// Case: organization/project or organization/resourceType
|
172
|
+
const possibleResourceTypeOrProject = pathSegmentsArray[1];
|
173
|
+
// Check if it's a valid resourceType
|
174
|
+
const isResourceType = Object.values(ConfigCollectionName).includes(possibleResourceTypeOrProject);
|
175
|
+
if (isResourceType) {
|
176
|
+
// If it's a valid resourceType, validate further
|
177
|
+
throw new Error(`Invalid URI structure: The resourceType "${possibleResourceTypeOrProject}" is missing the resourceId.`);
|
178
|
+
}
|
179
|
+
// Otherwise, treat it as a project
|
180
|
+
pathSegments.resourceGroup = possibleResourceTypeOrProject;
|
181
|
+
} else if (pathSegmentsArray.length > 3) {
|
182
|
+
// Case: organization/project/resourceType/resourceId
|
183
|
+
pathSegments.resourceGroup = pathSegmentsArray[1];
|
184
|
+
const possibleResourceType = pathSegmentsArray[2];
|
185
|
+
const resourceId = pathSegmentsArray[3];
|
186
|
+
// Validate the resourceType
|
187
|
+
const isResourceType = Object.values(ConfigCollectionName).includes(possibleResourceType);
|
188
|
+
if (!isResourceType) {
|
189
|
+
throw new Error(`Invalid URI structure: The resourceType "${possibleResourceType}" is not included in ConfigCollectionName.`);
|
190
|
+
}
|
191
|
+
// Assign resourceType and resourceId
|
192
|
+
pathSegments.resourceType = possibleResourceType;
|
193
|
+
pathSegments.resourceId = resourceId;
|
127
194
|
}
|
128
|
-
// Assign resourceType and resourceId
|
129
|
-
pathSegments.resourceType = possibleResourceType;
|
130
|
-
pathSegments.resourceId = resourceId;
|
131
195
|
}
|
132
196
|
return {
|
133
197
|
scheme: uri.scheme,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cdecodeUri.js","sources":["../../src/utils/cdecodeUri.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"cdecodeUri.js","sources":["../../src/utils/cdecodeUri.ts"],"sourcesContent":[null],"names":[],"mappings":"6L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AAA;AACjD;kBAGH,CAAA,aAAA,GAAA,iBAAA,CAAA,CAAA,CAAA;YAED,oBAAmC,GAAA,iBAAA,CAAA,CAAA,CAAA;AACnC,MAAA,MAAA,UAAA,GAAa,iBAAgB,CAAA,CAAA,CAAA;;AAC1B,MAAA,MAAA,uBAAsB,CAAA,MAAS,CAAA,oBAAI,CAAA,CAAA,QAAA,CAAA,oBAAA,CAAA;yBACe,EAAA;AACrD,QAAA,MAAA,IAAA,KAAA,CAAY,CAAC,yCAAqC,EAAA,oBAAA,CAAA,0CAAA,CAAA,CAAA;AAClD;AACA;kBAE4B,CAAA,YAAA,GAAA,oBAAA;AAC5B,MAAA,YAAM,CAAc,UAAA,GAAA,UAAU;;AAK1B;;YAKJ,GAAqC,CAAA,MAAA;AACrC,IAAA,SAAA,EAAA,GAAA,CAAA,SAAa;AACb,IAAA,YAAA;aACH;IACL;;;;;;;AAQE,SAAA,4BAAA,CAAA,SAAA,EAAA;AACN,EAAC,MAAA;AAED,IAAA,YAAA;;;AAGG;AACH,EAAM,IAAA,YAAsC,EAAA;IACxC,OAAM,CAAE;;;kBAI6C,EAAA;IACrD,OAAC,CAAA;;;;;;SAQ8D,CAAA;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ConfigurationScope, IConfigurationNode } from 'common
|
1
|
+
import { ConfigurationScope, IConfigurationNode } from 'common';
|
2
2
|
/**
|
3
3
|
* Retrieves the scope (ConfigurationScope) for each registered property.
|
4
4
|
* If tenantId is provided, retrieves only that tenant's properties.
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
2
|
-
import { ConfigCollectionName, ConfigFragmentName } from 'common
|
2
|
+
import { ConfigCollectionName, ConfigFragmentName, Scheme } from 'common';
|
3
|
+
declare const defaultOptions: {
|
4
|
+
flatten: boolean;
|
5
|
+
scheme: Scheme;
|
6
|
+
};
|
3
7
|
/**
|
4
8
|
* Generate URI, it sorts the params in order to generate URI.
|
5
9
|
* @param collectionName Schema Name to be used
|
@@ -9,9 +13,7 @@ import { ConfigCollectionName, ConfigFragmentName } from 'common/lib/generated/g
|
|
9
13
|
*/
|
10
14
|
export declare const generateUri: (collectionName: ConfigCollectionName, params: {
|
11
15
|
[key: string]: any;
|
12
|
-
}, fragment: string, authority?: string, options?:
|
13
|
-
flatten: boolean;
|
14
|
-
}) => URI;
|
16
|
+
}, fragment: string, authority?: string, options?: Partial<typeof defaultOptions>) => URI;
|
15
17
|
/**
|
16
18
|
* Generates URI for User with `_id` as `self` if the user logged in otherwise `guest`
|
17
19
|
*/
|
@@ -31,8 +33,7 @@ export declare const generateResourceUri: (collectionName: ConfigCollectionName,
|
|
31
33
|
[key: string]: any;
|
32
34
|
name?: string;
|
33
35
|
orgName: string;
|
34
|
-
}, fragment: string, authority?: string, options?:
|
35
|
-
flatten: boolean;
|
36
|
-
}) => URI;
|
36
|
+
}, fragment: string, authority?: string, options?: Partial<typeof defaultOptions>) => URI;
|
37
37
|
export declare const generateOrgUri: (name: string, fragment: string, authority?: string) => URI;
|
38
38
|
export declare const generateMachineUri: (name: string, fragment: string, authority?: string) => URI;
|
39
|
+
export {};
|
@@ -1,17 +1,19 @@
|
|
1
|
-
import {
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import sortKeys from'sort-keys';import queryString from'query-string';import {Scheme,ConfigFragmentName,ConfigCollectionName}from'common';import {flatten}from'./flatten-utils.js';function hasNestedObject(obj) {
|
2
2
|
// Not an object or null? No nesting to worry about.
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
4
4
|
return false;
|
5
5
|
}
|
6
|
-
// Treat arrays as acceptable
|
6
|
+
// Treat arrays as acceptable
|
7
7
|
if (Array.isArray(obj)) {
|
8
8
|
return false;
|
9
9
|
}
|
10
|
-
//
|
11
|
-
|
12
|
-
// direct child objects. E.g. { name: { name: 'tet' } } triggers an error.
|
13
|
-
return Object.values(obj).some(val => typeof val === 'object' && val !== null && !Array.isArray(val));
|
10
|
+
// Only consider it nested if any value is a non-null, non-array object
|
11
|
+
return Object.values(obj).some(val => val !== null && typeof val === 'object' && !Array.isArray(val) && !(val instanceof Date));
|
14
12
|
}
|
13
|
+
const defaultOptions = {
|
14
|
+
flatten: false,
|
15
|
+
scheme: Scheme.MONGO_DB_FILE
|
16
|
+
};
|
15
17
|
/**
|
16
18
|
* Generate URI, it sorts the params in order to generate URI.
|
17
19
|
* @param collectionName Schema Name to be used
|
@@ -19,18 +21,22 @@ import {Schemas}from'@workbench-stack/core/lib/core/network.js';import {URI}from
|
|
19
21
|
* @param fragment
|
20
22
|
* @param authority
|
21
23
|
*/
|
22
|
-
const generateUri = (collectionName, params, fragment, authority = '', options
|
23
|
-
|
24
|
-
|
24
|
+
const generateUri = (collectionName, params, fragment, authority = '', options) => {
|
25
|
+
options = {
|
26
|
+
...defaultOptions,
|
27
|
+
...options
|
28
|
+
};
|
25
29
|
// If we are NOT flattening, but detect nested objects, throw an error
|
26
30
|
if (!options.flatten && hasNestedObject(params)) {
|
27
31
|
throw new Error(`generateUri: "params: ${JSON.stringify(params)}" contains nested object(s), but "options.flatten" is false. Please flatten your data or enable flatten.`);
|
28
32
|
}
|
33
|
+
console.log('---params---', params);
|
29
34
|
params = options.flatten ? flatten(params) : params;
|
35
|
+
console.log('---params after flatten---', params);
|
30
36
|
const orderedParams = sortKeys(params);
|
31
37
|
const queryString$1 = queryString.stringify(orderedParams);
|
32
38
|
return URI.file(`/${collectionName}`).with({
|
33
|
-
scheme:
|
39
|
+
scheme: options.scheme,
|
34
40
|
authority,
|
35
41
|
fragment,
|
36
42
|
query: queryString$1
|
@@ -58,9 +64,7 @@ const generateUserUri = (params, fragment = ConfigFragmentName.Settings, authori
|
|
58
64
|
const generateApplicationUri = (orgName, fragment = ConfigFragmentName.Settings, authority = '') => generateUri(ConfigCollectionName.Organizations, {
|
59
65
|
orgName
|
60
66
|
}, fragment, authority);
|
61
|
-
const generateResourceUri = (collectionName, params, fragment, authority = '', options
|
62
|
-
flatten: false
|
63
|
-
}) => generateUri(collectionName, params, fragment, authority, options);
|
67
|
+
const generateResourceUri = (collectionName, params, fragment, authority = '', options) => generateUri(collectionName, params, fragment, authority, options);
|
64
68
|
const generateOrgUri = (name, fragment, authority = '') => generateUri(ConfigCollectionName.Organizations, {
|
65
69
|
name
|
66
70
|
}, fragment, authority);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generate-uri.js","sources":["../../src/utils/generate-uri.ts"],"sourcesContent":[null],"names":["queryString","querystring"],"mappings":"
|
1
|
+
{"version":3,"file":"generate-uri.js","sources":["../../src/utils/generate-uri.ts"],"sourcesContent":[null],"names":["queryString","querystring"],"mappings":"yPAOA,SAAS,eAAe,CAAC,GAAQ,EAAA;;MAEzB,OAAA,QAAe,QAAA,OAAe,KAAA,IAAS,EAAA;AACvC,IAAA,OAAA;;;AAGJ,EAAA,IAAA,aAAU,CAAA,GAAW,CAAA,EAAC;AAClB,IAAA,OAAA;;;AAGJ,EAAA,OAAA,aAAc,CAAA,GAAO,CAAA,CAAG,IAAE,CAAA,GACrB,IAAK,GAAE,KAAI,IAAK,IAAI,OAAI,GAAA,KAAU,YAAa,CAAI,KAAM,CAAA,WAAQ,CAAC,IAAI,EAAA,GAAK,gBAAgB,CAAI,CAAA;AAExG;AAEA,MAAM,cAAc,GAAG;AAEvB,EAAA,OAAA,EAAA,KAAA;;;;;;AAMG;AACH;;;AASgB,MAAA,WAAQ,GAAA,CAAI,gBAAgB,MAAM,EAAC,QAAG,EAAA,SAAA,GAAA,EAAA,EAAA,OAAA,KAAA;AAC9C,EAAA,OAAA,GAAA;IAKJ,GAAC,cAAA;AACD,IAAA,GAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,CAAA,mBAAsB,eAAe,CAAC,MAAC,CAAA,EAAA;IACvC,MAAM,IAAA,KAAA,CAAA,CAAW,wBAAwB,IAAC,CAAA,SAAa,CAAC,MAAC,CAAA,CAAA,wGAAA,CAAA,CAAA;;SAG/C,CAAA,GAAA,CAAA,cAAgB,EAAA,MAAA,CAAA;QACtB,GAAS,OAAA,CAAA,OAAA,GAAA,OAAA,CAAA,MAAA,CAAA,GAAA,MAAA;SACD,CAAA,GAAA,CAAA,4BAAA,EAAA,MAAA,CAAA;AACR,EAAA,MAAA,aAAkB,GAAA,QAAA,CAAA,MAAA,CAAA;AACrB,EAAA,MAAEA,aAAA,GAAAC,WAAA,CAAA,SAAA,CAAA,aAAA,CAAA;AACP,EAAE,OAAA,GAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,cAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA;AAEF,IAAA,MAAA,EAAA,OAAA,CAAA,MAAA;;AAEG,IAAA,QAAA;AACH,IAAA,KAAO,EAAAD;AAMP,GAAA,CAAA;;AAEG;AACH;AAKI;AACmC,MAAA,oBAAiB,GAAA,CAAA,WAAW,EAAA,QAAA,GAAA,kBAAA,CAAA,QAAA,EAAA,SAAA,GAAA,EAAA,KAAA,WAAA,CAAA,oBAAA,CAAA,QAAA,EAAA;;WAE9D,EAAA,SAAA;AACD;AACJ;AAEA;;AAEG,EAAA,IAAA,MAAA,CAAA,SAAA,EAAA;AACH,IAAA,MAAO,CAAA,KAA4B,GAAA,CAAA,MAAA,CAAA,SAAA,CAAA;AAGnC,IAAA,OAAO,MAAyB,CAAA,SAAA;AAQhC;AAGA,EAAA,OAAO,WAAwB,CAAA,oBAAkB,CAAA,QAAkB,EAAA,MAAA,EAAS,QAAO,EAC/E,SAAA,CAAA;;;;;;;;;;;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {ConfigurationContributionNames}from'common
|
1
|
+
import {ConfigurationContributionNames}from'common';// not used anymore
|
2
2
|
const generateSettingsId = (target, nativeId = ConfigurationContributionNames.Settings) => {
|
3
3
|
if (!nativeId) {
|
4
4
|
nativeId = ConfigurationContributionNames.Settings;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generated-settings-id.js","sources":["../../src/utils/generated-settings-id.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"generated-settings-id.js","sources":["../../src/utils/generated-settings-id.ts"],"sourcesContent":[null],"names":[],"mappings":"oDAGA;AACO,MAAM,kBAAkB,GAAG,CAC9B,MAA2B,EAC3B,QAAA,GAAmB,8BAA8B,CAAC,QAAQ,KAC1D;MACI,CAAA,QAAS,EAAA;AACT,IAAA,QAAA,GAAA,8BAAW,CAAA,QAA+B;;AAE9C,EAAA,OAAA,CAAA,EAAU,QAAA,CAAA,CAAQ,EAAI,MAAA,CAAA,CAAM;AAChC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { AuthStrategy } from 'common
|
1
|
+
import { AuthStrategy } from 'common';
|
2
2
|
export declare const getUserAlias: (alias: string[], strategy: AuthStrategy) => any;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {AuthStrategy}from'common
|
1
|
+
import {AuthStrategy}from'common';const getUserAlias = (alias, strategy) => {
|
2
2
|
let id;
|
3
3
|
if (strategy === AuthStrategy.Keycloak) {
|
4
4
|
id = alias.find(x => x.includes(AuthStrategy.Keycloak));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getUserAlias.js","sources":["../../src/utils/getUserAlias.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"getUserAlias.js","sources":["../../src/utils/getUserAlias.ts"],"sourcesContent":[null],"names":[],"mappings":"wCAEa,YAAY,GAAG,CAAC,KAAe,EAAE,QAAsB,KAAI;AACpE,EAAA,IAAA,EAAI;AACJ,EAAA,IAAA,aAAiB,YAAA,CAAA,QAAa,EAAQ;AAClC,IAAA,EAAA,GAAA,KAAU,CAAA,IAAC,MAAM,CAAC,CAAE,qBAAc,CAAA,QAAqB,CAAA,CAAA;AACvD,IAAA,OAAA,EAAA,CAAA,KAAe,CAAA,CAAA,EAAA,YAAI,CAAA,QAAa,CAAA,CAAA,CAAA,CAAQ,CAAG,CAAA,CAAA;;IAE/C,GAAE,UAAS,CAAA,CAAI,KAAK,CAAE,CAAA,qBAAa,CAAA,QAAqB,CAAA,CAAA;AACxD,EAAA,OAAA,EAAO,CAAE,KAAM,CAAA,CAAA,EAAI,YAAA,CAAA,KAAa,CAAA,CAAK,CAAG,CAAA,CAAA,CAAC,CAAC;AAC9C"}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { IConfigurationNodeContextInput, RegistryExtensions, ConfigurationSchemaId } from 'common
|
2
|
-
import { ServerContext } from 'common';
|
1
|
+
import { IConfigurationNodeContextInput, RegistryExtensions, ConfigurationSchemaId, ServerContext } from 'common';
|
3
2
|
type UserContext = Pick<ServerContext['userContext'], 'userAlias' | 'orgId' | 'tenantId'>;
|
4
3
|
export declare function buildNodeContext(userContext: UserContext, schemaId?: ConfigurationSchemaId, extensionName?: RegistryExtensions): IConfigurationNodeContextInput;
|
5
4
|
export declare function buildPermissionNodeContext(userContext: UserContext): IConfigurationNodeContextInput;
|
package/lib/utils/nodeContext.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {ConfigurationSchemaId,RegistryExtensions}from'common
|
1
|
+
import {ConfigurationSchemaId,RegistryExtensions}from'common';function buildNodeContext(userContext, schemaId = ConfigurationSchemaId.Configuration, extensionName = RegistryExtensions.DefaultConfiguration) {
|
2
2
|
return {
|
3
3
|
schemaId: schemaId,
|
4
4
|
tenantId: userContext?.tenantId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nodeContext.js","sources":["../../src/utils/nodeContext.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"nodeContext.js","sources":["../../src/utils/nodeContext.ts"],"sourcesContent":[null],"names":[],"mappings":"8DAGgB,SAAA,gBAAgB,CAC5B,WAAwB,EACxB,QAAQ,GAAG,qBAAqB,CAAC,aAAa,EAC9C,aAAoC,GAAA,kBAAkB,CAAC,oBAAoB,EAAA;SAEpE;AACH,IAAA,QAAA,EAAA,QAAkB;YACV,EAAA,WAAa,EAAA,QAAU;iBAClB;SACR,EAAA,WAAa,EAAA,KAAO;aAChB,EAAA,WAAa,EAAA;;AAE9B;AAEM,SAAU,0BAA0B,CAAC,WAAwB,EAAA;AAC/D,EAAA,OAAA,gBAAuB,CAAA,WAAY,EAAA,qBAAuB,CAAA,UAAW,EAAA,kBAAoB,CAAA,oBAAqB,CAAA;AAClH;AACM,SAAU,sBAAsB,CAAC,WAAwB,EAAA;AAC3D,EAAA,OAAA,gBAAuB,CAAA,WAAY,EAAA,qBAAuB,CAAA,MAAO,EAAA,kBAAoB,CAAA,oBAAqB,CAAA;AAC9G;AAEM,SAAU,oBAAoB,CAAC,WAAwB,EAAA;AACzD,EAAA,OAAA,gBAAuB,CAAA,WAAY,EAAA,qBAAuB,CAAA,QAAS,EAAA,kBAAoB,CAAA,oBAAqB,CAAA;AAChH"}
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
2
|
-
import { IPreferencesOpenOptionsInput, ConfigurationTarget } from 'common
|
2
|
+
import { IPreferencesOpenOptionsInput, ConfigurationTarget } from 'common';
|
3
3
|
export declare function getOpenSettings(target: ConfigurationTarget, resource: URI, options: IPreferencesOpenOptionsInput): {
|
4
4
|
editableSettingsInput: URI;
|
5
5
|
defaultPreferencesInput: URI;
|
6
6
|
};
|
7
7
|
/**
|
8
|
-
* Tries to parse the
|
8
|
+
* Tries to parse the "extension name" from a URI path that might look like:
|
9
9
|
* /myExtension/settings.json
|
10
10
|
* /defaultsettings/resourceSettings.json
|
11
11
|
* /someFolder/myExtension/organizationSettings.json
|
12
12
|
*
|
13
|
-
* If the last path segment is one of the
|
14
|
-
* the second-to-last segment as the extension name. Otherwise, return
|
13
|
+
* If the last path segment is one of the "known" settings files, return
|
14
|
+
* the second-to-last segment as the extension name. Otherwise, return "settings" by default.
|
15
15
|
*/
|
16
16
|
export declare function parseExtensionFromDefaultSettingsUri(resource: URI): string;
|
17
17
|
export declare function getDefaultSettingsURI(target: ConfigurationTarget, options: IPreferencesOpenOptionsInput): URI;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {convertToResourceUri}from'./resourceUriConversion.js';import {ConfigurationContributionNames}from'common
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {convertToResourceUri}from'./resourceUriConversion.js';import {ConfigurationContributionNames}from'common';const KNOWN_SETTINGS_FILES = new Set(['settings.json', 'organizationSettings.json', 'resourceSettings.json', 'machineSettings.json', 'applicationSettings.json', 'organizationsettings.json', 'resourcesettings.json', 'machinesettings.json', 'applicationsettings.json']);
|
2
2
|
function getOpenSettings(target, resource, options) {
|
3
3
|
const editableSettingsResource = getEditableSettingsURI(resource, options);
|
4
4
|
const mergedOptions = {
|
@@ -7,7 +7,7 @@ function getOpenSettings(target, resource, options) {
|
|
7
7
|
query: editableSettingsResource.query,
|
8
8
|
// Use editableSettingsResource.fragment if none was explicitly set.
|
9
9
|
defaultFragment: options?.defaultFragment ?? editableSettingsResource.fragment,
|
10
|
-
// Use the provided extensionName, or derive it from the resource
|
10
|
+
// Use the provided extensionName, or derive it from the resource's path
|
11
11
|
extensionName: options?.extensionName ?? parseExtensionFromDefaultSettingsUri(editableSettingsResource)
|
12
12
|
};
|
13
13
|
const defaultPreferencesResource = getDefaultSettingsURI(target, mergedOptions);
|
@@ -17,13 +17,13 @@ function getOpenSettings(target, resource, options) {
|
|
17
17
|
};
|
18
18
|
}
|
19
19
|
/**
|
20
|
-
* Tries to parse the
|
20
|
+
* Tries to parse the "extension name" from a URI path that might look like:
|
21
21
|
* /myExtension/settings.json
|
22
22
|
* /defaultsettings/resourceSettings.json
|
23
23
|
* /someFolder/myExtension/organizationSettings.json
|
24
24
|
*
|
25
|
-
* If the last path segment is one of the
|
26
|
-
* the second-to-last segment as the extension name. Otherwise, return
|
25
|
+
* If the last path segment is one of the "known" settings files, return
|
26
|
+
* the second-to-last segment as the extension name. Otherwise, return "settings" by default.
|
27
27
|
*/
|
28
28
|
function parseExtensionFromDefaultSettingsUri(resource) {
|
29
29
|
const pathSegments = resource.path.split('/').filter(Boolean);
|
@@ -46,7 +46,7 @@ function parseExtensionFromDefaultSettingsUri(resource) {
|
|
46
46
|
if (lastSegment.endsWith('.json')) {
|
47
47
|
// e.g. "/myExtension/otherFile.json" → extension = "otherFile" (or 2nd to last segment?)
|
48
48
|
// This snippet assumes you want "otherFile" from the last segment. If you instead want
|
49
|
-
// the second-to-last segment as an
|
49
|
+
// the second-to-last segment as an "extensionName," just adjust accordingly.
|
50
50
|
const trimmed = lastSegment.replace(/\.json$/, '');
|
51
51
|
return trimmed || ConfigurationContributionNames.Settings;
|
52
52
|
}
|
@@ -90,14 +90,15 @@ function getEditableSettingsURI(resource, options = {
|
|
90
90
|
fragment
|
91
91
|
} = options;
|
92
92
|
if (options?.subFragment) {
|
93
|
-
// If there
|
93
|
+
// If there's a subFragment, stitch it into the main fragment
|
94
94
|
fragment = fragment ? fragment.concat(`.${options.subFragment}`) : options.subFragment;
|
95
95
|
}
|
96
|
-
// Fall back to the resource
|
96
|
+
// Fall back to the resource's existing fragment if neither fragment nor subFragment is provided
|
97
97
|
const finalFragment = fragment ?? resource.fragment;
|
98
|
-
// Create a new URI with the possibly updated fragment
|
98
|
+
// Create a new URI with the possibly updated fragment, make sure to include authority.
|
99
99
|
const newResource = URI.from({
|
100
100
|
scheme: resource.scheme,
|
101
|
+
authority: resource.authority,
|
101
102
|
path: resource.path,
|
102
103
|
query: resource.query,
|
103
104
|
fragment: finalFragment
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"preferenceUri.js","sources":["../../src/utils/preferenceUri.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"preferenceUri.js","sources":["../../src/utils/preferenceUri.ts"],"sourcesContent":[null],"names":[],"mappings":"wLAIA,MAAM,oBAAoB,GAAG,IAAI,GA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