@activepieces/piece-microsoft-sharepoint 0.3.3 → 0.3.5

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.
Files changed (109) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +26 -81
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/copy-item-within-site.d.ts +0 -9
  7. package/src/lib/actions/copy-item-within-site.d.ts.map +0 -1
  8. package/src/lib/actions/copy-item-within-site.js +0 -161
  9. package/src/lib/actions/copy-item-within-site.js.map +0 -1
  10. package/src/lib/actions/copy-item.d.ts +0 -11
  11. package/src/lib/actions/copy-item.d.ts.map +0 -1
  12. package/src/lib/actions/copy-item.js +0 -121
  13. package/src/lib/actions/copy-item.js.map +0 -1
  14. package/src/lib/actions/create-folder.d.ts +0 -7
  15. package/src/lib/actions/create-folder.d.ts.map +0 -1
  16. package/src/lib/actions/create-folder.js +0 -48
  17. package/src/lib/actions/create-folder.js.map +0 -1
  18. package/src/lib/actions/create-list-item.d.ts +0 -6
  19. package/src/lib/actions/create-list-item.d.ts.map +0 -1
  20. package/src/lib/actions/create-list-item.js +0 -47
  21. package/src/lib/actions/create-list-item.js.map +0 -1
  22. package/src/lib/actions/create-list.d.ts +0 -6
  23. package/src/lib/actions/create-list.d.ts.map +0 -1
  24. package/src/lib/actions/create-list.js +0 -45
  25. package/src/lib/actions/create-list.js.map +0 -1
  26. package/src/lib/actions/delete-list-item.d.ts +0 -6
  27. package/src/lib/actions/delete-list-item.d.ts.map +0 -1
  28. package/src/lib/actions/delete-list-item.js +0 -37
  29. package/src/lib/actions/delete-list-item.js.map +0 -1
  30. package/src/lib/actions/find-file.d.ts +0 -9
  31. package/src/lib/actions/find-file.d.ts.map +0 -1
  32. package/src/lib/actions/find-file.js +0 -140
  33. package/src/lib/actions/find-file.js.map +0 -1
  34. package/src/lib/actions/find-site.d.ts +0 -4
  35. package/src/lib/actions/find-site.d.ts.map +0 -1
  36. package/src/lib/actions/find-site.js +0 -56
  37. package/src/lib/actions/find-site.js.map +0 -1
  38. package/src/lib/actions/get-folder-contents.d.ts +0 -10
  39. package/src/lib/actions/get-folder-contents.d.ts.map +0 -1
  40. package/src/lib/actions/get-folder-contents.js +0 -115
  41. package/src/lib/actions/get-folder-contents.js.map +0 -1
  42. package/src/lib/actions/get-site-information.d.ts +0 -5
  43. package/src/lib/actions/get-site-information.d.ts.map +0 -1
  44. package/src/lib/actions/get-site-information.js +0 -42
  45. package/src/lib/actions/get-site-information.js.map +0 -1
  46. package/src/lib/actions/move-file.d.ts +0 -8
  47. package/src/lib/actions/move-file.d.ts.map +0 -1
  48. package/src/lib/actions/move-file.js +0 -161
  49. package/src/lib/actions/move-file.js.map +0 -1
  50. package/src/lib/actions/publish-page.d.ts +0 -5
  51. package/src/lib/actions/publish-page.d.ts.map +0 -1
  52. package/src/lib/actions/publish-page.js +0 -56
  53. package/src/lib/actions/publish-page.js.map +0 -1
  54. package/src/lib/actions/search-list-item.d.ts +0 -6
  55. package/src/lib/actions/search-list-item.d.ts.map +0 -1
  56. package/src/lib/actions/search-list-item.js +0 -44
  57. package/src/lib/actions/search-list-item.js.map +0 -1
  58. package/src/lib/actions/update-list-item.d.ts +0 -7
  59. package/src/lib/actions/update-list-item.d.ts.map +0 -1
  60. package/src/lib/actions/update-list-item.js +0 -46
  61. package/src/lib/actions/update-list-item.js.map +0 -1
  62. package/src/lib/actions/upload-file.d.ts +0 -8
  63. package/src/lib/actions/upload-file.d.ts.map +0 -1
  64. package/src/lib/actions/upload-file.js +0 -52
  65. package/src/lib/actions/upload-file.js.map +0 -1
  66. package/src/lib/auth.d.ts +0 -2
  67. package/src/lib/auth.d.ts.map +0 -1
  68. package/src/lib/auth.js +0 -37
  69. package/src/lib/auth.js.map +0 -1
  70. package/src/lib/common/index.d.ts +0 -15
  71. package/src/lib/common/index.d.ts.map +0 -1
  72. package/src/lib/common/index.js +0 -416
  73. package/src/lib/common/index.js.map +0 -1
  74. package/src/lib/common/microsoft-cloud.d.ts +0 -5
  75. package/src/lib/common/microsoft-cloud.d.ts.map +0 -1
  76. package/src/lib/common/microsoft-cloud.js +0 -38
  77. package/src/lib/common/microsoft-cloud.js.map +0 -1
  78. package/src/lib/triggers/new-file-in-folder.d.ts +0 -19
  79. package/src/lib/triggers/new-file-in-folder.d.ts.map +0 -1
  80. package/src/lib/triggers/new-file-in-folder.js +0 -167
  81. package/src/lib/triggers/new-file-in-folder.js.map +0 -1
  82. package/src/lib/triggers/new-file-in-subfolders.d.ts +0 -19
  83. package/src/lib/triggers/new-file-in-subfolders.d.ts.map +0 -1
  84. package/src/lib/triggers/new-file-in-subfolders.js +0 -163
  85. package/src/lib/triggers/new-file-in-subfolders.js.map +0 -1
  86. package/src/lib/triggers/new-list-item.d.ts +0 -15
  87. package/src/lib/triggers/new-list-item.d.ts.map +0 -1
  88. package/src/lib/triggers/new-list-item.js +0 -99
  89. package/src/lib/triggers/new-list-item.js.map +0 -1
  90. package/src/lib/triggers/new-list.d.ts +0 -11
  91. package/src/lib/triggers/new-list.d.ts.map +0 -1
  92. package/src/lib/triggers/new-list.js +0 -93
  93. package/src/lib/triggers/new-list.js.map +0 -1
  94. package/src/lib/triggers/new-or-updated-file.d.ts +0 -19
  95. package/src/lib/triggers/new-or-updated-file.d.ts.map +0 -1
  96. package/src/lib/triggers/new-or-updated-file.js +0 -159
  97. package/src/lib/triggers/new-or-updated-file.js.map +0 -1
  98. package/src/lib/triggers/new-or-updated-folder.d.ts +0 -19
  99. package/src/lib/triggers/new-or-updated-folder.d.ts.map +0 -1
  100. package/src/lib/triggers/new-or-updated-folder.js +0 -159
  101. package/src/lib/triggers/new-or-updated-folder.js.map +0 -1
  102. package/src/lib/triggers/new-or-updated-list.d.ts +0 -11
  103. package/src/lib/triggers/new-or-updated-list.d.ts.map +0 -1
  104. package/src/lib/triggers/new-or-updated-list.js +0 -107
  105. package/src/lib/triggers/new-or-updated-list.js.map +0 -1
  106. package/src/lib/triggers/updated-list-item.d.ts +0 -15
  107. package/src/lib/triggers/updated-list-item.d.ts.map +0 -1
  108. package/src/lib/triggers/updated-list-item.js +0 -117
  109. package/src/lib/triggers/updated-list-item.js.map +0 -1
@@ -1,167 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newFileInFolderTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const microsoft_cloud_1 = require("../common/microsoft-cloud");
8
- const common_1 = require("../common");
9
- const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
10
- const clientState = 'activepieces_sharepoint_trigger';
11
- exports.newFileInFolderTrigger = (0, pieces_framework_1.createTrigger)({
12
- auth: auth_1.microsoftSharePointAuth,
13
- name: 'new_file_in_folder',
14
- displayName: 'New File in Folder',
15
- description: 'Fires when a new file is created or added in a specific folder.',
16
- props: {
17
- siteId: common_1.microsoftSharePointCommon.siteId,
18
- driveId: common_1.microsoftSharePointCommon.driveId,
19
- folderId: pieces_framework_1.Property.Dropdown({
20
- auth: auth_1.microsoftSharePointAuth,
21
- displayName: 'Folder to Monitor',
22
- description: 'The folder to watch for new files. Select "Root Folder" for the top-level folder of the drive.',
23
- required: true,
24
- refreshers: ['siteId', 'driveId'],
25
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId, driveId }) {
26
- var _b;
27
- if (!auth || !siteId || !driveId) {
28
- return {
29
- disabled: true,
30
- placeholder: 'Select a site and drive first.',
31
- options: [],
32
- };
33
- }
34
- const authValue = auth;
35
- const cloud = (_b = authValue.props) === null || _b === void 0 ? void 0 : _b['cloud'];
36
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
37
- authProvider: {
38
- getAccessToken: () => Promise.resolve(authValue.access_token),
39
- },
40
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
41
- });
42
- const options = [
43
- { label: 'Root Folder', value: 'root' },
44
- ];
45
- let response = yield client
46
- .api(`/drives/${driveId}/root/children?$filter=folder ne null&$select=id,name`)
47
- .get();
48
- while (response.value.length > 0) {
49
- for (const item of response.value) {
50
- options.push({ label: item.name, value: item.id });
51
- }
52
- if (response['@odata.nextLink']) {
53
- response = yield client.api(response['@odata.nextLink']).get();
54
- }
55
- else {
56
- break;
57
- }
58
- }
59
- return { disabled: false, options };
60
- }),
61
- }),
62
- },
63
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
64
- sampleData: {
65
- "id": "01DRYVE_ID_GOES_HERE",
66
- "name": "Example-Report.docx",
67
- "webUrl": "https://contoso.sharepoint.com/Shared%20Documents/Example-Report.docx",
68
- "size": 12345,
69
- "createdDateTime": "2025-09-26T14:26:12Z",
70
- "lastModifiedDateTime": "2025-09-26T14:26:12Z",
71
- "file": {
72
- "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
73
- },
74
- "parentReference": {
75
- "driveId": "DRIVE_ID_HERE",
76
- "id": "PARENT_FOLDER_ID_HERE",
77
- "path": "/drives/DRIVE_ID_HERE/root:/Shared Documents"
78
- }
79
- },
80
- onEnable(context) {
81
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
82
- var _a;
83
- const { siteId, driveId, folderId } = context.propsValue;
84
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
85
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
86
- authProvider: {
87
- getAccessToken: () => Promise.resolve(context.auth.access_token),
88
- },
89
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
90
- });
91
- try {
92
- const effectiveFolderId = folderId === 'root'
93
- ? (yield client.api(`/drives/${driveId}/root`).get()).id
94
- : folderId;
95
- const expirationDateTime = new Date();
96
- expirationDateTime.setDate(expirationDateTime.getDate() + 2);
97
- const subscription = yield client.api('/subscriptions').post({
98
- changeType: 'created',
99
- notificationUrl: context.webhookUrl,
100
- resource: `/sites/${siteId}/drive/items/${effectiveFolderId}/children`,
101
- expirationDateTime: expirationDateTime.toISOString(),
102
- clientState: clientState,
103
- });
104
- yield context.store.put('subscriptionId', subscription.id);
105
- }
106
- catch (error) {
107
- throw new Error(`Failed to create subscription: ${error.message || 'Unknown error'}`);
108
- }
109
- });
110
- },
111
- onDisable(context) {
112
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
- var _a;
114
- const subscriptionId = yield context.store.get('subscriptionId');
115
- if (subscriptionId) {
116
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
117
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
118
- authProvider: {
119
- getAccessToken: () => Promise.resolve(context.auth.access_token),
120
- },
121
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
122
- });
123
- try {
124
- yield client.api(`/subscriptions/${subscriptionId}`).delete();
125
- }
126
- catch (error) {
127
- console.warn(`Error deleting subscription ${subscriptionId}:`, error);
128
- }
129
- }
130
- yield context.store.delete('subscriptionId');
131
- });
132
- },
133
- run(context) {
134
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
135
- var _a, _b;
136
- const notifications = (_a = context.payload.body) === null || _a === void 0 ? void 0 : _a.value;
137
- if (!notifications || !Array.isArray(notifications)) {
138
- return [];
139
- }
140
- const validNotifications = notifications.filter((notif) => notif.clientState === clientState);
141
- if (validNotifications.length === 0) {
142
- return [];
143
- }
144
- const cloud = (_b = context.auth.props) === null || _b === void 0 ? void 0 : _b['cloud'];
145
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
146
- authProvider: {
147
- getAccessToken: () => Promise.resolve(context.auth.access_token),
148
- },
149
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
150
- });
151
- const newFilePayloads = [];
152
- for (const notification of validNotifications) {
153
- try {
154
- const newFile = yield client.api(notification.resource).get();
155
- if (newFile.file) {
156
- newFilePayloads.push(newFile);
157
- }
158
- }
159
- catch (error) {
160
- console.error('Error fetching file from notification:', error);
161
- }
162
- }
163
- return newFilePayloads;
164
- });
165
- },
166
- });
167
- //# sourceMappingURL=new-file-in-folder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-file-in-folder.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file-in-folder.ts"],"names":[],"mappings":";;;;AAAA,kCAAkD;AAClD,qEAOwC;AACxC,+DAA4D;AAC5D,sCAAsD;AACtD,8EAA2E;AAG3E,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEzC,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IAClD,IAAI,EAAE,8BAAuB;IAC7B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,iEAAiE;IAC9E,KAAK,EAAE;QACL,MAAM,EAAE,kCAAyB,CAAC,MAAM;QACxC,OAAO,EAAE,kCAAyB,CAAC,OAAO;QAC1C,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,IAAI,EAAE,8BAAuB;YAC7B,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,gGAAgG;YAC7G,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;YACjC,OAAO,EAAE,KAAkC,EAAE,oDAA7B,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;;gBACvC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjC,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,gCAAgC;wBAC7C,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBACD,MAAM,SAAS,GAAG,IAEjB,CAAC;gBACF,MAAM,KAAK,GAAG,MAAC,SAAiC,CAAC,KAAK,0CAAG,OAAO,CAAuB,CAAC;gBACxF,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;oBACvC,YAAY,E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O,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAC7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAC7C,CAAC;YACF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,KAAK,0CAAG,OAAO,CAAuB,CAAC;YAClE,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;gBACrC,YAAY,EAAE;oBACZ,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;iBACjE;gBACD,OAAO,EAAE,IAAA,iCAAe,EAAC,KAAK,CAAC;aAChC,CAAC,CAAC;YAEL,MAAM,eAAe,GAAG,EAAE,CAAC;YAC3B,KAAK,MAAM,YAAY,IAAI,kBAAkB,EAAE,CAAC;gBAC5C,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;oBAC9D,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;wBACf,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAClC,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;gBACjE,CAAC;YACL,CAAC;YACD,OAAO,eAAe,CAAC;QACzB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newFileInSubfoldersTrigger: 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, 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
- }> | 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, 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
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
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
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
15
- siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
16
- driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
17
- parentFolderId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
18
- }>;
19
- //# sourceMappingURL=new-file-in-subfolders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-file-in-subfolders.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file-in-subfolders.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,eAAe,EAIhB,MAAM,gCAAgC,CAAC;AAQxC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;EAkKrC,CAAC"}
@@ -1,163 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newFileInSubfoldersTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const microsoft_cloud_1 = require("../common/microsoft-cloud");
8
- const common_1 = require("../common");
9
- const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
10
- const clientState = 'activepieces_sharepoint_subfolder_trigger';
11
- exports.newFileInSubfoldersTrigger = (0, pieces_framework_1.createTrigger)({
12
- auth: auth_1.microsoftSharePointAuth,
13
- name: 'new_file_in_subfolders',
14
- displayName: 'New File in Subfolders',
15
- description: 'Fires when a new file is added anywhere in the first-level subfolders of a folder. Note: This trigger will not monitor subfolders created after the flow is activated.',
16
- props: {
17
- siteId: common_1.microsoftSharePointCommon.siteId,
18
- driveId: common_1.microsoftSharePointCommon.driveId,
19
- parentFolderId: pieces_framework_1.Property.Dropdown({
20
- auth: auth_1.microsoftSharePointAuth,
21
- displayName: 'Parent Folder',
22
- description: 'The parent folder whose subfolders you want to monitor.',
23
- required: true,
24
- refreshers: ['siteId', 'driveId'],
25
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId, driveId }) {
26
- var _b;
27
- if (!auth || !siteId || !driveId) {
28
- return {
29
- disabled: true,
30
- placeholder: 'Select a site and drive first.',
31
- options: [],
32
- };
33
- }
34
- const authValue = auth;
35
- const cloud = (_b = authValue.props) === null || _b === void 0 ? void 0 : _b['cloud'];
36
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
37
- authProvider: {
38
- getAccessToken: () => Promise.resolve(authValue.access_token),
39
- },
40
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
41
- });
42
- const options = [
43
- { label: 'Root Folder', value: 'root' },
44
- ];
45
- let response = yield client
46
- .api(`/drives/${driveId}/root/children?$filter=folder ne null&$select=id,name`)
47
- .get();
48
- while (response.value.length > 0) {
49
- for (const item of response.value) {
50
- options.push({ label: item.name, value: item.id });
51
- }
52
- if (response['@odata.nextLink']) {
53
- response = yield client.api(response['@odata.nextLink']).get();
54
- }
55
- else {
56
- break;
57
- }
58
- }
59
- return { disabled: false, options };
60
- }),
61
- }),
62
- },
63
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
64
- sampleData: {
65
- "id": "01DRYVE_ID_GOES_HERE",
66
- "name": "New-File-In-Subfolder.pdf",
67
- "webUrl": "https://contoso.sharepoint.com/Shared%20Documents/SubfolderA/New-File-In-Subfolder.pdf",
68
- "size": 54321,
69
- "createdDateTime": "2025-09-26T14:30:00Z",
70
- "lastModifiedDateTime": "2025-09-26T14:30:00Z",
71
- "file": { "mimeType": "application/pdf" },
72
- "parentReference": { "id": "SUBFOLDER_ID_HERE" }
73
- },
74
- onEnable(context) {
75
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
76
- var _a;
77
- const { siteId, driveId, parentFolderId } = context.propsValue;
78
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
79
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
80
- authProvider: {
81
- getAccessToken: () => Promise.resolve(context.auth.access_token),
82
- },
83
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
84
- });
85
- try {
86
- const effectiveParentId = parentFolderId === 'root'
87
- ? (yield client.api(`/drives/${driveId}/root`).get()).id
88
- : parentFolderId;
89
- const subfoldersResponse = yield client.api(`/drives/${driveId}/items/${effectiveParentId}/children?$filter=folder ne null&$select=id`).get();
90
- const subfolders = subfoldersResponse.value;
91
- const expirationDateTime = new Date();
92
- expirationDateTime.setDate(expirationDateTime.getDate() + 2);
93
- const subscriptionPromises = subfolders.map(folder => client.api('/subscriptions').post({
94
- changeType: 'created',
95
- notificationUrl: context.webhookUrl,
96
- resource: `/sites/${siteId}/drive/items/${folder.id}/children`,
97
- expirationDateTime: expirationDateTime.toISOString(),
98
- clientState: clientState,
99
- }));
100
- const settledSubscriptions = yield Promise.allSettled(subscriptionPromises);
101
- const subscriptionIds = settledSubscriptions
102
- .filter(res => res.status === 'fulfilled')
103
- .map(res => res.value.id);
104
- yield context.store.put('subscriptionIds', subscriptionIds);
105
- }
106
- catch (error) {
107
- throw new Error(`Failed to create subscriptions: ${error.message || 'Unknown error'}`);
108
- }
109
- });
110
- },
111
- onDisable(context) {
112
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
113
- var _a;
114
- const subscriptionIds = yield context.store.get('subscriptionIds');
115
- if (subscriptionIds && subscriptionIds.length > 0) {
116
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
117
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
118
- authProvider: {
119
- getAccessToken: () => Promise.resolve(context.auth.access_token),
120
- },
121
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
122
- });
123
- const deletionPromises = subscriptionIds.map(id => client.api(`/subscriptions/${id}`).delete().catch(err => console.error(`Failed to delete subscription ${id}:`, err)));
124
- yield Promise.allSettled(deletionPromises);
125
- }
126
- yield context.store.delete('subscriptionIds');
127
- });
128
- },
129
- run(context) {
130
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
131
- var _a, _b;
132
- const notifications = (_a = context.payload.body) === null || _a === void 0 ? void 0 : _a.value;
133
- if (!notifications || !Array.isArray(notifications)) {
134
- return [];
135
- }
136
- const validNotifications = notifications.filter((notif) => notif.clientState === clientState);
137
- if (validNotifications.length === 0) {
138
- return [];
139
- }
140
- const cloud = (_b = context.auth.props) === null || _b === void 0 ? void 0 : _b['cloud'];
141
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
142
- authProvider: {
143
- getAccessToken: () => Promise.resolve(context.auth.access_token),
144
- },
145
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
146
- });
147
- const newFilePayloads = [];
148
- for (const notification of validNotifications) {
149
- try {
150
- const newFile = yield client.api(notification.resource).get();
151
- if (newFile.file) {
152
- newFilePayloads.push(newFile);
153
- }
154
- }
155
- catch (error) {
156
- console.error('Error fetching file from notification:', error);
157
- }
158
- }
159
- return newFilePayloads;
160
- });
161
- },
162
- });
163
- //# sourceMappingURL=new-file-in-subfolders.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-file-in-subfolders.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-file-in-subfolders.ts"],"names":[],"mappings":";;;;AAAA,kCAAkD;AAClD,qEAOwC;AACxC,+DAA4D;AAC5D,sCAAsD;AACtD,8EAA2E;AAG3E,MAAM,WAAW,GAAG,2CAA2C,CAAC;AAEnD,QAAA,0BAA0B,GAAG,IAAA,gCAAa,EAAC;IACtD,IAAI,EAAE,8BAAuB;IAC7B,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,wKAAwK;IACrL,KAAK,EAAE;QACL,MAAM,EAAE,kCAAyB,CAAC,MAAM;QACxC,OAAO,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AAC,EAAE,CAAC;gBACpD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAC7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAC7C,CAAC;YACF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,KAAK,0CAAG,OAAO,CAAuB,CAAC;YAClE,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;gBACrC,YAAY,EAAE;oBACZ,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;iBACjE;gBACD,OAAO,EAAE,IAAA,iCAAe,EAAC,KAAK,CAAC;aAClC,CAAC,CAAC;YAEH,MAAM,eAAe,GAAG,EAAE,CAAC;YAC3B,KAAK,MAAM,YAAY,IAAI,kBAAkB,EAAE,CAAC;gBAC5C,IAAI,CAAC;oBACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;oBAC9D,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;wBACf,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAClC,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;gBACjE,CAAC;YACL,CAAC;YACD,OAAO,eAAe,CAAC;QACzB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newListItemTrigger: 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, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
4
- listId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
5
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
6
- siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
7
- listId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
9
- siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
10
- listId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
11
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
12
- siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
13
- listId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
14
- }>;
15
- //# sourceMappingURL=new-list-item.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-list-item.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-list-item.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,eAAe,EAGf,MAAM,gCAAgC,CAAC;AAoExC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAgC7B,CAAC"}
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newListItemTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const pieces_common_1 = require("@activepieces/pieces-common");
8
- const microsoft_cloud_1 = require("../common/microsoft-cloud");
9
- const common_1 = require("../common");
10
- const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
11
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
12
- const polling = {
13
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
14
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
15
- var _b;
16
- const { siteId, listId } = propsValue;
17
- const cloud = (_b = auth.props) === null || _b === void 0 ? void 0 : _b['cloud'];
18
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
19
- authProvider: {
20
- getAccessToken: () => Promise.resolve(auth.access_token),
21
- },
22
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
23
- });
24
- const items = [];
25
- const filter = lastFetchEpochMS === 0 ? `$filter=createdDateTime gt ${(0, dayjs_1.default)().toISOString()}` : '$top=10';
26
- let response = yield client
27
- .api(`/sites/${siteId}/lists/${listId}/items?${filter}`)
28
- .expand('fields')
29
- .get();
30
- if (lastFetchEpochMS === 0) {
31
- for (const message of response.value) {
32
- items.push(message);
33
- }
34
- }
35
- else {
36
- while (response.value.length > 0) {
37
- for (const message of response.value) {
38
- items.push(message);
39
- }
40
- if (response['@odata.nextLink']) {
41
- response = yield client.api(response['@odata.nextLink']).get();
42
- }
43
- else {
44
- break;
45
- }
46
- }
47
- }
48
- items.sort((a, b) => {
49
- const aDate = (0, dayjs_1.default)(a.createdDateTime);
50
- const bDate = (0, dayjs_1.default)(b.createdDateTime);
51
- return bDate.diff(aDate);
52
- });
53
- return items.map((item) => ({
54
- epochMilliSeconds: (0, dayjs_1.default)(item.createdDateTime).valueOf(),
55
- data: item,
56
- }));
57
- }),
58
- };
59
- exports.newListItemTrigger = (0, pieces_framework_1.createTrigger)({
60
- auth: auth_1.microsoftSharePointAuth,
61
- name: 'new_list_item',
62
- displayName: 'New List Item',
63
- description: 'Triggers when a new item is created in a SharePoint list.',
64
- props: {
65
- siteId: common_1.microsoftSharePointCommon.siteId,
66
- listId: common_1.microsoftSharePointCommon.listId,
67
- },
68
- type: pieces_framework_1.TriggerStrategy.POLLING,
69
- sampleData: undefined,
70
- onEnable(context) {
71
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
- yield pieces_common_1.pollingHelper.onEnable(polling, {
73
- auth: context.auth,
74
- store: context.store,
75
- propsValue: context.propsValue,
76
- });
77
- });
78
- },
79
- onDisable(context) {
80
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
81
- yield pieces_common_1.pollingHelper.onDisable(polling, {
82
- auth: context.auth,
83
- store: context.store,
84
- propsValue: context.propsValue,
85
- });
86
- });
87
- },
88
- test(context) {
89
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
90
- return yield pieces_common_1.pollingHelper.test(polling, context);
91
- });
92
- },
93
- run(context) {
94
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
95
- return yield pieces_common_1.pollingHelper.poll(polling, context);
96
- });
97
- },
98
- });
99
- //# sourceMappingURL=new-list-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-list-item.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-list-item.ts"],"names":[],"mappings":";;;;AAAA,kCAAkD;AAClD,qEAKwC;AACxC,+DAAqF;AACrF,+DAA4D;AAC5D,sCAAsD;A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AAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC9B,CAAC,CAAC;QACJ,CAAC;KAAA;IACK,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,11 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newListTrigger: 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, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
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, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
6
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
7
- siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
9
- siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
10
- }>;
11
- //# sourceMappingURL=new-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-list.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,eAAe,EAGf,MAAM,gCAAgC,CAAC;AA4DxC,eAAO,MAAM,cAAc;;;;;;;;EA+BzB,CAAC"}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newListTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const pieces_common_1 = require("@activepieces/pieces-common");
8
- const microsoft_cloud_1 = require("../common/microsoft-cloud");
9
- const common_1 = require("../common");
10
- const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
11
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
12
- const polling = {
13
- strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
14
- items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
15
- var _b;
16
- const { siteId } = propsValue;
17
- const isTestMode = lastFetchEpochMS === 0;
18
- const cloud = (_b = auth.props) === null || _b === void 0 ? void 0 : _b['cloud'];
19
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
20
- authProvider: {
21
- getAccessToken: () => Promise.resolve(auth.access_token),
22
- },
23
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
24
- });
25
- const lists = [];
26
- let response = yield client.api(`/sites/${siteId}/lists`).get();
27
- let stop = false;
28
- while (!stop && response.value.length > 0) {
29
- for (const item of response.value) {
30
- if (isTestMode) {
31
- lists.push(item);
32
- if (lists.length >= 10) {
33
- stop = true;
34
- }
35
- continue;
36
- }
37
- lists.push(item);
38
- }
39
- if (stop || !response['@odata.nextLink'])
40
- break;
41
- response = yield client.api(response['@odata.nextLink']).get();
42
- }
43
- lists.sort((a, b) => {
44
- const aDate = (0, dayjs_1.default)(a.createdDateTime);
45
- const bDate = (0, dayjs_1.default)(b.createdDateTime);
46
- return bDate.diff(aDate);
47
- });
48
- return lists.map((list) => ({
49
- epochMilliSeconds: (0, dayjs_1.default)(list.createdDateTime).valueOf(),
50
- data: list,
51
- }));
52
- }),
53
- };
54
- exports.newListTrigger = (0, pieces_framework_1.createTrigger)({
55
- auth: auth_1.microsoftSharePointAuth,
56
- name: 'new_list',
57
- displayName: 'New List',
58
- description: 'Triggers when a new list is created in a site.',
59
- props: {
60
- siteId: common_1.microsoftSharePointCommon.siteId,
61
- },
62
- type: pieces_framework_1.TriggerStrategy.POLLING,
63
- sampleData: undefined,
64
- onEnable(context) {
65
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
66
- yield pieces_common_1.pollingHelper.onEnable(polling, {
67
- auth: context.auth,
68
- store: context.store,
69
- propsValue: context.propsValue,
70
- });
71
- });
72
- },
73
- onDisable(context) {
74
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
- yield pieces_common_1.pollingHelper.onDisable(polling, {
76
- auth: context.auth,
77
- store: context.store,
78
- propsValue: context.propsValue,
79
- });
80
- });
81
- },
82
- test(context) {
83
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
84
- return yield pieces_common_1.pollingHelper.test(polling, context);
85
- });
86
- },
87
- run(context) {
88
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
89
- return yield pieces_common_1.pollingHelper.poll(polling, context);
90
- });
91
- },
92
- });
93
- //# sourceMappingURL=new-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"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