@activepieces/pieces-framework 0.6.18 → 0.6.20

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,18 +1,17 @@
1
1
  {
2
2
  "name": "@activepieces/pieces-framework",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
- "@sinclair/typebox": "^0.26.3",
7
- "axios": "1.4.0",
8
- "dayjs": "^1.11.8",
9
- "is-base64": "^1.1.0",
6
+ "@sinclair/typebox": "0.26.8",
7
+ "axios": "^1.0.0",
8
+ "dayjs": "1.11.9",
9
+ "is-base64": "1.1.0",
10
10
  "lodash": "4.17.21",
11
- "nanoid": "^3.3.4",
11
+ "nanoid": "3.3.6",
12
12
  "semver": "7.5.4",
13
- "@activepieces/shared": "0.8.3",
14
- "tslib": "2.6.1"
13
+ "@activepieces/shared": "0.8.7",
14
+ "tslib": "2.6.2"
15
15
  },
16
- "main": "./src/index.js",
17
- "types": "./src/index.d.ts"
16
+ "main": "./src/index.js"
18
17
  }
@@ -41,10 +41,19 @@ export type PauseHookParams = {
41
41
  pauseMetadata: PauseHookPauseMetadata;
42
42
  };
43
43
  export type PauseHook = (params: PauseHookParams) => void;
44
+ export type PropertyContext = {
45
+ server: ServerContext;
46
+ };
47
+ export type ServerContext = {
48
+ apiUrl: string;
49
+ publicUrl: string;
50
+ token: string;
51
+ };
44
52
  export type BaseActionContext<ET extends ExecutionType, PieceAuth extends PieceAuthProperty, ActionProps extends NonAuthPiecePropertyMap> = BaseContext<PieceAuth, ActionProps> & {
45
53
  executionType: ET;
46
54
  connections: ConnectionsManager;
47
55
  tags: TagsManager;
56
+ server: ServerContext;
48
57
  files: FilesService;
49
58
  serverUrl: string;
50
59
  run: {
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/context.ts"],"names":[],"mappings":";;;AAyHA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,iDAAiD;IACjD,oCAAsB,CAAA;IACtB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/context.ts"],"names":[],"mappings":";;;AAmIA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,iDAAiD;IACjD,oCAAsB,CAAA;IACtB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
@@ -1,6 +1,7 @@
1
1
  import { PropertyType } from "./property";
2
2
  import { BasePropertySchema, TPropertyValue } from "./base-prop";
3
3
  import { ValidationInputType } from "../validators/types";
4
+ import { PropertyContext } from "../context";
4
5
  export type DropdownState<T> = {
5
6
  disabled?: boolean;
6
7
  placeholder?: string;
@@ -10,7 +11,7 @@ export type DropdownOption<T> = {
10
11
  label: string;
11
12
  value: T;
12
13
  };
13
- export type DynamicDropdownOptions<T> = (propsValue: Record<string, unknown>) => Promise<DropdownState<T>>;
14
+ export type DynamicDropdownOptions<T> = (propsValue: Record<string, unknown>, ctx: PropertyContext) => Promise<DropdownState<T>>;
14
15
  export type DropdownProperty<T, R extends boolean> = BasePropertySchema & {
15
16
  refreshers: string[];
16
17
  options: DynamicDropdownOptions<T>;
@@ -2,10 +2,11 @@ import { PropertyType } from "./property";
2
2
  import { BasePropertySchema, ShortTextProperty, TPropertyValue } from "./base-prop";
3
3
  import { StaticDropdownProperty, StaticMultiSelectDropdownProperty } from "./dropdown-prop";
4
4
  import { ValidationInputType } from "../validators/types";
5
+ import { PropertyContext } from "../context";
5
6
  type DynamicProp = ShortTextProperty<boolean> | StaticDropdownProperty<any, boolean> | StaticMultiSelectDropdownProperty<any, boolean>;
6
7
  export type DynamicPropsValue = Record<string, DynamicProp['valueSchema']>;
7
8
  export type DynamicPropsSchema = BasePropertySchema & {
8
- props: (propsValue: Record<string, DynamicPropsValue>) => Promise<Record<string, DynamicProp>>;
9
+ props: (propsValue: Record<string, DynamicPropsValue>, ctx: PropertyContext) => Promise<Record<string, DynamicProp>>;
9
10
  refreshers: string[];
10
11
  };
11
12
  export type DynamicProperties<R extends boolean> = DynamicPropsSchema & TPropertyValue<DynamicPropsValue, PropertyType.DYNAMIC, ValidationInputType.ANY, R>;