Skip to content

Commit 995c479

Browse files
committed
fix sources
1 parent 71e12b0 commit 995c479

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

components/google_docs/sources/common/base.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import newFilesInstant from "@pipedream/google_drive/sources/new-files-instant/new-files-instant.mjs";
2-
import app from "../../google_docs.app.mjs";
2+
import googleDrive from "../../google_docs.app.mjs";
33
import { MY_DRIVE_VALUE } from "@pipedream/google_drive/common/constants.mjs";
44

55
export default {
66
...newFilesInstant,
77
props: {
8-
app,
8+
googleDrive,
99
db: "$.service.db",
1010
http: "$.interface.http",
1111
timer: newFilesInstant.props.timer,
1212
folders: {
1313
propDefinition: [
14-
app,
14+
googleDrive,
1515
"folderId",
1616
],
1717
type: "string[]",
@@ -30,7 +30,7 @@ export default {
3030
methods: {
3131
...newFilesInstant.methods,
3232
getDriveId() {
33-
return app.methods.getDriveId(MY_DRIVE_VALUE);
33+
return googleDrive.methods.getDriveId(MY_DRIVE_VALUE);
3434
},
3535
shouldProcess(file) {
3636
return (
@@ -48,7 +48,7 @@ export default {
4848
async getDocumentsFromFiles(files, limit) {
4949
return files.reduce(async (acc, file) => {
5050
const docs = await acc;
51-
const fileInfo = await this.app.getFile(file.id);
51+
const fileInfo = await this.googleDrive.getFile(file.id);
5252
return docs.length >= limit
5353
? docs
5454
: docs.concat(fileInfo);
@@ -59,13 +59,13 @@ export default {
5959

6060
if (!foldersIds?.length) {
6161
const opts = this.getDocumentsFromFolderOpts("root");
62-
const { files } = await this.app.listFilesInPage(null, opts);
62+
const { files } = await this.googleDrive.listFilesInPage(null, opts);
6363
return this.getDocumentsFromFiles(files, limit);
6464
}
6565

6666
return foldersIds.reduce(async (docs, folderId) => {
6767
const opts = this.getDocumentsFromFolderOpts(folderId);
68-
const { files } = await this.app.listFilesInPage(null, opts);
68+
const { files } = await this.googleDrive.listFilesInPage(null, opts);
6969
const nextDocuments = await this.getDocumentsFromFiles(files, limit);
7070
return (await docs).concat(nextDocuments);
7171
}, []);
@@ -75,7 +75,7 @@ export default {
7575
if (!this.shouldProcess(file)) {
7676
continue;
7777
}
78-
const doc = await this.app.getDocument(file.id);
78+
const doc = await this.googleDrive.getDocument(file.id);
7979
this.$emit(doc, this.generateMeta(doc));
8080
}
8181
},

components/google_docs/sources/new-document-created/new-document-created.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default {
2727
fields: "*",
2828
});
2929

30-
const { files } = await this.app.listFilesInPage(null, args);
30+
const { files } = await this.googleDrive.listFilesInPage(null, args);
3131
if (!files?.length) {
3232
return;
3333
}

components/google_docs/sources/new-or-updated-document/new-or-updated-document.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import common from "../common/base.mjs";
22
import {
33
GOOGLE_DRIVE_NOTIFICATION_CHANGE,
44
GOOGLE_DRIVE_NOTIFICATION_UPDATE,
5-
} from "../../../google_drive/common/constants.mjs";
5+
} from "@pipedream/google_drive/common/constants.mjs";
66

77
export default {
88
...common,
@@ -31,7 +31,7 @@ export default {
3131
const filteredFiles = this.checkMinimumInterval(changedFiles);
3232

3333
for (const file of filteredFiles) {
34-
file.parents = (await this.app.getFile(file.id, {
34+
file.parents = (await this.googleDrive.getFile(file.id, {
3535
fields: "parents",
3636
})).parents;
3737

@@ -42,7 +42,7 @@ export default {
4242
continue;
4343
}
4444

45-
const doc = await this.app.getDocument(file.id);
45+
const doc = await this.googleDrive.getDocument(file.id);
4646
const meta = this.generateMeta(doc);
4747
this.$emit(doc, meta);
4848
}

0 commit comments

Comments
 (0)