@maxim_mazurok/gapi.client.area120tables-v1alpha1 0.0.20231127 → 0.0.20231203
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 +672 -967
- package/package.json +6 -6
- package/readme.md +30 -28
- package/tests.ts +0 -151
- 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.area120tables-v1alpha1",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.20231203",
|
4
4
|
"description": "TypeScript typings for Area120 Tables API v1alpha1",
|
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
@@ -1,6 +1,5 @@
|
|
1
1
|
# TypeScript typings for Area120 Tables API v1alpha1
|
2
2
|
|
3
|
-
|
4
3
|
For detailed description please check [documentation](https://support.google.com/area120-tables/answer/10011390).
|
5
4
|
|
6
5
|
## Installing
|
@@ -25,10 +24,13 @@ gapi.load('client', () => {
|
|
25
24
|
Then load api client wrapper:
|
26
25
|
|
27
26
|
```typescript
|
28
|
-
gapi.client.load(
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
gapi.client.load(
|
28
|
+
'https://area120tables.googleapis.com/$discovery/rest?version=v1alpha1',
|
29
|
+
() => {
|
30
|
+
// now we can use:
|
31
|
+
// gapi.client.area120tables
|
32
|
+
}
|
33
|
+
);
|
32
34
|
```
|
33
35
|
|
34
36
|
```typescript
|
@@ -45,59 +47,59 @@ Don't forget to authenticate your client before sending any request to resources
|
|
45
47
|
// declare client_id registered in Google Developers Console
|
46
48
|
var client_id = '',
|
47
49
|
scope = [
|
48
|
-
|
49
|
-
|
50
|
+
// See, edit, create, and delete all of your Google Drive files
|
51
|
+
'https://www.googleapis.com/auth/drive',
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
+
// See, edit, create, and delete only the specific Google Drive files you use with this app
|
54
|
+
'https://www.googleapis.com/auth/drive.file',
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
+
// See and download all your Google Drive files
|
57
|
+
'https://www.googleapis.com/auth/drive.readonly',
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
+
// See, edit, create, and delete all your Google Sheets spreadsheets
|
60
|
+
'https://www.googleapis.com/auth/spreadsheets',
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
+
// See all your Google Sheets spreadsheets
|
63
|
+
'https://www.googleapis.com/auth/spreadsheets.readonly',
|
62
64
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
// See, edit, create, and delete your tables in Tables by Area 120
|
66
|
+
'https://www.googleapis.com/auth/tables',
|
67
|
+
],
|
68
|
+
immediate = true;
|
67
69
|
// ...
|
68
70
|
|
69
71
|
gapi.auth.authorize(
|
70
|
-
{
|
72
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
71
73
|
authResult => {
|
72
74
|
if (authResult && !authResult.error) {
|
73
|
-
|
75
|
+
/* handle successful authorization */
|
74
76
|
} else {
|
75
|
-
|
77
|
+
/* handle authorization error */
|
76
78
|
}
|
77
|
-
}
|
79
|
+
}
|
80
|
+
);
|
78
81
|
```
|
79
82
|
|
80
83
|
After that you can use Area120 Tables API resources: <!-- TODO: make this work for multiple namespaces -->
|
81
84
|
|
82
85
|
```typescript
|
83
|
-
|
84
86
|
/*
|
85
87
|
Gets a table. Returns NOT_FOUND if the table does not exist.
|
86
88
|
*/
|
87
|
-
await gapi.client.area120tables.tables.get({
|
89
|
+
await gapi.client.area120tables.tables.get({name: 'name'});
|
88
90
|
|
89
91
|
/*
|
90
92
|
Lists tables for the user.
|
91
93
|
*/
|
92
|
-
await gapi.client.area120tables.tables.list({
|
94
|
+
await gapi.client.area120tables.tables.list({});
|
93
95
|
|
94
96
|
/*
|
95
97
|
Gets a workspace. Returns NOT_FOUND if the workspace does not exist.
|
96
98
|
*/
|
97
|
-
await gapi.client.area120tables.workspaces.get({
|
99
|
+
await gapi.client.area120tables.workspaces.get({name: 'name'});
|
98
100
|
|
99
101
|
/*
|
100
102
|
Lists workspaces for the user.
|
101
103
|
*/
|
102
|
-
await gapi.client.area120tables.workspaces.list({
|
104
|
+
await gapi.client.area120tables.workspaces.list({});
|
103
105
|
```
|
package/tests.ts
DELETED
@@ -1,151 +0,0 @@
|
|
1
|
-
/* This is stub file for gapi.client.area120tables-v1alpha1 definition tests */
|
2
|
-
// IMPORTANT
|
3
|
-
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
4
|
-
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
5
|
-
|
6
|
-
// Revision: 20231127
|
7
|
-
|
8
|
-
gapi.load('client', async () => {
|
9
|
-
/** now we can use gapi.client */
|
10
|
-
|
11
|
-
await gapi.client.load('https://area120tables.googleapis.com/$discovery/rest?version=v1alpha1');
|
12
|
-
/** now we can use gapi.client.area120tables */
|
13
|
-
|
14
|
-
/** don't forget to authenticate your client before sending any request to resources: */
|
15
|
-
/** declare client_id registered in Google Developers Console */
|
16
|
-
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
17
|
-
const scope = [
|
18
|
-
/** See, edit, create, and delete all of your Google Drive files */
|
19
|
-
'https://www.googleapis.com/auth/drive',
|
20
|
-
/** See, edit, create, and delete only the specific Google Drive files you use with this app */
|
21
|
-
'https://www.googleapis.com/auth/drive.file',
|
22
|
-
/** See and download all your Google Drive files */
|
23
|
-
'https://www.googleapis.com/auth/drive.readonly',
|
24
|
-
/** See, edit, create, and delete all your Google Sheets spreadsheets */
|
25
|
-
'https://www.googleapis.com/auth/spreadsheets',
|
26
|
-
/** See all your Google Sheets spreadsheets */
|
27
|
-
'https://www.googleapis.com/auth/spreadsheets.readonly',
|
28
|
-
/** See, edit, create, and delete your tables in Tables by Area 120 */
|
29
|
-
'https://www.googleapis.com/auth/tables',
|
30
|
-
];
|
31
|
-
const immediate = false;
|
32
|
-
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
33
|
-
if (authResult && !authResult.error) {
|
34
|
-
/** handle successful authorization */
|
35
|
-
run();
|
36
|
-
} else {
|
37
|
-
/** handle authorization error */
|
38
|
-
}
|
39
|
-
});
|
40
|
-
|
41
|
-
async function run() {
|
42
|
-
/** Gets a table. Returns NOT_FOUND if the table does not exist. */
|
43
|
-
await gapi.client.area120tables.tables.get({
|
44
|
-
name: "Test string",
|
45
|
-
});
|
46
|
-
/** Lists tables for the user. */
|
47
|
-
await gapi.client.area120tables.tables.list({
|
48
|
-
orderBy: "Test string",
|
49
|
-
pageSize: 42,
|
50
|
-
pageToken: "Test string",
|
51
|
-
});
|
52
|
-
/** Creates multiple rows. */
|
53
|
-
await gapi.client.area120tables.tables.rows.batchCreate({
|
54
|
-
parent: "Test string",
|
55
|
-
}, {
|
56
|
-
requests: [
|
57
|
-
{
|
58
|
-
parent: "Test string",
|
59
|
-
row: {
|
60
|
-
createTime: "Test string",
|
61
|
-
name: "Test string",
|
62
|
-
updateTime: "Test string",
|
63
|
-
values: {
|
64
|
-
A: 42
|
65
|
-
},
|
66
|
-
},
|
67
|
-
view: "Test string",
|
68
|
-
}
|
69
|
-
],
|
70
|
-
});
|
71
|
-
/** Deletes multiple rows. */
|
72
|
-
await gapi.client.area120tables.tables.rows.batchDelete({
|
73
|
-
parent: "Test string",
|
74
|
-
}, {
|
75
|
-
names: [
|
76
|
-
"Test string"
|
77
|
-
],
|
78
|
-
});
|
79
|
-
/** Updates multiple rows. */
|
80
|
-
await gapi.client.area120tables.tables.rows.batchUpdate({
|
81
|
-
parent: "Test string",
|
82
|
-
}, {
|
83
|
-
requests: [
|
84
|
-
{
|
85
|
-
row: {
|
86
|
-
createTime: "Test string",
|
87
|
-
name: "Test string",
|
88
|
-
updateTime: "Test string",
|
89
|
-
values: {
|
90
|
-
A: 42
|
91
|
-
},
|
92
|
-
},
|
93
|
-
updateMask: "Test string",
|
94
|
-
view: "Test string",
|
95
|
-
}
|
96
|
-
],
|
97
|
-
});
|
98
|
-
/** Creates a row. */
|
99
|
-
await gapi.client.area120tables.tables.rows.create({
|
100
|
-
parent: "Test string",
|
101
|
-
view: "Test string",
|
102
|
-
}, {
|
103
|
-
createTime: "Test string",
|
104
|
-
name: "Test string",
|
105
|
-
updateTime: "Test string",
|
106
|
-
values: {
|
107
|
-
A: 42
|
108
|
-
},
|
109
|
-
});
|
110
|
-
/** Deletes a row. */
|
111
|
-
await gapi.client.area120tables.tables.rows.delete({
|
112
|
-
name: "Test string",
|
113
|
-
});
|
114
|
-
/** Gets a row. Returns NOT_FOUND if the row does not exist in the table. */
|
115
|
-
await gapi.client.area120tables.tables.rows.get({
|
116
|
-
name: "Test string",
|
117
|
-
view: "Test string",
|
118
|
-
});
|
119
|
-
/** Lists rows in a table. Returns NOT_FOUND if the table does not exist. */
|
120
|
-
await gapi.client.area120tables.tables.rows.list({
|
121
|
-
filter: "Test string",
|
122
|
-
orderBy: "Test string",
|
123
|
-
pageSize: 42,
|
124
|
-
pageToken: "Test string",
|
125
|
-
parent: "Test string",
|
126
|
-
view: "Test string",
|
127
|
-
});
|
128
|
-
/** Updates a row. */
|
129
|
-
await gapi.client.area120tables.tables.rows.patch({
|
130
|
-
name: "Test string",
|
131
|
-
updateMask: "Test string",
|
132
|
-
view: "Test string",
|
133
|
-
}, {
|
134
|
-
createTime: "Test string",
|
135
|
-
name: "Test string",
|
136
|
-
updateTime: "Test string",
|
137
|
-
values: {
|
138
|
-
A: 42
|
139
|
-
},
|
140
|
-
});
|
141
|
-
/** Gets a workspace. Returns NOT_FOUND if the workspace does not exist. */
|
142
|
-
await gapi.client.area120tables.workspaces.get({
|
143
|
-
name: "Test string",
|
144
|
-
});
|
145
|
-
/** Lists workspaces for the user. */
|
146
|
-
await gapi.client.area120tables.workspaces.list({
|
147
|
-
pageSize: 42,
|
148
|
-
pageToken: "Test string",
|
149
|
-
});
|
150
|
-
}
|
151
|
-
});
|
package/tsconfig.json
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"module": "commonjs",
|
4
|
-
"lib": ["es6", "dom"],
|
5
|
-
"noImplicitAny": true,
|
6
|
-
"noImplicitThis": true,
|
7
|
-
"strictNullChecks": true,
|
8
|
-
"baseUrl": "../",
|
9
|
-
"typeRoots": [
|
10
|
-
"../"
|
11
|
-
],
|
12
|
-
"types": [],
|
13
|
-
"noEmit": true,
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
15
|
-
"strictFunctionTypes": true
|
16
|
-
},
|
17
|
-
"files": ["index.d.ts", "tests.ts"]
|
18
|
-
}
|