@activepieces/piece-microsoft-sharepoint 0.0.5 → 0.0.6

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,38 @@
1
1
  {
2
2
  "name": "@activepieces/piece-microsoft-sharepoint",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "dependencies": {
5
- "@anthropic-ai/sdk": "0.27.3",
5
+ "@anthropic-ai/sdk": "0.39.0",
6
6
  "@microsoft/microsoft-graph-client": "3.0.7",
7
7
  "@microsoft/microsoft-graph-types": "2.40.0",
8
- "@sinclair/typebox": "0.32.35",
9
- "axios": "1.7.7",
10
- "dayjs": "1.11.9",
11
- "deepmerge": "4.3.1",
12
- "nanoid": "3.3.6",
13
- "openai": "4.47.1",
8
+ "@sinclair/typebox": "0.34.11",
9
+ "axios": "1.8.3",
10
+ "axios-retry": "4.4.1",
11
+ "deepmerge-ts": "7.1.0",
12
+ "fast-glob": "3.3.3",
13
+ "mime-types": "2.1.35",
14
+ "nanoid": "3.3.8",
15
+ "openai": "4.67.1",
16
+ "replicate": "0.34.1",
14
17
  "semver": "7.6.0",
15
- "@activepieces/pieces-common": "0.2.20",
16
- "@activepieces/pieces-framework": "0.7.35",
17
- "@activepieces/shared": "0.10.117",
18
- "tslib": "2.6.2"
18
+ "zod": "3.24.4",
19
+ "@activepieces/pieces-common": "0.4.6",
20
+ "@activepieces/pieces-framework": "0.10.4",
21
+ "@activepieces/shared": "0.11.4",
22
+ "tslib": "1.14.1"
23
+ },
24
+ "overrides": {
25
+ "@tryfabric/martian": {
26
+ "@notionhq/client": "$@notionhq/client"
27
+ },
28
+ "vite": {
29
+ "rollup": "npm:@rollup/wasm-node"
30
+ }
31
+ },
32
+ "resolutions": {
33
+ "rollup": "npm:@rollup/wasm-node"
19
34
  },
20
35
  "main": "./src/index.js",
21
- "type": "commonjs"
36
+ "type": "commonjs",
37
+ "types": "./src/index.d.ts"
22
38
  }
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',
@@ -39,6 +40,7 @@ exports.microsoftSharePoint = (0, pieces_framework_1.createPiece)({
39
40
  update_list_item_1.updateListItemAction,
40
41
  delete_list_item_1.deleteListItemAction,
41
42
  search_list_item_1.findListItemAction,
43
+ upload_file_1.uploadFile,
42
44
  (0, pieces_common_1.createCustomApiCallAction)({
43
45
  auth: exports.microsoftSharePointAuth,
44
46
  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;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,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"}
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;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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on = {
51
51
  displayName: 'Drive ID',
52
52
  required: true,
53
53
  refreshers: ['siteId'],
54
- options: (_b) => tslib_1.__awaiter(void 0, [_b], void 0, function* ({ auth, siteId }) {
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: (_c) => tslib_1.__awaiter(void 0, [_c], void 0, function* ({ auth, siteId }) {
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: (_d) => tslib_1.__awaiter(void 0, [_d], void 0, function* ({ auth, siteId, listId }) {
135
- var _e, _f, _g;
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: (_e = column.description) !== null && _e !== void 0 ? _e : '',
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: ((_f = column.choice) === null || _f === void 0 ? void 0 : _f.choices)
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: ((_g = column.choice) === null || _g === void 0 ? void 0 : _g.choices)
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: (_h) => tslib_1.__awaiter(void 0, [_h], void 0, function* ({ auth, siteId, listId }) {
216
- var _j;
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: (_j = item.fields.Title) !== null && _j !== void 0 ? _j : `Item ${item.id}`,
237
+ label: (_b = item.fields.Title) !== null && _b !== void 0 ? _b : `Item ${item.id}`,
238
238
  value: item.id,
239
239
  });
240
240
  }