@activepieces/pieces-common 0.2.37 → 0.3.0
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,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/pieces-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@anthropic-ai/sdk": "0.27.3",
|
|
7
|
-
"@sinclair/typebox": "0.
|
|
7
|
+
"@sinclair/typebox": "0.34.11",
|
|
8
8
|
"axios": "1.7.8",
|
|
9
9
|
"axios-retry": "4.4.1",
|
|
10
|
-
"deepmerge": "
|
|
10
|
+
"deepmerge-ts": "7.1.0",
|
|
11
11
|
"mime-types": "2.1.35",
|
|
12
|
-
"nanoid": "3.3.
|
|
12
|
+
"nanoid": "3.3.8",
|
|
13
13
|
"openai": "4.67.1",
|
|
14
14
|
"replicate": "0.34.1",
|
|
15
15
|
"semver": "7.6.0",
|
|
16
16
|
"zod": "3.23.8",
|
|
17
|
-
"@activepieces/pieces-framework": "0.7.
|
|
18
|
-
"@activepieces/shared": "0.10.
|
|
17
|
+
"@activepieces/pieces-framework": "0.7.42",
|
|
18
|
+
"@activepieces/shared": "0.10.133",
|
|
19
19
|
"tslib": "1.14.1"
|
|
20
20
|
},
|
|
21
21
|
"overrides": {
|
|
22
|
+
"cross-spawn": "7.0.6",
|
|
22
23
|
"@tryfabric/martian": {
|
|
23
24
|
"@notionhq/client": "$@notionhq/client"
|
|
24
25
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Store } from '@activepieces/pieces-framework';
|
|
1
|
+
import { FilesService, Store } from '@activepieces/pieces-framework';
|
|
2
2
|
interface TimebasedPolling<AuthValue, PropsValue> {
|
|
3
3
|
strategy: DedupeStrategy.TIMEBASED;
|
|
4
4
|
items: (params: {
|
|
@@ -16,6 +16,7 @@ interface LastItemPolling<AuthValue, PropsValue> {
|
|
|
16
16
|
items: (params: {
|
|
17
17
|
auth: AuthValue;
|
|
18
18
|
store: Store;
|
|
19
|
+
files?: FilesService;
|
|
19
20
|
propsValue: PropsValue;
|
|
20
21
|
lastItemId: unknown;
|
|
21
22
|
}) => Promise<{
|
|
@@ -29,10 +30,11 @@ export declare enum DedupeStrategy {
|
|
|
29
30
|
}
|
|
30
31
|
export type Polling<AuthValue, PropsValue> = TimebasedPolling<AuthValue, PropsValue> | LastItemPolling<AuthValue, PropsValue>;
|
|
31
32
|
export declare const pollingHelper: {
|
|
32
|
-
poll<AuthValue, PropsValue>(polling: Polling<AuthValue, PropsValue>, { store, auth, propsValue, maxItemsToPoll, }: {
|
|
33
|
+
poll<AuthValue, PropsValue>(polling: Polling<AuthValue, PropsValue>, { store, auth, propsValue, maxItemsToPoll, files, }: {
|
|
33
34
|
store: Store;
|
|
34
35
|
auth: AuthValue;
|
|
35
36
|
propsValue: PropsValue;
|
|
37
|
+
files: FilesService;
|
|
36
38
|
maxItemsToPoll?: number;
|
|
37
39
|
}): Promise<unknown[]>;
|
|
38
40
|
onEnable<AuthValue, PropsValue>(polling: Polling<AuthValue, PropsValue>, { store, auth, propsValue, }: {
|
|
@@ -45,10 +47,11 @@ export declare const pollingHelper: {
|
|
|
45
47
|
auth: AuthValue;
|
|
46
48
|
propsValue: PropsValue;
|
|
47
49
|
}): Promise<void>;
|
|
48
|
-
test<AuthValue, PropsValue>(polling: Polling<AuthValue, PropsValue>, { auth, propsValue, store, }: {
|
|
50
|
+
test<AuthValue, PropsValue>(polling: Polling<AuthValue, PropsValue>, { auth, propsValue, store, files, }: {
|
|
49
51
|
store: Store;
|
|
50
52
|
auth: AuthValue;
|
|
51
53
|
propsValue: PropsValue;
|
|
54
|
+
files: FilesService;
|
|
52
55
|
}): Promise<unknown[]>;
|
|
53
56
|
};
|
|
54
57
|
export {};
|
package/src/lib/polling/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var DedupeStrategy;
|
|
|
10
10
|
})(DedupeStrategy || (exports.DedupeStrategy = DedupeStrategy = {}));
|
|
11
11
|
exports.pollingHelper = {
|
|
12
12
|
poll(polling_1, _a) {
|
|
13
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { store, auth, propsValue, maxItemsToPoll, }) {
|
|
13
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { store, auth, propsValue, maxItemsToPoll, files, }) {
|
|
14
14
|
var _b, _c;
|
|
15
15
|
switch (polling.strategy) {
|
|
16
16
|
case DedupeStrategy.TIMEBASED: {
|
|
@@ -37,6 +37,7 @@ exports.pollingHelper = {
|
|
|
37
37
|
auth,
|
|
38
38
|
propsValue,
|
|
39
39
|
lastItemId,
|
|
40
|
+
files,
|
|
40
41
|
});
|
|
41
42
|
const lastItemIndex = items.findIndex((f) => f.id === lastItemId);
|
|
42
43
|
let newItems = [];
|
|
@@ -97,7 +98,7 @@ exports.pollingHelper = {
|
|
|
97
98
|
});
|
|
98
99
|
},
|
|
99
100
|
test(polling_1, _a) {
|
|
100
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { auth, propsValue, store, }) {
|
|
101
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (polling, { auth, propsValue, store, files, }) {
|
|
101
102
|
let items = [];
|
|
102
103
|
switch (polling.strategy) {
|
|
103
104
|
case DedupeStrategy.TIMEBASED: {
|
|
@@ -115,6 +116,7 @@ exports.pollingHelper = {
|
|
|
115
116
|
auth,
|
|
116
117
|
propsValue,
|
|
117
118
|
lastItemId: null,
|
|
119
|
+
files,
|
|
118
120
|
});
|
|
119
121
|
break;
|
|
120
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/common/src/lib/polling/index.ts"],"names":[],"mappings":";;;;AACA,iDAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../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