@adminide-stack/core 12.0.3-alpha.76 → 12.0.3-alpha.84
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.
@@ -11,54 +11,47 @@ import { URI, UriComponents } from '@vscode-alt/monaco-editor/esm/vs/base/common
|
|
11
11
|
* in their query string, generated from the resource type, ID, and context.
|
12
12
|
*/
|
13
13
|
export declare const resourcePath: (resource: (URI | UriComponents) | string) => string;
|
14
|
-
export declare function convertToResourceUri(resource: URI | string | UriComponents, params?: ResourceUriParams): URI;
|
15
14
|
export type ResourceUriParams = {
|
16
15
|
resourceType: string;
|
17
16
|
resourceId: string;
|
18
17
|
};
|
18
|
+
/**
|
19
|
+
* Generate a consistent hash ID for a resource
|
20
|
+
* @param resourceType Collection name
|
21
|
+
* @param resourceId Resource ID
|
22
|
+
* @param fragment Optional fragment/projection
|
23
|
+
* @param context Optional context parameters
|
24
|
+
* @returns Hash ID string
|
25
|
+
*/
|
26
|
+
export declare function generateHashId(resourceType: string, resourceId: string, context?: Record<string, string>, fragment?: string): string;
|
27
|
+
/**
|
28
|
+
* Strict version of convertToResourceUri that enforces ID-only references
|
29
|
+
* and generates hash IDs
|
30
|
+
*
|
31
|
+
* If params are not provided, they will be extracted from the URI if possible
|
32
|
+
*/
|
33
|
+
export declare function strictConvertToResourceUri(resource: URI | string | UriComponents, params?: ResourceUriParams): URI;
|
34
|
+
export declare function convertToResourceUri(resource: URI | string | UriComponents, params?: ResourceUriParams): URI;
|
19
35
|
/**
|
20
36
|
* Configure URI generation for current branch (uses orgName)
|
21
37
|
* @deprecated No longer needed with hash ID approach
|
22
38
|
*/
|
23
|
-
export declare function configureForCurrentBranch(
|
24
|
-
includePathSegments?: boolean;
|
25
|
-
}): void;
|
39
|
+
export declare function configureForCurrentBranch(): void;
|
26
40
|
/**
|
27
41
|
* Configure URI generation for upcoming branch (uses organization ID)
|
28
42
|
* @deprecated No longer needed with hash ID approach
|
29
43
|
*/
|
30
|
-
export declare function configureForUpcomingBranch(
|
31
|
-
includePathSegments?: boolean;
|
32
|
-
}): void;
|
44
|
+
export declare function configureForUpcomingBranch(): void;
|
33
45
|
/**
|
34
46
|
* Set up resource URI configuration at application startup
|
35
47
|
* @deprecated No longer needed with hash ID approach
|
36
48
|
*/
|
37
|
-
export declare function setupResourceUriConfiguration(
|
38
|
-
includePathSegments?: boolean;
|
39
|
-
defaultTenantId?: string;
|
40
|
-
}): void;
|
49
|
+
export declare function setupResourceUriConfiguration(): void;
|
41
50
|
/**
|
42
51
|
* Normalize a resource URI to ensure parameter consistency
|
43
52
|
* @deprecated No longer needed with hash ID approach
|
44
53
|
*/
|
45
|
-
export declare function normalizeResourceUri(uri: URI
|
46
|
-
/**
|
47
|
-
* Generate a consistent hash ID for a resource
|
48
|
-
* @param resourceType Collection name
|
49
|
-
* @param resourceId Resource ID
|
50
|
-
* @param context Optional context parameters
|
51
|
-
* @param fragment Optional fragment/projection
|
52
|
-
* @returns Hash ID string
|
53
|
-
*/
|
54
|
-
export declare function generateHashId(resourceType: string, resourceId: string, context?: Record<string, string>, fragment?: string): string;
|
55
|
-
/**
|
56
|
-
* Strict version of convertToResourceUri that enforces ID-only references
|
57
|
-
* and generates hash IDs
|
58
|
-
*
|
59
|
-
* If params are not provided, they will be extracted from the URI if possible
|
60
|
-
*/
|
61
|
-
export declare function strictConvertToResourceUri(resource: URI | string | UriComponents, params?: ResourceUriParams): URI;
|
54
|
+
export declare function normalizeResourceUri(uri: URI): URI;
|
62
55
|
/**
|
63
56
|
* Creates a standardized resource URI that strictly follows the global configuration
|
64
57
|
* This ensures all URIs use consistent parameter names across the application
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {Scheme}from'common';import {parseCdecodeUri}from'./cdecodeUri.js';import {reviveUri}from'./reviveUri.js'
|
1
|
+
import {URI}from'@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';import {Scheme}from'common';import {sha256}from'js-sha256';import {parseCdecodeUri}from'./cdecodeUri.js';import {reviveUri}from'./reviveUri.js';/* eslint-disable default-param-last */
|
2
|
+
/**
|
2
3
|
* Resource URI Conversion Utilities
|
3
4
|
*
|
4
5
|
* This module handles URI conversion between different formats:
|
@@ -34,48 +35,12 @@ function createConsistentQueryString(resourceId, hashId) {
|
|
34
35
|
const sortedParams = [`_hashId=${encodeURIComponent(hashId)}`, `_id=${encodeURIComponent(resourceId)}`].sort().join('&');
|
35
36
|
return sortedParams;
|
36
37
|
}
|
37
|
-
function convertToResourceUri(resource, params) {
|
38
|
-
// Simply delegate to the strict version for consistent behavior
|
39
|
-
return strictConvertToResourceUri(resource, params);
|
40
|
-
}
|
41
|
-
/**
|
42
|
-
* Configure URI generation for current branch (uses orgName)
|
43
|
-
* @deprecated No longer needed with hash ID approach
|
44
|
-
*/
|
45
|
-
function configureForCurrentBranch(options) {
|
46
|
-
// This is now a no-op but kept for backward compatibility
|
47
|
-
console.warn('configureForCurrentBranch is deprecated and has no effect with hash ID approach');
|
48
|
-
}
|
49
|
-
/**
|
50
|
-
* Configure URI generation for upcoming branch (uses organization ID)
|
51
|
-
* @deprecated No longer needed with hash ID approach
|
52
|
-
*/
|
53
|
-
function configureForUpcomingBranch(options) {
|
54
|
-
// This is now a no-op but kept for backward compatibility
|
55
|
-
console.warn('configureForUpcomingBranch is deprecated and has no effect with hash ID approach');
|
56
|
-
}
|
57
|
-
/**
|
58
|
-
* Set up resource URI configuration at application startup
|
59
|
-
* @deprecated No longer needed with hash ID approach
|
60
|
-
*/
|
61
|
-
function setupResourceUriConfiguration(isUpcomingBranch = false, options) {
|
62
|
-
// This is now a no-op but kept for backward compatibility
|
63
|
-
console.warn('setupResourceUriConfiguration is deprecated and has no effect with hash ID approach');
|
64
|
-
}
|
65
|
-
/**
|
66
|
-
* Normalize a resource URI to ensure parameter consistency
|
67
|
-
* @deprecated No longer needed with hash ID approach
|
68
|
-
*/
|
69
|
-
function normalizeResourceUri(uri, forcedOrgParam) {
|
70
|
-
// Just return the URI as is - with hash ID approach, there's no need for normalization
|
71
|
-
return uri;
|
72
|
-
}
|
73
38
|
/**
|
74
39
|
* Generate a consistent hash ID for a resource
|
75
40
|
* @param resourceType Collection name
|
76
41
|
* @param resourceId Resource ID
|
77
|
-
* @param context Optional context parameters
|
78
42
|
* @param fragment Optional fragment/projection
|
43
|
+
* @param context Optional context parameters
|
79
44
|
* @returns Hash ID string
|
80
45
|
*/
|
81
46
|
function generateHashId(resourceType, resourceId, context = {}, fragment) {
|
@@ -89,8 +54,8 @@ function generateHashId(resourceType, resourceId, context = {}, fragment) {
|
|
89
54
|
if (fragment) {
|
90
55
|
canonicalString += `|proj:${fragment}`;
|
91
56
|
}
|
92
|
-
//
|
93
|
-
const hash =
|
57
|
+
// Use js-sha256 for proper SHA-256 hashing
|
58
|
+
const hash = sha256(canonicalString);
|
94
59
|
return hash.substring(0, 12);
|
95
60
|
}
|
96
61
|
/**
|
@@ -161,6 +126,42 @@ function strictConvertToResourceUri(resource, params) {
|
|
161
126
|
}
|
162
127
|
throw new Error('Unsupported resource type');
|
163
128
|
}
|
129
|
+
function convertToResourceUri(resource, params) {
|
130
|
+
// Simply delegate to the strict version for consistent behavior
|
131
|
+
return strictConvertToResourceUri(resource, params);
|
132
|
+
}
|
133
|
+
/**
|
134
|
+
* Configure URI generation for current branch (uses orgName)
|
135
|
+
* @deprecated No longer needed with hash ID approach
|
136
|
+
*/
|
137
|
+
function configureForCurrentBranch() {
|
138
|
+
// This is now a no-op but kept for backward compatibility
|
139
|
+
console.warn('configureForCurrentBranch is deprecated and has no effect with hash ID approach');
|
140
|
+
}
|
141
|
+
/**
|
142
|
+
* Configure URI generation for upcoming branch (uses organization ID)
|
143
|
+
* @deprecated No longer needed with hash ID approach
|
144
|
+
*/
|
145
|
+
function configureForUpcomingBranch() {
|
146
|
+
// This is now a no-op but kept for backward compatibility
|
147
|
+
console.warn('configureForUpcomingBranch is deprecated and has no effect with hash ID approach');
|
148
|
+
}
|
149
|
+
/**
|
150
|
+
* Set up resource URI configuration at application startup
|
151
|
+
* @deprecated No longer needed with hash ID approach
|
152
|
+
*/
|
153
|
+
function setupResourceUriConfiguration() {
|
154
|
+
// This is now a no-op but kept for backward compatibility
|
155
|
+
console.warn('setupResourceUriConfiguration is deprecated and has no effect with hash ID approach');
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Normalize a resource URI to ensure parameter consistency
|
159
|
+
* @deprecated No longer needed with hash ID approach
|
160
|
+
*/
|
161
|
+
function normalizeResourceUri(uri) {
|
162
|
+
// Just return the URI as is - with hash ID approach, there's no need for normalization
|
163
|
+
return uri;
|
164
|
+
}
|
164
165
|
/**
|
165
166
|
* Creates a standardized resource URI that strictly follows the global configuration
|
166
167
|
* This ensures all URIs use consistent parameter names across the application
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resourceUriConversion.js","sources":["../../src/utils/resourceUriConversion.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"resourceUriConversion.js","sources":["../../src/utils/resourceUriConversion.ts"],"sourcesContent":[null],"names":[],"mappings":"sNAAA;AAOA;;;;;;;;;;AAUG;AAEU,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,EAAA,OAAA,CAAA,EAAA,IAAA,CAAA,EAAA,KAAA,CAAA,EAAA,QAAA,CAAA,CAAA;;;;;;;AAOG;AACH;;SAEuF,2BAAA,CAAA,UAAA,EAAA,M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KAAA;;;AAGG;AACH;;AAYI;;SAEY,uBAAmB,CAAA,YAAA,EAAA,UAAA,EAAA,cAAA,EAAA,OAAA,EAAA;;AAE9B,EAAA,OAAE,yBAAA,CAAA,YAAA,EAAA,UAAA,EAAA,cAAA,EAAA;AACP,IAAC,QAAA,EAAA,OAAA,EAAA,QAAA;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@adminide-stack/core",
|
3
|
-
"version": "12.0.3-alpha.
|
3
|
+
"version": "12.0.3-alpha.84",
|
4
4
|
"description": "AdminIDE core for higher packages to depend on",
|
5
5
|
"license": "UNLICENSED",
|
6
6
|
"author": "CDMBase LLC",
|
@@ -23,12 +23,13 @@
|
|
23
23
|
"dependencies": {
|
24
24
|
"@vscode-alt/monaco-editor": "^0.21.4",
|
25
25
|
"@workbench-stack/core": "3.9.7",
|
26
|
+
"js-sha256": "^0.11.1",
|
26
27
|
"query-string": "^9.0.0",
|
27
28
|
"sort-keys": "^5.0.0",
|
28
29
|
"vscode-uri": "^3.0.8"
|
29
30
|
},
|
30
31
|
"devDependencies": {
|
31
|
-
"common": "12.0.3-alpha.
|
32
|
+
"common": "12.0.3-alpha.84"
|
32
33
|
},
|
33
34
|
"peerDependencies": {
|
34
35
|
"@common-stack/server-core": ">=0.5.21",
|
@@ -37,7 +38,7 @@
|
|
37
38
|
"publishConfig": {
|
38
39
|
"access": "public"
|
39
40
|
},
|
40
|
-
"gitHead": "
|
41
|
+
"gitHead": "5904be14065611f61f6e32462068009e58d252f6",
|
41
42
|
"typescript": {
|
42
43
|
"definition": "lib/index.d.ts"
|
43
44
|
}
|