@adminide-stack/core 9.2.1-alpha.45 → 9.2.1-alpha.48

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.
Files changed (29) hide show
  1. package/lib/constants/configuration.d.ts +1 -0
  2. package/lib/constants/configuration.js +2 -1
  3. package/lib/constants/configuration.js.map +1 -1
  4. package/lib/core/configurations/models/ConfigurationModel.d.ts +1 -0
  5. package/lib/core/configurations/models/ConfigurationModel.js +7 -0
  6. package/lib/core/configurations/models/ConfigurationModel.js.map +1 -1
  7. package/lib/index.js +1 -1
  8. package/lib/interfaces/apollo-context.d.ts +2 -1
  9. package/lib/interfaces/configuration/configuration-server-service.d.ts +2 -2
  10. package/lib/interfaces/configuration/configuration.d.ts +8 -25
  11. package/lib/interfaces/configuration/configuration.js.map +1 -1
  12. package/lib/interfaces/configuration/configurationRegistry.d.ts +57 -37
  13. package/lib/interfaces/configuration/defaultSettingSnapshot.d.ts +9 -0
  14. package/lib/interfaces/configuration/index.d.ts +1 -0
  15. package/lib/interfaces/generated/generated-models.d.ts +318 -30
  16. package/lib/interfaces/generated/generated-models.js +34 -15
  17. package/lib/interfaces/generated/generated-models.js.map +1 -1
  18. package/lib/interfaces/preferences-service.d.ts +6 -6
  19. package/lib/utils/cdecodeUri.d.ts +1 -1
  20. package/lib/utils/cdecodeUri.js +1 -15
  21. package/lib/utils/cdecodeUri.js.map +1 -1
  22. package/lib/utils/configuration-utils.d.ts +11 -3
  23. package/lib/utils/configuration-utils.js +12 -2
  24. package/lib/utils/configuration-utils.js.map +1 -1
  25. package/lib/utils/index.d.ts +1 -0
  26. package/lib/utils/nodeContext.d.ts +7 -0
  27. package/lib/utils/nodeContext.js +18 -0
  28. package/lib/utils/nodeContext.js.map +1 -0
  29. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri';
2
- import { ISettingsSubject, IViewerSettingsInput, IPreferenceRoleInput, IPermissionSubject, IViewerSettingsSubject, IPolicySubject, IViewerPoliciesInput, IConfigurationOverrides, ICdecodeUriInput, IPageResourceSetting } from './generated';
2
+ import { ISettingsSubject, IViewerSettingsInput, IPreferenceRoleInput, IPermissionSubject, IViewerSettingsSubject, IPolicySubject, IViewerPoliciesInput, IConfigurationOverrides, ICdecodeUriInput, IPageResourceSetting, IConfigurationNodeContextInput } from './generated';
3
3
  import { ConfigurationTarget, IPreferencesInput, IPreferencesOpenOptionsInput as IPreferencesOpenOptions, IContributionSettings } from './generated';
4
4
  export type IPrefFragment = {
5
5
  fragmentName?: string;
@@ -7,16 +7,16 @@ export type IPrefFragment = {
7
7
  };
8
8
  export interface IPreferencesService {
9
9
  initiateSettingsFile(resource: URI): Promise<any>;
10
- defaultViewerSettingsSubject(target: ConfigurationTarget, options: IPreferencesOpenOptions): ISettingsSubject;
10
+ defaultViewerSettingsSubject(target: ConfigurationTarget, options: IPreferencesOpenOptions, context: IConfigurationNodeContextInput): Promise<ISettingsSubject>;
11
11
  /**
12
12
  * Viewer Settings for an Organization and its resources.
13
13
  * @param params
14
14
  * @param context
15
15
  */
16
- viewerSettings<T = IViewerSettingsSubject>(input: IViewerSettingsInput, fragment?: IPrefFragment): Promise<T>;
17
- viewerSettings2<T = IPageResourceSetting>(input: ICdecodeUriInput): Promise<T>;
18
- viewerPolicies<T = IPolicySubject>(input: IViewerPoliciesInput, fragment?: IPrefFragment): Promise<T>;
19
- viewerPermissions<T = IPermissionSubject>(input: IPreferenceRoleInput, fragment?: IPrefFragment): Promise<T>;
16
+ viewerSettings<T = IViewerSettingsSubject>(input: IViewerSettingsInput, context: IConfigurationNodeContextInput): Promise<T>;
17
+ viewerSettings2<T = IPageResourceSetting>(input: ICdecodeUriInput, context: IConfigurationNodeContextInput): Promise<T>;
18
+ viewerPolicies<T = IPolicySubject>(input: IViewerPoliciesInput, context: IConfigurationNodeContextInput): Promise<T>;
19
+ viewerPermissions<T = IPermissionSubject>(input: IPreferenceRoleInput, context: IConfigurationNodeContextInput): Promise<T>;
20
20
  writeSettings(cdecodeUri: URI, settings: Record<string, any>, arg3: IConfigurationOverrides, arg4: ConfigurationTarget, donotNotifyError?: boolean): any;
21
21
  }
22
22
  export interface IPreferenceClientService {
@@ -6,7 +6,7 @@ export declare const generateCdecodeUri: (authority: string | IAuthorityComponen
6
6
  }, fragment?: string) => URI;
7
7
  /**
8
8
  * valid
9
- * `cdecode://us-west-2/rranrn/${IConfigCollectionName.Teams}/JohnDoe`
9
+ * `cdecode://<tenantId>.us-west-2.clockbook.com/rranrn/${IConfigCollectionName.Teams}/JohnDoe`
10
10
  * `cdecode://us-west-2/rranrn/${IConfigCollectionName.Teams}/JohnDoe?param1=1&param2=2`
11
11
  * `cdecode://us-west-2/rranrn?param1=1`
12
12
  * `cdecode://us-west-2/`
@@ -1,17 +1,5 @@
1
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 sortKeys from'sort-keys';import queryString from'query-string';import {IConfigCollectionName}from'../interfaces/generated/generated-models.js';/* eslint-disable prefer-destructuring */
2
2
  /* eslint-disable default-param-last */
3
- /**
4
- * Extracts tenantId from the authority string.
5
- * Adjust this function based on how tenantId is represented in the authority.
6
- * For example, if authority is 'myApp.us-west-2.cdecode.com', tenantId could be 'myApp'.
7
- * @param authority - The authority part of the URI.
8
- * @returns The extracted tenantId.
9
- */
10
- function extractTenantId(authority) {
11
- // Example extraction logic: assuming tenantId is the first subdomain
12
- const parts = authority.split('.');
13
- return parts[0]; // 'myApp' from 'myApp.us-west-2.cdecode.com'
14
- }
15
3
  const generateCdecodeUri = (authority, params, query = {}, fragment) => {
16
4
  let authorityString;
17
5
  // Determine if authority is a string or an object
@@ -65,7 +53,7 @@ const generateCdecodeUri = (authority, params, query = {}, fragment) => {
65
53
  };
66
54
  /**
67
55
  * valid
68
- * `cdecode://us-west-2/rranrn/${IConfigCollectionName.Teams}/JohnDoe`
56
+ * `cdecode://<tenantId>.us-west-2.clockbook.com/rranrn/${IConfigCollectionName.Teams}/JohnDoe`
69
57
  * `cdecode://us-west-2/rranrn/${IConfigCollectionName.Teams}/JohnDoe?param1=1&param2=2`
70
58
  * `cdecode://us-west-2/rranrn?param1=1`
71
59
  * `cdecode://us-west-2/`
@@ -92,7 +80,6 @@ function parseCdecodeUri(uriString) {
92
80
  // Handle the case with no path segments (e.g., `cdecode://us-west-2/`)
93
81
  return {
94
82
  scheme: uri.scheme,
95
- tenantId: extractTenantId(uri.authority),
96
83
  authority: uri.authority,
97
84
  pathSegments,
98
85
  queryData: queryString.parse(uri.query),
@@ -145,7 +132,6 @@ function parseCdecodeUri(uriString) {
145
132
  return {
146
133
  scheme: uri.scheme,
147
134
  authority: uri.authority,
148
- tenantId: extractTenantId(uri.authority),
149
135
  pathSegments,
150
136
  queryData,
151
137
  fragmentData
@@ -1 +1 @@
1
- {"version":3,"file":"cdecodeUri.js","sources":["../../src/utils/cdecodeUri.ts"],"sourcesContent":[null],"names":[],"mappings":"4RAAA;AACA;AAaA;;;;;;AAMG;AACH,SAAS,eAAe,CAAC,SAAiB,EAAA;;QAEhC,KAAA,YAAiB,CAAA,SAAO,CAAA;AAC9B,EAAA,OAAA,OAAY,CAAC,CAAC;AAClB;AAEO,MAAM,kBAAkB,GAAG,CAC9B,SAAuC,EACvC,MAA8B,EAC9B,KAA4C,GAAA,EAAE,EAC9C,QAAiB,KACjB;AACA,EAAA,IAAA;;AAGA,EAAA,IAAA,OAAW,SAAA,KAAc,QAAA,EAAQ;mBACd,GAAA;SAClB;UAAO;YACE;YAEF;AACA,MAAA;QACJ,SAAC;QAED,CAAiC,MAAA,IAAA,CAAA,MAAA,IAAA,CAAA,eAAA,EAAA;YAClB,IAAA,KAAA,CAAA,oEAA0D,CAAA;;;IAI7E,eAAM,GAAA,CAAa,iBAAiB,CAAI,CAAA,EAAA,MAAI,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA,CAAA,WAAA,EAAA;;;QAItC,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tD,CAAA,2CACF,CAAA,CAAA;;AAGE;gBAGH,CAAA,YAAA,GAAA,oBAAA;gBAEoC,CAAA,UAAA,GAAA,UAAA;AACrC;AACA;QACH,SAAA,GAAA,WAAA,CAAA,KAAA,CAAA,GAAA,CAAA,KAAA,CAAA;MAE0B,YAAA,GAAA,GAAA,CAAA,QAAA;MACrB,GAAA,CAAA,QAAA,CAAS,QAAG,CAAA,GAAA,CAAA,EAAY;AAC9B,IAAA,YAAgB,GAAA,iBAA8C,CAAA,GAAA,CAAA,QAAA,CAAA;;SAE9C;IAChB,MAAC,EAAA,GAAA,CAAA,MAAA;IAED,SAAO,EAAA,GAAA,CAAA,SAAA;gBACK;aACC;;;;;AAKjB;AAEA;;;AAGG,EAAA,MAAA;AACH,IAAM,YAAU;IACZ;MAE+D,SAAA,CAAA,YAAA;;kBAEV,EAAA;IACrD,OAAC,CAAA;;;kBAI2C,EAAA;IAC5C,OAAC,CAAA;;;;;;AAOL,EAAC,OAAA,CAAA;"}
@@ -1,4 +1,12 @@
1
- import { ConfigurationScope, IConfigurationRegistry } from '../interfaces';
2
- export declare function getScopes(configurationRegistry: IConfigurationRegistry): {
1
+ import { ConfigurationScope, IConfigurationNode } from '../interfaces';
2
+ /**
3
+ * Retrieves the scope (ConfigurationScope) for each registered property.
4
+ * If tenantId is provided, retrieves only that tenant's properties.
5
+ *
6
+ * @param configurationRegistry - An IConfigurationRegistry that supports getConfigurationProperties(tenantId).
7
+ * @param tenantId - (Optional) the tenant whose properties you want.
8
+ * @returns A record of property key -> ConfigurationScope.
9
+ */
10
+ export declare function getScopes(configurationProperties: IConfigurationNode): Promise<{
3
11
  [key: string]: ConfigurationScope;
4
- };
12
+ }>;
@@ -1,9 +1,19 @@
1
- function getScopes(configurationRegistry) {
1
+ /**
2
+ * Retrieves the scope (ConfigurationScope) for each registered property.
3
+ * If tenantId is provided, retrieves only that tenant's properties.
4
+ *
5
+ * @param configurationRegistry - An IConfigurationRegistry that supports getConfigurationProperties(tenantId).
6
+ * @param tenantId - (Optional) the tenant whose properties you want.
7
+ * @returns A record of property key -> ConfigurationScope.
8
+ */
9
+ async function getScopes(configurationProperties) {
2
10
  const scopes = {};
3
- const configurationProperties = configurationRegistry.getConfigurationProperties();
11
+ // Gather the scope for each property
4
12
  for (const key of Object.keys(configurationProperties)) {
5
13
  scopes[key] = configurationProperties[key].scope;
6
14
  }
15
+ // These might be special keys (launch, task) that are always considered RESOURCE,
16
+ // depending on your project conventions. Keep or remove as necessary.
7
17
  scopes['launch'] = 4 /* ConfigurationScope.RESOURCE */;
8
18
  scopes['task'] = 4 /* ConfigurationScope.RESOURCE */;
9
19
  return scopes;
@@ -1 +1 @@
1
- {"version":3,"file":"configuration-utils.js","sources":["../../src/utils/configuration-utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGM,SAAU,SAAS,CAAC,qBAA6C,EAAA;QAC7D,MAAA,GAAS,EAAA;AACf,EAAA,MAAA,0BAAgC,qBAAA,CAAA,0BAAsB,EAA0B;OAC3E,MAAA,GAAS,IAAA,MAAU,CAAA,4BAAM,CAAA,EAAwB;UAC5C,CAAA,GAAA,CAAC,GAAG,uBAAI,CAAA,GAAuB,CAAC,CAAG,KAAE;;AAE/C,EAAA,MAAA,CAAA,QAAO,CAAA,GAAS,CAAA;AAChB,EAAA,MAAA,CAAA,MAAO,CAAA,GAAO,CAAA;AACd,EAAA,OAAA;AACJ"}
1
+ {"version":3,"file":"configuration-utils.js","sources":["../../src/utils/configuration-utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;;;AAOG;AACI,eAAe,SAAS,CAC3B,uBAA2C,EAAA;QAErC,MAAA,GAAgD,EAAA;;OAGjD,MAAA,GAAS,IAAA,MAAU,CAAA,4BAAM,CAAA,EAAwB;UAC5C,CAAA,GAAA,CAAC,GAAG,uBAAI,CAAA,GAAuB,CAAC,CAAG,KAAE;;;;AAK/C,EAAA,MAAA,CAAA,QAAO,CAAA,GAAS,CAAA;AAChB,EAAA,MAAA,CAAA,MAAO,CAAA,GAAO,CAAA;AAEd,EAAA,OAAA;AACJ"}
@@ -14,3 +14,4 @@ export * from './getUserAlias';
14
14
  export * from './getLogger';
15
15
  export * from './preferenceUri';
16
16
  export * from './reviveUri';
17
+ export * from './nodeContext';
@@ -0,0 +1,7 @@
1
+ import { IConfigurationNodeContextInput, IRegistryExtensions, IConfigurationSchemaId, ServerContext } from '../interfaces';
2
+ type UserContext = Pick<ServerContext['userContext'], 'userAlias' | 'orgId' | 'tenantId'>;
3
+ export declare function buildNodeContext(userContext: UserContext, schemaId?: IConfigurationSchemaId, extensionName?: IRegistryExtensions): IConfigurationNodeContextInput;
4
+ export declare function buildPermissionNodeContext(userContext: UserContext): IConfigurationNodeContextInput;
5
+ export declare function buildPolicyNodeContext(userContext: UserContext): IConfigurationNodeContextInput;
6
+ export declare function buildRoleNodeContext(userContext: UserContext): IConfigurationNodeContextInput;
7
+ export {};
@@ -0,0 +1,18 @@
1
+ import {IConfigurationSchemaId,IRegistryExtensions}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';function buildNodeContext(userContext, schemaId = IConfigurationSchemaId.Configuration, extensionName = IRegistryExtensions.DefaultConfiguration) {
2
+ return {
3
+ schemaId: schemaId,
4
+ tenantId: userContext?.tenantId,
5
+ extensionName,
6
+ orgId: userContext?.orgId,
7
+ userAlias: userContext?.userAlias
8
+ };
9
+ }
10
+ function buildPermissionNodeContext(userContext) {
11
+ return buildNodeContext(userContext, IConfigurationSchemaId.Permission, IRegistryExtensions.DefaultConfiguration);
12
+ }
13
+ function buildPolicyNodeContext(userContext) {
14
+ return buildNodeContext(userContext, IConfigurationSchemaId.Policy, IRegistryExtensions.DefaultConfiguration);
15
+ }
16
+ function buildRoleNodeContext(userContext) {
17
+ return buildNodeContext(userContext, IConfigurationSchemaId.UserRole, IRegistryExtensions.DefaultConfiguration);
18
+ }export{buildNodeContext,buildPermissionNodeContext,buildPolicyNodeContext,buildRoleNodeContext};//# sourceMappingURL=nodeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeContext.js","sources":["../../src/utils/nodeContext.ts"],"sourcesContent":[null],"names":[],"mappings":"wXAQgB,SAAA,gBAAgB,CAC5B,WAAwB,EACxB,QAAQ,GAAG,sBAAsB,CAAC,aAAa,EAC/C,aAAqC,GAAA,mBAAmB,CAAC,oBAAoB,EAAA;SAEtE;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,sBAAwB,CAAA,UAAW,EAAA,mBAAqB,CAAA,oBAAqB,CAAA;AACpH;AACM,SAAU,sBAAsB,CAAC,WAAwB,EAAA;AAC3D,EAAA,OAAA,gBAAuB,CAAA,WAAY,EAAA,sBAAwB,CAAA,MAAO,EAAA,mBAAqB,CAAA,oBAAqB,CAAA;AAChH;AAEM,SAAU,oBAAoB,CAAC,WAAwB,EAAA;AACzD,EAAA,OAAA,gBAAuB,CAAA,WAAY,EAAA,sBAAwB,CAAA,QAAS,EAAA,mBAAqB,CAAA,oBAAqB,CAAA;AAClH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/core",
3
- "version": "9.2.1-alpha.45",
3
+ "version": "9.2.1-alpha.48",
4
4
  "description": "AdminIDE core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -34,7 +34,7 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "106bc2ef238ec667ec6591d579938e4476e8ef3d",
37
+ "gitHead": "248df89ff71cd83aba9b40b303e6c6c35f1d9d84",
38
38
  "typescript": {
39
39
  "definition": "lib/index.d.ts"
40
40
  }