@extrahorizon/javascript-sdk 8.5.0-dev-72-f6603f3 → 8.5.0-dev-73-2ae1c71

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
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
  - Added `TransitionActionTask` to the `AfterActions`
18
18
  - Added `TRANSITION_DOCUMENTS` permission to the `GlobalPermissionName` enum
19
19
  - Added `TRANSITION_DOCUMENTS` permission to the documentation of the transition document function
20
+ - Added a `name` field to the `exh.data.documents.transition` body, allowing a transition to be triggered by its name rather then its id
20
21
 
21
22
  ### Changed
22
23
  - RQL `contains` and `excludes` now have their different variations better separated in the type definitions
@@ -5375,7 +5375,7 @@ const logsService = (httpWithAuth) => {
5375
5375
  };
5376
5376
  };
5377
5377
 
5378
- const version = '8.5.0-dev-72-f6603f3';
5378
+ const version = '8.5.0-dev-73-2ae1c71';
5379
5379
 
5380
5380
  /**
5381
5381
  * Create ExtraHorizon client.
package/build/index.mjs CHANGED
@@ -5345,7 +5345,7 @@ const logsService = (httpWithAuth) => {
5345
5345
  };
5346
5346
  };
5347
5347
 
5348
- const version = '8.5.0-dev-72-f6603f3';
5348
+ const version = '8.5.0-dev-73-2ae1c71';
5349
5349
 
5350
5350
  /**
5351
5351
  * Create ExtraHorizon client.
@@ -253,6 +253,15 @@ export interface Index {
253
253
  system?: boolean;
254
254
  }
255
255
  export declare type IndexInput = Pick<Index, 'fields' | 'options'>;
256
+ export declare type TransitionDocumentInput = {
257
+ id: ObjectId;
258
+ name?: string;
259
+ data?: Record<string, unknown>;
260
+ } | {
261
+ id?: ObjectId;
262
+ name: string;
263
+ data?: Record<string, unknown>;
264
+ };
256
265
  export interface Document<CustomData = null, CustomStatus = null> {
257
266
  id: ObjectId;
258
267
  userIds: ObjectId[];
@@ -555,6 +564,14 @@ export interface DataDocumentsService {
555
564
  *
556
565
  * Start a transition manually for the selected document where the conditions of a manual transition are met.
557
566
  *
567
+ * Either the `id` or the `name` of a transition must be provided.
568
+ * If both are provided, they must match the same transition, otherwise a `ResourceUnknownError` will be thrown.
569
+ *
570
+ * If `name` is provided, multiple transitions could match.
571
+ * In this case, the first matching transition will be triggered:
572
+ * - The first transition with a `fromStatuses` matching the current status of the document
573
+ * - And all the transition its `conditions` are met
574
+ *
558
575
  * Permission | Scope | Effect
559
576
  * - | - | -
560
577
  * none | | Update your own documents
@@ -570,10 +587,7 @@ export interface DataDocumentsService {
570
587
  * @throws {IllegalArgumentError}
571
588
  * @throws {ResourceUnknownError}
572
589
  */
573
- transition(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody: {
574
- id: ObjectId;
575
- data?: Record<string, any>;
576
- }, options?: OptionsWithRql): Promise<AffectedRecords>;
590
+ transition(schemaIdOrName: ObjectId | string, documentId: ObjectId, requestBody: TransitionDocumentInput, options?: OptionsWithRql): Promise<AffectedRecords>;
577
591
  /**
578
592
  * Link groups to a document
579
593
  *
@@ -1 +1 @@
1
- export declare const version = "8.5.0-dev-72-f6603f3";
1
+ export declare const version = "8.5.0-dev-73-2ae1c71";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/javascript-sdk",
3
- "version": "8.5.0-dev-72-f6603f3",
3
+ "version": "8.5.0-dev-73-2ae1c71",
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",