-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
86 lines (80 loc) · 2.09 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
export type PublishTarget = "default" | "trustedUsers";
/**
* Options for the Google Web Store API client.
*
* @see https://developer.chrome.com/docs/webstore/using_webstore_api/ to learn
* how to get the options from your Google account.
*/
export interface ClientOptions {
/** ID of your Chrome Web Store item. */
id: string;
/** Client ID from the Google API Console. */
clientId: string;
/** Client secret (caution: sensitive) from the Google API Console. */
clientSecret: string;
/** Refresh token from the Google API. */
refreshToken: string;
}
/**
* @see https://developer.chrome.com/docs/webstore/using_webstore_api/
*/
export interface GoogleAPITokenResponse {
// deno-lint-ignore camelcase
access_token: string;
// deno-lint-ignore camelcase
token_type: string;
// deno-lint-ignore camelcase
expires_in: number;
// deno-lint-ignore camelcase
refresh_token: string;
}
/**
* @see https://developer.chrome.com/docs/webstore/webstore_api/items/
*/
export interface GoogleAPIWebStoreItem {
kind: "chromewebstore#item";
/** Extension or app ID. */
id: string;
publicKey?: string;
uploadState: "FAILURE" | "IN_PROGRESS" | "NOT_FOUND" | "SUCCESS";
itemError?: Array<{
error_code: string;
error_detail: string;
}>;
}
export interface GoogleAPIWebStorePublishSuccess {
kind: "chromewebstore#item";
// deno-lint-ignore camelcase
item_id: string;
status: Array<
| "OK"
| "NOT_AUTHORIZED"
| "INVALID_DEVELOPER"
| "DEVELOPER_NO_OWNERSHIP"
| "DEVELOPER_SUSPENDED"
| "ITEM_NOT_FOUND"
| "ITEM_PENDING_REVIEW"
| "ITEM_TAKEN_DOWN"
| "PUBLISHER_SUSPENDED"
>;
statusDetail: Array<string>;
}
export interface GoogleAPIWebStorePublishFailure {
error: {
code: number;
message: string;
errors: Array<
{
message: string;
domain: string;
reason: string;
}
>;
};
}
/**
* @see https://developer.chrome.com/docs/webstore/webstore_api/items/publish/#response
*/
export type GoogleAPIWebStorePublishResponse =
| GoogleAPIWebStorePublishSuccess
| GoogleAPIWebStorePublishFailure;