@activepieces/pieces-framework
Advanced tools
Comparing version 0.6.6 to 0.6.7
{ | ||
"name": "@activepieces/pieces-framework", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"type": "commonjs", | ||
"dependencies": { | ||
"@sinclair/typebox": "^0.26.3", | ||
"axios": "1.4.0", | ||
"dayjs": "^1.11.8", | ||
"is-base64": "^1.1.0", | ||
"lodash": "4.17.21", | ||
"nanoid": "^3.3.4", | ||
"semver": "7.5.3", | ||
"@activepieces/shared": "0.5.10", | ||
"@activepieces/shared": "0.5.11", | ||
"tslib": "1.14.1" | ||
@@ -11,0 +15,0 @@ }, |
@@ -7,1 +7,3 @@ export * from './action/action'; | ||
export * from './piece-metadata'; | ||
export * from './validators/validators'; | ||
export * from './processors/processors'; |
@@ -10,2 +10,4 @@ "use strict"; | ||
tslib_1.__exportStar(require("./piece-metadata"), exports); | ||
tslib_1.__exportStar(require("./validators/validators"), exports); | ||
tslib_1.__exportStar(require("./processors/processors"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,3 @@ | ||
import { ProcessorFn } from "../processors/types"; | ||
import { TypedValidatorFn, ValidationInputType } from "../validators/types"; | ||
import { PropertyType } from "./property"; | ||
@@ -21,18 +23,22 @@ export type BasePropertySchema = { | ||
}; | ||
export type TPropertyValue<T, U extends PropertyType, REQUIRED extends boolean> = { | ||
export type TPropertyValue<T, U extends PropertyType, VALIDATION_INPUT extends ValidationInputType, REQUIRED extends boolean> = { | ||
valueSchema: T; | ||
type: U; | ||
required: REQUIRED; | ||
defaultProcessors?: ProcessorFn[]; | ||
processors?: ProcessorFn[]; | ||
validators?: TypedValidatorFn<VALIDATION_INPUT>[]; | ||
defaultValidators?: TypedValidatorFn<VALIDATION_INPUT>[]; | ||
defaultValue?: U extends PropertyType.ARRAY ? unknown[] : U extends PropertyType.JSON ? object : U extends PropertyType.CHECKBOX ? boolean : U extends PropertyType.LONG_TEXT ? string : U extends PropertyType.SHORT_TEXT ? string : U extends PropertyType.NUMBER ? number : U extends PropertyType.DROPDOWN ? unknown : U extends PropertyType.MULTI_SELECT_DROPDOWN ? unknown[] : U extends PropertyType.STATIC_MULTI_SELECT_DROPDOWN ? unknown[] : U extends PropertyType.STATIC_DROPDOWN ? unknown : U extends PropertyType.DATE_TIME ? string : U extends PropertyType.FILE ? ApFile : unknown; | ||
}; | ||
export type ShortTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.SHORT_TEXT, R>; | ||
export type LongTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.LONG_TEXT, R>; | ||
export type MarkDownProperty = BasePropertySchema & TPropertyValue<never, PropertyType.MARKDOWN, true>; | ||
export type SecretTextProperty<R extends boolean> = BasePieceAuthSchema<string> & TPropertyValue<string, PropertyType.SECRET_TEXT, R>; | ||
export type CheckboxProperty<R extends boolean> = BasePropertySchema & TPropertyValue<boolean, PropertyType.CHECKBOX, R>; | ||
export type NumberProperty<R extends boolean> = BasePropertySchema & TPropertyValue<number, PropertyType.NUMBER, R>; | ||
export type ArrayProperty<R extends boolean> = BasePropertySchema & TPropertyValue<unknown[], PropertyType.ARRAY, R>; | ||
export type ObjectProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.OBJECT, R>; | ||
export type JsonProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.JSON, R>; | ||
export type DateTimeProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.DATE_TIME, R>; | ||
export type ShortTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.SHORT_TEXT, ValidationInputType.STRING, R>; | ||
export type LongTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.LONG_TEXT, ValidationInputType.STRING, R>; | ||
export type MarkDownProperty = BasePropertySchema & TPropertyValue<never, PropertyType.MARKDOWN, ValidationInputType.ANY, true>; | ||
export type SecretTextProperty<R extends boolean> = BasePieceAuthSchema<string> & TPropertyValue<string, PropertyType.SECRET_TEXT, ValidationInputType.STRING, R>; | ||
export type CheckboxProperty<R extends boolean> = BasePropertySchema & TPropertyValue<boolean, PropertyType.CHECKBOX, ValidationInputType.ANY, R>; | ||
export type NumberProperty<R extends boolean> = BasePropertySchema & TPropertyValue<number, PropertyType.NUMBER, ValidationInputType.NUMBER, R>; | ||
export type ArrayProperty<R extends boolean> = BasePropertySchema & TPropertyValue<unknown[], PropertyType.ARRAY, ValidationInputType.ARRAY, R>; | ||
export type ObjectProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.OBJECT, ValidationInputType.OBJECT, R>; | ||
export type JsonProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.JSON, ValidationInputType.JSON, R>; | ||
export type DateTimeProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.DATE_TIME, ValidationInputType.DATE_TIME, R>; | ||
export type ApFile = { | ||
@@ -43,3 +49,3 @@ filename?: string; | ||
}; | ||
export type FileProperty<R extends boolean> = BasePropertySchema & TPropertyValue<ApFile, PropertyType.FILE, R>; | ||
export type FileProperty<R extends boolean> = BasePropertySchema & TPropertyValue<ApFile, PropertyType.FILE, ValidationInputType.FILE, R>; | ||
export {}; |
import { PropertyType } from "./property"; | ||
import { BasePieceAuthSchema, TPropertyValue } from "./base-prop"; | ||
import { ValidationInputType } from "../validators/types"; | ||
export type BasicAuthPropertyValue = { | ||
@@ -17,2 +18,2 @@ username: string; | ||
}; | ||
export type BasicAuthProperty<R extends boolean> = BasicAuthPropertySchema & TPropertyValue<BasicAuthPropertyValue, PropertyType.BASIC_AUTH, R>; | ||
export type BasicAuthProperty<R extends boolean> = BasicAuthPropertySchema & TPropertyValue<BasicAuthPropertyValue, PropertyType.BASIC_AUTH, ValidationInputType.ANY, R>; |
@@ -5,2 +5,3 @@ import { PropertyType } from "./property"; | ||
import { StaticPropsValue } from "./property"; | ||
import { ValidationInputType } from "../validators/types"; | ||
export interface CustomAuthProps { | ||
@@ -13,2 +14,2 @@ [name: string]: ShortTextProperty<boolean> | LongTextProperty<boolean> | SecretTextProperty<boolean> | NumberProperty<boolean> | StaticDropdownProperty<unknown, boolean> | CheckboxProperty<boolean>; | ||
}; | ||
export type CustomAuthProperty<R extends boolean, T extends CustomAuthProps> = CustomAuthPropertySchema<T> & TPropertyValue<CustomAuthPropertyValue<T>, PropertyType.CUSTOM_AUTH, R>; | ||
export type CustomAuthProperty<R extends boolean, T extends CustomAuthProps> = CustomAuthPropertySchema<T> & TPropertyValue<CustomAuthPropertyValue<T>, PropertyType.CUSTOM_AUTH, ValidationInputType.ANY, R>; |
import { PropertyType } from "./property"; | ||
import { BasePropertySchema, TPropertyValue } from "./base-prop"; | ||
import { ValidationInputType } from "../validators/types"; | ||
export type DropdownState<T> = { | ||
@@ -16,12 +17,12 @@ disabled?: boolean; | ||
options: DynamicDropdownOptions<T>; | ||
} & TPropertyValue<T, PropertyType.DROPDOWN, R>; | ||
} & TPropertyValue<T, PropertyType.DROPDOWN, ValidationInputType.ANY, R>; | ||
export type StaticDropdownProperty<T, R extends boolean> = BasePropertySchema & { | ||
options: DropdownState<T>; | ||
} & TPropertyValue<T, PropertyType.STATIC_DROPDOWN, R>; | ||
} & TPropertyValue<T, PropertyType.STATIC_DROPDOWN, ValidationInputType.ANY, R>; | ||
export type MultiSelectDropdownProperty<T, R extends boolean> = BasePropertySchema & { | ||
refreshers: string[]; | ||
options: DynamicDropdownOptions<T>; | ||
} & TPropertyValue<T[], PropertyType.MULTI_SELECT_DROPDOWN, R>; | ||
} & TPropertyValue<T[], PropertyType.MULTI_SELECT_DROPDOWN, ValidationInputType.ANY, R>; | ||
export type StaticMultiSelectDropdownProperty<T, R extends boolean> = BasePropertySchema & { | ||
options: DropdownState<T>; | ||
} & TPropertyValue<T[], PropertyType.STATIC_MULTI_SELECT_DROPDOWN, R>; | ||
} & TPropertyValue<T[], PropertyType.STATIC_MULTI_SELECT_DROPDOWN, ValidationInputType.ANY, R>; |
import { PropertyType } from "./property"; | ||
import { BasePropertySchema, ShortTextProperty, TPropertyValue } from "./base-prop"; | ||
import { StaticDropdownProperty, StaticMultiSelectDropdownProperty } from "./dropdown-prop"; | ||
import { ValidationInputType } from "../validators/types"; | ||
type DynamicProp = ShortTextProperty<boolean> | StaticDropdownProperty<any, boolean> | StaticMultiSelectDropdownProperty<any, boolean>; | ||
@@ -10,3 +11,3 @@ export type DynamicPropsValue = Record<string, DynamicProp['valueSchema']>; | ||
}; | ||
export type DynamicProperties<R extends boolean> = DynamicPropsSchema & TPropertyValue<DynamicPropsValue, PropertyType.DYNAMIC, R>; | ||
export type DynamicProperties<R extends boolean> = DynamicPropsSchema & TPropertyValue<DynamicPropsValue, PropertyType.DYNAMIC, ValidationInputType.ANY, R>; | ||
export {}; |
@@ -5,2 +5,3 @@ import { PropertyType } from "./property"; | ||
import { StaticPropsValue } from "./property"; | ||
import { ValidationInputType } from "../validators/types"; | ||
type OAuthProp = ShortTextProperty<true> | SecretTextProperty<true> | StaticDropdownProperty<any, true>; | ||
@@ -25,3 +26,3 @@ export interface OAuth2Props { | ||
}; | ||
export type OAuth2Property<R extends boolean, T extends OAuth2Props> = OAuth2PropertySchema & TPropertyValue<OAuth2PropertyValue<T>, PropertyType.OAUTH2, R>; | ||
export type OAuth2Property<R extends boolean, T extends OAuth2Props> = OAuth2PropertySchema & TPropertyValue<OAuth2PropertyValue<T>, PropertyType.OAUTH2, ValidationInputType.ANY, R>; | ||
export declare enum OAuth2AuthorizationMethod { | ||
@@ -28,0 +29,0 @@ HEADER = "HEADER", |
@@ -67,3 +67,3 @@ import { ArrayProperty, CheckboxProperty, DateTimeProperty, FileProperty, JsonProperty, LongTextProperty, MarkDownProperty, MarkDownPropertySchema, NumberProperty, ObjectProperty, SecretTextProperty, ShortTextProperty } from "./base-prop"; | ||
}; | ||
type Properties<T> = Omit<T, "valueSchema" | "type">; | ||
type Properties<T> = Omit<T, "valueSchema" | "type" | "defaultValidators" | "defaultProcessors">; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PieceAuth = exports.Property = exports.PropertyType = void 0; | ||
const processors_1 = require("../processors/processors"); | ||
const validators_1 = require("../validators/validators"); | ||
var PropertyType; | ||
@@ -40,3 +42,3 @@ (function (PropertyType) { | ||
Number(request) { | ||
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.NUMBER }); | ||
return Object.assign(Object.assign({}, request), { defaultProcessors: [processors_1.Processors.number], defaultValidators: [validators_1.Validators.number], valueSchema: undefined, type: PropertyType.NUMBER }); | ||
}, | ||
@@ -68,6 +70,6 @@ Json(request) { | ||
DateTime(request) { | ||
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.DATE_TIME }); | ||
return Object.assign(Object.assign({}, request), { defaultProcessors: [processors_1.Processors.datetime], defaultValidators: [validators_1.Validators.datetimeIso], valueSchema: undefined, type: PropertyType.DATE_TIME }); | ||
}, | ||
File(request) { | ||
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.FILE }); | ||
return Object.assign(Object.assign({}, request), { defaultProcessors: [processors_1.Processors.file], defaultValidators: [validators_1.Validators.file], valueSchema: undefined, type: PropertyType.FILE }); | ||
}, | ||
@@ -74,0 +76,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77259
65
1117
9
+ Addedaxios@1.4.0
+ Addeddayjs@^1.11.8
+ Addedis-base64@^1.1.0
+ Addedlodash@4.17.21
+ Added@activepieces/shared@0.5.11(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.4.0(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddayjs@1.11.13(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.3.0(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedis-base64@1.1.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removed@activepieces/shared@0.5.10(transitive)
Updated@activepieces/shared@0.5.11