@mindline/sync 1.0.73 → 1.0.74

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.
Binary file
@@ -2,10 +2,6 @@
2
2
  "Version": 1,
3
3
  "WorkspaceRootPath": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\",
4
4
  "Documents": [
5
- {
6
- "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\hybridspa.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
7
- "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:hybridspa.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
8
- },
9
5
  {
10
6
  "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
11
7
  "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:index.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
@@ -13,6 +9,18 @@
13
9
  {
14
10
  "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.d.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
15
11
  "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:index.d.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
12
+ },
13
+ {
14
+ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
15
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
16
+ },
17
+ {
18
+ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\resources.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
19
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:resources.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
20
+ },
21
+ {
22
+ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\hybridspa.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}",
23
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:hybridspa.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
16
24
  }
17
25
  ],
18
26
  "DocumentGroupContainers": [
@@ -59,46 +67,78 @@
59
67
  ]
60
68
  },
61
69
  {
62
- "DockedWidth": 200,
63
- "SelectedChildIndex": 0,
70
+ "DockedWidth": 186,
71
+ "SelectedChildIndex": 3,
64
72
  "Children": [
65
73
  {
66
74
  "$type": "Document",
67
- "DocumentIndex": 0,
75
+ "DocumentIndex": 2,
76
+ "Title": "package.json",
77
+ "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\package.json",
78
+ "RelativeDocumentMoniker": "package.json",
79
+ "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\package.json",
80
+ "RelativeToolTip": "package.json",
81
+ "ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
82
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
83
+ "WhenOpened": "2024-03-30T18:10:14.136Z",
84
+ "EditorCaption": ""
85
+ },
86
+ {
87
+ "$type": "Document",
88
+ "DocumentIndex": 4,
68
89
  "Title": "hybridspa.ts",
69
90
  "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\hybridspa.ts",
70
91
  "RelativeDocumentMoniker": "hybridspa.ts",
71
92
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\hybridspa.ts",
72
93
  "RelativeToolTip": "hybridspa.ts",
73
- "ViewState": "AQIAAAUCAAAAAAAAAAAhwAcCAAAEAAAA",
94
+ "ViewState": "AQIAAGQBAAAAAAAAAIAmwAcCAAAEAAAA",
74
95
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
75
- "WhenOpened": "2023-11-25T02:18:34.862Z",
96
+ "WhenOpened": "2023-11-25T02:18:34.862Z"
97
+ },
98
+ {
99
+ "$type": "Document",
100
+ "DocumentIndex": 3,
101
+ "Title": "resources.json",
102
+ "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\resources.json",
103
+ "RelativeDocumentMoniker": "resources.json",
104
+ "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\resources.json",
105
+ "RelativeToolTip": "resources.json",
106
+ "ViewState": "AQIAAAgAAAAAAAAAAAAUwDkAAAABAAAA",
107
+ "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
108
+ "WhenOpened": "2024-03-30T16:56:29.032Z",
76
109
  "EditorCaption": ""
77
110
  },
78
111
  {
79
112
  "$type": "Document",
80
- "DocumentIndex": 1,
113
+ "DocumentIndex": 0,
81
114
  "Title": "index.ts",
82
115
  "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.ts",
83
116
  "RelativeDocumentMoniker": "index.ts",
84
117
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.ts",
85
118
  "RelativeToolTip": "index.ts",
86
- "ViewState": "AQIAAAAAAAAAAAAAAAAAAAQAAADwAAAA",
119
+ "ViewState": "AQIAAOsBAAAAAAAAAAAAANEEAAAuAAAA",
87
120
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
88
121
  "WhenOpened": "2023-12-05T02:10:16.04Z",
89
122
  "EditorCaption": ""
90
- },
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "DockedWidth": 200,
128
+ "SelectedChildIndex": 0,
129
+ "Children": [
91
130
  {
92
131
  "$type": "Document",
93
- "DocumentIndex": 2,
132
+ "DocumentIndex": 1,
94
133
  "Title": "index.d.ts",
95
134
  "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.d.ts",
96
135
  "RelativeDocumentMoniker": "index.d.ts",
97
136
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.d.ts",
98
137
  "RelativeToolTip": "index.d.ts",
99
- "ViewState": "AQIAABMBAAAAAAAAAAAEwCsBAAAEAAAA",
138
+ "ViewState": "AQIAAPsAAAAAAAAAAAAAABcBAAAIAAAA",
100
139
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
101
- "WhenOpened": "2024-01-01T16:19:43.325Z"
140
+ "WhenOpened": "2024-01-01T16:19:43.325Z",
141
+ "EditorCaption": ""
102
142
  }
103
143
  ]
104
144
  },
package/index.d.ts CHANGED
@@ -265,6 +265,20 @@ declare module "@mindline/sync" {
265
265
  constructor(tid: string, name: string);
266
266
  update(total: number, read: number, written: number, deferred: number): void;
267
267
  }
268
+ export class ResourceArray {
269
+ resourceNodes: ResourceNode[];
270
+ constructor(bClearLocalStorage: boolean);
271
+ // get initial data from localStorage or file
272
+ init(bClearLocalStorage: boolean): void;
273
+ }
274
+ export class ResourceNode {
275
+ type: string;
276
+ resource: string;
277
+ cost: number;
278
+ expanded: boolean;
279
+ resources: ResourceNode[];
280
+ constructor(type: string, resource: string, cost: number);
281
+ }
268
282
  //
269
283
  // Azure AD Graph API
270
284
  //
package/index.ts CHANGED
@@ -10,6 +10,7 @@ import configs from "./configs.json";
10
10
  import workspaces from "./workspaces.json";
11
11
  import tasksData from "./tasks";
12
12
  import syncmilestones from './syncmilestones';
13
+ import resources from './resources';
13
14
  import { log } from "console";
14
15
  const FILTER_FIELD = "workspaceIDs";
15
16
  // called by unit tests
@@ -1228,6 +1229,53 @@ export class TenantNode {
1228
1229
  }
1229
1230
  }
1230
1231
  }
1232
+ export class ResourceArray {
1233
+ resourceNodes: ResourceNode[];
1234
+ constructor(bClearLocalStorage: boolean) {
1235
+ this.resourceNodes = new Array<ResourceNode>();
1236
+ this.init(bClearLocalStorage);
1237
+ }
1238
+ // get initial data from localStorage or file
1239
+ init(bClearLocalStorage: boolean): void {
1240
+ console.log(`Calling ResourceArray::init(bClearLocalStorage: ${bClearLocalStorage ? "true" : "false"})`);
1241
+ // if we have a non-empty string value stored, read it from localStorage
1242
+ if (storageAvailable("localStorage")) {
1243
+ let result = localStorage.getItem("RBAC");
1244
+ if (result != null && typeof result === "string" && result !== "") {
1245
+ if (bClearLocalStorage) {
1246
+ localStorage.removeItem("RBAC");
1247
+ }
1248
+ else {
1249
+ let resourceArrayString: string = result;
1250
+ let raFromLocalStorage: ResourceArray = JSON.parse(resourceArrayString);
1251
+ this.resourceNodes = raFromLocalStorage.resourceNodes;
1252
+ return;
1253
+ }
1254
+ }
1255
+ }
1256
+ // if storage unavailable or we were just asked to clear, read defaults to enable usable UI
1257
+ var resourcesString = JSON.stringify(resources);
1258
+ try {
1259
+ this.resourceNodes = deserializeArray(ResourceNode, resourcesString);
1260
+ } catch (e) {
1261
+ debugger;
1262
+ }
1263
+ }
1264
+ }
1265
+ export class ResourceNode {
1266
+ type: string;
1267
+ resource: string;
1268
+ cost: number;
1269
+ expanded: boolean;
1270
+ resources: ResourceNode[];
1271
+ constructor(type: string, resource: string, cost: number) {
1272
+ this.type = type;
1273
+ this.resource = resource;
1274
+ this.cost = cost;
1275
+ this.expanded = false;
1276
+ this.resources = new Array<ResourceNode>();
1277
+ }
1278
+ }
1231
1279
  // ======================= Azure AD Graph API ===============================
1232
1280
  export async function groupsGet(instance: IPublicClientApplication, user: User | undefined, groupSearchString: string): Promise<{ groups: Group[], error: string }> {
1233
1281
  // need a logged in user to get graph users
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mindline/sync",
3
3
  "type": "module",
4
- "version": "1.0.73",
4
+ "version": "1.0.74",
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.",
package/resources.json ADDED
@@ -0,0 +1,58 @@
1
+ [
2
+ {
3
+ "type": "mg",
4
+ "resource": "Tenant Root Group",
5
+ "cost": 0,
6
+ "expanded": true,
7
+ "resources": [
8
+ {
9
+ "type": "sub",
10
+ "resource": "Applications",
11
+ "cost": 16677.52,
12
+ "expanded": true,
13
+ "resources": [
14
+ {
15
+ "type": "rg",
16
+ "resource": "ssfdev",
17
+ "cost": 7500.08,
18
+ "expanded": true,
19
+ "resources": [
20
+ {
21
+ "type": "resources",
22
+ "resource": "SSFServices",
23
+ "cost": 0,
24
+ "expanded": false,
25
+ "resources": [
26
+ ]
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "type": "sub",
34
+ "resource": "Infrastructure",
35
+ "cost": 8737.58,
36
+ "expanded": true,
37
+ "resources": [
38
+ {
39
+ "type": "rg",
40
+ "resource": "SFFA_Prod_Mgmt_Shared_Resources_RG",
41
+ "cost": 7500.08,
42
+ "expanded": true,
43
+ "resources": [
44
+ {
45
+ "type": "resources",
46
+ "resource": "SSFA-Prod-UTIL-01",
47
+ "cost": 0,
48
+ "expanded": false,
49
+ "resources": [
50
+ ]
51
+ }
52
+ ]
53
+ }
54
+ ]
55
+ }
56
+ ]
57
+ }
58
+ ]