feat: Convert all app files to JS

This commit is contained in:
Faruk AYDIN
2024-01-05 17:44:21 +01:00
parent b95478b635
commit 43dba351c3
1030 changed files with 5114 additions and 6436 deletions

View File

@@ -0,0 +1,3 @@
import listForms from './list-forms/index.js';
export default [listForms];

View File

@@ -1,3 +0,0 @@
import listForms from './list-forms';
export default [listForms];

View File

@@ -1,24 +1,23 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
export default {
name: 'List forms',
key: 'listForms',
async run($: IGlobalVariable) {
const forms: {
data: IJSONObject[];
} = {
async run($) {
const forms = {
data: [],
};
const params = {
q: `mimeType='application/vnd.google-apps.form'`,
spaces: 'drive',
pageToken: undefined as unknown as string,
pageToken: undefined,
};
do {
const { data } = await $.http.get(`https://www.googleapis.com/drive/v3/files`, { params });
const { data } = await $.http.get(
`https://www.googleapis.com/drive/v3/files`,
{ params }
);
params.pageToken = data.nextPageToken;
for (const file of data.files) {