@activepieces/piece-microsoft-sharepoint 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-microsoft-sharepoint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@
|
|
5
|
+
"@ai-sdk/anthropic": "1.2.12",
|
|
6
|
+
"@ai-sdk/google": "1.2.19",
|
|
7
|
+
"@ai-sdk/openai": "1.3.22",
|
|
8
|
+
"@ai-sdk/replicate": "0.2.8",
|
|
6
9
|
"@microsoft/microsoft-graph-client": "3.0.7",
|
|
7
10
|
"@microsoft/microsoft-graph-types": "2.40.0",
|
|
8
|
-
"@sinclair/typebox": "0.
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"@sinclair/typebox": "0.34.11",
|
|
12
|
+
"ai": "4.3.16",
|
|
13
|
+
"axios": "1.8.3",
|
|
14
|
+
"axios-retry": "4.4.1",
|
|
15
|
+
"deepmerge-ts": "7.1.0",
|
|
16
|
+
"fast-glob": "3.3.3",
|
|
17
|
+
"mime-types": "2.1.35",
|
|
18
|
+
"nanoid": "3.3.8",
|
|
14
19
|
"semver": "7.6.0",
|
|
15
|
-
"
|
|
16
|
-
"@activepieces/pieces-
|
|
17
|
-
"@activepieces/
|
|
18
|
-
"
|
|
20
|
+
"zod": "3.25.76",
|
|
21
|
+
"@activepieces/pieces-common": "0.6.1",
|
|
22
|
+
"@activepieces/pieces-framework": "0.16.0",
|
|
23
|
+
"@activepieces/shared": "0.17.5",
|
|
24
|
+
"tslib": "2.8.1"
|
|
19
25
|
},
|
|
26
|
+
"overrides": {
|
|
27
|
+
"@tryfabric/martian": {
|
|
28
|
+
"@notionhq/client": "$@notionhq/client"
|
|
29
|
+
},
|
|
30
|
+
"vite": {
|
|
31
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
32
|
+
},
|
|
33
|
+
"stylus": "0.0.1-security"
|
|
34
|
+
},
|
|
35
|
+
"resolutions": {
|
|
36
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
37
|
+
},
|
|
38
|
+
"types": "./src/index.d.ts",
|
|
20
39
|
"main": "./src/index.js",
|
|
21
40
|
"type": "commonjs"
|
|
22
41
|
}
|
package/src/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const create_list_item_1 = require("./lib/actions/create-list-item");
|
|
|
10
10
|
const update_list_item_1 = require("./lib/actions/update-list-item");
|
|
11
11
|
const delete_list_item_1 = require("./lib/actions/delete-list-item");
|
|
12
12
|
const search_list_item_1 = require("./lib/actions/search-list-item");
|
|
13
|
+
const upload_file_1 = require("./lib/actions/upload-file");
|
|
13
14
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
14
15
|
exports.microsoftSharePointAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
15
16
|
description: 'Authentication for Microsoft SharePoint',
|
|
@@ -24,6 +25,7 @@ exports.microsoftSharePointAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
|
24
25
|
'Sites.Manage.All',
|
|
25
26
|
'Files.ReadWrite',
|
|
26
27
|
],
|
|
28
|
+
prompt: 'omit'
|
|
27
29
|
});
|
|
28
30
|
exports.microsoftSharePoint = (0, pieces_framework_1.createPiece)({
|
|
29
31
|
displayName: 'Microsoft SharePoint',
|
|
@@ -39,6 +41,7 @@ exports.microsoftSharePoint = (0, pieces_framework_1.createPiece)({
|
|
|
39
41
|
update_list_item_1.updateListItemAction,
|
|
40
42
|
delete_list_item_1.deleteListItemAction,
|
|
41
43
|
search_list_item_1.findListItemAction,
|
|
44
|
+
upload_file_1.uploadFile,
|
|
42
45
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
43
46
|
auth: exports.microsoftSharePointAuth,
|
|
44
47
|
baseUrl: () => 'https://graph.microsoft.com/v1.0/sites',
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/microsoft-sharepoint/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,iDAAqD;AACrD,+DAAiE;AACjE,2DAA6D;AAC7D,qEAAsE;AACtE,qEAAsE;AACtE,qEAAsE;AACtE,qEAAoE;AACpE,+DAAwE;AAE3D,QAAA,uBAAuB,GAAG,4BAAS,CAAC,MAAM,CAAC;IACtD,WAAW,EAAE,yCAAyC;IACtD,OAAO,EAAE,gEAAgE;IACzE,QAAQ,EAAE,4DAA4D;IACtE,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,QAAQ;QACR,OAAO;QACP,SAAS;QACT,gBAAgB;QAChB,kBAAkB;QAClB,iBAAiB;KAClB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/microsoft-sharepoint/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,iDAAqD;AACrD,+DAAiE;AACjE,2DAA6D;AAC7D,qEAAsE;AACtE,qEAAsE;AACtE,qEAAsE;AACtE,qEAAoE;AACpE,2DAAuD;AACvD,+DAAwE;AAE3D,QAAA,uBAAuB,GAAG,4BAAS,CAAC,MAAM,CAAC;IACtD,WAAW,EAAE,yCAAyC;IACtD,OAAO,EAAE,gEAAgE;IACzE,QAAQ,EAAE,4DAA4D;IACtE,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,QAAQ;QACR,OAAO;QACP,SAAS;QACT,gBAAgB;QAChB,kBAAkB;QAClB,iBAAiB;KAClB;IACD,MAAM,EAAE,MAAM;CACf,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,IAAA,8BAAW,EAAC;IAC7C,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,+BAAuB;IAC7B,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8DAA8D;IACvE,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,OAAO,EAAE;QACP,kCAAkB;QAClB,8BAAgB;QAChB,uCAAoB;QACpB,uCAAoB;QACpB,uCAAoB;QACpB,qCAAkB;QAClB,wBAAU;QACV,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,+BAAuB;YAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,wCAAwC;YACvD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACtE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const uploadFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
siteId: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
driveId: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
|
+
file: import("@activepieces/pieces-framework").FileProperty<true>;
|
|
5
|
+
parentFolder: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
fileName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadFile = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../../");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
9
|
+
exports.uploadFile = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.microsoftSharePointAuth,
|
|
11
|
+
name: 'microsoft_sharepoint_upload_file',
|
|
12
|
+
displayName: 'Upload File',
|
|
13
|
+
description: 'Uploads a new file at path you specify.',
|
|
14
|
+
props: {
|
|
15
|
+
siteId: common_1.microsoftSharePointCommon.siteId,
|
|
16
|
+
driveId: common_1.microsoftSharePointCommon.driveId,
|
|
17
|
+
file: pieces_framework_1.Property.File({
|
|
18
|
+
displayName: "File",
|
|
19
|
+
description: "The file or url you want to upload",
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
parentFolder: pieces_framework_1.Property.ShortText({
|
|
23
|
+
displayName: 'Parent Folder',
|
|
24
|
+
description: `Parent folder, like "/demo/" or "/docs/assignment/".Leave it default if you want to create folder at the root (**CHANGE THIS BACK//**) level.`,
|
|
25
|
+
required: true,
|
|
26
|
+
defaultValue: '/',
|
|
27
|
+
}),
|
|
28
|
+
fileName: pieces_framework_1.Property.ShortText({
|
|
29
|
+
displayName: 'File Name',
|
|
30
|
+
required: true,
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
run(context) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
var _a;
|
|
36
|
+
const { siteId, driveId, file, parentFolder, fileName } = context.propsValue;
|
|
37
|
+
const client = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
38
|
+
authProvider: {
|
|
39
|
+
getAccessToken: () => Promise.resolve(context.auth.access_token),
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const parentIdResponse = yield client.api(`/sites/${siteId}/drives/${driveId}/root:${parentFolder}`).get();
|
|
43
|
+
const parentId = (_a = parentIdResponse.id) !== null && _a !== void 0 ? _a : "test";
|
|
44
|
+
const uploadResponse = yield client.api(`/sites/${siteId}/drives/${driveId}/items/${parentId}:/${fileName}:/content`).put(file.data);
|
|
45
|
+
return uploadResponse;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=upload-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-sharepoint/src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,8BAAiD;AACjD,qEAAwE;AACxE,sCAAsD;AACtD,8EAA2D;AAE9C,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,2BAAuB;IAC7B,IAAI,EAAE,kCAAkC;IACxC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE;QACL,MAAM,EAAE,kCAAyB,CAAC,MAAM;QACxC,OAAO,EAAE,kCAAyB,CAAC,OAAO;QAC1C,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,+IAA+I;YAC5J,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,GAAG;SAClB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE7E,MAAM,MAAM,GAAG,+BAAM,CAAC,kBAAkB,CAAC;gBACvC,YAAY,EAAE;oBACZ,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;iBACjE;aACF,CAAC,CAAC;YAEH,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,WAAW,OAAO,SAAS,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,CAAA;YAC1G,MAAM,QAAQ,GAAG,MAAA,gBAAgB,CAAC,EAAE,mCAAI,MAAM,CAAC;YAE/C,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,UAAU,MAAM,WAAW,OAAO,UAAU,QAAQ,KAAK,QAAQ,WAAW,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAEpI,OAAO,cAAc,CAAA;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/index.js
CHANGED
|
@@ -51,7 +51,7 @@ exports.microsoftSharePointCommon = {
|
|
|
51
51
|
displayName: 'Drive ID',
|
|
52
52
|
required: true,
|
|
53
53
|
refreshers: ['siteId'],
|
|
54
|
-
options: (
|
|
54
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId }) {
|
|
55
55
|
if (!auth || !siteId) {
|
|
56
56
|
return {
|
|
57
57
|
disabled: true,
|
|
@@ -91,7 +91,7 @@ exports.microsoftSharePointCommon = {
|
|
|
91
91
|
displayName: 'List ID',
|
|
92
92
|
required: true,
|
|
93
93
|
refreshers: ['siteId'],
|
|
94
|
-
options: (
|
|
94
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId }) {
|
|
95
95
|
if (!auth || !siteId) {
|
|
96
96
|
return {
|
|
97
97
|
disabled: true,
|
|
@@ -131,8 +131,8 @@ exports.microsoftSharePointCommon = {
|
|
|
131
131
|
displayName: 'List Columns',
|
|
132
132
|
refreshers: ['siteId', 'listId'],
|
|
133
133
|
required: true,
|
|
134
|
-
props: (
|
|
135
|
-
var
|
|
134
|
+
props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId, listId }) {
|
|
135
|
+
var _b, _c, _d;
|
|
136
136
|
if (!auth || !siteId || !listId)
|
|
137
137
|
return {};
|
|
138
138
|
const fields = {};
|
|
@@ -162,7 +162,7 @@ exports.microsoftSharePointCommon = {
|
|
|
162
162
|
for (const column of columns) {
|
|
163
163
|
const params = {
|
|
164
164
|
displayName: column.displayName,
|
|
165
|
-
description: (
|
|
165
|
+
description: (_b = column.description) !== null && _b !== void 0 ? _b : '',
|
|
166
166
|
required: false,
|
|
167
167
|
};
|
|
168
168
|
if (column.boolean) {
|
|
@@ -178,7 +178,7 @@ exports.microsoftSharePointCommon = {
|
|
|
178
178
|
if (column.choice.displayAs === 'checkBoxes') {
|
|
179
179
|
fields[column.name] = pieces_framework_1.Property.StaticMultiSelectDropdown(Object.assign(Object.assign({}, params), { options: {
|
|
180
180
|
disabled: false,
|
|
181
|
-
options: ((
|
|
181
|
+
options: ((_c = column.choice) === null || _c === void 0 ? void 0 : _c.choices)
|
|
182
182
|
? column.choice.choices.map((choice) => ({
|
|
183
183
|
label: choice,
|
|
184
184
|
value: choice,
|
|
@@ -189,7 +189,7 @@ exports.microsoftSharePointCommon = {
|
|
|
189
189
|
else {
|
|
190
190
|
fields[column.name] = pieces_framework_1.Property.StaticDropdown(Object.assign(Object.assign({}, params), { options: {
|
|
191
191
|
disabled: false,
|
|
192
|
-
options: ((
|
|
192
|
+
options: ((_d = column.choice) === null || _d === void 0 ? void 0 : _d.choices)
|
|
193
193
|
? column.choice.choices.map((choice) => ({
|
|
194
194
|
label: choice,
|
|
195
195
|
value: choice,
|
|
@@ -212,8 +212,8 @@ exports.microsoftSharePointCommon = {
|
|
|
212
212
|
displayName: 'List Item ID',
|
|
213
213
|
required: true,
|
|
214
214
|
refreshers: ['siteId', 'listId'],
|
|
215
|
-
options: (
|
|
216
|
-
var
|
|
215
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, siteId, listId }) {
|
|
216
|
+
var _b;
|
|
217
217
|
if (!auth || !siteId || !listId) {
|
|
218
218
|
return {
|
|
219
219
|
disabled: true,
|
|
@@ -234,7 +234,7 @@ exports.microsoftSharePointCommon = {
|
|
|
234
234
|
while (response.value.length > 0) {
|
|
235
235
|
for (const item of response.value) {
|
|
236
236
|
options.push({
|
|
237
|
-
label: (
|
|
237
|
+
label: (_b = item.fields.Title) !== null && _b !== void 0 ? _b : `Item ${item.id}`,
|
|
238
238
|
value: item.id,
|
|
239
239
|
});
|
|
240
240
|
}
|