@maxim_mazurok/gapi.client.merchantapi-reports_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 +537 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,537 @@
1
+ /* Type definitions for non-npm package Merchant API reports_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=reports_v1
12
+ // Revision: 20250804
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Merchant API reports_v1 */
18
+ function load(
19
+ urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=reports_v1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'merchantapi', version: 'reports_v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'merchantapi',
26
+ version: 'reports_v1',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace merchantapi {
31
+ interface BestSellersBrandView {
32
+ /** Name of the brand. */
33
+ brand?: string;
34
+ /** Popularity rank in the previous week or month. */
35
+ previousRank?: string;
36
+ /** Estimated demand in relation to the brand with the highest popularity rank in the same category and country in the previous week or month. */
37
+ previousRelativeDemand?: string;
38
+ /** Popularity of the brand on Ads and organic surfaces, in the selected category and country, based on the estimated number of units sold. */
39
+ rank?: string;
40
+ /** Estimated demand in relation to the brand with the highest popularity rank in the same category and country. */
41
+ relativeDemand?: string;
42
+ /** Change in the estimated demand. Whether it rose, sank or remained flat. */
43
+ relativeDemandChange?: string;
44
+ /** Google product category ID to calculate the ranking for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. If a `WHERE` condition on `report_category_id` is not specified in the query, rankings for all top-level categories are returned. */
45
+ reportCategoryId?: string;
46
+ /** Country where the ranking is calculated. Represented in the ISO 3166 format. Required in the `SELECT` clause. Condition on `report_country_code` is required in the `WHERE` clause. */
47
+ reportCountryCode?: string;
48
+ /** Report date. The value of this field can only be one of the following: * The first day of the week (Monday) for weekly reports, * The first day of the month for monthly reports. Required in the `SELECT` clause. If a `WHERE` condition on `report_date` is not specified in the query, the latest available weekly or monthly report is returned. */
49
+ reportDate?: Date;
50
+ /** Granularity of the report. The ranking can be done over a week or a month timeframe. Required in the `SELECT` clause. Condition on `report_granularity` is required in the `WHERE` clause. */
51
+ reportGranularity?: string;
52
+ }
53
+ interface BestSellersProductClusterView {
54
+ /** Brand of the product cluster. */
55
+ brand?: string;
56
+ /** Whether there is at least one product of the brand currently `IN_STOCK` in your product data source in at least one of the countries, all products are `OUT_OF_STOCK` in your product data source in all countries, or `NOT_IN_INVENTORY`. The field doesn't take the Best sellers report country filter into account. */
57
+ brandInventoryStatus?: string;
58
+ /** Product category (1st level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
59
+ categoryL1?: string;
60
+ /** Product category (2nd level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
61
+ categoryL2?: string;
62
+ /** Product category (3rd level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
63
+ categoryL3?: string;
64
+ /** Product category (4th level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
65
+ categoryL4?: string;
66
+ /** Product category (5th level) of the product cluster, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
67
+ categoryL5?: string;
68
+ /** Whether the product cluster is `IN_STOCK` in your product data source in at least one of the countries, `OUT_OF_STOCK` in your product data source in all countries, or `NOT_IN_INVENTORY` at all. The field doesn't take the Best sellers report country filter into account. */
69
+ inventoryStatus?: string;
70
+ /** Popularity rank in the previous week or month. */
71
+ previousRank?: string;
72
+ /** Estimated demand in relation to the product cluster with the highest popularity rank in the same category and country in the previous week or month. */
73
+ previousRelativeDemand?: string;
74
+ /** Popularity of the product cluster on Ads and organic surfaces, in the selected category and country, based on the estimated number of units sold. */
75
+ rank?: string;
76
+ /** Estimated demand in relation to the product cluster with the highest popularity rank in the same category and country. */
77
+ relativeDemand?: string;
78
+ /** Change in the estimated demand. Whether it rose, sank or remained flat. */
79
+ relativeDemandChange?: string;
80
+ /** Google product category ID to calculate the ranking for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. If a `WHERE` condition on `report_category_id` is not specified in the query, rankings for all top-level categories are returned. */
81
+ reportCategoryId?: string;
82
+ /** Country where the ranking is calculated. Represented in the ISO 3166 format. Required in the `SELECT` clause. Condition on `report_country_code` is required in the `WHERE` clause. */
83
+ reportCountryCode?: string;
84
+ /** Report date. The value of this field can only be one of the following: * The first day of the week (Monday) for weekly reports, * The first day of the month for monthly reports. Required in the `SELECT` clause. If a `WHERE` condition on `report_date` is not specified in the query, the latest available weekly or monthly report is returned. */
85
+ reportDate?: Date;
86
+ /** Granularity of the report. The ranking can be done over a week or a month timeframe. Required in the `SELECT` clause. Condition on `report_granularity` is required in the `WHERE` clause. */
87
+ reportGranularity?: string;
88
+ /** Title of the product cluster. */
89
+ title?: string;
90
+ /** GTINs of example variants of the product cluster. */
91
+ variantGtins?: string[];
92
+ }
93
+ interface CompetitiveVisibilityBenchmarkView {
94
+ /** Change in visibility based on impressions with respect to the start of the selected time range (or first day with non-zero impressions) for a combined set of merchants with highest visibility approximating the market. Cannot be filtered on in the 'WHERE' clause. */
95
+ categoryBenchmarkVisibilityTrend?: number;
96
+ /** Date of this row. Required in the `SELECT` clause. A condition on `date` is required in the `WHERE` clause. */
97
+ date?: Date;
98
+ /** Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause. */
99
+ reportCategoryId?: string;
100
+ /** Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause. */
101
+ reportCountryCode?: string;
102
+ /** Traffic source of impressions. Required in the `SELECT` clause. */
103
+ trafficSource?: string;
104
+ /** Change in visibility based on impressions for your domain with respect to the start of the selected time range (or first day with non-zero impressions). Cannot be filtered on in the 'WHERE' clause. */
105
+ yourDomainVisibilityTrend?: number;
106
+ }
107
+ interface CompetitiveVisibilityCompetitorView {
108
+ /** [Ads / organic ratio] (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio) shows how often the domain receives impressions from Shopping ads compared to organic traffic. The number is rounded and bucketed. Cannot be filtered on in the 'WHERE' clause. */
109
+ adsOrganicRatio?: number;
110
+ /** Date of this row. A condition on `date` is required in the `WHERE` clause. */
111
+ date?: Date;
112
+ /** Domain of your competitor or your domain, if 'is_your_domain' is true. Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE' clause. */
113
+ domain?: string;
114
+ /** [Higher position rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate) shows how often a competitor’s offer got placed in a higher position on the page than your offer. Cannot be filtered on in the 'WHERE' clause. */
115
+ higherPositionRate?: number;
116
+ /** True if this row contains data for your domain. Cannot be filtered on in the 'WHERE' clause. */
117
+ isYourDomain?: boolean;
118
+ /** [Page overlap rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate) shows how frequently competing retailers’ offers are shown together with your offers on the same page. Cannot be filtered on in the 'WHERE' clause. */
119
+ pageOverlapRate?: number;
120
+ /** Position of the domain in the similar businesses ranking for the selected keys (`date`, `report_category_id`, `report_country_code`, `traffic_source`) based on impressions. 1 is the highest. Cannot be filtered on in the 'WHERE' clause. */
121
+ rank?: string;
122
+ /** [Relative visibility] (https://support.google.com/merchants/answer/11366442#zippy=%2Crelative-visibility) shows how often your competitors’ offers are shown compared to your offers. In other words, this is the number of displayed impressions of a competitor retailer divided by the number of your displayed impressions during a selected time range for a selected product category and country. Cannot be filtered on in the 'WHERE' clause. */
123
+ relativeVisibility?: number;
124
+ /** Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause. */
125
+ reportCategoryId?: string;
126
+ /** Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause. */
127
+ reportCountryCode?: string;
128
+ /** Traffic source of impressions. Required in the `SELECT` clause. */
129
+ trafficSource?: string;
130
+ }
131
+ interface CompetitiveVisibilityTopMerchantView {
132
+ /** [Ads / organic ratio] (https://support.google.com/merchants/answer/11366442#zippy=%2Cads-free-ratio) shows how often the domain receives impressions from Shopping ads compared to organic traffic. The number is rounded and bucketed. Cannot be filtered on in the 'WHERE' clause. */
133
+ adsOrganicRatio?: number;
134
+ /** Date of this row. Cannot be selected in the `SELECT` clause. A condition on `date` is required in the `WHERE` clause. */
135
+ date?: Date;
136
+ /** Domain of your competitor or your domain, if 'is_your_domain' is true. Required in the `SELECT` clause. Cannot be filtered on in the 'WHERE' clause. */
137
+ domain?: string;
138
+ /** [Higher position rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Chigher-position-rate) shows how often a competitor’s offer got placed in a higher position on the page than your offer. Cannot be filtered on in the 'WHERE' clause. */
139
+ higherPositionRate?: number;
140
+ /** True if this row contains data for your domain. Cannot be filtered on in the 'WHERE' clause. */
141
+ isYourDomain?: boolean;
142
+ /** [Page overlap rate] (https://support.google.com/merchants/answer/11366442#zippy=%2Cpage-overlap-rate) shows how frequently competing retailers’ offers are shown together with your offers on the same page. Cannot be filtered on in the 'WHERE' clause. */
143
+ pageOverlapRate?: number;
144
+ /** Position of the domain in the top merchants ranking for the selected keys (`date`, `report_category_id`, `report_country_code`, `traffic_source`) based on impressions. 1 is the highest. Cannot be filtered on in the 'WHERE' clause. */
145
+ rank?: string;
146
+ /** Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause. */
147
+ reportCategoryId?: string;
148
+ /** Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause. */
149
+ reportCountryCode?: string;
150
+ /** Traffic source of impressions. Required in the `SELECT` clause. */
151
+ trafficSource?: string;
152
+ }
153
+ interface Date {
154
+ /** Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
155
+ day?: number;
156
+ /** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
157
+ month?: number;
158
+ /** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
159
+ year?: number;
160
+ }
161
+ interface IssueSeverityPerReportingContext {
162
+ /** List of demoted countries in the reporting context, represented in ISO 3166 format. */
163
+ demotedCountries?: string[];
164
+ /** List of disapproved countries in the reporting context, represented in ISO 3166 format. */
165
+ disapprovedCountries?: string[];
166
+ /** Reporting context the issue applies to. */
167
+ reportingContext?: string;
168
+ }
169
+ interface ItemIssue {
170
+ /** Item issue resolution. */
171
+ resolution?: string;
172
+ /** Item issue severity. */
173
+ severity?: ItemIssueSeverity;
174
+ /** Item issue type. */
175
+ type?: ItemIssueType;
176
+ }
177
+ interface ItemIssueSeverity {
178
+ /** Aggregated severity of the issue for all reporting contexts it affects. **This field can be used for filtering the results.** */
179
+ aggregatedSeverity?: string;
180
+ /** Issue severity per reporting context. */
181
+ severityPerReportingContext?: IssueSeverityPerReportingContext[];
182
+ }
183
+ interface ItemIssueType {
184
+ /** Canonical attribute name for attribute-specific issues. */
185
+ canonicalAttribute?: string;
186
+ /** Error code of the issue, equivalent to the `code` of [Product issues](https://developers.google.com/shopping-content/guides/product-issues). */
187
+ code?: string;
188
+ }
189
+ interface NonProductPerformanceView {
190
+ /** Number of clicks on images and online store links leading to your non-product pages. Metric. */
191
+ clicks?: string;
192
+ /** Click-through rate - the number of clicks (`clicks`) divided by the number of impressions (`impressions`) of images and online store links leading to your non-product pages. Metric. */
193
+ clickThroughRate?: number;
194
+ /** Date in the merchant timezone to which metrics apply. Segment. Condition on `date` is required in the `WHERE` clause. */
195
+ date?: Date;
196
+ /** Number of times images and online store links leading to your non-product pages were shown. Metric. */
197
+ impressions?: string;
198
+ /** First day of the week (Monday) of the metrics date in the merchant timezone. Segment. */
199
+ week?: Date;
200
+ }
201
+ interface Price {
202
+ /** The price represented as a number in micros (1 million micros is an equivalent to one's currency standard unit, for example, 1 USD = 1000000 micros). */
203
+ amountMicros?: string;
204
+ /** The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217). */
205
+ currencyCode?: string;
206
+ }
207
+ interface PriceCompetitivenessProductView {
208
+ /** Latest available price benchmark for the product's catalog in the benchmark country. */
209
+ benchmarkPrice?: Price;
210
+ /** Brand of the product. */
211
+ brand?: string;
212
+ /** Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
213
+ categoryL1?: string;
214
+ /** Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
215
+ categoryL2?: string;
216
+ /** Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
217
+ categoryL3?: string;
218
+ /** Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
219
+ categoryL4?: string;
220
+ /** Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
221
+ categoryL5?: string;
222
+ /** REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Can be used to join data with the `product_view` table. Required in the `SELECT` clause. */
223
+ id?: string;
224
+ /** Merchant-provided id of the product. */
225
+ offerId?: string;
226
+ /** Current price of the product. */
227
+ price?: Price;
228
+ /** Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
229
+ productTypeL1?: string;
230
+ /** Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
231
+ productTypeL2?: string;
232
+ /** Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
233
+ productTypeL3?: string;
234
+ /** Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
235
+ productTypeL4?: string;
236
+ /** Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
237
+ productTypeL5?: string;
238
+ /** Country of the price benchmark. Represented in the ISO 3166 format. Required in the `SELECT` clause. */
239
+ reportCountryCode?: string;
240
+ /** Title of the product. */
241
+ title?: string;
242
+ }
243
+ interface PriceInsightsProductView {
244
+ /** Brand of the product. */
245
+ brand?: string;
246
+ /** Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
247
+ categoryL1?: string;
248
+ /** Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
249
+ categoryL2?: string;
250
+ /** Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
251
+ categoryL3?: string;
252
+ /** Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
253
+ categoryL4?: string;
254
+ /** Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
255
+ categoryL5?: string;
256
+ /** The predicted effectiveness of applying the price suggestion, bucketed. */
257
+ effectiveness?: string;
258
+ /** REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Can be used to join data with the `product_view` table. Required in the `SELECT` clause. */
259
+ id?: string;
260
+ /** Merchant-provided id of the product. */
261
+ offerId?: string;
262
+ /** Predicted change in clicks as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in clicks. */
263
+ predictedClicksChangeFraction?: number;
264
+ /** Predicted change in conversions as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in conversions). */
265
+ predictedConversionsChangeFraction?: number;
266
+ /** Predicted change in impressions as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in impressions. */
267
+ predictedImpressionsChangeFraction?: number;
268
+ /** Current price of the product. */
269
+ price?: Price;
270
+ /** Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
271
+ productTypeL1?: string;
272
+ /** Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
273
+ productTypeL2?: string;
274
+ /** Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
275
+ productTypeL3?: string;
276
+ /** Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
277
+ productTypeL4?: string;
278
+ /** Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
279
+ productTypeL5?: string;
280
+ /** Latest suggested price for the product. */
281
+ suggestedPrice?: Price;
282
+ /** Title of the product. */
283
+ title?: string;
284
+ }
285
+ interface ProductChange {
286
+ /** 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`, ``) */
287
+ newValue?: string;
288
+ /** 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`, ``) */
289
+ oldValue?: string;
290
+ /** Countries that have the change (if applicable). Represented in the ISO 3166 format. */
291
+ regionCode?: string;
292
+ /** 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) */
293
+ reportingContext?: string;
294
+ }
295
+ interface ProductPerformanceView {
296
+ /** Brand of the product. Segment. */
297
+ brand?: string;
298
+ /** [Product category (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment. */
299
+ categoryL1?: string;
300
+ /** [Product category (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment. */
301
+ categoryL2?: string;
302
+ /** [Product category (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment. */
303
+ categoryL3?: string;
304
+ /** [Product category (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment. */
305
+ categoryL4?: string;
306
+ /** [Product category (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in Google's product taxonomy. Segment. */
307
+ categoryL5?: string;
308
+ /** Number of clicks. Metric. */
309
+ clicks?: string;
310
+ /** Click-through rate - the number of clicks merchant's products receive (clicks) divided by the number of times the products are shown (impressions). Metric. */
311
+ clickThroughRate?: number;
312
+ /** Number of conversions divided by the number of clicks, reported on the impression date. Metric. Available only for the `FREE` traffic source. */
313
+ conversionRate?: number;
314
+ /** Number of conversions attributed to the product, reported on the conversion date. Depending on the attribution model, a conversion might be distributed across multiple clicks, where each click gets its own credit assigned. This metric is a sum of all such credits. Metric. Available only for the `FREE` traffic source. */
315
+ conversions?: number;
316
+ /** Value of conversions attributed to the product, reported on the conversion date. Metric. Available only for the `FREE` traffic source. */
317
+ conversionValue?: Price;
318
+ /** Code of the country where the customer is located at the time of the event. Represented in the ISO 3166 format. Segment. If the customer country cannot be determined, a special 'ZZ' code is returned. */
319
+ customerCountryCode?: string;
320
+ /** Custom label 0 for custom grouping of products. Segment. */
321
+ customLabel0?: string;
322
+ /** Custom label 1 for custom grouping of products. Segment. */
323
+ customLabel1?: string;
324
+ /** Custom label 2 for custom grouping of products. Segment. */
325
+ customLabel2?: string;
326
+ /** Custom label 3 for custom grouping of products. Segment. */
327
+ customLabel3?: string;
328
+ /** Custom label 4 for custom grouping of products. Segment. */
329
+ customLabel4?: string;
330
+ /** Date in the merchant timezone to which metrics apply. Segment. Condition on `date` is required in the `WHERE` clause. */
331
+ date?: Date;
332
+ /** Number of times merchant's products are shown. Metric. */
333
+ impressions?: string;
334
+ /** Marketing method to which metrics apply. Segment. */
335
+ marketingMethod?: string;
336
+ /** Merchant-provided id of the product. Segment. */
337
+ offerId?: string;
338
+ /** [Product type (1st level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment. */
339
+ productTypeL1?: string;
340
+ /** [Product type (2nd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment. */
341
+ productTypeL2?: string;
342
+ /** [Product type (3rd level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment. */
343
+ productTypeL3?: string;
344
+ /** [Product type (4th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment. */
345
+ productTypeL4?: string;
346
+ /** [Product type (5th level)](https://developers.google.com/shopping-content/guides/reports/segmentation#category_and_product_type) in merchant's own product taxonomy. Segment. */
347
+ productTypeL5?: string;
348
+ /** Title of the product. Segment. */
349
+ title?: string;
350
+ /** First day of the week (Monday) of the metrics date in the merchant timezone. Segment. */
351
+ week?: Date;
352
+ }
353
+ interface ProductStatusChangeMessage {
354
+ /** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
355
+ account?: string;
356
+ /** The attribute in the resource that changed, in this case it will be always `Status`. */
357
+ attribute?: string;
358
+ /** A message to describe the change that happened to the product */
359
+ changes?: ProductChange[];
360
+ /** 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. */
361
+ eventTime?: string;
362
+ /** Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event. */
363
+ expirationTime?: string;
364
+ /** 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}` */
365
+ managingAccount?: string;
366
+ /** The product name. Format: `accounts/{account}/products/{product}` */
367
+ resource?: string;
368
+ /** The product id. */
369
+ resourceId?: string;
370
+ /** The resource that changed, in this case it will always be `Product`. */
371
+ resourceType?: string;
372
+ }
373
+ interface ProductView {
374
+ /** Aggregated status. */
375
+ aggregatedReportingContextStatus?: string;
376
+ /** [Availability](https://support.google.com/merchants/answer/6324448) of the product. */
377
+ availability?: string;
378
+ /** Brand of the product. */
379
+ brand?: string;
380
+ /** Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
381
+ categoryL1?: string;
382
+ /** Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
383
+ categoryL2?: string;
384
+ /** Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
385
+ categoryL3?: string;
386
+ /** Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
387
+ categoryL4?: string;
388
+ /** Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). */
389
+ categoryL5?: string;
390
+ /** Channel of the product. Can be `ONLINE` or `LOCAL`. */
391
+ channel?: string;
392
+ /** Estimated performance potential compared to highest performing products of the merchant. */
393
+ clickPotential?: string;
394
+ /** Rank of the product based on its click potential. A product with `click_potential_rank` 1 has the highest click potential among the merchant's products that fulfill the search query conditions. */
395
+ clickPotentialRank?: string;
396
+ /** [Condition](https://support.google.com/merchants/answer/6324469) of the product. */
397
+ condition?: string;
398
+ /** The time the merchant created the product in timestamp seconds. */
399
+ creationTime?: string;
400
+ /** Expiration date for the product, specified on insertion. */
401
+ expirationDate?: Date;
402
+ /** Feed label of the product. */
403
+ feedLabel?: string;
404
+ /** List of Global Trade Item Numbers (GTINs) of the product. */
405
+ gtin?: string[];
406
+ /** REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Merchant API methods that operate on products take this as their `name` parameter. Required in the `SELECT` clause. */
407
+ id?: string;
408
+ /** Item group id provided by the merchant for grouping variants together. */
409
+ itemGroupId?: string;
410
+ /** List of item issues for the product. **This field cannot be used for sorting the results.** **Only selected attributes of this field (for example, `item_issues.severity.aggregated_severity`) can be used for filtering the results.** */
411
+ itemIssues?: ItemIssue[];
412
+ /** Language code of the product in BCP 47 format. */
413
+ languageCode?: string;
414
+ /** Merchant-provided id of the product. */
415
+ offerId?: string;
416
+ /** Product price. Absent if the information about the price of the product is not available. */
417
+ price?: Price;
418
+ /** Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
419
+ productTypeL1?: string;
420
+ /** Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
421
+ productTypeL2?: string;
422
+ /** Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
423
+ productTypeL3?: string;
424
+ /** Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
425
+ productTypeL4?: string;
426
+ /** Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406). */
427
+ productTypeL5?: string;
428
+ /** Normalized [shipping label](https://support.google.com/merchants/answer/6324504) specified in the data source. */
429
+ shippingLabel?: string;
430
+ /** Link to the processed image of the product, hosted on the Google infrastructure. */
431
+ thumbnailLink?: string;
432
+ /** Title of the product. */
433
+ title?: string;
434
+ }
435
+ interface ReportRow {
436
+ /** Fields available for query in `best_sellers_brand_view` table. */
437
+ bestSellersBrandView?: BestSellersBrandView;
438
+ /** Fields available for query in `best_sellers_product_cluster_view` table. */
439
+ bestSellersProductClusterView?: BestSellersProductClusterView;
440
+ /** Fields available for query in `competitive_visibility_benchmark_view` table. */
441
+ competitiveVisibilityBenchmarkView?: CompetitiveVisibilityBenchmarkView;
442
+ /** Fields available for query in `competitive_visibility_competitor_view` table. */
443
+ competitiveVisibilityCompetitorView?: CompetitiveVisibilityCompetitorView;
444
+ /** Fields available for query in `competitive_visibility_top_merchant_view` table. */
445
+ competitiveVisibilityTopMerchantView?: CompetitiveVisibilityTopMerchantView;
446
+ /** Fields available for query in `non_product_performance_view` table. */
447
+ nonProductPerformanceView?: NonProductPerformanceView;
448
+ /** Fields available for query in `price_competitiveness_product_view` table. */
449
+ priceCompetitivenessProductView?: PriceCompetitivenessProductView;
450
+ /** Fields available for query in `price_insights_product_view` table. */
451
+ priceInsightsProductView?: PriceInsightsProductView;
452
+ /** Fields available for query in `product_performance_view` table. */
453
+ productPerformanceView?: ProductPerformanceView;
454
+ /** Fields available for query in `product_view` table. */
455
+ productView?: ProductView;
456
+ }
457
+ interface SearchRequest {
458
+ /** Optional. Number of `ReportRows` to retrieve in a single page. Defaults to 1000. Values above 5000 are coerced to 5000. */
459
+ pageSize?: number;
460
+ /** Optional. Token of the page to retrieve. If not specified, the first page of results is returned. In order to request the next page of results, the value obtained from `next_page_token` in the previous response should be used. */
461
+ pageToken?: string;
462
+ /** Required. Query that defines a report to be retrieved. For details on how to construct your query, see the [Query Language guide](/merchant/api/guides/reports/query-language). For the full list of available tables and fields, see the [Available fields](/merchant/api/reference/rest/reports_v1beta/accounts.reports). */
463
+ query?: string;
464
+ }
465
+ interface SearchResponse {
466
+ /** Token which can be sent as `page_token` to retrieve the next page. If omitted, there are no subsequent pages. */
467
+ nextPageToken?: string;
468
+ /** Rows that matched the search query. */
469
+ results?: ReportRow[];
470
+ }
471
+ interface ReportsResource {
472
+ /** Retrieves a report defined by a search query. The response might contain fewer rows than specified by `page_size`. Rely on `next_page_token` to determine if there are more rows to be requested. */
473
+ search(request: {
474
+ /** V1 error format. */
475
+ '$.xgafv'?: string;
476
+ /** OAuth access token. */
477
+ access_token?: string;
478
+ /** Data format for response. */
479
+ alt?: string;
480
+ /** JSONP */
481
+ callback?: string;
482
+ /** Selector specifying which fields to include in a partial response. */
483
+ fields?: string;
484
+ /** 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. */
485
+ key?: string;
486
+ /** OAuth 2.0 token for the current user. */
487
+ oauth_token?: string;
488
+ /** Required. Id of the account making the call. Must be a standalone account or an MCA subaccount. Format: accounts/{account} */
489
+ parent: string;
490
+ /** Returns response with indentations and line breaks. */
491
+ prettyPrint?: boolean;
492
+ /** 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. */
493
+ quotaUser?: string;
494
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
495
+ upload_protocol?: string;
496
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
497
+ uploadType?: string;
498
+ /** Request body */
499
+ resource: SearchRequest;
500
+ }): Request<SearchResponse>;
501
+ search(
502
+ request: {
503
+ /** V1 error format. */
504
+ '$.xgafv'?: string;
505
+ /** OAuth access token. */
506
+ access_token?: string;
507
+ /** Data format for response. */
508
+ alt?: string;
509
+ /** JSONP */
510
+ callback?: string;
511
+ /** Selector specifying which fields to include in a partial response. */
512
+ fields?: string;
513
+ /** 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. */
514
+ key?: string;
515
+ /** OAuth 2.0 token for the current user. */
516
+ oauth_token?: string;
517
+ /** Required. Id of the account making the call. Must be a standalone account or an MCA subaccount. Format: accounts/{account} */
518
+ parent: string;
519
+ /** Returns response with indentations and line breaks. */
520
+ prettyPrint?: boolean;
521
+ /** 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. */
522
+ quotaUser?: string;
523
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
524
+ upload_protocol?: string;
525
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
526
+ uploadType?: string;
527
+ },
528
+ body: SearchRequest,
529
+ ): Request<SearchResponse>;
530
+ }
531
+ interface AccountsResource {
532
+ reports: ReportsResource;
533
+ }
534
+
535
+ const accounts: AccountsResource;
536
+ }
537
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.merchantapi-reports_v1",
3
+ "version": "0.0.20250804",
4
+ "description": "TypeScript typings for Merchant API reports_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 reports_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-reports_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=reports_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', 'reports_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
+ ```