@mindline/sync 1.0.100 → 1.0.101
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 -1
- 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/24a4af15-f48f-4636-bba3-eb444f17772c.vsidx +0 -0
- package/.vs/sync/FileContentIndex/{329bf12b-91d2-45df-a54a-8517aa352455.vsidx → 3d735301-6bc9-4349-a917-609e552af3d6.vsidx} +0 -0
- package/.vs/sync/FileContentIndex/547368c3-2a34-40f3-abaf-8bff09e997f6.vsidx +0 -0
- package/.vs/sync/FileContentIndex/97436329-fb83-43f9-95a2-5f3a047fcb45.vsidx +0 -0
- package/.vs/sync/v17/.wsuo +0 -0
- package/.vs/sync/v17/DocumentLayout.backup.json +23 -5
- package/.vs/sync/v17/DocumentLayout.json +9 -3
- package/dist/src/index.d.ts +16 -0
- package/dist/sync.es.js +652 -589
- package/dist/sync.es.js.map +1 -1
- package/dist/sync.umd.js +22 -14
- package/dist/sync.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +13 -0
- package/src/index.ts +100 -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/FileContentIndex/{1075558f-bf92-43ad-a8c4-360c99ce1e38.vsidx → c124698b-787d-47cd-a04b-0fc30de7e469.vsidx} +0 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -148,6 +148,17 @@ declare module "@mindline/sync" {
|
|
|
148
148
|
sel: boolean; // selection state
|
|
149
149
|
constructor();
|
|
150
150
|
}
|
|
151
|
+
export class AuditConfig {
|
|
152
|
+
id: string;
|
|
153
|
+
workspaceId: string;
|
|
154
|
+
name: string;
|
|
155
|
+
description: string;
|
|
156
|
+
isEnabled: boolean;
|
|
157
|
+
email: string;
|
|
158
|
+
tenantId: string;
|
|
159
|
+
sel: boolean; // selection state
|
|
160
|
+
constructor();
|
|
161
|
+
}
|
|
151
162
|
// class to group Users, Tenants, and Configs
|
|
152
163
|
export class Workspace {
|
|
153
164
|
id: string;
|
|
@@ -320,6 +331,8 @@ declare module "@mindline/sync" {
|
|
|
320
331
|
export function userDelegatedScopesRemove(instance: IPublicClientApplication, loggedInUser: User, tenant: Tenant, scope: string): boolean;
|
|
321
332
|
export function usersGet(instance: IPublicClientApplication, user: User | undefined): { users: string[], error: string };
|
|
322
333
|
// ======================= Mindline Config API ===============================
|
|
334
|
+
export function auditConfigAdd(instance: IPublicClientApplication, user: User, ac: AuditConfig, debug: boolean): Promise<APIResult>;
|
|
335
|
+
export function auditConfigRetrieve(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult>;
|
|
323
336
|
export function auditEventsRetrieve(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult>;
|
|
324
337
|
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;
|
|
325
338
|
export function configEnable(instance: IPublicClientApplication, authorizedUser: User, configurationId: string, enabled: boolean, debug: boolean): APIResult;
|
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 auditConfigEndpoint(): string {
|
|
54
|
+
return `https://${mindlineConfig.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-configuration`;
|
|
55
|
+
}
|
|
53
56
|
static auditEventsEndpoint(): string {
|
|
54
57
|
return `https://${mindlineConfig.environmentTag}-configurationapi-westus.azurewebsites.net/api/v1/audit-events`;
|
|
55
58
|
};
|
|
@@ -279,6 +282,26 @@ export class Config {
|
|
|
279
282
|
this.sel = false;
|
|
280
283
|
}
|
|
281
284
|
}
|
|
285
|
+
export class AuditConfig {
|
|
286
|
+
id: string;
|
|
287
|
+
workspaceId: string;
|
|
288
|
+
name: string;
|
|
289
|
+
description: string;
|
|
290
|
+
isEnabled: boolean;
|
|
291
|
+
email: string;
|
|
292
|
+
tenantId: string;
|
|
293
|
+
sel: boolean; // selection state
|
|
294
|
+
constructor() {
|
|
295
|
+
this.id = "";
|
|
296
|
+
this.name = "";
|
|
297
|
+
this.workspaceId = "";
|
|
298
|
+
this.description = "";
|
|
299
|
+
this.isEnabled = false;
|
|
300
|
+
this.email = "";
|
|
301
|
+
this.tenantId = "";
|
|
302
|
+
this.sel = false;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
282
305
|
export class Workspace {
|
|
283
306
|
id: string;
|
|
284
307
|
name: string;
|
|
@@ -1997,6 +2020,12 @@ export async function usersGet(instance: IPublicClientApplication, user: User |
|
|
|
1997
2020
|
}
|
|
1998
2021
|
}
|
|
1999
2022
|
// ======================= Mindline Config API ===============================
|
|
2023
|
+
export async function auditConfigAdd(instance: IPublicClientApplication, user: User, ac: AuditConfig, debug: boolean): Promise<APIResult> {
|
|
2024
|
+
return auditConfigPost(instance, user, ac, debug);
|
|
2025
|
+
}
|
|
2026
|
+
export async function auditConfigRetrieve(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult> {
|
|
2027
|
+
return auditConfigGet(instance, user, debug);
|
|
2028
|
+
}
|
|
2000
2029
|
export async function auditEventsRetrieve(instance: IPublicClientApplication, authorizedUser: User, debug: boolean): Promise<APIResult> {
|
|
2001
2030
|
return auditEventsGet(instance, authorizedUser, debug);
|
|
2002
2031
|
}
|
|
@@ -2805,6 +2834,77 @@ export async function adminPost(
|
|
|
2805
2834
|
}
|
|
2806
2835
|
return result;
|
|
2807
2836
|
}
|
|
2837
|
+
//auditConfigPost: write audit config to back end
|
|
2838
|
+
export async function auditConfigPost(
|
|
2839
|
+
instance: IPublicClientApplication,
|
|
2840
|
+
user: User,
|
|
2841
|
+
config: AuditConfig,
|
|
2842
|
+
debug: boolean
|
|
2843
|
+
): Promise<APIResult> {
|
|
2844
|
+
instance = instance;
|
|
2845
|
+
user = user;
|
|
2846
|
+
debug = debug;
|
|
2847
|
+
let result: APIResult = new APIResult();
|
|
2848
|
+
if (config.id === "") {
|
|
2849
|
+
result.result = false;
|
|
2850
|
+
result.error = "auditConfigPost: invalid config ID";
|
|
2851
|
+
result.status = 500;
|
|
2852
|
+
return result;
|
|
2853
|
+
}
|
|
2854
|
+
// create no parameter audit config post endpoint
|
|
2855
|
+
let endpoint: string = mindlineConfig.auditConfigEndpoint();
|
|
2856
|
+
// create config headers
|
|
2857
|
+
const headers = await mindlineDefineHeaders(instance, user);
|
|
2858
|
+
// create config body
|
|
2859
|
+
let configBody: string = `
|
|
2860
|
+
{
|
|
2861
|
+
"workspaceId": "${config.workspaceId}",
|
|
2862
|
+
"name": "${config.name}",
|
|
2863
|
+
"description": "${config.description}",
|
|
2864
|
+
"isEnabled": ${config.isEnabled},
|
|
2865
|
+
"email": "${config.email}",
|
|
2866
|
+
"tenantId": "${config.tenantId}"
|
|
2867
|
+
}`;
|
|
2868
|
+
let options = { method: "POST", headers: headers, body: configBody };
|
|
2869
|
+
// make config endpoint call
|
|
2870
|
+
try {
|
|
2871
|
+
if (debug) debugger;
|
|
2872
|
+
console.log("Attempting POST to /audit-configuration: " + endpoint);
|
|
2873
|
+
let response = await fetch(endpoint, options);
|
|
2874
|
+
if (response.status === 200 && response.statusText === "OK") {
|
|
2875
|
+
let data = await response.json();
|
|
2876
|
+
config.id = data;
|
|
2877
|
+
console.log(
|
|
2878
|
+
`Successful AuditConfigID: ${data} from POST to /audit-configuration: ${configBody}`
|
|
2879
|
+
);
|
|
2880
|
+
return result;
|
|
2881
|
+
}
|
|
2882
|
+
else {
|
|
2883
|
+
result.error = await processErrors(response);
|
|
2884
|
+
console.log(`Failed POST to /audit-configuration: ${configBody}`);
|
|
2885
|
+
console.log(result.error);
|
|
2886
|
+
result.status = 500;
|
|
2887
|
+
result.result = false;
|
|
2888
|
+
return result;
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
catch (error: any) {
|
|
2892
|
+
result.status = 500;
|
|
2893
|
+
result.result = false;
|
|
2894
|
+
result.error = error.message;
|
|
2895
|
+
console.log(result.error);
|
|
2896
|
+
return result;
|
|
2897
|
+
}
|
|
2898
|
+
return result;
|
|
2899
|
+
}
|
|
2900
|
+
//auditConfigPost: get audit config from back end
|
|
2901
|
+
export async function auditConfigGet(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult> {
|
|
2902
|
+
instance = instance;
|
|
2903
|
+
user = user;
|
|
2904
|
+
debug = debug;
|
|
2905
|
+
let result: APIResult = new APIResult();
|
|
2906
|
+
return result;
|
|
2907
|
+
}
|
|
2808
2908
|
export async function auditEventsGet(instance: IPublicClientApplication, user: User, debug: boolean): Promise<APIResult> {
|
|
2809
2909
|
let result: APIResult = new APIResult();
|
|
2810
2910
|
// we need a valid user
|
|
Binary file
|
|
Binary file
|
|
Binary file
|