@maxim_mazurok/gapi.client.drive-v3 0.0.20230430 → 0.0.20230517

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.
Files changed (4) hide show
  1. package/index.d.ts +1530 -761
  2. package/package.json +2 -2
  3. package/readme.md +24 -24
  4. package/tests.ts +47 -24
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.drive-v3",
3
- "version": "0.0.20230430",
4
- "description": "TypeScript typings for Drive API v3",
3
+ "version": "0.0.20230517",
4
+ "description": "TypeScript typings for Google Drive API v3",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "email": "maxim@mazurok.com",
package/readme.md CHANGED
@@ -1,11 +1,11 @@
1
- # TypeScript typings for Drive API v3
1
+ # TypeScript typings for Google Drive API v3
2
2
 
3
- Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.
3
+ The Google Drive API allows clients to access resources from Google Drive.
4
4
  For detailed description please check [documentation](https://developers.google.com/drive/).
5
5
 
6
6
  ## Installing
7
7
 
8
- Install typings for Drive API:
8
+ Install typings for Google Drive API:
9
9
 
10
10
  ```
11
11
  npm install @types/gapi.client.drive-v3 --save-dev
@@ -83,7 +83,7 @@ gapi.auth.authorize(
83
83
  });
84
84
  ```
85
85
 
86
- After that you can use Drive API resources: <!-- TODO: make this work for multiple namespaces -->
86
+ After that you can use Google Drive API resources: <!-- TODO: make this work for multiple namespaces -->
87
87
 
88
88
  ```typescript
89
89
 
@@ -103,12 +103,12 @@ Lists the changes for a user or shared drive.
103
103
  await gapi.client.drive.changes.list({ pageToken: "pageToken", });
104
104
 
105
105
  /*
106
- Subscribes to changes for a user. To use this method, you must include the pageToken query parameter.
106
+ Subscribes to changes for a user.
107
107
  */
108
108
  await gapi.client.drive.changes.watch({ pageToken: "pageToken", });
109
109
 
110
110
  /*
111
- Stop watching resources through this channel
111
+ Stops watching resources through this channel.
112
112
  */
113
113
  await gapi.client.drive.channels.stop({ });
114
114
 
@@ -158,7 +158,7 @@ Hides a shared drive from the default view.
158
158
  await gapi.client.drive.drives.hide({ driveId: "driveId", });
159
159
 
160
160
  /*
161
- Lists the user's shared drives.
161
+ Lists the user's shared drives. This method accepts the `q` parameter, which is a search query combining one or more search terms. For more information, see the [Search for shared drives](/drive/api/guides/search-shareddrives) guide.
162
162
  */
163
163
  await gapi.client.drive.drives.list({ });
164
164
 
@@ -168,17 +168,17 @@ Restores a shared drive to the default view.
168
168
  await gapi.client.drive.drives.unhide({ driveId: "driveId", });
169
169
 
170
170
  /*
171
- Updates the metadata for a shared drive.
171
+ Updates the metadate for a shared drive.
172
172
  */
173
173
  await gapi.client.drive.drives.update({ driveId: "driveId", });
174
174
 
175
175
  /*
176
- Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.
176
+ Creates a copy of a file and applies any requested updates with patch semantics.
177
177
  */
178
178
  await gapi.client.drive.files.copy({ fileId: "fileId", });
179
179
 
180
180
  /*
181
- Creates a file.
181
+ Creates a new file. This method supports an */upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME types:*`*/*` Note: Specify a valid MIME type, rather than the literal `*/*` value. The literal `*/*` is only used to indicate that any valid MIME type can be uploaded. For more information on uploading files, see [Upload file data](/drive/api/guides/manage-uploads). Apps creating shortcuts with `files.create` must specify the MIME type `application/vnd.google-apps.shortcut`. Apps should specify a file extension in the `name` property when inserting files with the API. For example, an operation to insert a JPEG file should specify something like `"name": "cat.jpg"` in the metadata. Subsequent `GET` requests include the read-only `fileExtension` property populated with the extension originally specified in the `title` property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the title. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.
182
182
  */
183
183
  await gapi.client.drive.files.create({ });
184
184
 
@@ -188,7 +188,7 @@ Permanently deletes a file owned by the user without moving it to the trash. If
188
188
  await gapi.client.drive.files.delete({ fileId: "fileId", });
189
189
 
190
190
  /*
191
- Permanently deletes all trashed files of a user or shared drive.
191
+ Permanently deletes all of the user's trashed files.
192
192
  */
193
193
  await gapi.client.drive.files.emptyTrash({ });
194
194
 
@@ -203,12 +203,12 @@ Generates a set of file IDs which can be provided in create or copy requests.
203
203
  await gapi.client.drive.files.generateIds({ });
204
204
 
205
205
  /*
206
- Gets a file's metadata or content by ID.
206
+ Gets a file's metadata or content by ID. If you provide the URL parameter `alt=media`, then the response includes the file contents in the response body. Downloading content with `alt=media` only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use [`files.export`](/drive/api/reference/rest/v3/files/export) instead. For more information, see [Download & export files](/drive/api/guides/manage-downloads).
207
207
  */
208
208
  await gapi.client.drive.files.get({ fileId: "fileId", });
209
209
 
210
210
  /*
211
- Lists or searches files.
211
+ Lists the user's files. This method accepts the `q` parameter, which is a search query combining one or more search terms. For more information, see the [Search for files & folders](/drive/api/guides/search-files) guide. *Note:* This method returns *all* files by default, including trashed files. If you don't want trashed files to appear in the list, use the `trashed=false` query parameter to remove trashed files from the results.
212
212
  */
213
213
  await gapi.client.drive.files.list({ });
214
214
 
@@ -218,27 +218,27 @@ Lists the labels on a file.
218
218
  await gapi.client.drive.files.listLabels({ fileId: "fileId", });
219
219
 
220
220
  /*
221
- Modifies the set of labels on a file.
221
+ Modifies the set of labels applied to a file. Returns a list of the labels that were added or modified.
222
222
  */
223
223
  await gapi.client.drive.files.modifyLabels({ fileId: "fileId", });
224
224
 
225
225
  /*
226
- Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.
226
+ Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as `modifiedDate`. This method supports patch semantics. This method supports an */upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME types:*`*/*` Note: Specify a valid MIME type, rather than the literal `*/*` value. The literal `*/*` is only used to indicate that any valid MIME type can be uploaded. For more information on uploading files, see [Upload file data](/drive/api/guides/manage-uploads).
227
227
  */
228
228
  await gapi.client.drive.files.update({ fileId: "fileId", });
229
229
 
230
230
  /*
231
- Subscribe to changes on a file.
231
+ Subscribes to changes to a file.
232
232
  */
233
233
  await gapi.client.drive.files.watch({ fileId: "fileId", });
234
234
 
235
235
  /*
236
- Creates a permission for a file or shared drive. For more information on creating permissions, see Share files, folders & drives.
236
+ Creates a permission for a file or shared drive. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied.
237
237
  */
238
238
  await gapi.client.drive.permissions.create({ fileId: "fileId", });
239
239
 
240
240
  /*
241
- Deletes a permission.
241
+ Deletes a permission. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied.
242
242
  */
243
243
  await gapi.client.drive.permissions.delete({ fileId: "fileId", permissionId: "permissionId", });
244
244
 
@@ -253,7 +253,7 @@ Lists a file's or shared drive's permissions.
253
253
  await gapi.client.drive.permissions.list({ fileId: "fileId", });
254
254
 
255
255
  /*
256
- Updates a permission with patch semantics.
256
+ Updates a permission with patch semantics. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied.
257
257
  */
258
258
  await gapi.client.drive.permissions.update({ fileId: "fileId", permissionId: "permissionId", });
259
259
 
@@ -303,27 +303,27 @@ Updates a revision with patch semantics.
303
303
  await gapi.client.drive.revisions.update({ fileId: "fileId", revisionId: "revisionId", });
304
304
 
305
305
  /*
306
- Deprecated use drives.create instead.
306
+ Deprecated: Use `drives.create` instead.
307
307
  */
308
308
  await gapi.client.drive.teamdrives.create({ requestId: "requestId", });
309
309
 
310
310
  /*
311
- Deprecated use drives.delete instead.
311
+ Deprecated: Use `drives.delete` instead.
312
312
  */
313
313
  await gapi.client.drive.teamdrives.delete({ teamDriveId: "teamDriveId", });
314
314
 
315
315
  /*
316
- Deprecated use drives.get instead.
316
+ Deprecated: Use `drives.get` instead.
317
317
  */
318
318
  await gapi.client.drive.teamdrives.get({ teamDriveId: "teamDriveId", });
319
319
 
320
320
  /*
321
- Deprecated use drives.list instead.
321
+ Deprecated: Use `drives.list` instead.
322
322
  */
323
323
  await gapi.client.drive.teamdrives.list({ });
324
324
 
325
325
  /*
326
- Deprecated use drives.update instead
326
+ Deprecated: Use `drives.update` instead.
327
327
  */
328
328
  await gapi.client.drive.teamdrives.update({ teamDriveId: "teamDriveId", });
329
329
  ```
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20230430
6
+ // Revision: 20230517
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -44,7 +44,8 @@ gapi.load('client', async () => {
44
44
 
45
45
  async function run() {
46
46
  /** Gets information about the user, the user's Drive, and system capabilities. */
47
- await gapi.client.drive.about.get();
47
+ await gapi.client.drive.about.get({
48
+ });
48
49
  /** Gets the starting pageToken for listing future changes. */
49
50
  await gapi.client.drive.changes.getStartPageToken({
50
51
  driveId: "Test string",
@@ -69,7 +70,7 @@ gapi.load('client', async () => {
69
70
  supportsTeamDrives: true,
70
71
  teamDriveId: "Test string",
71
72
  });
72
- /** Subscribes to changes for a user. To use this method, you must include the pageToken query parameter. */
73
+ /** Subscribes to changes for a user. */
73
74
  await gapi.client.drive.changes.watch({
74
75
  driveId: "Test string",
75
76
  includeCorpusRemovals: true,
@@ -99,8 +100,9 @@ gapi.load('client', async () => {
99
100
  token: "Test string",
100
101
  type: "Test string",
101
102
  });
102
- /** Stop watching resources through this channel */
103
- await gapi.client.drive.channels.stop({} , {
103
+ /** Stops watching resources through this channel. */
104
+ await gapi.client.drive.channels.stop({
105
+ }, {
104
106
  address: "Test string",
105
107
  expiration: "Test string",
106
108
  id: "Test string",
@@ -290,7 +292,10 @@ gapi.load('client', async () => {
290
292
  await gapi.client.drive.drives.hide({
291
293
  driveId: "Test string",
292
294
  });
293
- /** Lists the user's shared drives. */
295
+ /**
296
+ * Lists the user's shared drives. This method accepts the `q` parameter, which is a search query combining one or more search terms. For more information, see the [Search for shared
297
+ * drives](/drive/api/guides/search-shareddrives) guide.
298
+ */
294
299
  await gapi.client.drive.drives.list({
295
300
  pageSize: 42,
296
301
  pageToken: "Test string",
@@ -301,7 +306,7 @@ gapi.load('client', async () => {
301
306
  await gapi.client.drive.drives.unhide({
302
307
  driveId: "Test string",
303
308
  });
304
- /** Updates the metadata for a shared drive. */
309
+ /** Updates the metadate for a shared drive. */
305
310
  await gapi.client.drive.drives.update({
306
311
  driveId: "Test string",
307
312
  useDomainAdminAccess: true,
@@ -351,7 +356,7 @@ gapi.load('client', async () => {
351
356
  },
352
357
  themeId: "Test string",
353
358
  });
354
- /** Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied. */
359
+ /** Creates a copy of a file and applies any requested updates with patch semantics. */
355
360
  await gapi.client.drive.files.copy({
356
361
  enforceSingleParent: true,
357
362
  fileId: "Test string",
@@ -634,7 +639,15 @@ gapi.load('client', async () => {
634
639
  webViewLink: "Test string",
635
640
  writersCanShare: true,
636
641
  });
637
- /** Creates a file. */
642
+ /**
643
+ * Creates a new file. This method supports an *‍/upload* URI and accepts uploaded media with the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIME
644
+ * types:*`*‍/*` Note: Specify a valid MIME type, rather than the literal `*‍/*` value. The literal `*‍/*` is only used to indicate that any valid MIME type can be uploaded. For more
645
+ * information on uploading files, see [Upload file data](/drive/api/guides/manage-uploads). Apps creating shortcuts with `files.create` must specify the MIME type
646
+ * `application/vnd.google-apps.shortcut`. Apps should specify a file extension in the `name` property when inserting files with the API. For example, an operation to insert a JPEG file
647
+ * should specify something like `"name": "cat.jpg"` in the metadata. Subsequent `GET` requests include the read-only `fileExtension` property populated with the extension originally
648
+ * specified in the `title` property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with
649
+ * extension) based on the title. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.
650
+ */
638
651
  await gapi.client.drive.files.create({
639
652
  enforceSingleParent: true,
640
653
  ignoreDefaultVisibility: true,
@@ -927,7 +940,7 @@ gapi.load('client', async () => {
927
940
  supportsAllDrives: true,
928
941
  supportsTeamDrives: true,
929
942
  });
930
- /** Permanently deletes all trashed files of a user or shared drive. */
943
+ /** Permanently deletes all of the user's trashed files. */
931
944
  await gapi.client.drive.files.emptyTrash({
932
945
  driveId: "Test string",
933
946
  enforceSingleParent: true,
@@ -943,7 +956,11 @@ gapi.load('client', async () => {
943
956
  space: "Test string",
944
957
  type: "Test string",
945
958
  });
946
- /** Gets a file's metadata or content by ID. */
959
+ /**
960
+ * Gets a file's metadata or content by ID. If you provide the URL parameter `alt=media`, then the response includes the file contents in the response body. Downloading content with
961
+ * `alt=media` only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use [`files.export`](/drive/api/reference/rest/v3/files/export) instead. For more
962
+ * information, see [Download & export files](/drive/api/guides/manage-downloads).
963
+ */
947
964
  await gapi.client.drive.files.get({
948
965
  acknowledgeAbuse: true,
949
966
  fileId: "Test string",
@@ -952,7 +969,11 @@ gapi.load('client', async () => {
952
969
  supportsAllDrives: true,
953
970
  supportsTeamDrives: true,
954
971
  });
955
- /** Lists or searches files. */
972
+ /**
973
+ * Lists the user's files. This method accepts the `q` parameter, which is a search query combining one or more search terms. For more information, see the [Search for files &
974
+ * folders](/drive/api/guides/search-files) guide. *Note:* This method returns *all* files by default, including trashed files. If you don't want trashed files to appear in the list, use
975
+ * the `trashed=false` query parameter to remove trashed files from the results.
976
+ */
956
977
  await gapi.client.drive.files.list({
957
978
  corpora: "Test string",
958
979
  corpus: "Test string",
@@ -976,7 +997,7 @@ gapi.load('client', async () => {
976
997
  maxResults: 42,
977
998
  pageToken: "Test string",
978
999
  });
979
- /** Modifies the set of labels on a file. */
1000
+ /** Modifies the set of labels applied to a file. Returns a list of the labels that were added or modified. */
980
1001
  await gapi.client.drive.files.modifyLabels({
981
1002
  fileId: "Test string",
982
1003
  }, {
@@ -1012,8 +1033,10 @@ gapi.load('client', async () => {
1012
1033
  ],
1013
1034
  });
1014
1035
  /**
1015
- * Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change
1016
- * automatically, such as modifiedDate. This method supports patch semantics.
1036
+ * Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed
1037
+ * automatically, such as `modifiedDate`. This method supports patch semantics. This method supports an *‍/upload* URI and accepts uploaded media with the following characteristics: -
1038
+ * *Maximum file size:* 5,120 GB - *Accepted Media MIME types:*`*‍/*` Note: Specify a valid MIME type, rather than the literal `*‍/*` value. The literal `*‍/*` is only used to indicate
1039
+ * that any valid MIME type can be uploaded. For more information on uploading files, see [Upload file data](/drive/api/guides/manage-uploads).
1017
1040
  */
1018
1041
  await gapi.client.drive.files.update({
1019
1042
  addParents: "Test string",
@@ -1299,7 +1322,7 @@ gapi.load('client', async () => {
1299
1322
  webViewLink: "Test string",
1300
1323
  writersCanShare: true,
1301
1324
  });
1302
- /** Subscribe to changes on a file. */
1325
+ /** Subscribes to changes to a file. */
1303
1326
  await gapi.client.drive.files.watch({
1304
1327
  acknowledgeAbuse: true,
1305
1328
  fileId: "Test string",
@@ -1321,7 +1344,7 @@ gapi.load('client', async () => {
1321
1344
  token: "Test string",
1322
1345
  type: "Test string",
1323
1346
  });
1324
- /** Creates a permission for a file or shared drive. For more information on creating permissions, see Share files, folders & drives. */
1347
+ /** Creates a permission for a file or shared drive. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied. */
1325
1348
  await gapi.client.drive.permissions.create({
1326
1349
  emailMessage: "Test string",
1327
1350
  enforceSingleParent: true,
@@ -1363,7 +1386,7 @@ gapi.load('client', async () => {
1363
1386
  type: "Test string",
1364
1387
  view: "Test string",
1365
1388
  });
1366
- /** Deletes a permission. */
1389
+ /** Deletes a permission. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied. */
1367
1390
  await gapi.client.drive.permissions.delete({
1368
1391
  fileId: "Test string",
1369
1392
  permissionId: "Test string",
@@ -1389,7 +1412,7 @@ gapi.load('client', async () => {
1389
1412
  supportsTeamDrives: true,
1390
1413
  useDomainAdminAccess: true,
1391
1414
  });
1392
- /** Updates a permission with patch semantics. */
1415
+ /** Updates a permission with patch semantics. **Warning:** Concurrent permissions operations on the same file are not supported; only the last update is applied. */
1393
1416
  await gapi.client.drive.permissions.update({
1394
1417
  fileId: "Test string",
1395
1418
  permissionId: "Test string",
@@ -1544,7 +1567,7 @@ gapi.load('client', async () => {
1544
1567
  publishedOutsideDomain: true,
1545
1568
  size: "Test string",
1546
1569
  });
1547
- /** Deprecated use drives.create instead. */
1570
+ /** Deprecated: Use `drives.create` instead. */
1548
1571
  await gapi.client.drive.teamdrives.create({
1549
1572
  requestId: "Test string",
1550
1573
  }, {
@@ -1593,23 +1616,23 @@ gapi.load('client', async () => {
1593
1616
  },
1594
1617
  themeId: "Test string",
1595
1618
  });
1596
- /** Deprecated use drives.delete instead. */
1619
+ /** Deprecated: Use `drives.delete` instead. */
1597
1620
  await gapi.client.drive.teamdrives.delete({
1598
1621
  teamDriveId: "Test string",
1599
1622
  });
1600
- /** Deprecated use drives.get instead. */
1623
+ /** Deprecated: Use `drives.get` instead. */
1601
1624
  await gapi.client.drive.teamdrives.get({
1602
1625
  teamDriveId: "Test string",
1603
1626
  useDomainAdminAccess: true,
1604
1627
  });
1605
- /** Deprecated use drives.list instead. */
1628
+ /** Deprecated: Use `drives.list` instead. */
1606
1629
  await gapi.client.drive.teamdrives.list({
1607
1630
  pageSize: 42,
1608
1631
  pageToken: "Test string",
1609
1632
  q: "Test string",
1610
1633
  useDomainAdminAccess: true,
1611
1634
  });
1612
- /** Deprecated use drives.update instead */
1635
+ /** Deprecated: Use `drives.update` instead. */
1613
1636
  await gapi.client.drive.teamdrives.update({
1614
1637
  teamDriveId: "Test string",
1615
1638
  useDomainAdminAccess: true,