@maxim_mazurok/gapi.client.merchantapi-conversions_v1 0.0.20250804

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 +388 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,388 @@
1
+ /* Type definitions for non-npm package Merchant API conversions_v1 0.0 */
2
+ // Project: https://developers.google.com/merchant/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://merchantapi.googleapis.com/$discovery/rest?version=conversions_v1
12
+ // Revision: 20250804
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Merchant API conversions_v1 */
18
+ function load(
19
+ urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=conversions_v1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'merchantapi', version: 'conversions_v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'merchantapi',
26
+ version: 'conversions_v1',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace merchantapi {
31
+ interface AttributionSettings {
32
+ /** Required. Lookback window (in days) used for attribution in this source. Supported values are `7`, `30` & `40`. */
33
+ attributionLookbackWindowDays?: number;
34
+ /** Required. Attribution model. */
35
+ attributionModel?: string;
36
+ /** Immutable. Unordered list. List of different conversion types a conversion event can be classified as. A standard "purchase" type will be automatically created if this list is empty at creation time. */
37
+ conversionType?: ConversionType[];
38
+ }
39
+ interface ConversionSource {
40
+ /** Output only. Controller of the conversion source. */
41
+ controller?: string;
42
+ /** Output only. The time when an archived conversion source becomes permanently deleted and is no longer available to undelete. */
43
+ expireTime?: string;
44
+ /** Immutable. Conversion Source of type "Link to Google Analytics Property". */
45
+ googleAnalyticsLink?: GoogleAnalyticsLink;
46
+ /** Conversion Source of type "Merchant Center Tag Destination". */
47
+ merchantCenterDestination?: MerchantCenterDestination;
48
+ /** Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources. */
49
+ name?: string;
50
+ /** Output only. Current state of this conversion source. Can't be edited through the API. */
51
+ state?: string;
52
+ }
53
+ interface ConversionType {
54
+ /** Output only. Conversion event name, as it'll be reported by the client. */
55
+ name?: string;
56
+ /** Output only. Option indicating if the type should be included in Merchant Center reporting. */
57
+ report?: boolean;
58
+ }
59
+ interface Empty {}
60
+ interface GoogleAnalyticsLink {
61
+ /** Output only. Attribution settings for the linked Google Analytics property. */
62
+ attributionSettings?: AttributionSettings;
63
+ /** Output only. Name of the Google Analytics property the merchant is linked to. */
64
+ property?: string;
65
+ /** Required. Immutable. ID of the Google Analytics property the merchant is linked to. */
66
+ propertyId?: string;
67
+ }
68
+ interface ListConversionSourcesResponse {
69
+ /** List of conversion sources. */
70
+ conversionSources?: ConversionSource[];
71
+ /** Token to be used to fetch the next results page. */
72
+ nextPageToken?: string;
73
+ }
74
+ interface MerchantCenterDestination {
75
+ /** Required. Attribution settings used for the Merchant Center Destination. */
76
+ attributionSettings?: AttributionSettings;
77
+ /** Required. Three-letter currency code (ISO 4217). The currency code defines in which currency the conversions sent to this destination will be reported in Merchant Center. */
78
+ currencyCode?: string;
79
+ /** Output only. Merchant Center Destination ID. */
80
+ destination?: string;
81
+ /** Required. Merchant-specified display name for the destination. This is the name that identifies the conversion source within the Merchant Center UI. The maximum length is 64 characters. */
82
+ displayName?: string;
83
+ }
84
+ interface ProductChange {
85
+ /** The new value of the changed resource or attribute. If empty, it means that the product was deleted. Will have one of these values : (`approved`, `pending`, `disapproved`, ``) */
86
+ newValue?: string;
87
+ /** The old value of the changed resource or attribute. If empty, it means that the product was created. Will have one of these values : (`approved`, `pending`, `disapproved`, ``) */
88
+ oldValue?: string;
89
+ /** Countries that have the change (if applicable). Represented in the ISO 3166 format. */
90
+ regionCode?: string;
91
+ /** Reporting contexts that have the change (if applicable). Currently this field supports only (`SHOPPING_ADS`, `LOCAL_INVENTORY_ADS`, `YOUTUBE_SHOPPING`, `YOUTUBE_CHECKOUT`, `YOUTUBE_AFFILIATE`) from the enum value [ReportingContextEnum](/merchant/api/reference/rest/Shared.Types/ReportingContextEnum) */
92
+ reportingContext?: string;
93
+ }
94
+ interface ProductStatusChangeMessage {
95
+ /** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
96
+ account?: string;
97
+ /** The attribute in the resource that changed, in this case it will be always `Status`. */
98
+ attribute?: string;
99
+ /** A message to describe the change that happened to the product */
100
+ changes?: ProductChange[];
101
+ /** The time at which the event was generated. If you want to order the notification messages you receive you should rely on this field not on the order of receiving the notifications. */
102
+ eventTime?: string;
103
+ /** Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event. */
104
+ expirationTime?: string;
105
+ /** The account that manages the merchant's account. can be the same as merchant id if it is standalone account. Format : `accounts/{service_provider_id}` */
106
+ managingAccount?: string;
107
+ /** The product name. Format: `accounts/{account}/products/{product}` */
108
+ resource?: string;
109
+ /** The product id. */
110
+ resourceId?: string;
111
+ /** The resource that changed, in this case it will always be `Product`. */
112
+ resourceType?: string;
113
+ }
114
+ interface UndeleteConversionSourceRequest {}
115
+ interface ConversionSourcesResource {
116
+ /** Creates a new conversion source. */
117
+ create(request: {
118
+ /** V1 error format. */
119
+ '$.xgafv'?: string;
120
+ /** OAuth access token. */
121
+ access_token?: string;
122
+ /** Data format for response. */
123
+ alt?: string;
124
+ /** JSONP */
125
+ callback?: string;
126
+ /** Selector specifying which fields to include in a partial response. */
127
+ fields?: string;
128
+ /** 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. */
129
+ key?: string;
130
+ /** OAuth 2.0 token for the current user. */
131
+ oauth_token?: string;
132
+ /** Required. The merchant account that will own the new conversion source. Format: `accounts/{account}` */
133
+ parent: string;
134
+ /** Returns response with indentations and line breaks. */
135
+ prettyPrint?: boolean;
136
+ /** 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. */
137
+ quotaUser?: string;
138
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
139
+ upload_protocol?: string;
140
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
141
+ uploadType?: string;
142
+ /** Request body */
143
+ resource: ConversionSource;
144
+ }): Request<ConversionSource>;
145
+ create(
146
+ request: {
147
+ /** V1 error format. */
148
+ '$.xgafv'?: string;
149
+ /** OAuth access token. */
150
+ access_token?: string;
151
+ /** Data format for response. */
152
+ alt?: string;
153
+ /** JSONP */
154
+ callback?: string;
155
+ /** Selector specifying which fields to include in a partial response. */
156
+ fields?: string;
157
+ /** 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. */
158
+ key?: string;
159
+ /** OAuth 2.0 token for the current user. */
160
+ oauth_token?: string;
161
+ /** Required. The merchant account that will own the new conversion source. Format: `accounts/{account}` */
162
+ parent: string;
163
+ /** Returns response with indentations and line breaks. */
164
+ prettyPrint?: boolean;
165
+ /** 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. */
166
+ quotaUser?: string;
167
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
168
+ upload_protocol?: string;
169
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
170
+ uploadType?: string;
171
+ },
172
+ body: ConversionSource,
173
+ ): Request<ConversionSource>;
174
+ /** Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one. */
175
+ delete(request?: {
176
+ /** V1 error format. */
177
+ '$.xgafv'?: string;
178
+ /** OAuth access token. */
179
+ access_token?: string;
180
+ /** Data format for response. */
181
+ alt?: string;
182
+ /** JSONP */
183
+ callback?: string;
184
+ /** Selector specifying which fields to include in a partial response. */
185
+ fields?: string;
186
+ /** 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. */
187
+ key?: string;
188
+ /** Required. The name of the conversion source to be deleted. Format: `accounts/{account}/conversionSources/{conversion_source}` */
189
+ name: string;
190
+ /** OAuth 2.0 token for the current user. */
191
+ oauth_token?: string;
192
+ /** Returns response with indentations and line breaks. */
193
+ prettyPrint?: boolean;
194
+ /** 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. */
195
+ quotaUser?: string;
196
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
197
+ upload_protocol?: string;
198
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
199
+ uploadType?: string;
200
+ }): Request<{}>;
201
+ /** Fetches a conversion source. */
202
+ get(request?: {
203
+ /** V1 error format. */
204
+ '$.xgafv'?: string;
205
+ /** OAuth access token. */
206
+ access_token?: string;
207
+ /** Data format for response. */
208
+ alt?: string;
209
+ /** JSONP */
210
+ callback?: string;
211
+ /** Selector specifying which fields to include in a partial response. */
212
+ fields?: string;
213
+ /** 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. */
214
+ key?: string;
215
+ /** Required. The name of the conversion source to be fetched. Format: `accounts/{account}/conversionSources/{conversion_source}` */
216
+ name: string;
217
+ /** OAuth 2.0 token for the current user. */
218
+ oauth_token?: string;
219
+ /** Returns response with indentations and line breaks. */
220
+ prettyPrint?: boolean;
221
+ /** 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. */
222
+ quotaUser?: string;
223
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
224
+ upload_protocol?: string;
225
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
226
+ uploadType?: string;
227
+ }): Request<ConversionSource>;
228
+ /** Retrieves the list of conversion sources the caller has access to. */
229
+ list(request?: {
230
+ /** V1 error format. */
231
+ '$.xgafv'?: string;
232
+ /** OAuth access token. */
233
+ access_token?: string;
234
+ /** Data format for response. */
235
+ alt?: string;
236
+ /** JSONP */
237
+ callback?: string;
238
+ /** Selector specifying which fields to include in a partial response. */
239
+ fields?: string;
240
+ /** 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. */
241
+ key?: string;
242
+ /** OAuth 2.0 token for the current user. */
243
+ oauth_token?: string;
244
+ /** Optional. The maximum number of conversion sources to return in a page. If no `page_size` is specified, `100` is used as the default value. The maximum value is `200`. Values above `200` will be coerced to `200`. Regardless of pagination, at most `200` conversion sources are returned in total. */
245
+ pageSize?: number;
246
+ /** Optional. Page token. */
247
+ pageToken?: string;
248
+ /** Required. The merchant account who owns the collection of conversion sources. Format: `accounts/{account}` */
249
+ parent: string;
250
+ /** Returns response with indentations and line breaks. */
251
+ prettyPrint?: boolean;
252
+ /** 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. */
253
+ quotaUser?: string;
254
+ /** Optional. Show deleted (archived) conversion sources. By default, deleted conversion sources are not returned. */
255
+ showDeleted?: boolean;
256
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
257
+ upload_protocol?: string;
258
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
259
+ uploadType?: string;
260
+ }): Request<ListConversionSourcesResponse>;
261
+ /** Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources. */
262
+ patch(request: {
263
+ /** V1 error format. */
264
+ '$.xgafv'?: string;
265
+ /** OAuth access token. */
266
+ access_token?: string;
267
+ /** Data format for response. */
268
+ alt?: string;
269
+ /** JSONP */
270
+ callback?: string;
271
+ /** Selector specifying which fields to include in a partial response. */
272
+ fields?: string;
273
+ /** 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. */
274
+ key?: string;
275
+ /** Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources. */
276
+ name: string;
277
+ /** OAuth 2.0 token for the current user. */
278
+ oauth_token?: string;
279
+ /** Returns response with indentations and line breaks. */
280
+ prettyPrint?: boolean;
281
+ /** 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. */
282
+ quotaUser?: string;
283
+ /** Optional. List of fields being updated. */
284
+ updateMask?: string;
285
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
286
+ upload_protocol?: string;
287
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
288
+ uploadType?: string;
289
+ /** Request body */
290
+ resource: ConversionSource;
291
+ }): Request<ConversionSource>;
292
+ patch(
293
+ request: {
294
+ /** V1 error format. */
295
+ '$.xgafv'?: string;
296
+ /** OAuth access token. */
297
+ access_token?: string;
298
+ /** Data format for response. */
299
+ alt?: string;
300
+ /** JSONP */
301
+ callback?: string;
302
+ /** Selector specifying which fields to include in a partial response. */
303
+ fields?: string;
304
+ /** 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. */
305
+ key?: string;
306
+ /** Output only. Identifier. Generated by the Content API upon creation of a new `ConversionSource`. Format: `[a-z]{4}:.+` The four characters before the colon represent the type of conversion source. Content after the colon represents the ID of the conversion source within that type. The ID of two different conversion sources might be the same across different types. The following type prefixes are supported: * `galk`: For GoogleAnalyticsLink sources. * `mcdn`: For MerchantCenterDestination sources. */
307
+ name: string;
308
+ /** OAuth 2.0 token for the current user. */
309
+ oauth_token?: string;
310
+ /** Returns response with indentations and line breaks. */
311
+ prettyPrint?: boolean;
312
+ /** 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. */
313
+ quotaUser?: string;
314
+ /** Optional. List of fields being updated. */
315
+ updateMask?: string;
316
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
317
+ upload_protocol?: string;
318
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
319
+ uploadType?: string;
320
+ },
321
+ body: ConversionSource,
322
+ ): Request<ConversionSource>;
323
+ /** Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources. */
324
+ undelete(request: {
325
+ /** V1 error format. */
326
+ '$.xgafv'?: string;
327
+ /** OAuth access token. */
328
+ access_token?: string;
329
+ /** Data format for response. */
330
+ alt?: string;
331
+ /** JSONP */
332
+ callback?: string;
333
+ /** Selector specifying which fields to include in a partial response. */
334
+ fields?: string;
335
+ /** 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. */
336
+ key?: string;
337
+ /** Required. The name of the conversion source to be undeleted. Format: `accounts/{account}/conversionSources/{conversion_source}` */
338
+ name: string;
339
+ /** OAuth 2.0 token for the current user. */
340
+ oauth_token?: string;
341
+ /** Returns response with indentations and line breaks. */
342
+ prettyPrint?: boolean;
343
+ /** 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. */
344
+ quotaUser?: string;
345
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
346
+ upload_protocol?: string;
347
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
348
+ uploadType?: string;
349
+ /** Request body */
350
+ resource: UndeleteConversionSourceRequest;
351
+ }): Request<ConversionSource>;
352
+ undelete(
353
+ request: {
354
+ /** V1 error format. */
355
+ '$.xgafv'?: string;
356
+ /** OAuth access token. */
357
+ access_token?: string;
358
+ /** Data format for response. */
359
+ alt?: string;
360
+ /** JSONP */
361
+ callback?: string;
362
+ /** Selector specifying which fields to include in a partial response. */
363
+ fields?: string;
364
+ /** 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. */
365
+ key?: string;
366
+ /** Required. The name of the conversion source to be undeleted. Format: `accounts/{account}/conversionSources/{conversion_source}` */
367
+ name: string;
368
+ /** OAuth 2.0 token for the current user. */
369
+ oauth_token?: string;
370
+ /** Returns response with indentations and line breaks. */
371
+ prettyPrint?: boolean;
372
+ /** 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. */
373
+ quotaUser?: string;
374
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
375
+ upload_protocol?: string;
376
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
377
+ uploadType?: string;
378
+ },
379
+ body: UndeleteConversionSourceRequest,
380
+ ): Request<ConversionSource>;
381
+ }
382
+ interface AccountsResource {
383
+ conversionSources: ConversionSourcesResource;
384
+ }
385
+
386
+ const accounts: AccountsResource;
387
+ }
388
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.merchantapi-conversions_v1",
3
+ "version": "0.0.20250804",
4
+ "description": "TypeScript typings for Merchant API conversions_v1",
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,73 @@
1
+ # TypeScript typings for Merchant API conversions_v1
2
+
3
+ Programmatically manage your Merchant Center Accounts.
4
+ For detailed description please check [documentation](https://developers.google.com/merchant/api).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Merchant API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.merchantapi-conversions_v1 --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://merchantapi.googleapis.com/$discovery/rest?version=conversions_v1',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.merchantapi
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('merchantapi', 'conversions_v1', () => {
40
+ // now we can use:
41
+ // gapi.client.merchantapi
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
+ // Manage your product listings and accounts for Google Shopping
52
+ 'https://www.googleapis.com/auth/content',
53
+ ],
54
+ immediate = true;
55
+ // ...
56
+
57
+ gapi.auth.authorize(
58
+ {client_id: client_id, scope: scope, immediate: immediate},
59
+ authResult => {
60
+ if (authResult && !authResult.error) {
61
+ /* handle successful authorization */
62
+ } else {
63
+ /* handle authorization error */
64
+ }
65
+ },
66
+ );
67
+ ```
68
+
69
+ After that you can use Merchant API resources: <!-- TODO: make this work for multiple namespaces -->
70
+
71
+ ```typescript
72
+
73
+ ```