ebay-mcp 1.13.2 → 1.14.0
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/README.de.md +3 -3
- package/README.es.md +3 -3
- package/README.fr.md +3 -3
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +163 -41
- package/README.pt-BR.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh-CN.md +3 -3
- package/build/api/account-management/account.js +633 -297
- package/build/api/analytics-and-report/analytics.js +111 -65
- package/build/api/client.js +199 -140
- package/build/api/clientRequestError.js +23 -0
- package/build/api/clientTrading.js +213 -0
- package/build/api/clientTradingError.js +4 -0
- package/build/api/communication/feedback.js +147 -59
- package/build/api/communication/message.js +134 -81
- package/build/api/communication/negotiation.js +65 -53
- package/build/api/communication/notification.js +458 -164
- package/build/api/developer/developer.js +99 -45
- package/build/api/index.js +23 -8
- package/build/api/listing-management/inventory.js +884 -338
- package/build/api/listing-metadata/metadata.js +416 -170
- package/build/api/listing-metadata/taxonomy.js +187 -42
- package/build/api/marketing-and-promotions/marketing.js +1392 -598
- package/build/api/marketing-and-promotions/recommendation.js +49 -24
- package/build/api/order-management/dispute.js +226 -45
- package/build/api/order-management/fulfillment.js +144 -71
- package/build/api/order-management/orderIssueHelpers.js +61 -0
- package/build/api/other/compliance.js +50 -38
- package/build/api/other/edelivery.js +603 -159
- package/build/api/other/finding.js +280 -0
- package/build/api/other/identity.js +30 -15
- package/build/api/other/translation.js +29 -14
- package/build/api/other/vero.js +113 -27
- package/build/api/rateLimitTracker.js +55 -0
- package/build/api/shared/request.js +189 -98
- package/build/api/trading/trading.js +154 -87
- package/build/auth/credentialSession.js +250 -0
- package/build/auth/oauth.js +298 -171
- package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
- package/build/auth/oauthMiddleware.js +104 -0
- package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
- package/build/auth/tokenVerifier.js +243 -0
- package/build/auth/tokenVerifierError.js +21 -0
- package/build/config/environment.js +148 -113
- package/build/config/{tool-families.js → toolFamilies.js} +30 -14
- package/build/index.js +25 -19
- package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
- package/build/mcp/readOnlyFilter.js +67 -0
- package/build/mcp/runtime.js +31 -13
- package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
- package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
- package/build/schemas/account-management/account.js +144 -6
- package/build/schemas/analytics/analytics.js +33 -19
- package/build/schemas/communication/messages.js +12 -42
- package/build/schemas/developer/developer.js +135 -0
- package/build/schemas/fulfillment/orders.js +183 -21
- package/build/schemas/index.js +27 -19
- package/build/schemas/inventory-management/inventory.js +17 -9
- package/build/schemas/marketing/marketing.js +480 -25
- package/build/schemas/metadata/metadata.js +11 -6
- package/build/schemas/other/finding.js +27 -0
- package/build/schemas/other/otherApis.js +424 -0
- package/build/schemas/taxonomy/taxonomy.js +11 -5
- package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
- package/build/scripts/{build-ui.js → buildUi.js} +6 -1
- package/build/scripts/{dev-sync.js → devSync.js} +169 -110
- package/build/scripts/diagnostics.js +52 -44
- package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
- package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
- package/build/scripts/setup.js +241 -178
- package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
- package/build/scripts/skills.js +35 -27
- package/build/scripts/updateApiStatusDoc.js +71 -0
- package/build/serverHttp.js +90 -0
- package/build/skills/content.js +124 -118
- package/build/skills/index.js +22 -10
- package/build/skills/install.js +21 -10
- package/build/skills/markers.js +50 -15
- package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
- package/build/skills/render.js +41 -14
- package/build/skills/targets.js +49 -17
- package/build/tools/categories/account.js +166 -264
- package/build/tools/categories/analytics.js +11 -22
- package/build/tools/categories/browse.js +17 -0
- package/build/tools/categories/communication.js +124 -399
- package/build/tools/categories/connector.js +23 -20
- package/build/tools/categories/developer.js +46 -159
- package/build/tools/categories/fulfillment.js +84 -215
- package/build/tools/categories/index.js +6 -14
- package/build/tools/categories/inventory.js +238 -293
- package/build/tools/categories/marketing.js +677 -39
- package/build/tools/categories/metadata.js +190 -117
- package/build/tools/categories/other.js +81 -208
- package/build/tools/categories/taxonomy.js +29 -20
- package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
- package/build/tools/categories/trading.js +16 -47
- package/build/tools/contracts.js +34 -24
- package/build/tools/{define-tool.js → defineTool.js} +44 -29
- package/build/tools/registry.js +87 -29
- package/build/tools/schemas.js +3 -57
- package/build/tools/ui/archetypes.js +1 -0
- package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
- package/build/tools/ui/maps.js +294 -80
- package/build/types/index.js +1 -1
- package/build/ui/card.html +14 -14
- package/build/ui/chart.html +14 -14
- package/build/ui/stat.html +87 -0
- package/build/ui/table.html +14 -14
- package/build/utils/apiStatusFeed.js +95 -0
- package/build/utils/cliOutput.js +15 -0
- package/build/utils/cliUi.js +108 -0
- package/build/utils/communication/feedback.js +57 -77
- package/build/utils/communication/message.js +69 -98
- package/build/utils/communication/negotiation.js +30 -57
- package/build/utils/communication/notification.js +112 -252
- package/build/utils/{date-converter.js → dateConverter.js} +62 -30
- package/build/utils/effectSchema.js +203 -0
- package/build/utils/effectSchemaAdapter.js +121 -0
- package/build/utils/effectSchemaChainMethods.js +146 -0
- package/build/utils/effectSchemaRefinements.js +104 -0
- package/build/utils/effectSchemaStringMethods.js +63 -0
- package/build/utils/effectSchemaTypes.js +47 -0
- package/build/utils/{env-parser.js → envParser.js} +10 -2
- package/build/utils/errors.js +7 -3
- package/build/utils/http.js +148 -89
- package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
- package/build/utils/logger.js +127 -51
- package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
- package/build/utils/other/compliance.js +18 -38
- package/build/utils/other/identity.js +2 -2
- package/build/utils/other/translation.js +4 -4
- package/build/utils/other/vero.js +36 -20
- package/build/utils/schemaHelpers.js +22 -0
- package/build/utils/scopeHelper.js +270 -0
- package/build/utils/securityChecker.js +316 -0
- package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
- package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
- package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
- package/build/utils/trading/trading.js +35 -0
- package/build/utils/typeGuards.js +12 -0
- package/build/utils/version.js +65 -29
- package/package.json +10 -8
- package/build/api/client-trading.js +0 -124
- package/build/api/communication/shared.js +0 -59
- package/build/api/shared/query-params.js +0 -16
- package/build/auth/credential-session.js +0 -166
- package/build/auth/oauth-middleware.js +0 -100
- package/build/auth/token-verifier.js +0 -186
- package/build/schemas/other/other-apis.js +0 -390
- package/build/scripts/update-api-status-doc.js +0 -44
- package/build/server-http.js +0 -85
- package/build/tools/definitions/marketing.js +0 -1381
- package/build/tools/tool-handlers/marketing.js +0 -312
- package/build/utils/account-management/account.js +0 -818
- package/build/utils/api-status-feed.js +0 -84
- package/build/utils/cli-ui.js +0 -47
- package/build/utils/order-management/dispute.js +0 -369
- package/build/utils/order-management/fulfillment.js +0 -205
- package/build/utils/other/edelivery.js +0 -235
- package/build/utils/schema-helpers.js +0 -13
- package/build/utils/scope-helper.js +0 -207
- package/build/utils/security-checker.js +0 -248
- package/build/utils/type-guards.js +0 -6
- /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
- /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
- /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
- /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Based on: docs/sell-apps/other-apis/sell_edelivery_international_shipping_oas3.json
|
|
5
|
-
*/
|
|
1
|
+
import { buildEndpointParams, optionalNonNegativeNumberEffect, optionalPositiveNumberEffect, optionalStringEffect, requestDeleteEffect, requestGetEffect, requestPostEffect, requireObjectEffect, requireStringEffect, } from '../../api/shared/request.js';
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
/** eDelivery International Shipping API endpoints. */
|
|
6
4
|
export class EDeliveryApi {
|
|
7
5
|
client;
|
|
8
6
|
basePath = '/sell/logistics/v1';
|
|
@@ -10,211 +8,657 @@ export class EDeliveryApi {
|
|
|
10
8
|
this.client = client;
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
13
|
-
*
|
|
11
|
+
* Retrieves actual package weights and costs by tracking numbers or transaction time range.
|
|
12
|
+
*
|
|
13
|
+
* @param input - Optional tracking-number or transaction-time filters.
|
|
14
|
+
* @returns An Effect that succeeds with eBay's GetActualCostResponses.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const costs = await Effect.runPromise(
|
|
19
|
+
* edeliveryApi.getActualCosts({ trackingNumbers: 'ES000000001' }),
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/actual_costs/methods/getActualCosts
|
|
14
24
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
getActualCosts = (input = {}) => {
|
|
26
|
+
const client = this.client;
|
|
27
|
+
const path = `${this.basePath}/actual_costs`;
|
|
28
|
+
return Effect.gen(function* () {
|
|
29
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
30
|
+
const trackingNumbers = yield* optionalStringEffect(validatedInput.trackingNumbers, 'trackingNumbers');
|
|
31
|
+
const transactionBeginTime = yield* optionalStringEffect(validatedInput.transactionBeginTime, 'transactionBeginTime');
|
|
32
|
+
const transactionEndTime = yield* optionalStringEffect(validatedInput.transactionEndTime, 'transactionEndTime');
|
|
33
|
+
const params = buildEndpointParams({
|
|
34
|
+
trackingNumbers: { wireName: 'tracking_numbers', value: trackingNumbers },
|
|
35
|
+
transactionBeginTime: { wireName: 'trans_begin_time', value: transactionBeginTime },
|
|
36
|
+
transactionEndTime: { wireName: 'trans_end_time', value: transactionEndTime },
|
|
37
|
+
});
|
|
38
|
+
return yield* requestGetEffect(client, path, params);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
18
41
|
/**
|
|
19
|
-
*
|
|
42
|
+
* Retrieves saved ship-from address preferences.
|
|
43
|
+
*
|
|
44
|
+
* @param input - Empty endpoint input object.
|
|
45
|
+
* @returns An Effect that succeeds with eBay's GetAddressPreferenceListResponses.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const preferences = await Effect.runPromise(edeliveryApi.getAddressPreferences({}));
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/address_preference/methods/getAddressPreferences
|
|
20
53
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
54
|
+
getAddressPreferences = (input = {}) => {
|
|
55
|
+
void input;
|
|
56
|
+
return requestGetEffect(this.client, `${this.basePath}/address_preference`);
|
|
57
|
+
};
|
|
25
58
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
59
|
+
* Creates a ship-from address preference.
|
|
60
|
+
*
|
|
61
|
+
* @param input - Generated CreateAddressPreferenceRequest body.
|
|
62
|
+
* @returns An Effect that succeeds with eBay's CreateAddressPreferenceResponses.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const address = await Effect.runPromise(
|
|
67
|
+
* edeliveryApi.createAddressPreference({ body: { shipFromAddress: {} } }),
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/address_preference/methods/createAddressPreference
|
|
28
72
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
73
|
+
createAddressPreference = (input) => {
|
|
74
|
+
const client = this.client;
|
|
75
|
+
const path = `${this.basePath}/address_preference`;
|
|
76
|
+
return Effect.gen(function* () {
|
|
77
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
78
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
79
|
+
return yield* requestPostEffect(client, path, body);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
32
82
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
83
|
+
* Retrieves saved consign preferences.
|
|
84
|
+
*
|
|
85
|
+
* @param input - Empty endpoint input object.
|
|
86
|
+
* @returns An Effect that succeeds with eBay's GetConsignPreferenceListResponses.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const preferences = await Effect.runPromise(edeliveryApi.getConsignPreferences({}));
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/consign_preference/methods/getConsignPreferences
|
|
35
94
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
95
|
+
getConsignPreferences = (input = {}) => {
|
|
96
|
+
void input;
|
|
97
|
+
return requestGetEffect(this.client, `${this.basePath}/consign_preference`);
|
|
98
|
+
};
|
|
39
99
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
100
|
+
* Creates a consign preference.
|
|
101
|
+
*
|
|
102
|
+
* @param input - Generated CreateConsignPreferenceRequest body.
|
|
103
|
+
* @returns An Effect that succeeds with eBay's CreateConsignPreferenceResponses.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const preference = await Effect.runPromise(
|
|
108
|
+
* edeliveryApi.createConsignPreference({ body: { consignAddress: {} } }),
|
|
109
|
+
* );
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/consign_preference/methods/createConsignPreference
|
|
42
113
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
114
|
+
createConsignPreference = (input) => {
|
|
115
|
+
const client = this.client;
|
|
116
|
+
const path = `${this.basePath}/consign_preference`;
|
|
117
|
+
return Effect.gen(function* () {
|
|
118
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
119
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
120
|
+
return yield* requestPostEffect(client, path, body);
|
|
121
|
+
});
|
|
122
|
+
};
|
|
46
123
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
124
|
+
* Retrieves available shipping agents.
|
|
125
|
+
*
|
|
126
|
+
* @param input - Optional pagination controls.
|
|
127
|
+
* @returns An Effect that succeeds with eBay's GetAgentListResponses.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* const agents = await Effect.runPromise(edeliveryApi.getAgents({ limit: 50 }));
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/agents/methods/getAgents
|
|
49
135
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
136
|
+
getAgents = (input = {}) => {
|
|
137
|
+
const client = this.client;
|
|
138
|
+
const path = `${this.basePath}/agents`;
|
|
139
|
+
return Effect.gen(function* () {
|
|
140
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
141
|
+
const limit = yield* optionalPositiveNumberEffect(validatedInput.limit, 'limit');
|
|
142
|
+
const offset = yield* optionalNonNegativeNumberEffect(validatedInput.offset, 'offset');
|
|
143
|
+
const params = buildEndpointParams({
|
|
144
|
+
limit: { wireName: 'limit', value: limit === undefined ? undefined : String(limit) },
|
|
145
|
+
offset: { wireName: 'offset', value: offset === undefined ? undefined : String(offset) },
|
|
146
|
+
});
|
|
147
|
+
return yield* requestGetEffect(client, path, params);
|
|
148
|
+
});
|
|
149
|
+
};
|
|
53
150
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
151
|
+
* Retrieves available lithium battery qualifications.
|
|
152
|
+
*
|
|
153
|
+
* @param input - Optional pagination controls.
|
|
154
|
+
* @returns An Effect that succeeds with eBay's GetBatteryQualListResponses.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const qualifications = await Effect.runPromise(
|
|
159
|
+
* edeliveryApi.getBatteryQualifications({ limit: 25 }),
|
|
160
|
+
* );
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/battery_qualifications/methods/getBatteryQualifications
|
|
56
164
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
165
|
+
getBatteryQualifications = (input = {}) => {
|
|
166
|
+
const client = this.client;
|
|
167
|
+
const path = `${this.basePath}/battery_qualifications`;
|
|
168
|
+
return Effect.gen(function* () {
|
|
169
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
170
|
+
const limit = yield* optionalPositiveNumberEffect(validatedInput.limit, 'limit');
|
|
171
|
+
const offset = yield* optionalNonNegativeNumberEffect(validatedInput.offset, 'offset');
|
|
172
|
+
const params = buildEndpointParams({
|
|
173
|
+
limit: { wireName: 'limit', value: limit === undefined ? undefined : String(limit) },
|
|
174
|
+
offset: { wireName: 'offset', value: offset === undefined ? undefined : String(offset) },
|
|
175
|
+
});
|
|
176
|
+
return yield* requestGetEffect(client, path, params);
|
|
177
|
+
});
|
|
178
|
+
};
|
|
61
179
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
180
|
+
* Retrieves available drop-off sites.
|
|
181
|
+
*
|
|
182
|
+
* @param input - Optional pagination controls.
|
|
183
|
+
* @returns An Effect that succeeds with eBay's GetDropoffSiteListResponses.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* const sites = await Effect.runPromise(edeliveryApi.getDropoffSites({ offset: 10 }));
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/dropoff_sites/methods/getDropoffSites
|
|
64
191
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
192
|
+
getDropoffSites = (input = {}) => {
|
|
193
|
+
const client = this.client;
|
|
194
|
+
const path = `${this.basePath}/dropoff_sites`;
|
|
195
|
+
return Effect.gen(function* () {
|
|
196
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
197
|
+
const limit = yield* optionalPositiveNumberEffect(validatedInput.limit, 'limit');
|
|
198
|
+
const offset = yield* optionalNonNegativeNumberEffect(validatedInput.offset, 'offset');
|
|
199
|
+
const params = buildEndpointParams({
|
|
200
|
+
limit: { wireName: 'limit', value: limit === undefined ? undefined : String(limit) },
|
|
201
|
+
offset: { wireName: 'offset', value: offset === undefined ? undefined : String(offset) },
|
|
202
|
+
});
|
|
203
|
+
return yield* requestGetEffect(client, path, params);
|
|
204
|
+
});
|
|
205
|
+
};
|
|
68
206
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
207
|
+
* Retrieves available shipping services.
|
|
208
|
+
*
|
|
209
|
+
* @param input - Optional pagination controls.
|
|
210
|
+
* @returns An Effect that succeeds with eBay's GetServiceListResponses.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const services = await Effect.runPromise(edeliveryApi.getServices({ limit: 25 }));
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/services/methods/getServices
|
|
71
218
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
219
|
+
getServices = (input = {}) => {
|
|
220
|
+
const client = this.client;
|
|
221
|
+
const path = `${this.basePath}/services`;
|
|
222
|
+
return Effect.gen(function* () {
|
|
223
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
224
|
+
const limit = yield* optionalPositiveNumberEffect(validatedInput.limit, 'limit');
|
|
225
|
+
const offset = yield* optionalNonNegativeNumberEffect(validatedInput.offset, 'offset');
|
|
226
|
+
const params = buildEndpointParams({
|
|
227
|
+
limit: { wireName: 'limit', value: limit === undefined ? undefined : String(limit) },
|
|
228
|
+
offset: { wireName: 'offset', value: offset === undefined ? undefined : String(offset) },
|
|
229
|
+
});
|
|
230
|
+
return yield* requestGetEffect(client, path, params);
|
|
231
|
+
});
|
|
232
|
+
};
|
|
75
233
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
234
|
+
* Creates a bundle from package tracking numbers.
|
|
235
|
+
*
|
|
236
|
+
* @param input - Generated CreateBundleRequest body.
|
|
237
|
+
* @returns An Effect that succeeds with eBay's CreateBundleResponse.
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```ts
|
|
241
|
+
* const bundle = await Effect.runPromise(
|
|
242
|
+
* edeliveryApi.createBundle({ body: { bundle: { trackingNumbers: 'ES000000001' } } }),
|
|
243
|
+
* );
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/bundle/methods/createBundle
|
|
78
247
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
248
|
+
createBundle = (input) => {
|
|
249
|
+
const client = this.client;
|
|
250
|
+
const path = `${this.basePath}/bundle`;
|
|
251
|
+
return Effect.gen(function* () {
|
|
252
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
253
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
254
|
+
return yield* requestPostEffect(client, path, body);
|
|
255
|
+
});
|
|
256
|
+
};
|
|
82
257
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
258
|
+
* Retrieves a bundle by ID.
|
|
259
|
+
*
|
|
260
|
+
* @param input - Bundle identifier.
|
|
261
|
+
* @returns An Effect that succeeds with eBay's BundleDetailResponse.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```ts
|
|
265
|
+
* const bundle = await Effect.runPromise(edeliveryApi.getBundle({ bundleId: 'BUNDLE123' }));
|
|
266
|
+
* ```
|
|
267
|
+
*
|
|
268
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/bundle/methods/getBundle
|
|
85
269
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
270
|
+
getBundle = (input) => {
|
|
271
|
+
const client = this.client;
|
|
272
|
+
const basePath = this.basePath;
|
|
273
|
+
return Effect.gen(function* () {
|
|
274
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
275
|
+
const bundleId = yield* requireStringEffect(validatedInput.bundleId, 'bundleId');
|
|
276
|
+
return yield* requestGetEffect(client, `${basePath}/bundle/${bundleId}`);
|
|
277
|
+
});
|
|
278
|
+
};
|
|
90
279
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
280
|
+
* Cancels a bundle by ID.
|
|
281
|
+
*
|
|
282
|
+
* @param input - Bundle identifier.
|
|
283
|
+
* @returns An Effect that succeeds when eBay returns no content.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* await Effect.runPromise(edeliveryApi.cancelBundle({ bundleId: 'BUNDLE123' }));
|
|
288
|
+
* ```
|
|
289
|
+
*
|
|
290
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/bundle/methods/cancelBundle
|
|
93
291
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
292
|
+
cancelBundle = (input) => {
|
|
293
|
+
const client = this.client;
|
|
294
|
+
const basePath = this.basePath;
|
|
295
|
+
return Effect.gen(function* () {
|
|
296
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
297
|
+
const bundleId = yield* requireStringEffect(validatedInput.bundleId, 'bundleId');
|
|
298
|
+
return yield* requestPostEffect(client, `${basePath}/bundle/${bundleId}/cancel`);
|
|
299
|
+
});
|
|
300
|
+
};
|
|
97
301
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
302
|
+
* Retrieves the label for a bundle.
|
|
303
|
+
*
|
|
304
|
+
* @param input - Bundle identifier.
|
|
305
|
+
* @returns An Effect that succeeds with eBay's BundleLabelResponse.
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```ts
|
|
309
|
+
* const label = await Effect.runPromise(edeliveryApi.getBundleLabel({ bundleId: 'BUNDLE123' }));
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/bundle/methods/getBundleLabel
|
|
100
313
|
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
314
|
+
getBundleLabel = (input) => {
|
|
315
|
+
const client = this.client;
|
|
316
|
+
const basePath = this.basePath;
|
|
317
|
+
return Effect.gen(function* () {
|
|
318
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
319
|
+
const bundleId = yield* requireStringEffect(validatedInput.bundleId, 'bundleId');
|
|
320
|
+
return yield* requestGetEffect(client, `${basePath}/bundle/${bundleId}/label`);
|
|
321
|
+
});
|
|
322
|
+
};
|
|
104
323
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
324
|
+
* Creates a package.
|
|
325
|
+
*
|
|
326
|
+
* @param input - Generated AddPackageRequest body.
|
|
327
|
+
* @returns An Effect that succeeds with eBay's AddPackageResponses.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```ts
|
|
331
|
+
* const createdPackage = await Effect.runPromise(
|
|
332
|
+
* edeliveryApi.createPackage({ body: { packageInfo: {} } }),
|
|
333
|
+
* );
|
|
334
|
+
* ```
|
|
335
|
+
*
|
|
336
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/createPackage
|
|
107
337
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
338
|
+
createPackage = (input) => {
|
|
339
|
+
const client = this.client;
|
|
340
|
+
const path = `${this.basePath}/package`;
|
|
341
|
+
return Effect.gen(function* () {
|
|
342
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
343
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
344
|
+
return yield* requestPostEffect(client, path, body);
|
|
345
|
+
});
|
|
346
|
+
};
|
|
111
347
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
348
|
+
* Retrieves a package by ID.
|
|
349
|
+
*
|
|
350
|
+
* @param input - Package identifier.
|
|
351
|
+
* @returns An Effect that succeeds with eBay's GetPackageDetailResponses.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```ts
|
|
355
|
+
* const packageDetail = await Effect.runPromise(
|
|
356
|
+
* edeliveryApi.getPackage({ packageId: 'PKG123' }),
|
|
357
|
+
* );
|
|
358
|
+
* ```
|
|
359
|
+
*
|
|
360
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/getPackage
|
|
114
361
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
362
|
+
getPackage = (input) => {
|
|
363
|
+
const client = this.client;
|
|
364
|
+
const basePath = this.basePath;
|
|
365
|
+
return Effect.gen(function* () {
|
|
366
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
367
|
+
const packageId = yield* requireStringEffect(validatedInput.packageId, 'packageId');
|
|
368
|
+
return yield* requestGetEffect(client, `${basePath}/package/${packageId}`);
|
|
369
|
+
});
|
|
370
|
+
};
|
|
119
371
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
372
|
+
* Deletes a package by ID.
|
|
373
|
+
*
|
|
374
|
+
* @param input - Package identifier.
|
|
375
|
+
* @returns An Effect that succeeds when eBay returns no content.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```ts
|
|
379
|
+
* await Effect.runPromise(edeliveryApi.deletePackage({ packageId: 'PKG123' }));
|
|
380
|
+
* ```
|
|
381
|
+
*
|
|
382
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/deletePackage
|
|
122
383
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
384
|
+
deletePackage = (input) => {
|
|
385
|
+
const client = this.client;
|
|
386
|
+
const basePath = this.basePath;
|
|
387
|
+
return Effect.gen(function* () {
|
|
388
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
389
|
+
const packageId = yield* requireStringEffect(validatedInput.packageId, 'packageId');
|
|
390
|
+
return yield* requestDeleteEffect(client, `${basePath}/package/${packageId}`);
|
|
391
|
+
});
|
|
392
|
+
};
|
|
126
393
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
394
|
+
* Retrieves packages by fulfillment order line item ID.
|
|
395
|
+
*
|
|
396
|
+
* @param input - Fulfillment order line item identifier.
|
|
397
|
+
* @returns An Effect that succeeds with eBay's GetItemPackageIdResponses.
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```ts
|
|
401
|
+
* const packages = await Effect.runPromise(
|
|
402
|
+
* edeliveryApi.getPackagesByLineItemId({ orderLineItemId: 'LINE123' }),
|
|
403
|
+
* );
|
|
404
|
+
* ```
|
|
405
|
+
*
|
|
406
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/getPackagesByLineItemID
|
|
129
407
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
408
|
+
getPackagesByLineItemId = (input) => {
|
|
409
|
+
const client = this.client;
|
|
410
|
+
const basePath = this.basePath;
|
|
411
|
+
return Effect.gen(function* () {
|
|
412
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
413
|
+
const orderLineItemId = yield* requireStringEffect(validatedInput.orderLineItemId, 'orderLineItemId');
|
|
414
|
+
return yield* requestGetEffect(client, `${basePath}/package/${orderLineItemId}/item`);
|
|
415
|
+
});
|
|
416
|
+
};
|
|
133
417
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
418
|
+
* Cancels a package by ID.
|
|
419
|
+
*
|
|
420
|
+
* @param input - Package identifier.
|
|
421
|
+
* @returns An Effect that succeeds when eBay returns no content.
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* await Effect.runPromise(edeliveryApi.cancelPackage({ packageId: 'PKG123' }));
|
|
426
|
+
* ```
|
|
427
|
+
*
|
|
428
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/cancelPackage
|
|
136
429
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
430
|
+
cancelPackage = (input) => {
|
|
431
|
+
const client = this.client;
|
|
432
|
+
const basePath = this.basePath;
|
|
433
|
+
return Effect.gen(function* () {
|
|
434
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
435
|
+
const packageId = yield* requireStringEffect(validatedInput.packageId, 'packageId');
|
|
436
|
+
return yield* requestPostEffect(client, `${basePath}/package/${packageId}/cancel`);
|
|
437
|
+
});
|
|
438
|
+
};
|
|
147
439
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
440
|
+
* Clones a package by ID.
|
|
441
|
+
*
|
|
442
|
+
* @param input - Package identifier.
|
|
443
|
+
* @returns An Effect that succeeds with eBay's ClonePackageResponses.
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* ```ts
|
|
447
|
+
* const clone = await Effect.runPromise(edeliveryApi.clonePackage({ packageId: 'PKG123' }));
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/clonePackage
|
|
150
451
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
452
|
+
clonePackage = (input) => {
|
|
453
|
+
const client = this.client;
|
|
454
|
+
const basePath = this.basePath;
|
|
455
|
+
return Effect.gen(function* () {
|
|
456
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
457
|
+
const packageId = yield* requireStringEffect(validatedInput.packageId, 'packageId');
|
|
458
|
+
return yield* requestPostEffect(client, `${basePath}/package/${packageId}/clone`);
|
|
459
|
+
});
|
|
460
|
+
};
|
|
161
461
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
462
|
+
* Confirms a package by ID.
|
|
463
|
+
*
|
|
464
|
+
* @param input - Package identifier.
|
|
465
|
+
* @returns An Effect that succeeds when eBay returns no content.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```ts
|
|
469
|
+
* await Effect.runPromise(edeliveryApi.confirmPackage({ packageId: 'PKG123' }));
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/confirmPackage
|
|
164
473
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
474
|
+
confirmPackage = (input) => {
|
|
475
|
+
const client = this.client;
|
|
476
|
+
const basePath = this.basePath;
|
|
477
|
+
return Effect.gen(function* () {
|
|
478
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
479
|
+
const packageId = yield* requireStringEffect(validatedInput.packageId, 'packageId');
|
|
480
|
+
return yield* requestPostEffect(client, `${basePath}/package/${packageId}/confirm`);
|
|
481
|
+
});
|
|
482
|
+
};
|
|
169
483
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
484
|
+
* Cancels multiple packages.
|
|
485
|
+
*
|
|
486
|
+
* @param input - Generated CancelPackagesRequest body.
|
|
487
|
+
* @returns An Effect that succeeds with eBay's CancelPackagesResponses.
|
|
488
|
+
*
|
|
489
|
+
* @example
|
|
490
|
+
* ```ts
|
|
491
|
+
* const response = await Effect.runPromise(
|
|
492
|
+
* edeliveryApi.bulkCancelPackages({ body: { requests: { packageIds: 'PKG123' } } }),
|
|
493
|
+
* );
|
|
494
|
+
* ```
|
|
495
|
+
*
|
|
496
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/bulkCancelPackages
|
|
172
497
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
498
|
+
bulkCancelPackages = (input) => {
|
|
499
|
+
const client = this.client;
|
|
500
|
+
const path = `${this.basePath}/package/bulk_cancel_packages`;
|
|
501
|
+
return Effect.gen(function* () {
|
|
502
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
503
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
504
|
+
return yield* requestPostEffect(client, path, body);
|
|
505
|
+
});
|
|
506
|
+
};
|
|
176
507
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
508
|
+
* Confirms multiple packages.
|
|
509
|
+
*
|
|
510
|
+
* @param input - Generated ConfirmPackagesRequest body.
|
|
511
|
+
* @returns An Effect that succeeds with eBay's ConfirmPackagesResponses.
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* ```ts
|
|
515
|
+
* const response = await Effect.runPromise(
|
|
516
|
+
* edeliveryApi.bulkConfirmPackages({ body: { requests: { packageIds: 'PKG123' } } }),
|
|
517
|
+
* );
|
|
518
|
+
* ```
|
|
519
|
+
*
|
|
520
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/bulkConfirmPackages
|
|
179
521
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
522
|
+
bulkConfirmPackages = (input) => {
|
|
523
|
+
const client = this.client;
|
|
524
|
+
const path = `${this.basePath}/package/bulk_confirm_packages`;
|
|
525
|
+
return Effect.gen(function* () {
|
|
526
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
527
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
528
|
+
return yield* requestPostEffect(client, path, body);
|
|
529
|
+
});
|
|
530
|
+
};
|
|
183
531
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
532
|
+
* Deletes multiple packages.
|
|
533
|
+
*
|
|
534
|
+
* @param input - Generated DeletePackagesRequest body.
|
|
535
|
+
* @returns An Effect that succeeds with eBay's DeletePackagesResponses.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* ```ts
|
|
539
|
+
* const response = await Effect.runPromise(
|
|
540
|
+
* edeliveryApi.bulkDeletePackages({ body: { requests: { packageIds: 'PKG123' } } }),
|
|
541
|
+
* );
|
|
542
|
+
* ```
|
|
543
|
+
*
|
|
544
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/package/methods/bulkDeletePackages
|
|
186
545
|
*/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
546
|
+
bulkDeletePackages = (input) => {
|
|
547
|
+
const client = this.client;
|
|
548
|
+
const path = `${this.basePath}/package/bulk_delete_packages`;
|
|
549
|
+
return Effect.gen(function* () {
|
|
550
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
551
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
552
|
+
return yield* requestPostEffect(client, path, body);
|
|
553
|
+
});
|
|
554
|
+
};
|
|
191
555
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
556
|
+
* Retrieves labels by tracking numbers.
|
|
557
|
+
*
|
|
558
|
+
* @param input - Required tracking numbers and optional label formatting preferences.
|
|
559
|
+
* @returns An Effect that succeeds with eBay's GetLabelListResponses.
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* ```ts
|
|
563
|
+
* const labels = await Effect.runPromise(
|
|
564
|
+
* edeliveryApi.getLabels({ trackingNumbers: 'ES000000001', pageSize: 'A4' }),
|
|
565
|
+
* );
|
|
566
|
+
* ```
|
|
567
|
+
*
|
|
568
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/labels/methods/getLabels
|
|
194
569
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
570
|
+
getLabels = (input) => {
|
|
571
|
+
const client = this.client;
|
|
572
|
+
const path = `${this.basePath}/labels`;
|
|
573
|
+
return Effect.gen(function* () {
|
|
574
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
575
|
+
const trackingNumbers = yield* requireStringEffect(validatedInput.trackingNumbers, 'trackingNumbers');
|
|
576
|
+
const pageSize = yield* optionalStringEffect(validatedInput.pageSize, 'pageSize');
|
|
577
|
+
const printPreference = yield* optionalStringEffect(validatedInput.printPreference, 'printPreference');
|
|
578
|
+
const params = buildEndpointParams({
|
|
579
|
+
pageSize: { wireName: 'page_size', value: pageSize },
|
|
580
|
+
printPreference: { wireName: 'print_preference', value: printPreference },
|
|
581
|
+
trackingNumbers: { wireName: 'tracking_numbers', value: trackingNumbers },
|
|
582
|
+
});
|
|
583
|
+
return yield* requestGetEffect(client, path, params);
|
|
584
|
+
});
|
|
585
|
+
};
|
|
198
586
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
587
|
+
* Retrieves a handover sheet by tracking numbers.
|
|
588
|
+
*
|
|
589
|
+
* @param input - Required tracking numbers.
|
|
590
|
+
* @returns An Effect that succeeds with eBay's GetHandoverSheetResponses.
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
* ```ts
|
|
594
|
+
* const sheet = await Effect.runPromise(
|
|
595
|
+
* edeliveryApi.getHandoverSheet({ trackingNumbers: 'ES000000001' }),
|
|
596
|
+
* );
|
|
597
|
+
* ```
|
|
598
|
+
*
|
|
599
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/handover_sheet/methods/getHandoverSheet
|
|
201
600
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
601
|
+
getHandoverSheet = (input) => {
|
|
602
|
+
const client = this.client;
|
|
603
|
+
const path = `${this.basePath}/handover_sheet`;
|
|
604
|
+
return Effect.gen(function* () {
|
|
605
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
606
|
+
const trackingNumbers = yield* requireStringEffect(validatedInput.trackingNumbers, 'trackingNumbers');
|
|
607
|
+
const params = buildEndpointParams({
|
|
608
|
+
trackingNumbers: { wireName: 'tracking_numbers', value: trackingNumbers },
|
|
609
|
+
});
|
|
610
|
+
return yield* requestGetEffect(client, path, params);
|
|
611
|
+
});
|
|
612
|
+
};
|
|
205
613
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
614
|
+
* Retrieves tracking details for one tracking number.
|
|
615
|
+
*
|
|
616
|
+
* @param input - Required tracking number.
|
|
617
|
+
* @returns An Effect that succeeds with eBay's GetTrackingDetailResponses.
|
|
618
|
+
*
|
|
619
|
+
* @example
|
|
620
|
+
* ```ts
|
|
621
|
+
* const tracking = await Effect.runPromise(
|
|
622
|
+
* edeliveryApi.getTracking({ trackingNumber: 'ES000000001' }),
|
|
623
|
+
* );
|
|
624
|
+
* ```
|
|
625
|
+
*
|
|
626
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/tracking/methods/getTracking
|
|
208
627
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
628
|
+
getTracking = (input) => {
|
|
629
|
+
const client = this.client;
|
|
630
|
+
const path = `${this.basePath}/tracking`;
|
|
631
|
+
return Effect.gen(function* () {
|
|
632
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
633
|
+
const trackingNumber = yield* requireStringEffect(validatedInput.trackingNumber, 'trackingNumber');
|
|
634
|
+
const params = buildEndpointParams({
|
|
635
|
+
trackingNumber: { wireName: 'tracking_number', value: trackingNumber },
|
|
636
|
+
});
|
|
637
|
+
return yield* requestGetEffect(client, path, params);
|
|
638
|
+
});
|
|
639
|
+
};
|
|
213
640
|
/**
|
|
214
|
-
*
|
|
215
|
-
*
|
|
641
|
+
* Creates a complaint for shipment issues.
|
|
642
|
+
*
|
|
643
|
+
* @param input - Generated AddComplaintRequest body.
|
|
644
|
+
* @returns An Effect that succeeds with eBay's empty createComplaint response.
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* ```ts
|
|
648
|
+
* const complaint = await Effect.runPromise(
|
|
649
|
+
* edeliveryApi.createComplaint({ body: { complaintRequest: {} } }),
|
|
650
|
+
* );
|
|
651
|
+
* ```
|
|
652
|
+
*
|
|
653
|
+
* @see https://developer.ebay.com/api-docs/sell/edelivery_international_shipping/resources/complaint/methods/createComplaint
|
|
216
654
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
655
|
+
createComplaint = (input) => {
|
|
656
|
+
const client = this.client;
|
|
657
|
+
const path = `${this.basePath}/complaint`;
|
|
658
|
+
return Effect.gen(function* () {
|
|
659
|
+
const validatedInput = yield* requireObjectEffect(input, 'input');
|
|
660
|
+
const body = yield* requireObjectEffect(validatedInput.body, 'body');
|
|
661
|
+
return yield* requestPostEffect(client, path, body);
|
|
662
|
+
});
|
|
663
|
+
};
|
|
220
664
|
}
|