@maxim_mazurok/gapi.client.chromewebstore-v2 0.0.20251022
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 +557 -0
- package/package.json +20 -0
- package/readme.md +81 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Chrome Web Store API v2 0.0 */
|
|
2
|
+
// Project: https://developer.chrome.com/docs/webstore/api
|
|
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=v2
|
|
12
|
+
// Revision: 20251022
|
|
13
|
+
|
|
14
|
+
/// <reference types="gapi.client" />
|
|
15
|
+
|
|
16
|
+
declare namespace gapi.client {
|
|
17
|
+
/** Load Chrome Web Store API v2 */
|
|
18
|
+
function load(
|
|
19
|
+
urlOrObject: 'https://chromewebstore.googleapis.com/$discovery/rest?version=v2',
|
|
20
|
+
): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: 'chromewebstore', version: 'v2'): Promise<void>;
|
|
23
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
24
|
+
function load(
|
|
25
|
+
name: 'chromewebstore',
|
|
26
|
+
version: 'v2',
|
|
27
|
+
callback: () => any,
|
|
28
|
+
): void;
|
|
29
|
+
|
|
30
|
+
namespace chromewebstore {
|
|
31
|
+
interface Blobstore2Info {
|
|
32
|
+
/** The blob generation id. */
|
|
33
|
+
blobGeneration?: string;
|
|
34
|
+
/** The blob id, e.g., /blobstore/prod/playground/scotty */
|
|
35
|
+
blobId?: string;
|
|
36
|
+
/** Read handle passed from Bigstore -> Scotty for a GCS download. This is a signed, serialized blobstore2.ReadHandle proto which must never be set outside of Bigstore, and is not applicable to non-GCS media downloads. */
|
|
37
|
+
downloadReadHandle?: string;
|
|
38
|
+
/** The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call. */
|
|
39
|
+
readToken?: string;
|
|
40
|
+
/** Metadata passed from Blobstore -> Scotty for a new GCS upload. This is a signed, serialized blobstore2.BlobMetadataContainer proto which must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads. */
|
|
41
|
+
uploadMetadataContainer?: string;
|
|
42
|
+
}
|
|
43
|
+
interface CancelSubmissionRequest {}
|
|
44
|
+
interface CancelSubmissionResponse {}
|
|
45
|
+
interface CompositeMedia {
|
|
46
|
+
/** Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef. */
|
|
47
|
+
blobRef?: string;
|
|
48
|
+
/** Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob. */
|
|
49
|
+
blobstore2Info?: Blobstore2Info;
|
|
50
|
+
/** A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field. */
|
|
51
|
+
cosmoBinaryReference?: string;
|
|
52
|
+
/** crc32.c hash for the payload. */
|
|
53
|
+
crc32cHash?: number;
|
|
54
|
+
/** Media data, set if reference_type is INLINE */
|
|
55
|
+
inline?: string;
|
|
56
|
+
/** Size of the data, in bytes */
|
|
57
|
+
length?: string;
|
|
58
|
+
/** MD5 hash for the payload. */
|
|
59
|
+
md5Hash?: string;
|
|
60
|
+
/** Reference to a TI Blob, set if reference_type is BIGSTORE_REF. */
|
|
61
|
+
objectId?: ObjectId;
|
|
62
|
+
/** Path to the data, set if reference_type is PATH */
|
|
63
|
+
path?: string;
|
|
64
|
+
/** Describes what the field reference contains. */
|
|
65
|
+
referenceType?: string;
|
|
66
|
+
/** SHA-1 hash for the payload. */
|
|
67
|
+
sha1Hash?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ContentTypeInfo {
|
|
70
|
+
/** Scotty's best guess of what the content type of the file is. */
|
|
71
|
+
bestGuess?: string;
|
|
72
|
+
/** The content type of the file derived by looking at specific bytes (i.e. "magic bytes") of the actual file. */
|
|
73
|
+
fromBytes?: string;
|
|
74
|
+
/** The content type of the file derived from the file extension of the original file name used by the client. */
|
|
75
|
+
fromFileName?: string;
|
|
76
|
+
/** The content type of the file as specified in the request headers, multipart headers, or RUPIO start request. */
|
|
77
|
+
fromHeader?: string;
|
|
78
|
+
/** The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API). */
|
|
79
|
+
fromUrlPath?: string;
|
|
80
|
+
}
|
|
81
|
+
interface DeployInfo {
|
|
82
|
+
/** Required. The current deploy percentage for the release channel (nonnegative number between 0 and 100). */
|
|
83
|
+
deployPercentage?: number;
|
|
84
|
+
}
|
|
85
|
+
interface DiffChecksumsResponse {
|
|
86
|
+
/** Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol. */
|
|
87
|
+
checksumsLocation?: CompositeMedia;
|
|
88
|
+
/** The chunk size of checksums. Must be a multiple of 256KB. */
|
|
89
|
+
chunkSizeBytes?: string;
|
|
90
|
+
/** If set, calculate the checksums based on the contents and return them to the caller. */
|
|
91
|
+
objectLocation?: CompositeMedia;
|
|
92
|
+
/** The total size of the server object. */
|
|
93
|
+
objectSizeBytes?: string;
|
|
94
|
+
/** The object version of the object the checksums are being returned for. */
|
|
95
|
+
objectVersion?: string;
|
|
96
|
+
}
|
|
97
|
+
interface DiffDownloadResponse {
|
|
98
|
+
/** The original object location. */
|
|
99
|
+
objectLocation?: CompositeMedia;
|
|
100
|
+
}
|
|
101
|
+
interface DiffUploadRequest {
|
|
102
|
+
/** The location of the checksums for the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. For details on the format of the checksums, see http://go/scotty-diff-protocol. */
|
|
103
|
+
checksumsInfo?: CompositeMedia;
|
|
104
|
+
/** The location of the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. */
|
|
105
|
+
objectInfo?: CompositeMedia;
|
|
106
|
+
/** The object version of the object that is the base version the incoming diff script will be applied to. This field will always be filled in. */
|
|
107
|
+
objectVersion?: string;
|
|
108
|
+
}
|
|
109
|
+
interface DiffUploadResponse {
|
|
110
|
+
/** The object version of the object at the server. Must be included in the end notification response. The version in the end notification response must correspond to the new version of the object that is now stored at the server, after the upload. */
|
|
111
|
+
objectVersion?: string;
|
|
112
|
+
/** The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification. */
|
|
113
|
+
originalObject?: CompositeMedia;
|
|
114
|
+
}
|
|
115
|
+
interface DiffVersionResponse {
|
|
116
|
+
/** The total size of the server object. */
|
|
117
|
+
objectSizeBytes?: string;
|
|
118
|
+
/** The version of the object stored at the server. */
|
|
119
|
+
objectVersion?: string;
|
|
120
|
+
}
|
|
121
|
+
interface DistributionChannel {
|
|
122
|
+
/** The extension version provided in the manifest of the uploaded package. */
|
|
123
|
+
crxVersion?: string;
|
|
124
|
+
/** The current deploy percentage for the release channel (nonnegative number between 0 and 100). */
|
|
125
|
+
deployPercentage?: number;
|
|
126
|
+
}
|
|
127
|
+
interface DownloadParameters {
|
|
128
|
+
/** A boolean to be returned in the response to Scotty. Allows/disallows gzip encoding of the payload content when the server thinks it's advantageous (hence, does not guarantee compression) which allows Scotty to GZip the response to the client. */
|
|
129
|
+
allowGzipCompression?: boolean;
|
|
130
|
+
/** Determining whether or not Apiary should skip the inclusion of any Content-Range header on its response to Scotty. */
|
|
131
|
+
ignoreRange?: boolean;
|
|
132
|
+
}
|
|
133
|
+
interface FetchItemStatusResponse {
|
|
134
|
+
/** Output only. The ID of the item. */
|
|
135
|
+
itemId?: string;
|
|
136
|
+
/** Output only. The state of the last async upload for an item. Only set when there has been an async upload for the item in the past 24 hours. */
|
|
137
|
+
lastAsyncUploadState?: string;
|
|
138
|
+
/** The name of the requested item. */
|
|
139
|
+
name?: string;
|
|
140
|
+
/** The public key of the item, which may be generated by the store. */
|
|
141
|
+
publicKey?: string;
|
|
142
|
+
/** Output only. Status of the current published revision of the item. Will be unset if the item is not published. */
|
|
143
|
+
publishedItemRevisionStatus?: ItemRevisionStatus;
|
|
144
|
+
/** Status of the item revision submitted to be published. Will be unset if the item has not been submitted for publishing since the last successful publish. */
|
|
145
|
+
submittedItemRevisionStatus?: ItemRevisionStatus;
|
|
146
|
+
/** If true, the item has been taken down for a policy violation. Check the developer dashboard for details. */
|
|
147
|
+
takenDown?: boolean;
|
|
148
|
+
/** If true, the item has been warned for a policy violation and will be taken down if not resolved. Check the developer dashboard for details. */
|
|
149
|
+
warned?: boolean;
|
|
150
|
+
}
|
|
151
|
+
interface ItemRevisionStatus {
|
|
152
|
+
/** Details on the package of the item */
|
|
153
|
+
distributionChannels?: DistributionChannel[];
|
|
154
|
+
/** Output only. Current state of the item */
|
|
155
|
+
state?: string;
|
|
156
|
+
}
|
|
157
|
+
interface Media {
|
|
158
|
+
/** Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, "MD5" is the only possible value for this field. New values may be added at any time. */
|
|
159
|
+
algorithm?: string;
|
|
160
|
+
/** Use object_id instead. */
|
|
161
|
+
bigstoreObjectRef?: string;
|
|
162
|
+
/** Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef. */
|
|
163
|
+
blobRef?: string;
|
|
164
|
+
/** Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob. */
|
|
165
|
+
blobstore2Info?: Blobstore2Info;
|
|
166
|
+
/** A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified. */
|
|
167
|
+
compositeMedia?: CompositeMedia[];
|
|
168
|
+
/** MIME type of the data */
|
|
169
|
+
contentType?: string;
|
|
170
|
+
/** Extended content type information provided for Scotty uploads. */
|
|
171
|
+
contentTypeInfo?: ContentTypeInfo;
|
|
172
|
+
/** A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field. */
|
|
173
|
+
cosmoBinaryReference?: string;
|
|
174
|
+
/** For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported. */
|
|
175
|
+
crc32cHash?: number;
|
|
176
|
+
/** Set if reference_type is DIFF_CHECKSUMS_RESPONSE. */
|
|
177
|
+
diffChecksumsResponse?: DiffChecksumsResponse;
|
|
178
|
+
/** Set if reference_type is DIFF_DOWNLOAD_RESPONSE. */
|
|
179
|
+
diffDownloadResponse?: DiffDownloadResponse;
|
|
180
|
+
/** Set if reference_type is DIFF_UPLOAD_REQUEST. */
|
|
181
|
+
diffUploadRequest?: DiffUploadRequest;
|
|
182
|
+
/** Set if reference_type is DIFF_UPLOAD_RESPONSE. */
|
|
183
|
+
diffUploadResponse?: DiffUploadResponse;
|
|
184
|
+
/** Set if reference_type is DIFF_VERSION_RESPONSE. */
|
|
185
|
+
diffVersionResponse?: DiffVersionResponse;
|
|
186
|
+
/** Parameters for a media download. */
|
|
187
|
+
downloadParameters?: DownloadParameters;
|
|
188
|
+
/** Original file name */
|
|
189
|
+
filename?: string;
|
|
190
|
+
/** Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/blobstore2/api/scotty/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media. */
|
|
191
|
+
hash?: string;
|
|
192
|
+
/** For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification. */
|
|
193
|
+
hashVerified?: boolean;
|
|
194
|
+
/** Media data, set if reference_type is INLINE */
|
|
195
|
+
inline?: string;
|
|
196
|
+
/** |is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence. */
|
|
197
|
+
isPotentialRetry?: boolean;
|
|
198
|
+
/** Size of the data, in bytes */
|
|
199
|
+
length?: string;
|
|
200
|
+
/** Scotty-provided MD5 hash for an upload. */
|
|
201
|
+
md5Hash?: string;
|
|
202
|
+
/** Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA. */
|
|
203
|
+
mediaId?: string;
|
|
204
|
+
/** Reference to a TI Blob, set if reference_type is BIGSTORE_REF. */
|
|
205
|
+
objectId?: ObjectId;
|
|
206
|
+
/** Path to the data, set if reference_type is PATH */
|
|
207
|
+
path?: string;
|
|
208
|
+
/** Describes what the field reference contains. */
|
|
209
|
+
referenceType?: string;
|
|
210
|
+
/** Scotty-provided SHA1 hash for an upload. */
|
|
211
|
+
sha1Hash?: string;
|
|
212
|
+
/** Scotty-provided SHA256 hash for an upload. */
|
|
213
|
+
sha256Hash?: string;
|
|
214
|
+
/** Time at which the media data was last updated, in milliseconds since UNIX epoch */
|
|
215
|
+
timestamp?: string;
|
|
216
|
+
/** A unique fingerprint/version id for the media data */
|
|
217
|
+
token?: string;
|
|
218
|
+
}
|
|
219
|
+
interface MediaRequestInfo {
|
|
220
|
+
/** The number of current bytes uploaded or downloaded. */
|
|
221
|
+
currentBytes?: string;
|
|
222
|
+
/** Data to be copied to backend requests. Custom data is returned to Scotty in the agent_state field, which Scotty will then provide in subsequent upload notifications. */
|
|
223
|
+
customData?: string;
|
|
224
|
+
/** Set if the http request info is diff encoded. The value of this field is the version number of the base revision. This is corresponding to Apiary's mediaDiffObjectVersion (//depot/google3/java/com/google/api/server/media/variable/DiffObjectVersionVariable.java). See go/esf-scotty-diff-upload for more information. */
|
|
225
|
+
diffObjectVersion?: string;
|
|
226
|
+
/** The existence of the final_status field indicates that this is the last call to the agent for this request_id. http://google3/uploader/agent/scotty_agent.proto?l=737&rcl=347601929 */
|
|
227
|
+
finalStatus?: number;
|
|
228
|
+
/** The type of notification received from Scotty. */
|
|
229
|
+
notificationType?: string;
|
|
230
|
+
/** The physical headers provided by RequestReceivedParameters in Scotty request. type is uploader_service.KeyValuePairs. */
|
|
231
|
+
physicalHeaders?: string;
|
|
232
|
+
/** The Scotty request ID. */
|
|
233
|
+
requestId?: string;
|
|
234
|
+
/** The partition of the Scotty server handling this request. type is uploader_service.RequestReceivedParamsServingInfo LINT.IfChange(request_received_params_serving_info_annotations) LINT.ThenChange() */
|
|
235
|
+
requestReceivedParamsServingInfo?: string;
|
|
236
|
+
/** The total size of the file. */
|
|
237
|
+
totalBytes?: string;
|
|
238
|
+
/** Whether the total bytes field contains an estimated data. */
|
|
239
|
+
totalBytesIsEstimated?: boolean;
|
|
240
|
+
}
|
|
241
|
+
interface ObjectId {
|
|
242
|
+
/** The name of the bucket to which this object belongs. */
|
|
243
|
+
bucketName?: string;
|
|
244
|
+
/** Generation of the object. Generations are monotonically increasing across writes, allowing them to be be compared to determine which generation is newer. If this is omitted in a request, then you are requesting the live object. See http://go/bigstore-versions */
|
|
245
|
+
generation?: string;
|
|
246
|
+
/** The name of the object. */
|
|
247
|
+
objectName?: string;
|
|
248
|
+
}
|
|
249
|
+
interface PublishItemRequest {
|
|
250
|
+
/** Optional. Additional deploy information including the desired initial percentage rollout. Defaults to the current value saved in the developer dashboard if unset. */
|
|
251
|
+
deployInfos?: DeployInfo[];
|
|
252
|
+
/** Optional. Use this to control if the item is published immediately on approval or staged for publishing in the future. Defaults to `DEFAULT_PUBLISH` if unset. */
|
|
253
|
+
publishType?: string;
|
|
254
|
+
/** Optional. Whether to attempt to skip item review. The API will validate if the item qualifies and return a validation error if the item requires review. Defaults to `false` if unset. */
|
|
255
|
+
skipReview?: boolean;
|
|
256
|
+
}
|
|
257
|
+
interface PublishItemResponse {
|
|
258
|
+
/** Output only. The ID of the item. */
|
|
259
|
+
itemId?: string;
|
|
260
|
+
/** The name of the item that was submitted */
|
|
261
|
+
name?: string;
|
|
262
|
+
/** Output only. The current state of the submission. */
|
|
263
|
+
state?: string;
|
|
264
|
+
}
|
|
265
|
+
interface SetPublishedDeployPercentageRequest {
|
|
266
|
+
/** Required. Unscaled percentage value for the publised revision (nonnegative number between 0 and 100). It must be larger than the existing target percentage. */
|
|
267
|
+
deployPercentage?: number;
|
|
268
|
+
}
|
|
269
|
+
interface SetPublishedDeployPercentageResponse {}
|
|
270
|
+
interface UploadItemPackageRequest {
|
|
271
|
+
/** Reference to the uploaded media. */
|
|
272
|
+
blob?: Media;
|
|
273
|
+
/** Info about the media upload request. */
|
|
274
|
+
mediaRequestInfo?: MediaRequestInfo;
|
|
275
|
+
}
|
|
276
|
+
interface UploadItemPackageResponse {
|
|
277
|
+
/** The extension version provided in the manifest of the uploaded package. This will not be set if the upload is still in progress (`upload_state` is `UPLOAD_IN_PROGRESS`). */
|
|
278
|
+
crxVersion?: string;
|
|
279
|
+
/** Output only. The ID of the item the package was uploaded to. */
|
|
280
|
+
itemId?: string;
|
|
281
|
+
/** The name of the item the package was uploaded to. */
|
|
282
|
+
name?: string;
|
|
283
|
+
/** Output only. The state of the upload. If `upload_state` is `UPLOAD_IN_PROGRESS`, you can poll for updates using the fetchStatus method. */
|
|
284
|
+
uploadState?: string;
|
|
285
|
+
}
|
|
286
|
+
interface MediaResource {
|
|
287
|
+
/** Upload a new package to an existing item. */
|
|
288
|
+
upload(request: {
|
|
289
|
+
/** V1 error format. */
|
|
290
|
+
'$.xgafv'?: string;
|
|
291
|
+
/** OAuth access token. */
|
|
292
|
+
access_token?: string;
|
|
293
|
+
/** Data format for response. */
|
|
294
|
+
alt?: string;
|
|
295
|
+
/** JSONP */
|
|
296
|
+
callback?: string;
|
|
297
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
298
|
+
fields?: string;
|
|
299
|
+
/** 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. */
|
|
300
|
+
key?: string;
|
|
301
|
+
/** Required. Name of the item to upload the new package to in the form `publishers/{publisherId}/items/{itemId}` */
|
|
302
|
+
name: string;
|
|
303
|
+
/** OAuth 2.0 token for the current user. */
|
|
304
|
+
oauth_token?: string;
|
|
305
|
+
/** Returns response with indentations and line breaks. */
|
|
306
|
+
prettyPrint?: boolean;
|
|
307
|
+
/** 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. */
|
|
308
|
+
quotaUser?: string;
|
|
309
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
310
|
+
upload_protocol?: string;
|
|
311
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
312
|
+
uploadType?: string;
|
|
313
|
+
/** Request body */
|
|
314
|
+
resource: UploadItemPackageRequest;
|
|
315
|
+
}): Request<UploadItemPackageResponse>;
|
|
316
|
+
upload(
|
|
317
|
+
request: {
|
|
318
|
+
/** V1 error format. */
|
|
319
|
+
'$.xgafv'?: string;
|
|
320
|
+
/** OAuth access token. */
|
|
321
|
+
access_token?: string;
|
|
322
|
+
/** Data format for response. */
|
|
323
|
+
alt?: string;
|
|
324
|
+
/** JSONP */
|
|
325
|
+
callback?: string;
|
|
326
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
327
|
+
fields?: string;
|
|
328
|
+
/** 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. */
|
|
329
|
+
key?: string;
|
|
330
|
+
/** Required. Name of the item to upload the new package to in the form `publishers/{publisherId}/items/{itemId}` */
|
|
331
|
+
name: string;
|
|
332
|
+
/** OAuth 2.0 token for the current user. */
|
|
333
|
+
oauth_token?: string;
|
|
334
|
+
/** Returns response with indentations and line breaks. */
|
|
335
|
+
prettyPrint?: boolean;
|
|
336
|
+
/** 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. */
|
|
337
|
+
quotaUser?: string;
|
|
338
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
339
|
+
upload_protocol?: string;
|
|
340
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
341
|
+
uploadType?: string;
|
|
342
|
+
},
|
|
343
|
+
body: UploadItemPackageRequest,
|
|
344
|
+
): Request<UploadItemPackageResponse>;
|
|
345
|
+
}
|
|
346
|
+
interface ItemsResource {
|
|
347
|
+
/** Cancel the current active submission of an item if present. This can be used to cancel the review of a pending submission. */
|
|
348
|
+
cancelSubmission(request: {
|
|
349
|
+
/** V1 error format. */
|
|
350
|
+
'$.xgafv'?: string;
|
|
351
|
+
/** OAuth access token. */
|
|
352
|
+
access_token?: string;
|
|
353
|
+
/** Data format for response. */
|
|
354
|
+
alt?: string;
|
|
355
|
+
/** JSONP */
|
|
356
|
+
callback?: string;
|
|
357
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
358
|
+
fields?: string;
|
|
359
|
+
/** 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. */
|
|
360
|
+
key?: string;
|
|
361
|
+
/** Required. Name of the item to cancel the submission of in the form `publishers/{publisherId}/items/{itemId}` */
|
|
362
|
+
name: string;
|
|
363
|
+
/** OAuth 2.0 token for the current user. */
|
|
364
|
+
oauth_token?: string;
|
|
365
|
+
/** Returns response with indentations and line breaks. */
|
|
366
|
+
prettyPrint?: boolean;
|
|
367
|
+
/** 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. */
|
|
368
|
+
quotaUser?: string;
|
|
369
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
370
|
+
upload_protocol?: string;
|
|
371
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
372
|
+
uploadType?: string;
|
|
373
|
+
/** Request body */
|
|
374
|
+
resource: CancelSubmissionRequest;
|
|
375
|
+
}): Request<{}>;
|
|
376
|
+
cancelSubmission(
|
|
377
|
+
request: {
|
|
378
|
+
/** V1 error format. */
|
|
379
|
+
'$.xgafv'?: string;
|
|
380
|
+
/** OAuth access token. */
|
|
381
|
+
access_token?: string;
|
|
382
|
+
/** Data format for response. */
|
|
383
|
+
alt?: string;
|
|
384
|
+
/** JSONP */
|
|
385
|
+
callback?: string;
|
|
386
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
387
|
+
fields?: string;
|
|
388
|
+
/** 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. */
|
|
389
|
+
key?: string;
|
|
390
|
+
/** Required. Name of the item to cancel the submission of in the form `publishers/{publisherId}/items/{itemId}` */
|
|
391
|
+
name: string;
|
|
392
|
+
/** OAuth 2.0 token for the current user. */
|
|
393
|
+
oauth_token?: string;
|
|
394
|
+
/** Returns response with indentations and line breaks. */
|
|
395
|
+
prettyPrint?: boolean;
|
|
396
|
+
/** 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. */
|
|
397
|
+
quotaUser?: string;
|
|
398
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
399
|
+
upload_protocol?: string;
|
|
400
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
401
|
+
uploadType?: string;
|
|
402
|
+
},
|
|
403
|
+
body: CancelSubmissionRequest,
|
|
404
|
+
): Request<{}>;
|
|
405
|
+
/** Fetch the status of an item. */
|
|
406
|
+
fetchStatus(request?: {
|
|
407
|
+
/** V1 error format. */
|
|
408
|
+
'$.xgafv'?: string;
|
|
409
|
+
/** OAuth access token. */
|
|
410
|
+
access_token?: string;
|
|
411
|
+
/** Data format for response. */
|
|
412
|
+
alt?: string;
|
|
413
|
+
/** JSONP */
|
|
414
|
+
callback?: string;
|
|
415
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
416
|
+
fields?: string;
|
|
417
|
+
/** 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. */
|
|
418
|
+
key?: string;
|
|
419
|
+
/** Required. Name of the item to retrieve the status of in the form `publishers/{publisherId}/items/{itemId}` */
|
|
420
|
+
name: string;
|
|
421
|
+
/** OAuth 2.0 token for the current user. */
|
|
422
|
+
oauth_token?: string;
|
|
423
|
+
/** Returns response with indentations and line breaks. */
|
|
424
|
+
prettyPrint?: boolean;
|
|
425
|
+
/** 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. */
|
|
426
|
+
quotaUser?: string;
|
|
427
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
428
|
+
upload_protocol?: string;
|
|
429
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
430
|
+
uploadType?: string;
|
|
431
|
+
}): Request<FetchItemStatusResponse>;
|
|
432
|
+
/** Submit the item to be published in the store. The item will be submitted for review unless `skip_review` is set to true, or the item is staged from a previous submission with `publish_type` set to `STAGED_PUBLISH`. */
|
|
433
|
+
publish(request: {
|
|
434
|
+
/** V1 error format. */
|
|
435
|
+
'$.xgafv'?: string;
|
|
436
|
+
/** OAuth access token. */
|
|
437
|
+
access_token?: string;
|
|
438
|
+
/** Data format for response. */
|
|
439
|
+
alt?: string;
|
|
440
|
+
/** JSONP */
|
|
441
|
+
callback?: string;
|
|
442
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
443
|
+
fields?: string;
|
|
444
|
+
/** 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. */
|
|
445
|
+
key?: string;
|
|
446
|
+
/** Required. Name of the item in the form `publishers/{publisherId}/items/{itemId}` */
|
|
447
|
+
name: string;
|
|
448
|
+
/** OAuth 2.0 token for the current user. */
|
|
449
|
+
oauth_token?: string;
|
|
450
|
+
/** Returns response with indentations and line breaks. */
|
|
451
|
+
prettyPrint?: boolean;
|
|
452
|
+
/** 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. */
|
|
453
|
+
quotaUser?: string;
|
|
454
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
455
|
+
upload_protocol?: string;
|
|
456
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
457
|
+
uploadType?: string;
|
|
458
|
+
/** Request body */
|
|
459
|
+
resource: PublishItemRequest;
|
|
460
|
+
}): Request<PublishItemResponse>;
|
|
461
|
+
publish(
|
|
462
|
+
request: {
|
|
463
|
+
/** V1 error format. */
|
|
464
|
+
'$.xgafv'?: string;
|
|
465
|
+
/** OAuth access token. */
|
|
466
|
+
access_token?: string;
|
|
467
|
+
/** Data format for response. */
|
|
468
|
+
alt?: string;
|
|
469
|
+
/** JSONP */
|
|
470
|
+
callback?: string;
|
|
471
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
472
|
+
fields?: string;
|
|
473
|
+
/** 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. */
|
|
474
|
+
key?: string;
|
|
475
|
+
/** Required. Name of the item in the form `publishers/{publisherId}/items/{itemId}` */
|
|
476
|
+
name: string;
|
|
477
|
+
/** OAuth 2.0 token for the current user. */
|
|
478
|
+
oauth_token?: string;
|
|
479
|
+
/** Returns response with indentations and line breaks. */
|
|
480
|
+
prettyPrint?: boolean;
|
|
481
|
+
/** 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. */
|
|
482
|
+
quotaUser?: string;
|
|
483
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
484
|
+
upload_protocol?: string;
|
|
485
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
486
|
+
uploadType?: string;
|
|
487
|
+
},
|
|
488
|
+
body: PublishItemRequest,
|
|
489
|
+
): Request<PublishItemResponse>;
|
|
490
|
+
/** Set a higher target deploy percentage for the item's published revision. This will be updated without the item being submitted for review. This is only available to items with over 10,000 seven-day active users. */
|
|
491
|
+
setPublishedDeployPercentage(request: {
|
|
492
|
+
/** V1 error format. */
|
|
493
|
+
'$.xgafv'?: string;
|
|
494
|
+
/** OAuth access token. */
|
|
495
|
+
access_token?: string;
|
|
496
|
+
/** Data format for response. */
|
|
497
|
+
alt?: string;
|
|
498
|
+
/** JSONP */
|
|
499
|
+
callback?: string;
|
|
500
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
501
|
+
fields?: string;
|
|
502
|
+
/** 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. */
|
|
503
|
+
key?: string;
|
|
504
|
+
/** Required. Name of the item to update the published revision of in the form `publishers/{publisherId}/items/{itemId}` */
|
|
505
|
+
name: string;
|
|
506
|
+
/** OAuth 2.0 token for the current user. */
|
|
507
|
+
oauth_token?: string;
|
|
508
|
+
/** Returns response with indentations and line breaks. */
|
|
509
|
+
prettyPrint?: boolean;
|
|
510
|
+
/** 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. */
|
|
511
|
+
quotaUser?: string;
|
|
512
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
513
|
+
upload_protocol?: string;
|
|
514
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
515
|
+
uploadType?: string;
|
|
516
|
+
/** Request body */
|
|
517
|
+
resource: SetPublishedDeployPercentageRequest;
|
|
518
|
+
}): Request<{}>;
|
|
519
|
+
setPublishedDeployPercentage(
|
|
520
|
+
request: {
|
|
521
|
+
/** V1 error format. */
|
|
522
|
+
'$.xgafv'?: string;
|
|
523
|
+
/** OAuth access token. */
|
|
524
|
+
access_token?: string;
|
|
525
|
+
/** Data format for response. */
|
|
526
|
+
alt?: string;
|
|
527
|
+
/** JSONP */
|
|
528
|
+
callback?: string;
|
|
529
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
530
|
+
fields?: string;
|
|
531
|
+
/** 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. */
|
|
532
|
+
key?: string;
|
|
533
|
+
/** Required. Name of the item to update the published revision of in the form `publishers/{publisherId}/items/{itemId}` */
|
|
534
|
+
name: string;
|
|
535
|
+
/** OAuth 2.0 token for the current user. */
|
|
536
|
+
oauth_token?: string;
|
|
537
|
+
/** Returns response with indentations and line breaks. */
|
|
538
|
+
prettyPrint?: boolean;
|
|
539
|
+
/** 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. */
|
|
540
|
+
quotaUser?: string;
|
|
541
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
542
|
+
upload_protocol?: string;
|
|
543
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
544
|
+
uploadType?: string;
|
|
545
|
+
},
|
|
546
|
+
body: SetPublishedDeployPercentageRequest,
|
|
547
|
+
): Request<{}>;
|
|
548
|
+
}
|
|
549
|
+
interface PublishersResource {
|
|
550
|
+
items: ItemsResource;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
const media: MediaResource;
|
|
554
|
+
|
|
555
|
+
const publishers: PublishersResource;
|
|
556
|
+
}
|
|
557
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.chromewebstore-v2",
|
|
3
|
+
"version": "0.0.20251022",
|
|
4
|
+
"description": "TypeScript typings for Chrome Web Store API v2",
|
|
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,81 @@
|
|
|
1
|
+
# TypeScript typings for Chrome Web Store API v2
|
|
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/docs/webstore/api).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Chrome Web Store API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.chromewebstore-v2 --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=v2',
|
|
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', 'v2', () => {
|
|
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
|
+
Upload a new package to an existing item.
|
|
77
|
+
*/
|
|
78
|
+
await gapi.client.chromewebstore.media.upload({name: 'name'});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.chromewebstore-v2#Provenance:~:text=none-,Provenance,-Built%20and%20signed)
|