@extrahorizon/javascript-sdk 8.5.0-dev-77-cdf0205 → 8.5.0-dev-79-c67d6f6

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/CHANGELOG.md CHANGED
@@ -7,27 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [8.5.0]
9
9
 
10
- ### Fixed
11
- - Corrected `functioName` field to `functionName` in the `TransitionActionTask` type
12
- - `exh.templates.findFirst`, `findById` and `findByName` now correctly state `undefined` can be returned
13
- - The `notifyAlgoQueueManager` transition action type no longer claims it has a `id` and `version` field
14
- - Transitions now correctly state `name` is optional and `id` is only a returned field.
15
-
16
10
  ### Added
17
- - Added `exh.data.documents.unlinkAllUsers` and `unlinkAllGroups` methods to unlink all users or groups from a document
18
- - Added `priority` field to the `TransitionActionTask` type
19
- - Added `TransitionActionTask` to the `AfterActions`
20
- - Added `TRANSITION_DOCUMENTS` permission to the `GlobalPermissionName` enum
21
- - Added `TRANSITION_DOCUMENTS` permission to the documentation of the transition document function
22
- - Added a `name` field to the `exh.data.documents.transition` body, allowing a transition to be triggered by its name rather then its id
11
+ - Data Service:
12
+ - Schema `createMode`, `readMode`, `updateMode` and `deleteMode` have been updated to accept multiple granular options, matching the revamped access mode changes in Data Service `1.4.0`
13
+ - Schema Transition Action `type: "task"` now supports the `priority` field
14
+ - Schema Transition `afterActions` now supports the `type: "task"` Action
15
+ - Access mode documentation has been revamped for the relevant `exh.data.documents.*` methods
16
+ - `exh.data.documents.transition` now accepts a `name` field the `requestBody`, allowing a Transition to be triggered by its `name`
17
+ - `exh.data.documents.unlinkAllUsers` and `unlinkAllGroups` methods added, to unlink all users or groups from a Document
18
+ - `TRANSITION_DOCUMENTS` has been added as a supported permission
19
+ - `exh.events.create` now supports a `normalizeEventContent` option to disable normalization of event content
23
20
 
24
21
  ### Changed
25
- - RQL `contains` and `excludes` now have their different variations better separated in the type definitions
26
- - `exh.data.documents.unlinkUsers` and `unlinkGroups` now also accept an array of user or group ids directly rather than nested in a request body object
22
+ - `exh.data.documents.unlinkUsers` and `unlinkGroups` now also accept an array of user or group ids directly
27
23
  - Thanks to `tran-simon` for the pointing out the initially incorrect `unlinkUsers` type definition!
28
- - Data service schemas `createMode`, `readMode`, `updateMode` and `deleteMode` accepted values updated
29
- - Matching the access mode changes in Data Service 1.4.0
30
- - `readMode`, `updateMode` and `deleteMode` now also accept an array of relational modes
24
+ - The RQL `contains` and `excludes` methods type definitions have been improved
25
+
26
+ ### Fixed
27
+ - Data Service Schema Transition:
28
+ - Now correctly states `name` is optional and `id` is only a returned field.
29
+ - Action `type: "task"` now correctly types `functioName` as `functionName`
30
+ - Action `type: "notifyAlgoQueueManager"` no longer claims it has an `id` and `version` field
31
+ - `exh.templates.findFirst`, `findById` and `findByName` now correctly defines `undefined` as a return type
31
32
 
32
33
  ### Deprecated
33
34
  - `exh.data.documents.unlinkUsers` usage with an object is deprecated in favor of an array of ids directly or `unlinkAllUsers` for unlinking all users
@@ -5302,7 +5302,12 @@ var events = (client, httpAuth) => ({
5302
5302
  return res.data[0];
5303
5303
  },
5304
5304
  async create(requestBody, options) {
5305
- return (await client.post(httpAuth, '/', requestBody, options)).data;
5305
+ const requestOptions = { ...options };
5306
+ if ((options === null || options === void 0 ? void 0 : options.normalizeEventContent) === false) {
5307
+ requestOptions.customRequestKeys = ['content'];
5308
+ requestOptions.customResponseKeys = ['content'];
5309
+ }
5310
+ return (await client.post(httpAuth, '/', requestBody, requestOptions)).data;
5306
5311
  },
5307
5312
  });
5308
5313
 
@@ -5375,7 +5380,7 @@ const logsService = (httpWithAuth) => {
5375
5380
  };
5376
5381
  };
5377
5382
 
5378
- const version = '8.5.0-dev-77-cdf0205';
5383
+ const version = '8.5.0-dev-79-c67d6f6';
5379
5384
 
5380
5385
  /**
5381
5386
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -5272,7 +5272,12 @@ var events = (client, httpAuth) => ({
5272
5272
  return res.data[0];
5273
5273
  },
5274
5274
  async create(requestBody, options) {
5275
- return (await client.post(httpAuth, '/', requestBody, options)).data;
5275
+ const requestOptions = { ...options };
5276
+ if ((options === null || options === void 0 ? void 0 : options.normalizeEventContent) === false) {
5277
+ requestOptions.customRequestKeys = ['content'];
5278
+ requestOptions.customResponseKeys = ['content'];
5279
+ }
5280
+ return (await client.post(httpAuth, '/', requestBody, requestOptions)).data;
5276
5281
  },
5277
5282
  });
5278
5283
 
@@ -5345,7 +5350,7 @@ const logsService = (httpWithAuth) => {
5345
5350
  };
5346
5351
  };
5347
5352
 
5348
- const version = '8.5.0-dev-77-cdf0205';
5353
+ const version = '8.5.0-dev-79-c67d6f6';
5349
5354
 
5350
5355
  /**
5351
5356
  * Create ExtraHorizon client.
@@ -19,6 +19,12 @@ export interface Version {
19
19
  minor: number;
20
20
  patch: number;
21
21
  }
22
+ export interface CreateEventOptions extends OptionsBase {
23
+ /**
24
+ * If set to `false`, the `content` of the event will not be normalized, i.e. camelCase keys will be preserved.
25
+ */
26
+ normalizeEventContent?: boolean;
27
+ }
22
28
  export interface EventsService {
23
29
  /**
24
30
  * Returns a list of events
@@ -46,13 +52,16 @@ export interface EventsService {
46
52
  /**
47
53
  * Creates an event
48
54
  *
55
+ * **Note**: The `content` of the event will be normalized by default, i.e. all keys will be converted to snake_case.
56
+ * Use `normalizeEventContent: false` to preserve camelCase keys.
57
+ *
49
58
  * Permission | Scope | Effect
50
59
  * - | - | -
51
60
  * `CREATE_EVENTS` | `global` | **Required** for this endpoint
52
61
  * @param requestBody
53
62
  * @returns Event
54
63
  */
55
- create(requestBody: CreateEvent, options?: OptionsBase): Promise<Event>;
64
+ create(requestBody: CreateEvent, options?: CreateEventOptions): Promise<Event>;
56
65
  }
57
66
  export interface SubscriptionsService {
58
67
  /**
@@ -1 +1 @@
1
- export declare const version = "8.5.0-dev-77-cdf0205";
1
+ export declare const version = "8.5.0-dev-79-c67d6f6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.5.0-dev-77-cdf0205",
3
+ "version": "8.5.0-dev-79-c67d6f6",
4
4
  "description": "This package serves as a JavaScript wrapper around all Extra Horizon cloud services.",
5
5
  "main": "build/index.cjs.js",
6
6
  "types": "build/types/index.d.ts",