Skip to content

Commit 75da6d2

Browse files
committed
wip
1 parent e10500a commit 75da6d2

File tree

11 files changed

+330
-127
lines changed

11 files changed

+330
-127
lines changed

components/microsoft_excel/actions/add-a-worksheet-tablerow/add-a-worksheet-tablerow.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import microsoftExcel from "../../microsoft_excel.app.mjs";
33

44
export default {
55
key: "microsoft_excel-add-a-worksheet-tablerow",
6-
name: "Add A Worksheet Tablerow",
7-
version: "0.0.4",
6+
name: "Add a Worksheet Tablerow",
7+
version: "0.0.5",
88
description: "Adds rows to the end of specific table. [See the documentation](https://learn.microsoft.com/en-us/graph/api/tablerowcollection-add?view=graph-rest-1.0&tabs=http)",
99
type: "action",
1010
props: {
@@ -15,10 +15,10 @@ export default {
1515
"folderId",
1616
],
1717
},
18-
itemId: {
18+
sheetId: {
1919
propDefinition: [
2020
microsoftExcel,
21-
"itemId",
21+
"sheetId",
2222
({ folderId }) => ({
2323
folderId,
2424
}),
@@ -29,8 +29,8 @@ export default {
2929
propDefinition: [
3030
microsoftExcel,
3131
"tableId",
32-
({ itemId }) => ({
33-
itemId,
32+
({ sheetId }) => ({
33+
sheetId,
3434
}),
3535
],
3636
hidden: true,
@@ -49,10 +49,10 @@ export default {
4949
},
5050
},
5151
async additionalProps(props) {
52-
if (this.itemId) {
52+
if (this.sheetId) {
5353
try {
5454
await this.microsoftExcel.listTables({
55-
itemId: this.itemId,
55+
sheetId: this.sheetId,
5656
});
5757
} catch {
5858
props.tableName.hidden = false;
@@ -65,15 +65,15 @@ export default {
6565
async run({ $ }) {
6666
const {
6767
microsoftExcel,
68-
itemId,
68+
sheetId,
6969
tableId,
7070
tableName,
7171
values,
7272
} = this;
7373

7474
const response = await microsoftExcel.addRow({
7575
$,
76-
itemId,
76+
sheetId,
7777
tableId,
7878
tableName,
7979
data: {

components/microsoft_excel/actions/update-worksheet-tablerow/update-worksheet-tablerow.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import microsoftExcel from "../../microsoft_excel.app.mjs";
33
export default {
44
key: "microsoft_excel-update-worksheet-tablerow",
55
name: "Update Worksheet Tablerow",
6-
version: "0.0.4",
6+
version: "0.0.5",
77
description: "Update the properties of tablerow object. `(Only for work or school account)` [See the documentation](https://learn.microsoft.com/en-us/graph/api/tablerow-update?view=graph-rest-1.0&tabs=http)",
88
type: "action",
99
props: {
@@ -14,10 +14,10 @@ export default {
1414
"folderId",
1515
],
1616
},
17-
itemId: {
17+
sheetId: {
1818
propDefinition: [
1919
microsoftExcel,
20-
"itemId",
20+
"sheetId",
2121
({ folderId }) => ({
2222
folderId,
2323
}),
@@ -27,8 +27,8 @@ export default {
2727
propDefinition: [
2828
microsoftExcel,
2929
"tableId",
30-
({ itemId }) => ({
31-
itemId,
30+
({ sheetId }) => ({
31+
sheetId,
3232
}),
3333
],
3434
},
@@ -37,9 +37,9 @@ export default {
3737
microsoftExcel,
3838
"rowId",
3939
({
40-
itemId, tableId,
40+
sheetId, tableId,
4141
}) => ({
42-
itemId,
42+
sheetId,
4343
tableId,
4444
}),
4545
],
@@ -55,15 +55,15 @@ export default {
5555
async run({ $ }) {
5656
const {
5757
microsoftExcel,
58-
itemId,
58+
sheetId,
5959
tableId,
6060
rowId,
6161
values,
6262
} = this;
6363

6464
const response = await microsoftExcel.updateRow({
6565
$,
66-
itemId,
66+
sheetId,
6767
tableId,
6868
rowId,
6969
data: {

components/microsoft_excel/microsoft_excel.app.mjs

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default {
66
propDefinitions: {
77
folderId: {
88
type: "string",
9-
label: "Folder Id",
10-
description: "The ID of the folder where the item is located.",
9+
label: "Folder ID",
10+
description: "The ID of the folder where the item is located",
1111
async options() {
1212
const folders = await this.listFolderOptions();
1313
return [
@@ -16,15 +16,14 @@ export default {
1616
];
1717
},
1818
},
19-
itemId: {
19+
sheetId: {
2020
type: "string",
21-
label: "Item Id",
22-
description: "The Id of the item you want to use.",
21+
label: "Sheet ID",
22+
description: "The ID of the spreadsheet you want to use",
2323
async options({ folderId }) {
2424
const { value } = await this.listItems({
2525
folderId,
2626
});
27-
2827
return value.filter(
2928
(item) => item.file?.mimeType === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
3029
).map(({
@@ -37,13 +36,13 @@ export default {
3736
},
3837
rowId: {
3938
type: "string",
40-
label: "Row Id",
41-
description: "The Id of the row you want to use.",
39+
label: "Row ID",
40+
description: "The ID of the row you want to use",
4241
async options({
43-
itemId, tableId,
42+
sheetId, tableId,
4443
}) {
4544
const { value } = await this.listRows({
46-
itemId,
45+
sheetId,
4746
tableId,
4847
});
4948

@@ -57,11 +56,11 @@ export default {
5756
},
5857
tableId: {
5958
type: "string",
60-
label: "Table Id",
61-
description: "The Id of the table you want to use.",
62-
async options({ itemId }) {
59+
label: "Table ID",
60+
description: "The ID of the table you want to use",
61+
async options({ sheetId }) {
6362
const { value } = await this.listTables({
64-
itemId,
63+
sheetId,
6564
});
6665

6766
return value.map(({
@@ -99,11 +98,11 @@ export default {
9998
return axios($, config);
10099
},
101100
addRow({
102-
itemId, tableId, tableName, ...args
101+
sheetId, tableId, tableName, ...args
103102
}) {
104103
return this._makeRequest({
105104
method: "POST",
106-
path: `me/drive/items/${itemId}/workbook/tables/${tableId || tableName}/rows/add`,
105+
path: `me/drive/items/${sheetId}/workbook/tables/${tableId || tableName}/rows/add`,
107106
...args,
108107
});
109108
},
@@ -131,28 +130,28 @@ export default {
131130
});
132131
},
133132
listRows({
134-
itemId, tableId, ...args
133+
sheetId, tableId, ...args
135134
}) {
136135
return this._makeRequest({
137-
path: `me/drive/items/${itemId}/workbook/tables/${tableId}/rows`,
136+
path: `me/drive/items/${sheetId}/workbook/tables/${tableId}/rows`,
138137
...args,
139138
});
140139
},
141140
// List tables endpoint is not supported for personal accounts
142141
listTables({
143-
itemId, ...args
142+
sheetId, ...args
144143
}) {
145144
return this._makeRequest({
146-
path: `me/drive/items/${itemId}/workbook/tables`,
145+
path: `me/drive/items/${sheetId}/workbook/tables`,
147146
...args,
148147
});
149148
},
150149
updateRow({
151-
itemId, tableId, rowId, ...args
150+
sheetId, tableId, rowId, ...args
152151
}) {
153152
return this._makeRequest({
154153
method: "PATCH",
155-
path: `me/drive/items/${itemId}/workbook/tables/${tableId}/rows/itemAt(index=${rowId})`,
154+
path: `me/drive/items/${sheetId}/workbook/tables/${tableId}/rows/itemAt(index=${rowId})`,
156155
...args,
157156
});
158157
},
@@ -172,6 +171,22 @@ export default {
172171
...args,
173172
});
174173
},
174+
getDriveItem({
175+
itemId, ...args
176+
}) {
177+
return this._makeRequest({
178+
path: `me/drive/items/${itemId}`,
179+
...args,
180+
});
181+
},
182+
getDelta({
183+
path, token, ...args
184+
}) {
185+
return this._makeRequest({
186+
path: `${path}/delta?token=${token}`,
187+
...args,
188+
});
189+
},
175190
async listFolderOptions({
176191
folderId = null, prefix = "", batchLimit = 20, ...args
177192
} = {}) {

components/microsoft_excel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/microsoft_excel",
3-
"version": "0.1.3",
3+
"version": "0.2.0",
44
"description": "Pipedream Microsoft Excel Components",
55
"main": "microsoft_excel.app.mjs",
66
"keywords": [
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import common from "./base.mjs";
2+
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
3+
4+
export default {
5+
...common,
6+
props: {
7+
...common.props,
8+
timer: {
9+
type: "$.interface.timer",
10+
default: {
11+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
12+
},
13+
},
14+
},
15+
async run() {
16+
17+
},
18+
};

0 commit comments

Comments
 (0)