@evoke-platform/context 1.0.0-dev.99 → 1.0.0
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/README.md +84 -65
- package/dist/api/ApiBaseUrlProvider.js.map +1 -0
- package/dist/api/apiServices.js +3 -2
- package/dist/api/apiServices.js.map +1 -0
- package/dist/api/callback.js.map +1 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/paramsSerializer.d.ts +2 -0
- package/dist/api/paramsSerializer.js +16 -0
- package/dist/app/AppProvider.d.ts +10 -1
- package/dist/app/AppProvider.js +53 -6
- package/dist/app/AppProvider.js.map +1 -0
- package/dist/app/index.js.map +1 -0
- package/dist/authentication/AuthenticationContextProvider.js +4 -1
- package/dist/authentication/AuthenticationContextProvider.js.map +1 -0
- package/dist/authentication/index.js.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/notification/NotificationProvider.js +1 -1
- package/dist/objects/filters.js.map +1 -0
- package/dist/objects/index.js.map +1 -0
- package/dist/objects/objects.d.ts +40 -13
- package/dist/objects/objects.js.map +1 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/navigation.js.map +1 -0
- package/dist/router/routeParams.js.map +1 -0
- package/dist/signalr/SignalRConnectionProvider.js +40 -129
- package/dist/signalr/SignalRConnectionProvider.js.map +1 -0
- package/dist/signalr/index.js.map +1 -0
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ available and no further installation is necessary.
|
|
|
17
17
|
|
|
18
18
|
- [Working With Objects](#working-with-objects)
|
|
19
19
|
- [REST API Calls](#rest-api-calls)
|
|
20
|
-
- [
|
|
20
|
+
- [Notifications](#notifications)
|
|
21
21
|
|
|
22
22
|
### Working With Objects
|
|
23
23
|
|
|
@@ -160,7 +160,16 @@ Returns a function that can be used to navigate to another page. The returned fu
|
|
|
160
160
|
|
|
161
161
|
#### `useApp()`
|
|
162
162
|
|
|
163
|
-
Returns the currently loaded Evoke
|
|
163
|
+
Returns the currently loaded Evoke App as well as the following function.
|
|
164
|
+
|
|
165
|
+
- `findDefaultPageSlugFor`: An asynchronous function that takes an `objectId` as a parameter and returns the default page slug for that object, if no default page slug is found and the object is a subtype, the page slug of the first ancestor with a default page will be used. It returns `undefined` if no default page slug is found for any ancestor type.
|
|
166
|
+
|
|
167
|
+
Example usage:
|
|
168
|
+
|
|
169
|
+
```javascript
|
|
170
|
+
const { id: appId, findDefaultPageSlugFor } = useApp();
|
|
171
|
+
const defaultPageSlug = await findDefaultPageSlugFor(objectId);
|
|
172
|
+
```
|
|
164
173
|
|
|
165
174
|
### REST API calls
|
|
166
175
|
|
|
@@ -197,26 +206,27 @@ absolute URL.
|
|
|
197
206
|
|
|
198
207
|
##### `delete(url, options)`
|
|
199
208
|
|
|
200
|
-
###
|
|
201
|
-
|
|
202
|
-
Deprecated
|
|
209
|
+
### Notifications
|
|
203
210
|
|
|
204
|
-
- [
|
|
211
|
+
- [useNofitication](#usenotification)
|
|
205
212
|
- [documentChanges](#documentchangessubscribeobjectidinstanceid-data-documentchange)
|
|
206
213
|
- [instanceChanges](#instancechangessubscribeobjectid-instanceids-instancechange)
|
|
214
|
+
- [useSignalRConnection](#usesignalrconnection) (_Deprecated_)
|
|
215
|
+
- [documentChanges](#documentchangessubscribeobjectidinstanceid-data-documentchange) (_Deprecated_)
|
|
216
|
+
- [instanceChanges](#instancechangessubscribeobjectid-instanceids-instancechange) (_Deprecated_)
|
|
207
217
|
|
|
208
|
-
#### `
|
|
218
|
+
#### `useNofitication()`
|
|
209
219
|
|
|
210
|
-
Hook used to obtain an instanceChanges instance
|
|
220
|
+
Hook used to obtain an instanceChanges instance and a documentChanges instance.
|
|
211
221
|
|
|
212
|
-
##### `documentChanges.subscribe(
|
|
222
|
+
##### `documentChanges.subscribe(objectId, instanceId, (data: DocumentChange[]]) => {})`
|
|
213
223
|
|
|
214
|
-
Subscribe to the specified object instance
|
|
224
|
+
Subscribe to the specified object instance changes.
|
|
215
225
|
|
|
216
226
|
```javascript
|
|
217
|
-
const { documentChanges } =
|
|
227
|
+
const { documentChanges } = useNotification();
|
|
218
228
|
|
|
219
|
-
documentChanges.subscribe('myObjectId
|
|
229
|
+
documentChanges.subscribe('myObjectId', 'myInstanceId', (data) => {
|
|
220
230
|
console.log(data);
|
|
221
231
|
});
|
|
222
232
|
```
|
|
@@ -233,53 +243,61 @@ following data:
|
|
|
233
243
|
- `type`
|
|
234
244
|
- The type of update. Possible values are `BlobCreated`, `BlobDeleted`, and `BlobMetadataUpdated`.
|
|
235
245
|
|
|
236
|
-
##### `documentChanges.unsubscribe(
|
|
246
|
+
##### `documentChanges.unsubscribe(objectId, instanceId, (changes: DocumentChange[]) => {})`
|
|
237
247
|
|
|
238
|
-
Unsubscribe to the specified object instance
|
|
248
|
+
Unsubscribe to the specified object instance changes.
|
|
239
249
|
|
|
240
250
|
Callback function is optional.
|
|
251
|
+
If callback function is not defined, all subscriptions will be removed.
|
|
241
252
|
If callback function is defined, you must pass the exact same Function instance as was previously passed to `documentChanges.subscribe`.
|
|
242
253
|
Passing a different instance (even if the function body is the same) will not remove the subscription.
|
|
243
254
|
|
|
244
255
|
```javascript
|
|
245
|
-
const { documentChanges } =
|
|
256
|
+
const { documentChanges } = useNotification();
|
|
246
257
|
|
|
247
|
-
const callback = (
|
|
248
|
-
console.log(
|
|
258
|
+
const callback = (changes: DocumentChange[]) => {
|
|
259
|
+
console.log(changes);
|
|
249
260
|
};
|
|
250
261
|
|
|
251
|
-
documentChanges.subscribe('myObjectId
|
|
262
|
+
documentChanges.subscribe('myObjectId', 'myInstanceId', callback);
|
|
252
263
|
|
|
253
|
-
documentChanges.unsubscribe('myObjectId
|
|
264
|
+
documentChanges.unsubscribe('myObjectId', 'myInstanceId', callback);
|
|
254
265
|
```
|
|
255
266
|
|
|
256
|
-
##### `instanceChanges.subscribe(
|
|
267
|
+
##### `instanceChanges.subscribe(objectId, (changes: InstanceChange[]) => {})`
|
|
257
268
|
|
|
258
|
-
Subscribe to the specified object
|
|
269
|
+
Subscribe to the specified object changes.
|
|
259
270
|
|
|
260
271
|
```javascript
|
|
261
|
-
const { instanceChanges } =
|
|
272
|
+
const { instanceChanges } = useNotification();
|
|
262
273
|
|
|
263
|
-
instanceChanges.subscribe('myObjectId', (
|
|
264
|
-
console.log(
|
|
274
|
+
instanceChanges.subscribe('myObjectId', (changes) => {
|
|
275
|
+
console.log(changes);
|
|
265
276
|
});
|
|
266
277
|
```
|
|
267
278
|
|
|
268
|
-
The data provided to the callback will be an array of
|
|
279
|
+
The data provided to the callback will be an array of `InstanceChange` which contains the
|
|
280
|
+
following data:
|
|
269
281
|
|
|
270
|
-
|
|
282
|
+
- `objectId`
|
|
283
|
+
- Object describing the instance associated with the updated document.
|
|
284
|
+
- `instanceId`
|
|
285
|
+
- Instance that the updated document is associated with.
|
|
271
286
|
|
|
272
|
-
|
|
287
|
+
##### `instanceChanges.unsubscribe(objectId, (changes: InstanceChange[]) => {})`
|
|
288
|
+
|
|
289
|
+
Unsubscribe to the specified object changes.
|
|
273
290
|
|
|
274
291
|
Callback function is optional.
|
|
292
|
+
If callback function is not defined, all subscriptions will be removed.
|
|
275
293
|
If callback function is defined, you must pass the exact same Function instance as was previously passed to `instanceChanges.subscribe`.
|
|
276
294
|
Passing a different instance (even if the function body is the same) will not remove the subscription.
|
|
277
295
|
|
|
278
296
|
```javascript
|
|
279
|
-
const { instanceChanges } =
|
|
297
|
+
const { instanceChanges } = useNotification();
|
|
280
298
|
|
|
281
|
-
const callback = (
|
|
282
|
-
console.log(
|
|
299
|
+
const callback = (changes: InstanceChange[]) => {
|
|
300
|
+
console.log(changes);
|
|
283
301
|
};
|
|
284
302
|
|
|
285
303
|
instanceChanges.subscribe('myObjectId', callback);
|
|
@@ -287,24 +305,24 @@ instanceChanges.subscribe('myObjectId', callback);
|
|
|
287
305
|
instanceChanges.unsubscribe('myObjectId', callback);
|
|
288
306
|
```
|
|
289
307
|
|
|
290
|
-
|
|
308
|
+
#### `useSignalRConnection()`
|
|
291
309
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
- [instanceChanges](#instancechangessubscribeobjectid-instanceids-instancechange)
|
|
310
|
+
> **Deprecated**
|
|
311
|
+
> This has been deprecated in favor of [useNotification](#usenofitication).
|
|
295
312
|
|
|
296
|
-
|
|
313
|
+
Hook used to obtain an instanceChanges instance of `SignalRConnection` and a documentChanges instance of `SignalRConnection`.
|
|
297
314
|
|
|
298
|
-
|
|
315
|
+
##### `documentChanges.subscribe('{objectId}/{instanceId}', (data: DocumentChange[]]) => {})`
|
|
299
316
|
|
|
300
|
-
|
|
317
|
+
> **Deprecated**
|
|
318
|
+
> This has been deprecated in favor of [useNotification](#usenofitication).
|
|
301
319
|
|
|
302
|
-
Subscribe to the specified object instance changes.
|
|
320
|
+
Subscribe to the specified object instance document changes.
|
|
303
321
|
|
|
304
322
|
```javascript
|
|
305
|
-
const { documentChanges } =
|
|
323
|
+
const { documentChanges } = useSignalRConnection();
|
|
306
324
|
|
|
307
|
-
documentChanges.subscribe('myObjectId
|
|
325
|
+
documentChanges.subscribe('myObjectId/myInstanceId', (data) => {
|
|
308
326
|
console.log(data);
|
|
309
327
|
});
|
|
310
328
|
```
|
|
@@ -321,61 +339,62 @@ following data:
|
|
|
321
339
|
- `type`
|
|
322
340
|
- The type of update. Possible values are `BlobCreated`, `BlobDeleted`, and `BlobMetadataUpdated`.
|
|
323
341
|
|
|
324
|
-
##### `documentChanges.unsubscribe(objectId
|
|
342
|
+
##### `documentChanges.unsubscribe('{objectId}/{instanceId}', (data: DocumentChange[]) => {})`
|
|
325
343
|
|
|
326
|
-
|
|
344
|
+
> **Deprecated**
|
|
345
|
+
> This has been deprecated in favor of [useNotification](#usenofitication).
|
|
346
|
+
|
|
347
|
+
Unsubscribe to the specified object instance document changes.
|
|
327
348
|
|
|
328
349
|
Callback function is optional.
|
|
329
|
-
If callback function is not defined, all subscriptions will be removed.
|
|
330
350
|
If callback function is defined, you must pass the exact same Function instance as was previously passed to `documentChanges.subscribe`.
|
|
331
351
|
Passing a different instance (even if the function body is the same) will not remove the subscription.
|
|
332
352
|
|
|
333
353
|
```javascript
|
|
334
|
-
const { documentChanges } =
|
|
354
|
+
const { documentChanges } = useSignalRConnection();
|
|
335
355
|
|
|
336
|
-
const callback = (
|
|
337
|
-
console.log(
|
|
356
|
+
const callback = (data: DocumentChange[]) => {
|
|
357
|
+
console.log(data);
|
|
338
358
|
};
|
|
339
359
|
|
|
340
|
-
documentChanges.subscribe('myObjectId
|
|
360
|
+
documentChanges.subscribe('myObjectId/myInstanceId', callback);
|
|
341
361
|
|
|
342
|
-
documentChanges.unsubscribe('myObjectId
|
|
362
|
+
documentChanges.unsubscribe('myObjectId/myInstanceId', callback);
|
|
343
363
|
```
|
|
344
364
|
|
|
345
|
-
##### `instanceChanges.subscribe(objectId, (
|
|
365
|
+
##### `instanceChanges.subscribe('{objectId}', (instanceIds: InstanceChange[]) => {})`
|
|
346
366
|
|
|
347
|
-
|
|
367
|
+
> **Deprecated**
|
|
368
|
+
> This has been deprecated in favor of [useNotification](#usenofitication).
|
|
369
|
+
|
|
370
|
+
Subscribe to the specified object instance changes.
|
|
348
371
|
|
|
349
372
|
```javascript
|
|
350
|
-
const { instanceChanges } =
|
|
373
|
+
const { instanceChanges } = useSignalRConnection();
|
|
351
374
|
|
|
352
|
-
instanceChanges.subscribe('myObjectId', (
|
|
353
|
-
console.log(
|
|
375
|
+
instanceChanges.subscribe('myObjectId', (instanceIds) => {
|
|
376
|
+
console.log(instanceIds);
|
|
354
377
|
});
|
|
355
378
|
```
|
|
356
379
|
|
|
357
|
-
The data provided to the callback will be an array of
|
|
358
|
-
following data:
|
|
380
|
+
The data provided to the callback will be an array of instance IDs that were updated.
|
|
359
381
|
|
|
360
|
-
|
|
361
|
-
- Object describing the instance associated with the updated document.
|
|
362
|
-
- `instanceId`
|
|
363
|
-
- Instance that the updated document is associated with.
|
|
382
|
+
##### `instanceChanges.unsubscribe('{objectId}', (instanceIds: InstanceChange[]) => {})`
|
|
364
383
|
|
|
365
|
-
|
|
384
|
+
> **Deprecated**
|
|
385
|
+
> This has been deprecated in favor of [useNotification](#usenofitication).
|
|
366
386
|
|
|
367
|
-
Unsubscribe to the specified object changes.
|
|
387
|
+
Unsubscribe to the specified object instance changes.
|
|
368
388
|
|
|
369
389
|
Callback function is optional.
|
|
370
|
-
If callback function is not defined, all subscriptions will be removed.
|
|
371
390
|
If callback function is defined, you must pass the exact same Function instance as was previously passed to `instanceChanges.subscribe`.
|
|
372
391
|
Passing a different instance (even if the function body is the same) will not remove the subscription.
|
|
373
392
|
|
|
374
393
|
```javascript
|
|
375
|
-
const { instanceChanges } =
|
|
394
|
+
const { instanceChanges } = useSignalRConnection();
|
|
376
395
|
|
|
377
|
-
const callback = (
|
|
378
|
-
console.log(
|
|
396
|
+
const callback = (instanceIds: InstanceChange[]) => {
|
|
397
|
+
console.log(instanceIds);
|
|
379
398
|
};
|
|
380
399
|
|
|
381
400
|
instanceChanges.subscribe('myObjectId', callback);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiBaseUrlProvider.js","sourceRoot":"","sources":["../../src/api/ApiBaseUrlProvider.tsx"],"names":[],"mappings":";;AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,MAAA,UAAU,CAAC,QAAQ,0CAAE,MAAM,MAAM,CAAC,CAAC;AAE9E,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAOpD,SAAS,kBAAkB,CAAC,KAA8B;IACtD,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEhC,OAAO,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,YAAG,QAAQ,GAA8B,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,aAAa;IACzB,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACzC,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/api/apiServices.js
CHANGED
|
@@ -11,9 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
import axios from 'axios';
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
14
15
|
import { useAuthenticationContext } from '../authentication/AuthenticationContextProvider.js';
|
|
15
16
|
import { useApiBaseUrl } from './ApiBaseUrlProvider.js';
|
|
16
|
-
import {
|
|
17
|
+
import { paramsSerializer } from './paramsSerializer.js';
|
|
17
18
|
const sessionId = uuidv4();
|
|
18
19
|
export class ApiServices {
|
|
19
20
|
constructor(api, authContext) {
|
|
@@ -143,6 +144,6 @@ export class ApiServices {
|
|
|
143
144
|
export function useApiServices() {
|
|
144
145
|
const authContext = useAuthenticationContext();
|
|
145
146
|
const baseURL = useApiBaseUrl();
|
|
146
|
-
const apiServices = useMemo(() => new ApiServices(axios.create({ baseURL }), authContext), [authContext, baseURL]);
|
|
147
|
+
const apiServices = useMemo(() => new ApiServices(axios.create({ baseURL, paramsSerializer }), authContext), [authContext, baseURL]);
|
|
147
148
|
return apiServices;
|
|
148
149
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiServices.js","sourceRoot":"","sources":["../../src/api/apiServices.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;;;;;;;;;;AAE/C,OAAO,KAA2D,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAyB,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD,MAAM,OAAO,WAAW;IACpB,YAAoB,GAAkB,EAAE,WAAmC;QAAvD,QAAG,GAAH,GAAG,CAAe;QAClC,IA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GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnH,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callback.js","sourceRoot":"","sources":["../../src/api/callback.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAI/C,MAAM,UAAU,QAAQ,CAAI,SAA+B,EAAE,OAA8B;IACvF,OAAO,CAAC,GAAkB,EAAE,MAAU,EAAE,EAAE;QACtC,IAAI,GAAG,EAAE;YACL,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,GAAG,CAAC,CAAC;SAClB;aAAM;YACH,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,MAAW,CAAC,CAAC;SAC5B;IACL,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function paramsSerializer(params, options) {
|
|
2
|
+
const searchParams = new URLSearchParams();
|
|
3
|
+
for (const [key, value] of Object.entries(params)) {
|
|
4
|
+
if (!validateParamKey(key) || !validateParamValue(value)) {
|
|
5
|
+
continue;
|
|
6
|
+
}
|
|
7
|
+
searchParams.append(key, typeof value !== 'string' ? JSON.stringify(value) : value);
|
|
8
|
+
}
|
|
9
|
+
return searchParams.toString();
|
|
10
|
+
}
|
|
11
|
+
function validateParamKey(item) {
|
|
12
|
+
return item.length;
|
|
13
|
+
}
|
|
14
|
+
function validateParamValue(item) {
|
|
15
|
+
return item !== undefined;
|
|
16
|
+
}
|
|
@@ -38,10 +38,19 @@ export type NavigationItem = {
|
|
|
38
38
|
pageId: string;
|
|
39
39
|
pageName: string;
|
|
40
40
|
};
|
|
41
|
+
export type AppExtended = App & {
|
|
42
|
+
/**
|
|
43
|
+
* Looks up the default page slug for a given object or its nearest type ancestor.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} objectId - The ID of the object to start the search from.
|
|
46
|
+
* @returns {Promise<string | undefined>} The default page slug, or `undefined` if no default page is found.
|
|
47
|
+
*/
|
|
48
|
+
findDefaultPageSlugFor: (objectId: string) => Promise<string | undefined>;
|
|
49
|
+
};
|
|
41
50
|
export type AppProviderProps = {
|
|
42
51
|
app: App;
|
|
43
52
|
children?: ReactNode;
|
|
44
53
|
};
|
|
45
54
|
declare function AppProvider(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
export declare function useApp():
|
|
55
|
+
export declare function useApp(): AppExtended;
|
|
47
56
|
export default AppProvider;
|
package/dist/app/AppProvider.js
CHANGED
|
@@ -1,13 +1,60 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
import { createContext, useCallback, useContext } from 'react';
|
|
12
|
+
import { useApiServices } from '../api/index.js';
|
|
13
|
+
const defaultApp = {
|
|
14
|
+
id: '_evoke',
|
|
15
|
+
name: 'Evoke Platform',
|
|
16
|
+
type: 'public',
|
|
17
|
+
};
|
|
18
|
+
const defaultAppExtended = Object.assign(Object.assign({}, defaultApp), { findDefaultPageSlugFor: (objectId) => Promise.resolve(undefined) });
|
|
19
|
+
const AppContext = createContext(defaultAppExtended);
|
|
7
20
|
AppContext.displayName = 'AppContext';
|
|
8
21
|
function AppProvider(props) {
|
|
9
22
|
const { app, children } = props;
|
|
10
|
-
|
|
23
|
+
const apiServices = useApiServices();
|
|
24
|
+
const appExtended = Object.assign(Object.assign({}, app), { findDefaultPageSlugFor: useCallback((objectId) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
let defaultPageId;
|
|
27
|
+
let currentObjectId = objectId;
|
|
28
|
+
while (currentObjectId !== undefined) {
|
|
29
|
+
if ((_a = app.defaultPages) === null || _a === void 0 ? void 0 : _a[currentObjectId]) {
|
|
30
|
+
defaultPageId = app.defaultPages[currentObjectId];
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
const effectiveObject = yield apiServices.get(`data/objects/${currentObjectId}/effective`, {
|
|
34
|
+
params: { filter: { fields: ['baseObject'] } },
|
|
35
|
+
});
|
|
36
|
+
currentObjectId = (_c = (_b = effectiveObject === null || effectiveObject === void 0 ? void 0 : effectiveObject.baseObject) === null || _b === void 0 ? void 0 : _b.objectId) !== null && _c !== void 0 ? _c : undefined;
|
|
37
|
+
}
|
|
38
|
+
let defaultPage;
|
|
39
|
+
if (defaultPageId) {
|
|
40
|
+
const pageId = defaultPageId.includes('/')
|
|
41
|
+
? defaultPageId.split('/').slice(2).join('/')
|
|
42
|
+
: defaultPageId;
|
|
43
|
+
try {
|
|
44
|
+
defaultPage = yield apiServices.get(`/webContent/apps/${app.id}/pages/${encodeURIComponent(encodeURIComponent(pageId))}`);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const err = error;
|
|
48
|
+
if (((_d = err.response) === null || _d === void 0 ? void 0 : _d.status) === 404) {
|
|
49
|
+
defaultPage = undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (defaultPage === null || defaultPage === void 0 ? void 0 : defaultPage.slug) {
|
|
54
|
+
return `/${app.id}/${defaultPage.slug}`;
|
|
55
|
+
}
|
|
56
|
+
}), [app]) });
|
|
57
|
+
return _jsx(AppContext.Provider, { value: appExtended, children: children });
|
|
11
58
|
}
|
|
12
59
|
export function useApp() {
|
|
13
60
|
return useContext(AppContext);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppProvider.js","sourceRoot":"","sources":["../../src/app/AppProvider.tsx"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAiD7D,MAAM,UAAU,GAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACjF,MAAM,UAAU,GAAG,aAAa,CAAM,UAAU,CAAC,CAAC;AAElD,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAOtC,SAAS,WAAW,CAAC,KAAuB;IACxC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEhC,OAAO,KAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,YAAG,QAAQ,GAAuB,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,MAAM;IAClB,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -31,7 +31,10 @@ function AuthenticationContextProvider(props) {
|
|
|
31
31
|
? {
|
|
32
32
|
account: { id: account.localAccountId, name: account.name },
|
|
33
33
|
logout: () => {
|
|
34
|
-
msal.instance.logoutRedirect({
|
|
34
|
+
msal.instance.logoutRedirect({
|
|
35
|
+
account,
|
|
36
|
+
postLogoutRedirectUri: `/logout?p=${encodeURIComponent(window.location.pathname + window.location.search)}`,
|
|
37
|
+
});
|
|
35
38
|
},
|
|
36
39
|
getAccessToken,
|
|
37
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationContextProvider.js","sourceRoot":"","sources":["../../src/authentication/AuthenticationContextProvider.tsx"],"names":[],"mappings":";;;;;;;;;;AAKA,OAAO,EAAa,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAanF,MAAM,OAAO,GAAG,aAAa,CAAoC,SAAS,CAAC,CAAC;AAE5E,OAAO,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAU9C,SAAS,6BAA6B,CAAC,KAAyC;;IAC5E,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE9C,MAAM,OAAO,GAA4B,MAAA,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,mCAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/G,MAAM,cAAc,GAAG,WAAW,CAC9B;;YACI,IAAI;gBACA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,kBAAkB,iCAAM,WAAW,KAAE,OAAO,IAAG,CAAC;gBAErF,OAAO,QAAQ,CAAC,WAAW,CAAC;aAC/B;YAAC,OAAO,GAAY,EAAE;gBACnB,MAAM,IAAI,CAAC,QAAQ,CAAC,oBAAoB,iCAAM,WAAW,KAAE,OAAO,IAAG,CAAC;gBAEtE,OAAO,EAAE,CAAC;aACb;QACL,CAAC;KAAA,EACD,CAAC,IAAI,EAAE,WAAW,CAAC,CACtB,CAAC;IAEF,MAAM,OAAO,GAAsC,OAAO,CACtD,GAAG,EAAE,CACD,OAAO;QACH,CAAC,CAAC;YACI,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;YAC3D,MAAM,EAAE,GAAG,EAAE;gBACT,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9C,CAAC;YACD,cAAc;SACjB;QACH,CAAC,CAAC,SAAS,EACnB,CAAC,OAAO,EAAE,IAAI,EAAE,cAAc,CAAC,CAClC,CAAC;IAEF,OAAO,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAAG,QAAQ,GAAoB,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,wBAAwB;IACpC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,eAAe,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { HubConnectionBuilder, LogLevel, } from '@microsoft/signalr
|
|
11
|
+
import { HubConnectionBuilder, LogLevel, } from '@microsoft/signalr';
|
|
12
12
|
import { createContext, useContext, useEffect, useState } from 'react';
|
|
13
13
|
import { useApiServices } from '../api/index.js';
|
|
14
14
|
export const NotificationContext = createContext({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../src/objects/filters.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/objects/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -4,12 +4,28 @@ export type BaseObjReference = {
|
|
|
4
4
|
objectId: string;
|
|
5
5
|
discriminatorValue: unknown;
|
|
6
6
|
};
|
|
7
|
+
export type ViewLayoutEntityReference = {
|
|
8
|
+
id: string;
|
|
9
|
+
objectId: string;
|
|
10
|
+
};
|
|
11
|
+
type ViewLayoutEntity = {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
objectId: string;
|
|
15
|
+
};
|
|
16
|
+
export type TableViewLayoutEntity = ViewLayoutEntity & TableViewLayout;
|
|
17
|
+
export type DropdownViewLayoutEntity = ViewLayoutEntity & DropdownViewLayout;
|
|
7
18
|
export type ViewLayout = {
|
|
8
19
|
table?: TableViewLayout;
|
|
9
20
|
dropdown?: DropdownViewLayout;
|
|
10
21
|
};
|
|
22
|
+
export type DropdownViewLayoutSort = {
|
|
23
|
+
propertyId: string;
|
|
24
|
+
direction?: 'asc' | 'desc';
|
|
25
|
+
};
|
|
11
26
|
export type DropdownViewLayout = {
|
|
12
27
|
secondaryTextExpression: string;
|
|
28
|
+
sort?: DropdownViewLayoutSort;
|
|
13
29
|
};
|
|
14
30
|
export type TableViewLayout = {
|
|
15
31
|
properties: PropertyReference[];
|
|
@@ -35,7 +51,7 @@ export type Obj = {
|
|
|
35
51
|
export type ObjWithRoot = Obj & {
|
|
36
52
|
rootObjectId: string;
|
|
37
53
|
};
|
|
38
|
-
export type PropertyType = 'address' | 'array' | 'boolean' | 'collection' | 'date' | 'date-time' | 'image' | 'integer' | 'number' | 'object' | 'richText' | 'string' | 'time' | 'user';
|
|
54
|
+
export type PropertyType = 'address' | 'array' | 'boolean' | 'collection' | 'date' | 'date-time' | 'document' | 'image' | 'integer' | 'number' | 'object' | 'richText' | 'string' | 'time' | 'user';
|
|
39
55
|
export type NumericValidation = {
|
|
40
56
|
errorMessage?: string;
|
|
41
57
|
minimum?: number;
|
|
@@ -51,12 +67,14 @@ export type CriteriaValidation = {
|
|
|
51
67
|
};
|
|
52
68
|
export type StringValidation = {
|
|
53
69
|
operator: 'any' | 'all';
|
|
54
|
-
rules?:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
rules?: RegexValidation[];
|
|
71
|
+
};
|
|
72
|
+
export type DocumentValidation = {
|
|
73
|
+
errorMessage?: string;
|
|
74
|
+
maxDocuments?: number;
|
|
75
|
+
minDocuments?: number;
|
|
58
76
|
};
|
|
59
|
-
export type PropertyValidation = StringValidation | NumericValidation | DateValidation | CriteriaValidation;
|
|
77
|
+
export type PropertyValidation = StringValidation | NumericValidation | DateValidation | CriteriaValidation | DocumentValidation;
|
|
60
78
|
export type Property = {
|
|
61
79
|
id: string;
|
|
62
80
|
name: string;
|
|
@@ -109,7 +127,7 @@ export type ObjectInstance = {
|
|
|
109
127
|
};
|
|
110
128
|
export type RegexValidation = {
|
|
111
129
|
regex: string;
|
|
112
|
-
errorMessage
|
|
130
|
+
errorMessage?: string;
|
|
113
131
|
};
|
|
114
132
|
export type SelectOption = {
|
|
115
133
|
label: string;
|
|
@@ -144,12 +162,18 @@ export type DisplayConfiguration = {
|
|
|
144
162
|
mode?: 'default' | 'existingOnly';
|
|
145
163
|
relatedObjectDisplay?: 'dropdown' | 'dialogBox';
|
|
146
164
|
visibility?: VisibilityConfiguration | string;
|
|
165
|
+
viewLayout?: ViewLayoutEntityReference;
|
|
166
|
+
choicesDisplay?: {
|
|
167
|
+
type: 'dropdown' | 'radioButton';
|
|
168
|
+
sortBy?: 'ASC' | 'DESC' | 'NONE';
|
|
169
|
+
};
|
|
147
170
|
};
|
|
148
171
|
export type InputParameterReference = {
|
|
149
172
|
type: 'input';
|
|
150
173
|
parameterId: string;
|
|
151
174
|
display?: DisplayConfiguration;
|
|
152
175
|
enumWithLabels?: SelectOption[];
|
|
176
|
+
documentMetadata?: Record<string, string>;
|
|
153
177
|
};
|
|
154
178
|
export type Content = {
|
|
155
179
|
type: 'content';
|
|
@@ -178,7 +202,7 @@ export type FormEntry = InputParameterReference | Columns | Sections | Content;
|
|
|
178
202
|
export type Form = {
|
|
179
203
|
entries?: FormEntry[];
|
|
180
204
|
};
|
|
181
|
-
export type ActionInputType = 'button' | 'Section' | 'Columns' | 'Content' | 'Select' | 'TextField' | 'DateTime' | 'RepeatableField' | 'MultiSelect' | 'Decimal' | 'RichText' | 'Date' | 'Integer' | 'Image' | 'Object' | 'Time' | 'User';
|
|
205
|
+
export type ActionInputType = 'button' | 'Section' | 'Columns' | 'Content' | 'Select' | 'TextField' | 'DateTime' | 'Document' | 'RepeatableField' | 'ManyToManyRepeatableField' | 'MultiSelect' | 'Decimal' | 'RichText' | 'Date' | 'Integer' | 'Image' | 'Object' | 'Time' | 'User';
|
|
182
206
|
/**
|
|
183
207
|
* Represents an object action inputProperty object.
|
|
184
208
|
*/
|
|
@@ -187,7 +211,7 @@ export type ActionInput = {
|
|
|
187
211
|
label?: string;
|
|
188
212
|
type?: ActionInputType;
|
|
189
213
|
key?: string;
|
|
190
|
-
initialValue?: string | number | SelectOption[] | SelectOption;
|
|
214
|
+
initialValue?: string | string[] | number | RelatedObjectDefaultValue | SelectOption[] | SelectOption;
|
|
191
215
|
defaultToCurrentDate?: boolean;
|
|
192
216
|
defaultToCurrentTime?: boolean;
|
|
193
217
|
defaultValueCriteria?: object;
|
|
@@ -210,7 +234,7 @@ export type ActionInput = {
|
|
|
210
234
|
inputMaskPlaceholderChar?: string;
|
|
211
235
|
tableView?: boolean;
|
|
212
236
|
mode?: 'default' | 'existingOnly';
|
|
213
|
-
displayOption?: 'dropdown' | 'dialogBox';
|
|
237
|
+
displayOption?: 'dropdown' | 'dialogBox' | 'radioButton';
|
|
214
238
|
rows?: number;
|
|
215
239
|
showCharCount?: boolean;
|
|
216
240
|
readOnly?: boolean;
|
|
@@ -224,9 +248,9 @@ export type ActionInput = {
|
|
|
224
248
|
when?: string;
|
|
225
249
|
eq?: string | number | boolean;
|
|
226
250
|
};
|
|
227
|
-
property?:
|
|
228
|
-
|
|
229
|
-
|
|
251
|
+
property?: InputParameter;
|
|
252
|
+
viewLayout?: ViewLayoutEntityReference;
|
|
253
|
+
documentMetadata?: Record<string, string>;
|
|
230
254
|
validate?: {
|
|
231
255
|
required?: boolean;
|
|
232
256
|
criteria?: object;
|
|
@@ -240,6 +264,8 @@ export type ActionInput = {
|
|
|
240
264
|
maxTime?: string;
|
|
241
265
|
min?: number;
|
|
242
266
|
max?: number;
|
|
267
|
+
minDocuments?: number;
|
|
268
|
+
maxDocuments?: number;
|
|
243
269
|
customMessage?: string;
|
|
244
270
|
};
|
|
245
271
|
/**
|
|
@@ -306,3 +332,4 @@ export declare class ObjectStore {
|
|
|
306
332
|
instanceAction<T extends ObjectInstance = ObjectInstance>(id: string, input: ActionRequest, cb: Callback<T>): void;
|
|
307
333
|
}
|
|
308
334
|
export declare function useObject(objectId: string): ObjectStore;
|
|
335
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../../src/objects/objects.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAG/C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAyB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAiIxE,MAAM,OAAO,WAAW;IACpB,YAAoB,QAAqB,EAAU,QAAgB;QAA/C,aAAQ,GAAR,QAAQ,CAAa;QAAU,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAMvE,GAAG,CAAC,iBAAiD,EAAE,EAAkB;QACrE,IAAI,OAAkC,CAAC;QAEvC,IAAI,EAAE,EAAE;YACJ,OAAO,GAAG,iBAAkC,CAAC;SAChD;aAAM,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;YAChD,EAAE,GAAG,iBAAiB,CAAC;SAC1B;aAAM;YACH,OAAO,GAAG,iBAAiB,CAAC;SAC/B;QAED,MAAM,MAAM,GAAuB;YAC/B,MAAM,EAAE;gBACJ,gBAAgB,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS;aACvC;SACJ,CAAC;QAEF,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;SACrE;QAED,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAMD,aAAa,CAA2B,gBAAyC,EAAE,EAAkB;QACjG,IAAI,MAA0B,CAAC;QAE/B,IAAI,EAAE,EAAE;YACJ,MAAM,GAAG,gBAA0B,CAAC;SACvC;aAAM,IAAI,O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KAAK,CAAC,CAAC;SACzG;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,QAAQ,oBAAoB,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACrF,CAAC;IAKD,cAAc,CAA2B,EAAU,EAAE,KAAoB,EAAE,EAAgB;QACvF,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAmB,gBAAgB,IAAI,CAAC,QAAQ,cAAc,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;SAC/G;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,QAAQ,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3F,CAAC;CACJ;AAED,MAAM,UAAU,SAAS,CAAC,QAAgB;IACtC,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAElC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/router/navigation.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIlF,MAAM,UAAU,WAAW;IACvB,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IAErC,OAAO,WAAW,CACd,CAAC,IAAY,EAAE,MAA+B,EAAE,EAAE;QAC9C,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,CAAC,EACD,CAAC,QAAQ,CAAC,CACb,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routeParams.js","sourceRoot":"","sources":["../../src/router/routeParams.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,UAAU,aAAa;IACzB,OAAO,SAAS,EAAE,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,OAAO,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,142 +1,53 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
2
|
// Copyright (c) 2023 System Automation Corporation.
|
|
12
3
|
// This file is licensed under the MIT License.
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { useApiServices } from '../api/index.js';
|
|
4
|
+
import { createContext, useContext, useState } from 'react';
|
|
5
|
+
import { useNotification } from '../notification/index.js';
|
|
16
6
|
export const SignalRConnectionContext = createContext({});
|
|
17
7
|
SignalRConnectionContext.displayName = 'SignalRConnectionContext';
|
|
18
8
|
function SignalRConnectionProvider({ children }) {
|
|
19
|
-
const
|
|
20
|
-
const [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return api.post(`/signalr/hubs/${hubName}/negotiate`);
|
|
25
|
-
};
|
|
26
|
-
const getConnection = () => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
try {
|
|
28
|
-
const instancesConnectionInfo = yield getConnectionInfo('instanceChanges');
|
|
29
|
-
const documentsConnectionInfo = yield getConnectionInfo('documentChanges');
|
|
30
|
-
if (instancesConnectionInfo) {
|
|
31
|
-
const options = {
|
|
32
|
-
accessTokenFactory: () => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
if (instancesConnectionInfo.accessToken) {
|
|
34
|
-
return instancesConnectionInfo.accessToken;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return getConnection();
|
|
38
|
-
}
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
const connection = new HubConnectionBuilder()
|
|
42
|
-
.withUrl(instancesConnectionInfo.url, options)
|
|
43
|
-
.configureLogging(LogLevel.Error)
|
|
44
|
-
.withAutomaticReconnect()
|
|
45
|
-
.build();
|
|
46
|
-
setInstancesSignalRConnection(connection);
|
|
47
|
-
}
|
|
48
|
-
if (documentsConnectionInfo) {
|
|
49
|
-
const options = {
|
|
50
|
-
accessTokenFactory: () => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
if (documentsConnectionInfo.accessToken) {
|
|
52
|
-
return documentsConnectionInfo.accessToken;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
return getConnection();
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
};
|
|
59
|
-
const connection = new HubConnectionBuilder()
|
|
60
|
-
.withUrl(documentsConnectionInfo.url, options)
|
|
61
|
-
.configureLogging(LogLevel.Error)
|
|
62
|
-
.withAutomaticReconnect()
|
|
63
|
-
.build();
|
|
64
|
-
setDocumentsSignalRConnection(connection);
|
|
65
|
-
}
|
|
66
|
-
// eslint-disable-next-line no-empty
|
|
67
|
-
}
|
|
68
|
-
catch (err) { }
|
|
69
|
-
});
|
|
70
|
-
getConnection();
|
|
71
|
-
}, []);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
let documentsConnectionStopped = false;
|
|
74
|
-
const startConnection = (connection, numOfAttempts) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
yield connection.start().catch((error) => {
|
|
76
|
-
if (numOfAttempts < 4 && !documentsConnectionStopped) {
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
if (!documentsConnectionStopped) {
|
|
79
|
-
startConnection(connection, numOfAttempts + 1);
|
|
80
|
-
}
|
|
81
|
-
}, 2000);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
console.warn(`Cannot start connection to SignalR due to error "${error}"`);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
if (documentsSignalRConnection) {
|
|
89
|
-
startConnection(documentsSignalRConnection, 0);
|
|
90
|
-
}
|
|
91
|
-
return () => {
|
|
92
|
-
documentsSignalRConnection === null || documentsSignalRConnection === void 0 ? void 0 : documentsSignalRConnection.stop();
|
|
93
|
-
documentsConnectionStopped = true;
|
|
94
|
-
};
|
|
95
|
-
}, [documentsSignalRConnection]);
|
|
96
|
-
useEffect(() => {
|
|
97
|
-
let instancesConnectionStopped = false;
|
|
98
|
-
const startConnection = (connection, numOfAttempts) => __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
yield connection.start().catch((error) => {
|
|
100
|
-
if (numOfAttempts < 4 && !instancesConnectionStopped) {
|
|
101
|
-
setTimeout(() => {
|
|
102
|
-
if (!instancesConnectionStopped) {
|
|
103
|
-
startConnection(connection, numOfAttempts + 1);
|
|
104
|
-
}
|
|
105
|
-
}, 2000);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
console.warn(`Cannot start connection to SignalR due to error "${error}"`);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
if (instancesSignalRConnection) {
|
|
113
|
-
startConnection(instancesSignalRConnection, 0);
|
|
114
|
-
}
|
|
115
|
-
return () => {
|
|
116
|
-
instancesSignalRConnection === null || instancesSignalRConnection === void 0 ? void 0 : instancesSignalRConnection.stop();
|
|
117
|
-
instancesConnectionStopped = true;
|
|
118
|
-
};
|
|
119
|
-
}, [instancesSignalRConnection]);
|
|
9
|
+
const notifications = useNotification();
|
|
10
|
+
const [instanceCallbacks] = useState(
|
|
11
|
+
// Map provided callbacks to our wrappers that are sent to the underlying
|
|
12
|
+
// notification provider.
|
|
13
|
+
new WeakMap());
|
|
120
14
|
return (_jsx(SignalRConnectionContext.Provider, { value: {
|
|
121
|
-
documentChanges:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
15
|
+
documentChanges: {
|
|
16
|
+
subscribe: (topicName, callback) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const [objectId, instanceId] = topicName.split('/');
|
|
19
|
+
(_a = notifications.documentChanges) === null || _a === void 0 ? void 0 : _a.subscribe(objectId, instanceId, callback);
|
|
20
|
+
},
|
|
21
|
+
unsubscribe: (topicName, callback) => {
|
|
22
|
+
var _a;
|
|
23
|
+
const [objectId, instanceId] = topicName.split('/');
|
|
24
|
+
(_a = notifications.documentChanges) === null || _a === void 0 ? void 0 : _a.unsubscribe(objectId, instanceId, callback);
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
instanceChanges: {
|
|
28
|
+
subscribe: (objectId, callback) => {
|
|
29
|
+
var _a;
|
|
30
|
+
// If there is already a wrapper for the given callback, we must reuse the
|
|
31
|
+
// same one. Otherwise, if we overwrite the entry in our cache, we'll lose
|
|
32
|
+
// track of the original wrapper.
|
|
33
|
+
let wrapper = instanceCallbacks.get(callback);
|
|
34
|
+
if (!wrapper) {
|
|
35
|
+
wrapper = (...changes) => {
|
|
36
|
+
callback(...changes.map((change) => change.instanceId));
|
|
37
|
+
};
|
|
38
|
+
instanceCallbacks.set(callback, wrapper);
|
|
39
|
+
}
|
|
40
|
+
(_a = notifications.instanceChanges) === null || _a === void 0 ? void 0 : _a.subscribe(objectId, wrapper);
|
|
41
|
+
},
|
|
42
|
+
unsubscribe: (objectId, callback) => {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = notifications.instanceChanges) === null || _a === void 0 ? void 0 : _a.unsubscribe(objectId, callback && instanceCallbacks.get(callback));
|
|
45
|
+
},
|
|
46
|
+
},
|
|
137
47
|
}, children: children }));
|
|
138
48
|
}
|
|
139
49
|
export function useSignalRConnection() {
|
|
50
|
+
console.warn('Use of useSignalRConnection is deprecated. Use useNotification instead.');
|
|
140
51
|
return useContext(SignalRConnectionContext);
|
|
141
52
|
}
|
|
142
53
|
export default SignalRConnectionProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignalRConnectionProvider.js","sourceRoot":"","sources":["../../src/signalr/SignalRConnectionProvider.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,OAAO,EAAoC,oBAAoB,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACxH,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA2BjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAA+B,EAAE,CAAC,CAAC;AAExF,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAC;AAElE,SAAS,yBAAyB,CAAC,EAAE,QAAQ,EA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C,0BAA0B,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC;wBACrD,CAAC,CAAC,0BAA0B,CAAC,GAAG,CAAC,SAAS,CAAC;iBACtD;gBACH,CAAC,CAAC,SAAS;YACf,eAAe,EAAE,0BAA0B;gBACvC,CAAC,CAAC;oBACI,SAAS,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,0BAA0B,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;oBACtF,WAAW,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CACjC,QAAQ;wBACJ,CAAC,CAAC,0BAA0B,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC;wBACrD,CAAC,CAAC,0BAA0B,CAAC,GAAG,CAAC,SAAS,CAAC;iBACtD;gBACH,CAAC,CAAC,SAAS;SAClB,YAEA,QAAQ,GACuB,CACvC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,oBAAoB;IAChC,OAAO,UAAU,CAAC,wBAAwB,CAAC,CAAC;AAChD,CAAC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signalr/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,+CAA+C;AAE/C,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evoke-platform/context",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Utilities that provide context to Evoke platform widgets",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,24 +35,29 @@
|
|
|
35
35
|
"!dist/tests"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@azure/msal-browser": "^2.38.
|
|
38
|
+
"@azure/msal-browser": "^2.38.4",
|
|
39
39
|
"@azure/msal-react": "^1.5.9",
|
|
40
|
+
"@testing-library/dom": "^10.4.0",
|
|
41
|
+
"@testing-library/react": "^16.0.1",
|
|
40
42
|
"@types/chai": "^4.3.11",
|
|
41
43
|
"@types/dirty-chai": "^2.0.4",
|
|
42
44
|
"@types/mocha": "^10.0.6",
|
|
43
45
|
"@types/node": "^18.15.7",
|
|
44
46
|
"@types/react": "^18.2.28",
|
|
45
|
-
"@types/uuid": "^9.0.8",
|
|
46
47
|
"@types/sinon": "^17.0.3",
|
|
47
|
-
"
|
|
48
|
+
"@types/uuid": "^9.0.8",
|
|
49
|
+
"chai": "^4.4.1",
|
|
48
50
|
"commit-and-tag-version": "^12.1.0",
|
|
49
51
|
"dirty-chai": "^2.0.1",
|
|
50
52
|
"eslint-plugin-react": "^7.33.2",
|
|
53
|
+
"global-jsdom": "^25.0.0",
|
|
54
|
+
"jsdom": "^25.0.1",
|
|
51
55
|
"mocha": "^10.2.0",
|
|
52
56
|
"msw": "^1.3.1",
|
|
53
57
|
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.3.1",
|
|
54
59
|
"react-router-dom": "^6.16.0",
|
|
55
|
-
"sinon": "^
|
|
60
|
+
"sinon": "^18.0.0",
|
|
56
61
|
"typescript": "^5.3.3"
|
|
57
62
|
},
|
|
58
63
|
"peerDependencies": {
|
|
@@ -63,7 +68,7 @@
|
|
|
63
68
|
},
|
|
64
69
|
"dependencies": {
|
|
65
70
|
"@microsoft/signalr": "^7.0.12",
|
|
66
|
-
"axios": "^1.
|
|
71
|
+
"axios": "^1.7.9",
|
|
67
72
|
"uuid": "^9.0.1"
|
|
68
73
|
}
|
|
69
74
|
}
|