@mindline/sync 1.0.60 → 1.0.61

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.
@@ -2,5 +2,6 @@
2
2
  "ExpandedNodes": [
3
3
  ""
4
4
  ],
5
+ "SelectedNode": "\\configs.json",
5
6
  "PreviewInSolutionExplorer": false
6
7
  }
package/.vs/slnx.sqlite CHANGED
Binary file
Binary file
package/index.d.ts CHANGED
@@ -282,7 +282,14 @@ declare module "@mindline/sync" {
282
282
  //
283
283
  // Mindline Config API
284
284
  //
285
- export function configEdit(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): APIResult;
285
+ export function configEdit(
286
+ instance: IPublicClientApplication,
287
+ authorizedUser: User,
288
+ config: Config,
289
+ setConfigId: (id: string) => void,
290
+ setSelectedConfigs: (selectedConfigs: { [id: string]: boolean | number[] }) => void,
291
+ workspace: Workspace,
292
+ debug: boolean): APIResult;
286
293
  export function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): APIResult;
287
294
  export function configsRefresh(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, ii: InitInfo, debug: boolean): APIResult;
288
295
  export function initGet(instance: IPublicClientApplication, authorizedUser: User, user: User, ii: InitInfo, tasks: TaskArray, debug: boolean): APIResult;
package/index.ts CHANGED
@@ -900,7 +900,7 @@ export class BatchArray {
900
900
  setIdleText(`${this.pb_total} seconds elapsed. Last update ${this.pb_idle} seconds ago. [max idle: ${this.pb_idleMax}/60]`);
901
901
  if (this.pb_idle >= 60) {
902
902
  if (this.milestoneArray.milestones[0].Write == null) {
903
- this.milestoneArray.write(setMilestones);
903
+ //this.milestoneArray.write(setMilestones); -- allow sync to cntinue
904
904
  setConfigSyncResult(`sync continuing, but no update for ${this.pb_idle} seconds`);
905
905
  }
906
906
  }
@@ -1674,10 +1674,32 @@ export async function usersGet(instance: IPublicClientApplication, user: User |
1674
1674
  }
1675
1675
  }
1676
1676
  // ======================= Mindline Config API ===============================
1677
- export async function configEdit(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult> {
1677
+ export async function configEdit(
1678
+ instance: IPublicClientApplication,
1679
+ authorizedUser: User,
1680
+ config: Config,
1681
+ setConfigId: (id: string) => void,
1682
+ setSelectedConfigs: (selectedConfigs: { [id: string]: boolean | number[] }) => void,
1683
+ workspace: Workspace,
1684
+ debug: boolean): Promise<APIResult>
1685
+ {
1678
1686
  let result: APIResult = new APIResult();
1679
1687
  if (config.id === "1") {
1680
- result = await configPost(instance, authorizedUser, config, workspaceId, debug);
1688
+ result = await configPost(instance, authorizedUser, config, workspace.id, debug);
1689
+ if (result.result) {
1690
+ // config id was updated from "1"
1691
+ setConfigId(config.id);
1692
+ // set this config as the selected config
1693
+ const newSelection = {};
1694
+ Object.defineProperty(newSelection, config.id, { value: true, writable: true, enumerable: true });
1695
+ setSelectedConfigs(newSelection);
1696
+ // update associated configs in this workspace
1697
+ let idx: number = workspace.associatedConfigs.findIndex((id: string) => id == "1");
1698
+ if (idx !== -1) {
1699
+ workspace.associatedConfigs.splice(idx, 1);
1700
+ workspace.associatedConfigs.push(config.id);
1701
+ }
1702
+ }
1681
1703
  }
1682
1704
  else {
1683
1705
  result = await configPut(instance, authorizedUser, config, debug);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mindline/sync",
3
3
  "type": "module",
4
- "version": "1.0.60",
4
+ "version": "1.0.61",
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.",