@activepieces/pieces-common
Advanced tools
Comparing version 0.2.16 to 0.2.17
{ | ||
"name": "@activepieces/pieces-common", | ||
"version": "0.2.16", | ||
"version": "0.2.17", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -1,5 +0,5 @@ | ||
import { OAuth2PropertyValue, PieceAuthProperty } from "@activepieces/pieces-framework"; | ||
import { OAuth2PropertyValue, PieceAuthProperty, Property, StaticDropdownProperty } from "@activepieces/pieces-framework"; | ||
import { HttpHeaders, HttpMethod } from "../http"; | ||
export declare const getAccessTokenOrThrow: (auth: OAuth2PropertyValue | undefined) => string; | ||
export declare function createCustomApiCallAction({ auth, baseUrl, authMapping, description, displayName, name }: { | ||
export declare function createCustomApiCallAction({ auth, baseUrl, authMapping, description, displayName, name, props }: { | ||
auth?: PieceAuthProperty; | ||
@@ -11,10 +11,19 @@ baseUrl: (auth?: unknown) => string; | ||
name?: string | null; | ||
props?: { | ||
url?: Partial<ReturnType<typeof Property.ShortText>>; | ||
method?: Partial<StaticDropdownProperty<HttpMethod, boolean>>; | ||
headers?: Partial<ReturnType<typeof Property.Object>>; | ||
queryParams?: Partial<ReturnType<typeof Property.Object>>; | ||
body?: Partial<ReturnType<typeof Property.Json>>; | ||
failsafe?: Partial<ReturnType<typeof Property.Checkbox>>; | ||
timeout?: Partial<ReturnType<typeof Property.Number>>; | ||
}; | ||
}): import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").BasicAuthProperty | import("@activepieces/pieces-framework").CustomAuthProperty<any> | import("@activepieces/pieces-framework").OAuth2Property<any> | import("@activepieces/pieces-framework").SecretTextProperty<boolean>, { | ||
url: import("@activepieces/pieces-framework").DynamicProperties<true>; | ||
method: import("@activepieces/pieces-framework").StaticDropdownProperty<HttpMethod, true>; | ||
headers: import("@activepieces/pieces-framework").ObjectProperty<true>; | ||
queryParams: import("@activepieces/pieces-framework").ObjectProperty<true>; | ||
body: import("@activepieces/pieces-framework").JsonProperty<false>; | ||
failsafe: import("@activepieces/pieces-framework").CheckboxProperty<false>; | ||
timeout: import("@activepieces/pieces-framework").NumberProperty<false>; | ||
method: StaticDropdownProperty<HttpMethod, false> | StaticDropdownProperty<HttpMethod, true>; | ||
headers: import("@activepieces/pieces-framework").ObjectProperty<false> | import("@activepieces/pieces-framework").ObjectProperty<true>; | ||
queryParams: import("@activepieces/pieces-framework").ObjectProperty<false> | import("@activepieces/pieces-framework").ObjectProperty<true>; | ||
body: import("@activepieces/pieces-framework").JsonProperty<false> | import("@activepieces/pieces-framework").JsonProperty<true>; | ||
failsafe: import("@activepieces/pieces-framework").CheckboxProperty<false> | import("@activepieces/pieces-framework").CheckboxProperty<true>; | ||
timeout: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>; | ||
}>; |
@@ -16,3 +16,4 @@ "use strict"; | ||
exports.getAccessTokenOrThrow = getAccessTokenOrThrow; | ||
function createCustomApiCallAction({ auth, baseUrl, authMapping, description, displayName, name }) { | ||
function createCustomApiCallAction({ auth, baseUrl, authMapping, description, displayName, name, props }) { | ||
var _a, _b, _c, _d, _e, _f; | ||
return (0, pieces_framework_1.createAction)({ | ||
@@ -29,17 +30,10 @@ name: name ? name : 'custom_api_call', | ||
refreshers: [], | ||
props: (_a) => tslib_1.__awaiter(this, [_a], void 0, function* ({ auth }) { | ||
props: (_g) => tslib_1.__awaiter(this, [_g], void 0, function* ({ auth }) { | ||
var _h; | ||
return { | ||
url: pieces_framework_1.Property.ShortText({ | ||
displayName: 'URL', | ||
description: 'The full URL to use, including the base URL', | ||
required: true, | ||
defaultValue: baseUrl(auth) | ||
}) | ||
url: pieces_framework_1.Property.ShortText(Object.assign({ displayName: 'URL', description: 'The full URL to use, including the base URL', required: true, defaultValue: baseUrl(auth) }, ((_h = props === null || props === void 0 ? void 0 : props.url) !== null && _h !== void 0 ? _h : {}))) | ||
}; | ||
}) | ||
}), | ||
method: pieces_framework_1.Property.StaticDropdown({ | ||
displayName: 'Method', | ||
required: true, | ||
options: { | ||
method: pieces_framework_1.Property.StaticDropdown(Object.assign({ displayName: 'Method', required: true, options: { | ||
options: Object.values(http_1.HttpMethod).map(v => { | ||
@@ -51,25 +45,8 @@ return { | ||
}) | ||
} | ||
}), | ||
headers: pieces_framework_1.Property.Object({ | ||
displayName: 'Headers', | ||
description: 'Authorization headers are injected automatically from your connection.', | ||
required: true, | ||
}), | ||
queryParams: pieces_framework_1.Property.Object({ | ||
displayName: 'Query Parameters', | ||
required: true, | ||
}), | ||
body: pieces_framework_1.Property.Json({ | ||
displayName: 'Body', | ||
required: false, | ||
}), | ||
failsafe: pieces_framework_1.Property.Checkbox({ | ||
displayName: 'No Error on Failure', | ||
required: false, | ||
}), | ||
timeout: pieces_framework_1.Property.Number({ | ||
displayName: 'Timeout (in seconds)', | ||
required: false, | ||
}), | ||
} }, ((_a = props === null || props === void 0 ? void 0 : props.method) !== null && _a !== void 0 ? _a : {}))), | ||
headers: pieces_framework_1.Property.Object(Object.assign({ displayName: 'Headers', description: 'Authorization headers are injected automatically from your connection.', required: true }, ((_b = props === null || props === void 0 ? void 0 : props.headers) !== null && _b !== void 0 ? _b : {}))), | ||
queryParams: pieces_framework_1.Property.Object(Object.assign({ displayName: 'Query Parameters', required: true }, ((_c = props === null || props === void 0 ? void 0 : props.queryParams) !== null && _c !== void 0 ? _c : {}))), | ||
body: pieces_framework_1.Property.Json(Object.assign({ displayName: 'Body', required: false }, ((_d = props === null || props === void 0 ? void 0 : props.body) !== null && _d !== void 0 ? _d : {}))), | ||
failsafe: pieces_framework_1.Property.Checkbox(Object.assign({ displayName: 'No Error on Failure', required: false }, ((_e = props === null || props === void 0 ? void 0 : props.failsafe) !== null && _e !== void 0 ? _e : {}))), | ||
timeout: pieces_framework_1.Property.Number(Object.assign({ displayName: 'Timeout (in seconds)', required: false }, ((_f = props === null || props === void 0 ? void 0 : props.timeout) !== null && _f !== void 0 ? _f : {}))), | ||
}, | ||
@@ -76,0 +53,0 @@ run: (context) => tslib_1.__awaiter(this, void 0, void 0, function* () { |
Sorry, the diff of this file is not supported yet
82895
1230