@commercetools/tools-core 0.0.1 → 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.
Files changed (30) hide show
  1. package/dist/index.cjs +11290 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +889 -0
  4. package/dist/index.d.ts +889 -5
  5. package/dist/index.js +7137 -1
  6. package/package.json +16 -11
  7. package/dist/decorators/test/tool.decorator.test.d.ts +0 -1
  8. package/dist/decorators/tool.decorator.d.ts +0 -26
  9. package/dist/handlers/base.handler.d.ts +0 -34
  10. package/dist/handlers/commercetools.handler.d.ts +0 -16
  11. package/dist/handlers/test/base.handler.test.d.ts +0 -1
  12. package/dist/handlers/test/commercetools.handler.test.d.ts +0 -1
  13. package/dist/handlers/test/fixtures.d.ts +0 -24
  14. package/dist/resources/customer/customer.handler.d.ts +0 -22
  15. package/dist/resources/customer/customer.prompt.d.ts +0 -4
  16. package/dist/resources/customer/customer.schema.d.ts +0 -281
  17. package/dist/resources/customer/test/customer.hander.test.d.ts +0 -1
  18. package/dist/resources/customer/test/fixtures.d.ts +0 -2
  19. package/dist/resources/project/project.handler.d.ts +0 -26
  20. package/dist/resources/project/project.prompt.d.ts +0 -2
  21. package/dist/resources/project/project.schema.d.ts +0 -454
  22. package/dist/resources/project/test/fixtures.d.ts +0 -2
  23. package/dist/resources/project/test/project.handler.test.d.ts +0 -1
  24. package/dist/shared/client/client.base.d.ts +0 -9
  25. package/dist/shared/client/sdk.commercetools.d.ts +0 -31
  26. package/dist/shared/errors/tool.error.d.ts +0 -34
  27. package/dist/shared/index.d.ts +0 -5
  28. package/dist/shared/types/interface.d.ts +0 -57
  29. package/dist/shared/types/types.d.ts +0 -4
  30. package/dist/utils/constants.d.ts +0 -1
package/package.json CHANGED
@@ -1,32 +1,37 @@
1
1
  {
2
2
  "name": "@commercetools/tools-core",
3
3
  "description": "commercetools tool system core",
4
- "version": "0.0.1",
4
+ "version": "0.0.4",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "type": "module",
9
- "packageManager": "yarn@4.9.2",
9
+ "packageManager": "yarn@4.9.1",
10
10
  "engines": {
11
11
  "node": ">=18"
12
12
  },
13
+ "files": [
14
+ "dist",
15
+ "README.md"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
13
20
  "dependencies": {
14
21
  "@commercetools/platform-sdk": "^8.23.0",
15
22
  "@commercetools/ts-client": "^4.8.0",
16
23
  "zod": "^3.22.0"
17
24
  },
18
- "devDependencies": {
19
- "@types/node": "^25.0.9",
20
- "esbuild": "^0.27.2",
21
- "typescript": "^4.6.2"
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js",
29
+ "require": "./dist/index.cjs.js"
30
+ }
22
31
  },
23
- "files": [
24
- "dist",
25
- "README.md"
26
- ],
27
32
  "scripts": {
28
33
  "clean": "rm -rf dist",
29
- "build": "yarn clean;tsc && node esbuild.cjs",
34
+ "build": "yarn clean;tsup",
30
35
  "typecheck": "tsc --noEmit",
31
36
  "test": "jest --config jest.config.cjs --runInBand"
32
37
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- import { type IConstructor, type Configuration } from '../shared';
2
- import { type BaseResourceHandler } from '../handlers/base.handler';
3
- /**
4
- * Decorator to automatically register a tool handler
5
- *
6
- * Usage:
7
- * ```typescript
8
- * @ToolHandler()
9
- * export class CustomerHandler extends BaseResourceHandler {
10
- * // ...
11
- * }
12
- * ```
13
- *
14
- * The handler will be automatically discovered and registered
15
- * when the module is loaded.
16
- */
17
- export declare function ToolHandler(): <T extends IConstructor<BaseResourceHandler<Configuration>>>(constructor: T) => T;
18
- /**
19
- * Get all handlers registered via decorator
20
- * This is called by ToolDiscovery to register all decorated handlers
21
- */
22
- export declare function getDecoratorRegisteredHandlers(): BaseResourceHandler<Configuration>[];
23
- /**
24
- * Clear the decorator registry (mainly for testing)
25
- */
26
- export declare function clearDecoratorRegistry(): void;
@@ -1,34 +0,0 @@
1
- import { ToolExecutionContext, ResourceMetadata, ToolHandler, ToolOperation } from '../shared';
2
- /**
3
- * Generic base handler - NO API client logic
4
- * Only handles tool routing, validation, and naming
5
- */
6
- export declare abstract class BaseResourceHandler<TConfig = unknown> implements ToolHandler<TConfig> {
7
- protected abstract readonly metadata: ResourceMetadata;
8
- abstract read(context: ToolExecutionContext<TConfig>): Promise<unknown>;
9
- abstract create(context: ToolExecutionContext<TConfig>): Promise<unknown>;
10
- abstract update(context: ToolExecutionContext<TConfig>): Promise<unknown>;
11
- abstract delete(context: ToolExecutionContext<TConfig>): Promise<unknown>;
12
- protected getToolName(operation: ToolOperation): string;
13
- protected getOperation(toolName: string): ToolOperation | null;
14
- execute(context: ToolExecutionContext<TConfig>): Promise<unknown>;
15
- getAllToolNames(): string[];
16
- getToolDefinition(operation: ToolOperation): {
17
- name: string;
18
- description: string;
19
- inputSchema: import("zod").ZodObject<Record<string, import("zod").ZodTypeAny>, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
20
- [x: string]: any;
21
- }, {
22
- [x: string]: any;
23
- }>;
24
- };
25
- getAllToolDefinitions(): {
26
- name: string;
27
- description: string;
28
- inputSchema: import("zod").ZodObject<Record<string, import("zod").ZodTypeAny>, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
29
- [x: string]: any;
30
- }, {
31
- [x: string]: any;
32
- }>;
33
- }[];
34
- }
@@ -1,16 +0,0 @@
1
- import { ApiRoot } from '@commercetools/platform-sdk';
2
- import { type Configuration, type IApiClientFactory, type ToolExecutionContext } from '../shared';
3
- import { BaseResourceHandler } from './base.handler';
4
- /**
5
- * Commercetools-specific resource handler
6
- * Extends BaseResourceHandler with commercetools API client functionality
7
- * This is an abstract class - subclasses must implement the CRUD methods
8
- */
9
- export declare abstract class CommercetoolsResourceHandler extends BaseResourceHandler<Configuration> {
10
- protected apiClientFactory: IApiClientFactory<Configuration>;
11
- constructor(apiClientFactory?: IApiClientFactory<Configuration>);
12
- /**
13
- * Get the API root instance for commercetools
14
- */
15
- protected getApiRoot(context: ToolExecutionContext<Configuration>): ApiRoot;
16
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- /// <reference types="jest" />
2
- import { ApiRoot } from '@commercetools/platform-sdk';
3
- import { ResourceMetadata, ToolExecutionContext } from '../../shared';
4
- import { type Configuration, type IApiClientFactory } from '../../shared';
5
- import { CommercetoolsResourceHandler } from '../../handlers/commercetools.handler';
6
- import { BaseResourceHandler } from '../..';
7
- export declare class TestHandler extends BaseResourceHandler {
8
- protected readonly metadata: ResourceMetadata;
9
- read(_context: ToolExecutionContext): Promise<unknown>;
10
- create(_context: ToolExecutionContext): Promise<unknown>;
11
- update(_context: ToolExecutionContext): Promise<unknown>;
12
- delete(_context: ToolExecutionContext): Promise<unknown>;
13
- }
14
- export declare const mockApiRoot: ApiRoot;
15
- export declare class MockApiClientFactory implements IApiClientFactory<Configuration> {
16
- createApiClient: jest.Mock<ApiRoot, [_config: Configuration, _token: string], any>;
17
- }
18
- export declare class TestCommercetoolsHandler extends CommercetoolsResourceHandler {
19
- protected readonly metadata: ResourceMetadata;
20
- read(context: ToolExecutionContext<Configuration>): Promise<unknown>;
21
- create(_context: ToolExecutionContext<Configuration>): Promise<unknown>;
22
- update(_context: ToolExecutionContext<Configuration>): Promise<unknown>;
23
- delete(_context: ToolExecutionContext<Configuration>): Promise<unknown>;
24
- }
@@ -1,22 +0,0 @@
1
- import { z } from 'zod';
2
- import { type Customer, type CustomerPagedQueryResponse, type ByProjectKeyRequestBuilder } from '@commercetools/platform-sdk';
3
- import { IApiClientFactory, type ResourceMetadata, type ToolExecutionContext, type Configuration } from '../../shared';
4
- import { CommercetoolsResourceHandler } from '../../handlers/commercetools.handler';
5
- export declare class CustomerHandler extends CommercetoolsResourceHandler {
6
- protected readonly metadata: ResourceMetadata;
7
- constructor(apiClientFactory?: IApiClientFactory<Configuration>);
8
- getToolDefinition(operation: 'read' | 'create' | 'update' | 'delete'): {
9
- name: string;
10
- description: string;
11
- inputSchema: z.ZodObject<Record<string, z.ZodTypeAny>, z.UnknownKeysParam, z.ZodTypeAny, {
12
- [x: string]: any;
13
- }, {
14
- [x: string]: any;
15
- }>;
16
- };
17
- protected getCustomersApi(api: ByProjectKeyRequestBuilder, storeKey?: string): import("@commercetools/platform-sdk").ByProjectKeyInStoreKeyByStoreKeyCustomersRequestBuilder | import("@commercetools/platform-sdk").ByProjectKeyCustomersRequestBuilder;
18
- read(context: ToolExecutionContext<Configuration>): Promise<Customer | CustomerPagedQueryResponse>;
19
- create(context: ToolExecutionContext<Configuration>): Promise<unknown>;
20
- update(context: ToolExecutionContext<Configuration>): Promise<unknown>;
21
- delete(context: ToolExecutionContext<Configuration>): Promise<unknown>;
22
- }
@@ -1,4 +0,0 @@
1
- export declare const readCustomerPrompt = "\nThis tool will fetch a Customer by ID (ID or key if provided) from commercetools or a specific store in commercetools or query all available customers in a commercetools project if no arquments or parameters are provided.\n\nIt takes these optional arguments:\n- id (string, optional): The ID of the customer to fetch.\n- storeKey (string, optional): The key of the store to fetch the customer from.\n- where (array of strings, optional): Query predicates specified as strings. Example: [\"email = \\\"customer@example.com\\\"\"]\n- sort (array of strings, optional): Sort criteria for the results. Example: [\"firstName asc\", \"createdAt desc\"]\n- limit (integer, optional): A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 10.\n- offset (integer, optional): The number of items to skip before starting to collect the result set.\n- expand (array of strings, optional): Fields to expand. Example: [\"customerGroup\"]\n";
2
- export declare const createCustomerPrompt = "\nThis tool will create a new Customer in commercetools or a specific store in commercetools.\n\nIt takes these required arguments:\n- email (string): Customer email address.\n- password (string): Customer password.\n\nIt takes these optional arguments:\n- storeKey (string, optional): The key of the store to create the customer in.\n- firstName (string, optional): Customer first name.\n- lastName (string, optional): Customer last name.\n- middleName (string, optional): Customer middle name.\n- title (string, optional): Customer title (e.g., Mr., Mrs., Dr.).\n- dateOfBirth (string, optional): Customer date of birth in ISO 8601 format (YYYY-MM-DD).\n- companyName (string, optional): Customer company name.\n- vatId (string, optional): Customer VAT identification number.\n- addresses (array, optional): An array of customer addresses.\n- defaultShippingAddress (integer, optional): Index of default shipping address in the addresses array.\n- defaultBillingAddress (integer, optional): Index of default billing address in the addresses array.\n- shippingAddresses (array of integers, optional): Indices of shipping addresses in the addresses array.\n- billingAddresses (array of integers, optional): Indices of billing addresses in the addresses array.\n- isEmailVerified (boolean, optional): Whether the customer email is verified.\n- externalId (string, optional): Customer external ID.\n- customerGroup (object, optional): Customer group reference.\n- custom (object, optional): Custom fields.\n- locale (string, optional): Customer locale.\n- salutation (string, optional): Customer salutation.\n- key (string, optional): Customer key.\n";
3
- export declare const updateCustomerPrompt = "\nThis tool will update a Customer in commercetools using update actions from the commercetools API.\n\nIt takes these required arguments:\n- id (string): The ID of the customer to update.\n- version (integer): The current version of the customer.\n- actions (array): An array of update actions to perform on the customer. Each action should have an \"action\" field indicating the action type.\n\nExample actions from commercetools API include:\n- addAddress\n- addBillingAddressId\n- addShippingAddressId\n- changeAddress\n- changeEmail\n- removeAddress\n- removeBillingAddressId\n- removeShippingAddressId\n- setCompanyName\n- setCustomField\n- setCustomType\n- setDateOfBirth\n- setDefaultBillingAddress\n- setDefaultShippingAddress\n- setFirstName\n- setLastName\n- setLocale\n- setMiddleName\n- setSalutation\n- setTitle\n- setVatId\n\nEach action type requires specific fields according to the commercetools API.\n";
4
- export declare const deleteCustomerPrompt = "\nThis tool will delete a Customer from commercetools.\n\nIt takes these required arguments:\n- id (string): The ID of the customer to delete.\n- version (integer): The current version of the customer (for optimistic locking).\n\nIt takes these optional arguments:\n- dataErasure (boolean, optional): Delete personal data.\n";
@@ -1,281 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const readCustomerParameters: z.ZodObject<{
3
- id: z.ZodOptional<z.ZodString>;
4
- key: z.ZodOptional<z.ZodString>;
5
- storeKey: z.ZodOptional<z.ZodString>;
6
- where: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
- sort: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
- limit: z.ZodOptional<z.ZodNumber>;
9
- offset: z.ZodOptional<z.ZodNumber>;
10
- expand: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
- }, "strip", z.ZodTypeAny, {
12
- sort?: string[];
13
- id?: string;
14
- key?: string;
15
- storeKey?: string;
16
- where?: string[];
17
- limit?: number;
18
- offset?: number;
19
- expand?: string[];
20
- }, {
21
- sort?: string[];
22
- id?: string;
23
- key?: string;
24
- storeKey?: string;
25
- where?: string[];
26
- limit?: number;
27
- offset?: number;
28
- expand?: string[];
29
- }>;
30
- export declare const createCustomerParameters: z.ZodObject<{
31
- email: z.ZodString;
32
- storeKey: z.ZodOptional<z.ZodString>;
33
- password: z.ZodString;
34
- firstName: z.ZodOptional<z.ZodString>;
35
- lastName: z.ZodOptional<z.ZodString>;
36
- middleName: z.ZodOptional<z.ZodString>;
37
- title: z.ZodOptional<z.ZodString>;
38
- dateOfBirth: z.ZodOptional<z.ZodString>;
39
- companyName: z.ZodOptional<z.ZodString>;
40
- vatId: z.ZodOptional<z.ZodString>;
41
- addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
- streetName: z.ZodString;
43
- streetNumber: z.ZodOptional<z.ZodString>;
44
- additionalStreetInfo: z.ZodOptional<z.ZodString>;
45
- postalCode: z.ZodString;
46
- city: z.ZodString;
47
- region: z.ZodOptional<z.ZodString>;
48
- state: z.ZodOptional<z.ZodString>;
49
- country: z.ZodString;
50
- company: z.ZodOptional<z.ZodString>;
51
- department: z.ZodOptional<z.ZodString>;
52
- building: z.ZodOptional<z.ZodString>;
53
- apartment: z.ZodOptional<z.ZodString>;
54
- pOBox: z.ZodOptional<z.ZodString>;
55
- phone: z.ZodOptional<z.ZodString>;
56
- mobile: z.ZodOptional<z.ZodString>;
57
- email: z.ZodOptional<z.ZodString>;
58
- fax: z.ZodOptional<z.ZodString>;
59
- additionalAddressInfo: z.ZodOptional<z.ZodString>;
60
- }, "strip", z.ZodTypeAny, {
61
- email?: string;
62
- streetName?: string;
63
- streetNumber?: string;
64
- additionalStreetInfo?: string;
65
- postalCode?: string;
66
- city?: string;
67
- region?: string;
68
- state?: string;
69
- country?: string;
70
- company?: string;
71
- department?: string;
72
- building?: string;
73
- apartment?: string;
74
- pOBox?: string;
75
- phone?: string;
76
- mobile?: string;
77
- fax?: string;
78
- additionalAddressInfo?: string;
79
- }, {
80
- email?: string;
81
- streetName?: string;
82
- streetNumber?: string;
83
- additionalStreetInfo?: string;
84
- postalCode?: string;
85
- city?: string;
86
- region?: string;
87
- state?: string;
88
- country?: string;
89
- company?: string;
90
- department?: string;
91
- building?: string;
92
- apartment?: string;
93
- pOBox?: string;
94
- phone?: string;
95
- mobile?: string;
96
- fax?: string;
97
- additionalAddressInfo?: string;
98
- }>, "many">>;
99
- defaultShippingAddress: z.ZodOptional<z.ZodNumber>;
100
- defaultBillingAddress: z.ZodOptional<z.ZodNumber>;
101
- shippingAddresses: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
102
- billingAddresses: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
103
- isEmailVerified: z.ZodOptional<z.ZodBoolean>;
104
- externalId: z.ZodOptional<z.ZodString>;
105
- customerGroup: z.ZodOptional<z.ZodObject<{
106
- id: z.ZodString;
107
- typeId: z.ZodLiteral<"customer-group">;
108
- }, "strip", z.ZodTypeAny, {
109
- id?: string;
110
- typeId?: "customer-group";
111
- }, {
112
- id?: string;
113
- typeId?: "customer-group";
114
- }>>;
115
- custom: z.ZodOptional<z.ZodObject<{
116
- type: z.ZodObject<{
117
- id: z.ZodString;
118
- typeId: z.ZodLiteral<"type">;
119
- }, "strip", z.ZodTypeAny, {
120
- id?: string;
121
- typeId?: "type";
122
- }, {
123
- id?: string;
124
- typeId?: "type";
125
- }>;
126
- fields: z.ZodRecord<z.ZodString, z.ZodAny>;
127
- }, "strip", z.ZodTypeAny, {
128
- type?: {
129
- id?: string;
130
- typeId?: "type";
131
- };
132
- fields?: Record<string, any>;
133
- }, {
134
- type?: {
135
- id?: string;
136
- typeId?: "type";
137
- };
138
- fields?: Record<string, any>;
139
- }>>;
140
- locale: z.ZodOptional<z.ZodString>;
141
- salutation: z.ZodOptional<z.ZodString>;
142
- key: z.ZodOptional<z.ZodString>;
143
- }, "strip", z.ZodTypeAny, {
144
- key?: string;
145
- storeKey?: string;
146
- email?: string;
147
- password?: string;
148
- firstName?: string;
149
- lastName?: string;
150
- middleName?: string;
151
- title?: string;
152
- dateOfBirth?: string;
153
- companyName?: string;
154
- vatId?: string;
155
- custom?: {
156
- type?: {
157
- id?: string;
158
- typeId?: "type";
159
- };
160
- fields?: Record<string, any>;
161
- };
162
- addresses?: {
163
- email?: string;
164
- streetName?: string;
165
- streetNumber?: string;
166
- additionalStreetInfo?: string;
167
- postalCode?: string;
168
- city?: string;
169
- region?: string;
170
- state?: string;
171
- country?: string;
172
- company?: string;
173
- department?: string;
174
- building?: string;
175
- apartment?: string;
176
- pOBox?: string;
177
- phone?: string;
178
- mobile?: string;
179
- fax?: string;
180
- additionalAddressInfo?: string;
181
- }[];
182
- defaultShippingAddress?: number;
183
- defaultBillingAddress?: number;
184
- shippingAddresses?: number[];
185
- billingAddresses?: number[];
186
- isEmailVerified?: boolean;
187
- externalId?: string;
188
- customerGroup?: {
189
- id?: string;
190
- typeId?: "customer-group";
191
- };
192
- locale?: string;
193
- salutation?: string;
194
- }, {
195
- key?: string;
196
- storeKey?: string;
197
- email?: string;
198
- password?: string;
199
- firstName?: string;
200
- lastName?: string;
201
- middleName?: string;
202
- title?: string;
203
- dateOfBirth?: string;
204
- companyName?: string;
205
- vatId?: string;
206
- custom?: {
207
- type?: {
208
- id?: string;
209
- typeId?: "type";
210
- };
211
- fields?: Record<string, any>;
212
- };
213
- addresses?: {
214
- email?: string;
215
- streetName?: string;
216
- streetNumber?: string;
217
- additionalStreetInfo?: string;
218
- postalCode?: string;
219
- city?: string;
220
- region?: string;
221
- state?: string;
222
- country?: string;
223
- company?: string;
224
- department?: string;
225
- building?: string;
226
- apartment?: string;
227
- pOBox?: string;
228
- phone?: string;
229
- mobile?: string;
230
- fax?: string;
231
- additionalAddressInfo?: string;
232
- }[];
233
- defaultShippingAddress?: number;
234
- defaultBillingAddress?: number;
235
- shippingAddresses?: number[];
236
- billingAddresses?: number[];
237
- isEmailVerified?: boolean;
238
- externalId?: string;
239
- customerGroup?: {
240
- id?: string;
241
- typeId?: "customer-group";
242
- };
243
- locale?: string;
244
- salutation?: string;
245
- }>;
246
- export declare const updateCustomerParameters: z.ZodObject<{
247
- id: z.ZodString;
248
- version: z.ZodNumber;
249
- actions: z.ZodArray<z.ZodIntersection<z.ZodObject<{
250
- action: z.ZodString;
251
- }, "strip", z.ZodTypeAny, {
252
- action?: string;
253
- }, {
254
- action?: string;
255
- }>, z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>, "many">;
256
- }, "strip", z.ZodTypeAny, {
257
- id?: string;
258
- version?: number;
259
- actions?: ({
260
- action?: string;
261
- } & Record<string, any>)[];
262
- }, {
263
- id?: string;
264
- version?: number;
265
- actions?: ({
266
- action?: string;
267
- } & Record<string, any>)[];
268
- }>;
269
- export declare const deleteCustomerParameters: z.ZodObject<{
270
- id: z.ZodString;
271
- version: z.ZodNumber;
272
- dataErasure: z.ZodOptional<z.ZodBoolean>;
273
- }, "strip", z.ZodTypeAny, {
274
- id?: string;
275
- version?: number;
276
- dataErasure?: boolean;
277
- }, {
278
- id?: string;
279
- version?: number;
280
- dataErasure?: boolean;
281
- }>;
@@ -1,2 +0,0 @@
1
- import { ApiRoot } from '@commercetools/platform-sdk';
2
- export declare const mockApiRoot: ApiRoot;
@@ -1,26 +0,0 @@
1
- import { z } from 'zod';
2
- import { type Configuration, type IApiClientFactory, type ResourceMetadata, type ToolExecutionContext } from '../../shared';
3
- import { CommercetoolsResourceHandler } from '../../handlers/commercetools.handler';
4
- /**
5
- * Project Resource Handler
6
- * Handles project read and update operations
7
- *
8
- * Automatically discovered via @ToolHandler() decorator
9
- */
10
- export declare class ProjectHandler extends CommercetoolsResourceHandler {
11
- protected readonly metadata: ResourceMetadata;
12
- constructor(apiClientFactory?: IApiClientFactory);
13
- getToolDefinition(operation: 'read' | 'update'): {
14
- name: string;
15
- description: string;
16
- inputSchema: z.ZodObject<Record<string, z.ZodTypeAny>, z.UnknownKeysParam, z.ZodTypeAny, {
17
- [x: string]: any;
18
- }, {
19
- [x: string]: any;
20
- }>;
21
- };
22
- read(context: ToolExecutionContext<Configuration>): Promise<unknown>;
23
- update(context: ToolExecutionContext<Configuration>): Promise<unknown>;
24
- create(_context: ToolExecutionContext<Configuration>): Promise<unknown>;
25
- delete(_context: ToolExecutionContext<Configuration>): Promise<unknown>;
26
- }
@@ -1,2 +0,0 @@
1
- export declare const readProjectPrompt = "\nThis tool will fetch information about a commercetools project.\n\nIt takes these optional arguments:\n- projectKey (string, optional): The key of the project to read. If not provided, the current projectKey from the configuration will be used.\n\nThe response will contain detailed information about the project including countries, currencies, languages, and more.\n";
2
- export declare const updateProjectPrompt = "\nThis tool will update settings for a commercetools project. This is an admin-only operation.\n\nIt takes these arguments:\n- version (number, optional): The current version of the project. If not provided, the current version will be fetched automatically.\n- actions (array, required): The list of update actions to apply to the project.\n- projectKey (string, optional): The key of the project to update. If not provided, the current project will be used.\n\nAvailable update actions include:\n- changeName: Update the project name\n- changeCountries: Update the list of countries\n- changeCurrencies: Update the list of currencies\n- changeLanguages: Update the list of languages\n- changeMessagesConfiguration: Update the Messages Query feature configuration\n- changeCartsConfiguration: Update the Carts feature configuration\n- changeCountryTaxRateFallbackEnabled: Change the country tax rate fallback setting\n- changeShoppingListsConfiguration: Update the Shopping Lists feature configuration\n- setShippingRateInputType: Set the shipping rate input type\n- setExternalOAuth: Configure an external OAuth provider\n- changeProductSearchIndexingEnabled: Enable/disable product search indexing\n- changeOrderSearchStatus: Change the Order Search status\n- changeCustomerSearchStatus: Change the Customer Search status\n- changeBusinessUnitSearchStatus: Change the Business Unit Search status\n- and more\n\nThe response will contain the updated project information.\n";