@evoke-platform/context 1.0.0-dev.5 → 1.0.0-dev.50
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 +16 -2
- package/dist/app/AppProvider.d.ts +1 -0
- package/dist/app/AppProvider.js.map +1 -1
- package/dist/objects/objects.d.ts +51 -10
- package/dist/objects/objects.js.map +1 -1
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -199,8 +199,8 @@ absolute URL.
|
|
|
199
199
|
### SignalR Connection
|
|
200
200
|
|
|
201
201
|
- [useSignalRConnection](#usesignalrconnection)
|
|
202
|
-
- [documentChanges](#
|
|
203
|
-
- [instanceChanges](#
|
|
202
|
+
- [documentChanges](#documentchangessubscribeobjectidinstanceid-data-documentchange)
|
|
203
|
+
- [instanceChanges](#instancechangessubscribeobjectid-instanceids-instancechange)
|
|
204
204
|
|
|
205
205
|
#### `useSignalRConnection()`
|
|
206
206
|
|
|
@@ -218,6 +218,18 @@ documentChanges.subscribe('myObjectId/myInstanceId', (data) => {
|
|
|
218
218
|
});
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
+
The data provided to the callback will be an array of `DocumentChange` which contains the
|
|
222
|
+
following data:
|
|
223
|
+
|
|
224
|
+
- `objectId`
|
|
225
|
+
- Object describing the instance associated with the updated document.
|
|
226
|
+
- `instanceId`
|
|
227
|
+
- Instance that the updated document is associated with.
|
|
228
|
+
- `documentId`
|
|
229
|
+
- Document that was updated.
|
|
230
|
+
- `type`
|
|
231
|
+
- The type of update. Possible values are `BlobCreated`, `BlobDeleted`, and `BlobMetadataUpdated`.
|
|
232
|
+
|
|
221
233
|
##### `documentChanges.unsubscribe('{objectId}/{instanceId}', (data: DocumentChange[]) => {})`
|
|
222
234
|
|
|
223
235
|
Unsubscribe to the specified object instance document changes.
|
|
@@ -250,6 +262,8 @@ instanceChanges.subscribe('myObjectId', (instanceIds) => {
|
|
|
250
262
|
});
|
|
251
263
|
```
|
|
252
264
|
|
|
265
|
+
The data provided to the callback will be an array of instance IDs that were updated.
|
|
266
|
+
|
|
253
267
|
##### `instanceChanges.unsubscribe('{objectId}', (instanceIds: InstanceChange[]) => {})`
|
|
254
268
|
|
|
255
269
|
Unsubscribe to the specified object instance changes.
|
|
@@ -1 +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;
|
|
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;AAgD7D,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"}
|
|
@@ -23,7 +23,7 @@ export type Action = {
|
|
|
23
23
|
name: string;
|
|
24
24
|
type: ActionType;
|
|
25
25
|
outputEvent: string;
|
|
26
|
-
inputProperties?:
|
|
26
|
+
inputProperties?: ActionInput[];
|
|
27
27
|
};
|
|
28
28
|
export type ObjectInstance = {
|
|
29
29
|
id: string;
|
|
@@ -31,6 +31,47 @@ export type ObjectInstance = {
|
|
|
31
31
|
name: string;
|
|
32
32
|
[key: string]: unknown;
|
|
33
33
|
};
|
|
34
|
+
export type RegexValidation = {
|
|
35
|
+
regex: string;
|
|
36
|
+
errorMessage: string;
|
|
37
|
+
};
|
|
38
|
+
export type SelectOption = {
|
|
39
|
+
label: string;
|
|
40
|
+
value: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Represents an object action inputProperty object.
|
|
44
|
+
*/
|
|
45
|
+
export type ActionInput = {
|
|
46
|
+
label: string;
|
|
47
|
+
type: string;
|
|
48
|
+
key: string;
|
|
49
|
+
initialValue?: unknown;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
tooltip?: string;
|
|
53
|
+
prefix?: string;
|
|
54
|
+
suffix?: string;
|
|
55
|
+
showCharCount?: boolean;
|
|
56
|
+
readOnly?: boolean;
|
|
57
|
+
isMultiLineText?: boolean;
|
|
58
|
+
data?: {
|
|
59
|
+
/**
|
|
60
|
+
* An array of values required for select options.
|
|
61
|
+
*/
|
|
62
|
+
values?: SelectOption[];
|
|
63
|
+
};
|
|
64
|
+
validate?: {
|
|
65
|
+
required?: boolean;
|
|
66
|
+
operator?: 'any' | 'all';
|
|
67
|
+
regexes?: RegexValidation[];
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* An array of sub-components to be rendered inside sections.
|
|
71
|
+
*/
|
|
72
|
+
components?: ActionInput[];
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
};
|
|
34
75
|
export type ActionRequest = {
|
|
35
76
|
actionId: string;
|
|
36
77
|
input?: Record<string, unknown>;
|
|
@@ -65,16 +106,16 @@ export declare class ObjectStore {
|
|
|
65
106
|
get(options?: ObjectOptions): Promise<Obj>;
|
|
66
107
|
get(cb?: Callback<Obj>): void;
|
|
67
108
|
get(options: ObjectOptions, cb?: Callback<Obj>): void;
|
|
68
|
-
findInstances(filter?: Filter): Promise<
|
|
69
|
-
findInstances(cb: Callback<
|
|
70
|
-
findInstances(filter: Filter, cb: Callback<
|
|
71
|
-
getInstance(id: string): Promise<
|
|
72
|
-
getInstance(id: string, cb: Callback<
|
|
109
|
+
findInstances<T extends ObjectInstance = ObjectInstance>(filter?: Filter): Promise<T[]>;
|
|
110
|
+
findInstances<T extends ObjectInstance = ObjectInstance>(cb: Callback<T[]>): void;
|
|
111
|
+
findInstances<T extends ObjectInstance = ObjectInstance>(filter: Filter, cb: Callback<T[]>): void;
|
|
112
|
+
getInstance<T extends ObjectInstance = ObjectInstance>(id: string): Promise<T>;
|
|
113
|
+
getInstance<T extends ObjectInstance = ObjectInstance>(id: string, cb: Callback<T>): void;
|
|
73
114
|
getInstanceHistory(id: string): Promise<History[]>;
|
|
74
115
|
getInstanceHistory(id: string, cb: Callback<History[]>): void;
|
|
75
|
-
newInstance(input: ActionRequest): Promise<
|
|
76
|
-
newInstance(input: ActionRequest, cb: Callback<
|
|
77
|
-
instanceAction(id: string, input: ActionRequest): Promise<
|
|
78
|
-
instanceAction(id: string, input: ActionRequest, cb: Callback<
|
|
116
|
+
newInstance<T extends ObjectInstance = ObjectInstance>(input: ActionRequest): Promise<T>;
|
|
117
|
+
newInstance<T extends ObjectInstance = ObjectInstance>(input: ActionRequest, cb: Callback<T>): void;
|
|
118
|
+
instanceAction<T extends ObjectInstance = ObjectInstance>(id: string, input: ActionRequest): Promise<T>;
|
|
119
|
+
instanceAction<T extends ObjectInstance = ObjectInstance>(id: string, input: ActionRequest, cb: Callback<T>): void;
|
|
79
120
|
}
|
|
80
121
|
export declare function useObject(objectId: string): ObjectStore;
|
|
@@ -1 +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,E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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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evoke-platform/context",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.50",
|
|
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,24 @@
|
|
|
35
35
|
"!dist/tests"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@azure/msal-browser": "^2.
|
|
39
|
-
"@azure/msal-react": "^1.5.
|
|
40
|
-
"@types/chai": "^4.3.
|
|
38
|
+
"@azure/msal-browser": "^2.38.1",
|
|
39
|
+
"@azure/msal-react": "^1.5.9",
|
|
40
|
+
"@types/chai": "^4.3.6",
|
|
41
41
|
"@types/dirty-chai": "^2.0.2",
|
|
42
42
|
"@types/mocha": "^10.0.1",
|
|
43
43
|
"@types/node": "^18.15.7",
|
|
44
|
-
"@types/react": "^18.
|
|
45
|
-
"@types/sinon": "^10.0.
|
|
46
|
-
"chai": "^4.3.
|
|
44
|
+
"@types/react": "^18.2.19",
|
|
45
|
+
"@types/sinon": "^10.0.17",
|
|
46
|
+
"chai": "^4.3.8",
|
|
47
47
|
"commit-and-tag-version": "^11.2.2",
|
|
48
48
|
"dirty-chai": "^2.0.1",
|
|
49
|
-
"eslint-plugin-react": "^7.
|
|
49
|
+
"eslint-plugin-react": "^7.33.2",
|
|
50
50
|
"mocha": "^10.2.0",
|
|
51
|
-
"msw": "^1.
|
|
51
|
+
"msw": "^1.3.1",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
|
-
"react-router-dom": "^6.
|
|
54
|
-
"sinon": "^
|
|
55
|
-
"typescript": "^5.
|
|
53
|
+
"react-router-dom": "^6.16.0",
|
|
54
|
+
"sinon": "^16.1.0",
|
|
55
|
+
"typescript": "^5.2.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@azure/msal-browser": ">=2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-router-dom": ">=6"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@microsoft/signalr": "^7.0.
|
|
65
|
-
"axios": "^1.
|
|
64
|
+
"@microsoft/signalr": "^7.0.10",
|
|
65
|
+
"axios": "^1.5.0"
|
|
66
66
|
}
|
|
67
67
|
}
|