Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@activepieces/pieces-common

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@activepieces/pieces-common - npm Package Compare versions

Comparing version 0.2.13 to 0.2.14

6

package.json
{
"name": "@activepieces/pieces-common",
"version": "0.2.13",
"version": "0.2.14",
"type": "commonjs",

@@ -13,4 +13,4 @@ "dependencies": {

"semver": "7.6.0",
"@activepieces/pieces-framework": "0.7.30",
"@activepieces/shared": "0.10.105",
"@activepieces/pieces-framework": "0.7.31",
"@activepieces/shared": "0.10.106",
"tslib": "1.14.1"

@@ -17,0 +17,0 @@ },

import { OAuth2PropertyValue, PieceAuthProperty } from "@activepieces/pieces-framework";
import { HttpHeaders, HttpMethod } from "../http";
export declare const getAccessTokenOrThrow: (auth: OAuth2PropertyValue | undefined) => string;
export declare function createCustomApiCallAction({ auth, baseUrl, authMapping }: {
export declare function createCustomApiCallAction({ auth, baseUrl, authMapping, description, displayName, name }: {
auth?: PieceAuthProperty;
baseUrl: (auth?: unknown) => string;
authMapping?: (auth: unknown) => HttpHeaders;
authMapping?: (auth: unknown) => Promise<HttpHeaders>;
description?: string | null;
displayName?: string | null;
name?: string | null;
}): 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>, {

@@ -9,0 +12,0 @@ url: import("@activepieces/pieces-framework").DynamicProperties<true>;

@@ -16,7 +16,7 @@ "use strict";

exports.getAccessTokenOrThrow = getAccessTokenOrThrow;
function createCustomApiCallAction({ auth, baseUrl, authMapping }) {
function createCustomApiCallAction({ auth, baseUrl, authMapping, description, displayName, name }) {
return (0, pieces_framework_1.createAction)({
name: 'custom_api_call',
displayName: 'Custom API Call',
description: 'Send a custom API call to a specific endpoint',
name: name ? name : 'custom_api_call',
displayName: displayName ? displayName : 'Custom API Call',
description: description ? description : 'Make a custom API call to a specific endpoint',
auth: auth ? auth : undefined,

@@ -29,3 +29,3 @@ requireAuth: auth ? true : false,

refreshers: [],
props: ({ auth }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
props: (_a) => tslib_1.__awaiter(this, [_a], void 0, function* ({ auth }) {
return {

@@ -81,3 +81,6 @@ url: pieces_framework_1.Property.ShortText({

if (authMapping) {
headersValue = Object.assign(Object.assign({}, headersValue), authMapping(context.auth));
const headers = yield authMapping(context.auth);
if (headers) {
headersValue = Object.assign(Object.assign({}, headersValue), headers);
}
}

@@ -84,0 +87,0 @@ const request = {

@@ -14,4 +14,4 @@ "use strict";

sendRequest(request) {
var _a, _b;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
var _a, _b;
try {

@@ -18,0 +18,0 @@ process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';

@@ -36,3 +36,3 @@ import { Store } from '@activepieces/pieces-framework';

propsValue: PropsValue;
maxItemsToPoll?: number | undefined;
maxItemsToPoll?: number;
}): Promise<unknown[]>;

@@ -39,0 +39,0 @@ onEnable<AuthValue_1, PropsValue_1>(polling: Polling<AuthValue_1, PropsValue_1>, { store, auth, propsValue, }: {

@@ -12,5 +12,5 @@ "use strict";

exports.pollingHelper = {
poll(polling, { store, auth, propsValue, maxItemsToPoll, }) {
var _a, _b;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
poll(polling_1, _a) {
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { store, auth, propsValue, maxItemsToPoll, }) {
var _b, _c;
switch (polling.strategy) {

@@ -48,3 +48,3 @@ case DedupeStrategy.TIMEBASED: {

else {
newItems = (_a = items === null || items === void 0 ? void 0 : items.slice(0, lastItemIndex)) !== null && _a !== void 0 ? _a : [];
newItems = (_b = items === null || items === void 0 ? void 0 : items.slice(0, lastItemIndex)) !== null && _b !== void 0 ? _b : [];
}

@@ -56,3 +56,3 @@ // Sorted from newest to oldest

}
const newLastItem = (_b = newItems === null || newItems === void 0 ? void 0 : newItems[0]) === null || _b === void 0 ? void 0 : _b.id;
const newLastItem = (_c = newItems === null || newItems === void 0 ? void 0 : newItems[0]) === null || _c === void 0 ? void 0 : _c.id;
if (!(0, shared_1.isNil)(newLastItem)) {

@@ -66,5 +66,5 @@ yield store.put('lastItem', newLastItem);

},
onEnable(polling, { store, auth, propsValue, }) {
var _a;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
onEnable(polling_1, _a) {
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { store, auth, propsValue, }) {
var _b;
switch (polling.strategy) {

@@ -82,3 +82,3 @@ case DedupeStrategy.TIMEBASED: {

});
const lastItemId = (_a = items === null || items === void 0 ? void 0 : items[0]) === null || _a === void 0 ? void 0 : _a.id;
const lastItemId = (_b = items === null || items === void 0 ? void 0 : items[0]) === null || _b === void 0 ? void 0 : _b.id;
if (!(0, shared_1.isNil)(lastItemId)) {

@@ -104,4 +104,4 @@ yield store.put('lastItem', lastItemId);

},
test(polling, { auth, propsValue, store, }) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
test(polling_1, _a) {
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { auth, propsValue, store, }) {
let items = [];

@@ -108,0 +108,0 @@ switch (polling.strategy) {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc