@maxim_mazurok/gapi.client.sheets-v4 0.0.20231114 → 0.0.20231128

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,17 +1,17 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.sheets-v4",
3
- "version": "0.0.20231114",
3
+ "version": "0.0.20231128",
4
4
  "description": "TypeScript typings for Google Sheets API v4",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
5
9
  "license": "MIT",
6
10
  "author": {
7
- "email": "maxim@mazurok.com",
8
11
  "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
9
13
  "url": "https://maxim.mazurok.com"
10
14
  },
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
- },
15
15
  "types": "index.d.ts",
16
16
  "dependencies": {
17
17
  "@types/gapi.client": "*",
package/readme.md CHANGED
@@ -25,10 +25,13 @@ gapi.load('client', () => {
25
25
  Then load api client wrapper:
26
26
 
27
27
  ```typescript
28
- gapi.client.load('https://sheets.googleapis.com/$discovery/rest?version=v4', () => {
29
- // now we can use:
30
- // gapi.client.sheets
31
- });
28
+ gapi.client.load(
29
+ 'https://sheets.googleapis.com/$discovery/rest?version=v4',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.sheets
33
+ }
34
+ );
32
35
  ```
33
36
 
34
37
  ```typescript
@@ -45,56 +48,60 @@ Don't forget to authenticate your client before sending any request to resources
45
48
  // declare client_id registered in Google Developers Console
46
49
  var client_id = '',
47
50
  scope = [
48
- // See, edit, create, and delete all of your Google Drive files
49
- 'https://www.googleapis.com/auth/drive',
51
+ // See, edit, create, and delete all of your Google Drive files
52
+ 'https://www.googleapis.com/auth/drive',
50
53
 
51
- // See, edit, create, and delete only the specific Google Drive files you use with this app
52
- 'https://www.googleapis.com/auth/drive.file',
54
+ // See, edit, create, and delete only the specific Google Drive files you use with this app
55
+ 'https://www.googleapis.com/auth/drive.file',
53
56
 
54
- // See and download all your Google Drive files
55
- 'https://www.googleapis.com/auth/drive.readonly',
57
+ // See and download all your Google Drive files
58
+ 'https://www.googleapis.com/auth/drive.readonly',
56
59
 
57
- // See, edit, create, and delete all your Google Sheets spreadsheets
58
- 'https://www.googleapis.com/auth/spreadsheets',
60
+ // See, edit, create, and delete all your Google Sheets spreadsheets
61
+ 'https://www.googleapis.com/auth/spreadsheets',
59
62
 
60
- // See all your Google Sheets spreadsheets
61
- 'https://www.googleapis.com/auth/spreadsheets.readonly',
62
- ],
63
- immediate = true;
63
+ // See all your Google Sheets spreadsheets
64
+ 'https://www.googleapis.com/auth/spreadsheets.readonly',
65
+ ],
66
+ immediate = true;
64
67
  // ...
65
68
 
66
69
  gapi.auth.authorize(
67
- { client_id: client_id, scope: scope, immediate: immediate },
70
+ {client_id: client_id, scope: scope, immediate: immediate},
68
71
  authResult => {
69
72
  if (authResult && !authResult.error) {
70
- /* handle successful authorization */
73
+ /* handle successful authorization */
71
74
  } else {
72
- /* handle authorization error */
75
+ /* handle authorization error */
73
76
  }
74
- });
77
+ }
78
+ );
75
79
  ```
76
80
 
77
81
  After that you can use Google Sheets API resources: <!-- TODO: make this work for multiple namespaces -->
78
82
 
79
83
  ```typescript
80
-
81
84
  /*
82
85
  Applies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. The replies will mirror the requests. For example, if you applied 4 updates and the 3rd one had a reply, then the response will have 2 empty replies, the actual reply, and another empty reply, in that order. Due to the collaborative nature of spreadsheets, it is not guaranteed that the spreadsheet will reflect exactly your changes after this completes, however it is guaranteed that the updates in the request will be applied together atomically. Your changes may be altered with respect to collaborator changes. If there are no collaborators, the spreadsheet should reflect your changes.
83
86
  */
84
- await gapi.client.sheets.spreadsheets.batchUpdate({ spreadsheetId: "spreadsheetId", });
87
+ await gapi.client.sheets.spreadsheets.batchUpdate({
88
+ spreadsheetId: 'spreadsheetId',
89
+ });
85
90
 
86
91
  /*
87
92
  Creates a spreadsheet, returning the newly created spreadsheet.
88
93
  */
89
- await gapi.client.sheets.spreadsheets.create({ });
94
+ await gapi.client.sheets.spreadsheets.create({});
90
95
 
91
96
  /*
92
97
  Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids is not returned. You can include grid data in one of 2 ways: * Specify a [field mask](https://developers.google.com/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData URL parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want. To retrieve only subsets of spreadsheet data, use the ranges URL parameter. Ranges are specified using [A1 notation](/sheets/api/guides/concepts#cell). You can define a single cell (for example, `A1`) or multiple cells (for example, `A1:D5`). You can also get cells from other sheets within the same spreadsheet (for example, `Sheet2!A1:C4`) or retrieve multiple ranges at once (for example, `?ranges=A1:D5&ranges=Sheet2!A1:C4`). Limiting the range returns only the portions of the spreadsheet that intersect the requested ranges.
93
98
  */
94
- await gapi.client.sheets.spreadsheets.get({ spreadsheetId: "spreadsheetId", });
99
+ await gapi.client.sheets.spreadsheets.get({spreadsheetId: 'spreadsheetId'});
95
100
 
96
101
  /*
97
102
  Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified. Specifying one or more data filters returns the portions of the spreadsheet that intersect ranges matched by any of the filters. By default, data within grids is not returned. You can include grid data one of 2 ways: * Specify a [field mask](https://developers.google.com/sheets/api/guides/field-masks) listing your desired fields using the `fields` URL parameter in HTTP * Set the includeGridData parameter to true. If a field mask is set, the `includeGridData` parameter is ignored For large spreadsheets, as a best practice, retrieve only the specific spreadsheet fields that you want.
98
103
  */
99
- await gapi.client.sheets.spreadsheets.getByDataFilter({ spreadsheetId: "spreadsheetId", });
104
+ await gapi.client.sheets.spreadsheets.getByDataFilter({
105
+ spreadsheetId: 'spreadsheetId',
106
+ });
100
107
  ```