@adminide-stack/core 9.2.1-alpha.3 → 9.2.1-alpha.33
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/core/configurations/configuration.d.ts +1 -2
- package/lib/core/configurations/configuration.js +8 -8
- package/lib/core/configurations/configuration.js.map +1 -1
- package/lib/core/configurations/models/ConfigurationModel.js +1 -1
- package/lib/core/configurations/models/ConfigurationModel.js.map +1 -1
- package/lib/core/organization/configuration.d.ts +1 -1
- package/lib/core/organization/configuration.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/interfaces/apollo-context.d.ts +1 -0
- package/lib/interfaces/contex-key-service.d.ts +2 -2
- package/lib/interfaces/generated/generated-models.d.ts +334 -255
- package/lib/interfaces/generated/generated-models.js +559 -614
- package/lib/interfaces/generated/generated-models.js.map +1 -1
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/interfaces/organization-key-context.d.ts +12 -0
- package/lib/interfaces/preferences-service.d.ts +5 -3
- package/lib/interfaces/workbench-exports.d.ts +1 -1
- package/lib/services/abstract-configuration.js +2 -1
- package/lib/services/abstract-configuration.js.map +1 -1
- package/lib/services/abstract-organization-context-service.js.map +1 -1
- package/lib/utils/cdecodeUri.d.ts +21 -29
- package/lib/utils/cdecodeUri.js +97 -19
- package/lib/utils/cdecodeUri.js.map +1 -1
- package/lib/utils/generate-uri.d.ts +5 -3
- package/lib/utils/generate-uri.js +22 -2
- package/lib/utils/generate-uri.js.map +1 -1
- package/lib/utils/generate-uri.test.d.ts +1 -0
- package/lib/utils/generated-settings-id.js +2 -2
- package/lib/utils/generated-settings-id.js.map +1 -1
- package/lib/utils/getLogger.d.ts +1 -0
- package/lib/utils/getLogger.js +8 -0
- package/lib/utils/getLogger.js.map +1 -0
- package/lib/utils/index.d.ts +4 -1
- package/lib/utils/preferenceUri.d.ts +18 -0
- package/lib/utils/preferenceUri.js +107 -0
- package/lib/utils/preferenceUri.js.map +1 -0
- package/lib/utils/preferenceUri.test.d.ts +1 -0
- package/lib/utils/resourceUriConversion.js +68 -0
- package/lib/utils/resourceUriConversion.js.map +1 -0
- package/lib/utils/resourceUriConversion.test.d.ts +1 -0
- package/lib/utils/reviveUri.d.ts +2 -0
- package/lib/utils/{uri.js → reviveUri.js} +2 -4
- package/lib/utils/reviveUri.js.map +1 -0
- package/package.json +4 -4
- package/lib/utils/uri.js.map +0 -1
- /package/lib/utils/{uri.d.ts → resourceUriConversion.d.ts} +0 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import queryString from'query-string';import {parseCdecodeUri}from'./cdecodeUri.js';import {IConfigCollectionName}from'../interfaces/generated/generated-models.js';import'../interfaces/configuration/configuration.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';// moved to `@workbench-stack/core`
|
2
|
+
const resourcePath = resource => {
|
3
|
+
if (typeof resource === 'string') {
|
4
|
+
return resource;
|
5
|
+
}
|
6
|
+
const {
|
7
|
+
path
|
8
|
+
} = resource;
|
9
|
+
const query = resource.query ? `:${resource.query}` : '';
|
10
|
+
const fragment = resource.fragment ? `:${resource.fragment}` : '';
|
11
|
+
return `${path}${query}${fragment}`;
|
12
|
+
};
|
13
|
+
function convertToResourceUri(resource) {
|
14
|
+
if (!resource) return null;
|
15
|
+
const isValidUri = uri => 'scheme' in uri && 'path' in uri;
|
16
|
+
if (resource instanceof URI) {
|
17
|
+
if (isValidUri(resource)) {
|
18
|
+
if (resource.scheme === 'cdecode') {
|
19
|
+
// Use parseCdecodeUri for cdecode URIs
|
20
|
+
const parsedUri = parseCdecodeUri(resource);
|
21
|
+
// Determine the path based on available segments
|
22
|
+
let path = '';
|
23
|
+
// Construct the query string based on available segments
|
24
|
+
const queryData = {};
|
25
|
+
if (parsedUri.pathSegments.resourceType) {
|
26
|
+
path = `/${parsedUri.pathSegments.resourceType}`;
|
27
|
+
queryData.orgName = parsedUri.pathSegments.organization;
|
28
|
+
queryData.resourceId = parsedUri.pathSegments.resourceId;
|
29
|
+
queryData.resourceGroup = parsedUri.pathSegments.resourceGroup;
|
30
|
+
} else if (parsedUri.pathSegments.resourceGroup) {
|
31
|
+
path = `/${IConfigCollectionName.Projects}`;
|
32
|
+
queryData.orgName = parsedUri.pathSegments.organization;
|
33
|
+
queryData.resourceGroup = parsedUri.pathSegments.resourceGroup;
|
34
|
+
} else if (parsedUri.pathSegments.organization) {
|
35
|
+
path = `/${IConfigCollectionName.Organizations}`;
|
36
|
+
queryData.orgName = parsedUri.pathSegments.organization;
|
37
|
+
} else {
|
38
|
+
throw new Error('not a valid resource');
|
39
|
+
}
|
40
|
+
return URI.from({
|
41
|
+
scheme: parsedUri.scheme,
|
42
|
+
authority: parsedUri.authority,
|
43
|
+
path,
|
44
|
+
query: queryString.stringify(queryData),
|
45
|
+
fragment: parsedUri.fragmentData
|
46
|
+
});
|
47
|
+
}
|
48
|
+
return resource;
|
49
|
+
}
|
50
|
+
throw new Error('Invalid URI instance: Missing required properties');
|
51
|
+
}
|
52
|
+
if (typeof resource === 'string') {
|
53
|
+
const parsedUri = URI.parse(resource);
|
54
|
+
if (parsedUri.scheme === 'cdecode') {
|
55
|
+
return convertToResourceUri(parsedUri); // Reuse the logic for URI instances
|
56
|
+
}
|
57
|
+
return parsedUri;
|
58
|
+
}
|
59
|
+
if (typeof resource === 'object') {
|
60
|
+
console.log('---RESOUR_---', resource);
|
61
|
+
const revivedUri = URI.revive(resource);
|
62
|
+
if (revivedUri.scheme === 'cdecode') {
|
63
|
+
return convertToResourceUri(revivedUri); // Reuse the logic for URI instances
|
64
|
+
}
|
65
|
+
return revivedUri;
|
66
|
+
}
|
67
|
+
throw new Error('Unsupported resource type');
|
68
|
+
}export{convertToResourceUri,resourcePath};//# sourceMappingURL=resourceUriConversion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"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resource === 'string' ? resource : `${resource.path}:${resource.query}:${resource.fragment}`;
|
3
|
-
function convertToResourceUri(resource) {
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';function reviveUri(resource) {
|
4
2
|
if (resource instanceof URI) {
|
5
3
|
return resource;
|
6
4
|
} else if (typeof resource === 'string') {
|
@@ -9,4 +7,4 @@ function convertToResourceUri(resource) {
|
|
9
7
|
} else if (typeof resource === 'object') {
|
10
8
|
return URI.revive(resource);
|
11
9
|
}
|
12
|
-
}export{
|
10
|
+
}export{reviveUri};//# sourceMappingURL=reviveUri.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reviveUri.js","sources":["../../src/utils/reviveUri.ts"],"sourcesContent":[null],"names":[],"mappings":"sEAEM,SAAU,SAAS,CAAC,QAAsC,EAAA;AAC5D,EAAA,IAAA,QAAY,YAAA,GAAe,EAAA;AACvB,IAAA,OAAA;SACH,IAAA,OAAA,QAAA,KAAA,QAAA,EAAA;AAAM;WACgB,GAAA,CAAA,KAAA,CAAA,QAAA,CAAA;AACnB,GAAA,MAAA,IAAA,OAAW,QAAM,KAAQ,QAAE,EAAA;IAC/B,OAAC,GAAA,CAAA,MAAA,CAAA,QAAA,CAAA;AAAM;AACH"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@adminide-stack/core",
|
3
|
-
"version": "9.2.1-alpha.
|
3
|
+
"version": "9.2.1-alpha.33",
|
4
4
|
"description": "AdminIDE core for higher packages to depend on",
|
5
5
|
"license": "ISC",
|
6
6
|
"author": "CDMBase LLC",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"build:lib:watch": "npm run build:lib -- --watch",
|
16
16
|
"jest": "./node_modules/.bin/jest",
|
17
17
|
"prepublish": "npm run build",
|
18
|
-
"test": "
|
18
|
+
"test": "vitest",
|
19
19
|
"test:debug": "npm test -- --runInBand",
|
20
20
|
"test:watch": "npm test -- --watch",
|
21
21
|
"watch": "npm run build:lib:watch"
|
@@ -34,8 +34,8 @@
|
|
34
34
|
"publishConfig": {
|
35
35
|
"access": "public"
|
36
36
|
},
|
37
|
+
"gitHead": "6de0ec0442362d49adf1ff406f9b14f9d4f7480a",
|
37
38
|
"typescript": {
|
38
39
|
"definition": "lib/index.d.ts"
|
39
|
-
}
|
40
|
-
"gitHead": "42887edb082ec3f8f1bf448b51adb935973a9339"
|
40
|
+
}
|
41
41
|
}
|
package/lib/utils/uri.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"uri.js","sources":["../../src/utils/uri.ts"],"sourcesContent":[null],"names":[],"mappings":"sEACA;AACO,MAAM,YAAY,GAAG,QAA0C,IAAI,OAAQ,QAAA,KAAa,QAAA,GAAS,QAAU,GAAC,CAAC,EAAI,QAAA,CAAA,IAAa,CAAA,CAAA,EAAA,QAAY,CAAA,OAAM,EAAI,QAAA,CAAA,QAAS,CAAA;AAG9J,SAAU,oBAAoB,CAAC,QAAsC,EAAA;AACvE,EAAA,IAAA,QAAY,YAAA,GAAe,EAAA;AACvB,IAAA,OAAA;SACH,IAAA,OAAA,QAAA,KAAA,QAAA,EAAA;AAAM;WACgB,GAAA,CAAA,KAAA,CAAA,QAAA,CAAA;AACnB,GAAA,MAAA,IAAA,OAAW,QAAM,KAAQ,QAAE,EAAA;IAC/B,OAAC,GAAA,CAAA,MAAA,CAAA,QAAA,CAAA;AAAM;AACH"}
|
File without changes
|