@maxim_mazurok/gapi.client.chromewebstore-v1.1 0.0.20251005

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 (3) hide show
  1. package/index.d.ts +258 -0
  2. package/package.json +20 -0
  3. package/readme.md +96 -0
package/index.d.ts ADDED
@@ -0,0 +1,258 @@
1
+ /* Type definitions for non-npm package Chrome Web Store API v1.1 0.0 */
2
+ // Project: https://developer.chrome.com/webstore/api_index
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://chromewebstore.googleapis.com/$discovery/rest?version=v1.1
12
+ // Revision: 20251005
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Chrome Web Store API v1.1 */
18
+ function load(
19
+ urlOrObject: 'https://chromewebstore.googleapis.com/$discovery/rest?version=v1.1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'chromewebstore', version: 'v1.1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'chromewebstore',
26
+ version: 'v1.1',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace chromewebstore {
31
+ interface Item {
32
+ /** The CRX version of the item. If the projection is draft, then it is the draft's CRX version. */
33
+ crxVersion?: string;
34
+ /** Unique ID of the item. */
35
+ id?: string;
36
+ /** Detail human-readable status of the operation, in English only. Same error messages are displayed when you upload your app to the Chrome Web Store. */
37
+ itemError?: ItemError[];
38
+ /** Identifies this resource as an Item. Value: the fixed string "chromewebstore#item". */
39
+ kind?: string;
40
+ /** Public key of this item. */
41
+ publicKey?: string;
42
+ /** Status of the operation. Possible values are: - \"FAILURE\" - \"IN_PROGRESS\" - \"NOT_FOUND\" - \"SUCCESS\" */
43
+ uploadState?: string;
44
+ }
45
+ interface Item2 {
46
+ /** The ID of this item. */
47
+ item_id?: string;
48
+ /** Static string value is always "chromewebstore#item". */
49
+ kind?: string;
50
+ /** The status code of this publish operation. It may contain multiple elements from the following list: NOT_AUTHORIZED, INVALID_DEVELOPER, DEVELOPER_NO_OWNERSHIP, DEVELOPER_SUSPENDED, ITEM_NOT_FOUND, ITEM_PENDING_REVIEW, ITEM_TAKEN_DOWN, PUBLISHER_SUSPENDED. */
51
+ status?: string[];
52
+ /** Detailed human-comprehensible explanation of the status code above. */
53
+ statusDetail?: string[];
54
+ }
55
+ interface ItemError {
56
+ /** The error code. */
57
+ error_code?: string;
58
+ /** The human-readable detail message of the error. */
59
+ error_detail?: string;
60
+ }
61
+ interface PublishRequest {
62
+ /** The target deploy percentage of the item. It's only useful for items with big user base. */
63
+ deployPercentage?: number;
64
+ /** Optional. The caller request to exempt the review and directly publish because the update is within the list that we can automatically validate. The API will check if the exemption can be granted using real time data. */
65
+ reviewExemption?: boolean;
66
+ /** The publish target of this publish operation. This is the same as using publishTarget as a URL query parameter. The string value can either be target="trustedTesters" or target="default". The default value, if none is supplied, is target="default". Recommended usage is to use the URL query parameter to specificy the value. */
67
+ target?: string;
68
+ }
69
+ interface ItemsResource {
70
+ /** Gets your own Chrome Web Store item. */
71
+ get(request?: {
72
+ /** V1 error format. */
73
+ '$.xgafv'?: string;
74
+ /** OAuth access token. */
75
+ access_token?: string;
76
+ /** Data format for response. */
77
+ alt?: string;
78
+ /** JSONP */
79
+ callback?: string;
80
+ /** Selector specifying which fields to include in a partial response. */
81
+ fields?: string;
82
+ /** Unique identifier representing the Chrome App, Chrome Extension, or the Chrome Theme. */
83
+ itemId: string;
84
+ /** 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. */
85
+ key?: string;
86
+ /** OAuth 2.0 token for the current user. */
87
+ oauth_token?: string;
88
+ /** Returns response with indentations and line breaks. */
89
+ prettyPrint?: boolean;
90
+ /** Determines which subset of the item information to return. */
91
+ projection?: string;
92
+ /** 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. */
93
+ quotaUser?: string;
94
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
95
+ upload_protocol?: string;
96
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
97
+ uploadType?: string;
98
+ }): Request<Item>;
99
+ /** Inserts a new item. */
100
+ insert(request?: {
101
+ /** V1 error format. */
102
+ '$.xgafv'?: string;
103
+ /** OAuth access token. */
104
+ access_token?: string;
105
+ /** Data format for response. */
106
+ alt?: string;
107
+ /** JSONP */
108
+ callback?: string;
109
+ /** Selector specifying which fields to include in a partial response. */
110
+ fields?: string;
111
+ /** 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. */
112
+ key?: string;
113
+ /** OAuth 2.0 token for the current user. */
114
+ oauth_token?: string;
115
+ /** Returns response with indentations and line breaks. */
116
+ prettyPrint?: boolean;
117
+ /** The email of the publisher who owns the items. Defaults to the caller's email address. */
118
+ publisherEmail?: string;
119
+ /** 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. */
120
+ quotaUser?: string;
121
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
122
+ upload_protocol?: string;
123
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
124
+ uploadType?: string;
125
+ }): Request<Item>;
126
+ /** Publishes an item. */
127
+ publish(request: {
128
+ /** V1 error format. */
129
+ '$.xgafv'?: string;
130
+ /** OAuth access token. */
131
+ access_token?: string;
132
+ /** Data format for response. */
133
+ alt?: string;
134
+ /** JSONP */
135
+ callback?: string;
136
+ /** The deploy percentage you want to set for your item. Valid values are [0, 100]. If set to any number less than 100, only that many percentage of users will be allowed to get the update. */
137
+ deployPercentage?: number;
138
+ /** Selector specifying which fields to include in a partial response. */
139
+ fields?: string;
140
+ /** The ID of the item to publish. */
141
+ itemId: string;
142
+ /** 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. */
143
+ key?: string;
144
+ /** OAuth 2.0 token for the current user. */
145
+ oauth_token?: string;
146
+ /** Returns response with indentations and line breaks. */
147
+ prettyPrint?: boolean;
148
+ /** Provide defined publishTarget in URL (case sensitive): publishTarget="trustedTesters" or publishTarget="default". Defaults to publishTarget="default". */
149
+ publishTarget?: string;
150
+ /** 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. */
151
+ quotaUser?: string;
152
+ /** Optional. The caller request to exempt the review and directly publish because the update is within the list that we can automatically validate. The API will check if the exemption can be granted using real time data. */
153
+ reviewExemption?: boolean;
154
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
155
+ upload_protocol?: string;
156
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
157
+ uploadType?: string;
158
+ /** Request body */
159
+ resource: PublishRequest;
160
+ }): Request<Item2>;
161
+ publish(
162
+ request: {
163
+ /** V1 error format. */
164
+ '$.xgafv'?: string;
165
+ /** OAuth access token. */
166
+ access_token?: string;
167
+ /** Data format for response. */
168
+ alt?: string;
169
+ /** JSONP */
170
+ callback?: string;
171
+ /** The deploy percentage you want to set for your item. Valid values are [0, 100]. If set to any number less than 100, only that many percentage of users will be allowed to get the update. */
172
+ deployPercentage?: number;
173
+ /** Selector specifying which fields to include in a partial response. */
174
+ fields?: string;
175
+ /** The ID of the item to publish. */
176
+ itemId: string;
177
+ /** 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. */
178
+ key?: string;
179
+ /** OAuth 2.0 token for the current user. */
180
+ oauth_token?: string;
181
+ /** Returns response with indentations and line breaks. */
182
+ prettyPrint?: boolean;
183
+ /** Provide defined publishTarget in URL (case sensitive): publishTarget="trustedTesters" or publishTarget="default". Defaults to publishTarget="default". */
184
+ publishTarget?: string;
185
+ /** 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. */
186
+ quotaUser?: string;
187
+ /** Optional. The caller request to exempt the review and directly publish because the update is within the list that we can automatically validate. The API will check if the exemption can be granted using real time data. */
188
+ reviewExemption?: boolean;
189
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
190
+ upload_protocol?: string;
191
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
192
+ uploadType?: string;
193
+ },
194
+ body: PublishRequest,
195
+ ): Request<Item2>;
196
+ /** Updates an existing item. */
197
+ update(request: {
198
+ /** V1 error format. */
199
+ '$.xgafv'?: string;
200
+ /** OAuth access token. */
201
+ access_token?: string;
202
+ /** Data format for response. */
203
+ alt?: string;
204
+ /** JSONP */
205
+ callback?: string;
206
+ /** Selector specifying which fields to include in a partial response. */
207
+ fields?: string;
208
+ /** The ID of the item to upload. */
209
+ itemId: string;
210
+ /** 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. */
211
+ key?: string;
212
+ /** OAuth 2.0 token for the current user. */
213
+ oauth_token?: string;
214
+ /** Returns response with indentations and line breaks. */
215
+ prettyPrint?: boolean;
216
+ /** 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. */
217
+ quotaUser?: string;
218
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
219
+ upload_protocol?: string;
220
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
221
+ uploadType?: string;
222
+ /** Request body */
223
+ resource: Item;
224
+ }): Request<Item>;
225
+ update(
226
+ request: {
227
+ /** V1 error format. */
228
+ '$.xgafv'?: string;
229
+ /** OAuth access token. */
230
+ access_token?: string;
231
+ /** Data format for response. */
232
+ alt?: string;
233
+ /** JSONP */
234
+ callback?: string;
235
+ /** Selector specifying which fields to include in a partial response. */
236
+ fields?: string;
237
+ /** The ID of the item to upload. */
238
+ itemId: string;
239
+ /** 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. */
240
+ key?: string;
241
+ /** OAuth 2.0 token for the current user. */
242
+ oauth_token?: string;
243
+ /** Returns response with indentations and line breaks. */
244
+ prettyPrint?: boolean;
245
+ /** 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. */
246
+ quotaUser?: string;
247
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
248
+ upload_protocol?: string;
249
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
250
+ uploadType?: string;
251
+ },
252
+ body: Item,
253
+ ): Request<Item>;
254
+ }
255
+
256
+ const items: ItemsResource;
257
+ }
258
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.chromewebstore-v1.1",
3
+ "version": "0.0.20251005",
4
+ "description": "TypeScript typings for Chrome Web Store API v1.1",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
13
+ "url": "https://maxim.mazurok.com"
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,96 @@
1
+ # TypeScript typings for Chrome Web Store API v1.1
2
+
3
+ The Chrome Web Store API provides access to data about apps and extensions, as well as developer tools for managing them.
4
+ For detailed description please check [documentation](https://developer.chrome.com/webstore/api_index).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Chrome Web Store API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.chromewebstore-v1.1 --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(
29
+ 'https://chromewebstore.googleapis.com/$discovery/rest?version=v1.1',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.chromewebstore
33
+ },
34
+ );
35
+ ```
36
+
37
+ ```typescript
38
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
39
+ gapi.client.load('chromewebstore', 'v1.1', () => {
40
+ // now we can use:
41
+ // gapi.client.chromewebstore
42
+ });
43
+ ```
44
+
45
+ Don't forget to authenticate your client before sending any request to resources:
46
+
47
+ ```typescript
48
+ // declare client_id registered in Google Developers Console
49
+ var client_id = '',
50
+ scope = [
51
+ // See, edit, update, or publish your Chrome Web Store extensions, themes, apps, and licences you have access to
52
+ 'https://www.googleapis.com/auth/chromewebstore',
53
+
54
+ // See and download your Chrome Web Store extensions and apps, and see licenses you have access to
55
+ 'https://www.googleapis.com/auth/chromewebstore.readonly',
56
+ ],
57
+ immediate = true;
58
+ // ...
59
+
60
+ gapi.auth.authorize(
61
+ {client_id: client_id, scope: scope, immediate: immediate},
62
+ authResult => {
63
+ if (authResult && !authResult.error) {
64
+ /* handle successful authorization */
65
+ } else {
66
+ /* handle authorization error */
67
+ }
68
+ },
69
+ );
70
+ ```
71
+
72
+ After that you can use Chrome Web Store API resources: <!-- TODO: make this work for multiple namespaces -->
73
+
74
+ ```typescript
75
+ /*
76
+ Gets your own Chrome Web Store item.
77
+ */
78
+ await gapi.client.chromewebstore.items.get({itemId: 'itemId'});
79
+
80
+ /*
81
+ Inserts a new item.
82
+ */
83
+ await gapi.client.chromewebstore.items.insert({});
84
+
85
+ /*
86
+ Publishes an item.
87
+ */
88
+ await gapi.client.chromewebstore.items.publish({itemId: 'itemId'});
89
+
90
+ /*
91
+ Updates an existing item.
92
+ */
93
+ await gapi.client.chromewebstore.items.update({itemId: 'itemId'});
94
+ ```
95
+
96
+ For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.chromewebstore-v1.1#Provenance:~:text=none-,Provenance,-Built%20and%20signed)