@evoke-platform/context 1.2.0 → 1.3.0-dev.2

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 CHANGED
@@ -17,6 +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
+ - [Authentication Context](#authentication-context)
20
21
  - [Notifications](#notifications)
21
22
 
22
23
  ### Working With Objects
@@ -222,6 +223,25 @@ absolute URL.
222
223
 
223
224
  ##### `delete(url, options)`
224
225
 
226
+ ### Authentication Context
227
+
228
+ - [useAuthenticationContext](#useauthenticationcontext)
229
+
230
+ #### `useAuthenticationContext()`
231
+
232
+ Hook to obtain the authentication context based on the current logged-in user.
233
+
234
+ The authentication context includes the following property and functions.
235
+
236
+ - `account` _[object]_
237
+ - The account of the currently logged-in user. This includes both the user's `id` and `name`.
238
+ - `logout()`
239
+ - A function that logs out the currently logged-in user. The user will be redirected to Evoke's logout page upon logout.
240
+ - `getAccessToken()`
241
+ - A function that returns an access token that is associated to the currently logged-in user. This token can be used to make API calls to Evoke's APIs to authenticate the API call.
242
+ - Note: As a general recommendation, the [ApiService](#class-apiservices) class should be used to make API calls as it will take care
243
+ of appending an access token to the call.
244
+
225
245
  ### Notifications
226
246
 
227
247
  - [useNofitication](#usenotification)
@@ -1,5 +1,8 @@
1
1
  import { ApiServices, Callback } from '../api/index.js';
2
2
  import { Filter } from './filters.js';
3
+ export type EvokeFormDisplayConfiguration = {
4
+ submitLabel?: string;
5
+ };
3
6
  export type EvokeForm = {
4
7
  id: string;
5
8
  name: string;
@@ -8,6 +11,7 @@ export type EvokeForm = {
8
11
  formObjectId?: string;
9
12
  actionId?: string;
10
13
  autosaveActionId?: string;
14
+ display?: EvokeFormDisplayConfiguration;
11
15
  };
12
16
  export type BaseObjReference = {
13
17
  objectId: string;
@@ -90,6 +94,7 @@ export type Property = {
90
94
  name: string;
91
95
  type: PropertyType;
92
96
  enum?: string[];
97
+ strictlyTrue?: boolean;
93
98
  nonStrictEnum?: boolean;
94
99
  objectId?: string;
95
100
  relatedPropertyId?: string;
@@ -114,6 +119,7 @@ export type InputParameter = {
114
119
  type: PropertyType;
115
120
  required?: boolean;
116
121
  enum?: string[];
122
+ strictlyTrue?: boolean;
117
123
  nonStrictEnum?: boolean;
118
124
  validation?: PropertyValidation | InputStringValidation;
119
125
  objectId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/context",
3
- "version": "1.2.0",
3
+ "version": "1.3.0-dev.2",
4
4
  "description": "Utilities that provide context to Evoke platform widgets",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",