@maxim_mazurok/gapi.client.bigquery-v2 0.0.20231030 → 0.0.20231202
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/index.d.ts +3531 -5769
- package/package.json +6 -6
- package/readme.md +158 -63
- package/tests.ts +0 -3388
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxim_mazurok/gapi.client.bigquery-v2",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20231202",
|
|
4
4
|
"description": "TypeScript typings for BigQuery API v2",
|
|
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(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://bigquery.googleapis.com/$discovery/rest?version=v2',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.bigquery
|
|
33
|
+
}
|
|
34
|
+
);
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
```typescript
|
|
@@ -45,232 +48,324 @@ 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
|
-
|
|
49
|
-
|
|
51
|
+
// View and manage your data in Google BigQuery and see the email address for your Google Account
|
|
52
|
+
'https://www.googleapis.com/auth/bigquery',
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
// Insert data into Google BigQuery
|
|
55
|
+
'https://www.googleapis.com/auth/bigquery.insertdata',
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
58
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
// View your data across Google Cloud services and see the email address of your Google Account
|
|
61
|
+
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
// Manage your data and permissions in Cloud Storage and see the email address for your Google Account
|
|
64
|
+
'https://www.googleapis.com/auth/devstorage.full_control',
|
|
62
65
|
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
// View your data in Google Cloud Storage
|
|
67
|
+
'https://www.googleapis.com/auth/devstorage.read_only',
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
// Manage your data in Cloud Storage and see the email address of your Google Account
|
|
70
|
+
'https://www.googleapis.com/auth/devstorage.read_write',
|
|
71
|
+
],
|
|
72
|
+
immediate = true;
|
|
70
73
|
// ...
|
|
71
74
|
|
|
72
75
|
gapi.auth.authorize(
|
|
73
|
-
{
|
|
76
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
74
77
|
authResult => {
|
|
75
78
|
if (authResult && !authResult.error) {
|
|
76
|
-
|
|
79
|
+
/* handle successful authorization */
|
|
77
80
|
} else {
|
|
78
|
-
|
|
81
|
+
/* handle authorization error */
|
|
79
82
|
}
|
|
80
|
-
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
81
85
|
```
|
|
82
86
|
|
|
83
87
|
After that you can use BigQuery API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
84
88
|
|
|
85
89
|
```typescript
|
|
86
|
-
|
|
87
90
|
/*
|
|
88
91
|
Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
|
|
89
92
|
*/
|
|
90
|
-
await gapi.client.bigquery.datasets.delete({
|
|
93
|
+
await gapi.client.bigquery.datasets.delete({
|
|
94
|
+
datasetId: 'datasetId',
|
|
95
|
+
projectId: 'projectId',
|
|
96
|
+
});
|
|
91
97
|
|
|
92
98
|
/*
|
|
93
99
|
Returns the dataset specified by datasetID.
|
|
94
100
|
*/
|
|
95
|
-
await gapi.client.bigquery.datasets.get({
|
|
101
|
+
await gapi.client.bigquery.datasets.get({
|
|
102
|
+
datasetId: 'datasetId',
|
|
103
|
+
projectId: 'projectId',
|
|
104
|
+
});
|
|
96
105
|
|
|
97
106
|
/*
|
|
98
107
|
Creates a new empty dataset.
|
|
99
108
|
*/
|
|
100
|
-
await gapi.client.bigquery.datasets.insert({
|
|
109
|
+
await gapi.client.bigquery.datasets.insert({projectId: 'projectId'});
|
|
101
110
|
|
|
102
111
|
/*
|
|
103
112
|
Lists all datasets in the specified project to which you have been granted the READER dataset role.
|
|
104
113
|
*/
|
|
105
|
-
await gapi.client.bigquery.datasets.list({
|
|
114
|
+
await gapi.client.bigquery.datasets.list({projectId: 'projectId'});
|
|
106
115
|
|
|
107
116
|
/*
|
|
108
117
|
Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.
|
|
109
118
|
*/
|
|
110
|
-
await gapi.client.bigquery.datasets.patch({
|
|
119
|
+
await gapi.client.bigquery.datasets.patch({
|
|
120
|
+
datasetId: 'datasetId',
|
|
121
|
+
projectId: 'projectId',
|
|
122
|
+
});
|
|
111
123
|
|
|
112
124
|
/*
|
|
113
125
|
Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.
|
|
114
126
|
*/
|
|
115
|
-
await gapi.client.bigquery.datasets.update({
|
|
127
|
+
await gapi.client.bigquery.datasets.update({
|
|
128
|
+
datasetId: 'datasetId',
|
|
129
|
+
projectId: 'projectId',
|
|
130
|
+
});
|
|
116
131
|
|
|
117
132
|
/*
|
|
118
133
|
Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
|
|
119
134
|
*/
|
|
120
|
-
await gapi.client.bigquery.jobs.cancel({
|
|
135
|
+
await gapi.client.bigquery.jobs.cancel({
|
|
136
|
+
jobId: 'jobId',
|
|
137
|
+
projectId: 'projectId',
|
|
138
|
+
});
|
|
121
139
|
|
|
122
140
|
/*
|
|
123
141
|
Requests the deletion of the metadata of a job. This call returns when the job's metadata is deleted.
|
|
124
142
|
*/
|
|
125
|
-
await gapi.client.bigquery.jobs.delete({
|
|
143
|
+
await gapi.client.bigquery.jobs.delete({
|
|
144
|
+
jobId: 'jobId',
|
|
145
|
+
projectId: 'projectId',
|
|
146
|
+
});
|
|
126
147
|
|
|
127
148
|
/*
|
|
128
149
|
Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
|
|
129
150
|
*/
|
|
130
|
-
await gapi.client.bigquery.jobs.get({
|
|
151
|
+
await gapi.client.bigquery.jobs.get({jobId: 'jobId', projectId: 'projectId'});
|
|
131
152
|
|
|
132
153
|
/*
|
|
133
154
|
Retrieves the results of a query job.
|
|
134
155
|
*/
|
|
135
|
-
await gapi.client.bigquery.jobs.getQueryResults({
|
|
156
|
+
await gapi.client.bigquery.jobs.getQueryResults({
|
|
157
|
+
jobId: 'jobId',
|
|
158
|
+
projectId: 'projectId',
|
|
159
|
+
});
|
|
136
160
|
|
|
137
161
|
/*
|
|
138
162
|
Starts a new asynchronous job. Requires the Can View project role.
|
|
139
163
|
*/
|
|
140
|
-
await gapi.client.bigquery.jobs.insert({
|
|
164
|
+
await gapi.client.bigquery.jobs.insert({projectId: 'projectId'});
|
|
141
165
|
|
|
142
166
|
/*
|
|
143
167
|
Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
|
|
144
168
|
*/
|
|
145
|
-
await gapi.client.bigquery.jobs.list({
|
|
169
|
+
await gapi.client.bigquery.jobs.list({projectId: 'projectId'});
|
|
146
170
|
|
|
147
171
|
/*
|
|
148
172
|
Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.
|
|
149
173
|
*/
|
|
150
|
-
await gapi.client.bigquery.jobs.query({
|
|
174
|
+
await gapi.client.bigquery.jobs.query({projectId: 'projectId'});
|
|
151
175
|
|
|
152
176
|
/*
|
|
153
177
|
Deletes the model specified by modelId from the dataset.
|
|
154
178
|
*/
|
|
155
|
-
await gapi.client.bigquery.models.delete({
|
|
179
|
+
await gapi.client.bigquery.models.delete({
|
|
180
|
+
datasetId: 'datasetId',
|
|
181
|
+
modelId: 'modelId',
|
|
182
|
+
projectId: 'projectId',
|
|
183
|
+
});
|
|
156
184
|
|
|
157
185
|
/*
|
|
158
186
|
Gets the specified model resource by model ID.
|
|
159
187
|
*/
|
|
160
|
-
await gapi.client.bigquery.models.get({
|
|
188
|
+
await gapi.client.bigquery.models.get({
|
|
189
|
+
datasetId: 'datasetId',
|
|
190
|
+
modelId: 'modelId',
|
|
191
|
+
projectId: 'projectId',
|
|
192
|
+
});
|
|
161
193
|
|
|
162
194
|
/*
|
|
163
195
|
Lists all models in the specified dataset. Requires the READER dataset role. After retrieving the list of models, you can get information about a particular model by calling the models.get method.
|
|
164
196
|
*/
|
|
165
|
-
await gapi.client.bigquery.models.list({
|
|
197
|
+
await gapi.client.bigquery.models.list({
|
|
198
|
+
datasetId: 'datasetId',
|
|
199
|
+
projectId: 'projectId',
|
|
200
|
+
});
|
|
166
201
|
|
|
167
202
|
/*
|
|
168
203
|
Patch specific fields in the specified model.
|
|
169
204
|
*/
|
|
170
|
-
await gapi.client.bigquery.models.patch({
|
|
205
|
+
await gapi.client.bigquery.models.patch({
|
|
206
|
+
datasetId: 'datasetId',
|
|
207
|
+
modelId: 'modelId',
|
|
208
|
+
projectId: 'projectId',
|
|
209
|
+
});
|
|
171
210
|
|
|
172
211
|
/*
|
|
173
212
|
Returns the email address of the service account for your project used for interactions with Google Cloud KMS.
|
|
174
213
|
*/
|
|
175
|
-
await gapi.client.bigquery.projects.getServiceAccount({
|
|
214
|
+
await gapi.client.bigquery.projects.getServiceAccount({projectId: 'projectId'});
|
|
176
215
|
|
|
177
216
|
/*
|
|
178
217
|
Lists all projects to which you have been granted any project role.
|
|
179
218
|
*/
|
|
180
|
-
await gapi.client.bigquery.projects.list({
|
|
219
|
+
await gapi.client.bigquery.projects.list({});
|
|
181
220
|
|
|
182
221
|
/*
|
|
183
222
|
Deletes the routine specified by routineId from the dataset.
|
|
184
223
|
*/
|
|
185
|
-
await gapi.client.bigquery.routines.delete({
|
|
224
|
+
await gapi.client.bigquery.routines.delete({
|
|
225
|
+
datasetId: 'datasetId',
|
|
226
|
+
projectId: 'projectId',
|
|
227
|
+
routineId: 'routineId',
|
|
228
|
+
});
|
|
186
229
|
|
|
187
230
|
/*
|
|
188
231
|
Gets the specified routine resource by routine ID.
|
|
189
232
|
*/
|
|
190
|
-
await gapi.client.bigquery.routines.get({
|
|
233
|
+
await gapi.client.bigquery.routines.get({
|
|
234
|
+
datasetId: 'datasetId',
|
|
235
|
+
projectId: 'projectId',
|
|
236
|
+
routineId: 'routineId',
|
|
237
|
+
});
|
|
191
238
|
|
|
192
239
|
/*
|
|
193
240
|
Creates a new routine in the dataset.
|
|
194
241
|
*/
|
|
195
|
-
await gapi.client.bigquery.routines.insert({
|
|
242
|
+
await gapi.client.bigquery.routines.insert({
|
|
243
|
+
datasetId: 'datasetId',
|
|
244
|
+
projectId: 'projectId',
|
|
245
|
+
});
|
|
196
246
|
|
|
197
247
|
/*
|
|
198
248
|
Lists all routines in the specified dataset. Requires the READER dataset role.
|
|
199
249
|
*/
|
|
200
|
-
await gapi.client.bigquery.routines.list({
|
|
250
|
+
await gapi.client.bigquery.routines.list({
|
|
251
|
+
datasetId: 'datasetId',
|
|
252
|
+
projectId: 'projectId',
|
|
253
|
+
});
|
|
201
254
|
|
|
202
255
|
/*
|
|
203
256
|
Updates information in an existing routine. The update method replaces the entire Routine resource.
|
|
204
257
|
*/
|
|
205
|
-
await gapi.client.bigquery.routines.update({
|
|
258
|
+
await gapi.client.bigquery.routines.update({
|
|
259
|
+
datasetId: 'datasetId',
|
|
260
|
+
projectId: 'projectId',
|
|
261
|
+
routineId: 'routineId',
|
|
262
|
+
});
|
|
206
263
|
|
|
207
264
|
/*
|
|
208
265
|
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
|
209
266
|
*/
|
|
210
|
-
await gapi.client.bigquery.rowAccessPolicies.getIamPolicy({
|
|
267
|
+
await gapi.client.bigquery.rowAccessPolicies.getIamPolicy({
|
|
268
|
+
resource: 'resource',
|
|
269
|
+
});
|
|
211
270
|
|
|
212
271
|
/*
|
|
213
272
|
Lists all row access policies on the specified table.
|
|
214
273
|
*/
|
|
215
|
-
await gapi.client.bigquery.rowAccessPolicies.list({
|
|
274
|
+
await gapi.client.bigquery.rowAccessPolicies.list({
|
|
275
|
+
datasetId: 'datasetId',
|
|
276
|
+
projectId: 'projectId',
|
|
277
|
+
tableId: 'tableId',
|
|
278
|
+
});
|
|
216
279
|
|
|
217
280
|
/*
|
|
218
281
|
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
|
219
282
|
*/
|
|
220
|
-
await gapi.client.bigquery.rowAccessPolicies.testIamPermissions({
|
|
283
|
+
await gapi.client.bigquery.rowAccessPolicies.testIamPermissions({
|
|
284
|
+
resource: 'resource',
|
|
285
|
+
});
|
|
221
286
|
|
|
222
287
|
/*
|
|
223
288
|
Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.
|
|
224
289
|
*/
|
|
225
|
-
await gapi.client.bigquery.tabledata.insertAll({
|
|
290
|
+
await gapi.client.bigquery.tabledata.insertAll({
|
|
291
|
+
datasetId: 'datasetId',
|
|
292
|
+
projectId: 'projectId',
|
|
293
|
+
tableId: 'tableId',
|
|
294
|
+
});
|
|
226
295
|
|
|
227
296
|
/*
|
|
228
297
|
Retrieves table data from a specified set of rows. Requires the READER dataset role.
|
|
229
298
|
*/
|
|
230
|
-
await gapi.client.bigquery.tabledata.list({
|
|
299
|
+
await gapi.client.bigquery.tabledata.list({
|
|
300
|
+
datasetId: 'datasetId',
|
|
301
|
+
projectId: 'projectId',
|
|
302
|
+
tableId: 'tableId',
|
|
303
|
+
});
|
|
231
304
|
|
|
232
305
|
/*
|
|
233
306
|
Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
|
|
234
307
|
*/
|
|
235
|
-
await gapi.client.bigquery.tables.delete({
|
|
308
|
+
await gapi.client.bigquery.tables.delete({
|
|
309
|
+
datasetId: 'datasetId',
|
|
310
|
+
projectId: 'projectId',
|
|
311
|
+
tableId: 'tableId',
|
|
312
|
+
});
|
|
236
313
|
|
|
237
314
|
/*
|
|
238
315
|
Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
|
|
239
316
|
*/
|
|
240
|
-
await gapi.client.bigquery.tables.get({
|
|
317
|
+
await gapi.client.bigquery.tables.get({
|
|
318
|
+
datasetId: 'datasetId',
|
|
319
|
+
projectId: 'projectId',
|
|
320
|
+
tableId: 'tableId',
|
|
321
|
+
});
|
|
241
322
|
|
|
242
323
|
/*
|
|
243
324
|
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
|
|
244
325
|
*/
|
|
245
|
-
await gapi.client.bigquery.tables.getIamPolicy({
|
|
326
|
+
await gapi.client.bigquery.tables.getIamPolicy({resource: 'resource'});
|
|
246
327
|
|
|
247
328
|
/*
|
|
248
329
|
Creates a new, empty table in the dataset.
|
|
249
330
|
*/
|
|
250
|
-
await gapi.client.bigquery.tables.insert({
|
|
331
|
+
await gapi.client.bigquery.tables.insert({
|
|
332
|
+
datasetId: 'datasetId',
|
|
333
|
+
projectId: 'projectId',
|
|
334
|
+
});
|
|
251
335
|
|
|
252
336
|
/*
|
|
253
337
|
Lists all tables in the specified dataset. Requires the READER dataset role.
|
|
254
338
|
*/
|
|
255
|
-
await gapi.client.bigquery.tables.list({
|
|
339
|
+
await gapi.client.bigquery.tables.list({
|
|
340
|
+
datasetId: 'datasetId',
|
|
341
|
+
projectId: 'projectId',
|
|
342
|
+
});
|
|
256
343
|
|
|
257
344
|
/*
|
|
258
345
|
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
|
|
259
346
|
*/
|
|
260
|
-
await gapi.client.bigquery.tables.patch({
|
|
347
|
+
await gapi.client.bigquery.tables.patch({
|
|
348
|
+
datasetId: 'datasetId',
|
|
349
|
+
projectId: 'projectId',
|
|
350
|
+
tableId: 'tableId',
|
|
351
|
+
});
|
|
261
352
|
|
|
262
353
|
/*
|
|
263
354
|
Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
|
|
264
355
|
*/
|
|
265
|
-
await gapi.client.bigquery.tables.setIamPolicy({
|
|
356
|
+
await gapi.client.bigquery.tables.setIamPolicy({resource: 'resource'});
|
|
266
357
|
|
|
267
358
|
/*
|
|
268
359
|
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
|
269
360
|
*/
|
|
270
|
-
await gapi.client.bigquery.tables.testIamPermissions({
|
|
361
|
+
await gapi.client.bigquery.tables.testIamPermissions({resource: 'resource'});
|
|
271
362
|
|
|
272
363
|
/*
|
|
273
364
|
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
|
|
274
365
|
*/
|
|
275
|
-
await gapi.client.bigquery.tables.update({
|
|
366
|
+
await gapi.client.bigquery.tables.update({
|
|
367
|
+
datasetId: 'datasetId',
|
|
368
|
+
projectId: 'projectId',
|
|
369
|
+
tableId: 'tableId',
|
|
370
|
+
});
|
|
276
371
|
```
|