@commercetools/tools-core 0.0.2 → 0.0.4
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/dist/index.cjs +2076 -1071
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +208 -154
- package/dist/index.d.ts +208 -154
- package/dist/index.js +1542 -841
- package/package.json +8 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _commercetools_platform_sdk from '@commercetools/platform-sdk';
|
|
2
|
-
import { ApiRoot, ByProjectKeyRequestBuilder, AttributeGroup, AttributeGroupPagedQueryResponse, Category, CategoryPagedQueryResponse, Channel, ChannelPagedQueryResponse, CustomObject, CustomObjectPagedQueryResponse, Customer, CustomerPagedQueryResponse, CustomerSignInResult, DiscountCode, DiscountCodePagedQueryResponse, Extension, ExtensionPagedQueryResponse, InventoryEntry, InventoryPagedQueryResponse, Message, MessagePagedQueryResponse, ProductDiscount, ProductDiscountPagedQueryResponse, ProductProjection, ProductProjectionPagedSearchResponse, ProductPagedSearchResponse, ProductSelection, ProductSelectionPagedQueryResponse, ProductTailoring, ProductTailoringPagedQueryResponse, ProductType, ProductTypePagedQueryResponse, Product, ProductPagedQueryResponse, Project, Review, ReviewPagedQueryResponse, StandalonePrice, StandalonePricePagedQueryResponse, State, StatePagedQueryResponse, Store, StorePagedQueryResponse, Subscription, SubscriptionPagedQueryResponse, TaxCategory, TaxCategoryPagedQueryResponse, Type, TypePagedQueryResponse, Zone, ZonePagedQueryResponse } from '@commercetools/platform-sdk';
|
|
2
|
+
import { ApiRoot, ByProjectKeyRequestBuilder, AttributeGroup, AttributeGroupPagedQueryResponse, Category, CategoryPagedQueryResponse, Cart, CartPagedQueryResponse, Channel, ChannelPagedQueryResponse, CustomObject, CustomObjectPagedQueryResponse, Customer, CustomerPagedQueryResponse, CustomerSignInResult, CustomerGroup, CustomerGroupPagedQueryResponse, CustomerPagedSearchResponse, DiscountCode, DiscountCodePagedQueryResponse, Extension, ExtensionPagedQueryResponse, InventoryEntry, InventoryPagedQueryResponse, Message, MessagePagedQueryResponse, ProductDiscount, ProductDiscountPagedQueryResponse, ProductProjection, ProductProjectionPagedSearchResponse, ProductPagedSearchResponse, ProductSelection, ProductSelectionPagedQueryResponse, ProductTailoring, ProductTailoringPagedQueryResponse, ProductType, ProductTypePagedQueryResponse, Product, ProductPagedQueryResponse, Project, Review, ReviewPagedQueryResponse, StandalonePrice, StandalonePricePagedQueryResponse, State, StatePagedQueryResponse, Store, StorePagedQueryResponse, Subscription, SubscriptionPagedQueryResponse, TaxCategory, TaxCategoryPagedQueryResponse, Type, TypePagedQueryResponse, Zone, ZonePagedQueryResponse } from '@commercetools/platform-sdk';
|
|
3
3
|
import { Client } from '@commercetools/ts-client';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -85,31 +85,15 @@ interface ToolHandler$1<TConfig> {
|
|
|
85
85
|
interface IApiClientFactory<TConfig = unknown> {
|
|
86
86
|
createApiClient(configuration: TConfig, authToken: string): ApiRoot;
|
|
87
87
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Minimal interface required for commercetools handlers
|
|
90
|
-
* Any configuration type used with commercetools handlers must have at least projectKey
|
|
91
|
-
*/
|
|
92
|
-
interface CommercetoolsConfig {
|
|
93
|
-
projectKey: string;
|
|
94
|
-
}
|
|
95
88
|
/**
|
|
96
89
|
* Default Configuration interface for backward compatibility
|
|
97
90
|
* This can be extended or replaced in consuming packages
|
|
98
91
|
*/
|
|
99
|
-
interface Configuration
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
rateLimits?: {
|
|
105
|
-
requestsPerMinute?: number;
|
|
106
|
-
};
|
|
107
|
-
customFields?: Record<string, unknown>;
|
|
108
|
-
apiUrl?: string;
|
|
109
|
-
authUrl?: string;
|
|
110
|
-
clientId?: string;
|
|
111
|
-
clientSecret?: string;
|
|
112
|
-
};
|
|
92
|
+
interface Configuration<T = Record<string, unknown>> {
|
|
93
|
+
tools: string[];
|
|
94
|
+
projectKey: string;
|
|
95
|
+
correlationId: string;
|
|
96
|
+
metadata?: T;
|
|
113
97
|
}
|
|
114
98
|
/**
|
|
115
99
|
* Constructor type
|
|
@@ -130,7 +114,7 @@ type ApiRootFn = (client: Client, baseUri?: string) => ApiRoot;
|
|
|
130
114
|
* Provides context and debugging information
|
|
131
115
|
* Generic over configuration type to support custom configs
|
|
132
116
|
*/
|
|
133
|
-
declare class ToolExecutionError<TConfig extends
|
|
117
|
+
declare class ToolExecutionError<TConfig extends Configuration> extends Error {
|
|
134
118
|
readonly toolName: string;
|
|
135
119
|
readonly operation: string;
|
|
136
120
|
readonly projectKey: string;
|
|
@@ -172,7 +156,7 @@ declare class CommercetoolsAPIClient {
|
|
|
172
156
|
private apiRoot;
|
|
173
157
|
private configuration;
|
|
174
158
|
private authToken?;
|
|
175
|
-
constructor(configuration: Configuration
|
|
159
|
+
constructor(configuration: Configuration, authToken?: string);
|
|
176
160
|
/**
|
|
177
161
|
* Get the API root instance
|
|
178
162
|
*/
|
|
@@ -195,7 +179,7 @@ declare class CommercetoolsAPIClient {
|
|
|
195
179
|
* Default implementation of API client factory
|
|
196
180
|
* Generic over configuration type to support custom configs
|
|
197
181
|
*/
|
|
198
|
-
declare class ApiClientFactory<TConfig extends
|
|
182
|
+
declare class ApiClientFactory<TConfig extends Configuration = Configuration> implements IApiClientFactory<TConfig> {
|
|
199
183
|
createApiClient(configuration: TConfig, authToken: string): _commercetools_platform_sdk.ApiRoot;
|
|
200
184
|
getApiRoot(configuration: TConfig, authToken: string): CommercetoolsAPIClient;
|
|
201
185
|
}
|
|
@@ -240,7 +224,7 @@ declare abstract class BaseResourceHandler<TConfig = unknown> implements ToolHan
|
|
|
240
224
|
* The handler will be automatically discovered and registered
|
|
241
225
|
* when the module is loaded.
|
|
242
226
|
*/
|
|
243
|
-
declare function ToolHandler(): <T extends IConstructor<BaseResourceHandler<Configuration
|
|
227
|
+
declare function ToolHandler(): <T extends IConstructor<BaseResourceHandler<Configuration<Record<string, unknown>>>>>(constructor: T) => T;
|
|
244
228
|
/**
|
|
245
229
|
* Get all handlers registered via decorator
|
|
246
230
|
* This is called by ToolDiscovery to register all decorated handlers
|
|
@@ -252,7 +236,7 @@ declare function getDecoratorRegisteredHandlers(): BaseResourceHandler<Configura
|
|
|
252
236
|
* Extends BaseResourceHandler with commercetools API client functionality
|
|
253
237
|
* This is an abstract class - subclasses must implement the CRUD methods
|
|
254
238
|
*
|
|
255
|
-
* @template TConfig - Configuration type that must extend
|
|
239
|
+
* @template TConfig - Configuration type that must extend Configuration (requires projectKey)
|
|
256
240
|
*
|
|
257
241
|
* Example usage:
|
|
258
242
|
* ```typescript
|
|
@@ -260,14 +244,14 @@ declare function getDecoratorRegisteredHandlers(): BaseResourceHandler<Configura
|
|
|
260
244
|
* export class CustomersHandler extends CommercetoolsResourceHandler { ... }
|
|
261
245
|
*
|
|
262
246
|
* // Using custom config type
|
|
263
|
-
* interface MyCustomConfig extends
|
|
247
|
+
* interface MyCustomConfig extends Configuration {
|
|
264
248
|
* projectKey: string;
|
|
265
249
|
* customField: string;
|
|
266
250
|
* }
|
|
267
251
|
* export class CustomersHandler extends CommercetoolsResourceHandler<MyCustomConfig> { ... }
|
|
268
252
|
* ```
|
|
269
253
|
*/
|
|
270
|
-
declare abstract class CommercetoolsResourceHandler<TConfig extends
|
|
254
|
+
declare abstract class CommercetoolsResourceHandler<TConfig extends Configuration = Configuration> extends BaseResourceHandler<TConfig> {
|
|
271
255
|
protected apiClientFactory: IApiClientFactory<TConfig>;
|
|
272
256
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
273
257
|
/**
|
|
@@ -276,7 +260,7 @@ declare abstract class CommercetoolsResourceHandler<TConfig extends Commercetool
|
|
|
276
260
|
protected getApiRoot(context: ToolExecutionContext<TConfig>): ApiRoot;
|
|
277
261
|
}
|
|
278
262
|
|
|
279
|
-
declare class AttributeGroupsHandler<TConfig extends
|
|
263
|
+
declare class AttributeGroupsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
280
264
|
protected readonly metadata: ResourceMetadata;
|
|
281
265
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
282
266
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -290,16 +274,16 @@ declare class AttributeGroupsHandler<TConfig extends CommercetoolsConfig = Comme
|
|
|
290
274
|
update(context: ToolExecutionContext<TConfig>): Promise<AttributeGroup>;
|
|
291
275
|
delete(context: ToolExecutionContext<TConfig>): Promise<AttributeGroup>;
|
|
292
276
|
}
|
|
293
|
-
declare function readAttributeGroups<TConfig extends
|
|
294
|
-
declare function createAttributeGroups<TConfig extends
|
|
295
|
-
declare function updateAttributeGroups<TConfig extends
|
|
296
|
-
declare function deleteAttributeGroups<TConfig extends
|
|
277
|
+
declare function readAttributeGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<AttributeGroup | AttributeGroupPagedQueryResponse>;
|
|
278
|
+
declare function createAttributeGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<AttributeGroup>;
|
|
279
|
+
declare function updateAttributeGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<AttributeGroup>;
|
|
280
|
+
declare function deleteAttributeGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<AttributeGroup>;
|
|
297
281
|
|
|
298
282
|
/**
|
|
299
283
|
* Categories Resource Handler
|
|
300
284
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
301
285
|
*/
|
|
302
|
-
declare class CategoriesHandler<TConfig extends
|
|
286
|
+
declare class CategoriesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
303
287
|
protected readonly metadata: ResourceMetadata;
|
|
304
288
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
305
289
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -313,12 +297,35 @@ declare class CategoriesHandler<TConfig extends CommercetoolsConfig = Commerceto
|
|
|
313
297
|
update(context: ToolExecutionContext<TConfig>): Promise<Category>;
|
|
314
298
|
delete(context: ToolExecutionContext<TConfig>): Promise<Category>;
|
|
315
299
|
}
|
|
316
|
-
declare function readCategories<TConfig extends
|
|
317
|
-
declare function createCategories<TConfig extends
|
|
318
|
-
declare function updateCategories<TConfig extends
|
|
319
|
-
declare function deleteCategories<TConfig extends
|
|
300
|
+
declare function readCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Category | CategoryPagedQueryResponse>;
|
|
301
|
+
declare function createCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Category>;
|
|
302
|
+
declare function updateCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Category>;
|
|
303
|
+
declare function deleteCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Category>;
|
|
320
304
|
|
|
321
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Carts Resource Handler
|
|
307
|
+
* Store-aware: supports storeKey for store-specific carts.
|
|
308
|
+
*/
|
|
309
|
+
declare class CartsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
310
|
+
protected readonly metadata: ResourceMetadata;
|
|
311
|
+
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
312
|
+
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
313
|
+
name: string;
|
|
314
|
+
description: string;
|
|
315
|
+
inputSchema: ValidatableSchema;
|
|
316
|
+
};
|
|
317
|
+
protected getCartsApi(api: ByProjectKeyRequestBuilder, storeKey?: string): _commercetools_platform_sdk.ByProjectKeyInStoreKeyByStoreKeyCartsRequestBuilder | _commercetools_platform_sdk.ByProjectKeyCartsRequestBuilder;
|
|
318
|
+
read(context: ToolExecutionContext<TConfig>): Promise<Cart | CartPagedQueryResponse>;
|
|
319
|
+
create(context: ToolExecutionContext<TConfig>): Promise<Cart>;
|
|
320
|
+
update(context: ToolExecutionContext<TConfig>): Promise<Cart>;
|
|
321
|
+
delete(context: ToolExecutionContext<TConfig>): Promise<Cart>;
|
|
322
|
+
}
|
|
323
|
+
declare function readCarts<TConfig extends Configuration = Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Cart | CartPagedQueryResponse>;
|
|
324
|
+
declare function createCarts<TConfig extends Configuration = Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Cart>;
|
|
325
|
+
declare function updateCarts<TConfig extends Configuration = Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Cart>;
|
|
326
|
+
declare function deleteCarts<TConfig extends Configuration = Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Cart>;
|
|
327
|
+
|
|
328
|
+
declare class ChannelsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
322
329
|
protected readonly metadata: ResourceMetadata;
|
|
323
330
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
324
331
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -332,12 +339,12 @@ declare class ChannelsHandler<TConfig extends CommercetoolsConfig = Commercetool
|
|
|
332
339
|
update(context: ToolExecutionContext<TConfig>): Promise<Channel>;
|
|
333
340
|
delete(context: ToolExecutionContext<TConfig>): Promise<Channel>;
|
|
334
341
|
}
|
|
335
|
-
declare function readChannels<TConfig extends
|
|
336
|
-
declare function createChannels<TConfig extends
|
|
337
|
-
declare function updateChannels<TConfig extends
|
|
338
|
-
declare function deleteChannels<TConfig extends
|
|
342
|
+
declare function readChannels<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Channel | ChannelPagedQueryResponse>;
|
|
343
|
+
declare function createChannels<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Channel>;
|
|
344
|
+
declare function updateChannels<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Channel>;
|
|
345
|
+
declare function deleteChannels<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Channel>;
|
|
339
346
|
|
|
340
|
-
declare class CustomObjectsHandler<TConfig extends
|
|
347
|
+
declare class CustomObjectsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
341
348
|
protected readonly metadata: ResourceMetadata;
|
|
342
349
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
343
350
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -351,10 +358,10 @@ declare class CustomObjectsHandler<TConfig extends CommercetoolsConfig = Commerc
|
|
|
351
358
|
update(context: ToolExecutionContext<TConfig>): Promise<CustomObject>;
|
|
352
359
|
delete(context: ToolExecutionContext<TConfig>): Promise<CustomObject>;
|
|
353
360
|
}
|
|
354
|
-
declare function readCustomObjects<TConfig extends
|
|
355
|
-
declare function createCustomObjects<TConfig extends
|
|
356
|
-
declare function updateCustomObjects<TConfig extends
|
|
357
|
-
declare function deleteCustomObjects<TConfig extends
|
|
361
|
+
declare function readCustomObjects<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomObject | CustomObjectPagedQueryResponse>;
|
|
362
|
+
declare function createCustomObjects<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomObject>;
|
|
363
|
+
declare function updateCustomObjects<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomObject>;
|
|
364
|
+
declare function deleteCustomObjects<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomObject>;
|
|
358
365
|
|
|
359
366
|
/**
|
|
360
367
|
* Customers Resource Handler
|
|
@@ -374,7 +381,7 @@ declare function deleteCustomObjects<TConfig extends CommercetoolsConfig = Comme
|
|
|
374
381
|
* const handler = new CustomersHandler<MyConfig>();
|
|
375
382
|
* ```
|
|
376
383
|
*/
|
|
377
|
-
declare class CustomersHandler<TConfig extends
|
|
384
|
+
declare class CustomersHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
378
385
|
protected readonly metadata: ResourceMetadata;
|
|
379
386
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
380
387
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -388,16 +395,62 @@ declare class CustomersHandler<TConfig extends CommercetoolsConfig = Commercetoo
|
|
|
388
395
|
update(context: ToolExecutionContext<TConfig>): Promise<Customer>;
|
|
389
396
|
delete(context: ToolExecutionContext<TConfig>): Promise<Customer>;
|
|
390
397
|
}
|
|
391
|
-
declare function readCustomers<TConfig extends
|
|
392
|
-
declare function createCustomers<TConfig extends
|
|
393
|
-
declare function updateCustomers<TConfig extends
|
|
394
|
-
declare function deleteCustomers<TConfig extends
|
|
398
|
+
declare function readCustomers<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Customer | CustomerPagedQueryResponse>;
|
|
399
|
+
declare function createCustomers<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomerSignInResult>;
|
|
400
|
+
declare function updateCustomers<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Customer>;
|
|
401
|
+
declare function deleteCustomers<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Customer>;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Customer Groups Resource Handler
|
|
405
|
+
*/
|
|
406
|
+
declare class CustomerGroupsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
407
|
+
protected readonly metadata: ResourceMetadata;
|
|
408
|
+
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
409
|
+
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
410
|
+
name: string;
|
|
411
|
+
description: string;
|
|
412
|
+
inputSchema: ValidatableSchema;
|
|
413
|
+
};
|
|
414
|
+
protected getCustomerGroupsApi(api: ByProjectKeyRequestBuilder): _commercetools_platform_sdk.ByProjectKeyCustomerGroupsRequestBuilder;
|
|
415
|
+
read(context: ToolExecutionContext<TConfig>): Promise<CustomerGroup | CustomerGroupPagedQueryResponse>;
|
|
416
|
+
create(context: ToolExecutionContext<TConfig>): Promise<CustomerGroup>;
|
|
417
|
+
update(context: ToolExecutionContext<TConfig>): Promise<CustomerGroup>;
|
|
418
|
+
delete(context: ToolExecutionContext<TConfig>): Promise<CustomerGroup>;
|
|
419
|
+
}
|
|
420
|
+
declare function readCustomerGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomerGroup | CustomerGroupPagedQueryResponse>;
|
|
421
|
+
declare function createCustomerGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomerGroup>;
|
|
422
|
+
declare function updateCustomerGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomerGroup>;
|
|
423
|
+
declare function deleteCustomerGroups<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomerGroup>;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Customer Search Resource Handler
|
|
427
|
+
* Search-only: POST to customers/search. Create/update/delete are not supported.
|
|
428
|
+
* See: https://docs.commercetools.com/api/projects/customer-search
|
|
429
|
+
*/
|
|
430
|
+
declare class CustomerSearchHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
431
|
+
protected readonly metadata: ResourceMetadata;
|
|
432
|
+
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
433
|
+
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
434
|
+
name: string;
|
|
435
|
+
description: string;
|
|
436
|
+
inputSchema: ValidatableSchema;
|
|
437
|
+
};
|
|
438
|
+
protected getCustomerSearchApi(api: ByProjectKeyRequestBuilder): _commercetools_platform_sdk.ByProjectKeyCustomersSearchRequestBuilder;
|
|
439
|
+
read(context: ToolExecutionContext<TConfig>): Promise<CustomerPagedSearchResponse>;
|
|
440
|
+
create(context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
441
|
+
update(context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
442
|
+
delete(context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
443
|
+
}
|
|
444
|
+
declare function readCustomerSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<CustomerPagedSearchResponse>;
|
|
445
|
+
declare function createCustomerSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
446
|
+
declare function updateCustomerSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
447
|
+
declare function deleteCustomerSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
395
448
|
|
|
396
449
|
/**
|
|
397
450
|
* Discount Codes Resource Handler
|
|
398
451
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
399
452
|
*/
|
|
400
|
-
declare class DiscountCodesHandler<TConfig extends
|
|
453
|
+
declare class DiscountCodesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
401
454
|
protected readonly metadata: ResourceMetadata;
|
|
402
455
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
403
456
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -411,16 +464,16 @@ declare class DiscountCodesHandler<TConfig extends CommercetoolsConfig = Commerc
|
|
|
411
464
|
update(context: ToolExecutionContext<TConfig>): Promise<DiscountCode>;
|
|
412
465
|
delete(context: ToolExecutionContext<TConfig>): Promise<DiscountCode>;
|
|
413
466
|
}
|
|
414
|
-
declare function readDiscountCodes<TConfig extends
|
|
415
|
-
declare function createDiscountCodes<TConfig extends
|
|
416
|
-
declare function updateDiscountCodes<TConfig extends
|
|
417
|
-
declare function deleteDiscountCodes<TConfig extends
|
|
467
|
+
declare function readDiscountCodes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<DiscountCode | DiscountCodePagedQueryResponse>;
|
|
468
|
+
declare function createDiscountCodes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<DiscountCode>;
|
|
469
|
+
declare function updateDiscountCodes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<DiscountCode>;
|
|
470
|
+
declare function deleteDiscountCodes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<DiscountCode>;
|
|
418
471
|
|
|
419
472
|
/**
|
|
420
473
|
* Extensions Resource Handler
|
|
421
474
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
422
475
|
*/
|
|
423
|
-
declare class ExtensionsHandler<TConfig extends
|
|
476
|
+
declare class ExtensionsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
424
477
|
protected readonly metadata: ResourceMetadata;
|
|
425
478
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
426
479
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -434,16 +487,16 @@ declare class ExtensionsHandler<TConfig extends CommercetoolsConfig = Commerceto
|
|
|
434
487
|
update(context: ToolExecutionContext<TConfig>): Promise<Extension>;
|
|
435
488
|
delete(context: ToolExecutionContext<TConfig>): Promise<Extension>;
|
|
436
489
|
}
|
|
437
|
-
declare function readExtensions<TConfig extends
|
|
438
|
-
declare function createExtensions<TConfig extends
|
|
439
|
-
declare function updateExtensions<TConfig extends
|
|
440
|
-
declare function deleteExtensions<TConfig extends
|
|
490
|
+
declare function readExtensions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Extension | ExtensionPagedQueryResponse>;
|
|
491
|
+
declare function createExtensions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Extension>;
|
|
492
|
+
declare function updateExtensions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Extension>;
|
|
493
|
+
declare function deleteExtensions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Extension>;
|
|
441
494
|
|
|
442
495
|
/**
|
|
443
496
|
* Inventory Resource Handler
|
|
444
497
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
445
498
|
*/
|
|
446
|
-
declare class InventoryHandler<TConfig extends
|
|
499
|
+
declare class InventoryHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
447
500
|
protected readonly metadata: ResourceMetadata;
|
|
448
501
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
449
502
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -457,12 +510,12 @@ declare class InventoryHandler<TConfig extends CommercetoolsConfig = Commercetoo
|
|
|
457
510
|
update(context: ToolExecutionContext<TConfig>): Promise<InventoryEntry>;
|
|
458
511
|
delete(context: ToolExecutionContext<TConfig>): Promise<InventoryEntry>;
|
|
459
512
|
}
|
|
460
|
-
declare function readInventory<TConfig extends
|
|
461
|
-
declare function createInventory<TConfig extends
|
|
462
|
-
declare function updateInventory<TConfig extends
|
|
463
|
-
declare function deleteInventory<TConfig extends
|
|
513
|
+
declare function readInventory<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<InventoryEntry | InventoryPagedQueryResponse>;
|
|
514
|
+
declare function createInventory<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<InventoryEntry>;
|
|
515
|
+
declare function updateInventory<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<InventoryEntry>;
|
|
516
|
+
declare function deleteInventory<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<InventoryEntry>;
|
|
464
517
|
|
|
465
|
-
declare class MessagesHandler<TConfig extends
|
|
518
|
+
declare class MessagesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
466
519
|
protected readonly metadata: ResourceMetadata;
|
|
467
520
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
468
521
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -476,16 +529,16 @@ declare class MessagesHandler<TConfig extends CommercetoolsConfig = Commercetool
|
|
|
476
529
|
update(_context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
477
530
|
delete(_context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
478
531
|
}
|
|
479
|
-
declare function readMessages<TConfig extends
|
|
480
|
-
declare function createMessages<TConfig extends
|
|
481
|
-
declare function updateMessages<TConfig extends
|
|
482
|
-
declare function deleteMessages<TConfig extends
|
|
532
|
+
declare function readMessages<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Message | MessagePagedQueryResponse>;
|
|
533
|
+
declare function createMessages<TConfig extends Configuration>(_context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
534
|
+
declare function updateMessages<TConfig extends Configuration>(_context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
535
|
+
declare function deleteMessages<TConfig extends Configuration>(_context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
483
536
|
|
|
484
537
|
/**
|
|
485
538
|
* Product Discounts Resource Handler
|
|
486
539
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
487
540
|
*/
|
|
488
|
-
declare class ProductDiscountsHandler<TConfig extends
|
|
541
|
+
declare class ProductDiscountsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
489
542
|
protected readonly metadata: ResourceMetadata;
|
|
490
543
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
491
544
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -499,12 +552,12 @@ declare class ProductDiscountsHandler<TConfig extends CommercetoolsConfig = Comm
|
|
|
499
552
|
update(context: ToolExecutionContext<TConfig>): Promise<ProductDiscount>;
|
|
500
553
|
delete(context: ToolExecutionContext<TConfig>): Promise<ProductDiscount>;
|
|
501
554
|
}
|
|
502
|
-
declare function readProductDiscounts<TConfig extends
|
|
503
|
-
declare function createProductDiscounts<TConfig extends
|
|
504
|
-
declare function updateProductDiscounts<TConfig extends
|
|
505
|
-
declare function deleteProductDiscounts<TConfig extends
|
|
555
|
+
declare function readProductDiscounts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductDiscount | ProductDiscountPagedQueryResponse>;
|
|
556
|
+
declare function createProductDiscounts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductDiscount>;
|
|
557
|
+
declare function updateProductDiscounts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductDiscount>;
|
|
558
|
+
declare function deleteProductDiscounts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductDiscount>;
|
|
506
559
|
|
|
507
|
-
declare class ProductProjectionsHandler<TConfig extends
|
|
560
|
+
declare class ProductProjectionsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
508
561
|
protected readonly metadata: ResourceMetadata;
|
|
509
562
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
510
563
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -518,16 +571,16 @@ declare class ProductProjectionsHandler<TConfig extends CommercetoolsConfig = Co
|
|
|
518
571
|
update(_context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
519
572
|
delete(_context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
520
573
|
}
|
|
521
|
-
declare function readProductProjections<TConfig extends
|
|
522
|
-
declare function createProductProjections<TConfig extends
|
|
523
|
-
declare function updateProductProjections<TConfig extends
|
|
524
|
-
declare function deleteProductProjections<TConfig extends
|
|
574
|
+
declare function readProductProjections<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductProjection | ProductProjectionPagedSearchResponse>;
|
|
575
|
+
declare function createProductProjections<TConfig extends Configuration>(_context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
576
|
+
declare function updateProductProjections<TConfig extends Configuration>(_context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
577
|
+
declare function deleteProductProjections<TConfig extends Configuration>(_context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
525
578
|
|
|
526
579
|
/**
|
|
527
580
|
* Product Search Resource Handler
|
|
528
581
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
529
582
|
*/
|
|
530
|
-
declare class ProductSearchHandler<TConfig extends
|
|
583
|
+
declare class ProductSearchHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
531
584
|
protected readonly metadata: ResourceMetadata;
|
|
532
585
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
533
586
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -541,16 +594,16 @@ declare class ProductSearchHandler<TConfig extends CommercetoolsConfig = Commerc
|
|
|
541
594
|
update(context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
542
595
|
delete(context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
543
596
|
}
|
|
544
|
-
declare function readProductSearch<TConfig extends
|
|
545
|
-
declare function createProductSearch<TConfig extends
|
|
546
|
-
declare function updateProductSearch<TConfig extends
|
|
547
|
-
declare function deleteProductSearch<TConfig extends
|
|
597
|
+
declare function readProductSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductPagedSearchResponse>;
|
|
598
|
+
declare function createProductSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
599
|
+
declare function updateProductSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
600
|
+
declare function deleteProductSearch<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<never>;
|
|
548
601
|
|
|
549
602
|
/**
|
|
550
603
|
* Product Selections Resource Handler
|
|
551
604
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
552
605
|
*/
|
|
553
|
-
declare class ProductSelectionsHandler<TConfig extends
|
|
606
|
+
declare class ProductSelectionsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
554
607
|
protected readonly metadata: ResourceMetadata;
|
|
555
608
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
556
609
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -564,16 +617,16 @@ declare class ProductSelectionsHandler<TConfig extends CommercetoolsConfig = Com
|
|
|
564
617
|
update(context: ToolExecutionContext<TConfig>): Promise<ProductSelection>;
|
|
565
618
|
delete(context: ToolExecutionContext<TConfig>): Promise<ProductSelection>;
|
|
566
619
|
}
|
|
567
|
-
declare function readProductSelections<TConfig extends
|
|
568
|
-
declare function createProductSelections<TConfig extends
|
|
569
|
-
declare function updateProductSelections<TConfig extends
|
|
570
|
-
declare function deleteProductSelections<TConfig extends
|
|
620
|
+
declare function readProductSelections<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductSelection | ProductSelectionPagedQueryResponse>;
|
|
621
|
+
declare function createProductSelections<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductSelection>;
|
|
622
|
+
declare function updateProductSelections<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductSelection>;
|
|
623
|
+
declare function deleteProductSelections<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductSelection>;
|
|
571
624
|
|
|
572
625
|
/**
|
|
573
626
|
* Product Tailoring Resource Handler
|
|
574
627
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
575
628
|
*/
|
|
576
|
-
declare class ProductTailoringHandler<TConfig extends
|
|
629
|
+
declare class ProductTailoringHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
577
630
|
protected readonly metadata: ResourceMetadata;
|
|
578
631
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
579
632
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -587,16 +640,16 @@ declare class ProductTailoringHandler<TConfig extends CommercetoolsConfig = Comm
|
|
|
587
640
|
update(context: ToolExecutionContext<TConfig>): Promise<ProductTailoring>;
|
|
588
641
|
delete(context: ToolExecutionContext<TConfig>): Promise<ProductTailoring>;
|
|
589
642
|
}
|
|
590
|
-
declare function readProductTailoring<TConfig extends
|
|
591
|
-
declare function createProductTailoring<TConfig extends
|
|
592
|
-
declare function updateProductTailoring<TConfig extends
|
|
593
|
-
declare function deleteProductTailoring<TConfig extends
|
|
643
|
+
declare function readProductTailoring<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductTailoring | ProductTailoringPagedQueryResponse>;
|
|
644
|
+
declare function createProductTailoring<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductTailoring>;
|
|
645
|
+
declare function updateProductTailoring<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductTailoring>;
|
|
646
|
+
declare function deleteProductTailoring<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductTailoring>;
|
|
594
647
|
|
|
595
648
|
/**
|
|
596
649
|
* Product Types Resource Handler
|
|
597
650
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
598
651
|
*/
|
|
599
|
-
declare class ProductTypesHandler<TConfig extends
|
|
652
|
+
declare class ProductTypesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
600
653
|
protected readonly metadata: ResourceMetadata;
|
|
601
654
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
602
655
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -610,16 +663,16 @@ declare class ProductTypesHandler<TConfig extends CommercetoolsConfig = Commerce
|
|
|
610
663
|
update(context: ToolExecutionContext<TConfig>): Promise<ProductType>;
|
|
611
664
|
delete(context: ToolExecutionContext<TConfig>): Promise<ProductType>;
|
|
612
665
|
}
|
|
613
|
-
declare function readProductTypes<TConfig extends
|
|
614
|
-
declare function createProductTypes<TConfig extends
|
|
615
|
-
declare function updateProductTypes<TConfig extends
|
|
616
|
-
declare function deleteProductTypes<TConfig extends
|
|
666
|
+
declare function readProductTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductType | ProductTypePagedQueryResponse>;
|
|
667
|
+
declare function createProductTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductType>;
|
|
668
|
+
declare function updateProductTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductType>;
|
|
669
|
+
declare function deleteProductTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<ProductType>;
|
|
617
670
|
|
|
618
671
|
/**
|
|
619
672
|
* Products Resource Handler
|
|
620
673
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
621
674
|
*/
|
|
622
|
-
declare class ProductsHandler<TConfig extends
|
|
675
|
+
declare class ProductsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
623
676
|
protected readonly metadata: ResourceMetadata;
|
|
624
677
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
625
678
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -633,19 +686,19 @@ declare class ProductsHandler<TConfig extends CommercetoolsConfig = Commercetool
|
|
|
633
686
|
update(context: ToolExecutionContext<TConfig>): Promise<Product>;
|
|
634
687
|
delete(context: ToolExecutionContext<TConfig>): Promise<Product>;
|
|
635
688
|
}
|
|
636
|
-
declare function readProducts<TConfig extends
|
|
637
|
-
declare function createProducts<TConfig extends
|
|
638
|
-
declare function updateProducts<TConfig extends
|
|
639
|
-
declare function deleteProducts<TConfig extends
|
|
689
|
+
declare function readProducts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Product | ProductPagedQueryResponse>;
|
|
690
|
+
declare function createProducts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Product>;
|
|
691
|
+
declare function updateProducts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Product>;
|
|
692
|
+
declare function deleteProducts<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Product>;
|
|
640
693
|
|
|
641
694
|
/**
|
|
642
695
|
* Project Resource Handler
|
|
643
696
|
* Handles project read and update operations
|
|
644
|
-
* Generic over configuration type - defaults to
|
|
697
|
+
* Generic over configuration type - defaults to Configuration
|
|
645
698
|
*
|
|
646
699
|
* Automatically discovered via @ToolHandler() decorator
|
|
647
700
|
*/
|
|
648
|
-
declare class ProjectHandler<TConfig extends
|
|
701
|
+
declare class ProjectHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
649
702
|
protected readonly metadata: ResourceMetadata;
|
|
650
703
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
651
704
|
getToolDefinition(operation: 'read' | 'update'): {
|
|
@@ -658,14 +711,14 @@ declare class ProjectHandler<TConfig extends CommercetoolsConfig = Commercetools
|
|
|
658
711
|
create(_context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
659
712
|
delete(_context: ToolExecutionContext<TConfig>): Promise<never>;
|
|
660
713
|
}
|
|
661
|
-
declare function readProject<TConfig extends
|
|
662
|
-
declare function updateProject<TConfig extends
|
|
714
|
+
declare function readProject<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Project>;
|
|
715
|
+
declare function updateProject<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Project>;
|
|
663
716
|
|
|
664
717
|
/**
|
|
665
718
|
* Reviews Resource Handler
|
|
666
719
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
667
720
|
*/
|
|
668
|
-
declare class ReviewsHandler<TConfig extends
|
|
721
|
+
declare class ReviewsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
669
722
|
protected readonly metadata: ResourceMetadata;
|
|
670
723
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
671
724
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -679,12 +732,12 @@ declare class ReviewsHandler<TConfig extends CommercetoolsConfig = Commercetools
|
|
|
679
732
|
update(context: ToolExecutionContext<TConfig>): Promise<Review>;
|
|
680
733
|
delete(context: ToolExecutionContext<TConfig>): Promise<Review>;
|
|
681
734
|
}
|
|
682
|
-
declare function readReviews<TConfig extends
|
|
683
|
-
declare function createReviews<TConfig extends
|
|
684
|
-
declare function updateReviews<TConfig extends
|
|
685
|
-
declare function deleteReviews<TConfig extends
|
|
735
|
+
declare function readReviews<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Review | ReviewPagedQueryResponse>;
|
|
736
|
+
declare function createReviews<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Review>;
|
|
737
|
+
declare function updateReviews<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Review>;
|
|
738
|
+
declare function deleteReviews<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Review>;
|
|
686
739
|
|
|
687
|
-
declare class StandalonePricesHandler<TConfig extends
|
|
740
|
+
declare class StandalonePricesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
688
741
|
protected readonly metadata: ResourceMetadata;
|
|
689
742
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
690
743
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -698,12 +751,12 @@ declare class StandalonePricesHandler<TConfig extends CommercetoolsConfig = Comm
|
|
|
698
751
|
update(context: ToolExecutionContext<TConfig>): Promise<StandalonePrice>;
|
|
699
752
|
delete(context: ToolExecutionContext<TConfig>): Promise<StandalonePrice>;
|
|
700
753
|
}
|
|
701
|
-
declare function readStandalonePrices<TConfig extends
|
|
702
|
-
declare function createStandalonePrices<TConfig extends
|
|
703
|
-
declare function updateStandalonePrices<TConfig extends
|
|
704
|
-
declare function deleteStandalonePrices<TConfig extends
|
|
754
|
+
declare function readStandalonePrices<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<StandalonePrice | StandalonePricePagedQueryResponse>;
|
|
755
|
+
declare function createStandalonePrices<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<StandalonePrice>;
|
|
756
|
+
declare function updateStandalonePrices<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<StandalonePrice>;
|
|
757
|
+
declare function deleteStandalonePrices<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<StandalonePrice>;
|
|
705
758
|
|
|
706
|
-
declare class StatesHandler<TConfig extends
|
|
759
|
+
declare class StatesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
707
760
|
protected readonly metadata: ResourceMetadata;
|
|
708
761
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
709
762
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -717,12 +770,12 @@ declare class StatesHandler<TConfig extends CommercetoolsConfig = CommercetoolsC
|
|
|
717
770
|
update(context: ToolExecutionContext<TConfig>): Promise<State>;
|
|
718
771
|
delete(context: ToolExecutionContext<TConfig>): Promise<State>;
|
|
719
772
|
}
|
|
720
|
-
declare function readStates<TConfig extends
|
|
721
|
-
declare function createStates<TConfig extends
|
|
722
|
-
declare function updateStates<TConfig extends
|
|
723
|
-
declare function deleteStates<TConfig extends
|
|
773
|
+
declare function readStates<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<State | StatePagedQueryResponse>;
|
|
774
|
+
declare function createStates<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<State>;
|
|
775
|
+
declare function updateStates<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<State>;
|
|
776
|
+
declare function deleteStates<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<State>;
|
|
724
777
|
|
|
725
|
-
declare class StoresHandler<TConfig extends
|
|
778
|
+
declare class StoresHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
726
779
|
protected readonly metadata: ResourceMetadata;
|
|
727
780
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
728
781
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -736,12 +789,12 @@ declare class StoresHandler<TConfig extends CommercetoolsConfig = CommercetoolsC
|
|
|
736
789
|
update(context: ToolExecutionContext<TConfig>): Promise<Store>;
|
|
737
790
|
delete(context: ToolExecutionContext<TConfig>): Promise<Store>;
|
|
738
791
|
}
|
|
739
|
-
declare function readStores<TConfig extends
|
|
740
|
-
declare function createStores<TConfig extends
|
|
741
|
-
declare function updateStores<TConfig extends
|
|
742
|
-
declare function deleteStores<TConfig extends
|
|
792
|
+
declare function readStores<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Store | StorePagedQueryResponse>;
|
|
793
|
+
declare function createStores<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Store>;
|
|
794
|
+
declare function updateStores<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Store>;
|
|
795
|
+
declare function deleteStores<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Store>;
|
|
743
796
|
|
|
744
|
-
declare class SubscriptionsHandler<TConfig extends
|
|
797
|
+
declare class SubscriptionsHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
745
798
|
protected readonly metadata: ResourceMetadata;
|
|
746
799
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
747
800
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -755,16 +808,16 @@ declare class SubscriptionsHandler<TConfig extends CommercetoolsConfig = Commerc
|
|
|
755
808
|
update(context: ToolExecutionContext<TConfig>): Promise<Subscription>;
|
|
756
809
|
delete(context: ToolExecutionContext<TConfig>): Promise<Subscription>;
|
|
757
810
|
}
|
|
758
|
-
declare function readSubscriptions<TConfig extends
|
|
759
|
-
declare function createSubscriptions<TConfig extends
|
|
760
|
-
declare function updateSubscriptions<TConfig extends
|
|
761
|
-
declare function deleteSubscriptions<TConfig extends
|
|
811
|
+
declare function readSubscriptions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Subscription | SubscriptionPagedQueryResponse>;
|
|
812
|
+
declare function createSubscriptions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Subscription>;
|
|
813
|
+
declare function updateSubscriptions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Subscription>;
|
|
814
|
+
declare function deleteSubscriptions<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Subscription>;
|
|
762
815
|
|
|
763
816
|
/**
|
|
764
817
|
* Tax Categories Resource Handler
|
|
765
818
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
766
819
|
*/
|
|
767
|
-
declare class TaxCategoriesHandler<TConfig extends
|
|
820
|
+
declare class TaxCategoriesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
768
821
|
protected readonly metadata: ResourceMetadata;
|
|
769
822
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
770
823
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -778,16 +831,16 @@ declare class TaxCategoriesHandler<TConfig extends CommercetoolsConfig = Commerc
|
|
|
778
831
|
update(context: ToolExecutionContext<TConfig>): Promise<TaxCategory>;
|
|
779
832
|
delete(context: ToolExecutionContext<TConfig>): Promise<TaxCategory>;
|
|
780
833
|
}
|
|
781
|
-
declare function readTaxCategories<TConfig extends
|
|
782
|
-
declare function createTaxCategories<TConfig extends
|
|
783
|
-
declare function updateTaxCategories<TConfig extends
|
|
784
|
-
declare function deleteTaxCategories<TConfig extends
|
|
834
|
+
declare function readTaxCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<TaxCategory | TaxCategoryPagedQueryResponse>;
|
|
835
|
+
declare function createTaxCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<TaxCategory>;
|
|
836
|
+
declare function updateTaxCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<TaxCategory>;
|
|
837
|
+
declare function deleteTaxCategories<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<TaxCategory>;
|
|
785
838
|
|
|
786
839
|
/**
|
|
787
840
|
* Types Resource Handler
|
|
788
841
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
789
842
|
*/
|
|
790
|
-
declare class TypesHandler<TConfig extends
|
|
843
|
+
declare class TypesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
791
844
|
protected readonly metadata: ResourceMetadata;
|
|
792
845
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
793
846
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -801,16 +854,16 @@ declare class TypesHandler<TConfig extends CommercetoolsConfig = CommercetoolsCo
|
|
|
801
854
|
update(context: ToolExecutionContext<TConfig>): Promise<Type>;
|
|
802
855
|
delete(context: ToolExecutionContext<TConfig>): Promise<Type>;
|
|
803
856
|
}
|
|
804
|
-
declare function readTypes<TConfig extends
|
|
805
|
-
declare function createTypes<TConfig extends
|
|
806
|
-
declare function updateTypes<TConfig extends
|
|
807
|
-
declare function deleteTypes<TConfig extends
|
|
857
|
+
declare function readTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Type | TypePagedQueryResponse>;
|
|
858
|
+
declare function createTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Type>;
|
|
859
|
+
declare function updateTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Type>;
|
|
860
|
+
declare function deleteTypes<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Type>;
|
|
808
861
|
|
|
809
862
|
/**
|
|
810
863
|
* Zones Resource Handler
|
|
811
864
|
* Generic over configuration type - defaults to CommercetoolsConfig
|
|
812
865
|
*/
|
|
813
|
-
declare class ZonesHandler<TConfig extends
|
|
866
|
+
declare class ZonesHandler<TConfig extends Configuration = Configuration> extends CommercetoolsResourceHandler<TConfig> {
|
|
814
867
|
protected readonly metadata: ResourceMetadata;
|
|
815
868
|
constructor(apiClientFactory?: IApiClientFactory<TConfig>);
|
|
816
869
|
getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
|
|
@@ -824,12 +877,13 @@ declare class ZonesHandler<TConfig extends CommercetoolsConfig = CommercetoolsCo
|
|
|
824
877
|
update(context: ToolExecutionContext<TConfig>): Promise<Zone>;
|
|
825
878
|
delete(context: ToolExecutionContext<TConfig>): Promise<Zone>;
|
|
826
879
|
}
|
|
827
|
-
declare function readZones<TConfig extends
|
|
828
|
-
declare function createZones<TConfig extends
|
|
829
|
-
declare function updateZones<TConfig extends
|
|
830
|
-
declare function deleteZones<TConfig extends
|
|
880
|
+
declare function readZones<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Zone | ZonePagedQueryResponse>;
|
|
881
|
+
declare function createZones<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Zone>;
|
|
882
|
+
declare function updateZones<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Zone>;
|
|
883
|
+
declare function deleteZones<TConfig extends Configuration>(context: ToolExecutionContext<TConfig>, apiClientFactory?: IApiClientFactory<TConfig>): Promise<Zone>;
|
|
831
884
|
|
|
832
885
|
declare const TOOL_NAME_PREFIX = "";
|
|
833
886
|
declare const OPERATIONS: string[];
|
|
887
|
+
declare const DEFAULT_API_URL = "https://api.europe-west1.gcp.commercetools.com";
|
|
834
888
|
|
|
835
|
-
export { ApiClientFactory, type ApiRootFn, AttributeGroupsHandler, BaseResourceHandler, CategoriesHandler, ChannelsHandler, CommercetoolsAPIClient, type
|
|
889
|
+
export { ApiClientFactory, type ApiRootFn, AttributeGroupsHandler, BaseResourceHandler, CartsHandler, CategoriesHandler, ChannelsHandler, CommercetoolsAPIClient, type Configuration, CustomObjectsHandler, CustomerGroupsHandler, CustomerSearchHandler, CustomersHandler, DEFAULT_API_URL, DiscountCodesHandler, ExtensionsHandler, type IApiClientFactory, type IConstructor, type IErrorConstructor, InventoryHandler, MessagesHandler, OPERATIONS, ProductDiscountsHandler, ProductProjectionsHandler, ProductSearchHandler, ProductSelectionsHandler, ProductTailoringHandler, ProductTypesHandler, ProductsHandler, ProjectHandler, type ResourceMetadata, type ResourceSchema, ReviewsHandler, StandalonePricesHandler, StatesHandler, StoresHandler, SubscriptionsHandler, TOOL_NAME_PREFIX, TaxCategoriesHandler, type ToolExecutionContext, ToolExecutionError, ToolHandler, type ToolOperation, TypesHandler, type ValidatableResourceSchema, type ValidatableSchema, ZonesHandler, createAttributeGroups, createCarts, createCategories, createChannels, createCustomObjects, createCustomerGroups, createCustomerSearch, createCustomers, createDiscountCodes, createExtensions, createInventory, createMessages, createProductDiscounts, createProductProjections, createProductSearch, createProductSelections, createProductTailoring, createProductTypes, createProducts, createReviews, createStandalonePrices, createStates, createStores, createSubscriptions, createTaxCategories, createTypes, createZones, deleteAttributeGroups, deleteCarts, deleteCategories, deleteChannels, deleteCustomObjects, deleteCustomerGroups, deleteCustomerSearch, deleteCustomers, deleteDiscountCodes, deleteExtensions, deleteInventory, deleteMessages, deleteProductDiscounts, deleteProductProjections, deleteProductSearch, deleteProductSelections, deleteProductTailoring, deleteProductTypes, deleteProducts, deleteReviews, deleteStandalonePrices, deleteStates, deleteStores, deleteSubscriptions, deleteTaxCategories, deleteTypes, deleteZones, getDecoratorRegisteredHandlers, readAttributeGroups, readCarts, readCategories, readChannels, readCustomObjects, readCustomerGroups, readCustomerSearch, readCustomers, readDiscountCodes, readExtensions, readInventory, readMessages, readProductDiscounts, readProductProjections, readProductSearch, readProductSelections, readProductTailoring, readProductTypes, readProducts, readProject, readReviews, readStandalonePrices, readStates, readStores, readSubscriptions, readTaxCategories, readTypes, readZones, updateAttributeGroups, updateCarts, updateCategories, updateChannels, updateCustomObjects, updateCustomerGroups, updateCustomerSearch, updateCustomers, updateDiscountCodes, updateExtensions, updateInventory, updateMessages, updateProductDiscounts, updateProductProjections, updateProductSearch, updateProductSelections, updateProductTailoring, updateProductTypes, updateProducts, updateProject, updateReviews, updateStandalonePrices, updateStates, updateStores, updateSubscriptions, updateTaxCategories, updateTypes, updateZones };
|