@hahnpro/flow-sdk 7.0.2 → 7.1.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.
@@ -260,7 +260,12 @@ class FlowApplication {
260
260
  this.properties = this.flow.properties || {};
261
261
  try {
262
262
  if (!this.skipApi && !(this._api instanceof hpc_api_1.MockAPI)) {
263
- this._api = new hpc_api_1.API(this.apiClient);
263
+ let tokenSubject;
264
+ const { owner, runAsOwner } = this.context;
265
+ if (runAsOwner && owner) {
266
+ tokenSubject = owner.type === 'org' ? 'org-admin-' + owner.id : owner.id;
267
+ }
268
+ this._api = new hpc_api_1.API(this.apiClient, { tokenSubject });
264
269
  }
265
270
  }
266
271
  catch (err) {
@@ -1,7 +1,10 @@
1
+ import { Owner } from '@hahnpro/hpc-api';
1
2
  export interface FlowContext {
2
3
  deploymentId?: string;
3
4
  diagramId?: string;
4
5
  flowId?: string;
6
+ owner?: Owner;
7
+ runAsOwner?: boolean;
5
8
  }
6
9
  export interface FlowElementContext extends FlowContext {
7
10
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hahnpro/flow-sdk",
3
- "version": "7.0.2",
3
+ "version": "7.1.0",
4
4
  "description": "SDK for building Flow Modules",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -36,13 +36,13 @@
36
36
  "reflect-metadata": "0.2.2",
37
37
  "rxjs": "7.8.1",
38
38
  "string-interp": "0.3.6",
39
- "@hahnpro/hpc-api": "5.2.8"
39
+ "@hahnpro/hpc-api": "5.3.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/amqplib": "0.10.5",
43
43
  "@types/jest": "29.5.12",
44
44
  "@types/lodash": "4.17.7",
45
- "@types/node": "20.14.15",
45
+ "@types/node": "20.16.1",
46
46
  "class-validator-jsonschema": "5.0.1",
47
47
  "jest": "29.7.0",
48
48
  "typescript": "5.5.4"