@maxim_mazurok/gapi.client.playgrouping-v1alpha1 0.0.20230824

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 ADDED
@@ -0,0 +1,250 @@
1
+ /* Type definitions for non-npm package Google Play Grouping API v1alpha1 0.0 */
2
+ // Project: https://cloud.google.com/playgrouping/
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+
8
+ // IMPORTANT
9
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
+ // Generated from: https://playgrouping.googleapis.com/$discovery/rest?version=v1alpha1
12
+ // Revision: 20230824
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Google Play Grouping API v1alpha1 */
18
+ function load(urlOrObject: "https://playgrouping.googleapis.com/$discovery/rest?version=v1alpha1"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "playgrouping", version: "v1alpha1"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "playgrouping", version: "v1alpha1", callback: () => any): void;
23
+
24
+ namespace playgrouping {
25
+ interface CreateOrUpdateTagsRequest {
26
+ /** Tags to be inserted or updated. */
27
+ tags?:
28
+ Tag[];
29
+ }
30
+ interface CreateOrUpdateTagsResponse {
31
+ /** All requested tags are returned, including pre-existing ones. */
32
+ tags?:
33
+ Tag[];
34
+ }
35
+ interface Tag {
36
+ /** A boolean value of the tag. */
37
+ booleanValue?:
38
+ boolean;
39
+ /** A signed 64-bit integer value of the tag. */
40
+ int64Value?:
41
+ string;
42
+ /** Required. Key for the tag. */
43
+ key?:
44
+ string;
45
+ /** A string value of the tag. */
46
+ stringValue?:
47
+ string;
48
+ /** A time value of the tag. */
49
+ timeValue?:
50
+ string;
51
+ }
52
+ interface VerifyTokenRequest {
53
+ /** Required. Persona represented by the token. Format: personas/{persona} */
54
+ persona?:
55
+ string;
56
+ }
57
+ // tslint:disable-next-line:no-empty-interface
58
+ interface VerifyTokenResponse {
59
+ }
60
+ interface TagsResource {
61
+ /** Create or update tags for the user and app that are represented by the given token. */
62
+ createOrUpdate(request: {
63
+ /** V1 error format. */
64
+ "$.xgafv"?:
65
+ string;
66
+ /** OAuth access token. */
67
+ access_token?:
68
+ string;
69
+ /** Data format for response. */
70
+ alt?:
71
+ string;
72
+ /** Required. App whose tags are being manipulated. Format: apps/{package_name} */
73
+ appPackage:
74
+ string;
75
+ /** JSONP */
76
+ callback?:
77
+ string;
78
+ /** Selector specifying which fields to include in a partial response. */
79
+ fields?:
80
+ string;
81
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
82
+ key?:
83
+ string;
84
+ /** OAuth 2.0 token for the current user. */
85
+ oauth_token?:
86
+ string;
87
+ /** Returns response with indentations and line breaks. */
88
+ prettyPrint?:
89
+ boolean;
90
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
91
+ quotaUser?:
92
+ string;
93
+ /** Required. Token for which the tags are being inserted or updated. Format: tokens/{token} */
94
+ token:
95
+ string;
96
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
97
+ upload_protocol?:
98
+ string;
99
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
100
+ uploadType?:
101
+ string;
102
+ /** Request body */
103
+ resource:
104
+ CreateOrUpdateTagsRequest;
105
+ }): Request<CreateOrUpdateTagsResponse>;
106
+ createOrUpdate(request: {
107
+ /** V1 error format. */
108
+ "$.xgafv"?:
109
+ string;
110
+ /** OAuth access token. */
111
+ access_token?:
112
+ string;
113
+ /** Data format for response. */
114
+ alt?:
115
+ string;
116
+ /** Required. App whose tags are being manipulated. Format: apps/{package_name} */
117
+ appPackage:
118
+ string;
119
+ /** JSONP */
120
+ callback?:
121
+ string;
122
+ /** Selector specifying which fields to include in a partial response. */
123
+ fields?:
124
+ string;
125
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
126
+ key?:
127
+ string;
128
+ /** OAuth 2.0 token for the current user. */
129
+ oauth_token?:
130
+ string;
131
+ /** Returns response with indentations and line breaks. */
132
+ prettyPrint?:
133
+ boolean;
134
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
135
+ quotaUser?:
136
+ string;
137
+ /** Required. Token for which the tags are being inserted or updated. Format: tokens/{token} */
138
+ token:
139
+ string;
140
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
141
+ upload_protocol?:
142
+ string;
143
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
144
+ uploadType?:
145
+ string;
146
+ },
147
+ body: CreateOrUpdateTagsRequest): Request<CreateOrUpdateTagsResponse>;
148
+ }
149
+ interface TokensResource {
150
+ /**
151
+ * Verify an API token by asserting the app and persona it belongs to. The verification is a protection against client-side attacks and will fail if the contents of the token don't
152
+ * match the provided values. A token must be verified before it can be used to manipulate user tags.
153
+ */
154
+ verify(request: {
155
+ /** V1 error format. */
156
+ "$.xgafv"?:
157
+ string;
158
+ /** OAuth access token. */
159
+ access_token?:
160
+ string;
161
+ /** Data format for response. */
162
+ alt?:
163
+ string;
164
+ /** Required. App the token belongs to. Format: apps/{package_name} */
165
+ appPackage:
166
+ string;
167
+ /** JSONP */
168
+ callback?:
169
+ string;
170
+ /** Selector specifying which fields to include in a partial response. */
171
+ fields?:
172
+ string;
173
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
174
+ key?:
175
+ string;
176
+ /** OAuth 2.0 token for the current user. */
177
+ oauth_token?:
178
+ string;
179
+ /** Returns response with indentations and line breaks. */
180
+ prettyPrint?:
181
+ boolean;
182
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
183
+ quotaUser?:
184
+ string;
185
+ /** Required. The token to be verified. Format: tokens/{token} */
186
+ token:
187
+ string;
188
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
189
+ upload_protocol?:
190
+ string;
191
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
192
+ uploadType?:
193
+ string;
194
+ /** Request body */
195
+ resource:
196
+ VerifyTokenRequest;
197
+ }): Request<{}>;
198
+ verify(request: {
199
+ /** V1 error format. */
200
+ "$.xgafv"?:
201
+ string;
202
+ /** OAuth access token. */
203
+ access_token?:
204
+ string;
205
+ /** Data format for response. */
206
+ alt?:
207
+ string;
208
+ /** Required. App the token belongs to. Format: apps/{package_name} */
209
+ appPackage:
210
+ string;
211
+ /** JSONP */
212
+ callback?:
213
+ string;
214
+ /** Selector specifying which fields to include in a partial response. */
215
+ fields?:
216
+ string;
217
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
218
+ key?:
219
+ string;
220
+ /** OAuth 2.0 token for the current user. */
221
+ oauth_token?:
222
+ string;
223
+ /** Returns response with indentations and line breaks. */
224
+ prettyPrint?:
225
+ boolean;
226
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
227
+ quotaUser?:
228
+ string;
229
+ /** Required. The token to be verified. Format: tokens/{token} */
230
+ token:
231
+ string;
232
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
233
+ upload_protocol?:
234
+ string;
235
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
236
+ uploadType?:
237
+ string;
238
+ },
239
+ body: VerifyTokenRequest): Request<{}>;
240
+ tags:
241
+ TagsResource;
242
+ }
243
+ interface AppsResource {
244
+ tokens:
245
+ TokensResource;
246
+ }
247
+
248
+ const apps: AppsResource;
249
+ }
250
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.playgrouping-v1alpha1",
3
+ "version": "0.0.20230824",
4
+ "description": "TypeScript typings for Google Play Grouping API v1alpha1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery-v1": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,47 @@
1
+ # TypeScript typings for Google Play Grouping API v1alpha1
2
+
3
+ playgrouping.googleapis.com API.
4
+ For detailed description please check [documentation](https://cloud.google.com/playgrouping/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Google Play Grouping API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.playgrouping-v1alpha1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://playgrouping.googleapis.com/$discovery/rest?version=v1alpha1', () => {
29
+ // now we can use:
30
+ // gapi.client.playgrouping
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('playgrouping', 'v1alpha1', () => {
37
+ // now we can use:
38
+ // gapi.client.playgrouping
39
+ });
40
+ ```
41
+
42
+
43
+
44
+ After that you can use Google Play Grouping API resources: <!-- TODO: make this work for multiple namespaces -->
45
+
46
+ ```typescript
47
+ ```
package/tests.ts ADDED
@@ -0,0 +1,43 @@
1
+ /* This is stub file for gapi.client.playgrouping-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: 20230824
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://playgrouping.googleapis.com/$discovery/rest?version=v1alpha1');
12
+ /** now we can use gapi.client.playgrouping */
13
+
14
+ run();
15
+
16
+ async function run() {
17
+ /**
18
+ * Verify an API token by asserting the app and persona it belongs to. The verification is a protection against client-side attacks and will fail if the contents of the token don't match
19
+ * the provided values. A token must be verified before it can be used to manipulate user tags.
20
+ */
21
+ await gapi.client.playgrouping.apps.tokens.verify({
22
+ appPackage: "Test string",
23
+ token: "Test string",
24
+ }, {
25
+ persona: "Test string",
26
+ });
27
+ /** Create or update tags for the user and app that are represented by the given token. */
28
+ await gapi.client.playgrouping.apps.tokens.tags.createOrUpdate({
29
+ appPackage: "Test string",
30
+ token: "Test string",
31
+ }, {
32
+ tags: [
33
+ {
34
+ booleanValue: true,
35
+ int64Value: "Test string",
36
+ key: "Test string",
37
+ stringValue: "Test string",
38
+ timeValue: "Test string",
39
+ }
40
+ ],
41
+ });
42
+ }
43
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
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
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }