@activepieces/shared 0.10.20 → 0.10.21

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@activepieces/shared",
3
- "version": "0.10.20",
3
+ "version": "0.10.21",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
6
  "@sinclair/typebox": "0.26.8",
7
7
  "nanoid": "3.3.6",
8
8
  "semver": "7.5.4",
9
- "tslib": "2.6.1"
9
+ "tslib": "2.6.2"
10
10
  },
11
11
  "main": "./src/index.js"
12
12
  }
@@ -6,5 +6,8 @@ export type Principal = {
6
6
  type: PrincipalType;
7
7
  projectId: ProjectId;
8
8
  projectType?: ProjectType;
9
- platformId?: ApId;
9
+ platform?: {
10
+ id: ApId;
11
+ role: 'OWNER' | 'MEMBER';
12
+ };
10
13
  };
@@ -1,2 +1,3 @@
1
1
  export declare function assertNotNullOrUndefined<T>(value: T | null | undefined, fieldName: string): asserts value is T;
2
+ export declare function assertEqual<T>(value1: T, value2: T, fieldName1: string, fieldName2: string): void;
2
3
  export declare const isNotUndefined: <T>(value: T | undefined) => value is T;
@@ -1,12 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNotUndefined = exports.assertNotNullOrUndefined = void 0;
3
+ exports.isNotUndefined = exports.assertEqual = exports.assertNotNullOrUndefined = void 0;
4
4
  function assertNotNullOrUndefined(value, fieldName) {
5
5
  if (value === null || value === undefined) {
6
6
  throw new Error(`${fieldName} is null or undefined`);
7
7
  }
8
8
  }
9
9
  exports.assertNotNullOrUndefined = assertNotNullOrUndefined;
10
+ function assertEqual(value1, value2, fieldName1, fieldName2) {
11
+ if (value1 !== value2) {
12
+ throw new Error(`${fieldName1} and ${fieldName2} should be equal`);
13
+ }
14
+ }
15
+ exports.assertEqual = assertEqual;
10
16
  const isNotUndefined = (value) => {
11
17
  return value !== undefined;
12
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"assertions.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/common/utils/assertions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CACpC,KAA2B,EAC3B,SAAiB;IAEjB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,uBAAuB,CAAC,CAAA;KACvD;AACL,CAAC;AAPD,4DAOC;AAEM,MAAM,cAAc,GAAG,CAAI,KAAoB,EAAc,EAAE;IAClE,OAAO,KAAK,KAAK,SAAS,CAAA;AAC9B,CAAC,CAAA;AAFY,QAAA,cAAc,kBAE1B"}
1
+ {"version":3,"file":"assertions.js","sourceRoot":"","sources":["../../../../../../../packages/shared/src/lib/common/utils/assertions.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CACpC,KAA2B,EAC3B,SAAiB;IAEjB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,uBAAuB,CAAC,CAAA;KACvD;AACL,CAAC;AAPD,4DAOC;AAED,SAAgB,WAAW,CACvB,MAAS,EACT,MAAS,EACT,UAAkB,EAClB,UAAkB;IAElB,IAAI,MAAM,KAAK,MAAM,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,QAAQ,UAAU,kBAAkB,CAAC,CAAA;KACrE;AACL,CAAC;AATD,kCASC;AAEM,MAAM,cAAc,GAAG,CAAI,KAAoB,EAAc,EAAE;IAClE,OAAO,KAAK,KAAK,SAAS,CAAA;AAC9B,CAAC,CAAA;AAFY,QAAA,cAAc,kBAE1B"}