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,216 +1,510 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildEndpointParams, optionalPositiveNumberEffect, optionalStringEffect, requestDeleteEffect, requestGetEffect, requestPostEffect, requestPutEffect, requireObjectEffect, requireStringEffect, } from '../../api/shared/request.js';
|
|
2
|
+
import { Effect } from 'effect';
|
|
2
3
|
/**
|
|
3
4
|
* Notification API - Event notifications and subscriptions
|
|
4
5
|
* Based on: docs/sell-apps/communication/commerce_notification_v1_oas3.json
|
|
5
6
|
*/
|
|
6
7
|
export class NotificationApi {
|
|
7
|
-
client;
|
|
8
8
|
basePath = '/commerce/notification/v1';
|
|
9
|
+
client;
|
|
9
10
|
constructor(client) {
|
|
10
11
|
this.client = client;
|
|
11
12
|
}
|
|
12
|
-
path(endpoint) {
|
|
13
|
-
return `${this.basePath}${endpoint}`;
|
|
14
|
-
}
|
|
15
|
-
async get(endpoint, failureMessage, params) {
|
|
16
|
-
return await getWithApiError(this.client, this.path(endpoint), failureMessage, params);
|
|
17
|
-
}
|
|
18
|
-
async post(endpoint, failureMessage, body) {
|
|
19
|
-
return await postWithApiError(this.client, this.path(endpoint), failureMessage, body);
|
|
20
|
-
}
|
|
21
|
-
async put(endpoint, failureMessage, body) {
|
|
22
|
-
return await putWithApiError(this.client, this.path(endpoint), failureMessage, body);
|
|
23
|
-
}
|
|
24
|
-
async delete(endpoint, failureMessage) {
|
|
25
|
-
return await deleteWithApiError(this.client, this.path(endpoint), failureMessage);
|
|
26
|
-
}
|
|
27
|
-
async getContinuation(endpoint, failureMessage, limit, continuationToken) {
|
|
28
|
-
return await this.get(endpoint, failureMessage, buildContinuationParams(limit, continuationToken));
|
|
29
|
-
}
|
|
30
13
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
14
|
+
* Retrieves a public key used to validate notification signatures.
|
|
15
|
+
*
|
|
16
|
+
* @param input - Public key identifier from the notification signature header.
|
|
17
|
+
* @returns An Effect that succeeds with eBay's generated PublicKey response.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const key = await Effect.runPromise(notificationApi.getPublicKey({ publicKeyId: 'key-123' }));
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/public_key/methods/getPublicKey
|
|
34
25
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
getPublicKey = (input) => {
|
|
27
|
+
const apiClient = this.client;
|
|
28
|
+
const apiBasePath = this.basePath;
|
|
29
|
+
return Effect.gen(function* () {
|
|
30
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
31
|
+
const validatedPublicKeyId = yield* requireStringEffect(request.publicKeyId, 'publicKeyId');
|
|
32
|
+
return yield* requestGetEffect(apiClient, `${apiBasePath}/public_key/${validatedPublicKeyId}`);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
39
35
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
36
|
+
* Retrieves the Notification API alert configuration.
|
|
37
|
+
*
|
|
38
|
+
* @param input - Empty endpoint input object.
|
|
39
|
+
* @returns An Effect that succeeds with eBay's generated Config response.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const config = await Effect.runPromise(notificationApi.getConfig({}));
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/config/methods/getConfig
|
|
42
47
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
getConfig = (input = {}) => {
|
|
49
|
+
void input;
|
|
50
|
+
return requestGetEffect(this.client, `${this.basePath}/config`);
|
|
51
|
+
};
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
53
|
+
* Updates the Notification API alert configuration.
|
|
54
|
+
*
|
|
55
|
+
* @param input - Notification alert configuration body.
|
|
56
|
+
* @returns An Effect that succeeds when eBay accepts the update.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* await Effect.runPromise(notificationApi.updateConfig({ alertEmail: 'ops@example.com' }));
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/config/methods/updateConfig
|
|
49
64
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
updateConfig = (input) => {
|
|
66
|
+
const apiClient = this.client;
|
|
67
|
+
const path = `${this.basePath}/config`;
|
|
68
|
+
return Effect.gen(function* () {
|
|
69
|
+
const body = yield* requireObjectEffect(input, 'input');
|
|
70
|
+
return yield* requestPutEffect(apiClient, path, body);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
54
73
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
74
|
+
* Retrieves configured notification destinations.
|
|
75
|
+
*
|
|
76
|
+
* @param input - Optional page size and continuation token.
|
|
77
|
+
* @returns An Effect that succeeds with eBay's generated DestinationSearchResponse.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const destinations = await Effect.runPromise(notificationApi.getDestinations({ limit: 20 }));
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/destination/methods/getDestinations
|
|
57
85
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
86
|
+
getDestinations = (input = {}) => {
|
|
87
|
+
const apiClient = this.client;
|
|
88
|
+
const path = `${this.basePath}/destination`;
|
|
89
|
+
return Effect.gen(function* () {
|
|
90
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
91
|
+
const limit = yield* optionalPositiveNumberEffect(request.limit, 'limit');
|
|
92
|
+
const continuationToken = yield* optionalStringEffect(request.continuationToken, 'continuationToken');
|
|
93
|
+
const params = buildEndpointParams({
|
|
94
|
+
limit: { wireName: 'limit', value: limit },
|
|
95
|
+
continuationToken: { wireName: 'continuation_token', value: continuationToken },
|
|
96
|
+
});
|
|
97
|
+
return yield* requestGetEffect(apiClient, path, params);
|
|
98
|
+
});
|
|
99
|
+
};
|
|
61
100
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* @
|
|
101
|
+
* Retrieves one notification destination.
|
|
102
|
+
*
|
|
103
|
+
* @param input - Destination identifier.
|
|
104
|
+
* @returns An Effect that succeeds with eBay's generated Destination response.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* const destination = await Effect.runPromise(
|
|
109
|
+
* notificationApi.getDestination({ destinationId: 'dest-1' }),
|
|
110
|
+
* );
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/destination/methods/getDestination
|
|
65
114
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
115
|
+
getDestination = (input) => {
|
|
116
|
+
const apiClient = this.client;
|
|
117
|
+
const apiBasePath = this.basePath;
|
|
118
|
+
return Effect.gen(function* () {
|
|
119
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
120
|
+
const validatedDestinationId = yield* requireStringEffect(request.destinationId, 'destinationId');
|
|
121
|
+
return yield* requestGetEffect(apiClient, `${apiBasePath}/destination/${validatedDestinationId}`);
|
|
122
|
+
});
|
|
123
|
+
};
|
|
70
124
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
125
|
+
* Creates a notification destination.
|
|
126
|
+
*
|
|
127
|
+
* @param input - Destination request body.
|
|
128
|
+
* @returns An Effect that succeeds when eBay accepts the destination.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* await Effect.runPromise(notificationApi.createDestination({ name: 'webhook' }));
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/destination/methods/createDestination
|
|
73
136
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
137
|
+
createDestination = (input) => {
|
|
138
|
+
const apiClient = this.client;
|
|
139
|
+
const path = `${this.basePath}/destination`;
|
|
140
|
+
return Effect.gen(function* () {
|
|
141
|
+
const body = yield* requireObjectEffect(input, 'input');
|
|
142
|
+
return yield* requestPostEffect(apiClient, path, body);
|
|
143
|
+
});
|
|
144
|
+
};
|
|
78
145
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
146
|
+
* Updates a notification destination.
|
|
147
|
+
*
|
|
148
|
+
* @param input - Destination identifier plus destination update body fields.
|
|
149
|
+
* @returns An Effect that succeeds when eBay accepts the update.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* await Effect.runPromise(
|
|
154
|
+
* notificationApi.updateDestination({ destinationId: 'dest-1', name: 'webhook' }),
|
|
155
|
+
* );
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/destination/methods/updateDestination
|
|
81
159
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
|
|
160
|
+
updateDestination = (input) => {
|
|
161
|
+
const apiClient = this.client;
|
|
162
|
+
const apiBasePath = this.basePath;
|
|
163
|
+
return Effect.gen(function* () {
|
|
164
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
165
|
+
const { destinationId, ...destination } = request;
|
|
166
|
+
const validatedDestinationId = yield* requireStringEffect(destinationId, 'destinationId');
|
|
167
|
+
const body = yield* requireObjectEffect(destination, 'destination');
|
|
168
|
+
return yield* requestPutEffect(apiClient, `${apiBasePath}/destination/${validatedDestinationId}`, body);
|
|
169
|
+
});
|
|
170
|
+
};
|
|
87
171
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
172
|
+
* Deletes a notification destination.
|
|
173
|
+
*
|
|
174
|
+
* @param input - Destination identifier.
|
|
175
|
+
* @returns An Effect that succeeds when eBay deletes the destination.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* await Effect.runPromise(notificationApi.deleteDestination({ destinationId: 'dest-1' }));
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/destination/methods/deleteDestination
|
|
90
183
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
184
|
+
deleteDestination = (input) => {
|
|
185
|
+
const apiClient = this.client;
|
|
186
|
+
const apiBasePath = this.basePath;
|
|
187
|
+
return Effect.gen(function* () {
|
|
188
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
189
|
+
const validatedDestinationId = yield* requireStringEffect(request.destinationId, 'destinationId');
|
|
190
|
+
return yield* requestDeleteEffect(apiClient, `${apiBasePath}/destination/${validatedDestinationId}`);
|
|
191
|
+
});
|
|
192
|
+
};
|
|
95
193
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* @
|
|
194
|
+
* Retrieves configured notification subscriptions.
|
|
195
|
+
*
|
|
196
|
+
* @param input - Optional page size and continuation token.
|
|
197
|
+
* @returns An Effect that succeeds with eBay's generated SubscriptionSearchResponse.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* const subscriptions = await Effect.runPromise(notificationApi.getSubscriptions({ limit: 20 }));
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/getSubscriptions
|
|
99
205
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
206
|
+
getSubscriptions = (input = {}) => {
|
|
207
|
+
const apiClient = this.client;
|
|
208
|
+
const path = `${this.basePath}/subscription`;
|
|
209
|
+
return Effect.gen(function* () {
|
|
210
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
211
|
+
const limit = yield* optionalPositiveNumberEffect(request.limit, 'limit');
|
|
212
|
+
const continuationToken = yield* optionalStringEffect(request.continuationToken, 'continuationToken');
|
|
213
|
+
const params = buildEndpointParams({
|
|
214
|
+
limit: { wireName: 'limit', value: limit },
|
|
215
|
+
continuationToken: { wireName: 'continuation_token', value: continuationToken },
|
|
216
|
+
});
|
|
217
|
+
return yield* requestGetEffect(apiClient, path, params);
|
|
218
|
+
});
|
|
219
|
+
};
|
|
103
220
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* @
|
|
221
|
+
* Creates a notification subscription.
|
|
222
|
+
*
|
|
223
|
+
* @param input - Subscription creation request body.
|
|
224
|
+
* @returns An Effect that succeeds when eBay accepts the subscription.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* await Effect.runPromise(notificationApi.createSubscription({ topicId: 'MARKETPLACE' }));
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/createSubscription
|
|
107
232
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
233
|
+
createSubscription = (input) => {
|
|
234
|
+
const apiClient = this.client;
|
|
235
|
+
const path = `${this.basePath}/subscription`;
|
|
236
|
+
return Effect.gen(function* () {
|
|
237
|
+
const body = yield* requireObjectEffect(input, 'input');
|
|
238
|
+
return yield* requestPostEffect(apiClient, path, body);
|
|
239
|
+
});
|
|
240
|
+
};
|
|
112
241
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* @param
|
|
116
|
-
* @
|
|
242
|
+
* Retrieves one notification subscription.
|
|
243
|
+
*
|
|
244
|
+
* @param input - Subscription identifier.
|
|
245
|
+
* @returns An Effect that succeeds with eBay's generated Subscription response.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```ts
|
|
249
|
+
* const subscription = await Effect.runPromise(
|
|
250
|
+
* notificationApi.getSubscription({ subscriptionId: 'sub-1' }),
|
|
251
|
+
* );
|
|
252
|
+
* ```
|
|
253
|
+
*
|
|
254
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/getSubscription
|
|
117
255
|
*/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
256
|
+
getSubscription = (input) => {
|
|
257
|
+
const apiClient = this.client;
|
|
258
|
+
const apiBasePath = this.basePath;
|
|
259
|
+
return Effect.gen(function* () {
|
|
260
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
261
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
262
|
+
return yield* requestGetEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}`);
|
|
263
|
+
});
|
|
264
|
+
};
|
|
122
265
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @
|
|
266
|
+
* Updates a notification subscription.
|
|
267
|
+
*
|
|
268
|
+
* @param input - Subscription identifier plus subscription update body fields.
|
|
269
|
+
* @returns An Effect that succeeds when eBay accepts the update.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```ts
|
|
273
|
+
* await Effect.runPromise(
|
|
274
|
+
* notificationApi.updateSubscription({ subscriptionId: 'sub-1', status: 'DISABLED' }),
|
|
275
|
+
* );
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/updateSubscription
|
|
126
279
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return
|
|
131
|
-
|
|
280
|
+
updateSubscription = (input) => {
|
|
281
|
+
const apiClient = this.client;
|
|
282
|
+
const apiBasePath = this.basePath;
|
|
283
|
+
return Effect.gen(function* () {
|
|
284
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
285
|
+
const { subscriptionId, ...subscription } = request;
|
|
286
|
+
const validatedSubscriptionId = yield* requireStringEffect(subscriptionId, 'subscriptionId');
|
|
287
|
+
const body = yield* requireObjectEffect(subscription, 'subscription');
|
|
288
|
+
return yield* requestPutEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}`, body);
|
|
289
|
+
});
|
|
290
|
+
};
|
|
132
291
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* @
|
|
292
|
+
* Deletes a notification subscription.
|
|
293
|
+
*
|
|
294
|
+
* @param input - Subscription identifier.
|
|
295
|
+
* @returns An Effect that succeeds when eBay deletes the subscription.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```ts
|
|
299
|
+
* await Effect.runPromise(notificationApi.deleteSubscription({ subscriptionId: 'sub-1' }));
|
|
300
|
+
* ```
|
|
301
|
+
*
|
|
302
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/deleteSubscription
|
|
136
303
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
304
|
+
deleteSubscription = (input) => {
|
|
305
|
+
const apiClient = this.client;
|
|
306
|
+
const apiBasePath = this.basePath;
|
|
307
|
+
return Effect.gen(function* () {
|
|
308
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
309
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
310
|
+
return yield* requestDeleteEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}`);
|
|
311
|
+
});
|
|
312
|
+
};
|
|
141
313
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* @
|
|
314
|
+
* Disables an active notification subscription.
|
|
315
|
+
*
|
|
316
|
+
* @param input - Subscription identifier.
|
|
317
|
+
* @returns An Effect that succeeds when eBay disables the subscription.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```ts
|
|
321
|
+
* await Effect.runPromise(notificationApi.disableSubscription({ subscriptionId: 'sub-1' }));
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/disableSubscription
|
|
145
325
|
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
326
|
+
disableSubscription = (input) => {
|
|
327
|
+
const apiClient = this.client;
|
|
328
|
+
const apiBasePath = this.basePath;
|
|
329
|
+
return Effect.gen(function* () {
|
|
330
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
331
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
332
|
+
return yield* requestPostEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}/disable`);
|
|
333
|
+
});
|
|
334
|
+
};
|
|
150
335
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* @
|
|
336
|
+
* Enables a disabled notification subscription.
|
|
337
|
+
*
|
|
338
|
+
* @param input - Subscription identifier.
|
|
339
|
+
* @returns An Effect that succeeds when eBay enables the subscription.
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```ts
|
|
343
|
+
* await Effect.runPromise(notificationApi.enableSubscription({ subscriptionId: 'sub-1' }));
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/enableSubscription
|
|
154
347
|
*/
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
348
|
+
enableSubscription = (input) => {
|
|
349
|
+
const apiClient = this.client;
|
|
350
|
+
const apiBasePath = this.basePath;
|
|
351
|
+
return Effect.gen(function* () {
|
|
352
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
353
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
354
|
+
return yield* requestPostEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}/enable`);
|
|
355
|
+
});
|
|
356
|
+
};
|
|
159
357
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* @
|
|
358
|
+
* Sends a test notification for a subscription.
|
|
359
|
+
*
|
|
360
|
+
* @param input - Subscription identifier.
|
|
361
|
+
* @returns An Effect that succeeds when eBay accepts the test notification.
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* ```ts
|
|
365
|
+
* await Effect.runPromise(notificationApi.testSubscription({ subscriptionId: 'sub-1' }));
|
|
366
|
+
* ```
|
|
367
|
+
*
|
|
368
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/testSubscription
|
|
163
369
|
*/
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
370
|
+
testSubscription = (input) => {
|
|
371
|
+
const apiClient = this.client;
|
|
372
|
+
const apiBasePath = this.basePath;
|
|
373
|
+
return Effect.gen(function* () {
|
|
374
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
375
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
376
|
+
return yield* requestPostEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}/test`);
|
|
377
|
+
});
|
|
378
|
+
};
|
|
168
379
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* @param
|
|
172
|
-
* @
|
|
380
|
+
* Retrieves one notification topic.
|
|
381
|
+
*
|
|
382
|
+
* @param input - Topic identifier.
|
|
383
|
+
* @returns An Effect that succeeds with eBay's generated Topic response.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* ```ts
|
|
387
|
+
* const topic = await Effect.runPromise(notificationApi.getTopic({ topicId: 'topic-1' }));
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/topic/methods/getTopic
|
|
173
391
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
392
|
+
getTopic = (input) => {
|
|
393
|
+
const apiClient = this.client;
|
|
394
|
+
const apiBasePath = this.basePath;
|
|
395
|
+
return Effect.gen(function* () {
|
|
396
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
397
|
+
const validatedTopicId = yield* requireStringEffect(request.topicId, 'topicId');
|
|
398
|
+
return yield* requestGetEffect(apiClient, `${apiBasePath}/topic/${validatedTopicId}`);
|
|
399
|
+
});
|
|
400
|
+
};
|
|
178
401
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* @
|
|
402
|
+
* Retrieves available notification topics.
|
|
403
|
+
*
|
|
404
|
+
* @param input - Optional page size and continuation token.
|
|
405
|
+
* @returns An Effect that succeeds with eBay's generated TopicSearchResponse.
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* ```ts
|
|
409
|
+
* const topics = await Effect.runPromise(notificationApi.getTopics({ limit: 20 }));
|
|
410
|
+
* ```
|
|
411
|
+
*
|
|
412
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/topic/methods/getTopics
|
|
182
413
|
*/
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
414
|
+
getTopics = (input = {}) => {
|
|
415
|
+
const apiClient = this.client;
|
|
416
|
+
const path = `${this.basePath}/topic`;
|
|
417
|
+
return Effect.gen(function* () {
|
|
418
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
419
|
+
const limit = yield* optionalPositiveNumberEffect(request.limit, 'limit');
|
|
420
|
+
const continuationToken = yield* optionalStringEffect(request.continuationToken, 'continuationToken');
|
|
421
|
+
const params = buildEndpointParams({
|
|
422
|
+
limit: { wireName: 'limit', value: limit },
|
|
423
|
+
continuationToken: { wireName: 'continuation_token', value: continuationToken },
|
|
424
|
+
});
|
|
425
|
+
return yield* requestGetEffect(apiClient, path, params);
|
|
426
|
+
});
|
|
427
|
+
};
|
|
186
428
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* @
|
|
429
|
+
* Creates a filter for a notification subscription.
|
|
430
|
+
*
|
|
431
|
+
* @param input - Subscription identifier plus JSON Schema filter body accepted by eBay.
|
|
432
|
+
* @returns An Effect that succeeds with eBay's generated empty response body.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```ts
|
|
436
|
+
* await Effect.runPromise(
|
|
437
|
+
* notificationApi.createSubscriptionFilter({
|
|
438
|
+
* subscriptionId: 'sub-1',
|
|
439
|
+
* filterSchema: { type: 'object' },
|
|
440
|
+
* }),
|
|
441
|
+
* );
|
|
442
|
+
* ```
|
|
443
|
+
*
|
|
444
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/createSubscriptionFilter
|
|
190
445
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return
|
|
195
|
-
|
|
446
|
+
createSubscriptionFilter = (input) => {
|
|
447
|
+
const apiClient = this.client;
|
|
448
|
+
const apiBasePath = this.basePath;
|
|
449
|
+
return Effect.gen(function* () {
|
|
450
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
451
|
+
const { subscriptionId, ...filter } = request;
|
|
452
|
+
const validatedSubscriptionId = yield* requireStringEffect(subscriptionId, 'subscriptionId');
|
|
453
|
+
const body = yield* requireObjectEffect(filter, 'filter');
|
|
454
|
+
return yield* requestPostEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}/filter`, body);
|
|
455
|
+
});
|
|
456
|
+
};
|
|
196
457
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* @
|
|
458
|
+
* Retrieves one subscription filter.
|
|
459
|
+
*
|
|
460
|
+
* @param input - Subscription identifier and subscription filter identifier.
|
|
461
|
+
* @returns An Effect that succeeds with eBay's generated SubscriptionFilter response.
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* ```ts
|
|
465
|
+
* const filter = await Effect.runPromise(
|
|
466
|
+
* notificationApi.getSubscriptionFilter({ subscriptionId: 'sub-1', filterId: 'filter-1' }),
|
|
467
|
+
* );
|
|
468
|
+
* ```
|
|
469
|
+
*
|
|
470
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/getSubscriptionFilter
|
|
200
471
|
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return
|
|
205
|
-
|
|
472
|
+
getSubscriptionFilter = (input) => {
|
|
473
|
+
const apiClient = this.client;
|
|
474
|
+
const apiBasePath = this.basePath;
|
|
475
|
+
return Effect.gen(function* () {
|
|
476
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
477
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
478
|
+
const validatedFilterId = yield* requireStringEffect(request.filterId, 'filterId');
|
|
479
|
+
return yield* requestGetEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}/filter/${validatedFilterId}`);
|
|
480
|
+
});
|
|
481
|
+
};
|
|
206
482
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* @
|
|
483
|
+
* Deletes a subscription filter.
|
|
484
|
+
*
|
|
485
|
+
* @param input - Subscription identifier and subscription filter identifier.
|
|
486
|
+
* @returns An Effect that succeeds when eBay deletes the filter.
|
|
487
|
+
*
|
|
488
|
+
* @example
|
|
489
|
+
* ```ts
|
|
490
|
+
* await Effect.runPromise(
|
|
491
|
+
* notificationApi.deleteSubscriptionFilter({
|
|
492
|
+
* subscriptionId: 'sub-1',
|
|
493
|
+
* filterId: 'filter-1',
|
|
494
|
+
* }),
|
|
495
|
+
* );
|
|
496
|
+
* ```
|
|
497
|
+
*
|
|
498
|
+
* @see https://developer.ebay.com/api-docs/commerce/notification/resources/subscription/methods/deleteSubscriptionFilter
|
|
210
499
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return
|
|
215
|
-
|
|
500
|
+
deleteSubscriptionFilter = (input) => {
|
|
501
|
+
const apiClient = this.client;
|
|
502
|
+
const apiBasePath = this.basePath;
|
|
503
|
+
return Effect.gen(function* () {
|
|
504
|
+
const request = yield* requireObjectEffect(input, 'input');
|
|
505
|
+
const validatedSubscriptionId = yield* requireStringEffect(request.subscriptionId, 'subscriptionId');
|
|
506
|
+
const validatedFilterId = yield* requireStringEffect(request.filterId, 'filterId');
|
|
507
|
+
return yield* requestDeleteEffect(apiClient, `${apiBasePath}/subscription/${validatedSubscriptionId}/filter/${validatedFilterId}`);
|
|
508
|
+
});
|
|
509
|
+
};
|
|
216
510
|
}
|