@maxim_mazurok/gapi.client.merchantapi-ordertracking_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 +236 -0
  2. package/package.json +20 -0
  3. package/readme.md +73 -0
package/index.d.ts ADDED
@@ -0,0 +1,236 @@
1
+ /* Type definitions for non-npm package Merchant API ordertracking_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=ordertracking_v1
12
+ // Revision: 20250804
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Merchant API ordertracking_v1 */
18
+ function load(
19
+ urlOrObject: 'https://merchantapi.googleapis.com/$discovery/rest?version=ordertracking_v1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(
23
+ name: 'merchantapi',
24
+ version: 'ordertracking_v1',
25
+ ): Promise<void>;
26
+ /** @deprecated Please load APIs with discovery documents. */
27
+ function load(
28
+ name: 'merchantapi',
29
+ version: 'ordertracking_v1',
30
+ callback: () => any,
31
+ ): void;
32
+
33
+ namespace merchantapi {
34
+ interface DateTime {
35
+ /** Optional. Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a datetime without a day. */
36
+ day?: number;
37
+ /** Optional. Hours of day in 24 hour format. Should be from 0 to 23, defaults to 0 (midnight). An API may choose to allow the value "24:00:00" for scenarios like business closing time. */
38
+ hours?: number;
39
+ /** Optional. Minutes of hour of day. Must be from 0 to 59, defaults to 0. */
40
+ minutes?: number;
41
+ /** Optional. Month of year. Must be from 1 to 12, or 0 if specifying a datetime without a month. */
42
+ month?: number;
43
+ /** Optional. Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999, defaults to 0. */
44
+ nanos?: number;
45
+ /** Optional. Seconds of minutes of the time. Must normally be from 0 to 59, defaults to 0. An API may allow the value 60 if it allows leap-seconds. */
46
+ seconds?: number;
47
+ /** Time zone. */
48
+ timeZone?: TimeZone;
49
+ /** UTC offset. Must be whole seconds, between -18 hours and +18 hours. For example, a UTC offset of -4:00 would be represented as { seconds: -14400 }. */
50
+ utcOffset?: string;
51
+ /** Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a datetime without a year. */
52
+ year?: number;
53
+ }
54
+ interface LineItemDetails {
55
+ /** Optional. Brand of the product. */
56
+ brand?: string;
57
+ /** Optional. The Global Trade Item Number. */
58
+ gtin?: string;
59
+ /** Required. The ID for this line item. */
60
+ lineItemId?: string;
61
+ /** Optional. The manufacturer part number. */
62
+ mpn?: string;
63
+ /** Required. The Content API REST ID of the product, in the form channel:contentLanguage:targetCountry:offerId. */
64
+ productId?: string;
65
+ /** Optional. Plain text title of this product. */
66
+ productTitle?: string;
67
+ /** Required. The quantity of the line item in the order. */
68
+ quantity?: string;
69
+ }
70
+ interface OrderTrackingSignal {
71
+ /** Optional. The shipping fee of the order; this value should be set to zero in the case of free shipping. */
72
+ customerShippingFee?: Price;
73
+ /** Optional. The delivery postal code, as a continuous string without spaces or dashes, for example "95016". This field will be anonymized in returned OrderTrackingSignal creation response. */
74
+ deliveryPostalCode?: string;
75
+ /** Optional. The [CLDR territory code] (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) for the shipping destination. */
76
+ deliveryRegionCode?: string;
77
+ /** Required. Information about line items in the order. */
78
+ lineItems?: LineItemDetails[];
79
+ /** Optional. The Google Merchant Center ID of this order tracking signal. This value is optional. If left unset, the caller's Merchant Center ID is used. You must request access in order to provide data on behalf of another business. For more information, see [Submitting Order Tracking Signals](/shopping-content/guides/order-tracking-signals). */
80
+ merchantId?: string;
81
+ /** Required. The time when the order was created on the businesses side. Include the year and timezone string, if available. */
82
+ orderCreatedTime?: DateTime;
83
+ /** Required. The ID of the order on the businesses side. This field will be hashed in returned OrderTrackingSignal creation response. */
84
+ orderId?: string;
85
+ /** Output only. The ID that uniquely identifies this order tracking signal. */
86
+ orderTrackingSignalId?: string;
87
+ /** Optional. The mapping of the line items to the shipment information. */
88
+ shipmentLineItemMapping?: ShipmentLineItemMapping[];
89
+ /** Required. The shipping information for the order. */
90
+ shippingInfo?: ShippingInfo[];
91
+ }
92
+ interface Price {
93
+ /** 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). */
94
+ amountMicros?: string;
95
+ /** The currency of the price using three-letter acronyms according to [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217). */
96
+ currencyCode?: string;
97
+ }
98
+ interface ProductChange {
99
+ /** 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`, ``) */
100
+ newValue?: string;
101
+ /** 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`, ``) */
102
+ oldValue?: string;
103
+ /** Countries that have the change (if applicable). Represented in the ISO 3166 format. */
104
+ regionCode?: string;
105
+ /** 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) */
106
+ reportingContext?: string;
107
+ }
108
+ interface ProductStatusChangeMessage {
109
+ /** The target account that owns the entity that changed. Format : `accounts/{merchant_id}` */
110
+ account?: string;
111
+ /** The attribute in the resource that changed, in this case it will be always `Status`. */
112
+ attribute?: string;
113
+ /** A message to describe the change that happened to the product */
114
+ changes?: ProductChange[];
115
+ /** 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. */
116
+ eventTime?: string;
117
+ /** Optional. The product expiration time. This field will not be set if the notification is sent for a product deletion event. */
118
+ expirationTime?: string;
119
+ /** 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}` */
120
+ managingAccount?: string;
121
+ /** The product name. Format: `accounts/{account}/products/{product}` */
122
+ resource?: string;
123
+ /** The product id. */
124
+ resourceId?: string;
125
+ /** The resource that changed, in this case it will always be `Product`. */
126
+ resourceType?: string;
127
+ }
128
+ interface ShipmentLineItemMapping {
129
+ /** Required. The line item ID. */
130
+ lineItemId?: string;
131
+ /** Required. The line item quantity in the shipment. */
132
+ quantity?: string;
133
+ /** Required. The shipment ID. This field will be hashed in returned OrderTrackingSignal creation response. */
134
+ shipmentId?: string;
135
+ }
136
+ interface ShippingInfo {
137
+ /** Optional. The time when the shipment was actually delivered. Include the year and timezone string, if available. This field is required, if one of the following fields is absent: tracking_id or carrier_name. */
138
+ actualDeliveryTime?: DateTime;
139
+ /** Optional. The name of the shipping carrier for the delivery. This field is required if one of the following fields is absent: earliest_delivery_promise_time, latest_delivery_promise_time, and actual_delivery_time. */
140
+ carrier?: string;
141
+ /** Optional. The service type for fulfillment, such as GROUND, FIRST_CLASS, etc. */
142
+ carrierService?: string;
143
+ /** Optional. The earliest delivery promised time. Include the year and timezone string, if available. This field is required, if one of the following fields is absent: tracking_id or carrier_name. */
144
+ earliestDeliveryPromiseTime?: DateTime;
145
+ /** Optional. The latest delivery promised time. Include the year and timezone string, if available. This field is required, if one of the following fields is absent: tracking_id or carrier_name. */
146
+ latestDeliveryPromiseTime?: DateTime;
147
+ /** Required. The origin postal code, as a continuous string without spaces or dashes, for example "95016". This field will be anonymized in returned OrderTrackingSignal creation response. */
148
+ originPostalCode?: string;
149
+ /** Required. The [CLDR territory code] (http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) for the shipping origin. */
150
+ originRegionCode?: string;
151
+ /** Required. The shipment ID. This field will be hashed in returned OrderTrackingSignal creation response. */
152
+ shipmentId?: string;
153
+ /** Optional. The time when the shipment was shipped. Include the year and timezone string, if available. */
154
+ shippedTime?: DateTime;
155
+ /** Required. The status of the shipment. */
156
+ shippingStatus?: string;
157
+ /** Optional. The tracking ID of the shipment. This field is required if one of the following fields is absent: earliest_delivery_promise_time, latest_delivery_promise_time, and actual_delivery_time. */
158
+ trackingId?: string;
159
+ }
160
+ interface TimeZone {
161
+ /** IANA Time Zone Database time zone. For example "America/New_York". */
162
+ id?: string;
163
+ /** Optional. IANA Time Zone Database version number. For example "2019a". */
164
+ version?: string;
165
+ }
166
+ interface OrderTrackingSignalsResource {
167
+ /** Creates new order tracking signal. */
168
+ create(request: {
169
+ /** V1 error format. */
170
+ '$.xgafv'?: string;
171
+ /** OAuth access token. */
172
+ access_token?: string;
173
+ /** Data format for response. */
174
+ alt?: string;
175
+ /** JSONP */
176
+ callback?: string;
177
+ /** Selector specifying which fields to include in a partial response. */
178
+ fields?: string;
179
+ /** 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. */
180
+ key?: string;
181
+ /** OAuth 2.0 token for the current user. */
182
+ oauth_token?: string;
183
+ /** Output only. The ID that uniquely identifies this order tracking signal. */
184
+ orderTrackingSignalId?: string;
185
+ /** Required. The account of the business for which the order signal is created. Format: accounts/{account} */
186
+ parent: string;
187
+ /** Returns response with indentations and line breaks. */
188
+ prettyPrint?: boolean;
189
+ /** 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. */
190
+ quotaUser?: string;
191
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
192
+ upload_protocol?: string;
193
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
194
+ uploadType?: string;
195
+ /** Request body */
196
+ resource: OrderTrackingSignal;
197
+ }): Request<OrderTrackingSignal>;
198
+ create(
199
+ request: {
200
+ /** V1 error format. */
201
+ '$.xgafv'?: string;
202
+ /** OAuth access token. */
203
+ access_token?: string;
204
+ /** Data format for response. */
205
+ alt?: string;
206
+ /** JSONP */
207
+ callback?: string;
208
+ /** Selector specifying which fields to include in a partial response. */
209
+ fields?: string;
210
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
211
+ key?: string;
212
+ /** OAuth 2.0 token for the current user. */
213
+ oauth_token?: string;
214
+ /** Output only. The ID that uniquely identifies this order tracking signal. */
215
+ orderTrackingSignalId?: string;
216
+ /** Required. The account of the business for which the order signal is created. Format: accounts/{account} */
217
+ parent: string;
218
+ /** Returns response with indentations and line breaks. */
219
+ prettyPrint?: boolean;
220
+ /** 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. */
221
+ quotaUser?: string;
222
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
223
+ upload_protocol?: string;
224
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
225
+ uploadType?: string;
226
+ },
227
+ body: OrderTrackingSignal,
228
+ ): Request<OrderTrackingSignal>;
229
+ }
230
+ interface AccountsResource {
231
+ orderTrackingSignals: OrderTrackingSignalsResource;
232
+ }
233
+
234
+ const accounts: AccountsResource;
235
+ }
236
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.merchantapi-ordertracking_v1",
3
+ "version": "0.0.20250804",
4
+ "description": "TypeScript typings for Merchant API ordertracking_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 ordertracking_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-ordertracking_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=ordertracking_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', 'ordertracking_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
+ ```