@activepieces/pieces-framework 0.22.0 → 0.22.2
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/pieces-framework",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@sinclair/typebox": "0.34.11",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"nanoid": "3.3.8",
|
|
9
9
|
"semver": "7.6.0",
|
|
10
10
|
"socket.io-client": "4.8.1",
|
|
11
|
-
"@activepieces/shared": "0.
|
|
11
|
+
"@activepieces/shared": "0.29.0",
|
|
12
12
|
"tslib": "2.6.2"
|
|
13
13
|
},
|
|
14
14
|
"resolutions": {
|
|
@@ -32,7 +32,7 @@ type CreateActionParams<PieceAuth extends PieceAuthProperty | PieceAuthProperty[
|
|
|
32
32
|
requireAuth?: boolean;
|
|
33
33
|
errorHandlingOptions?: ErrorHandlingOptionsParam;
|
|
34
34
|
};
|
|
35
|
-
export declare class IAction<PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined =
|
|
35
|
+
export declare class IAction<PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined = any, ActionProps extends InputPropertyMap = InputPropertyMap> implements ActionBase {
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly displayName: string;
|
|
38
38
|
readonly description: string;
|
|
@@ -43,6 +43,6 @@ export declare class IAction<PieceAuth extends PieceAuthProperty | PieceAuthProp
|
|
|
43
43
|
readonly errorHandlingOptions: ErrorHandlingOptionsParam;
|
|
44
44
|
constructor(name: string, displayName: string, description: string, props: ActionProps, run: ActionRunner<ExtractPieceAuthPropertyTypeForMethods<PieceAuth>, ActionProps>, test: ActionRunner<ExtractPieceAuthPropertyTypeForMethods<PieceAuth>, ActionProps>, requireAuth: boolean, errorHandlingOptions: ErrorHandlingOptionsParam);
|
|
45
45
|
}
|
|
46
|
-
export type Action<PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined =
|
|
46
|
+
export type Action<PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined = any, ActionProps extends InputPropertyMap = any> = IAction<PieceAuth, ActionProps>;
|
|
47
47
|
export declare const createAction: <PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined = PieceAuthProperty, ActionProps extends InputPropertyMap = any>(params: CreateActionParams<PieceAuth, ActionProps>) => IAction<PieceAuth, ActionProps>;
|
|
48
48
|
export {};
|
package/src/lib/piece.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class Piece<PieceAuth extends PieceAuthProperty | PieceAuthProper
|
|
|
28
28
|
triggers(): Record<string, Trigger>;
|
|
29
29
|
}
|
|
30
30
|
export declare const createPiece: <PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined>(params: CreatePieceParams<PieceAuth>) => Piece<PieceAuth>;
|
|
31
|
-
type CreatePieceParams<PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined> = {
|
|
31
|
+
type CreatePieceParams<PieceAuth extends PieceAuthProperty | PieceAuthProperty[] | undefined = undefined> = {
|
|
32
32
|
displayName: string;
|
|
33
33
|
logoUrl: string;
|
|
34
34
|
authors: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PiecePropertyMap } from ".";
|
|
2
2
|
import { PieceAuthProperty } from "./authentication";
|
|
3
3
|
import { TSchema } from "@sinclair/typebox";
|
|
4
|
-
declare function buildSchema(props: PiecePropertyMap, auth: PieceAuthProperty | PieceAuthProperty[] | undefined): import("@sinclair/typebox").TObject<Record<string, TSchema>>;
|
|
4
|
+
declare function buildSchema(props: PiecePropertyMap, auth: PieceAuthProperty | PieceAuthProperty[] | undefined, requireAuth?: boolean | undefined): import("@sinclair/typebox").TObject<Record<string, TSchema>>;
|
|
5
5
|
export declare const piecePropertiesUtils: {
|
|
6
6
|
buildSchema: typeof buildSchema;
|
|
7
7
|
};
|
package/src/lib/property/util.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.piecePropertiesUtils = void 0;
|
|
|
4
4
|
const property_type_1 = require("./input/property-type");
|
|
5
5
|
const typebox_1 = require("@sinclair/typebox");
|
|
6
6
|
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
function buildSchema(props, auth) {
|
|
7
|
+
function buildSchema(props, auth, requireAuth = true) {
|
|
8
8
|
const entries = Object.entries(props);
|
|
9
9
|
const nullableType = [typebox_1.Type.Null(), typebox_1.Type.Undefined()];
|
|
10
10
|
const nonNullableUnknownPropType = typebox_1.Type.Not(typebox_1.Type.Union(nullableType), typebox_1.Type.Unknown());
|
|
@@ -107,10 +107,9 @@ function buildSchema(props, auth) {
|
|
|
107
107
|
: [propsSchema[name], ...nullableType]));
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
if (auth) {
|
|
111
|
-
const authProperty = Array.isArray(auth) ? auth.at(0) : auth;
|
|
110
|
+
if (auth && requireAuth) {
|
|
112
111
|
propsSchema[shared_1.AUTHENTICATION_PROPERTY_NAME] = typebox_1.Type.String({
|
|
113
|
-
minLength:
|
|
112
|
+
minLength: 1
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
115
|
return typebox_1.Type.Object(propsSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/framework/src/lib/property/util.ts"],"names":[],"mappings":";;;AAEA,yDAAqD;AACrD,+CAAkD;AAClD,iDAAoF;AAEpF,SAAS,WAAW,CAAC,KAAuB,EAAE,IAAyD;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/framework/src/lib/property/util.ts"],"names":[],"mappings":";;;AAEA,yDAAqD;AACrD,+CAAkD;AAClD,iDAAoF;AAEpF,SAAS,WAAW,CAAC,KAAuB,EAA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