@adminide-stack/core 9.2.1-alpha.9 → 10.0.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants/configuration.d.ts +1 -0
- package/lib/constants/configuration.js +2 -1
- package/lib/constants/configuration.js.map +1 -1
- package/lib/core/configurations/configuration.d.ts +14 -13
- package/lib/core/configurations/configuration.js +100 -100
- package/lib/core/configurations/configuration.js.map +1 -1
- package/lib/core/configurations/events/ConfigurationChangeEvent.d.ts +3 -3
- package/lib/core/configurations/events/ConfigurationChangeEvent.js +2 -2
- package/lib/core/configurations/events/ConfigurationChangeEvent.js.map +1 -1
- package/lib/core/configurations/helpers/configuration.d.ts +2 -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 +5 -4
- package/lib/core/configurations/models/ConfigurationModel.js +26 -19
- package/lib/core/configurations/models/ConfigurationModel.js.map +1 -1
- package/lib/core/organization/configuration.d.ts +2 -1
- 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 +2 -1
- package/lib/core/organization/helpers/organization-helpers.js +2 -2
- package/lib/core/organization/helpers/organization-helpers.js.map +1 -1
- package/lib/core/organization/organization.d.ts +15 -14
- package/lib/core/organization/organization.js +48 -44
- package/lib/core/organization/organization.js.map +1 -1
- package/lib/errors/auth-error.d.ts +2 -2
- package/lib/errors/auth-error.js +1 -1
- package/lib/errors/auth-error.js.map +1 -1
- package/lib/errors/index.d.ts +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/interfaces/apollo-context.d.ts +2 -1
- package/lib/interfaces/configuration/configuration-file-service.d.ts +1 -1
- package/lib/interfaces/configuration/configuration-server-service.d.ts +3 -3
- package/lib/interfaces/configuration/configuration.d.ts +8 -57
- package/lib/interfaces/configuration/configuration.js +1 -34
- package/lib/interfaces/configuration/configuration.js.map +1 -1
- package/lib/interfaces/configuration/configurationRegistry.d.ts +66 -46
- package/lib/interfaces/configuration/configuraton-service.d.ts +2 -2
- package/lib/interfaces/configuration/defaultSettingSnapshot.d.ts +9 -0
- package/lib/interfaces/configuration/event.d.ts +3 -3
- package/lib/interfaces/configuration/index.d.ts +1 -0
- package/lib/interfaces/contex-key-service.d.ts +2 -2
- package/lib/interfaces/environment/environment-service.d.ts +1 -1
- package/lib/interfaces/index.d.ts +0 -1
- package/lib/interfaces/organization/organization-context-service.d.ts +1 -1
- package/lib/interfaces/organization/organization-context.d.ts +1 -1
- package/lib/interfaces/organization/organization-context.js.map +1 -1
- package/lib/interfaces/organization/organizations-context.d.ts +1 -1
- package/lib/interfaces/organization-key-context.d.ts +1 -1
- package/lib/interfaces/permissions.d.ts +1 -2
- package/lib/interfaces/permissions.js.map +1 -1
- package/lib/interfaces/policy.d.ts +1 -1
- package/lib/interfaces/preferences-service.d.ts +8 -6
- package/lib/interfaces/reduxStore.d.ts +1 -1
- package/lib/interfaces/workbench-exports.d.ts +1 -1
- package/lib/schema/route-schema.graphql +31 -0
- package/lib/services/abstract-configuration.d.ts +12 -10
- package/lib/services/abstract-configuration.js +40 -39
- package/lib/services/abstract-configuration.js.map +1 -1
- package/lib/services/abstract-organization-context-service.d.ts +5 -4
- package/lib/services/abstract-organization-context-service.js +2 -2
- package/lib/services/abstract-organization-context-service.js.map +1 -1
- package/lib/utils/cdecodeUri.d.ts +9 -18
- package/lib/utils/cdecodeUri.js +71 -7
- package/lib/utils/cdecodeUri.js.map +1 -1
- package/lib/utils/configuration-utils.d.ts +11 -3
- package/lib/utils/configuration-utils.js +12 -2
- package/lib/utils/configuration-utils.js.map +1 -1
- package/lib/utils/flatten-utils.d.ts +1 -0
- package/lib/utils/flatten-utils.js +19 -1
- package/lib/utils/flatten-utils.js.map +1 -1
- package/lib/utils/generate-uri.d.ts +6 -4
- 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.d.ts +1 -1
- package/lib/utils/generated-settings-id.js +3 -3
- 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/getUserAlias.d.ts +2 -0
- package/lib/utils/getUserAlias.js +9 -0
- package/lib/utils/getUserAlias.js.map +1 -0
- package/lib/utils/index.d.ts +6 -1
- package/lib/utils/nodeContext.d.ts +8 -0
- package/lib/utils/nodeContext.js +18 -0
- package/lib/utils/nodeContext.js.map +1 -0
- 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 +67 -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/reviveUri.js +13 -0
- package/lib/utils/reviveUri.js.map +1 -0
- package/lib/utils/roles-utils.d.ts +1 -1
- package/lib/utils/roles-utils.js +1 -1
- package/lib/utils/roles-utils.js.map +1 -1
- package/package.json +5 -4
- package/lib/errors/auth-error-messages.d.ts +0 -25
- package/lib/errors/auth-error-messages.js +0 -27
- package/lib/errors/auth-error-messages.js.map +0 -1
- package/lib/interfaces/generated/generated-models.d.ts +0 -13308
- package/lib/interfaces/generated/generated-models.js +0 -18845
- package/lib/interfaces/generated/generated-models.js.map +0 -1
- package/lib/interfaces/generated/index.d.ts +0 -1
- package/lib/utils/uri.js +0 -24
- package/lib/utils/uri.js.map +0 -1
- /package/lib/utils/{uri.d.ts → resourceUriConversion.d.ts} +0 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {convertToResourceUri}from'./resourceUriConversion.js';import {IConfigurationContributionNames}from'common/lib/generated/generated-models.js';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
|
+
function getOpenSettings(target, resource, options) {
|
3
|
+
const editableSettingsResource = getEditableSettingsURI(resource, options);
|
4
|
+
const mergedOptions = {
|
5
|
+
...options,
|
6
|
+
authority: editableSettingsResource.authority,
|
7
|
+
query: editableSettingsResource.query,
|
8
|
+
// Use editableSettingsResource.fragment if none was explicitly set.
|
9
|
+
defaultFragment: options?.defaultFragment ?? editableSettingsResource.fragment,
|
10
|
+
// Use the provided extensionName, or derive it from the resource’s path
|
11
|
+
extensionName: options?.extensionName ?? parseExtensionFromDefaultSettingsUri(editableSettingsResource)
|
12
|
+
};
|
13
|
+
const defaultPreferencesResource = getDefaultSettingsURI(target, mergedOptions);
|
14
|
+
return {
|
15
|
+
editableSettingsInput: editableSettingsResource,
|
16
|
+
defaultPreferencesInput: defaultPreferencesResource
|
17
|
+
};
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Tries to parse the “extension name” from a URI path that might look like:
|
21
|
+
* /myExtension/settings.json
|
22
|
+
* /defaultsettings/resourceSettings.json
|
23
|
+
* /someFolder/myExtension/organizationSettings.json
|
24
|
+
*
|
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
|
+
*/
|
28
|
+
function parseExtensionFromDefaultSettingsUri(resource) {
|
29
|
+
const pathSegments = resource.path.split('/').filter(Boolean);
|
30
|
+
if (pathSegments.length === 0) {
|
31
|
+
return 'settings';
|
32
|
+
}
|
33
|
+
const lastSegment = pathSegments[pathSegments.length - 1].toLowerCase();
|
34
|
+
// 1) If the last segment is among the known settings files (ends with .json)
|
35
|
+
if (KNOWN_SETTINGS_FILES.has(lastSegment)) {
|
36
|
+
// We expect the extension name to be the second-to-last segment
|
37
|
+
// e.g. "/myExtension/settings.json" or "/some/folder/ext/organizationSettings.json"
|
38
|
+
if (pathSegments.length >= 2) {
|
39
|
+
return pathSegments[pathSegments.length - 2];
|
40
|
+
}
|
41
|
+
// If there's only one segment overall, fallback
|
42
|
+
return IConfigurationContributionNames.Settings;
|
43
|
+
}
|
44
|
+
// 2) If it still ends with .json but not a standard settings file, just remove ".json"
|
45
|
+
// and treat that as the extension name. (Optional logic)
|
46
|
+
if (lastSegment.endsWith('.json')) {
|
47
|
+
// e.g. "/myExtension/otherFile.json" → extension = "otherFile" (or 2nd to last segment?)
|
48
|
+
// This snippet assumes you want "otherFile" from the last segment. If you instead want
|
49
|
+
// the second-to-last segment as an “extensionName,” just adjust accordingly.
|
50
|
+
const trimmed = lastSegment.replace(/\.json$/, '');
|
51
|
+
return trimmed || IConfigurationContributionNames.Settings;
|
52
|
+
}
|
53
|
+
// 3) If no recognized .json file, just fallback
|
54
|
+
return IConfigurationContributionNames.Settings;
|
55
|
+
}
|
56
|
+
function getDefaultSettingsURI(target, options) {
|
57
|
+
const extension = options.extensionName || IConfigurationContributionNames.Settings;
|
58
|
+
switch (target) {
|
59
|
+
case 4 /* ConfigurationTarget.ORGANIZATION */:
|
60
|
+
return URI.from({
|
61
|
+
scheme: 'cdecode',
|
62
|
+
authority: options.authority,
|
63
|
+
path: `/${extension}/organizationSettings.json`,
|
64
|
+
query: options.query,
|
65
|
+
fragment: options.defaultFragment
|
66
|
+
});
|
67
|
+
case 5 /* ConfigurationTarget.ORGANIZATION_RESOURCE */:
|
68
|
+
return URI.from({
|
69
|
+
scheme: 'cdecode',
|
70
|
+
authority: options.authority,
|
71
|
+
path: `/${extension}/resourceSettings.json`,
|
72
|
+
query: options.query,
|
73
|
+
fragment: options.defaultFragment
|
74
|
+
});
|
75
|
+
default:
|
76
|
+
return URI.from({
|
77
|
+
scheme: 'cdecode',
|
78
|
+
authority: options.authority,
|
79
|
+
path: `/${extension}/settings.json`,
|
80
|
+
query: options.query,
|
81
|
+
fragment: options.defaultFragment
|
82
|
+
});
|
83
|
+
}
|
84
|
+
}
|
85
|
+
function getEditableSettingsURI(resource, options = {
|
86
|
+
forceExist: false
|
87
|
+
}) {
|
88
|
+
// Grab the existing or new fragment from options
|
89
|
+
let {
|
90
|
+
fragment
|
91
|
+
} = options;
|
92
|
+
if (options?.subFragment) {
|
93
|
+
// If there’s a subFragment, stitch it into the main fragment
|
94
|
+
fragment = fragment ? fragment.concat(`.${options.subFragment}`) : options.subFragment;
|
95
|
+
}
|
96
|
+
// Fall back to the resource’s existing fragment if neither fragment nor subFragment is provided
|
97
|
+
const finalFragment = fragment ?? resource.fragment;
|
98
|
+
// Create a new URI with the possibly updated fragment
|
99
|
+
const newResource = URI.from({
|
100
|
+
scheme: resource.scheme,
|
101
|
+
path: resource.path,
|
102
|
+
query: resource.query,
|
103
|
+
fragment: finalFragment
|
104
|
+
});
|
105
|
+
// Always convert to resource-based URI
|
106
|
+
return convertToResourceUri(newResource);
|
107
|
+
}export{getDefaultSettingsURI,getEditableSettingsURI,getOpenSettings,parseExtensionFromDefaultSettingsUri};//# sourceMappingURL=preferenceUri.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"preferenceUri.js","sources":["../../src/utils/preferenceUri.ts"],"sourcesContent":[null],"names":[],"mappings":"2NAQA,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAA,eAAA,EAAA,2BAAA,EAAA,uBAAA,EAAA,sBAAA,EAAA,0BAAA,EAAA,2BAAA,EAAA,uBAAA,EAAA,sBAAA,EAAA,0BAAA,CAAA,CAAA;AAClB,SAAA,eAAA,CAAA,MAAA,EAAA,QAAA,EAAA,OAAA,EAAA;QACY,wBAAA,GAAA,sBAAA,CAAA,QAAA,EAAA,OAAA,CAAA;QACJ,aAAA,GAAA;IACvB,GAAsB,OAAA;IACtB,SAA0B,EAAA,wBAAA,CAAA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Z,KAAM,CAAA;MACE,OAAA,GAAA,CAAA,IAAS,CAAA;AACb,QAAA,MAAA,EAAA,SAAA;iBACW,EAAA,OAAI,CAAI,SAAC;AACZ,QAAA,IAAA,EAAA,CAAA,CAAA,EAAA,SAAiB,CAAA,sBAAA,CAAA;sBACR,CAAA,KAAS;gBAClB,EAAI,OAAM,CAAA;;;AAGb,MAAA,OAAA,GAAE,CAAA,IAAA,CAAA;AACP,QAAA,MAAA,EAAA,SAAA;iBACW,EAAA,OAAI,CAAI,SAAC;AACZ,QAAA,IAAA,EAAA,CAAA,CAAA,EAAA,SAAiB,CAAA,cAAA,CAAA;sBACR,CAAA,KAAS;gBAClB,EAAI,OAAM,CAAA;;;AAGb;AACL,SAAA,sBAAA,CAAA,QAAA,EAAA,OAAA,GAAA;YACI,EAAO;AACH,CAAA,EAAA;;;;;AAKH,EAAA,IAAA,OAAA,EAAE,WAAA,EAAA;;AAEf,IAAC,QAAA,GAAA,QAAA,GAAA,QAAA,CAAA,MAAA,CAAA,CAAA,CAAA,EAAA,OAAA,CAAA,WAAA,CAAA,CAAA,CAAA,GAAA,OAAA,CAAA,WAAA;AAED;;AAKI,EAAA,MAAI,aAAY,WAAW,IAAA,QAAA,CAAA,QAAA;AAC3B;QACI,WAA6D,GAAA,GAAA,CAAA,IAAA,CAAA;UACrD,EAAA,eAAW;IACvB,IAAC,EAAA,QAAA,CAAA,IAAA;IAED,KAAgG,EAAA,QAAA,CAAA,KAAA;AAChG,IAAA;IAEA;AACA;SACU,oBAAiB,CAAA,WAAA,CAAA;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import queryString from'query-string';import {IConfigCollectionName}from'common/lib/generated/generated-models.js';import {parseCdecodeUri}from'./cdecodeUri.js';import {reviveUri}from'./reviveUri.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
|
+
const revivedUri = reviveUri(resource);
|
61
|
+
if (revivedUri.scheme === 'cdecode') {
|
62
|
+
return convertToResourceUri(revivedUri); // Reuse the logic for URI instances
|
63
|
+
}
|
64
|
+
return revivedUri;
|
65
|
+
}
|
66
|
+
throw new Error('Unsupported resource type');
|
67
|
+
}export{convertToResourceUri,resourcePath};//# sourceMappingURL=resourceUriConversion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"resourceUriConversion.js","sources":["../../src/utils/resourceUriConversion.ts"],"sourcesContent":[null],"names":[],"mappings":"8QAMA;AACa,MAAA,YAAY,GAAG,QAAC,IAA4C;AACrE,EAAA,IAAA,OAAW,QAAA,KAAa,QAAA,EAAQ;AAC5B,IAAA,OAAA;;AAEJ,EAAA,MAAA;AACA,IAAA;AACA,GAAA,GAAA;AACA,EAAA,MAAA,QAAc,cAAW,GAAA,CAAA,CAAA,EAAQ,QAAG,CAAA,KAAA,CAAA,CAAA,GAAA,EAAA;AACxC,EAAE,MAAA,QAAA,GAAA,QAAA,CAAA,QAAA,GAAA,CAAA,CAAA,EAAA,QAAA,CAAA,QAAA,CAAA,CAAA,GAAA,EAAA;AAEF,EAAM,OAAA,CAAA,EAAA,IAAU,CAAoB,EAAA,KAAA,CAAA,EAAA,QAAA,CAAA,CAAC;AACjC;AAAe,6BAAY,CAAA,QAAA,EAAA;AAC3B,EAAA,IAAA,CAAA,QAAgB,EAAA,OAAI;AAEpB,EAAA,MAAI,UAAQ,GAAA,GAAA,IAAY,QAAM,IAAA,G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AA;AACD,IAAA,IAAI,SAAO,CAAA,MAAa,KAAA,SAAU,EAAC;aACzB,8BAAsB,CAAQ,CAAC;AACrC;AACI,IAAA,OAAA;;AAEJ,EAAA,IAAA,OAAA,aAAiB,QAAA,EAAA;IACrB,MAAC,UAAA,GAAA,SAAA,CAAA,QAAA,CAAA;AACD,IAAA,IAAI,UAAO,CAAA,MAAa,KAAA,SAAW,EAAA;AAC/B,MAAA,OAAA,oBAAmB,CAAA,UAAU,CAAQ,CAAC;AACtC;AACI,IAAA,OAAA;;AAEJ,EAAA,MAAA,IAAA,iCAAkB,CAAA;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
import 'reflect-metadata';
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';function reviveUri(resource) {
|
2
|
+
if (resource instanceof URI) {
|
3
|
+
return resource;
|
4
|
+
} else if (typeof resource === 'string') {
|
5
|
+
// default resource
|
6
|
+
return URI.parse(resource);
|
7
|
+
} else if (typeof resource === 'object') {
|
8
|
+
// Spread into a new object in case original is immutable:
|
9
|
+
return URI.revive({
|
10
|
+
...resource
|
11
|
+
});
|
12
|
+
}
|
13
|
+
}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;;AACxB,IAAA,OAAA,GAAW,CAAA,MAAA,CAAA;SAC4C;;;AAGlE"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
|
2
|
-
import { ConfigurationTarget } from '
|
2
|
+
import { ConfigurationTarget } from 'common/lib//generated/generated-models';
|
3
3
|
export declare function generateApplicationRoleResource(roleName: string): URI;
|
4
4
|
export declare function generateRegisteredRoleURI(roleName: string, target?: ConfigurationTarget): URI;
|
package/lib/utils/roles-utils.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {Schemas}from'@workbench-stack/core/lib/core/network.js';import {camelCase}from'lodash-es';import {IResourceAuthority}from'
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {Schemas}from'@workbench-stack/core/lib/core/network.js';import {camelCase}from'lodash-es';import {IResourceAuthority}from'common/lib//generated/generated-models.js';function generateApplicationRoleResource(roleName) {
|
2
2
|
return URI.from({
|
3
3
|
scheme: Schemas.cdecode,
|
4
4
|
authority: 'applicationrole',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"roles-utils.js","sources":["../../src/utils/roles-utils.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"roles-utils.js","sources":["../../src/utils/roles-utils.ts"],"sourcesContent":[null],"names":[],"mappings":"mPAKM,SAAU,+BAA+B,CAAC,QAAgB,EAAA;SACrD,GAAA,CAAA,IAAI,CAAA;AACf,IAAC,MAAA,EAAA,OAAA,CAAA,OAAA;AAED,IAAA,SAAgB,EAAA,iBAAA;AAIZ,IAAA,IAAI,eAAkB,CAAA,QAAA,CAAA,CAAA,KAAA;IAEtB;AACI;AACI,SAAA,yBAAY,CAAkB,QAAC,EAAA,MAAe,GAAC,CAAA,wCAAA;eACzC;AACV,EAAA,QAAA,MAAA;AACI,IAAA,KAAA,CAAA;eACM,GAAA,kBAAA,CAAA,eAAA;AACV,MAAA;AACI,IAAA,KAAA,CAAA;eACM,GAAA,kBAAA,CAAA,gBAAA;AACV,MAAA;AACI,IAAA,KAAA,CAAA;eACM,GAAA,kBAAA,CAAA,YAAA;AACV,MAAA;AACI,IAAA,KAAA,CAAA;MACP,SAAA,GAAA,kBAAA,CAAA,QAAA;MAEM;;YAEM,IAAA,KAAoB,CAAA,CAAA,gBAAmB,EAAA,MAAA,CAAA,CAAA,CAAA;AAChD;AACH,EAAA,OAAE,GAAA,CAAA,IAAA,CAAA;AACP,IAAC,MAAA,EAAA,OAAA,CAAA,OAAA;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@adminide-stack/core",
|
3
|
-
"version": "
|
3
|
+
"version": "10.0.1-alpha.2",
|
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"
|
@@ -23,6 +23,7 @@
|
|
23
23
|
"dependencies": {
|
24
24
|
"@vscode-alt/monaco-editor": "^0.21.4",
|
25
25
|
"@workbench-stack/core": "3.9.5",
|
26
|
+
"common": "10.0.1-alpha.2",
|
26
27
|
"query-string": "^9.0.0",
|
27
28
|
"sort-keys": "^5.0.0",
|
28
29
|
"vscode-uri": "^3.0.8"
|
@@ -34,8 +35,8 @@
|
|
34
35
|
"publishConfig": {
|
35
36
|
"access": "public"
|
36
37
|
},
|
37
|
-
"gitHead": "7992cccf564284f1bddaac54787137493e4d7755",
|
38
38
|
"typescript": {
|
39
39
|
"definition": "lib/index.d.ts"
|
40
|
-
}
|
40
|
+
},
|
41
|
+
"gitHead": "48fa8208e5d098ed971a78a30ab4bbf9bc2a4ed9"
|
41
42
|
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
export declare enum AuthErrors {
|
2
|
-
TokenExpired = "TokenExpired",
|
3
|
-
ContextFailedDueToTokenExpired = "Context creation failed: TokenExpired",
|
4
|
-
InvalidToken = "InvalidToken",
|
5
|
-
AccessDenied = "AccessDeined",
|
6
|
-
CaptchaError = "CaptchaError",
|
7
|
-
CSRFValidationFailed = "CSRFValidationFailed",
|
8
|
-
TokenMissing = "TokenMissing",
|
9
|
-
ScopeExpected = "ScopeExpected",
|
10
|
-
UserExpected = "UserExpected",
|
11
|
-
UserLoginNeeded = "UserLoginNeeded",
|
12
|
-
NotAuthorized = "Not Authorised!"
|
13
|
-
}
|
14
|
-
export declare const AuthErrorsMessage: {
|
15
|
-
TokenExpired: string;
|
16
|
-
InvalidToken: string;
|
17
|
-
AccessDenied: string;
|
18
|
-
CaptchaError: string;
|
19
|
-
CSRFValidationFailed: string;
|
20
|
-
TokenMissing: string;
|
21
|
-
ScopeExpected: string;
|
22
|
-
UserExpected: string;
|
23
|
-
UserLoginNeeded: string;
|
24
|
-
NotAuthorized: string;
|
25
|
-
};
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var AuthErrors;
|
2
|
-
(function (AuthErrors) {
|
3
|
-
AuthErrors["TokenExpired"] = "TokenExpired";
|
4
|
-
// Graphql Request wraps the error in somecases
|
5
|
-
AuthErrors["ContextFailedDueToTokenExpired"] = "Context creation failed: TokenExpired";
|
6
|
-
AuthErrors["InvalidToken"] = "InvalidToken";
|
7
|
-
AuthErrors["AccessDenied"] = "AccessDeined";
|
8
|
-
AuthErrors["CaptchaError"] = "CaptchaError";
|
9
|
-
AuthErrors["CSRFValidationFailed"] = "CSRFValidationFailed";
|
10
|
-
AuthErrors["TokenMissing"] = "TokenMissing";
|
11
|
-
AuthErrors["ScopeExpected"] = "ScopeExpected";
|
12
|
-
AuthErrors["UserExpected"] = "UserExpected";
|
13
|
-
AuthErrors["UserLoginNeeded"] = "UserLoginNeeded";
|
14
|
-
AuthErrors["NotAuthorized"] = "Not Authorised!";
|
15
|
-
})(AuthErrors || (AuthErrors = {}));
|
16
|
-
const AuthErrorsMessage = {
|
17
|
-
TokenExpired: 'Your token is expired, please re login',
|
18
|
-
InvalidToken: 'Security error - invalid token',
|
19
|
-
AccessDenied: "You don't have permission to access it.",
|
20
|
-
CaptchaError: 'Please re-enter captcha',
|
21
|
-
CSRFValidationFailed: 'CSRF token validation failed',
|
22
|
-
TokenMissing: 'You must supply a JWT for authorization!',
|
23
|
-
ScopeExpected: 'No scopes supplied!',
|
24
|
-
UserExpected: 'You must supply a User!',
|
25
|
-
UserLoginNeeded: 'Try logout and login',
|
26
|
-
NotAuthorized: 'You are not authorised to perform this request. Contact administrator'
|
27
|
-
};export{AuthErrors,AuthErrorsMessage};//# sourceMappingURL=auth-error-messages.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"auth-error-messages.js","sources":["../../src/errors/auth-error-messages.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,UAAU,EAAA;AAClB,EAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAAA;;AAEA,EAAA,UAAA,CAAA,gCAAA,CAAA,GAAA,uCAAA;AACA,EAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAAA;AACA,EAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAAA;AACA,EAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAAA;AACA,EAAA,UAAA,CAAA,sBAAA,CAAA,GAAA,sBAAA;AACA,EAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAAA;AACA,EAAA,UAAA,CAAA,eAAA,CAAA,GAAA,eAAA;AACA,EAAA,UAAA,CAAA,cAAA,CAAA,GAAA,cAAA;AACA,EAAA,UAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;AACA,EAAA,UAAA,CAAA,eAAA,CAAA,GAAA,iBAAA;AACJ,CAAC,EAbW,UAAU,KAAV,UAAU,GAarB,EAAA,CAAA,CAAA;AAGY,MAAA,iBAAiB,GAAG;AAC7B,EAAA,YAAA,EAAY,wCAA0C;AACtD,EAAA,YAAA,EAAY,gCAAkC;AAC9C,EAAA,YAAA,EAAY,yCAA2C;AACvD,EAAA,YAAA,EAAY,yBAA2B;AACvC,EAAA,oBAAA,EAAoB,8BAAgC;AACpD,EAAA,YAAA,EAAY,0CAA4C;AACxD,EAAA,aAAA,EAAa,qBAAuB;AACpC,EAAA,YAAA,EAAY,yBAA2B;AACvC,EAAA,eAAA,EAAe,sBAAwB;AACvC,EAAA,aAAA,EAAa;"}
|