@mindline/sync 1.0.98 → 1.0.100
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/VSWorkspaceState.json +1 -2
- package/.vs/slnx.sqlite +0 -0
- package/.vs/sync/CopilotIndices/17.14.260.54502/CodeChunks.db +0 -0
- package/.vs/sync/CopilotIndices/17.14.260.54502/SemanticSymbols.db +0 -0
- package/.vs/sync/FileContentIndex/329bf12b-91d2-45df-a54a-8517aa352455.vsidx +0 -0
- package/.vs/sync/FileContentIndex/3e5ba5f3-8912-41a5-b84c-70b0058c1769.vsidx +0 -0
- package/.vs/sync/FileContentIndex/b4b73e68-525d-401c-95be-e93f3675ea76.vsidx +0 -0
- package/.vs/sync/FileContentIndex/d40775c5-40b9-4274-bf7c-d627a3d5e7c8.vsidx +0 -0
- package/.vs/sync/v17/.wsuo +0 -0
- package/.vs/sync/v17/DocumentLayout.backup.json +20 -53
- package/.vs/sync/v17/DocumentLayout.json +27 -60
- package/dist/src/index.d.ts +4 -1
- package/dist/sync.es.js +788 -756
- package/dist/sync.es.js.map +1 -1
- package/dist/sync.umd.js +23 -23
- package/dist/sync.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/index.d.ts +5 -3
- package/src/index.ts +64 -7
- package/.vs/sync/FileContentIndex/273140aa-4f18-43b9-bcdd-2a15a7bb3321.vsidx +0 -0
- package/.vs/sync/FileContentIndex/3f844564-c214-4f94-a0ae-1560b50e152c.vsidx +0 -0
- package/.vs/sync/FileContentIndex/45c8c5a2-a7a0-4025-b787-3053b90d28fc.vsidx +0 -0
- package/.vs/sync/FileContentIndex/bf8b7585-0ffb-4a59-ba38-a349db39ce21.vsidx +0 -0
- /package/.vs/sync/FileContentIndex/{b9c9b1f1-a6bb-4dbc-8e91-4e9ecf1382d5.vsidx → 1075558f-bf92-43ad-a8c4-360c99ce1e38.vsidx} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindline/sync",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.100",
|
|
4
4
|
"description": "sync is a node.js package encapsulating JavaScript classes required for configuring Mindline sync service.",
|
|
5
5
|
"main": "dist/sync.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "vite build",
|
|
12
|
+
"prepublishOnly": "npm run build",
|
|
12
13
|
"test": "vitest"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [],
|
package/src/index.d.ts
CHANGED
|
@@ -320,18 +320,20 @@ declare module "@mindline/sync" {
|
|
|
320
320
|
export function userDelegatedScopesRemove(instance: IPublicClientApplication, loggedInUser: User, tenant: Tenant, scope: string): boolean;
|
|
321
321
|
export function usersGet(instance: IPublicClientApplication, user: User | undefined): { users: string[], error: string };
|
|
322
322
|
// ======================= Mindline Config API ===============================
|
|
323
|
-
export function
|
|
324
|
-
export function configConsentForWrite(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
323
|
+
export function auditEventsRetrieve(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult>;
|
|
325
324
|
export function configEdit(instance: IPublicClientApplication, authorizedUser: User, config: Config, setConfigId: (id: string) => void, setSelectedConfigs: (selectedConfigs: { [id: string]: boolean | number[] }) => void, workspace: Workspace, ii: InitInfo, debug: boolean): APIResult;
|
|
326
325
|
export function configEnable(instance: IPublicClientApplication, authorizedUser: User, configurationId: string, enabled: boolean, debug: boolean): APIResult;
|
|
327
|
-
export function
|
|
326
|
+
export function configConsentForRead(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
327
|
+
export function configConsentForWrite(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult>;
|
|
328
328
|
export function configsRefresh(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, ii: InitInfo, debug: boolean): APIResult;
|
|
329
|
+
export function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): APIResult;
|
|
329
330
|
export function initGet(instance: IPublicClientApplication, user: User, ii: InitInfo, tasks: TaskArray, debug: boolean): APIResult;
|
|
330
331
|
export function tenantAdd(instance: IPublicClientApplication, authorizedUser: User, tenant: Tenant, workspaceId: string): APIResult;
|
|
331
332
|
export function tenantRemove(instance: IPublicClientApplication, authorizedUser: User, tenant: Tenant, workspaceId: string, debug: boolean): APIResult;
|
|
332
333
|
export function userAdd(instance: IPublicClientApplication, authorizedUser: User, user: User, workspaceId: string): APIResult;
|
|
333
334
|
export function userRemove(instance: IPublicClientApplication, authorizedUser: User, user: User, workspaceId: string): APIResult;
|
|
334
335
|
export function workspaceEdit(instance: IPublicClientApplication, authorizedUser: User, workspaceId: string, workspaceName: string): Promise<APIResult>;
|
|
336
|
+
// ======================= PowerBI Access Token Retrieval ===============================
|
|
335
337
|
export function getPowerBIAccessToken(instance: IPublicClientApplication, user: User): Promise<string>;
|
|
336
338
|
// ======================= Azure REST API ===============================
|
|
337
339
|
export function canListRootAssignments(instance: IPublicClientApplication, user: User): Promise<boolean>;
|
package/src/index.ts
CHANGED
|
@@ -50,6 +50,9 @@ export class mindlineConfig {
|
|
|
50
50
|
static adminsEndpoint(): string {
|
|
51
51
|
return `https://${mindlineConfig.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/admins`;
|
|
52
52
|
};
|
|
53
|
+
static auditEventsEndpoint(): string {
|
|
54
|
+
return `https://${mindlineConfig.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-events`;
|
|
55
|
+
};
|
|
53
56
|
static configConsentEndpoint(): string {
|
|
54
57
|
return `https://${mindlineConfig.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/configuration/consent`;
|
|
55
58
|
};
|
|
@@ -1994,6 +1997,9 @@ export async function usersGet(instance: IPublicClientApplication, user: User |
|
|
|
1994
1997
|
}
|
|
1995
1998
|
}
|
|
1996
1999
|
// ======================= Mindline Config API ===============================
|
|
2000
|
+
export async function auditEventsRetrieve(instance: IPublicClientApplication, authorizedUser: User, debug: boolean): Promise<APIResult> {
|
|
2001
|
+
return auditEventsGet(instance, authorizedUser, debug);
|
|
2002
|
+
}
|
|
1997
2003
|
export async function configEdit(
|
|
1998
2004
|
instance: IPublicClientApplication,
|
|
1999
2005
|
authorizedUser: User,
|
|
@@ -2041,9 +2047,6 @@ export async function configEnable(
|
|
|
2041
2047
|
result = await configPatch(instance, authorizedUser, configurationId, enabled, debug);
|
|
2042
2048
|
return result;
|
|
2043
2049
|
}
|
|
2044
|
-
export async function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult> {
|
|
2045
|
-
return configDelete(instance, authorizedUser, config, workspaceId, debug);
|
|
2046
|
-
}
|
|
2047
2050
|
export async function configConsentForRead(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult> {
|
|
2048
2051
|
return configConsentReadPut(instance, authorizedUser, configId, tid, consent);
|
|
2049
2052
|
}
|
|
@@ -2083,6 +2086,9 @@ export async function configsRefresh(instance: IPublicClientApplication, authori
|
|
|
2083
2086
|
result.status = 500;
|
|
2084
2087
|
return result;
|
|
2085
2088
|
}
|
|
2089
|
+
export async function configRemove(instance: IPublicClientApplication, authorizedUser: User, config: Config, workspaceId: string, debug: boolean): Promise<APIResult> {
|
|
2090
|
+
return configDelete(instance, authorizedUser, config, workspaceId, debug);
|
|
2091
|
+
}
|
|
2086
2092
|
export async function initGet(instance: IPublicClientApplication, user: User, ii: InitInfo, tasks: TaskArray, debug: boolean): Promise<APIResult> {
|
|
2087
2093
|
console.log(`>>>>>> initGet`);
|
|
2088
2094
|
let result: APIResult = new APIResult();
|
|
@@ -2556,10 +2562,7 @@ async function readResources(instance: IPublicClientApplication, user: User): Pr
|
|
|
2556
2562
|
}
|
|
2557
2563
|
return resources;
|
|
2558
2564
|
}
|
|
2559
|
-
|
|
2560
|
-
//hybridspa.ts - calls to Mindline Config API
|
|
2561
|
-
|
|
2562
|
-
// helper functions
|
|
2565
|
+
// ======================= HYBRIDSPA.TS -- Mindline Config API helper functions ===============================
|
|
2563
2566
|
function getAPIScope(user: User): string {
|
|
2564
2567
|
let apiAppID: string = "8d95d21c-c378-4bb0-9f52-88c30d271e7a";
|
|
2565
2568
|
let authority: string = user.authority.toLowerCase();
|
|
@@ -2802,6 +2805,60 @@ export async function adminPost(
|
|
|
2802
2805
|
}
|
|
2803
2806
|
return result;
|
|
2804
2807
|
}
|
|
2808
|
+
export async function auditEventsGet(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult> {
|
|
2809
|
+
let result: APIResult = new APIResult();
|
|
2810
|
+
// we need a valid user
|
|
2811
|
+
if (user.mail == undefined || user.mail == "") {
|
|
2812
|
+
result.result = false;
|
|
2813
|
+
result.status = 500;
|
|
2814
|
+
result.error = "auditEventsGet: no user provided";
|
|
2815
|
+
return result;
|
|
2816
|
+
}
|
|
2817
|
+
// create endpoint
|
|
2818
|
+
let endpoint: string = mindlineConfig.auditEventsEndpoint();
|
|
2819
|
+
let url: URL = new URL(endpoint);
|
|
2820
|
+
// create workspace headers
|
|
2821
|
+
const headers = await mindlineDefineHeaders(instance, user);
|
|
2822
|
+
// make workspace endpoint call
|
|
2823
|
+
let options = { method: "GET", headers: headers };
|
|
2824
|
+
try {
|
|
2825
|
+
if (debug) debugger;
|
|
2826
|
+
console.log("Attempting GET from /audit-events endpoint: " + url.href);
|
|
2827
|
+
let response = await fetch(url.href, options);
|
|
2828
|
+
if (response.status === 200 && response.statusText === "OK") {
|
|
2829
|
+
let json = await response.json();
|
|
2830
|
+
if (Array.isArray(json.data)) {
|
|
2831
|
+
let returnedArray: Array<Object> = json.data;
|
|
2832
|
+
if (returnedArray != null) {
|
|
2833
|
+
result.array = returnedArray;
|
|
2834
|
+
let initialValue: string = "";
|
|
2835
|
+
console.log(`Successful GET from /audit-events: ${result.array.reduce((acc, curr: any) => acc + curr.initiatedByUser + " ", initialValue)}`);
|
|
2836
|
+
return result;
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
result.error = `Failed GET from /audit-events: failed to JSON-parse response`;
|
|
2840
|
+
console.log(result.error);
|
|
2841
|
+
result.status = 500;
|
|
2842
|
+
result.result = false;
|
|
2843
|
+
return result;
|
|
2844
|
+
}
|
|
2845
|
+
else {
|
|
2846
|
+
console.log(`Failed GET from /audit-events: ${url.href}`);
|
|
2847
|
+
result.error = await processErrors(response);
|
|
2848
|
+
result.status = 500;
|
|
2849
|
+
result.result = false;
|
|
2850
|
+
console.log(result.error);
|
|
2851
|
+
return result;
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
catch (error: any) {
|
|
2855
|
+
result.error = error.message;
|
|
2856
|
+
result.status = 500;
|
|
2857
|
+
result.result = false;
|
|
2858
|
+
console.log(error.message);
|
|
2859
|
+
}
|
|
2860
|
+
return result;
|
|
2861
|
+
}
|
|
2805
2862
|
//configConsentReadPut
|
|
2806
2863
|
export async function configConsentReadPut(instance: IPublicClientApplication, authorizedUser: User, configId: string, tid: string, consent: boolean): Promise<APIResult> {
|
|
2807
2864
|
let result: APIResult = new APIResult();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|