@mindline/sync 1.0.82 → 1.0.83

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,6 +2,5 @@
2
2
  "ExpandedNodes": [
3
3
  ""
4
4
  ],
5
- "SelectedNode": "\\package.json",
6
5
  "PreviewInSolutionExplorer": false
7
6
  }
package/.vs/slnx.sqlite CHANGED
Binary file
Binary file
@@ -2,14 +2,14 @@
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}"
12
8
  },
9
+ {
10
+ "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}",
11
+ "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:hybridspa.ts||{0F2454B1-A556-402D-A7D0-1FDE7F99DEE0}"
12
+ },
13
13
  {
14
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
15
  "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
@@ -64,7 +64,7 @@
64
64
  },
65
65
  {
66
66
  "DockedWidth": 200,
67
- "SelectedChildIndex": 2,
67
+ "SelectedChildIndex": 3,
68
68
  "Children": [
69
69
  {
70
70
  "$type": "Document",
@@ -76,8 +76,7 @@
76
76
  "RelativeToolTip": "package.json",
77
77
  "ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
78
78
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
79
- "WhenOpened": "2024-11-06T06:24:37.385Z",
80
- "EditorCaption": ""
79
+ "WhenOpened": "2024-11-06T06:24:37.385Z"
81
80
  },
82
81
  {
83
82
  "$type": "Document",
@@ -93,26 +92,26 @@
93
92
  },
94
93
  {
95
94
  "$type": "Document",
96
- "DocumentIndex": 0,
95
+ "DocumentIndex": 1,
97
96
  "Title": "hybridspa.ts",
98
97
  "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\hybridspa.ts",
99
98
  "RelativeDocumentMoniker": "hybridspa.ts",
100
99
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\hybridspa.ts",
101
100
  "RelativeToolTip": "hybridspa.ts",
102
- "ViewState": "AQIAABwAAAAAAAAAAAAAABwAAAAUAAAA",
101
+ "ViewState": "AQIAACEAAAAAAAAAAAAtwDMAAABOAAAA",
103
102
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
104
103
  "WhenOpened": "2024-11-04T14:16:26.493Z",
105
104
  "EditorCaption": ""
106
105
  },
107
106
  {
108
107
  "$type": "Document",
109
- "DocumentIndex": 1,
108
+ "DocumentIndex": 0,
110
109
  "Title": "index.ts",
111
110
  "DocumentMoniker": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.ts",
112
111
  "RelativeDocumentMoniker": "index.ts",
113
112
  "ToolTip": "C:\\Users\\ArvindSuthar\\source\\repos\\front\\sync\\index.ts",
114
113
  "RelativeToolTip": "index.ts",
115
- "ViewState": "AQIAAPQGAAAAAAAAAAAswNQHAAAdAAAA",
114
+ "ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
116
115
  "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
117
116
  "WhenOpened": "2024-05-12T20:20:11.888Z",
118
117
  "EditorCaption": ""
package/hybridspa.ts CHANGED
@@ -88,8 +88,9 @@ export async function processErrors(response: Response): Promise<string> {
88
88
  if (errorString != "") return errorString;
89
89
  }
90
90
  let data = await response.json();
91
+ // process errors from Mindline Config API
91
92
  if (data.error !== undefined) {
92
- errorString = `Error: ${data.error.code} Message: ${data.error.message}`;
93
+ errorString = `Error: ${data.error} Message: ${data.message}`;
93
94
  } else if (data.errors !== undefined) {
94
95
  let errorArray = Object.keys(data.errors);
95
96
  let errorlist: string = "";
package/index.ts CHANGED
@@ -1525,7 +1525,7 @@ export async function signIn(user: User, tasks: TaskArray): Promise<boolean> {
1525
1525
  return false;
1526
1526
  }
1527
1527
  }
1528
- // SignIn by an admin consents the app, Challenge adds incremental permissions dynamically, but requires a consented app - TEST THIS
1528
+ // SignIn by an admin consents the app, Challenge adds incremental permissions dynamically, but requires a consented app - TODO: TEST FRESH CONSENT EXPERIENCE
1529
1529
  let signinURL: string = window.location.href;
1530
1530
  switch (user.authority) {
1531
1531
  case graphConfig.authorityWW:
@@ -1543,11 +1543,17 @@ export async function signIn(user: User, tasks: TaskArray): Promise<boolean> {
1543
1543
  }
1544
1544
  let url: URL = new URL(signinURL);
1545
1545
  url.searchParams.append("redirectUri", window.location.origin);
1546
- url.searchParams.append("domainHint", "organizations");
1547
- // "1" is the OID that is set by default when reading the user objects from the JSON initialization file.
1548
- // This means this user has not been created by the admin. If it had been, oid and mail would be the same and not == "1".
1549
1546
  if (user.oid !== "1") {
1550
1547
  url.searchParams.append("loginHint", user.mail);
1548
+ const regex = /@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/;
1549
+ const regexMatch = user.mail.match(regex);
1550
+ let domain: string = regexMatch ? regexMatch[1] : "organizations";
1551
+ url.searchParams.append("domainHint", domain);
1552
+ }
1553
+ else {
1554
+ // "1" is the dummy OID set when initializing the application from JSON. No need to provide any specific hint.
1555
+ // This means that a user has not yet been specified by the admin. If it had been, oid would not be "1".
1556
+ url.searchParams.append("domainHint", "organizations");
1551
1557
  }
1552
1558
  tasks.setTaskStart("initialization", new Date());
1553
1559
  tasks.setTaskStart("authenticate user", new Date());
@@ -1555,6 +1561,7 @@ export async function signIn(user: User, tasks: TaskArray): Promise<boolean> {
1555
1561
  return true;
1556
1562
  }
1557
1563
  export function signInIncrementally(user: User, scope: string): void {
1564
+ debugger;
1558
1565
  if (user.oid == "1") return;
1559
1566
  // for dynamic delegated permissions, we can use the Microsoft Identity Web Account Controller Challenge method
1560
1567
  let challengeURL: string = window.location.href;
@@ -1653,7 +1660,8 @@ export async function tenantRelationshipsGetByDomain(loggedInUser: User, tenant:
1653
1660
  tenantEndpoint += "')";
1654
1661
  console.log("tenantRelationshipsGetByDomain: Attempting GET from /findTenantInformationByDomainName:", tenantEndpoint);
1655
1662
  let response = await fetch(tenantEndpoint, options);
1656
- if (response.status == 200 && response.statusText == "OK") {
1663
+ // status IS 200, but statusText no longer returns "OK" 1/26/2025
1664
+ if (response.status == 200) { // && response.statusText == "OK") {
1657
1665
  let data = await response.json();
1658
1666
  if (data) {
1659
1667
  if (data.error != null) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mindline/sync",
3
3
  "type": "module",
4
- "version": "1.0.82",
4
+ "version": "1.0.83",
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.",