@activepieces/piece-microsoft-sharepoint 0.3.4 → 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 -166
  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 -126
  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 -53
  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 -52
  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 -50
  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 -42
  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 -145
  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 -61
  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 -120
  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 -47
  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 -166
  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 -61
  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 -49
  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 -51
  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 -57
  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 -170
  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 -166
  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 -102
  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 -96
  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 -162
  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 -162
  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 -110
  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 -120
  109. package/src/lib/triggers/updated-list-item.js.map +0 -1
@@ -1,170 +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
- aiMetadata: {
17
- description: 'Fires when a new file appears directly inside one specific monitored folder of a SharePoint drive (the folder itself, not its subfolders). Each event represents a single newly created or added file with its metadata.',
18
- },
19
- props: {
20
- siteId: common_1.microsoftSharePointCommon.siteId,
21
- driveId: common_1.microsoftSharePointCommon.driveId,
22
- folderId: pieces_framework_1.Property.Dropdown({
23
- auth: auth_1.microsoftSharePointAuth,
24
- displayName: 'Folder to Monitor',
25
- description: 'The folder to watch for new files. Select "Root Folder" for the top-level folder of the drive.',
26
- required: true,
27
- refreshers: ['siteId', 'driveId'],
28
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId, driveId }) {
29
- var _b;
30
- if (!auth || !siteId || !driveId) {
31
- return {
32
- disabled: true,
33
- placeholder: 'Select a site and drive first.',
34
- options: [],
35
- };
36
- }
37
- const authValue = auth;
38
- const cloud = (_b = authValue.props) === null || _b === void 0 ? void 0 : _b['cloud'];
39
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
40
- authProvider: {
41
- getAccessToken: () => Promise.resolve(authValue.access_token),
42
- },
43
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
44
- });
45
- const options = [
46
- { label: 'Root Folder', value: 'root' },
47
- ];
48
- let response = yield client
49
- .api(`/drives/${driveId}/root/children?$filter=folder ne null&$select=id,name`)
50
- .get();
51
- while (response.value.length > 0) {
52
- for (const item of response.value) {
53
- options.push({ label: item.name, value: item.id });
54
- }
55
- if (response['@odata.nextLink']) {
56
- response = yield client.api(response['@odata.nextLink']).get();
57
- }
58
- else {
59
- break;
60
- }
61
- }
62
- return { disabled: false, options };
63
- }),
64
- }),
65
- },
66
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
67
- sampleData: {
68
- "id": "01DRYVE_ID_GOES_HERE",
69
- "name": "Example-Report.docx",
70
- "webUrl": "https://contoso.sharepoint.com/Shared%20Documents/Example-Report.docx",
71
- "size": 12345,
72
- "createdDateTime": "2025-09-26T14:26:12Z",
73
- "lastModifiedDateTime": "2025-09-26T14:26:12Z",
74
- "file": {
75
- "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
76
- },
77
- "parentReference": {
78
- "driveId": "DRIVE_ID_HERE",
79
- "id": "PARENT_FOLDER_ID_HERE",
80
- "path": "/drives/DRIVE_ID_HERE/root:/Shared Documents"
81
- }
82
- },
83
- onEnable(context) {
84
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
- var _a;
86
- const { siteId, driveId, folderId } = context.propsValue;
87
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
88
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
89
- authProvider: {
90
- getAccessToken: () => Promise.resolve(context.auth.access_token),
91
- },
92
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
93
- });
94
- try {
95
- const effectiveFolderId = folderId === 'root'
96
- ? (yield client.api(`/drives/${driveId}/root`).get()).id
97
- : folderId;
98
- const expirationDateTime = new Date();
99
- expirationDateTime.setDate(expirationDateTime.getDate() + 2);
100
- const subscription = yield client.api('/subscriptions').post({
101
- changeType: 'created',
102
- notificationUrl: context.webhookUrl,
103
- resource: `/sites/${siteId}/drive/items/${effectiveFolderId}/children`,
104
- expirationDateTime: expirationDateTime.toISOString(),
105
- clientState: clientState,
106
- });
107
- yield context.store.put('subscriptionId', subscription.id);
108
- }
109
- catch (error) {
110
- throw new Error(`Failed to create subscription: ${error.message || 'Unknown error'}`);
111
- }
112
- });
113
- },
114
- onDisable(context) {
115
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
116
- var _a;
117
- const subscriptionId = yield context.store.get('subscriptionId');
118
- if (subscriptionId) {
119
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
120
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
121
- authProvider: {
122
- getAccessToken: () => Promise.resolve(context.auth.access_token),
123
- },
124
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
125
- });
126
- try {
127
- yield client.api(`/subscriptions/${subscriptionId}`).delete();
128
- }
129
- catch (error) {
130
- console.warn(`Error deleting subscription ${subscriptionId}:`, error);
131
- }
132
- }
133
- yield context.store.delete('subscriptionId');
134
- });
135
- },
136
- run(context) {
137
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
138
- var _a, _b;
139
- const notifications = (_a = context.payload.body) === null || _a === void 0 ? void 0 : _a.value;
140
- if (!notifications || !Array.isArray(notifications)) {
141
- return [];
142
- }
143
- const validNotifications = notifications.filter((notif) => notif.clientState === clientState);
144
- if (validNotifications.length === 0) {
145
- return [];
146
- }
147
- const cloud = (_b = context.auth.props) === null || _b === void 0 ? void 0 : _b['cloud'];
148
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
149
- authProvider: {
150
- getAccessToken: () => Promise.resolve(context.auth.access_token),
151
- },
152
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
153
- });
154
- const newFilePayloads = [];
155
- for (const notification of validNotifications) {
156
- try {
157
- const newFile = yield client.api(notification.resource).get();
158
- if (newFile.file) {
159
- newFilePayloads.push(newFile);
160
- }
161
- }
162
- catch (error) {
163
- console.error('Error fetching file from notification:', error);
164
- }
165
- }
166
- return newFilePayloads;
167
- });
168
- },
169
- });
170
- //# 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,UAAU,EAAE;QACV,WAAW,EAAE,0NAA0N;KACxO;IACD,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,I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}
@@ -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;;;;;;;;;;;;;;;;EAqKrC,CAAC"}
@@ -1,166 +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
- aiMetadata: {
17
- description: 'Fires when a new file is added to any of the immediate (first-level) subfolders of a chosen parent folder in a SharePoint drive. Each event represents one newly added file. Only subfolders that existed when the flow was activated are monitored; subfolders created later are not watched.',
18
- },
19
- props: {
20
- siteId: common_1.microsoftSharePointCommon.siteId,
21
- driveId: common_1.microsoftSharePointCommon.driveId,
22
- parentFolderId: pieces_framework_1.Property.Dropdown({
23
- auth: auth_1.microsoftSharePointAuth,
24
- displayName: 'Parent Folder',
25
- description: 'The parent folder whose subfolders you want to monitor.',
26
- required: true,
27
- refreshers: ['siteId', 'driveId'],
28
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId, driveId }) {
29
- var _b;
30
- if (!auth || !siteId || !driveId) {
31
- return {
32
- disabled: true,
33
- placeholder: 'Select a site and drive first.',
34
- options: [],
35
- };
36
- }
37
- const authValue = auth;
38
- const cloud = (_b = authValue.props) === null || _b === void 0 ? void 0 : _b['cloud'];
39
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
40
- authProvider: {
41
- getAccessToken: () => Promise.resolve(authValue.access_token),
42
- },
43
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
44
- });
45
- const options = [
46
- { label: 'Root Folder', value: 'root' },
47
- ];
48
- let response = yield client
49
- .api(`/drives/${driveId}/root/children?$filter=folder ne null&$select=id,name`)
50
- .get();
51
- while (response.value.length > 0) {
52
- for (const item of response.value) {
53
- options.push({ label: item.name, value: item.id });
54
- }
55
- if (response['@odata.nextLink']) {
56
- response = yield client.api(response['@odata.nextLink']).get();
57
- }
58
- else {
59
- break;
60
- }
61
- }
62
- return { disabled: false, options };
63
- }),
64
- }),
65
- },
66
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
67
- sampleData: {
68
- "id": "01DRYVE_ID_GOES_HERE",
69
- "name": "New-File-In-Subfolder.pdf",
70
- "webUrl": "https://contoso.sharepoint.com/Shared%20Documents/SubfolderA/New-File-In-Subfolder.pdf",
71
- "size": 54321,
72
- "createdDateTime": "2025-09-26T14:30:00Z",
73
- "lastModifiedDateTime": "2025-09-26T14:30:00Z",
74
- "file": { "mimeType": "application/pdf" },
75
- "parentReference": { "id": "SUBFOLDER_ID_HERE" }
76
- },
77
- onEnable(context) {
78
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
- var _a;
80
- const { siteId, driveId, parentFolderId } = context.propsValue;
81
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
82
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
83
- authProvider: {
84
- getAccessToken: () => Promise.resolve(context.auth.access_token),
85
- },
86
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
87
- });
88
- try {
89
- const effectiveParentId = parentFolderId === 'root'
90
- ? (yield client.api(`/drives/${driveId}/root`).get()).id
91
- : parentFolderId;
92
- const subfoldersResponse = yield client.api(`/drives/${driveId}/items/${effectiveParentId}/children?$filter=folder ne null&$select=id`).get();
93
- const subfolders = subfoldersResponse.value;
94
- const expirationDateTime = new Date();
95
- expirationDateTime.setDate(expirationDateTime.getDate() + 2);
96
- const subscriptionPromises = subfolders.map(folder => client.api('/subscriptions').post({
97
- changeType: 'created',
98
- notificationUrl: context.webhookUrl,
99
- resource: `/sites/${siteId}/drive/items/${folder.id}/children`,
100
- expirationDateTime: expirationDateTime.toISOString(),
101
- clientState: clientState,
102
- }));
103
- const settledSubscriptions = yield Promise.allSettled(subscriptionPromises);
104
- const subscriptionIds = settledSubscriptions
105
- .filter(res => res.status === 'fulfilled')
106
- .map(res => res.value.id);
107
- yield context.store.put('subscriptionIds', subscriptionIds);
108
- }
109
- catch (error) {
110
- throw new Error(`Failed to create subscriptions: ${error.message || 'Unknown error'}`);
111
- }
112
- });
113
- },
114
- onDisable(context) {
115
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
116
- var _a;
117
- const subscriptionIds = yield context.store.get('subscriptionIds');
118
- if (subscriptionIds && subscriptionIds.length > 0) {
119
- const cloud = (_a = context.auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
120
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
121
- authProvider: {
122
- getAccessToken: () => Promise.resolve(context.auth.access_token),
123
- },
124
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
125
- });
126
- const deletionPromises = subscriptionIds.map(id => client.api(`/subscriptions/${id}`).delete().catch(err => console.error(`Failed to delete subscription ${id}:`, err)));
127
- yield Promise.allSettled(deletionPromises);
128
- }
129
- yield context.store.delete('subscriptionIds');
130
- });
131
- },
132
- run(context) {
133
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
134
- var _a, _b;
135
- const notifications = (_a = context.payload.body) === null || _a === void 0 ? void 0 : _a.value;
136
- if (!notifications || !Array.isArray(notifications)) {
137
- return [];
138
- }
139
- const validNotifications = notifications.filter((notif) => notif.clientState === clientState);
140
- if (validNotifications.length === 0) {
141
- return [];
142
- }
143
- const cloud = (_b = context.auth.props) === null || _b === void 0 ? void 0 : _b['cloud'];
144
- const client = microsoft_graph_client_1.Client.initWithMiddleware({
145
- authProvider: {
146
- getAccessToken: () => Promise.resolve(context.auth.access_token),
147
- },
148
- baseUrl: (0, microsoft_cloud_1.getGraphBaseUrl)(cloud),
149
- });
150
- const newFilePayloads = [];
151
- for (const notification of validNotifications) {
152
- try {
153
- const newFile = yield client.api(notification.resource).get();
154
- if (newFile.file) {
155
- newFilePayloads.push(newFile);
156
- }
157
- }
158
- catch (error) {
159
- console.error('Error fetching file from notification:', error);
160
- }
161
- }
162
- return newFilePayloads;
163
- });
164
- },
165
- });
166
- //# 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;A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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;;;;;;;;;;;;EAmC7B,CAAC"}
@@ -1,102 +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
- aiMetadata: {
65
- description: 'Fires when a new item (row) is added to one specific SharePoint list on a given site, based on item creation time (polling). Each event represents one newly created list item with its fields; updates to existing items do not trigger it.',
66
- },
67
- props: {
68
- siteId: common_1.microsoftSharePointCommon.siteId,
69
- listId: common_1.microsoftSharePointCommon.listId,
70
- },
71
- type: pieces_framework_1.TriggerStrategy.POLLING,
72
- sampleData: undefined,
73
- onEnable(context) {
74
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
- yield pieces_common_1.pollingHelper.onEnable(polling, {
76
- auth: context.auth,
77
- store: context.store,
78
- propsValue: context.propsValue,
79
- });
80
- });
81
- },
82
- onDisable(context) {
83
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
84
- yield pieces_common_1.pollingHelper.onDisable(polling, {
85
- auth: context.auth,
86
- store: context.store,
87
- propsValue: context.propsValue,
88
- });
89
- });
90
- },
91
- test(context) {
92
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
93
- return yield pieces_common_1.pollingHelper.test(polling, context);
94
- });
95
- },
96
- run(context) {
97
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
98
- return yield pieces_common_1.pollingHelper.poll(polling, context);
99
- });
100
- },
101
- });
102
- //# 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;AACtD,8EAA2E;AAC3E,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,MAAM,EAAE,GAAG,UAAU,CAAC;QAEtC,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAG,OAAO,CAAuB,CAAC;QAC1D,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;YACD,OAAO,EAAE,IAAA,iCAAe,EAAC,KAAK,CAAC;SAC/B,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,MAAM,MAAM,GACX,gBAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,8BAA8B,IAAA,eAAK,GAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAG5F,IAAI,QAAQ,GAAmB,MAAM,MAAM;aACzC,GAAG,CAAC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CAAC;AAEW,QAAA,kBAAkB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,8BAAuB;IAC7B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE;QACX,WAAW,EAAE,8OAA8O;KAC3P;IACD,KAAK,EAAE;QACN,MAAM,EAAE,kCAAyB,CAAC,MAAM;QACxC,MAAM,EAAE,kCAAyB,CAAC,MAAM;KACxC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAE7B,UAAU,EAAE,SAAS;IACf,QAAQ,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,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;;;;;;;;EAkCzB,CAAC"}
@@ -1,96 +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
- aiMetadata: {
60
- description: 'Fires when a new list is created on one specific SharePoint site, based on list creation time (polling). Each event represents one newly created list; changes to existing lists do not trigger it (use New or Updated List for that).',
61
- },
62
- props: {
63
- siteId: common_1.microsoftSharePointCommon.siteId,
64
- },
65
- type: pieces_framework_1.TriggerStrategy.POLLING,
66
- sampleData: undefined,
67
- onEnable(context) {
68
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
- yield pieces_common_1.pollingHelper.onEnable(polling, {
70
- auth: context.auth,
71
- store: context.store,
72
- propsValue: context.propsValue,
73
- });
74
- });
75
- },
76
- onDisable(context) {
77
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
78
- yield pieces_common_1.pollingHelper.onDisable(polling, {
79
- auth: context.auth,
80
- store: context.store,
81
- propsValue: context.propsValue,
82
- });
83
- });
84
- },
85
- test(context) {
86
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
87
- return yield pieces_common_1.pollingHelper.test(polling, context);
88
- });
89
- },
90
- run(context) {
91
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
- return yield pieces_common_1.pollingHelper.poll(polling, context);
93
- });
94
- },
95
- });
96
- //# sourceMappingURL=new-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-list.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-list.ts"],"names":[],"mappings":";;;;AAAA,kCAAkD;AAClD,qEAKwC;AACxC,+DAAqF;AACrF,+DAA4D;AAC5D,sCAAsD;AACtD,8EAA2E;AAC3E,0DAA0B;AAM1B,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,GAAG,UAAU,CAAC;QAC9B,MAAM,UAAU,GAAG,gBAAgB,KAAK,CAAC,CAAC;QAE1C,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,KAAK,0CAAG,OAAO,CAAuB,CAAC;QAC1D,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;YACxC,YAAY,EAAE;gBACb,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CA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