@activepieces/piece-microsoft-sharepoint 0.1.2 → 0.2.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 +10 -15
- package/src/i18n/translation.json +5 -5
- package/src/lib/actions/copy-item-within-site.d.ts +4 -4
- package/src/lib/actions/copy-item-within-site.js +1 -0
- package/src/lib/actions/copy-item-within-site.js.map +1 -1
- package/src/lib/actions/copy-item.d.ts +6 -6
- package/src/lib/actions/create-folder.d.ts +2 -2
- package/src/lib/actions/create-list-item.d.ts +3 -3
- package/src/lib/actions/create-list.d.ts +1 -1
- package/src/lib/actions/delete-list-item.d.ts +3 -3
- package/src/lib/actions/find-file.d.ts +3 -3
- package/src/lib/actions/find-file.js +1 -0
- package/src/lib/actions/find-file.js.map +1 -1
- package/src/lib/actions/get-folder-contents.d.ts +3 -3
- package/src/lib/actions/get-folder-contents.js +1 -0
- package/src/lib/actions/get-folder-contents.js.map +1 -1
- package/src/lib/actions/get-site-information.d.ts +1 -1
- package/src/lib/actions/move-file.d.ts +4 -4
- package/src/lib/actions/move-file.js +2 -0
- package/src/lib/actions/move-file.js.map +1 -1
- package/src/lib/actions/publish-page.d.ts +2 -2
- package/src/lib/actions/search-list-item.d.ts +2 -2
- package/src/lib/actions/update-list-item.d.ts +4 -4
- package/src/lib/actions/upload-file.d.ts +2 -2
- package/src/lib/common/index.d.ts +9 -9
- package/src/lib/common/index.js +9 -0
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/triggers/new-file-in-folder.d.ts +9 -9
- package/src/lib/triggers/new-file-in-folder.js +1 -0
- package/src/lib/triggers/new-file-in-folder.js.map +1 -1
- package/src/lib/triggers/new-file-in-subfolders.d.ts +9 -9
- package/src/lib/triggers/new-file-in-subfolders.js +1 -0
- package/src/lib/triggers/new-file-in-subfolders.js.map +1 -1
- package/src/lib/triggers/new-list-item.d.ts +6 -6
- package/src/lib/triggers/new-list-item.js +64 -77
- package/src/lib/triggers/new-list-item.js.map +1 -1
- package/src/lib/triggers/new-list.d.ts +3 -3
- package/src/lib/triggers/new-list.js +59 -71
- package/src/lib/triggers/new-list.js.map +1 -1
- package/src/lib/triggers/new-or-updated-file.d.ts +9 -9
- package/src/lib/triggers/new-or-updated-file.js +83 -81
- package/src/lib/triggers/new-or-updated-file.js.map +1 -1
- package/src/lib/triggers/new-or-updated-folder.d.ts +9 -9
- package/src/lib/triggers/new-or-updated-folder.js +83 -81
- package/src/lib/triggers/new-or-updated-folder.js.map +1 -1
- package/src/lib/triggers/new-or-updated-list.d.ts +3 -3
- package/src/lib/triggers/new-or-updated-list.js +71 -69
- package/src/lib/triggers/new-or-updated-list.js.map +1 -1
- package/src/lib/triggers/updated-list-item.d.ts +6 -6
|
@@ -6,16 +6,70 @@ const __1 = require("../../");
|
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
9
|
-
const
|
|
9
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
11
|
+
const polling = {
|
|
12
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
13
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
14
|
+
const { siteId, driveId, folderId } = propsValue;
|
|
15
|
+
const isTestMode = lastFetchEpochMS === 0;
|
|
16
|
+
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
17
|
+
authProvider: {
|
|
18
|
+
getAccessToken: () => Promise.resolve(auth.access_token),
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const files = [];
|
|
22
|
+
const endpoint = folderId !== 'root'
|
|
23
|
+
? `/sites/${siteId}/drive/items/${folderId}/children`
|
|
24
|
+
: `/sites/${siteId}/drives/${driveId}/items/root/children`;
|
|
25
|
+
let response = yield client
|
|
26
|
+
.api(endpoint)
|
|
27
|
+
.orderby('lastModifiedDateTime desc')
|
|
28
|
+
.get();
|
|
29
|
+
let stop = false;
|
|
30
|
+
while (!stop && response.value.length > 0) {
|
|
31
|
+
for (const item of response.value) {
|
|
32
|
+
if (!item.file)
|
|
33
|
+
continue;
|
|
34
|
+
const modifiedMs = (0, dayjs_1.default)(item.lastModifiedDateTime).valueOf();
|
|
35
|
+
if (isTestMode) {
|
|
36
|
+
files.push(item);
|
|
37
|
+
if (files.length >= 10) {
|
|
38
|
+
stop = true;
|
|
39
|
+
}
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (modifiedMs < lastFetchEpochMS) {
|
|
43
|
+
stop = true;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
files.push(item);
|
|
47
|
+
}
|
|
48
|
+
if (stop || !response['@odata.nextLink'])
|
|
49
|
+
break;
|
|
50
|
+
response = yield client.api(response['@odata.nextLink']).get();
|
|
51
|
+
}
|
|
52
|
+
files.sort((a, b) => {
|
|
53
|
+
const aDate = (0, dayjs_1.default)(a.lastModifiedDateTime);
|
|
54
|
+
const bDate = (0, dayjs_1.default)(b.lastModifiedDateTime);
|
|
55
|
+
return bDate.diff(aDate);
|
|
56
|
+
});
|
|
57
|
+
return files.map((file) => ({
|
|
58
|
+
epochMilliSeconds: (0, dayjs_1.default)(file.lastModifiedDateTime).valueOf(),
|
|
59
|
+
data: file,
|
|
60
|
+
}));
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
10
63
|
exports.newOrUpdatedFileTrigger = (0, pieces_framework_1.createTrigger)({
|
|
11
64
|
auth: __1.microsoftSharePointAuth,
|
|
12
65
|
name: 'new_or_updated_file',
|
|
13
66
|
displayName: 'New or Updated File',
|
|
14
|
-
description: '
|
|
67
|
+
description: 'Triggers when a file is created or updated in a given folder.',
|
|
15
68
|
props: {
|
|
16
69
|
siteId: common_1.microsoftSharePointCommon.siteId,
|
|
17
70
|
driveId: common_1.microsoftSharePointCommon.driveId,
|
|
18
71
|
folderId: pieces_framework_1.Property.Dropdown({
|
|
72
|
+
auth: __1.microsoftSharePointAuth,
|
|
19
73
|
displayName: 'Folder to Monitor',
|
|
20
74
|
description: 'The folder to watch for new or updated files. Select "Root Folder" for the top-level folder of the drive.',
|
|
21
75
|
required: true,
|
|
@@ -34,11 +88,9 @@ exports.newOrUpdatedFileTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
34
88
|
getAccessToken: () => Promise.resolve(authValue.access_token),
|
|
35
89
|
},
|
|
36
90
|
});
|
|
37
|
-
const options = [
|
|
38
|
-
{ label: 'Root Folder', value: 'root' },
|
|
39
|
-
];
|
|
91
|
+
const options = [{ label: 'Root Folder', value: 'root' }];
|
|
40
92
|
let response = yield client
|
|
41
|
-
.api(`/drives/${driveId}/root/children?$filter=folder ne null&$select=id,name`)
|
|
93
|
+
.api(`/sites/${siteId}/drives/${driveId}/items/root/children?$filter=folder ne null&$select=id,name`)
|
|
42
94
|
.get();
|
|
43
95
|
while (response.value.length > 0) {
|
|
44
96
|
for (const item of response.value) {
|
|
@@ -55,95 +107,45 @@ exports.newOrUpdatedFileTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
55
107
|
}),
|
|
56
108
|
}),
|
|
57
109
|
},
|
|
58
|
-
type: pieces_framework_1.TriggerStrategy.
|
|
110
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
59
111
|
sampleData: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
112
|
+
id: '01DRYVE_ID_GOES_HERE',
|
|
113
|
+
name: 'Updated-Financials.xlsx',
|
|
114
|
+
webUrl: 'https://contoso.sharepoint.com/Shared%20Documents/Updated-Financials.xlsx',
|
|
115
|
+
size: 65432,
|
|
116
|
+
createdDateTime: '2025-09-26T10:00:00Z',
|
|
117
|
+
lastModifiedDateTime: '2025-09-26T14:34:00Z',
|
|
118
|
+
file: {
|
|
119
|
+
mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
68
120
|
},
|
|
69
|
-
|
|
121
|
+
parentReference: { id: 'PARENT_FOLDER_ID_HERE' },
|
|
70
122
|
},
|
|
71
123
|
onEnable(context) {
|
|
72
124
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
125
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
126
|
+
auth: context.auth,
|
|
127
|
+
store: context.store,
|
|
128
|
+
propsValue: context.propsValue,
|
|
78
129
|
});
|
|
79
|
-
try {
|
|
80
|
-
const effectiveFolderId = folderId === 'root'
|
|
81
|
-
? (yield client.api(`/drives/${driveId}/root`).get()).id
|
|
82
|
-
: folderId;
|
|
83
|
-
const expirationDateTime = new Date();
|
|
84
|
-
expirationDateTime.setDate(expirationDateTime.getDate() + 2);
|
|
85
|
-
const subscription = yield client.api('/subscriptions').post({
|
|
86
|
-
changeType: 'created,updated',
|
|
87
|
-
notificationUrl: context.webhookUrl,
|
|
88
|
-
resource: `/sites/${siteId}/drive/items/${effectiveFolderId}/children`,
|
|
89
|
-
expirationDateTime: expirationDateTime.toISOString(),
|
|
90
|
-
clientState: clientState,
|
|
91
|
-
});
|
|
92
|
-
yield context.store.put('subscriptionId', subscription.id);
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
throw new Error(`Failed to create subscription: ${error.message || 'Unknown error'}`);
|
|
96
|
-
}
|
|
97
130
|
});
|
|
98
131
|
},
|
|
99
132
|
onDisable(context) {
|
|
100
133
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
catch (error) {
|
|
112
|
-
console.warn(`Error deleting subscription ${subscriptionId}:`, error);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
yield context.store.delete('subscriptionId');
|
|
134
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
135
|
+
auth: context.auth,
|
|
136
|
+
store: context.store,
|
|
137
|
+
propsValue: context.propsValue,
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
test(context) {
|
|
142
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
116
144
|
});
|
|
117
145
|
},
|
|
118
146
|
run(context) {
|
|
119
147
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
|
|
121
|
-
const notifications = (_a = context.payload.body) === null || _a === void 0 ? void 0 : _a.value;
|
|
122
|
-
if (!notifications || !Array.isArray(notifications)) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
const validNotifications = notifications.filter((notif) => notif.clientState === clientState);
|
|
126
|
-
if (validNotifications.length === 0) {
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
130
|
-
authProvider: {
|
|
131
|
-
getAccessToken: () => Promise.resolve(context.auth.access_token),
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
const changedFilePayloads = [];
|
|
135
|
-
for (const notification of validNotifications) {
|
|
136
|
-
try {
|
|
137
|
-
const changedFile = yield client.api(notification.resource).get();
|
|
138
|
-
if (changedFile.file) {
|
|
139
|
-
changedFilePayloads.push(changedFile);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
console.error('Error fetching file from notification:', error);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return changedFilePayloads;
|
|
148
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
147
149
|
});
|
|
148
150
|
},
|
|
149
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-or-updated-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-sharepoint/src/lib/triggers/new-or-updated-file.ts"],"names":[],"mappings":";;;;AAAA,8BAAiD;AACjD,qEAMwC;AACxC,sCAAsD;AACtD,8EAA2E;
|
|
1
|
+
{"version":3,"file":"new-or-updated-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-sharepoint/src/lib/triggers/new-or-updated-file.ts"],"names":[],"mappings":";;;;AAAA,8BAAiD;AACjD,qEAMwC;AACxC,sCAAsD;AACtD,8EAA2E;AAE3E,+DAAqF;AACrF,0DAA0B;AAQ1B,MAAM,OAAO,GAAsF;IAClG,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE;QACnD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QACjD,MAAM,UAAU,GAAG,gBAAgB,KAAK,CAAC,CAAC;QAE1C,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;YACxC,YAAY,EAAE;gBACb,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;aACxD;SACD,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,MAAM,QAAQ,GACb,QAAQ,KAAK,MAAM;YAClB,CAAC,CAAC,UAAU,MAAM,gBAAgB,QAAQ,WAAW;YACrD,CAAC,CAAC,UAAU,MAAM,WAAW,OAAO,sBAAsB,CAAC;QAE7D,IAAI,QAAQ,GAAmB,MAAM,MAAM;aACzC,GAAG,CAAC,QAAQ,CAAC;aACb,OAAO,CAAC,2BAA2B,CAAC;aACpC,GAAG,EAAE,CAAC;QAER,IAAI,I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ACK,SAAS,CAAC,OAAO;;YACtB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE;gBACtC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC9B,CAAC,CAAC;QACJ,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YACjB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
2
|
export declare const newOrUpdatedFolderTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
3
|
-
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
4
|
-
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
5
|
-
parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
3
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
4
|
+
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
5
|
+
parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
6
6
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
7
|
-
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
8
|
-
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
9
|
-
parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
7
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
8
|
+
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
9
|
+
parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
10
10
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
11
|
-
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
12
|
-
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
13
|
-
parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
11
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
12
|
+
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
13
|
+
parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
14
14
|
}>;
|
|
@@ -6,16 +6,70 @@ const __1 = require("../../");
|
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
9
|
-
const
|
|
9
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
10
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
11
|
+
const polling = {
|
|
12
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
13
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
14
|
+
const { siteId, driveId, parentFolderId } = propsValue;
|
|
15
|
+
const isTestMode = lastFetchEpochMS === 0;
|
|
16
|
+
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
17
|
+
authProvider: {
|
|
18
|
+
getAccessToken: () => Promise.resolve(auth.access_token),
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const folders = [];
|
|
22
|
+
const endpoint = parentFolderId !== 'root'
|
|
23
|
+
? `/sites/${siteId}/drive/items/${parentFolderId}/children`
|
|
24
|
+
: `/sites/${siteId}/drives/${driveId}/items/root/children`;
|
|
25
|
+
let response = yield client
|
|
26
|
+
.api(endpoint)
|
|
27
|
+
.orderby('lastModifiedDateTime desc')
|
|
28
|
+
.get();
|
|
29
|
+
let stop = false;
|
|
30
|
+
while (!stop && response.value.length > 0) {
|
|
31
|
+
for (const item of response.value) {
|
|
32
|
+
if (!item.folder)
|
|
33
|
+
continue;
|
|
34
|
+
const modifiedMs = (0, dayjs_1.default)(item.lastModifiedDateTime).valueOf();
|
|
35
|
+
if (isTestMode) {
|
|
36
|
+
folders.push(item);
|
|
37
|
+
if (folders.length >= 10) {
|
|
38
|
+
stop = true;
|
|
39
|
+
}
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (modifiedMs < lastFetchEpochMS) {
|
|
43
|
+
stop = true;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
folders.push(item);
|
|
47
|
+
}
|
|
48
|
+
if (stop || !response['@odata.nextLink'])
|
|
49
|
+
break;
|
|
50
|
+
response = yield client.api(response['@odata.nextLink']).get();
|
|
51
|
+
}
|
|
52
|
+
folders.sort((a, b) => {
|
|
53
|
+
const aDate = (0, dayjs_1.default)(a.lastModifiedDateTime);
|
|
54
|
+
const bDate = (0, dayjs_1.default)(b.lastModifiedDateTime);
|
|
55
|
+
return bDate.diff(aDate);
|
|
56
|
+
});
|
|
57
|
+
return folders.map((folder) => ({
|
|
58
|
+
epochMilliSeconds: (0, dayjs_1.default)(folder.lastModifiedDateTime).valueOf(),
|
|
59
|
+
data: folder,
|
|
60
|
+
}));
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
10
63
|
exports.newOrUpdatedFolderTrigger = (0, pieces_framework_1.createTrigger)({
|
|
11
64
|
auth: __1.microsoftSharePointAuth,
|
|
12
65
|
name: 'new_or_updated_folder',
|
|
13
66
|
displayName: 'New or Updated Folder',
|
|
14
|
-
description: '
|
|
67
|
+
description: 'Triggers when a folder is created or updated (e.g., name change).',
|
|
15
68
|
props: {
|
|
16
69
|
siteId: common_1.microsoftSharePointCommon.siteId,
|
|
17
70
|
driveId: common_1.microsoftSharePointCommon.driveId,
|
|
18
71
|
parentFolderId: pieces_framework_1.Property.Dropdown({
|
|
72
|
+
auth: __1.microsoftSharePointAuth,
|
|
19
73
|
displayName: 'Parent Folder to Monitor',
|
|
20
74
|
description: 'The folder to watch for new or updated subfolders. Select "Root Folder" to monitor the top-level of the drive.',
|
|
21
75
|
required: true,
|
|
@@ -34,11 +88,9 @@ exports.newOrUpdatedFolderTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
34
88
|
getAccessToken: () => Promise.resolve(authValue.access_token),
|
|
35
89
|
},
|
|
36
90
|
});
|
|
37
|
-
const options = [
|
|
38
|
-
{ label: 'Root Folder', value: 'root' },
|
|
39
|
-
];
|
|
91
|
+
const options = [{ label: 'Root Folder', value: 'root' }];
|
|
40
92
|
let response = yield client
|
|
41
|
-
.api(`/drives/${driveId}/root/children?$filter=folder ne null&$select=id,name`)
|
|
93
|
+
.api(`/sites/${siteId}/drives/${driveId}/items/root/children?$filter=folder ne null&$select=id,name`)
|
|
42
94
|
.get();
|
|
43
95
|
while (response.value.length > 0) {
|
|
44
96
|
for (const item of response.value) {
|
|
@@ -55,95 +107,45 @@ exports.newOrUpdatedFolderTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
55
107
|
}),
|
|
56
108
|
}),
|
|
57
109
|
},
|
|
58
|
-
type: pieces_framework_1.TriggerStrategy.
|
|
110
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
59
111
|
sampleData: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
112
|
+
id: '01DRYVE_FOLDER_ID_GOES_HERE',
|
|
113
|
+
name: 'Project Alpha',
|
|
114
|
+
webUrl: 'https://contoso.sharepoint.com/Shared%20Documents/Project%20Alpha',
|
|
115
|
+
size: 0,
|
|
116
|
+
createdDateTime: '2025-09-26T14:50:00Z',
|
|
117
|
+
lastModifiedDateTime: '2025-09-26T14:50:00Z',
|
|
118
|
+
folder: {
|
|
119
|
+
childCount: 0,
|
|
68
120
|
},
|
|
69
|
-
|
|
121
|
+
parentReference: { id: 'PARENT_FOLDER_ID_HERE' },
|
|
70
122
|
},
|
|
71
123
|
onEnable(context) {
|
|
72
124
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
125
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
126
|
+
auth: context.auth,
|
|
127
|
+
store: context.store,
|
|
128
|
+
propsValue: context.propsValue,
|
|
78
129
|
});
|
|
79
|
-
try {
|
|
80
|
-
const effectiveParentId = parentFolderId === 'root'
|
|
81
|
-
? (yield client.api(`/drives/${driveId}/root`).get()).id
|
|
82
|
-
: parentFolderId;
|
|
83
|
-
const expirationDateTime = new Date();
|
|
84
|
-
expirationDateTime.setDate(expirationDateTime.getDate() + 2);
|
|
85
|
-
const subscription = yield client.api('/subscriptions').post({
|
|
86
|
-
changeType: 'created,updated',
|
|
87
|
-
notificationUrl: context.webhookUrl,
|
|
88
|
-
resource: `/sites/${siteId}/drive/items/${effectiveParentId}/children`,
|
|
89
|
-
expirationDateTime: expirationDateTime.toISOString(),
|
|
90
|
-
clientState: clientState,
|
|
91
|
-
});
|
|
92
|
-
yield context.store.put('subscriptionId', subscription.id);
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
throw new Error(`Failed to create subscription: ${error.message || 'Unknown error'}`);
|
|
96
|
-
}
|
|
97
130
|
});
|
|
98
131
|
},
|
|
99
132
|
onDisable(context) {
|
|
100
133
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
catch (error) {
|
|
112
|
-
console.warn(`Error deleting subscription ${subscriptionId}:`, error);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
yield context.store.delete('subscriptionId');
|
|
134
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
135
|
+
auth: context.auth,
|
|
136
|
+
store: context.store,
|
|
137
|
+
propsValue: context.propsValue,
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
test(context) {
|
|
142
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
116
144
|
});
|
|
117
145
|
},
|
|
118
146
|
run(context) {
|
|
119
147
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
|
|
121
|
-
const notifications = (_a = context.payload.body) === null || _a === void 0 ? void 0 : _a.value;
|
|
122
|
-
if (!notifications || !Array.isArray(notifications)) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
const validNotifications = notifications.filter((notif) => notif.clientState === clientState);
|
|
126
|
-
if (validNotifications.length === 0) {
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
130
|
-
authProvider: {
|
|
131
|
-
getAccessToken: () => Promise.resolve(context.auth.access_token),
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
const folderPayloads = [];
|
|
135
|
-
for (const notification of validNotifications) {
|
|
136
|
-
try {
|
|
137
|
-
const changedItem = yield client.api(notification.resource).get();
|
|
138
|
-
if (changedItem.folder) {
|
|
139
|
-
folderPayloads.push(changedItem);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
console.error('Error fetching folder from notification:', error);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return folderPayloads;
|
|
148
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
147
149
|
});
|
|
148
150
|
},
|
|
149
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-or-updated-folder.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-sharepoint/src/lib/triggers/new-or-updated-folder.ts"],"names":[],"mappings":";;;;AAAA,8BAAiD;AACjD,qEAMwC;AACxC,sCAAsD;AACtD,8EAA2E;
|
|
1
|
+
{"version":3,"file":"new-or-updated-folder.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-sharepoint/src/lib/triggers/new-or-updated-folder.ts"],"names":[],"mappings":";;;;AAAA,8BAAiD;AACjD,qEAMwC;AACxC,sCAAsD;AACtD,8EAA2E;AAE3E,0DAA0B;AAC1B,+DAAqF;AAQrF,MAAM,OAAO,GAAsF;IAClG,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAA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
2
|
export declare const newOrUpdatedListTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
3
|
-
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
3
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
4
4
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
5
|
-
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
5
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
6
6
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
7
|
-
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true
|
|
7
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
8
8
|
}>;
|