@mindline/sync 1.0.61 → 1.0.62

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/.vs/slnx.sqlite CHANGED
Binary file
package/index.d.ts CHANGED
@@ -289,6 +289,7 @@ declare module "@mindline/sync" {
289
289
  setConfigId: (id: string) => void,
290
290
  setSelectedConfigs: (selectedConfigs: { [id: string]: boolean | number[] }) => void,
291
291
  workspace: Workspace,
292
+ ii: InitInfo,
292
293
  debug: boolean): APIResult;
293
294
  export function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): APIResult;
294
295
  export function configsRefresh(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, ii: InitInfo, debug: boolean): APIResult;
package/index.ts CHANGED
@@ -1681,6 +1681,7 @@ export async function configEdit(
1681
1681
  setConfigId: (id: string) => void,
1682
1682
  setSelectedConfigs: (selectedConfigs: { [id: string]: boolean | number[] }) => void,
1683
1683
  workspace: Workspace,
1684
+ ii: InitInfo,
1684
1685
  debug: boolean): Promise<APIResult>
1685
1686
  {
1686
1687
  let result: APIResult = new APIResult();
@@ -1704,6 +1705,7 @@ export async function configEdit(
1704
1705
  else {
1705
1706
  result = await configPut(instance, authorizedUser, config, debug);
1706
1707
  }
1708
+ ii.save();
1707
1709
  return result;
1708
1710
  }
1709
1711
  export async function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult> {
@@ -1718,12 +1720,10 @@ export async function configsRefresh(instance: IPublicClientApplication, authori
1718
1720
  // clear Config associations as we are about to reset
1719
1721
  workspace.associatedConfigs.length = 0;
1720
1722
  // GET configs associated with this workspace
1721
- let configsPromise: Promise<APIResult> = configsGet(instance, authorizedUser, workspace.id, debug);
1722
- // wait for query to finish, return on any failure
1723
- let [configsResult] = await Promise.all([configsPromise]);
1724
- if (!configsResult.result) return configsResult;
1723
+ let result: APIResult = await configsGet(instance, authorizedUser, workspace.id, debug);
1724
+ if (!result.result) return result;
1725
1725
  // process returned workspace components
1726
- processReturnedConfigs(workspace, ii, configsResult.array!);
1726
+ processReturnedConfigs(workspace, ii, result.array!);
1727
1727
  // tag components with workspaceIDs
1728
1728
  ii.tagWithWorkspaces();
1729
1729
  }
@@ -1831,8 +1831,8 @@ function processReturnedAdmins(workspace: Workspace, ii: InitInfo, returnedAdmin
1831
1831
  user.name = item.firstName ?? user.name;
1832
1832
  user.mail = item.email;
1833
1833
  user.tid = item.tenantId;
1834
- // *try* to set authority from tenant returned in previous call processReturnedTenants (it may not be there)
1835
- // ASSUMPTION: user either comes from
1834
+ // *try* to set authority/companyName/companyDomain from tenant returned in previous call processReturnedTenants (it may not be there)
1835
+ // ASSUMPTION: in terms of setting authority, user either comes from
1836
1836
  // 1. .NET session, in which case user has an authority from the token
1837
1837
  // 2. Config API, in which case either
1838
1838
  // a. associated tenant with authority exists for this user (i.e. workspace owner has called POST init/configuration and created Admin and Tenant at same time)
@@ -1841,6 +1841,8 @@ function processReturnedAdmins(workspace: Workspace, ii: InitInfo, returnedAdmin
1841
1841
  let tenant: Tenant | undefined = ii.ts.find((t) => (t.tid === user.tid));
1842
1842
  if (tenant != undefined) {
1843
1843
  user.authority = tenant.authority;
1844
+ user.companyName = tenant.name;
1845
+ user.companyDomain = tenant.domain;
1844
1846
  }
1845
1847
  // ensure this workspace tracks this user
1846
1848
  let idx = workspace.associatedUsers.findIndex((u) => u === user.oid);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mindline/sync",
3
3
  "type": "module",
4
- "version": "1.0.61",
4
+ "version": "1.0.62",
5
5
  "types": "index.d.ts",
6
6
  "exports": "./index.ts",
7
7
  "description": "sync is a node.js package encapsulating javscript classes required for configuring Mindline sync service.",