@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.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/utils/constants.ts
|
|
2
2
|
var TOOL_NAME_PREFIX = "";
|
|
3
3
|
var OPERATIONS = ["read", "create", "update", "delete"];
|
|
4
|
+
var DEFAULT_API_URL = "https://api.europe-west1.gcp.commercetools.com";
|
|
4
5
|
|
|
5
6
|
// src/handlers/base.handler.ts
|
|
6
7
|
var BaseResourceHandler = class {
|
|
@@ -182,14 +183,9 @@ var CommercetoolsAPIClient = class {
|
|
|
182
183
|
configuration;
|
|
183
184
|
authToken;
|
|
184
185
|
constructor(configuration, authToken) {
|
|
185
|
-
this.configuration = {
|
|
186
|
-
projectKey: configuration.projectKey,
|
|
187
|
-
allowedTools: [],
|
|
188
|
-
metadata: configuration.metadata,
|
|
189
|
-
...configuration
|
|
190
|
-
};
|
|
191
186
|
this.authToken = authToken;
|
|
192
187
|
this.client = this.createClient();
|
|
188
|
+
this.configuration = configuration;
|
|
193
189
|
if (!this.client) {
|
|
194
190
|
throw new Error("Failed to create commercetools client");
|
|
195
191
|
}
|
|
@@ -220,12 +216,12 @@ var CommercetoolsAPIClient = class {
|
|
|
220
216
|
* Create commercetools client
|
|
221
217
|
*/
|
|
222
218
|
createClient() {
|
|
223
|
-
var _a;
|
|
224
|
-
const apiUrl = ((_a = this.configuration.metadata) == null ? void 0 : _a.apiUrl) || "https://api.europe-west1.gcp.commercetools.com";
|
|
225
219
|
const httpMiddlewareOptions = {
|
|
226
|
-
host:
|
|
220
|
+
host: DEFAULT_API_URL
|
|
227
221
|
};
|
|
228
|
-
const client = new ClientBuilder().withHttpMiddleware(httpMiddlewareOptions).withConcurrentModificationMiddleware().withCorrelationIdMiddleware(
|
|
222
|
+
const client = new ClientBuilder().withHttpMiddleware(httpMiddlewareOptions).withConcurrentModificationMiddleware().withCorrelationIdMiddleware({
|
|
223
|
+
generate: () => this.configuration.correlationId
|
|
224
|
+
}).withUserAgentMiddleware({
|
|
229
225
|
libraryName: "multitenant-mcp-service",
|
|
230
226
|
libraryVersion: "1.0.0"
|
|
231
227
|
});
|
|
@@ -686,33 +682,302 @@ async function deleteCategories(context, apiClientFactory) {
|
|
|
686
682
|
return handler.delete(context);
|
|
687
683
|
}
|
|
688
684
|
|
|
685
|
+
// src/resources/carts/carts.schema.ts
|
|
686
|
+
import { z as z3 } from "zod";
|
|
687
|
+
var readCartParameters = z3.object({
|
|
688
|
+
id: z3.string().optional().describe("Cart ID"),
|
|
689
|
+
key: z3.string().optional().describe("Cart key (user-defined unique identifier)"),
|
|
690
|
+
storeKey: z3.string().optional().describe(
|
|
691
|
+
"Store key. When provided, the request is executed in the context of that store (store-specific carts). Omit for project-level carts."
|
|
692
|
+
),
|
|
693
|
+
where: z3.array(z3.string()).optional().describe(
|
|
694
|
+
'Query predicates specified as strings. Example: ["customerId = \\"customer-123\\""] or ["key = \\"cart-key-1\\""]'
|
|
695
|
+
),
|
|
696
|
+
sort: z3.array(z3.string()).optional().describe(
|
|
697
|
+
'Sort criteria for the results. Example: ["createdAt desc", "lastModifiedAt desc"]'
|
|
698
|
+
),
|
|
699
|
+
limit: z3.number().int().min(1).max(500).optional().describe(
|
|
700
|
+
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
701
|
+
),
|
|
702
|
+
offset: z3.number().int().min(0).optional().describe(
|
|
703
|
+
"The number of items to skip before starting to collect the result set."
|
|
704
|
+
),
|
|
705
|
+
expand: z3.array(z3.string()).optional().describe(
|
|
706
|
+
'Fields to expand. Example: ["lineItems[*].variant", "shippingInfo.shippingMethod", "discountCodes[*]"]'
|
|
707
|
+
)
|
|
708
|
+
});
|
|
709
|
+
var createCartParameters = z3.object({
|
|
710
|
+
storeKey: z3.string().optional().describe(
|
|
711
|
+
"Store key. When provided, the cart is created in the context of that store. Omit for project-level carts."
|
|
712
|
+
),
|
|
713
|
+
body: z3.record(z3.any()).describe(
|
|
714
|
+
"Cart draft (CartDraft). Required fields typically include: currency (string, ISO 4217), and optionally: country (string, ISO 3166-1 alpha-2), key, customerId, customerEmail, inventoryMode (Single|None), lineItems (array), customLineItems (array), shippingAddress (Address), billingAddress (Address), shippingMethod (ResourceIdentifier), store (ResourceIdentifier), locale, taxMode (Platform|External), taxRoundingMode, taxCalculationMode, externalTaxRateForShippingMethod, discountCodes (array of strings), custom (type + fields), deleteDaysAfterLastModification, itemShippingAddresses (array of Address), etc. See commercetools API docs for CartDraft for full structure."
|
|
715
|
+
)
|
|
716
|
+
});
|
|
717
|
+
var updateCartParameters = z3.object({
|
|
718
|
+
id: z3.string().optional().describe("The ID of the cart to update"),
|
|
719
|
+
key: z3.string().optional().describe("The key of the cart to update"),
|
|
720
|
+
storeKey: z3.string().optional().describe("Store key when the cart is store-specific"),
|
|
721
|
+
version: z3.number().int().describe("The current version of the cart (for optimistic locking)"),
|
|
722
|
+
actions: z3.array(z3.record(z3.any())).optional().describe(
|
|
723
|
+
'Update actions. Each action must have an "action" field (e.g. addLineItem, setShippingAddress, addDiscountCode, recalculate, etc.) and fields specific to that action. See commercetools Cart update actions documentation.'
|
|
724
|
+
)
|
|
725
|
+
});
|
|
726
|
+
var deleteCartParameters = z3.object({
|
|
727
|
+
id: z3.string().optional().describe("Cart ID (required if key is not provided)"),
|
|
728
|
+
key: z3.string().optional().describe("Cart key (required if id is not provided)"),
|
|
729
|
+
storeKey: z3.string().optional().describe("Store key when the cart is store-specific"),
|
|
730
|
+
version: z3.number().int().describe("Current version of the cart (for optimistic locking)"),
|
|
731
|
+
dataErasure: z3.boolean().optional().describe(
|
|
732
|
+
"When true, personal data (e.g. email, addresses) associated with the cart is deleted. Default is false."
|
|
733
|
+
)
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
// src/resources/carts/carts.prompt.ts
|
|
737
|
+
var readCartPrompt = `
|
|
738
|
+
This tool will fetch a Cart by ID or key (if provided) from commercetools, optionally in a store context, or query carts in the project (or in a store when storeKey is provided).
|
|
739
|
+
|
|
740
|
+
Carts hold line items, custom line items, shipping and billing addresses, and can be converted to orders. They can be project-level or store-specific.
|
|
741
|
+
|
|
742
|
+
It takes these optional arguments:
|
|
743
|
+
- id (string, optional): The ID of the cart to fetch.
|
|
744
|
+
- key (string, optional): The key of the cart to fetch (user-defined unique identifier).
|
|
745
|
+
- storeKey (string, optional): The key of the store. When provided, the request is executed in the context of that store (for store-specific carts). Omit for project-level carts.
|
|
746
|
+
- where (array of strings, optional): Query predicates specified as strings. Example: ["customerId = \\"customer-123\\""] or ["key = \\"cart-key-1\\""]
|
|
747
|
+
- sort (array of strings, optional): Sort criteria for the results. Example: ["createdAt desc", "lastModifiedAt desc"]
|
|
748
|
+
- limit (integer, optional): A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20.
|
|
749
|
+
- offset (integer, optional): The number of items to skip before starting to collect the result set.
|
|
750
|
+
- expand (array of strings, optional): Fields to expand. Example: ["lineItems[*].variant", "shippingInfo.shippingMethod", "discountCodes[*]"]
|
|
751
|
+
`;
|
|
752
|
+
var createCartPrompt = `
|
|
753
|
+
This tool will create a new Cart in commercetools (optionally in a store when storeKey is provided).
|
|
754
|
+
|
|
755
|
+
A cart requires at least a currency (and often a country for shipping/tax). You can add line items, shipping address, discount codes, and more at creation or in a follow-up update.
|
|
756
|
+
|
|
757
|
+
It takes these required arguments:
|
|
758
|
+
- body (object): Cart draft (CartDraft). Must include at least:
|
|
759
|
+
- currency (string): ISO 4217 currency code (e.g. "USD", "EUR").
|
|
760
|
+
|
|
761
|
+
It takes these optional arguments:
|
|
762
|
+
- storeKey (string, optional): The key of the store. When provided, the cart is created in the context of that store. Omit for project-level carts.
|
|
763
|
+
- body fields (all optional except currency): country (string, ISO 3166-1 alpha-2), key (string), customerId (string), customerEmail (string), inventoryMode ("Single" or "None"), lineItems (array of LineItemDraft: productId, variantId, quantity, supplyChannel, distributionChannel, custom, etc.), customLineItems (array of CustomLineItemDraft), shippingAddress (Address), billingAddress (Address), shippingMethod (ResourceIdentifier to ShippingMethod), store (ResourceIdentifier to Store), locale (string), taxMode ("Platform" or "External"), taxRoundingMode, taxCalculationMode, externalTaxRateForShippingMethod (ExternalTaxRateDraft), discountCodes (array of discount code strings), custom (type + fields), deleteDaysAfterLastModification (number), itemShippingAddresses (array of Address), origin (Customer or Merchant), etc. See the commercetools API documentation for CartDraft for the complete structure and nested types.
|
|
764
|
+
`;
|
|
765
|
+
var updateCartPrompt = `
|
|
766
|
+
This tool will update a Cart in commercetools using update actions.
|
|
767
|
+
|
|
768
|
+
It takes these required arguments:
|
|
769
|
+
- version (integer): The current version of the cart (for optimistic locking).
|
|
770
|
+
- Either id or key must be provided to identify the cart.
|
|
771
|
+
|
|
772
|
+
It takes these optional arguments:
|
|
773
|
+
- id (string, optional): The ID of the cart to update (required if key is not provided).
|
|
774
|
+
- key (string, optional): The key of the cart to update (required if id is not provided).
|
|
775
|
+
- storeKey (string, optional): The key of the store when the cart is store-specific.
|
|
776
|
+
- actions (array, optional): An array of update actions. Each action must have an "action" field indicating the action type and any required fields for that action.
|
|
777
|
+
|
|
778
|
+
Example actions from the commercetools Cart API include:
|
|
779
|
+
- addLineItem: Add a line item. Fields: productId, variantId?, sku?, quantity?, supplyChannel?, distributionChannel?, custom?, addedAt?, shippingDetails?
|
|
780
|
+
- removeLineItem: Remove a line item. Fields: lineItemId, quantity?
|
|
781
|
+
- changeLineItemQuantity: Change line item quantity. Fields: lineItemId, quantity
|
|
782
|
+
- setLineItemShippingDetails: Set shipping details for a line item. Fields: lineItemId, shippingDetails?
|
|
783
|
+
- addCustomLineItem: Add a custom line item. Fields: name (LocalizedString), quantity, money, slug, taxCategory?, externalTaxRate?, custom?
|
|
784
|
+
- removeCustomLineItem: Remove a custom line item. Fields: customLineItemId
|
|
785
|
+
- setShippingAddress: Set shipping address. Fields: address?
|
|
786
|
+
- setBillingAddress: Set billing address. Fields: address?
|
|
787
|
+
- setShippingMethod: Set shipping method. Fields: shippingMethod?, externalTaxRate?
|
|
788
|
+
- addDiscountCode: Add a discount code. Fields: code
|
|
789
|
+
- removeDiscountCode: Remove a discount code. Fields: discountCode (Reference)
|
|
790
|
+
- recalculate: Recalculate cart (prices, taxes, totals). Fields: updateProductData?
|
|
791
|
+
- setKey: Set cart key. Fields: key?
|
|
792
|
+
- setCustomerId: Set customer ID. Fields: customerId?
|
|
793
|
+
- setCustomerEmail: Set customer email. Fields: email?
|
|
794
|
+
- setCustomType: Set custom type. Fields: type?, fields?
|
|
795
|
+
- setCustomField: Set custom field. Fields: name, value?
|
|
796
|
+
- setLocale: Set locale. Fields: locale?
|
|
797
|
+
- setDeleteDaysAfterLastModification: Set delete days. Fields: deleteDaysAfterLastModification?
|
|
798
|
+
- setItemShippingAddress: Set item shipping address. Fields: addressKey, address?
|
|
799
|
+
- addItemShippingAddress: Add item shipping address. Fields: address
|
|
800
|
+
- removeItemShippingAddress: Remove item shipping address. Fields: addressKey
|
|
801
|
+
|
|
802
|
+
Each action type requires specific fields according to the commercetools API documentation.
|
|
803
|
+
`;
|
|
804
|
+
var deleteCartPrompt = `
|
|
805
|
+
This tool will delete a Cart from commercetools.
|
|
806
|
+
|
|
807
|
+
It takes these required arguments:
|
|
808
|
+
- version (integer): The current version of the cart (for optimistic locking).
|
|
809
|
+
- Either id or key must be provided to identify the cart.
|
|
810
|
+
|
|
811
|
+
It takes these optional arguments:
|
|
812
|
+
- id (string, optional): The ID of the cart to delete (required if key is not provided).
|
|
813
|
+
- key (string, optional): The key of the cart to delete (required if id is not provided).
|
|
814
|
+
- storeKey (string, optional): The key of the store when the cart is store-specific.
|
|
815
|
+
- dataErasure (boolean, optional): When true, personal data (e.g. email, addresses) associated with the cart is deleted. Default is false.
|
|
816
|
+
`;
|
|
817
|
+
|
|
818
|
+
// src/resources/carts/carts.handler.ts
|
|
819
|
+
var CartsHandler = class extends CommercetoolsResourceHandler {
|
|
820
|
+
metadata = {
|
|
821
|
+
namespace: "carts",
|
|
822
|
+
description: "Manage carts in commercetools",
|
|
823
|
+
toolNamePrefix: TOOL_NAME_PREFIX,
|
|
824
|
+
schemas: {
|
|
825
|
+
read: readCartParameters,
|
|
826
|
+
create: createCartParameters,
|
|
827
|
+
update: updateCartParameters,
|
|
828
|
+
delete: deleteCartParameters
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
constructor(apiClientFactory) {
|
|
832
|
+
super(apiClientFactory);
|
|
833
|
+
}
|
|
834
|
+
getToolDefinition(operation) {
|
|
835
|
+
const prompts = {
|
|
836
|
+
read: readCartPrompt,
|
|
837
|
+
create: createCartPrompt,
|
|
838
|
+
update: updateCartPrompt,
|
|
839
|
+
delete: deleteCartPrompt
|
|
840
|
+
};
|
|
841
|
+
return {
|
|
842
|
+
name: this.getToolName(operation),
|
|
843
|
+
description: prompts[operation],
|
|
844
|
+
inputSchema: this.metadata.schemas[operation]
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
getCartsApi(api, storeKey) {
|
|
848
|
+
return storeKey ? api.inStoreKeyWithStoreKeyValue({ storeKey }).carts() : api.carts();
|
|
849
|
+
}
|
|
850
|
+
async read(context) {
|
|
851
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
852
|
+
projectKey: context.configuration.projectKey
|
|
853
|
+
});
|
|
854
|
+
const params = context.parameters;
|
|
855
|
+
try {
|
|
856
|
+
const cartsApi = this.getCartsApi(api, params.storeKey);
|
|
857
|
+
if (params == null ? void 0 : params.id) {
|
|
858
|
+
const res2 = await cartsApi.withId({ ID: params.id }).get({
|
|
859
|
+
queryArgs: { ...params.expand && { expand: params.expand } }
|
|
860
|
+
}).execute();
|
|
861
|
+
return res2.body;
|
|
862
|
+
}
|
|
863
|
+
if (params == null ? void 0 : params.key) {
|
|
864
|
+
const res2 = await cartsApi.withKey({ key: params.key }).get({
|
|
865
|
+
queryArgs: { ...params.expand && { expand: params.expand } }
|
|
866
|
+
}).execute();
|
|
867
|
+
return res2.body;
|
|
868
|
+
}
|
|
869
|
+
const res = await cartsApi.get({
|
|
870
|
+
queryArgs: {
|
|
871
|
+
limit: params.limit ?? 20,
|
|
872
|
+
...params.offset != null && { offset: params.offset },
|
|
873
|
+
...params.sort && { sort: params.sort },
|
|
874
|
+
...params.where && { where: params.where },
|
|
875
|
+
...params.expand && { expand: params.expand }
|
|
876
|
+
}
|
|
877
|
+
}).execute();
|
|
878
|
+
return res.body;
|
|
879
|
+
} catch (err) {
|
|
880
|
+
throw new ToolExecutionError("Failed to read cart", context, err);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
async create(context) {
|
|
884
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
885
|
+
projectKey: context.configuration.projectKey
|
|
886
|
+
});
|
|
887
|
+
const params = context.parameters;
|
|
888
|
+
try {
|
|
889
|
+
const cartsApi = this.getCartsApi(api, params.storeKey);
|
|
890
|
+
const created = await cartsApi.post({
|
|
891
|
+
body: params.body
|
|
892
|
+
}).execute();
|
|
893
|
+
return created.body;
|
|
894
|
+
} catch (err) {
|
|
895
|
+
throw new ToolExecutionError("Failed to create cart", context, err);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
async update(context) {
|
|
899
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
900
|
+
projectKey: context.configuration.projectKey
|
|
901
|
+
});
|
|
902
|
+
const params = context.parameters;
|
|
903
|
+
try {
|
|
904
|
+
const cartsApi = this.getCartsApi(api, params.storeKey);
|
|
905
|
+
let cartId;
|
|
906
|
+
let version = params.version;
|
|
907
|
+
if (params.id) {
|
|
908
|
+
cartId = params.id;
|
|
909
|
+
} else if (params.key) {
|
|
910
|
+
const res = await cartsApi.withKey({ key: params.key }).get().execute();
|
|
911
|
+
cartId = res.body.id;
|
|
912
|
+
version = res.body.version;
|
|
913
|
+
} else {
|
|
914
|
+
throw new ToolExecutionError(
|
|
915
|
+
"Either id or key must be provided",
|
|
916
|
+
context
|
|
917
|
+
);
|
|
918
|
+
}
|
|
919
|
+
const updated = await cartsApi.withId({ ID: cartId }).post({
|
|
920
|
+
body: {
|
|
921
|
+
version,
|
|
922
|
+
actions: params.actions ?? []
|
|
923
|
+
}
|
|
924
|
+
}).execute();
|
|
925
|
+
return updated.body;
|
|
926
|
+
} catch (err) {
|
|
927
|
+
throw new ToolExecutionError("Failed to update cart", context, err);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
async delete(context) {
|
|
931
|
+
throw new ToolExecutionError(
|
|
932
|
+
"Delete operation not implemented for carts",
|
|
933
|
+
context
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
async function readCarts(context, apiClientFactory) {
|
|
938
|
+
const handler = new CartsHandler(apiClientFactory);
|
|
939
|
+
return handler.read(context);
|
|
940
|
+
}
|
|
941
|
+
async function createCarts(context, apiClientFactory) {
|
|
942
|
+
const handler = new CartsHandler(apiClientFactory);
|
|
943
|
+
return handler.create(context);
|
|
944
|
+
}
|
|
945
|
+
async function updateCarts(context, apiClientFactory) {
|
|
946
|
+
const handler = new CartsHandler(apiClientFactory);
|
|
947
|
+
return handler.update(context);
|
|
948
|
+
}
|
|
949
|
+
async function deleteCarts(context, apiClientFactory) {
|
|
950
|
+
const handler = new CartsHandler(apiClientFactory);
|
|
951
|
+
return handler.delete(context);
|
|
952
|
+
}
|
|
953
|
+
|
|
689
954
|
// src/resources/channels/channels.handler.ts
|
|
690
|
-
import { z as
|
|
955
|
+
import { z as z5 } from "zod";
|
|
691
956
|
|
|
692
957
|
// src/resources/channels/channels.schema.ts
|
|
693
|
-
import { z as
|
|
694
|
-
var readChannelsParameters =
|
|
695
|
-
id:
|
|
696
|
-
key:
|
|
697
|
-
where:
|
|
698
|
-
sort:
|
|
699
|
-
limit:
|
|
700
|
-
offset:
|
|
701
|
-
expand:
|
|
958
|
+
import { z as z4 } from "zod";
|
|
959
|
+
var readChannelsParameters = z4.object({
|
|
960
|
+
id: z4.string().optional(),
|
|
961
|
+
key: z4.string().optional(),
|
|
962
|
+
where: z4.array(z4.string()).optional(),
|
|
963
|
+
sort: z4.array(z4.string()).optional(),
|
|
964
|
+
limit: z4.number().int().min(1).max(500).optional(),
|
|
965
|
+
offset: z4.number().int().optional(),
|
|
966
|
+
expand: z4.array(z4.string()).optional()
|
|
702
967
|
});
|
|
703
|
-
var createChannelsParameters =
|
|
704
|
-
body:
|
|
968
|
+
var createChannelsParameters = z4.object({
|
|
969
|
+
body: z4.record(z4.any())
|
|
705
970
|
});
|
|
706
|
-
var updateChannelsParameters =
|
|
707
|
-
id:
|
|
708
|
-
key:
|
|
709
|
-
version:
|
|
710
|
-
actions:
|
|
971
|
+
var updateChannelsParameters = z4.object({
|
|
972
|
+
id: z4.string().optional(),
|
|
973
|
+
key: z4.string().optional(),
|
|
974
|
+
version: z4.number().optional(),
|
|
975
|
+
actions: z4.array(z4.record(z4.any())).optional()
|
|
711
976
|
});
|
|
712
|
-
var deleteChannelsParameters =
|
|
713
|
-
id:
|
|
714
|
-
key:
|
|
715
|
-
version:
|
|
977
|
+
var deleteChannelsParameters = z4.object({
|
|
978
|
+
id: z4.string().optional(),
|
|
979
|
+
key: z4.string().optional(),
|
|
980
|
+
version: z4.number().optional()
|
|
716
981
|
});
|
|
717
982
|
|
|
718
983
|
// src/resources/channels/channels.prompt.ts
|
|
@@ -798,7 +1063,7 @@ var ChannelsHandler = class extends CommercetoolsResourceHandler {
|
|
|
798
1063
|
read: readChannelsParameters,
|
|
799
1064
|
create: createChannelsParameters,
|
|
800
1065
|
update: updateChannelsParameters,
|
|
801
|
-
delete:
|
|
1066
|
+
delete: z5.object({})
|
|
802
1067
|
}
|
|
803
1068
|
};
|
|
804
1069
|
constructor(apiClientFactory) {
|
|
@@ -908,34 +1173,34 @@ async function deleteChannels(context, apiClientFactory) {
|
|
|
908
1173
|
}
|
|
909
1174
|
|
|
910
1175
|
// src/resources/custom-objects/custom-objects.schema.ts
|
|
911
|
-
import { z as
|
|
912
|
-
var readCustomObjectsParameters =
|
|
913
|
-
container:
|
|
914
|
-
key:
|
|
915
|
-
id:
|
|
916
|
-
where:
|
|
917
|
-
sort:
|
|
918
|
-
limit:
|
|
919
|
-
offset:
|
|
920
|
-
expand:
|
|
1176
|
+
import { z as z6 } from "zod";
|
|
1177
|
+
var readCustomObjectsParameters = z6.object({
|
|
1178
|
+
container: z6.string().optional(),
|
|
1179
|
+
key: z6.string().optional(),
|
|
1180
|
+
id: z6.string().optional(),
|
|
1181
|
+
where: z6.array(z6.string()).optional(),
|
|
1182
|
+
sort: z6.array(z6.string()).optional(),
|
|
1183
|
+
limit: z6.number().int().min(1).max(500).optional(),
|
|
1184
|
+
offset: z6.number().int().optional(),
|
|
1185
|
+
expand: z6.array(z6.string()).optional()
|
|
921
1186
|
});
|
|
922
|
-
var createCustomObjectsParameters =
|
|
923
|
-
container:
|
|
924
|
-
key:
|
|
925
|
-
value:
|
|
1187
|
+
var createCustomObjectsParameters = z6.object({
|
|
1188
|
+
container: z6.string().describe("Container name (namespace)"),
|
|
1189
|
+
key: z6.string().describe("User-defined key"),
|
|
1190
|
+
value: z6.any().describe("JSON-serializable value")
|
|
926
1191
|
});
|
|
927
|
-
var updateCustomObjectsParameters =
|
|
928
|
-
container:
|
|
929
|
-
key:
|
|
930
|
-
id:
|
|
931
|
-
version:
|
|
932
|
-
value:
|
|
1192
|
+
var updateCustomObjectsParameters = z6.object({
|
|
1193
|
+
container: z6.string().optional(),
|
|
1194
|
+
key: z6.string().optional(),
|
|
1195
|
+
id: z6.string().optional(),
|
|
1196
|
+
version: z6.number().optional(),
|
|
1197
|
+
value: z6.any().optional()
|
|
933
1198
|
});
|
|
934
|
-
var deleteCustomObjectsParameters =
|
|
935
|
-
container:
|
|
936
|
-
key:
|
|
937
|
-
id:
|
|
938
|
-
version:
|
|
1199
|
+
var deleteCustomObjectsParameters = z6.object({
|
|
1200
|
+
container: z6.string().optional(),
|
|
1201
|
+
key: z6.string().optional(),
|
|
1202
|
+
id: z6.string().optional(),
|
|
1203
|
+
version: z6.number().optional()
|
|
939
1204
|
});
|
|
940
1205
|
|
|
941
1206
|
// src/resources/custom-objects/custom-objects.prompt.ts
|
|
@@ -1172,7 +1437,7 @@ var CustomObjectsHandler = class extends CommercetoolsResourceHandler {
|
|
|
1172
1437
|
}
|
|
1173
1438
|
async delete(context) {
|
|
1174
1439
|
throw new ToolExecutionError(
|
|
1175
|
-
"Delete not
|
|
1440
|
+
"Delete operation not implemented for custom objects",
|
|
1176
1441
|
context
|
|
1177
1442
|
);
|
|
1178
1443
|
}
|
|
@@ -1195,94 +1460,94 @@ async function deleteCustomObjects(context, apiClientFactory) {
|
|
|
1195
1460
|
}
|
|
1196
1461
|
|
|
1197
1462
|
// src/resources/customers/customers.schema.ts
|
|
1198
|
-
import { z as
|
|
1199
|
-
var readCustomerParameters =
|
|
1200
|
-
id:
|
|
1201
|
-
key:
|
|
1202
|
-
storeKey:
|
|
1203
|
-
where:
|
|
1463
|
+
import { z as z7 } from "zod";
|
|
1464
|
+
var readCustomerParameters = z7.object({
|
|
1465
|
+
id: z7.string().optional().describe("Customer ID"),
|
|
1466
|
+
key: z7.string().optional().describe("Customer key"),
|
|
1467
|
+
storeKey: z7.string().optional().describe("Store key"),
|
|
1468
|
+
where: z7.array(z7.string()).optional().describe(
|
|
1204
1469
|
'Query predicates specified as strings. Example: ["email = \\"customer@example.com\\""]'
|
|
1205
1470
|
),
|
|
1206
|
-
sort:
|
|
1471
|
+
sort: z7.array(z7.string()).optional().describe(
|
|
1207
1472
|
'Sort criteria for the results. Example: ["firstName asc", "createdAt desc"]'
|
|
1208
1473
|
),
|
|
1209
|
-
limit:
|
|
1474
|
+
limit: z7.number().int().min(1).max(500).optional().describe(
|
|
1210
1475
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 10."
|
|
1211
1476
|
),
|
|
1212
|
-
offset:
|
|
1477
|
+
offset: z7.number().int().min(0).optional().describe(
|
|
1213
1478
|
"The number of items to skip before starting to collect the result set."
|
|
1214
1479
|
),
|
|
1215
|
-
expand:
|
|
1480
|
+
expand: z7.array(z7.string()).optional().describe('Fields to expand. Example: ["customerGroup"]')
|
|
1216
1481
|
});
|
|
1217
|
-
var createCustomerParameters =
|
|
1218
|
-
email:
|
|
1219
|
-
storeKey:
|
|
1220
|
-
password:
|
|
1221
|
-
firstName:
|
|
1222
|
-
lastName:
|
|
1223
|
-
middleName:
|
|
1224
|
-
title:
|
|
1225
|
-
dateOfBirth:
|
|
1226
|
-
companyName:
|
|
1227
|
-
vatId:
|
|
1228
|
-
addresses:
|
|
1229
|
-
|
|
1230
|
-
streetName:
|
|
1231
|
-
streetNumber:
|
|
1232
|
-
additionalStreetInfo:
|
|
1233
|
-
postalCode:
|
|
1234
|
-
city:
|
|
1235
|
-
region:
|
|
1236
|
-
state:
|
|
1237
|
-
country:
|
|
1238
|
-
company:
|
|
1239
|
-
department:
|
|
1240
|
-
building:
|
|
1241
|
-
apartment:
|
|
1242
|
-
pOBox:
|
|
1243
|
-
phone:
|
|
1244
|
-
mobile:
|
|
1245
|
-
email:
|
|
1246
|
-
fax:
|
|
1247
|
-
additionalAddressInfo:
|
|
1482
|
+
var createCustomerParameters = z7.object({
|
|
1483
|
+
email: z7.string().email().describe("Customer email address"),
|
|
1484
|
+
storeKey: z7.string().optional().describe("Store key"),
|
|
1485
|
+
password: z7.string().describe("Customer password"),
|
|
1486
|
+
firstName: z7.string().optional().describe("Customer first name"),
|
|
1487
|
+
lastName: z7.string().optional().describe("Customer last name"),
|
|
1488
|
+
middleName: z7.string().optional().describe("Customer middle name"),
|
|
1489
|
+
title: z7.string().optional().describe("Customer title (e.g., Mr., Mrs., Dr.)"),
|
|
1490
|
+
dateOfBirth: z7.string().optional().describe("Customer date of birth in ISO 8601 format (YYYY-MM-DD)"),
|
|
1491
|
+
companyName: z7.string().optional().describe("Customer company name"),
|
|
1492
|
+
vatId: z7.string().optional().describe("Customer VAT identification number"),
|
|
1493
|
+
addresses: z7.array(
|
|
1494
|
+
z7.object({
|
|
1495
|
+
streetName: z7.string().describe("Street name"),
|
|
1496
|
+
streetNumber: z7.string().optional().describe("Street number"),
|
|
1497
|
+
additionalStreetInfo: z7.string().optional().describe("Additional street information"),
|
|
1498
|
+
postalCode: z7.string().describe("Postal code"),
|
|
1499
|
+
city: z7.string().describe("City"),
|
|
1500
|
+
region: z7.string().optional().describe("Region"),
|
|
1501
|
+
state: z7.string().optional().describe("State"),
|
|
1502
|
+
country: z7.string().describe("Country code (ISO 3166-1 alpha-2)"),
|
|
1503
|
+
company: z7.string().optional().describe("Company name"),
|
|
1504
|
+
department: z7.string().optional().describe("Department"),
|
|
1505
|
+
building: z7.string().optional().describe("Building"),
|
|
1506
|
+
apartment: z7.string().optional().describe("Apartment"),
|
|
1507
|
+
pOBox: z7.string().optional().describe("P.O. Box"),
|
|
1508
|
+
phone: z7.string().optional().describe("Phone"),
|
|
1509
|
+
mobile: z7.string().optional().describe("Mobile phone"),
|
|
1510
|
+
email: z7.string().email().optional().describe("Email"),
|
|
1511
|
+
fax: z7.string().optional().describe("Fax"),
|
|
1512
|
+
additionalAddressInfo: z7.string().optional().describe("Additional address information")
|
|
1248
1513
|
})
|
|
1249
1514
|
).optional().describe("Customer addresses"),
|
|
1250
|
-
defaultShippingAddress:
|
|
1251
|
-
defaultBillingAddress:
|
|
1252
|
-
shippingAddresses:
|
|
1253
|
-
billingAddresses:
|
|
1254
|
-
isEmailVerified:
|
|
1255
|
-
externalId:
|
|
1256
|
-
customerGroup:
|
|
1257
|
-
id:
|
|
1258
|
-
typeId:
|
|
1515
|
+
defaultShippingAddress: z7.number().int().optional().describe("Index of default shipping address in the addresses array"),
|
|
1516
|
+
defaultBillingAddress: z7.number().int().optional().describe("Index of default billing address in the addresses array"),
|
|
1517
|
+
shippingAddresses: z7.array(z7.number().int()).optional().describe("Indices of shipping addresses in the addresses array"),
|
|
1518
|
+
billingAddresses: z7.array(z7.number().int()).optional().describe("Indices of billing addresses in the addresses array"),
|
|
1519
|
+
isEmailVerified: z7.boolean().optional().describe("Whether the customer email is verified"),
|
|
1520
|
+
externalId: z7.string().optional().describe("Customer external ID"),
|
|
1521
|
+
customerGroup: z7.object({
|
|
1522
|
+
id: z7.string(),
|
|
1523
|
+
typeId: z7.literal("customer-group")
|
|
1259
1524
|
}).optional().describe("Customer group reference"),
|
|
1260
|
-
custom:
|
|
1261
|
-
type:
|
|
1262
|
-
id:
|
|
1263
|
-
typeId:
|
|
1525
|
+
custom: z7.object({
|
|
1526
|
+
type: z7.object({
|
|
1527
|
+
id: z7.string(),
|
|
1528
|
+
typeId: z7.literal("type")
|
|
1264
1529
|
}),
|
|
1265
|
-
fields:
|
|
1530
|
+
fields: z7.record(z7.string(), z7.any())
|
|
1266
1531
|
}).optional().describe("Custom fields"),
|
|
1267
|
-
locale:
|
|
1268
|
-
salutation:
|
|
1269
|
-
key:
|
|
1532
|
+
locale: z7.string().optional().describe("Customer locale"),
|
|
1533
|
+
salutation: z7.string().optional().describe("Customer salutation"),
|
|
1534
|
+
key: z7.string().optional().describe("Customer key")
|
|
1270
1535
|
});
|
|
1271
|
-
var updateCustomerParameters =
|
|
1272
|
-
id:
|
|
1273
|
-
version:
|
|
1274
|
-
actions:
|
|
1275
|
-
|
|
1276
|
-
action:
|
|
1277
|
-
}).and(
|
|
1536
|
+
var updateCustomerParameters = z7.object({
|
|
1537
|
+
id: z7.string().describe("The ID of the customer to update"),
|
|
1538
|
+
version: z7.number().int().describe("The current version of the customer"),
|
|
1539
|
+
actions: z7.array(
|
|
1540
|
+
z7.object({
|
|
1541
|
+
action: z7.string().describe("The name of the update action to perform")
|
|
1542
|
+
}).and(z7.record(z7.string(), z7.any()).optional()).describe(
|
|
1278
1543
|
'Array of update actions to perform on the customer. Each action should have an "action" field and other fields specific to that action type.'
|
|
1279
1544
|
)
|
|
1280
1545
|
).describe("Update actions")
|
|
1281
1546
|
});
|
|
1282
|
-
var deleteCustomerParameters =
|
|
1283
|
-
id:
|
|
1284
|
-
version:
|
|
1285
|
-
dataErasure:
|
|
1547
|
+
var deleteCustomerParameters = z7.object({
|
|
1548
|
+
id: z7.string().describe("Customer ID"),
|
|
1549
|
+
version: z7.number().int().describe("Current version (for optimistic locking)"),
|
|
1550
|
+
dataErasure: z7.boolean().optional().describe("Delete personal data")
|
|
1286
1551
|
});
|
|
1287
1552
|
|
|
1288
1553
|
// src/resources/customers/customers.prompt.ts
|
|
@@ -1439,135 +1704,552 @@ var CustomersHandler = class extends CommercetoolsResourceHandler {
|
|
|
1439
1704
|
);
|
|
1440
1705
|
}
|
|
1441
1706
|
}
|
|
1442
|
-
async create(context) {
|
|
1707
|
+
async create(context) {
|
|
1708
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
1709
|
+
projectKey: context.configuration.projectKey
|
|
1710
|
+
});
|
|
1711
|
+
const params = context.parameters;
|
|
1712
|
+
try {
|
|
1713
|
+
const customer = await this.getCustomersApi(api, params.storeKey).post({
|
|
1714
|
+
body: params
|
|
1715
|
+
}).execute();
|
|
1716
|
+
return customer.body;
|
|
1717
|
+
} catch (error) {
|
|
1718
|
+
throw new ToolExecutionError(
|
|
1719
|
+
"Failed to create customers",
|
|
1720
|
+
context,
|
|
1721
|
+
error
|
|
1722
|
+
);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
async update(context) {
|
|
1726
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
1727
|
+
projectKey: context.configuration.projectKey
|
|
1728
|
+
});
|
|
1729
|
+
const params = context.parameters;
|
|
1730
|
+
try {
|
|
1731
|
+
const customer = await api.customers().withId({ ID: params.id }).get().execute();
|
|
1732
|
+
const currentVersion = customer.body.version;
|
|
1733
|
+
const updatedCustomer = await api.customers().withId({ ID: params.id }).post({
|
|
1734
|
+
body: {
|
|
1735
|
+
version: currentVersion,
|
|
1736
|
+
actions: params.actions
|
|
1737
|
+
}
|
|
1738
|
+
}).execute();
|
|
1739
|
+
return updatedCustomer.body;
|
|
1740
|
+
} catch (error) {
|
|
1741
|
+
throw new ToolExecutionError(
|
|
1742
|
+
"Failed to update customers",
|
|
1743
|
+
context,
|
|
1744
|
+
error
|
|
1745
|
+
);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
async delete(context) {
|
|
1749
|
+
throw new ToolExecutionError("Delete operation not implemented", context);
|
|
1750
|
+
}
|
|
1751
|
+
};
|
|
1752
|
+
async function readCustomers(context, apiClientFactory) {
|
|
1753
|
+
const handler = new CustomersHandler(apiClientFactory);
|
|
1754
|
+
return handler.read(context);
|
|
1755
|
+
}
|
|
1756
|
+
async function createCustomers(context, apiClientFactory) {
|
|
1757
|
+
const handler = new CustomersHandler(apiClientFactory);
|
|
1758
|
+
return handler.create(context);
|
|
1759
|
+
}
|
|
1760
|
+
async function updateCustomers(context, apiClientFactory) {
|
|
1761
|
+
const handler = new CustomersHandler(apiClientFactory);
|
|
1762
|
+
return handler.update(context);
|
|
1763
|
+
}
|
|
1764
|
+
async function deleteCustomers(context, apiClientFactory) {
|
|
1765
|
+
const handler = new CustomersHandler(apiClientFactory);
|
|
1766
|
+
return handler.delete(context);
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
// src/resources/customer-groups/customer-groups.schema.ts
|
|
1770
|
+
import { z as z8 } from "zod";
|
|
1771
|
+
var readCustomerGroupsParameters = z8.object({
|
|
1772
|
+
id: z8.string().optional().describe("Customer group ID"),
|
|
1773
|
+
key: z8.string().optional().describe("Customer group key"),
|
|
1774
|
+
where: z8.array(z8.string()).optional().describe(
|
|
1775
|
+
'Query predicates specified as strings. Example: ["key = \\"vip\\""] or ["name = \\"VIP Customers\\""]'
|
|
1776
|
+
),
|
|
1777
|
+
sort: z8.array(z8.string()).optional().describe(
|
|
1778
|
+
'Sort criteria for the results. Example: ["name asc", "createdAt desc", "key asc"]'
|
|
1779
|
+
),
|
|
1780
|
+
limit: z8.number().int().min(1).max(500).optional().describe(
|
|
1781
|
+
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
1782
|
+
),
|
|
1783
|
+
offset: z8.number().int().min(0).optional().describe(
|
|
1784
|
+
"The number of items to skip before starting to collect the result set."
|
|
1785
|
+
),
|
|
1786
|
+
expand: z8.array(z8.string()).optional().describe(
|
|
1787
|
+
"Fields to expand. Customer groups have no reference expansions by default."
|
|
1788
|
+
)
|
|
1789
|
+
});
|
|
1790
|
+
var createCustomerGroupsParameters = z8.object({
|
|
1791
|
+
groupName: z8.string().min(1).describe(
|
|
1792
|
+
"Unique name of the customer group. Must be different from any existing group name in the project."
|
|
1793
|
+
),
|
|
1794
|
+
key: z8.string().min(2).max(256).optional().describe(
|
|
1795
|
+
"User-defined unique identifier for the customer group (2-256 characters, alphanumeric with underscores/hyphens)."
|
|
1796
|
+
),
|
|
1797
|
+
custom: z8.object({
|
|
1798
|
+
type: z8.object({
|
|
1799
|
+
id: z8.string().describe("ID of the custom type"),
|
|
1800
|
+
typeId: z8.literal("type")
|
|
1801
|
+
}),
|
|
1802
|
+
fields: z8.record(z8.string(), z8.any()).optional().describe("Custom field values")
|
|
1803
|
+
}).optional().describe(
|
|
1804
|
+
'Custom fields for the customer group. Requires a Type with resourceTypeIds including "customer-group".'
|
|
1805
|
+
)
|
|
1806
|
+
});
|
|
1807
|
+
var updateCustomerGroupsParameters = z8.object({
|
|
1808
|
+
id: z8.string().optional().describe("The ID of the customer group to update"),
|
|
1809
|
+
key: z8.string().optional().describe("The key of the customer group to update"),
|
|
1810
|
+
version: z8.number().int().describe(
|
|
1811
|
+
"The current version of the customer group (for optimistic locking)"
|
|
1812
|
+
),
|
|
1813
|
+
actions: z8.array(
|
|
1814
|
+
z8.object({
|
|
1815
|
+
action: z8.string().describe("The name of the update action to perform")
|
|
1816
|
+
}).and(z8.record(z8.string(), z8.any()).optional()).describe(
|
|
1817
|
+
'Array of update actions. Each action must have an "action" field and other fields specific to that action type (e.g. changeName requires "name", setKey requires "key").'
|
|
1818
|
+
)
|
|
1819
|
+
).describe("Update actions")
|
|
1820
|
+
});
|
|
1821
|
+
var deleteCustomerGroupsParameters = z8.object({
|
|
1822
|
+
id: z8.string().optional().describe("Customer group ID (required if key is not provided)"),
|
|
1823
|
+
key: z8.string().optional().describe("Customer group key (required if id is not provided)"),
|
|
1824
|
+
version: z8.number().int().describe(
|
|
1825
|
+
"Current version of the customer group (for optimistic locking)."
|
|
1826
|
+
)
|
|
1827
|
+
});
|
|
1828
|
+
|
|
1829
|
+
// src/resources/customer-groups/customer-groups.prompt.ts
|
|
1830
|
+
var readCustomerGroupsPrompt = `
|
|
1831
|
+
This tool will fetch a Customer Group by ID or key (if provided) from commercetools or query all available customer groups in a commercetools project if no arguments or parameters are provided.
|
|
1832
|
+
|
|
1833
|
+
Customer groups are used to segment customers (e.g. for B2B pricing, promotions, or analytics). Each customer can be assigned to at most one customer group.
|
|
1834
|
+
|
|
1835
|
+
It takes these optional arguments:
|
|
1836
|
+
- id (string, optional): The ID of the customer group to fetch.
|
|
1837
|
+
- key (string, optional): The key of the customer group to fetch.
|
|
1838
|
+
- where (array of strings, optional): Query predicates specified as strings. Example: ["key = \\"vip\\""] or ["name = \\"VIP Customers\\""]
|
|
1839
|
+
- sort (array of strings, optional): Sort criteria for the results. Example: ["name asc", "createdAt desc", "key asc"]
|
|
1840
|
+
- limit (integer, optional): A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20.
|
|
1841
|
+
- offset (integer, optional): The number of items to skip before starting to collect the result set.
|
|
1842
|
+
- expand (array of strings, optional): Fields to expand. Customer groups typically have no reference fields to expand.
|
|
1843
|
+
`;
|
|
1844
|
+
var createCustomerGroupsPrompt = `
|
|
1845
|
+
This tool will create a new Customer Group in commercetools.
|
|
1846
|
+
|
|
1847
|
+
Customer groups segment customers for pricing, promotions, or reporting. Common examples include "VIP", "Wholesale", or "B2B".
|
|
1848
|
+
|
|
1849
|
+
It takes these required arguments:
|
|
1850
|
+
- groupName (string): Unique name of the customer group. Must be different from any existing group name in the project.
|
|
1851
|
+
|
|
1852
|
+
It takes these optional arguments:
|
|
1853
|
+
- key (string, optional): User-defined unique identifier for the customer group (2-256 characters, alphanumeric with underscores/hyphens). If omitted, a key may be derived or left unset.
|
|
1854
|
+
- custom (object, optional): Custom fields for the customer group. Must include a "type" object with "id" and "typeId" set to "type", and optionally a "fields" object with custom field values. The Type must have resourceTypeIds including "customer-group".
|
|
1855
|
+
`;
|
|
1856
|
+
var updateCustomerGroupsPrompt = `
|
|
1857
|
+
This tool will update a Customer Group in commercetools using update actions from the commercetools API.
|
|
1858
|
+
|
|
1859
|
+
It takes these required arguments:
|
|
1860
|
+
- version (integer): The current version of the customer group (for optimistic locking).
|
|
1861
|
+
- actions (array): An array of update actions to perform. Each action must have an "action" field indicating the action type and any required fields for that action.
|
|
1862
|
+
|
|
1863
|
+
It takes these optional arguments:
|
|
1864
|
+
- id (string, optional): The ID of the customer group to update (required if key is not provided).
|
|
1865
|
+
- key (string, optional): The key of the customer group to update (required if id is not provided).
|
|
1866
|
+
|
|
1867
|
+
Example actions from the commercetools API include:
|
|
1868
|
+
- changeName: Change the name of the customer group. Requires "name" (string).
|
|
1869
|
+
- setKey: Set or change the key. Requires "key" (string, optional; omit or set to null to remove).
|
|
1870
|
+
- setCustomType: Set custom type and fields. Requires "type" (object with "id", "typeId") and optionally "fields" (object).
|
|
1871
|
+
- setCustomField: Set a custom field value. Requires "name" (string) and "value" (any; use null to remove).
|
|
1872
|
+
|
|
1873
|
+
Each action type requires specific fields according to the commercetools API documentation.
|
|
1874
|
+
`;
|
|
1875
|
+
var deleteCustomerGroupsPrompt = `
|
|
1876
|
+
This tool will delete a Customer Group from commercetools.
|
|
1877
|
+
|
|
1878
|
+
Deleting a customer group does not delete the customers that were assigned to it; their customerGroup reference will be cleared or may need to be updated separately depending on API behavior.
|
|
1879
|
+
|
|
1880
|
+
It takes these required arguments:
|
|
1881
|
+
- version (integer): The current version of the customer group (for optimistic locking).
|
|
1882
|
+
|
|
1883
|
+
It takes these optional arguments:
|
|
1884
|
+
- id (string, optional): The ID of the customer group to delete (required if key is not provided).
|
|
1885
|
+
- key (string, optional): The key of the customer group to delete (required if id is not provided).
|
|
1886
|
+
`;
|
|
1887
|
+
|
|
1888
|
+
// src/resources/customer-groups/customer-groups.handler.ts
|
|
1889
|
+
var CustomerGroupsHandler = class extends CommercetoolsResourceHandler {
|
|
1890
|
+
metadata = {
|
|
1891
|
+
namespace: "customer-groups",
|
|
1892
|
+
description: "Manage customer groups in commercetools",
|
|
1893
|
+
toolNamePrefix: TOOL_NAME_PREFIX,
|
|
1894
|
+
schemas: {
|
|
1895
|
+
read: readCustomerGroupsParameters,
|
|
1896
|
+
create: createCustomerGroupsParameters,
|
|
1897
|
+
update: updateCustomerGroupsParameters,
|
|
1898
|
+
delete: deleteCustomerGroupsParameters
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1901
|
+
constructor(apiClientFactory) {
|
|
1902
|
+
super(apiClientFactory);
|
|
1903
|
+
}
|
|
1904
|
+
getToolDefinition(operation) {
|
|
1905
|
+
const prompts = {
|
|
1906
|
+
read: readCustomerGroupsPrompt,
|
|
1907
|
+
create: createCustomerGroupsPrompt,
|
|
1908
|
+
update: updateCustomerGroupsPrompt,
|
|
1909
|
+
delete: deleteCustomerGroupsPrompt
|
|
1910
|
+
};
|
|
1911
|
+
return {
|
|
1912
|
+
name: this.getToolName(operation),
|
|
1913
|
+
description: prompts[operation],
|
|
1914
|
+
inputSchema: this.metadata.schemas[operation]
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
getCustomerGroupsApi(api) {
|
|
1918
|
+
return api.customerGroups();
|
|
1919
|
+
}
|
|
1920
|
+
async read(context) {
|
|
1921
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
1922
|
+
projectKey: context.configuration.projectKey
|
|
1923
|
+
});
|
|
1924
|
+
const params = context.parameters;
|
|
1925
|
+
try {
|
|
1926
|
+
const apiResource = this.getCustomerGroupsApi(api);
|
|
1927
|
+
if (params == null ? void 0 : params.id) {
|
|
1928
|
+
const res2 = await apiResource.withId({ ID: params.id }).get({
|
|
1929
|
+
queryArgs: { ...params.expand && { expand: params.expand } }
|
|
1930
|
+
}).execute();
|
|
1931
|
+
return res2.body;
|
|
1932
|
+
}
|
|
1933
|
+
if (params == null ? void 0 : params.key) {
|
|
1934
|
+
const res2 = await apiResource.withKey({ key: params.key }).get({
|
|
1935
|
+
queryArgs: { ...params.expand && { expand: params.expand } }
|
|
1936
|
+
}).execute();
|
|
1937
|
+
return res2.body;
|
|
1938
|
+
}
|
|
1939
|
+
const res = await apiResource.get({
|
|
1940
|
+
queryArgs: {
|
|
1941
|
+
limit: params.limit ?? 20,
|
|
1942
|
+
...params.offset != null && { offset: params.offset },
|
|
1943
|
+
...params.sort && { sort: params.sort },
|
|
1944
|
+
...params.where && { where: params.where },
|
|
1945
|
+
...params.expand && { expand: params.expand }
|
|
1946
|
+
}
|
|
1947
|
+
}).execute();
|
|
1948
|
+
return res.body;
|
|
1949
|
+
} catch (err) {
|
|
1950
|
+
throw new ToolExecutionError(
|
|
1951
|
+
"Failed to read customer groups",
|
|
1952
|
+
context,
|
|
1953
|
+
err
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
async create(context) {
|
|
1958
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
1959
|
+
projectKey: context.configuration.projectKey
|
|
1960
|
+
});
|
|
1961
|
+
const params = context.parameters;
|
|
1962
|
+
try {
|
|
1963
|
+
const body = {
|
|
1964
|
+
groupName: params.groupName,
|
|
1965
|
+
...params.key != null && { key: params.key },
|
|
1966
|
+
...params.custom != null && { custom: params.custom }
|
|
1967
|
+
};
|
|
1968
|
+
const created = await this.getCustomerGroupsApi(api).post({
|
|
1969
|
+
body
|
|
1970
|
+
}).execute();
|
|
1971
|
+
return created.body;
|
|
1972
|
+
} catch (err) {
|
|
1973
|
+
throw new ToolExecutionError(
|
|
1974
|
+
"Failed to create customer group",
|
|
1975
|
+
context,
|
|
1976
|
+
err
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
async update(context) {
|
|
1981
|
+
const api = this.getApiRoot(context).withProjectKey({
|
|
1982
|
+
projectKey: context.configuration.projectKey
|
|
1983
|
+
});
|
|
1984
|
+
const params = context.parameters;
|
|
1985
|
+
try {
|
|
1986
|
+
const apiResource = this.getCustomerGroupsApi(api);
|
|
1987
|
+
let groupId;
|
|
1988
|
+
let version = params.version;
|
|
1989
|
+
if (params.id) {
|
|
1990
|
+
groupId = params.id;
|
|
1991
|
+
} else if (params.key) {
|
|
1992
|
+
const res = await apiResource.withKey({ key: params.key }).get().execute();
|
|
1993
|
+
groupId = res.body.id;
|
|
1994
|
+
version = res.body.version;
|
|
1995
|
+
} else {
|
|
1996
|
+
throw new ToolExecutionError(
|
|
1997
|
+
"Either id or key must be provided",
|
|
1998
|
+
context
|
|
1999
|
+
);
|
|
2000
|
+
}
|
|
2001
|
+
const updated = await apiResource.withId({ ID: groupId }).post({
|
|
2002
|
+
body: {
|
|
2003
|
+
version,
|
|
2004
|
+
actions: params.actions ?? []
|
|
2005
|
+
}
|
|
2006
|
+
}).execute();
|
|
2007
|
+
return updated.body;
|
|
2008
|
+
} catch (err) {
|
|
2009
|
+
throw new ToolExecutionError(
|
|
2010
|
+
"Failed to update customer group",
|
|
2011
|
+
context,
|
|
2012
|
+
err
|
|
2013
|
+
);
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
async delete(context) {
|
|
2017
|
+
throw new ToolExecutionError(
|
|
2018
|
+
"Delete operation not implemented for customer groups",
|
|
2019
|
+
context
|
|
2020
|
+
);
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
async function readCustomerGroups(context, apiClientFactory) {
|
|
2024
|
+
const handler = new CustomerGroupsHandler(apiClientFactory);
|
|
2025
|
+
return handler.read(context);
|
|
2026
|
+
}
|
|
2027
|
+
async function createCustomerGroups(context, apiClientFactory) {
|
|
2028
|
+
const handler = new CustomerGroupsHandler(apiClientFactory);
|
|
2029
|
+
return handler.create(context);
|
|
2030
|
+
}
|
|
2031
|
+
async function updateCustomerGroups(context, apiClientFactory) {
|
|
2032
|
+
const handler = new CustomerGroupsHandler(apiClientFactory);
|
|
2033
|
+
return handler.update(context);
|
|
2034
|
+
}
|
|
2035
|
+
async function deleteCustomerGroups(context, apiClientFactory) {
|
|
2036
|
+
const handler = new CustomerGroupsHandler(apiClientFactory);
|
|
2037
|
+
return handler.delete(context);
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
// src/resources/customer-search/customer-search.schema.ts
|
|
2041
|
+
import { z as z9 } from "zod";
|
|
2042
|
+
var readCustomerSearchParameters = z9.object({
|
|
2043
|
+
query: z9.record(z9.any()).optional().describe(
|
|
2044
|
+
"Search query (SearchQuery). Use fullText (field, value), exact (field, value), range (field, gte, lt), or compound (and, or, not). Text fields: all, firstName, lastName, email, companyName, fullName, addresses.*. Keyword: id, key, customerNumber, externalId, vatId, customerGroup.id, stores.key. Number/date: dateOfBirth, createdAt, lastModifiedAt, version."
|
|
2045
|
+
),
|
|
2046
|
+
sort: z9.array(z9.record(z9.any())).optional().describe(
|
|
2047
|
+
'Sort criteria (SearchSorting). If not provided, results are sorted by relevance descending. Example: [{"field": "createdAt", "order": "desc"}]'
|
|
2048
|
+
),
|
|
2049
|
+
limit: z9.number().int().min(1).max(100).optional().describe(
|
|
2050
|
+
"Maximum number of search results. Default: 20. Minimum: 1, Maximum: 100."
|
|
2051
|
+
),
|
|
2052
|
+
offset: z9.number().int().min(0).max(9900).optional().describe(
|
|
2053
|
+
"Number of search results to skip for pagination. Default: 0. Minimum: 0, Maximum: 9900."
|
|
2054
|
+
)
|
|
2055
|
+
});
|
|
2056
|
+
var createCustomerSearchParameters = z9.object({}).describe("Customer Search does not support create operations");
|
|
2057
|
+
var updateCustomerSearchParameters = z9.object({}).describe("Customer Search does not support update operations");
|
|
2058
|
+
var deleteCustomerSearchParameters = z9.object({}).describe("Customer Search does not support delete operations");
|
|
2059
|
+
|
|
2060
|
+
// src/resources/customer-search/customer-search.prompt.ts
|
|
2061
|
+
var readCustomerSearchPrompt = `
|
|
2062
|
+
This tool searches across Customers in a commercetools Project using the [Customer Search API](https://docs.commercetools.com/api/projects/customer-search). It is designed for back-office use cases (e.g. Merchant Center, admin tools), not storefront search.
|
|
2063
|
+
|
|
2064
|
+
The API is **ID-first**: it returns only Customer IDs (and relevance scores). To get full Customer data, use the Get Customer by ID endpoint (customers.read with id) after searching.
|
|
2065
|
+
|
|
2066
|
+
Customer Search is deactivated for a Project by default. Activate it via the Project API (Change Customer Search status) or by indexing in Merchant Center (Customers > Customer list). If no search calls are made for 30 days, the feature is automatically deactivated.
|
|
2067
|
+
|
|
2068
|
+
It takes these optional arguments:
|
|
2069
|
+
- query (object, optional): Search query in the [Search Query Language](https://docs.commercetools.com/api/search-query-language). Examples:
|
|
2070
|
+
- Full-text on a field: { "fullText": { "field": "firstName", "value": "john" } }
|
|
2071
|
+
- Search in all text fields: { "fullText": { "field": "all", "value": "example" } }
|
|
2072
|
+
- Exact match (keyword): { "exact": { "field": "email", "value": "user@example.com" } } or { "exact": { "field": "id", "value": "customer-id" } }
|
|
2073
|
+
- Range (date/number): { "range": { "field": "createdAt", "gte": "2023-12-01T00:00:00.000Z", "lt": "2024-01-01T00:00:00.000Z" } }
|
|
2074
|
+
- Compound: { "and": [ { "fullText": { "field": "firstName", "value": "john" } }, { "exact": { "field": "customerGroup.id", "value": "group-id" } } ] } or { "or": [ ... ] }
|
|
2075
|
+
Text fields: all, firstName, lastName, email, companyName, fullName, addresses.all, addresses.city, addresses.country, etc. Keyword: id, key, customerNumber, externalId, vatId, customerGroup.id, stores.key. Number/date: dateOfBirth, createdAt, lastModifiedAt, version.
|
|
2076
|
+
- sort (array of objects, optional): Sort criteria (SearchSorting). If not provided, results are sorted by relevance descending. Example: [{"field": "createdAt", "order": "desc"}].
|
|
2077
|
+
- limit (integer, optional): Maximum number of results. Default: 20. Min: 1, Max: 100.
|
|
2078
|
+
- offset (integer, optional): Number of results to skip for pagination. Default: 0. Min: 0, Max: 9900.
|
|
2079
|
+
|
|
2080
|
+
If the index is not ready or the feature is inactive, a SearchNotReady error is returned.
|
|
2081
|
+
`;
|
|
2082
|
+
var createCustomerSearchPrompt = `
|
|
2083
|
+
Customer Search does not support create operations. This is a read-only search API. Use the Customers API (customers.create) to create customers.
|
|
2084
|
+
`;
|
|
2085
|
+
var updateCustomerSearchPrompt = `
|
|
2086
|
+
Customer Search does not support update operations. This is a read-only search API. Use the Customers API (customers.update) to update customers.
|
|
2087
|
+
`;
|
|
2088
|
+
var deleteCustomerSearchPrompt = `
|
|
2089
|
+
Customer Search does not support delete operations. This is a read-only search API. Use the Customers API (customers.delete) to delete customers.
|
|
2090
|
+
`;
|
|
2091
|
+
|
|
2092
|
+
// src/resources/customer-search/customer-search.handler.ts
|
|
2093
|
+
var CustomerSearchHandler = class extends CommercetoolsResourceHandler {
|
|
2094
|
+
metadata = {
|
|
2095
|
+
namespace: "customer-search",
|
|
2096
|
+
description: "Search customers in commercetools (back-office, ID-first)",
|
|
2097
|
+
toolNamePrefix: TOOL_NAME_PREFIX,
|
|
2098
|
+
schemas: {
|
|
2099
|
+
read: readCustomerSearchParameters,
|
|
2100
|
+
create: createCustomerSearchParameters,
|
|
2101
|
+
update: updateCustomerSearchParameters,
|
|
2102
|
+
delete: deleteCustomerSearchParameters
|
|
2103
|
+
}
|
|
2104
|
+
};
|
|
2105
|
+
constructor(apiClientFactory) {
|
|
2106
|
+
super(apiClientFactory);
|
|
2107
|
+
}
|
|
2108
|
+
getToolDefinition(operation) {
|
|
2109
|
+
const prompts = {
|
|
2110
|
+
read: readCustomerSearchPrompt,
|
|
2111
|
+
create: createCustomerSearchPrompt,
|
|
2112
|
+
update: updateCustomerSearchPrompt,
|
|
2113
|
+
delete: deleteCustomerSearchPrompt
|
|
2114
|
+
};
|
|
2115
|
+
return {
|
|
2116
|
+
name: this.getToolName(operation),
|
|
2117
|
+
description: prompts[operation],
|
|
2118
|
+
inputSchema: this.metadata.schemas[operation]
|
|
2119
|
+
};
|
|
2120
|
+
}
|
|
2121
|
+
getCustomerSearchApi(api) {
|
|
2122
|
+
return api.customers().search();
|
|
2123
|
+
}
|
|
2124
|
+
async read(context) {
|
|
1443
2125
|
const api = this.getApiRoot(context).withProjectKey({
|
|
1444
2126
|
projectKey: context.configuration.projectKey
|
|
1445
2127
|
});
|
|
1446
2128
|
const params = context.parameters;
|
|
1447
2129
|
try {
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
2130
|
+
const body = {
|
|
2131
|
+
...params.query != null && {
|
|
2132
|
+
query: params.query
|
|
2133
|
+
},
|
|
2134
|
+
...params.sort != null && {
|
|
2135
|
+
sort: params.sort
|
|
2136
|
+
},
|
|
2137
|
+
...params.limit != null && { limit: params.limit },
|
|
2138
|
+
...params.offset != null && { offset: params.offset }
|
|
2139
|
+
};
|
|
2140
|
+
const searchResponse = await this.getCustomerSearchApi(api).post({ body }).execute();
|
|
2141
|
+
return searchResponse.body;
|
|
2142
|
+
} catch (err) {
|
|
1453
2143
|
throw new ToolExecutionError(
|
|
1454
|
-
"Failed to
|
|
2144
|
+
err.message || "Failed to search customers",
|
|
1455
2145
|
context,
|
|
1456
|
-
|
|
2146
|
+
err
|
|
1457
2147
|
);
|
|
1458
2148
|
}
|
|
1459
2149
|
}
|
|
2150
|
+
async create(context) {
|
|
2151
|
+
throw new ToolExecutionError(
|
|
2152
|
+
"Create operation not supported for customer-search",
|
|
2153
|
+
context
|
|
2154
|
+
);
|
|
2155
|
+
}
|
|
1460
2156
|
async update(context) {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
try {
|
|
1466
|
-
const customer = await api.customers().withId({ ID: params.id }).get().execute();
|
|
1467
|
-
const currentVersion = customer.body.version;
|
|
1468
|
-
const updatedCustomer = await api.customers().withId({ ID: params.id }).post({
|
|
1469
|
-
body: {
|
|
1470
|
-
version: currentVersion,
|
|
1471
|
-
actions: params.actions
|
|
1472
|
-
}
|
|
1473
|
-
}).execute();
|
|
1474
|
-
return updatedCustomer.body;
|
|
1475
|
-
} catch (error) {
|
|
1476
|
-
throw new ToolExecutionError(
|
|
1477
|
-
"Failed to update customers",
|
|
1478
|
-
context,
|
|
1479
|
-
error
|
|
1480
|
-
);
|
|
1481
|
-
}
|
|
2157
|
+
throw new ToolExecutionError(
|
|
2158
|
+
"Update operation not supported for customer-search",
|
|
2159
|
+
context
|
|
2160
|
+
);
|
|
1482
2161
|
}
|
|
1483
2162
|
async delete(context) {
|
|
1484
|
-
throw new ToolExecutionError(
|
|
2163
|
+
throw new ToolExecutionError(
|
|
2164
|
+
"Delete operation not supported for customer-search",
|
|
2165
|
+
context
|
|
2166
|
+
);
|
|
1485
2167
|
}
|
|
1486
2168
|
};
|
|
1487
|
-
async function
|
|
1488
|
-
const handler = new
|
|
2169
|
+
async function readCustomerSearch(context, apiClientFactory) {
|
|
2170
|
+
const handler = new CustomerSearchHandler(apiClientFactory);
|
|
1489
2171
|
return handler.read(context);
|
|
1490
2172
|
}
|
|
1491
|
-
async function
|
|
1492
|
-
const handler = new
|
|
2173
|
+
async function createCustomerSearch(context, apiClientFactory) {
|
|
2174
|
+
const handler = new CustomerSearchHandler(apiClientFactory);
|
|
1493
2175
|
return handler.create(context);
|
|
1494
2176
|
}
|
|
1495
|
-
async function
|
|
1496
|
-
const handler = new
|
|
2177
|
+
async function updateCustomerSearch(context, apiClientFactory) {
|
|
2178
|
+
const handler = new CustomerSearchHandler(apiClientFactory);
|
|
1497
2179
|
return handler.update(context);
|
|
1498
2180
|
}
|
|
1499
|
-
async function
|
|
1500
|
-
const handler = new
|
|
2181
|
+
async function deleteCustomerSearch(context, apiClientFactory) {
|
|
2182
|
+
const handler = new CustomerSearchHandler(apiClientFactory);
|
|
1501
2183
|
return handler.delete(context);
|
|
1502
2184
|
}
|
|
1503
2185
|
|
|
1504
2186
|
// src/resources/discount-codes/discount-codes.schema.ts
|
|
1505
|
-
import { z as
|
|
1506
|
-
var readDiscountCodesParameters =
|
|
1507
|
-
id:
|
|
1508
|
-
key:
|
|
1509
|
-
where:
|
|
2187
|
+
import { z as z10 } from "zod";
|
|
2188
|
+
var readDiscountCodesParameters = z10.object({
|
|
2189
|
+
id: z10.string().optional().describe("Discount Code ID"),
|
|
2190
|
+
key: z10.string().optional().describe("Discount Code key"),
|
|
2191
|
+
where: z10.array(z10.string()).optional().describe(
|
|
1510
2192
|
'Query predicates specified as strings. Example: ["code = \\"SUMMER2024\\""]'
|
|
1511
2193
|
),
|
|
1512
|
-
sort:
|
|
2194
|
+
sort: z10.array(z10.string()).optional().describe(
|
|
1513
2195
|
'Sort criteria for the results. Example: ["code asc", "createdAt desc"]'
|
|
1514
2196
|
),
|
|
1515
|
-
limit:
|
|
2197
|
+
limit: z10.number().int().min(1).max(500).optional().describe(
|
|
1516
2198
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
1517
2199
|
),
|
|
1518
|
-
offset:
|
|
2200
|
+
offset: z10.number().int().min(0).optional().describe(
|
|
1519
2201
|
"The number of items to skip before starting to collect the result set."
|
|
1520
2202
|
),
|
|
1521
|
-
expand:
|
|
2203
|
+
expand: z10.array(z10.string()).optional().describe('Fields to expand. Example: ["cartDiscounts[*]"]')
|
|
1522
2204
|
});
|
|
1523
|
-
var createDiscountCodesParameters =
|
|
1524
|
-
key:
|
|
1525
|
-
name:
|
|
1526
|
-
description:
|
|
1527
|
-
code:
|
|
2205
|
+
var createDiscountCodesParameters = z10.object({
|
|
2206
|
+
key: z10.string().min(2).max(256).optional().describe("User-defined unique identifier for the discount code"),
|
|
2207
|
+
name: z10.record(z10.string()).optional().describe("Localized name of the Discount Code"),
|
|
2208
|
+
description: z10.record(z10.string()).optional().describe("Localized description"),
|
|
2209
|
+
code: z10.string().describe(
|
|
1528
2210
|
"User-defined unique identifier added to a Cart to apply related Cart Discounts"
|
|
1529
2211
|
),
|
|
1530
|
-
cartDiscounts:
|
|
1531
|
-
|
|
1532
|
-
id:
|
|
1533
|
-
key:
|
|
1534
|
-
typeId:
|
|
2212
|
+
cartDiscounts: z10.array(
|
|
2213
|
+
z10.object({
|
|
2214
|
+
id: z10.string().optional(),
|
|
2215
|
+
key: z10.string().optional(),
|
|
2216
|
+
typeId: z10.literal("cart-discount")
|
|
1535
2217
|
})
|
|
1536
2218
|
).describe(
|
|
1537
2219
|
"Array of references to up to 10 CartDiscounts that apply when the code is used"
|
|
1538
2220
|
),
|
|
1539
|
-
cartPredicate:
|
|
1540
|
-
isActive:
|
|
1541
|
-
maxApplications:
|
|
1542
|
-
maxApplicationsPerCustomer:
|
|
1543
|
-
groups:
|
|
1544
|
-
validFrom:
|
|
1545
|
-
validUntil:
|
|
1546
|
-
custom:
|
|
1547
|
-
type:
|
|
1548
|
-
id:
|
|
1549
|
-
typeId:
|
|
2221
|
+
cartPredicate: z10.string().optional().describe("Optional predicate defining which Carts the code can apply to"),
|
|
2222
|
+
isActive: z10.boolean().optional().describe("Whether the code can be applied (defaults to false)"),
|
|
2223
|
+
maxApplications: z10.number().int().min(0).optional().describe("Total number of times the code can be applied"),
|
|
2224
|
+
maxApplicationsPerCustomer: z10.number().int().min(0).optional().describe("Times the code can be applied per customer"),
|
|
2225
|
+
groups: z10.array(z10.string()).optional().describe("Tags for grouping and organizing Discount Codes"),
|
|
2226
|
+
validFrom: z10.string().optional().describe("Date/time when the code becomes valid (ISO 8601 format)"),
|
|
2227
|
+
validUntil: z10.string().optional().describe("Date/time when the code expires (ISO 8601 format)"),
|
|
2228
|
+
custom: z10.object({
|
|
2229
|
+
type: z10.object({
|
|
2230
|
+
id: z10.string(),
|
|
2231
|
+
typeId: z10.literal("type")
|
|
1550
2232
|
}).optional(),
|
|
1551
|
-
fields:
|
|
2233
|
+
fields: z10.record(z10.string(), z10.any()).optional()
|
|
1552
2234
|
}).optional().describe("Custom fields for the discount code")
|
|
1553
2235
|
});
|
|
1554
|
-
var updateDiscountCodesParameters =
|
|
1555
|
-
id:
|
|
1556
|
-
key:
|
|
1557
|
-
version:
|
|
1558
|
-
actions:
|
|
1559
|
-
|
|
1560
|
-
action:
|
|
1561
|
-
}).and(
|
|
2236
|
+
var updateDiscountCodesParameters = z10.object({
|
|
2237
|
+
id: z10.string().optional().describe("The ID of the discount code to update"),
|
|
2238
|
+
key: z10.string().optional().describe("The key of the discount code to update"),
|
|
2239
|
+
version: z10.number().int().describe("The current version of the discount code"),
|
|
2240
|
+
actions: z10.array(
|
|
2241
|
+
z10.object({
|
|
2242
|
+
action: z10.string().describe("The name of the update action to perform")
|
|
2243
|
+
}).and(z10.record(z10.string(), z10.any()).optional()).describe(
|
|
1562
2244
|
'Array of update actions to perform on the discount code. Each action should have an "action" field and other fields specific to that action type.'
|
|
1563
2245
|
)
|
|
1564
2246
|
).describe("Update actions")
|
|
1565
2247
|
});
|
|
1566
|
-
var deleteDiscountCodesParameters =
|
|
1567
|
-
id:
|
|
1568
|
-
key:
|
|
1569
|
-
version:
|
|
1570
|
-
dataErasure:
|
|
2248
|
+
var deleteDiscountCodesParameters = z10.object({
|
|
2249
|
+
id: z10.string().optional().describe("Discount Code ID"),
|
|
2250
|
+
key: z10.string().optional().describe("Discount Code key"),
|
|
2251
|
+
version: z10.number().int().describe("Current version (for optimistic locking)"),
|
|
2252
|
+
dataErasure: z10.boolean().optional().describe("Delete personal data")
|
|
1571
2253
|
});
|
|
1572
2254
|
|
|
1573
2255
|
// src/resources/discount-codes/discount-codes.prompt.ts
|
|
@@ -1771,7 +2453,10 @@ var DiscountCodesHandler = class extends CommercetoolsResourceHandler {
|
|
|
1771
2453
|
}
|
|
1772
2454
|
}
|
|
1773
2455
|
async delete(context) {
|
|
1774
|
-
throw new ToolExecutionError(
|
|
2456
|
+
throw new ToolExecutionError(
|
|
2457
|
+
"Delete operation not implemented for discount codes",
|
|
2458
|
+
context
|
|
2459
|
+
);
|
|
1775
2460
|
}
|
|
1776
2461
|
};
|
|
1777
2462
|
async function readDiscountCodes(context, apiClientFactory) {
|
|
@@ -1792,44 +2477,44 @@ async function deleteDiscountCodes(context, apiClientFactory) {
|
|
|
1792
2477
|
}
|
|
1793
2478
|
|
|
1794
2479
|
// src/resources/extensions/extensions.schema.ts
|
|
1795
|
-
import { z as
|
|
1796
|
-
var readExtensionsParameters =
|
|
1797
|
-
id:
|
|
1798
|
-
key:
|
|
1799
|
-
where:
|
|
2480
|
+
import { z as z11 } from "zod";
|
|
2481
|
+
var readExtensionsParameters = z11.object({
|
|
2482
|
+
id: z11.string().optional().describe("Extension ID"),
|
|
2483
|
+
key: z11.string().optional().describe("Extension key"),
|
|
2484
|
+
where: z11.array(z11.string()).optional().describe(
|
|
1800
2485
|
'Query predicates specified as strings. Example: ["key = \\"my-extension\\""]'
|
|
1801
2486
|
),
|
|
1802
|
-
sort:
|
|
2487
|
+
sort: z11.array(z11.string()).optional().describe(
|
|
1803
2488
|
'Sort criteria for the results. Example: ["key asc", "createdAt desc"]'
|
|
1804
2489
|
),
|
|
1805
|
-
limit:
|
|
2490
|
+
limit: z11.number().int().min(1).max(500).optional().describe(
|
|
1806
2491
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
1807
2492
|
),
|
|
1808
|
-
offset:
|
|
2493
|
+
offset: z11.number().int().min(0).optional().describe(
|
|
1809
2494
|
"The number of items to skip before starting to collect the result set."
|
|
1810
2495
|
),
|
|
1811
|
-
expand:
|
|
2496
|
+
expand: z11.array(z11.string()).optional().describe('Fields to expand. Example: ["destination", "triggers"]')
|
|
1812
2497
|
});
|
|
1813
|
-
var createExtensionsParameters =
|
|
1814
|
-
key:
|
|
1815
|
-
destination:
|
|
1816
|
-
type:
|
|
1817
|
-
url:
|
|
1818
|
-
arn:
|
|
1819
|
-
accessKey:
|
|
1820
|
-
accessSecret:
|
|
1821
|
-
region:
|
|
1822
|
-
authentication:
|
|
1823
|
-
type:
|
|
1824
|
-
headerValue:
|
|
1825
|
-
key:
|
|
2498
|
+
var createExtensionsParameters = z11.object({
|
|
2499
|
+
key: z11.string().min(2).max(256).optional().describe("User-defined unique identifier for the extension"),
|
|
2500
|
+
destination: z11.object({
|
|
2501
|
+
type: z11.enum(["HTTP", "AWSLambda", "GoogleCloudFunction"]),
|
|
2502
|
+
url: z11.string().optional().describe("URL of the HTTP endpoint or Google Cloud Function"),
|
|
2503
|
+
arn: z11.string().optional().describe("ARN of the AWS Lambda function"),
|
|
2504
|
+
accessKey: z11.string().optional().describe("AWS access key or Azure Event Grid access key"),
|
|
2505
|
+
accessSecret: z11.string().optional().describe("AWS access secret"),
|
|
2506
|
+
region: z11.string().optional().describe("AWS region or Google Cloud region"),
|
|
2507
|
+
authentication: z11.object({
|
|
2508
|
+
type: z11.enum(["AuthorizationHeader", "AzureFunctions"]),
|
|
2509
|
+
headerValue: z11.string().optional().describe("Header value for authorization"),
|
|
2510
|
+
key: z11.string().optional().describe("Function key for authentication")
|
|
1826
2511
|
}).optional().describe("Authentication configuration"),
|
|
1827
|
-
connectionString:
|
|
1828
|
-
uri:
|
|
2512
|
+
connectionString: z11.string().optional().describe("Azure Service Bus connection string"),
|
|
2513
|
+
uri: z11.string().optional().describe("RabbitMQ URI or Azure Event Grid URI")
|
|
1829
2514
|
}).describe("Destination configuration for the extension"),
|
|
1830
|
-
triggers:
|
|
1831
|
-
|
|
1832
|
-
resourceTypeId:
|
|
2515
|
+
triggers: z11.array(
|
|
2516
|
+
z11.object({
|
|
2517
|
+
resourceTypeId: z11.enum([
|
|
1833
2518
|
"cart",
|
|
1834
2519
|
"order",
|
|
1835
2520
|
"payment",
|
|
@@ -1842,30 +2527,30 @@ var createExtensionsParameters = z8.object({
|
|
|
1842
2527
|
"business-unit",
|
|
1843
2528
|
"shopping-list"
|
|
1844
2529
|
]).describe("Resource type that triggers the extension"),
|
|
1845
|
-
actions:
|
|
1846
|
-
condition:
|
|
2530
|
+
actions: z11.array(z11.enum(["Create", "Update"])).describe("Actions that trigger the extension"),
|
|
2531
|
+
condition: z11.string().optional().describe("Conditional predicate for triggering")
|
|
1847
2532
|
})
|
|
1848
2533
|
).describe("Describes what triggers the extension"),
|
|
1849
|
-
timeoutInMs:
|
|
2534
|
+
timeoutInMs: z11.number().int().min(1).max(1e4).optional().describe(
|
|
1850
2535
|
"Maximum time in milliseconds for the extension to respond (default: 2000, max: 10000)"
|
|
1851
2536
|
)
|
|
1852
2537
|
});
|
|
1853
|
-
var updateExtensionsParameters =
|
|
1854
|
-
id:
|
|
1855
|
-
key:
|
|
1856
|
-
version:
|
|
1857
|
-
actions:
|
|
1858
|
-
|
|
1859
|
-
action:
|
|
1860
|
-
}).and(
|
|
2538
|
+
var updateExtensionsParameters = z11.object({
|
|
2539
|
+
id: z11.string().optional().describe("The ID of the extension to update"),
|
|
2540
|
+
key: z11.string().optional().describe("The key of the extension to update"),
|
|
2541
|
+
version: z11.number().int().describe("The current version of the extension"),
|
|
2542
|
+
actions: z11.array(
|
|
2543
|
+
z11.object({
|
|
2544
|
+
action: z11.string().describe("The name of the update action to perform")
|
|
2545
|
+
}).and(z11.record(z11.string(), z11.any()).optional()).describe(
|
|
1861
2546
|
'Array of update actions to perform on the extension. Each action should have an "action" field and other fields specific to that action type.'
|
|
1862
2547
|
)
|
|
1863
2548
|
).describe("Update actions")
|
|
1864
2549
|
});
|
|
1865
|
-
var deleteExtensionsParameters =
|
|
1866
|
-
id:
|
|
1867
|
-
key:
|
|
1868
|
-
version:
|
|
2550
|
+
var deleteExtensionsParameters = z11.object({
|
|
2551
|
+
id: z11.string().optional().describe("Extension ID"),
|
|
2552
|
+
key: z11.string().optional().describe("Extension key"),
|
|
2553
|
+
version: z11.number().int().describe("Current version (for optimistic locking)")
|
|
1869
2554
|
});
|
|
1870
2555
|
|
|
1871
2556
|
// src/resources/extensions/extensions.prompt.ts
|
|
@@ -2072,60 +2757,60 @@ async function deleteExtensions(context, apiClientFactory) {
|
|
|
2072
2757
|
}
|
|
2073
2758
|
|
|
2074
2759
|
// src/resources/inventory/inventory.schema.ts
|
|
2075
|
-
import { z as
|
|
2076
|
-
var readInventoryParameters =
|
|
2077
|
-
id:
|
|
2078
|
-
key:
|
|
2079
|
-
sku:
|
|
2080
|
-
where:
|
|
2760
|
+
import { z as z12 } from "zod";
|
|
2761
|
+
var readInventoryParameters = z12.object({
|
|
2762
|
+
id: z12.string().optional().describe("Inventory Entry ID"),
|
|
2763
|
+
key: z12.string().optional().describe("Inventory Entry key"),
|
|
2764
|
+
sku: z12.string().optional().describe("SKU of the product variant"),
|
|
2765
|
+
where: z12.array(z12.string()).optional().describe(
|
|
2081
2766
|
'Query predicates specified as strings. Example: ["sku = \\"SKU-123\\""]'
|
|
2082
2767
|
),
|
|
2083
|
-
sort:
|
|
2768
|
+
sort: z12.array(z12.string()).optional().describe(
|
|
2084
2769
|
'Sort criteria for the results. Example: ["quantityOnStock desc", "createdAt asc"]'
|
|
2085
2770
|
),
|
|
2086
|
-
limit:
|
|
2771
|
+
limit: z12.number().int().min(1).max(500).optional().describe(
|
|
2087
2772
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 10."
|
|
2088
2773
|
),
|
|
2089
|
-
offset:
|
|
2774
|
+
offset: z12.number().int().min(0).optional().describe(
|
|
2090
2775
|
"The number of items to skip before starting to collect the result set."
|
|
2091
2776
|
),
|
|
2092
|
-
expand:
|
|
2777
|
+
expand: z12.array(z12.string()).optional().describe('Fields to expand. Example: ["supplyChannel"]')
|
|
2093
2778
|
});
|
|
2094
|
-
var createInventoryParameters =
|
|
2095
|
-
sku:
|
|
2096
|
-
quantityOnStock:
|
|
2097
|
-
key:
|
|
2098
|
-
supplyChannel:
|
|
2099
|
-
id:
|
|
2100
|
-
key:
|
|
2101
|
-
typeId:
|
|
2779
|
+
var createInventoryParameters = z12.object({
|
|
2780
|
+
sku: z12.string().describe("SKU of the product variant"),
|
|
2781
|
+
quantityOnStock: z12.number().int().min(0).describe("Quantity available in stock"),
|
|
2782
|
+
key: z12.string().optional().describe("User-defined unique identifier"),
|
|
2783
|
+
supplyChannel: z12.object({
|
|
2784
|
+
id: z12.string().optional(),
|
|
2785
|
+
key: z12.string().optional(),
|
|
2786
|
+
typeId: z12.literal("channel")
|
|
2102
2787
|
}).optional().describe("Supply channel reference"),
|
|
2103
|
-
expectedDelivery:
|
|
2788
|
+
expectedDelivery: z12.string().optional().describe(
|
|
2104
2789
|
"Expected delivery date in ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ)"
|
|
2105
2790
|
),
|
|
2106
|
-
restockableInDays:
|
|
2107
|
-
custom:
|
|
2108
|
-
type:
|
|
2109
|
-
id:
|
|
2110
|
-
typeId:
|
|
2791
|
+
restockableInDays: z12.number().int().min(0).optional().describe("Number of days until the item is restockable"),
|
|
2792
|
+
custom: z12.object({
|
|
2793
|
+
type: z12.object({
|
|
2794
|
+
id: z12.string(),
|
|
2795
|
+
typeId: z12.literal("type")
|
|
2111
2796
|
}).optional(),
|
|
2112
|
-
fields:
|
|
2797
|
+
fields: z12.record(z12.string(), z12.any()).optional()
|
|
2113
2798
|
}).optional().describe("Custom fields")
|
|
2114
2799
|
});
|
|
2115
|
-
var updateInventoryParameters =
|
|
2116
|
-
id:
|
|
2117
|
-
key:
|
|
2118
|
-
version:
|
|
2119
|
-
actions:
|
|
2120
|
-
|
|
2121
|
-
action:
|
|
2122
|
-
}).and(
|
|
2800
|
+
var updateInventoryParameters = z12.object({
|
|
2801
|
+
id: z12.string().optional().describe("The ID of the inventory entry to update"),
|
|
2802
|
+
key: z12.string().optional().describe("The key of the inventory entry to update"),
|
|
2803
|
+
version: z12.number().int().describe("The current version of the inventory entry"),
|
|
2804
|
+
actions: z12.array(
|
|
2805
|
+
z12.object({
|
|
2806
|
+
action: z12.string().describe("The name of the update action")
|
|
2807
|
+
}).and(z12.record(z12.string(), z12.unknown()))
|
|
2123
2808
|
).describe("Update actions")
|
|
2124
2809
|
});
|
|
2125
|
-
var deleteInventoryParameters =
|
|
2126
|
-
id:
|
|
2127
|
-
key:
|
|
2128
|
-
version:
|
|
2810
|
+
var deleteInventoryParameters = z12.object({
|
|
2811
|
+
id: z12.string().optional().describe("Inventory Entry ID"),
|
|
2812
|
+
key: z12.string().optional().describe("Inventory Entry key"),
|
|
2813
|
+
version: z12.number().int().describe("Current version")
|
|
2129
2814
|
});
|
|
2130
2815
|
|
|
2131
2816
|
// src/resources/inventory/inventory.prompt.ts
|
|
@@ -2347,18 +3032,18 @@ async function deleteInventory(context, apiClientFactory) {
|
|
|
2347
3032
|
}
|
|
2348
3033
|
|
|
2349
3034
|
// src/resources/messages/messages.schema.ts
|
|
2350
|
-
import { z as
|
|
2351
|
-
var readMessagesParameters =
|
|
2352
|
-
id:
|
|
2353
|
-
where:
|
|
2354
|
-
sort:
|
|
2355
|
-
limit:
|
|
2356
|
-
offset:
|
|
2357
|
-
expand:
|
|
3035
|
+
import { z as z13 } from "zod";
|
|
3036
|
+
var readMessagesParameters = z13.object({
|
|
3037
|
+
id: z13.string().optional(),
|
|
3038
|
+
where: z13.array(z13.string()).optional(),
|
|
3039
|
+
sort: z13.array(z13.string()).optional(),
|
|
3040
|
+
limit: z13.number().int().min(1).max(500).optional(),
|
|
3041
|
+
offset: z13.number().int().optional(),
|
|
3042
|
+
expand: z13.array(z13.string()).optional()
|
|
2358
3043
|
});
|
|
2359
|
-
var createMessagesParameters =
|
|
2360
|
-
var updateMessagesParameters =
|
|
2361
|
-
var deleteMessagesParameters =
|
|
3044
|
+
var createMessagesParameters = z13.object({});
|
|
3045
|
+
var updateMessagesParameters = z13.object({});
|
|
3046
|
+
var deleteMessagesParameters = z13.object({});
|
|
2362
3047
|
|
|
2363
3048
|
// src/resources/messages/messages.prompt.ts
|
|
2364
3049
|
var readMessagesPrompt = `
|
|
@@ -2469,52 +3154,52 @@ async function deleteMessages(_context, apiClientFactory) {
|
|
|
2469
3154
|
}
|
|
2470
3155
|
|
|
2471
3156
|
// src/resources/product-discounts/product-discounts.schema.ts
|
|
2472
|
-
import { z as
|
|
2473
|
-
var readProductDiscountsParameters =
|
|
2474
|
-
id:
|
|
2475
|
-
key:
|
|
2476
|
-
where:
|
|
3157
|
+
import { z as z14 } from "zod";
|
|
3158
|
+
var readProductDiscountsParameters = z14.object({
|
|
3159
|
+
id: z14.string().optional().describe("Product Discount ID"),
|
|
3160
|
+
key: z14.string().optional().describe("Product Discount key"),
|
|
3161
|
+
where: z14.array(z14.string()).optional().describe(
|
|
2477
3162
|
'Query predicates specified as strings. Example: ["key = \\"summer-sale\\""]'
|
|
2478
3163
|
),
|
|
2479
|
-
sort:
|
|
3164
|
+
sort: z14.array(z14.string()).optional().describe(
|
|
2480
3165
|
'Sort criteria for the results. Example: ["key asc", "createdAt desc"]'
|
|
2481
3166
|
),
|
|
2482
|
-
limit:
|
|
3167
|
+
limit: z14.number().int().min(1).max(500).optional().describe(
|
|
2483
3168
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
2484
3169
|
),
|
|
2485
|
-
offset:
|
|
3170
|
+
offset: z14.number().int().min(0).optional().describe(
|
|
2486
3171
|
"The number of items to skip before starting to collect the result set."
|
|
2487
3172
|
),
|
|
2488
|
-
expand:
|
|
3173
|
+
expand: z14.array(z14.string()).optional().describe("Fields to expand. Example: []")
|
|
2489
3174
|
});
|
|
2490
|
-
var createProductDiscountsParameters =
|
|
2491
|
-
key:
|
|
2492
|
-
name:
|
|
2493
|
-
description:
|
|
2494
|
-
value:
|
|
2495
|
-
predicate:
|
|
2496
|
-
sortOrder:
|
|
2497
|
-
isActive:
|
|
2498
|
-
validFrom:
|
|
2499
|
-
validUntil:
|
|
2500
|
-
references:
|
|
3175
|
+
var createProductDiscountsParameters = z14.object({
|
|
3176
|
+
key: z14.string().min(2).max(256).optional().describe("User-defined unique identifier for the product discount"),
|
|
3177
|
+
name: z14.record(z14.string()).describe("Product Discount name (localized string)"),
|
|
3178
|
+
description: z14.record(z14.string()).optional().describe("Product Discount description (localized string)"),
|
|
3179
|
+
value: z14.any().describe("Value of the product discount"),
|
|
3180
|
+
predicate: z14.string().describe("Valid ProductDiscount predicate"),
|
|
3181
|
+
sortOrder: z14.string().describe("String value used to order ProductDiscounts"),
|
|
3182
|
+
isActive: z14.boolean().optional().describe("Whether the product discount is active (defaults to true)"),
|
|
3183
|
+
validFrom: z14.string().optional().describe("Date/time when the discount becomes valid (ISO 8601 format)"),
|
|
3184
|
+
validUntil: z14.string().optional().describe("Date/time when the discount expires (ISO 8601 format)"),
|
|
3185
|
+
references: z14.array(z14.any()).optional().describe("References to other resources")
|
|
2501
3186
|
});
|
|
2502
|
-
var updateProductDiscountsParameters =
|
|
2503
|
-
id:
|
|
2504
|
-
key:
|
|
2505
|
-
version:
|
|
2506
|
-
actions:
|
|
2507
|
-
|
|
2508
|
-
action:
|
|
2509
|
-
}).and(
|
|
3187
|
+
var updateProductDiscountsParameters = z14.object({
|
|
3188
|
+
id: z14.string().optional().describe("The ID of the product discount to update"),
|
|
3189
|
+
key: z14.string().optional().describe("The key of the product discount to update"),
|
|
3190
|
+
version: z14.number().int().describe("The current version of the product discount"),
|
|
3191
|
+
actions: z14.array(
|
|
3192
|
+
z14.object({
|
|
3193
|
+
action: z14.string().describe("The name of the update action to perform")
|
|
3194
|
+
}).and(z14.record(z14.string(), z14.any()).optional()).describe(
|
|
2510
3195
|
'Array of update actions to perform on the product discount. Each action should have an "action" field and other fields specific to that action type.'
|
|
2511
3196
|
)
|
|
2512
3197
|
).describe("Update actions")
|
|
2513
3198
|
});
|
|
2514
|
-
var deleteProductDiscountsParameters =
|
|
2515
|
-
id:
|
|
2516
|
-
key:
|
|
2517
|
-
version:
|
|
3199
|
+
var deleteProductDiscountsParameters = z14.object({
|
|
3200
|
+
id: z14.string().optional().describe("Product Discount ID"),
|
|
3201
|
+
key: z14.string().optional().describe("Product Discount key"),
|
|
3202
|
+
version: z14.number().int().describe("Current version (for optimistic locking)")
|
|
2518
3203
|
});
|
|
2519
3204
|
|
|
2520
3205
|
// src/resources/product-discounts/product-discounts.prompt.ts
|
|
@@ -2731,20 +3416,20 @@ async function deleteProductDiscounts(context, apiClientFactory) {
|
|
|
2731
3416
|
}
|
|
2732
3417
|
|
|
2733
3418
|
// src/resources/product-projections/product-projections.schema.ts
|
|
2734
|
-
import { z as
|
|
2735
|
-
var readProductProjectionsParameters =
|
|
2736
|
-
id:
|
|
2737
|
-
key:
|
|
2738
|
-
where:
|
|
2739
|
-
sort:
|
|
2740
|
-
limit:
|
|
2741
|
-
offset:
|
|
2742
|
-
expand:
|
|
2743
|
-
fuzzy:
|
|
3419
|
+
import { z as z15 } from "zod";
|
|
3420
|
+
var readProductProjectionsParameters = z15.object({
|
|
3421
|
+
id: z15.string().optional(),
|
|
3422
|
+
key: z15.string().optional(),
|
|
3423
|
+
where: z15.array(z15.string()).optional(),
|
|
3424
|
+
sort: z15.array(z15.string()).optional(),
|
|
3425
|
+
limit: z15.number().int().min(1).max(500).optional(),
|
|
3426
|
+
offset: z15.number().int().optional(),
|
|
3427
|
+
expand: z15.array(z15.string()).optional(),
|
|
3428
|
+
fuzzy: z15.boolean().optional()
|
|
2744
3429
|
});
|
|
2745
|
-
var createProductProjectionsParameters =
|
|
2746
|
-
var updateProductProjectionsParameters =
|
|
2747
|
-
var deleteProductProjectionsParameters =
|
|
3430
|
+
var createProductProjectionsParameters = z15.object({});
|
|
3431
|
+
var updateProductProjectionsParameters = z15.object({});
|
|
3432
|
+
var deleteProductProjectionsParameters = z15.object({});
|
|
2748
3433
|
|
|
2749
3434
|
// src/resources/product-projections/product-projections.prompt.ts
|
|
2750
3435
|
var readProductProjectionsPrompt = `
|
|
@@ -2878,30 +3563,30 @@ async function deleteProductProjections(_context, apiClientFactory) {
|
|
|
2878
3563
|
}
|
|
2879
3564
|
|
|
2880
3565
|
// src/resources/product-search/product-search.schema.ts
|
|
2881
|
-
import { z as
|
|
2882
|
-
var readProductSearchParameters =
|
|
2883
|
-
query:
|
|
2884
|
-
filter:
|
|
2885
|
-
facet:
|
|
2886
|
-
sort:
|
|
2887
|
-
limit:
|
|
3566
|
+
import { z as z16 } from "zod";
|
|
3567
|
+
var readProductSearchParameters = z16.object({
|
|
3568
|
+
query: z16.string().optional().describe("Search query in the search query language"),
|
|
3569
|
+
filter: z16.array(z16.string()).optional().describe("Filter expressions"),
|
|
3570
|
+
facet: z16.array(z16.string()).optional().describe("Facet expressions"),
|
|
3571
|
+
sort: z16.array(z16.string()).optional().describe("Sort criteria for the results"),
|
|
3572
|
+
limit: z16.number().int().min(1).max(500).optional().describe(
|
|
2888
3573
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
2889
3574
|
),
|
|
2890
|
-
offset:
|
|
3575
|
+
offset: z16.number().int().min(0).optional().describe(
|
|
2891
3576
|
"The number of items to skip before starting to collect the result set."
|
|
2892
3577
|
),
|
|
2893
|
-
markMatchingVariants:
|
|
2894
|
-
priceCurrency:
|
|
2895
|
-
priceCountry:
|
|
2896
|
-
priceCustomerGroup:
|
|
2897
|
-
priceChannel:
|
|
2898
|
-
localeProjection:
|
|
2899
|
-
storeProjection:
|
|
2900
|
-
expand:
|
|
3578
|
+
markMatchingVariants: z16.boolean().optional().describe("Whether to mark matching variants"),
|
|
3579
|
+
priceCurrency: z16.string().optional().describe("Currency code for price selection"),
|
|
3580
|
+
priceCountry: z16.string().optional().describe("Country code for price selection"),
|
|
3581
|
+
priceCustomerGroup: z16.string().optional().describe("Customer group ID for price selection"),
|
|
3582
|
+
priceChannel: z16.string().optional().describe("Channel ID for price selection"),
|
|
3583
|
+
localeProjection: z16.string().optional().describe("Locale for projection"),
|
|
3584
|
+
storeProjection: z16.string().optional().describe("Store key for projection"),
|
|
3585
|
+
expand: z16.array(z16.string()).optional().describe("Fields to expand")
|
|
2901
3586
|
});
|
|
2902
|
-
var createProductSearchParameters =
|
|
2903
|
-
var updateProductSearchParameters =
|
|
2904
|
-
var deleteProductSearchParameters =
|
|
3587
|
+
var createProductSearchParameters = z16.object({}).describe("Product Search does not support create operations");
|
|
3588
|
+
var updateProductSearchParameters = z16.object({}).describe("Product Search does not support update operations");
|
|
3589
|
+
var deleteProductSearchParameters = z16.object({}).describe("Product Search does not support delete operations");
|
|
2905
3590
|
|
|
2906
3591
|
// src/resources/product-search/product-search.prompt.ts
|
|
2907
3592
|
var readProductSearchPrompt = `
|
|
@@ -3020,54 +3705,54 @@ async function deleteProductSearch(context, apiClientFactory) {
|
|
|
3020
3705
|
}
|
|
3021
3706
|
|
|
3022
3707
|
// src/resources/product-selections/product-selections.schema.ts
|
|
3023
|
-
import { z as
|
|
3024
|
-
var readProductSelectionsParameters =
|
|
3025
|
-
id:
|
|
3026
|
-
key:
|
|
3027
|
-
where:
|
|
3708
|
+
import { z as z17 } from "zod";
|
|
3709
|
+
var readProductSelectionsParameters = z17.object({
|
|
3710
|
+
id: z17.string().optional().describe("Product Selection ID"),
|
|
3711
|
+
key: z17.string().optional().describe("Product Selection key"),
|
|
3712
|
+
where: z17.array(z17.string()).optional().describe(
|
|
3028
3713
|
'Query predicates specified as strings. Example: ["key = \\"my-selection\\""]'
|
|
3029
3714
|
),
|
|
3030
|
-
sort:
|
|
3715
|
+
sort: z17.array(z17.string()).optional().describe(
|
|
3031
3716
|
'Sort criteria for the results. Example: ["key asc", "createdAt desc"]'
|
|
3032
3717
|
),
|
|
3033
|
-
limit:
|
|
3718
|
+
limit: z17.number().int().min(1).max(500).optional().describe(
|
|
3034
3719
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
3035
3720
|
),
|
|
3036
|
-
offset:
|
|
3721
|
+
offset: z17.number().int().min(0).optional().describe(
|
|
3037
3722
|
"The number of items to skip before starting to collect the result set."
|
|
3038
3723
|
),
|
|
3039
|
-
expand:
|
|
3724
|
+
expand: z17.array(z17.string()).optional().describe("Fields to expand. Example: []")
|
|
3040
3725
|
});
|
|
3041
|
-
var createProductSelectionsParameters =
|
|
3042
|
-
key:
|
|
3043
|
-
name:
|
|
3044
|
-
mode:
|
|
3726
|
+
var createProductSelectionsParameters = z17.object({
|
|
3727
|
+
key: z17.string().min(2).max(256).optional().describe("User-defined unique identifier for the product selection"),
|
|
3728
|
+
name: z17.record(z17.string()).describe("Product Selection name (localized string)"),
|
|
3729
|
+
mode: z17.enum(["Individual", "IndividualExclusion"]).optional().describe(
|
|
3045
3730
|
"Selection mode: Individual (explicitly includes) or IndividualExclusion (explicitly excludes)"
|
|
3046
3731
|
),
|
|
3047
|
-
custom:
|
|
3048
|
-
type:
|
|
3049
|
-
id:
|
|
3050
|
-
typeId:
|
|
3732
|
+
custom: z17.object({
|
|
3733
|
+
type: z17.object({
|
|
3734
|
+
id: z17.string(),
|
|
3735
|
+
typeId: z17.literal("type")
|
|
3051
3736
|
}).optional(),
|
|
3052
|
-
fields:
|
|
3737
|
+
fields: z17.record(z17.string(), z17.any()).optional()
|
|
3053
3738
|
}).optional().describe("Custom fields for the product selection")
|
|
3054
3739
|
});
|
|
3055
|
-
var updateProductSelectionsParameters =
|
|
3056
|
-
id:
|
|
3057
|
-
key:
|
|
3058
|
-
version:
|
|
3059
|
-
actions:
|
|
3060
|
-
|
|
3061
|
-
action:
|
|
3062
|
-
}).and(
|
|
3740
|
+
var updateProductSelectionsParameters = z17.object({
|
|
3741
|
+
id: z17.string().optional().describe("The ID of the product selection to update"),
|
|
3742
|
+
key: z17.string().optional().describe("The key of the product selection to update"),
|
|
3743
|
+
version: z17.number().int().describe("The current version of the product selection"),
|
|
3744
|
+
actions: z17.array(
|
|
3745
|
+
z17.object({
|
|
3746
|
+
action: z17.string().describe("The name of the update action to perform")
|
|
3747
|
+
}).and(z17.record(z17.string(), z17.any()).optional()).describe(
|
|
3063
3748
|
'Array of update actions to perform on the product selection. Each action should have an "action" field and other fields specific to that action type.'
|
|
3064
3749
|
)
|
|
3065
3750
|
).describe("Update actions")
|
|
3066
3751
|
});
|
|
3067
|
-
var deleteProductSelectionsParameters =
|
|
3068
|
-
id:
|
|
3069
|
-
key:
|
|
3070
|
-
version:
|
|
3752
|
+
var deleteProductSelectionsParameters = z17.object({
|
|
3753
|
+
id: z17.string().optional().describe("Product Selection ID"),
|
|
3754
|
+
key: z17.string().optional().describe("Product Selection key"),
|
|
3755
|
+
version: z17.number().int().describe("Current version (for optimistic locking)")
|
|
3071
3756
|
});
|
|
3072
3757
|
|
|
3073
3758
|
// src/resources/product-selections/product-selections.prompt.ts
|
|
@@ -3275,67 +3960,67 @@ async function deleteProductSelections(context, apiClientFactory) {
|
|
|
3275
3960
|
}
|
|
3276
3961
|
|
|
3277
3962
|
// src/resources/product-tailoring/product-tailoring.schema.ts
|
|
3278
|
-
import { z as
|
|
3279
|
-
var readProductTailoringParameters =
|
|
3280
|
-
id:
|
|
3281
|
-
key:
|
|
3282
|
-
productId:
|
|
3283
|
-
productKey:
|
|
3284
|
-
storeKey:
|
|
3285
|
-
where:
|
|
3963
|
+
import { z as z18 } from "zod";
|
|
3964
|
+
var readProductTailoringParameters = z18.object({
|
|
3965
|
+
id: z18.string().optional().describe("Product Tailoring ID"),
|
|
3966
|
+
key: z18.string().optional().describe("Product Tailoring key"),
|
|
3967
|
+
productId: z18.string().optional().describe("Product ID"),
|
|
3968
|
+
productKey: z18.string().optional().describe("Product key"),
|
|
3969
|
+
storeKey: z18.string().optional().describe("Store key"),
|
|
3970
|
+
where: z18.array(z18.string()).optional().describe(
|
|
3286
3971
|
'Query predicates specified as strings. Example: ["productKey = \\"product-123\\""]'
|
|
3287
3972
|
),
|
|
3288
|
-
sort:
|
|
3973
|
+
sort: z18.array(z18.string()).optional().describe(
|
|
3289
3974
|
'Sort criteria for the results. Example: ["productKey asc", "createdAt desc"]'
|
|
3290
3975
|
),
|
|
3291
|
-
limit:
|
|
3976
|
+
limit: z18.number().int().min(1).max(500).optional().describe(
|
|
3292
3977
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
3293
3978
|
),
|
|
3294
|
-
offset:
|
|
3979
|
+
offset: z18.number().int().min(0).optional().describe(
|
|
3295
3980
|
"The number of items to skip before starting to collect the result set."
|
|
3296
3981
|
),
|
|
3297
|
-
expand:
|
|
3982
|
+
expand: z18.array(z18.string()).optional().describe("Fields to expand. Example: []")
|
|
3298
3983
|
});
|
|
3299
|
-
var createProductTailoringParameters =
|
|
3300
|
-
productKey:
|
|
3301
|
-
storeKey:
|
|
3302
|
-
name:
|
|
3303
|
-
description:
|
|
3304
|
-
slug:
|
|
3305
|
-
metaTitle:
|
|
3306
|
-
metaDescription:
|
|
3307
|
-
metaKeywords:
|
|
3308
|
-
variantTailoring:
|
|
3309
|
-
|
|
3310
|
-
id:
|
|
3311
|
-
images:
|
|
3312
|
-
assets:
|
|
3313
|
-
attributes:
|
|
3984
|
+
var createProductTailoringParameters = z18.object({
|
|
3985
|
+
productKey: z18.string().describe("Product key"),
|
|
3986
|
+
storeKey: z18.string().describe("Store key"),
|
|
3987
|
+
name: z18.record(z18.string()).optional().describe("Tailored product name (localized string)"),
|
|
3988
|
+
description: z18.record(z18.string()).optional().describe("Tailored product description (localized string)"),
|
|
3989
|
+
slug: z18.record(z18.string()).optional().describe("Tailored product slug (localized string)"),
|
|
3990
|
+
metaTitle: z18.record(z18.string()).optional().describe("Tailored meta title (localized string)"),
|
|
3991
|
+
metaDescription: z18.record(z18.string()).optional().describe("Tailored meta description (localized string)"),
|
|
3992
|
+
metaKeywords: z18.record(z18.string()).optional().describe("Tailored meta keywords (localized string)"),
|
|
3993
|
+
variantTailoring: z18.array(
|
|
3994
|
+
z18.object({
|
|
3995
|
+
id: z18.number().int().describe("Variant ID"),
|
|
3996
|
+
images: z18.array(z18.any()).optional().describe("Tailored images for the variant"),
|
|
3997
|
+
assets: z18.array(z18.any()).optional().describe("Tailored assets for the variant"),
|
|
3998
|
+
attributes: z18.record(z18.any()).optional().describe("Tailored attributes for the variant")
|
|
3314
3999
|
})
|
|
3315
4000
|
).optional().describe("Variant tailoring data")
|
|
3316
4001
|
});
|
|
3317
|
-
var updateProductTailoringParameters =
|
|
3318
|
-
id:
|
|
3319
|
-
key:
|
|
3320
|
-
productId:
|
|
3321
|
-
productKey:
|
|
3322
|
-
storeKey:
|
|
3323
|
-
version:
|
|
3324
|
-
actions:
|
|
3325
|
-
|
|
3326
|
-
action:
|
|
3327
|
-
}).and(
|
|
4002
|
+
var updateProductTailoringParameters = z18.object({
|
|
4003
|
+
id: z18.string().optional().describe("Product Tailoring ID"),
|
|
4004
|
+
key: z18.string().optional().describe("Product Tailoring key"),
|
|
4005
|
+
productId: z18.string().optional().describe("Product ID"),
|
|
4006
|
+
productKey: z18.string().optional().describe("Product key"),
|
|
4007
|
+
storeKey: z18.string().optional().describe("Store key"),
|
|
4008
|
+
version: z18.number().int().describe("The current version of the product tailoring"),
|
|
4009
|
+
actions: z18.array(
|
|
4010
|
+
z18.object({
|
|
4011
|
+
action: z18.string().describe("The name of the update action to perform")
|
|
4012
|
+
}).and(z18.record(z18.string(), z18.any()).optional()).describe(
|
|
3328
4013
|
'Array of update actions to perform on the product tailoring. Each action should have an "action" field and other fields specific to that action type.'
|
|
3329
4014
|
)
|
|
3330
4015
|
).describe("Update actions")
|
|
3331
4016
|
});
|
|
3332
|
-
var deleteProductTailoringParameters =
|
|
3333
|
-
id:
|
|
3334
|
-
key:
|
|
3335
|
-
productId:
|
|
3336
|
-
productKey:
|
|
3337
|
-
storeKey:
|
|
3338
|
-
version:
|
|
4017
|
+
var deleteProductTailoringParameters = z18.object({
|
|
4018
|
+
id: z18.string().optional().describe("Product Tailoring ID"),
|
|
4019
|
+
key: z18.string().optional().describe("Product Tailoring key"),
|
|
4020
|
+
productId: z18.string().optional().describe("Product ID"),
|
|
4021
|
+
productKey: z18.string().optional().describe("Product key"),
|
|
4022
|
+
storeKey: z18.string().optional().describe("Store key"),
|
|
4023
|
+
version: z18.number().int().describe("Current version (for optimistic locking)")
|
|
3339
4024
|
});
|
|
3340
4025
|
|
|
3341
4026
|
// src/resources/product-tailoring/product-tailoring.prompt.ts
|
|
@@ -3617,57 +4302,57 @@ async function deleteProductTailoring(context, apiClientFactory) {
|
|
|
3617
4302
|
}
|
|
3618
4303
|
|
|
3619
4304
|
// src/resources/product-types/product-types.schema.ts
|
|
3620
|
-
import { z as
|
|
3621
|
-
var readProductTypesParameters =
|
|
3622
|
-
id:
|
|
3623
|
-
key:
|
|
3624
|
-
where:
|
|
4305
|
+
import { z as z19 } from "zod";
|
|
4306
|
+
var readProductTypesParameters = z19.object({
|
|
4307
|
+
id: z19.string().optional().describe("Product Type ID"),
|
|
4308
|
+
key: z19.string().optional().describe("Product Type key"),
|
|
4309
|
+
where: z19.array(z19.string()).optional().describe(
|
|
3625
4310
|
'Query predicates specified as strings. Example: ["key = \\"my-product-type\\""]'
|
|
3626
4311
|
),
|
|
3627
|
-
sort:
|
|
4312
|
+
sort: z19.array(z19.string()).optional().describe(
|
|
3628
4313
|
'Sort criteria for the results. Example: ["key asc", "createdAt desc"]'
|
|
3629
4314
|
),
|
|
3630
|
-
limit:
|
|
4315
|
+
limit: z19.number().int().min(1).max(500).optional().describe(
|
|
3631
4316
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
3632
4317
|
),
|
|
3633
|
-
offset:
|
|
4318
|
+
offset: z19.number().int().min(0).optional().describe(
|
|
3634
4319
|
"The number of items to skip before starting to collect the result set."
|
|
3635
4320
|
),
|
|
3636
|
-
expand:
|
|
4321
|
+
expand: z19.array(z19.string()).optional().describe("Fields to expand. Example: []")
|
|
3637
4322
|
});
|
|
3638
|
-
var createProductTypesParameters =
|
|
3639
|
-
key:
|
|
3640
|
-
name:
|
|
3641
|
-
description:
|
|
3642
|
-
attributes:
|
|
3643
|
-
|
|
3644
|
-
name:
|
|
3645
|
-
label:
|
|
3646
|
-
isRequired:
|
|
3647
|
-
isSearchable:
|
|
3648
|
-
type:
|
|
3649
|
-
attributeConstraint:
|
|
3650
|
-
inputHint:
|
|
3651
|
-
inputTip:
|
|
4323
|
+
var createProductTypesParameters = z19.object({
|
|
4324
|
+
key: z19.string().min(2).max(256).describe("User-defined unique identifier for the product type"),
|
|
4325
|
+
name: z19.string().describe("Product Type name"),
|
|
4326
|
+
description: z19.string().optional().describe("Product Type description"),
|
|
4327
|
+
attributes: z19.array(
|
|
4328
|
+
z19.object({
|
|
4329
|
+
name: z19.string().describe("Attribute name"),
|
|
4330
|
+
label: z19.record(z19.string()).optional().describe("Localized label for the attribute"),
|
|
4331
|
+
isRequired: z19.boolean().optional().describe("Whether the attribute is required"),
|
|
4332
|
+
isSearchable: z19.boolean().optional().describe("Whether the attribute is searchable"),
|
|
4333
|
+
type: z19.any().describe("Attribute type definition"),
|
|
4334
|
+
attributeConstraint: z19.enum(["None", "Unique", "CombinationUnique", "SameForAll"]).optional().describe("Attribute constraint"),
|
|
4335
|
+
inputHint: z19.enum(["SingleLine", "MultiLine"]).optional().describe("Input hint for String attributes"),
|
|
4336
|
+
inputTip: z19.record(z19.string()).optional().describe("Input tip for the attribute (localized)")
|
|
3652
4337
|
})
|
|
3653
4338
|
).optional().describe("Array of attribute definitions")
|
|
3654
4339
|
});
|
|
3655
|
-
var updateProductTypesParameters =
|
|
3656
|
-
id:
|
|
3657
|
-
key:
|
|
3658
|
-
version:
|
|
3659
|
-
actions:
|
|
3660
|
-
|
|
3661
|
-
action:
|
|
3662
|
-
}).and(
|
|
4340
|
+
var updateProductTypesParameters = z19.object({
|
|
4341
|
+
id: z19.string().optional().describe("The ID of the product type to update"),
|
|
4342
|
+
key: z19.string().optional().describe("The key of the product type to update"),
|
|
4343
|
+
version: z19.number().int().describe("The current version of the product type"),
|
|
4344
|
+
actions: z19.array(
|
|
4345
|
+
z19.object({
|
|
4346
|
+
action: z19.string().describe("The name of the update action to perform")
|
|
4347
|
+
}).and(z19.record(z19.string(), z19.any()).optional()).describe(
|
|
3663
4348
|
'Array of update actions to perform on the product type. Each action should have an "action" field and other fields specific to that action type.'
|
|
3664
4349
|
)
|
|
3665
4350
|
).describe("Update actions")
|
|
3666
4351
|
});
|
|
3667
|
-
var deleteProductTypesParameters =
|
|
3668
|
-
id:
|
|
3669
|
-
key:
|
|
3670
|
-
version:
|
|
4352
|
+
var deleteProductTypesParameters = z19.object({
|
|
4353
|
+
id: z19.string().optional().describe("Product Type ID"),
|
|
4354
|
+
key: z19.string().optional().describe("Product Type key"),
|
|
4355
|
+
version: z19.number().int().describe("Current version (for optimistic locking)")
|
|
3671
4356
|
});
|
|
3672
4357
|
|
|
3673
4358
|
// src/resources/product-types/product-types.prompt.ts
|
|
@@ -3887,84 +4572,84 @@ async function deleteProductTypes(context, apiClientFactory) {
|
|
|
3887
4572
|
}
|
|
3888
4573
|
|
|
3889
4574
|
// src/resources/products/products.schema.ts
|
|
3890
|
-
import { z as
|
|
3891
|
-
var readProductsParameters =
|
|
3892
|
-
id:
|
|
3893
|
-
key:
|
|
3894
|
-
where:
|
|
4575
|
+
import { z as z20 } from "zod";
|
|
4576
|
+
var readProductsParameters = z20.object({
|
|
4577
|
+
id: z20.string().optional().describe("Product ID"),
|
|
4578
|
+
key: z20.string().optional().describe("Product key"),
|
|
4579
|
+
where: z20.array(z20.string()).optional().describe(
|
|
3895
4580
|
'Query predicates specified as strings. Example: ["key = \\"product-key\\""]'
|
|
3896
4581
|
),
|
|
3897
|
-
sort:
|
|
4582
|
+
sort: z20.array(z20.string()).optional().describe(
|
|
3898
4583
|
'Sort criteria for the results. Example: ["name asc", "createdAt desc"]'
|
|
3899
4584
|
),
|
|
3900
|
-
limit:
|
|
4585
|
+
limit: z20.number().int().min(1).max(500).optional().describe(
|
|
3901
4586
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
3902
4587
|
),
|
|
3903
|
-
offset:
|
|
4588
|
+
offset: z20.number().int().min(0).optional().describe(
|
|
3904
4589
|
"The number of items to skip before starting to collect the result set."
|
|
3905
4590
|
),
|
|
3906
|
-
expand:
|
|
3907
|
-
priceCurrency:
|
|
3908
|
-
priceCountry:
|
|
3909
|
-
priceCustomerGroup:
|
|
3910
|
-
priceChannel:
|
|
3911
|
-
localeProjection:
|
|
3912
|
-
storeProjection:
|
|
4591
|
+
expand: z20.array(z20.string()).optional().describe('Fields to expand. Example: ["productType", "categories[*]"]'),
|
|
4592
|
+
priceCurrency: z20.string().optional().describe("Currency code for price selection"),
|
|
4593
|
+
priceCountry: z20.string().optional().describe("Country code for price selection"),
|
|
4594
|
+
priceCustomerGroup: z20.string().optional().describe("Customer group ID for price selection"),
|
|
4595
|
+
priceChannel: z20.string().optional().describe("Channel ID for price selection"),
|
|
4596
|
+
localeProjection: z20.string().optional().describe("Locale for projection"),
|
|
4597
|
+
storeProjection: z20.string().optional().describe("Store key for projection")
|
|
3913
4598
|
});
|
|
3914
|
-
var createProductsParameters =
|
|
3915
|
-
key:
|
|
3916
|
-
productType:
|
|
3917
|
-
id:
|
|
3918
|
-
key:
|
|
3919
|
-
typeId:
|
|
4599
|
+
var createProductsParameters = z20.object({
|
|
4600
|
+
key: z20.string().min(2).max(256).optional().describe("User-defined unique identifier for the product"),
|
|
4601
|
+
productType: z20.object({
|
|
4602
|
+
id: z20.string().optional(),
|
|
4603
|
+
key: z20.string().optional(),
|
|
4604
|
+
typeId: z20.literal("product-type")
|
|
3920
4605
|
}).describe("Product Type reference"),
|
|
3921
|
-
name:
|
|
3922
|
-
description:
|
|
3923
|
-
slug:
|
|
3924
|
-
categories:
|
|
3925
|
-
|
|
3926
|
-
id:
|
|
3927
|
-
key:
|
|
3928
|
-
typeId:
|
|
4606
|
+
name: z20.record(z20.string()).describe("Product name (localized string)"),
|
|
4607
|
+
description: z20.record(z20.string()).optional().describe("Product description (localized string)"),
|
|
4608
|
+
slug: z20.record(z20.string()).describe("Product slug (localized string)"),
|
|
4609
|
+
categories: z20.array(
|
|
4610
|
+
z20.object({
|
|
4611
|
+
id: z20.string().optional(),
|
|
4612
|
+
key: z20.string().optional(),
|
|
4613
|
+
typeId: z20.literal("category")
|
|
3929
4614
|
})
|
|
3930
4615
|
).optional().describe("Array of category references"),
|
|
3931
|
-
categoryOrderHints:
|
|
3932
|
-
metaTitle:
|
|
3933
|
-
metaDescription:
|
|
3934
|
-
metaKeywords:
|
|
3935
|
-
masterVariant:
|
|
3936
|
-
variants:
|
|
3937
|
-
taxCategory:
|
|
3938
|
-
id:
|
|
3939
|
-
key:
|
|
3940
|
-
typeId:
|
|
4616
|
+
categoryOrderHints: z20.record(z20.string()).optional().describe("Category order hints"),
|
|
4617
|
+
metaTitle: z20.record(z20.string()).optional().describe("Meta title (localized string)"),
|
|
4618
|
+
metaDescription: z20.record(z20.string()).optional().describe("Meta description (localized string)"),
|
|
4619
|
+
metaKeywords: z20.record(z20.string()).optional().describe("Meta keywords (localized string)"),
|
|
4620
|
+
masterVariant: z20.any().optional().describe("Master variant"),
|
|
4621
|
+
variants: z20.array(z20.any()).optional().describe("Product variants"),
|
|
4622
|
+
taxCategory: z20.object({
|
|
4623
|
+
id: z20.string().optional(),
|
|
4624
|
+
key: z20.string().optional(),
|
|
4625
|
+
typeId: z20.literal("tax-category")
|
|
3941
4626
|
}).optional().describe("Tax category reference"),
|
|
3942
|
-
state:
|
|
3943
|
-
id:
|
|
3944
|
-
key:
|
|
3945
|
-
typeId:
|
|
4627
|
+
state: z20.object({
|
|
4628
|
+
id: z20.string().optional(),
|
|
4629
|
+
key: z20.string().optional(),
|
|
4630
|
+
typeId: z20.literal("state")
|
|
3946
4631
|
}).optional().describe("State reference"),
|
|
3947
|
-
reviewRatingStatistics:
|
|
3948
|
-
publish:
|
|
3949
|
-
priceMode:
|
|
4632
|
+
reviewRatingStatistics: z20.any().optional().describe("Review rating statistics"),
|
|
4633
|
+
publish: z20.boolean().optional().describe("Whether to publish the product"),
|
|
4634
|
+
priceMode: z20.enum(["Embedded", "Standalone"]).optional().describe("Price mode")
|
|
3950
4635
|
});
|
|
3951
|
-
var updateProductsParameters =
|
|
3952
|
-
id:
|
|
3953
|
-
key:
|
|
3954
|
-
version:
|
|
3955
|
-
actions:
|
|
3956
|
-
|
|
3957
|
-
action:
|
|
3958
|
-
}).and(
|
|
4636
|
+
var updateProductsParameters = z20.object({
|
|
4637
|
+
id: z20.string().optional().describe("The ID of the product to update"),
|
|
4638
|
+
key: z20.string().optional().describe("The key of the product to update"),
|
|
4639
|
+
version: z20.number().int().describe("The current version of the product"),
|
|
4640
|
+
actions: z20.array(
|
|
4641
|
+
z20.object({
|
|
4642
|
+
action: z20.string().describe("The name of the update action to perform")
|
|
4643
|
+
}).and(z20.record(z20.string(), z20.any()).optional()).describe(
|
|
3959
4644
|
'Array of update actions to perform on the product. Each action should have an "action" field and other fields specific to that action type.'
|
|
3960
4645
|
)
|
|
3961
4646
|
).describe("Update actions")
|
|
3962
4647
|
});
|
|
3963
|
-
var deleteProductsParameters =
|
|
3964
|
-
id:
|
|
3965
|
-
key:
|
|
3966
|
-
version:
|
|
3967
|
-
priceMode:
|
|
4648
|
+
var deleteProductsParameters = z20.object({
|
|
4649
|
+
id: z20.string().optional().describe("Product ID"),
|
|
4650
|
+
key: z20.string().optional().describe("Product key"),
|
|
4651
|
+
version: z20.number().int().describe("Current version (for optimistic locking)"),
|
|
4652
|
+
priceMode: z20.enum(["Embedded", "Standalone"]).optional().describe("Price mode")
|
|
3968
4653
|
});
|
|
3969
4654
|
|
|
3970
4655
|
// src/resources/products/products.prompt.ts
|
|
@@ -4265,158 +4950,158 @@ async function deleteProducts(context, apiClientFactory) {
|
|
|
4265
4950
|
}
|
|
4266
4951
|
|
|
4267
4952
|
// src/resources/project/project.handler.ts
|
|
4268
|
-
import { z as
|
|
4953
|
+
import { z as z22 } from "zod";
|
|
4269
4954
|
|
|
4270
4955
|
// src/resources/project/project.schema.ts
|
|
4271
|
-
import { z as
|
|
4272
|
-
var readProjectParameters =
|
|
4273
|
-
projectKey:
|
|
4956
|
+
import { z as z21 } from "zod";
|
|
4957
|
+
var readProjectParameters = z21.object({
|
|
4958
|
+
projectKey: z21.string().optional().describe(
|
|
4274
4959
|
"The key of the project to read. If not provided, the current project will be used."
|
|
4275
4960
|
)
|
|
4276
4961
|
});
|
|
4277
|
-
var messagesConfigurationDraftSchema =
|
|
4278
|
-
enabled:
|
|
4279
|
-
deleteDaysAfterCreation:
|
|
4962
|
+
var messagesConfigurationDraftSchema = z21.object({
|
|
4963
|
+
enabled: z21.boolean().describe("When true, the Messages Query feature is active."),
|
|
4964
|
+
deleteDaysAfterCreation: z21.number().min(1).max(90).optional().describe(
|
|
4280
4965
|
"Specifies the number of days each Message should be available via the Messages Query API."
|
|
4281
4966
|
)
|
|
4282
4967
|
});
|
|
4283
|
-
var cartsConfigurationSchema =
|
|
4284
|
-
deleteDaysAfterLastModification:
|
|
4968
|
+
var cartsConfigurationSchema = z21.object({
|
|
4969
|
+
deleteDaysAfterLastModification: z21.number().min(1).optional().describe(
|
|
4285
4970
|
"Default value for the deleteDaysAfterLastModification parameter of CartDraft and MyCartDraft."
|
|
4286
4971
|
),
|
|
4287
|
-
countryTaxRateFallbackEnabled:
|
|
4972
|
+
countryTaxRateFallbackEnabled: z21.boolean().optional().describe(
|
|
4288
4973
|
"Indicates if country - no state Tax Rate fallback should be used."
|
|
4289
4974
|
)
|
|
4290
4975
|
});
|
|
4291
|
-
var shoppingListsConfigurationSchema =
|
|
4292
|
-
deleteDaysAfterLastModification:
|
|
4976
|
+
var shoppingListsConfigurationSchema = z21.object({
|
|
4977
|
+
deleteDaysAfterLastModification: z21.number().min(1).optional().describe(
|
|
4293
4978
|
"Default value for the deleteDaysAfterLastModification parameter of ShoppingListDraft."
|
|
4294
4979
|
)
|
|
4295
4980
|
});
|
|
4296
|
-
var customFieldLocalizedEnumValueSchema =
|
|
4297
|
-
key:
|
|
4298
|
-
label:
|
|
4981
|
+
var customFieldLocalizedEnumValueSchema = z21.object({
|
|
4982
|
+
key: z21.string().describe("The key of the enum value."),
|
|
4983
|
+
label: z21.record(z21.string(), z21.string()).describe("The localized labels for the enum value.")
|
|
4299
4984
|
});
|
|
4300
|
-
var shippingRateInputTypeSchema =
|
|
4301
|
-
|
|
4302
|
-
type:
|
|
4985
|
+
var shippingRateInputTypeSchema = z21.discriminatedUnion("type", [
|
|
4986
|
+
z21.object({
|
|
4987
|
+
type: z21.literal("CartValue")
|
|
4303
4988
|
}),
|
|
4304
|
-
|
|
4305
|
-
type:
|
|
4306
|
-
values:
|
|
4989
|
+
z21.object({
|
|
4990
|
+
type: z21.literal("CartClassification"),
|
|
4991
|
+
values: z21.array(customFieldLocalizedEnumValueSchema).describe("The classification items for ShippingRatePriceTier.")
|
|
4307
4992
|
}),
|
|
4308
|
-
|
|
4309
|
-
type:
|
|
4310
|
-
score:
|
|
4993
|
+
z21.object({
|
|
4994
|
+
type: z21.literal("CartScore"),
|
|
4995
|
+
score: z21.number().describe("The score mapping for available shipping rate tiers.")
|
|
4311
4996
|
})
|
|
4312
4997
|
]);
|
|
4313
|
-
var externalOAuthSchema =
|
|
4314
|
-
url:
|
|
4315
|
-
authorizationHeader:
|
|
4998
|
+
var externalOAuthSchema = z21.object({
|
|
4999
|
+
url: z21.string().url().describe("The URL of the token introspection endpoint."),
|
|
5000
|
+
authorizationHeader: z21.string().describe(
|
|
4316
5001
|
"The authorization header to authenticate against the introspection endpoint."
|
|
4317
5002
|
)
|
|
4318
5003
|
});
|
|
4319
|
-
var customerSearchStatusSchema =
|
|
4320
|
-
var businessUnitSearchStatusSchema =
|
|
4321
|
-
var orderSearchStatusSchema =
|
|
4322
|
-
var productSearchIndexingModeSchema =
|
|
5004
|
+
var customerSearchStatusSchema = z21.enum(["Activated", "Deactivated"]);
|
|
5005
|
+
var businessUnitSearchStatusSchema = z21.enum(["Activated", "Deactivated"]);
|
|
5006
|
+
var orderSearchStatusSchema = z21.enum(["Activated", "Deactivated"]);
|
|
5007
|
+
var productSearchIndexingModeSchema = z21.enum([
|
|
4323
5008
|
"ProductProjectionsSearch",
|
|
4324
5009
|
"ProductsSearch"
|
|
4325
5010
|
]);
|
|
4326
|
-
var businessUnitConfigurationStatusSchema =
|
|
5011
|
+
var businessUnitConfigurationStatusSchema = z21.enum([
|
|
4327
5012
|
"Active",
|
|
4328
5013
|
"Inactive",
|
|
4329
5014
|
"Verification"
|
|
4330
5015
|
]);
|
|
4331
|
-
var associateRoleResourceIdentifierSchema =
|
|
4332
|
-
typeId:
|
|
4333
|
-
id:
|
|
4334
|
-
key:
|
|
5016
|
+
var associateRoleResourceIdentifierSchema = z21.object({
|
|
5017
|
+
typeId: z21.literal("associate-role"),
|
|
5018
|
+
id: z21.string().optional().describe("The ID of the associate role."),
|
|
5019
|
+
key: z21.string().optional().describe("The key of the associate role.")
|
|
4335
5020
|
});
|
|
4336
|
-
var changeNameSchema =
|
|
4337
|
-
action:
|
|
4338
|
-
name:
|
|
5021
|
+
var changeNameSchema = z21.object({
|
|
5022
|
+
action: z21.literal("changeName"),
|
|
5023
|
+
name: z21.string().describe("New value to set.")
|
|
4339
5024
|
});
|
|
4340
|
-
var changeCountriesSchema =
|
|
4341
|
-
action:
|
|
4342
|
-
countries:
|
|
5025
|
+
var changeCountriesSchema = z21.object({
|
|
5026
|
+
action: z21.literal("changeCountries"),
|
|
5027
|
+
countries: z21.array(z21.string()).describe("New value to set. Must not be empty.")
|
|
4343
5028
|
});
|
|
4344
|
-
var changeCurrenciesSchema =
|
|
4345
|
-
action:
|
|
4346
|
-
currencies:
|
|
5029
|
+
var changeCurrenciesSchema = z21.object({
|
|
5030
|
+
action: z21.literal("changeCurrencies"),
|
|
5031
|
+
currencies: z21.array(z21.string()).describe("New value to set. Must not be empty.")
|
|
4347
5032
|
});
|
|
4348
|
-
var changeLanguagesSchema =
|
|
4349
|
-
action:
|
|
4350
|
-
languages:
|
|
5033
|
+
var changeLanguagesSchema = z21.object({
|
|
5034
|
+
action: z21.literal("changeLanguages"),
|
|
5035
|
+
languages: z21.array(z21.string()).describe("New value to set. Must not be empty.")
|
|
4351
5036
|
});
|
|
4352
|
-
var changeMessagesConfigurationSchema =
|
|
4353
|
-
action:
|
|
5037
|
+
var changeMessagesConfigurationSchema = z21.object({
|
|
5038
|
+
action: z21.literal("changeMessagesConfiguration"),
|
|
4354
5039
|
messagesConfiguration: messagesConfigurationDraftSchema.describe(
|
|
4355
5040
|
"Configuration for the Messages Query feature."
|
|
4356
5041
|
)
|
|
4357
5042
|
});
|
|
4358
|
-
var changeCartsConfigurationSchema =
|
|
4359
|
-
action:
|
|
5043
|
+
var changeCartsConfigurationSchema = z21.object({
|
|
5044
|
+
action: z21.literal("changeCartsConfiguration"),
|
|
4360
5045
|
cartsConfiguration: cartsConfigurationSchema.describe(
|
|
4361
5046
|
"Configuration for the Carts feature."
|
|
4362
5047
|
)
|
|
4363
5048
|
});
|
|
4364
|
-
var changeCountryTaxRateFallbackEnabledSchema =
|
|
4365
|
-
action:
|
|
4366
|
-
countryTaxRateFallbackEnabled:
|
|
5049
|
+
var changeCountryTaxRateFallbackEnabledSchema = z21.object({
|
|
5050
|
+
action: z21.literal("changeCountryTaxRateFallbackEnabled"),
|
|
5051
|
+
countryTaxRateFallbackEnabled: z21.boolean().describe("When true, country - no state Tax Rate is used as fallback.")
|
|
4367
5052
|
});
|
|
4368
|
-
var changeShoppingListsConfigurationSchema =
|
|
4369
|
-
action:
|
|
5053
|
+
var changeShoppingListsConfigurationSchema = z21.object({
|
|
5054
|
+
action: z21.literal("changeShoppingListsConfiguration"),
|
|
4370
5055
|
shoppingListsConfiguration: shoppingListsConfigurationSchema.describe(
|
|
4371
5056
|
"Configuration for the Shopping Lists feature."
|
|
4372
5057
|
)
|
|
4373
5058
|
});
|
|
4374
|
-
var changeMyBusinessUnitStatusOnCreationSchema =
|
|
4375
|
-
action:
|
|
5059
|
+
var changeMyBusinessUnitStatusOnCreationSchema = z21.object({
|
|
5060
|
+
action: z21.literal("changeMyBusinessUnitStatusOnCreation"),
|
|
4376
5061
|
status: businessUnitConfigurationStatusSchema.describe(
|
|
4377
5062
|
"Status for Business Units created using the My Business Unit endpoint."
|
|
4378
5063
|
)
|
|
4379
5064
|
});
|
|
4380
|
-
var setMyBusinessUnitAssociateRoleOnCreationSchema =
|
|
4381
|
-
action:
|
|
5065
|
+
var setMyBusinessUnitAssociateRoleOnCreationSchema = z21.object({
|
|
5066
|
+
action: z21.literal("setMyBusinessUnitAssociateRoleOnCreation"),
|
|
4382
5067
|
associateRole: associateRoleResourceIdentifierSchema.describe(
|
|
4383
5068
|
"Default Associate Role assigned to the Associate creating a Business Unit."
|
|
4384
5069
|
)
|
|
4385
5070
|
});
|
|
4386
|
-
var setShippingRateInputTypeSchema =
|
|
4387
|
-
action:
|
|
5071
|
+
var setShippingRateInputTypeSchema = z21.object({
|
|
5072
|
+
action: z21.literal("setShippingRateInputType"),
|
|
4388
5073
|
shippingRateInputType: shippingRateInputTypeSchema.optional().describe("Value to set. If empty, any existing value will be removed.")
|
|
4389
5074
|
});
|
|
4390
|
-
var setExternalOAuthSchema =
|
|
4391
|
-
action:
|
|
5075
|
+
var setExternalOAuthSchema = z21.object({
|
|
5076
|
+
action: z21.literal("setExternalOAuth"),
|
|
4392
5077
|
externalOAuth: externalOAuthSchema.optional().describe("Value to set. If empty, any existing value will be removed.")
|
|
4393
5078
|
});
|
|
4394
|
-
var changeProductSearchIndexingEnabledSchema =
|
|
4395
|
-
action:
|
|
4396
|
-
enabled:
|
|
5079
|
+
var changeProductSearchIndexingEnabledSchema = z21.object({
|
|
5080
|
+
action: z21.literal("changeProductSearchIndexingEnabled"),
|
|
5081
|
+
enabled: z21.boolean().describe("If false, the indexing of Product information will stop."),
|
|
4397
5082
|
mode: productSearchIndexingModeSchema.optional().describe(
|
|
4398
5083
|
"Controls whether the action should apply to Product Projection Search or to Product Search."
|
|
4399
5084
|
)
|
|
4400
5085
|
});
|
|
4401
|
-
var changeOrderSearchStatusSchema =
|
|
4402
|
-
action:
|
|
5086
|
+
var changeOrderSearchStatusSchema = z21.object({
|
|
5087
|
+
action: z21.literal("changeOrderSearchStatus"),
|
|
4403
5088
|
status: orderSearchStatusSchema.describe(
|
|
4404
5089
|
"Activates or deactivates the Order Search feature."
|
|
4405
5090
|
)
|
|
4406
5091
|
});
|
|
4407
|
-
var changeCustomerSearchStatusSchema =
|
|
4408
|
-
action:
|
|
5092
|
+
var changeCustomerSearchStatusSchema = z21.object({
|
|
5093
|
+
action: z21.literal("changeCustomerSearchStatus"),
|
|
4409
5094
|
status: customerSearchStatusSchema.describe(
|
|
4410
5095
|
"Activates or deactivates the Customer Search feature."
|
|
4411
5096
|
)
|
|
4412
5097
|
});
|
|
4413
|
-
var changeBusinessUnitSearchStatusSchema =
|
|
4414
|
-
action:
|
|
5098
|
+
var changeBusinessUnitSearchStatusSchema = z21.object({
|
|
5099
|
+
action: z21.literal("changeBusinessUnitSearchStatus"),
|
|
4415
5100
|
status: businessUnitSearchStatusSchema.describe(
|
|
4416
5101
|
"Activates or deactivates the Search Business Units feature."
|
|
4417
5102
|
)
|
|
4418
5103
|
});
|
|
4419
|
-
var updateActionSchema =
|
|
5104
|
+
var updateActionSchema = z21.discriminatedUnion("action", [
|
|
4420
5105
|
changeNameSchema,
|
|
4421
5106
|
changeCountriesSchema,
|
|
4422
5107
|
changeCurrenciesSchema,
|
|
@@ -4434,12 +5119,12 @@ var updateActionSchema = z18.discriminatedUnion("action", [
|
|
|
4434
5119
|
changeCustomerSearchStatusSchema,
|
|
4435
5120
|
changeBusinessUnitSearchStatusSchema
|
|
4436
5121
|
]);
|
|
4437
|
-
var updateProjectParameters =
|
|
4438
|
-
version:
|
|
5122
|
+
var updateProjectParameters = z21.object({
|
|
5123
|
+
version: z21.number().describe(
|
|
4439
5124
|
"The current version of the project. If not provided, the current version will be fetched automatically."
|
|
4440
5125
|
),
|
|
4441
|
-
actions:
|
|
4442
|
-
projectKey:
|
|
5126
|
+
actions: z21.array(updateActionSchema).describe("The list of update actions to apply to the project."),
|
|
5127
|
+
projectKey: z21.string().optional().describe(
|
|
4443
5128
|
"The key of the project to update. If not provided, the current project will be used."
|
|
4444
5129
|
)
|
|
4445
5130
|
});
|
|
@@ -4490,9 +5175,9 @@ var ProjectHandler = class extends CommercetoolsResourceHandler {
|
|
|
4490
5175
|
schemas: {
|
|
4491
5176
|
read: readProjectParameters,
|
|
4492
5177
|
update: updateProjectParameters,
|
|
4493
|
-
create:
|
|
5178
|
+
create: z22.object({}),
|
|
4494
5179
|
// Empty schema for unsupported operation
|
|
4495
|
-
delete:
|
|
5180
|
+
delete: z22.object({})
|
|
4496
5181
|
// Empty schema for unsupported operation
|
|
4497
5182
|
}
|
|
4498
5183
|
};
|
|
@@ -4555,72 +5240,72 @@ async function updateProject(context, apiClientFactory) {
|
|
|
4555
5240
|
}
|
|
4556
5241
|
|
|
4557
5242
|
// src/resources/reviews/reviews.schema.ts
|
|
4558
|
-
import { z as
|
|
4559
|
-
var readReviewsParameters =
|
|
4560
|
-
id:
|
|
4561
|
-
key:
|
|
4562
|
-
where:
|
|
5243
|
+
import { z as z23 } from "zod";
|
|
5244
|
+
var readReviewsParameters = z23.object({
|
|
5245
|
+
id: z23.string().optional().describe("Review ID"),
|
|
5246
|
+
key: z23.string().optional().describe("Review key"),
|
|
5247
|
+
where: z23.array(z23.string()).optional().describe(
|
|
4563
5248
|
'Query predicates specified as strings. Example: ["rating > 50"]'
|
|
4564
5249
|
),
|
|
4565
|
-
sort:
|
|
5250
|
+
sort: z23.array(z23.string()).optional().describe(
|
|
4566
5251
|
'Sort criteria for the results. Example: ["rating desc", "createdAt asc"]'
|
|
4567
5252
|
),
|
|
4568
|
-
limit:
|
|
5253
|
+
limit: z23.number().int().min(1).max(500).optional().describe(
|
|
4569
5254
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
4570
5255
|
),
|
|
4571
|
-
offset:
|
|
5256
|
+
offset: z23.number().int().min(0).optional().describe(
|
|
4572
5257
|
"The number of items to skip before starting to collect the result set."
|
|
4573
5258
|
),
|
|
4574
|
-
expand:
|
|
5259
|
+
expand: z23.array(z23.string()).optional().describe('Fields to expand. Example: ["customer", "target"]')
|
|
4575
5260
|
});
|
|
4576
|
-
var createReviewsParameters =
|
|
4577
|
-
key:
|
|
4578
|
-
uniquenessValue:
|
|
4579
|
-
locale:
|
|
4580
|
-
authorName:
|
|
4581
|
-
title:
|
|
4582
|
-
text:
|
|
4583
|
-
target:
|
|
4584
|
-
id:
|
|
4585
|
-
key:
|
|
4586
|
-
typeId:
|
|
5261
|
+
var createReviewsParameters = z23.object({
|
|
5262
|
+
key: z23.string().min(2).max(256).optional().describe("User-defined unique identifier for the review"),
|
|
5263
|
+
uniquenessValue: z23.string().optional().describe("Must be unique among reviews"),
|
|
5264
|
+
locale: z23.string().optional().describe("Language in which the content is written"),
|
|
5265
|
+
authorName: z23.string().optional().describe("Name of the author"),
|
|
5266
|
+
title: z23.string().optional().describe("Title of the review"),
|
|
5267
|
+
text: z23.string().optional().describe("Text content of the review"),
|
|
5268
|
+
target: z23.object({
|
|
5269
|
+
id: z23.string().optional(),
|
|
5270
|
+
key: z23.string().optional(),
|
|
5271
|
+
typeId: z23.enum(["product", "channel"])
|
|
4587
5272
|
}).optional().describe("Identifies the target of the review (Product or Channel)"),
|
|
4588
|
-
state:
|
|
4589
|
-
id:
|
|
4590
|
-
key:
|
|
4591
|
-
typeId:
|
|
5273
|
+
state: z23.object({
|
|
5274
|
+
id: z23.string().optional(),
|
|
5275
|
+
key: z23.string().optional(),
|
|
5276
|
+
typeId: z23.literal("state")
|
|
4592
5277
|
}).optional().describe("State of the review used for approval processes"),
|
|
4593
|
-
rating:
|
|
4594
|
-
customer:
|
|
4595
|
-
id:
|
|
4596
|
-
key:
|
|
4597
|
-
typeId:
|
|
5278
|
+
rating: z23.number().int().min(-100).max(100).optional().describe("Rating of the Product or Channel, range -100 to 100"),
|
|
5279
|
+
customer: z23.object({
|
|
5280
|
+
id: z23.string().optional(),
|
|
5281
|
+
key: z23.string().optional(),
|
|
5282
|
+
typeId: z23.literal("customer")
|
|
4598
5283
|
}).optional().describe("Customer who created the review"),
|
|
4599
|
-
custom:
|
|
4600
|
-
type:
|
|
4601
|
-
id:
|
|
4602
|
-
typeId:
|
|
5284
|
+
custom: z23.object({
|
|
5285
|
+
type: z23.object({
|
|
5286
|
+
id: z23.string(),
|
|
5287
|
+
typeId: z23.literal("type")
|
|
4603
5288
|
}).optional(),
|
|
4604
|
-
fields:
|
|
5289
|
+
fields: z23.record(z23.string(), z23.any()).optional()
|
|
4605
5290
|
}).optional().describe("Custom fields for the review")
|
|
4606
5291
|
});
|
|
4607
|
-
var updateReviewsParameters =
|
|
4608
|
-
id:
|
|
4609
|
-
key:
|
|
4610
|
-
version:
|
|
4611
|
-
actions:
|
|
4612
|
-
|
|
4613
|
-
action:
|
|
4614
|
-
}).and(
|
|
5292
|
+
var updateReviewsParameters = z23.object({
|
|
5293
|
+
id: z23.string().optional().describe("The ID of the review to update"),
|
|
5294
|
+
key: z23.string().optional().describe("The key of the review to update"),
|
|
5295
|
+
version: z23.number().int().describe("The current version of the review"),
|
|
5296
|
+
actions: z23.array(
|
|
5297
|
+
z23.object({
|
|
5298
|
+
action: z23.string().describe("The name of the update action to perform")
|
|
5299
|
+
}).and(z23.record(z23.string(), z23.any()).optional()).describe(
|
|
4615
5300
|
'Array of update actions to perform on the review. Each action should have an "action" field and other fields specific to that action type.'
|
|
4616
5301
|
)
|
|
4617
5302
|
).describe("Update actions")
|
|
4618
5303
|
});
|
|
4619
|
-
var deleteReviewsParameters =
|
|
4620
|
-
id:
|
|
4621
|
-
key:
|
|
4622
|
-
version:
|
|
4623
|
-
dataErasure:
|
|
5304
|
+
var deleteReviewsParameters = z23.object({
|
|
5305
|
+
id: z23.string().optional().describe("Review ID"),
|
|
5306
|
+
key: z23.string().optional().describe("Review key"),
|
|
5307
|
+
version: z23.number().int().describe("Current version (for optimistic locking)"),
|
|
5308
|
+
dataErasure: z23.boolean().optional().describe("Delete personal data")
|
|
4624
5309
|
});
|
|
4625
5310
|
|
|
4626
5311
|
// src/resources/reviews/reviews.prompt.ts
|
|
@@ -4831,30 +5516,30 @@ async function deleteReviews(context, apiClientFactory) {
|
|
|
4831
5516
|
}
|
|
4832
5517
|
|
|
4833
5518
|
// src/resources/standalone-prices/standalone-prices.schema.ts
|
|
4834
|
-
import { z as
|
|
4835
|
-
var readStandalonePricesParameters =
|
|
4836
|
-
id:
|
|
4837
|
-
key:
|
|
4838
|
-
sku:
|
|
4839
|
-
where:
|
|
4840
|
-
sort:
|
|
4841
|
-
limit:
|
|
4842
|
-
offset:
|
|
4843
|
-
expand:
|
|
5519
|
+
import { z as z24 } from "zod";
|
|
5520
|
+
var readStandalonePricesParameters = z24.object({
|
|
5521
|
+
id: z24.string().optional(),
|
|
5522
|
+
key: z24.string().optional(),
|
|
5523
|
+
sku: z24.string().optional(),
|
|
5524
|
+
where: z24.array(z24.string()).optional(),
|
|
5525
|
+
sort: z24.array(z24.string()).optional(),
|
|
5526
|
+
limit: z24.number().int().min(1).max(500).optional(),
|
|
5527
|
+
offset: z24.number().int().optional(),
|
|
5528
|
+
expand: z24.array(z24.string()).optional()
|
|
4844
5529
|
});
|
|
4845
|
-
var createStandalonePricesParameters =
|
|
4846
|
-
body:
|
|
5530
|
+
var createStandalonePricesParameters = z24.object({
|
|
5531
|
+
body: z24.record(z24.any())
|
|
4847
5532
|
});
|
|
4848
|
-
var updateStandalonePricesParameters =
|
|
4849
|
-
id:
|
|
4850
|
-
key:
|
|
4851
|
-
version:
|
|
4852
|
-
actions:
|
|
5533
|
+
var updateStandalonePricesParameters = z24.object({
|
|
5534
|
+
id: z24.string().optional(),
|
|
5535
|
+
key: z24.string().optional(),
|
|
5536
|
+
version: z24.number().optional(),
|
|
5537
|
+
actions: z24.array(z24.record(z24.any())).optional()
|
|
4853
5538
|
});
|
|
4854
|
-
var deleteStandalonePricesParameters =
|
|
4855
|
-
id:
|
|
4856
|
-
key:
|
|
4857
|
-
version:
|
|
5539
|
+
var deleteStandalonePricesParameters = z24.object({
|
|
5540
|
+
id: z24.string().optional(),
|
|
5541
|
+
key: z24.string().optional(),
|
|
5542
|
+
version: z24.number().optional()
|
|
4858
5543
|
});
|
|
4859
5544
|
|
|
4860
5545
|
// src/resources/standalone-prices/standalone-prices.prompt.ts
|
|
@@ -4999,30 +5684,30 @@ async function deleteStandalonePrices(context, apiClientFactory) {
|
|
|
4999
5684
|
}
|
|
5000
5685
|
|
|
5001
5686
|
// src/resources/states/states.schema.ts
|
|
5002
|
-
import { z as
|
|
5003
|
-
var readStatesParameters =
|
|
5004
|
-
id:
|
|
5005
|
-
key:
|
|
5006
|
-
where:
|
|
5007
|
-
sort:
|
|
5008
|
-
limit:
|
|
5009
|
-
offset:
|
|
5010
|
-
expand:
|
|
5011
|
-
withTotal:
|
|
5687
|
+
import { z as z25 } from "zod";
|
|
5688
|
+
var readStatesParameters = z25.object({
|
|
5689
|
+
id: z25.string().optional(),
|
|
5690
|
+
key: z25.string().optional(),
|
|
5691
|
+
where: z25.array(z25.string()).optional(),
|
|
5692
|
+
sort: z25.array(z25.string()).optional(),
|
|
5693
|
+
limit: z25.number().int().min(1).max(500).optional(),
|
|
5694
|
+
offset: z25.number().int().optional(),
|
|
5695
|
+
expand: z25.array(z25.string()).optional(),
|
|
5696
|
+
withTotal: z25.boolean().optional()
|
|
5012
5697
|
});
|
|
5013
|
-
var createStatesParameters =
|
|
5014
|
-
body:
|
|
5698
|
+
var createStatesParameters = z25.object({
|
|
5699
|
+
body: z25.record(z25.any())
|
|
5015
5700
|
});
|
|
5016
|
-
var updateStatesParameters =
|
|
5017
|
-
id:
|
|
5018
|
-
key:
|
|
5019
|
-
version:
|
|
5020
|
-
actions:
|
|
5701
|
+
var updateStatesParameters = z25.object({
|
|
5702
|
+
id: z25.string().optional(),
|
|
5703
|
+
key: z25.string().optional(),
|
|
5704
|
+
version: z25.number().optional(),
|
|
5705
|
+
actions: z25.array(z25.record(z25.any())).optional()
|
|
5021
5706
|
});
|
|
5022
|
-
var deleteStatesParameters =
|
|
5023
|
-
id:
|
|
5024
|
-
key:
|
|
5025
|
-
version:
|
|
5707
|
+
var deleteStatesParameters = z25.object({
|
|
5708
|
+
id: z25.string().optional(),
|
|
5709
|
+
key: z25.string().optional(),
|
|
5710
|
+
version: z25.number().optional()
|
|
5026
5711
|
});
|
|
5027
5712
|
|
|
5028
5713
|
// src/resources/states/states.prompt.ts
|
|
@@ -5198,29 +5883,29 @@ async function deleteStates(context, apiClientFactory) {
|
|
|
5198
5883
|
}
|
|
5199
5884
|
|
|
5200
5885
|
// src/resources/stores/stores.schema.ts
|
|
5201
|
-
import { z as
|
|
5202
|
-
var readStoresParameters =
|
|
5203
|
-
id:
|
|
5204
|
-
key:
|
|
5205
|
-
where:
|
|
5206
|
-
sort:
|
|
5207
|
-
limit:
|
|
5208
|
-
offset:
|
|
5209
|
-
expand:
|
|
5886
|
+
import { z as z26 } from "zod";
|
|
5887
|
+
var readStoresParameters = z26.object({
|
|
5888
|
+
id: z26.string().optional(),
|
|
5889
|
+
key: z26.string().optional(),
|
|
5890
|
+
where: z26.array(z26.string()).optional(),
|
|
5891
|
+
sort: z26.array(z26.string()).optional(),
|
|
5892
|
+
limit: z26.number().int().min(1).max(500).optional(),
|
|
5893
|
+
offset: z26.number().int().optional(),
|
|
5894
|
+
expand: z26.array(z26.string()).optional()
|
|
5210
5895
|
});
|
|
5211
|
-
var createStoresParameters =
|
|
5212
|
-
body:
|
|
5896
|
+
var createStoresParameters = z26.object({
|
|
5897
|
+
body: z26.record(z26.any())
|
|
5213
5898
|
});
|
|
5214
|
-
var updateStoresParameters =
|
|
5215
|
-
id:
|
|
5216
|
-
key:
|
|
5217
|
-
version:
|
|
5218
|
-
actions:
|
|
5899
|
+
var updateStoresParameters = z26.object({
|
|
5900
|
+
id: z26.string().optional(),
|
|
5901
|
+
key: z26.string().optional(),
|
|
5902
|
+
version: z26.number().optional(),
|
|
5903
|
+
actions: z26.array(z26.record(z26.any())).optional()
|
|
5219
5904
|
});
|
|
5220
|
-
var deleteStoresParameters =
|
|
5221
|
-
id:
|
|
5222
|
-
key:
|
|
5223
|
-
version:
|
|
5905
|
+
var deleteStoresParameters = z26.object({
|
|
5906
|
+
id: z26.string().optional(),
|
|
5907
|
+
key: z26.string().optional(),
|
|
5908
|
+
version: z26.number().optional()
|
|
5224
5909
|
});
|
|
5225
5910
|
|
|
5226
5911
|
// src/resources/stores/stores.prompt.ts
|
|
@@ -5351,29 +6036,29 @@ async function deleteStores(context, apiClientFactory) {
|
|
|
5351
6036
|
}
|
|
5352
6037
|
|
|
5353
6038
|
// src/resources/subscriptions/subscriptions.schema.ts
|
|
5354
|
-
import { z as
|
|
5355
|
-
var readSubscriptionsParameters =
|
|
5356
|
-
id:
|
|
5357
|
-
key:
|
|
5358
|
-
where:
|
|
5359
|
-
sort:
|
|
5360
|
-
limit:
|
|
5361
|
-
offset:
|
|
5362
|
-
expand:
|
|
6039
|
+
import { z as z27 } from "zod";
|
|
6040
|
+
var readSubscriptionsParameters = z27.object({
|
|
6041
|
+
id: z27.string().optional(),
|
|
6042
|
+
key: z27.string().optional(),
|
|
6043
|
+
where: z27.array(z27.string()).optional(),
|
|
6044
|
+
sort: z27.array(z27.string()).optional(),
|
|
6045
|
+
limit: z27.number().int().min(1).max(500).optional(),
|
|
6046
|
+
offset: z27.number().int().optional(),
|
|
6047
|
+
expand: z27.array(z27.string()).optional()
|
|
5363
6048
|
});
|
|
5364
|
-
var createSubscriptionsParameters =
|
|
5365
|
-
body:
|
|
6049
|
+
var createSubscriptionsParameters = z27.object({
|
|
6050
|
+
body: z27.record(z27.any())
|
|
5366
6051
|
});
|
|
5367
|
-
var updateSubscriptionsParameters =
|
|
5368
|
-
id:
|
|
5369
|
-
key:
|
|
5370
|
-
version:
|
|
5371
|
-
actions:
|
|
6052
|
+
var updateSubscriptionsParameters = z27.object({
|
|
6053
|
+
id: z27.string().optional(),
|
|
6054
|
+
key: z27.string().optional(),
|
|
6055
|
+
version: z27.number().optional(),
|
|
6056
|
+
actions: z27.array(z27.record(z27.any())).optional()
|
|
5372
6057
|
});
|
|
5373
|
-
var deleteSubscriptionsParameters =
|
|
5374
|
-
id:
|
|
5375
|
-
key:
|
|
5376
|
-
version:
|
|
6058
|
+
var deleteSubscriptionsParameters = z27.object({
|
|
6059
|
+
id: z27.string().optional(),
|
|
6060
|
+
key: z27.string().optional(),
|
|
6061
|
+
version: z27.number().optional()
|
|
5377
6062
|
});
|
|
5378
6063
|
|
|
5379
6064
|
// src/resources/subscriptions/subscriptions.prompt.ts
|
|
@@ -5561,60 +6246,60 @@ async function deleteSubscriptions(context, apiClientFactory) {
|
|
|
5561
6246
|
}
|
|
5562
6247
|
|
|
5563
6248
|
// src/resources/tax-categories/tax-categories.schema.ts
|
|
5564
|
-
import { z as
|
|
5565
|
-
var readTaxCategoriesParameters =
|
|
5566
|
-
id:
|
|
5567
|
-
key:
|
|
5568
|
-
where:
|
|
6249
|
+
import { z as z28 } from "zod";
|
|
6250
|
+
var readTaxCategoriesParameters = z28.object({
|
|
6251
|
+
id: z28.string().optional().describe("Tax Category ID"),
|
|
6252
|
+
key: z28.string().optional().describe("Tax Category key"),
|
|
6253
|
+
where: z28.array(z28.string()).optional().describe(
|
|
5569
6254
|
'Query predicates specified as strings. Example: ["name = \\"Standard\\""]'
|
|
5570
6255
|
),
|
|
5571
|
-
sort:
|
|
6256
|
+
sort: z28.array(z28.string()).optional().describe(
|
|
5572
6257
|
'Sort criteria for the results. Example: ["name asc", "createdAt desc"]'
|
|
5573
6258
|
),
|
|
5574
|
-
limit:
|
|
6259
|
+
limit: z28.number().int().min(1).max(500).optional().describe(
|
|
5575
6260
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
5576
6261
|
),
|
|
5577
|
-
offset:
|
|
6262
|
+
offset: z28.number().int().min(0).optional().describe(
|
|
5578
6263
|
"The number of items to skip before starting to collect the result set."
|
|
5579
6264
|
),
|
|
5580
|
-
expand:
|
|
6265
|
+
expand: z28.array(z28.string()).optional().describe("Fields to expand. Example: []")
|
|
5581
6266
|
});
|
|
5582
|
-
var createTaxCategoriesParameters =
|
|
5583
|
-
key:
|
|
5584
|
-
name:
|
|
5585
|
-
description:
|
|
5586
|
-
rates:
|
|
5587
|
-
|
|
5588
|
-
name:
|
|
5589
|
-
amount:
|
|
5590
|
-
includedInPrice:
|
|
5591
|
-
country:
|
|
5592
|
-
state:
|
|
5593
|
-
subRates:
|
|
5594
|
-
|
|
5595
|
-
name:
|
|
5596
|
-
amount:
|
|
6267
|
+
var createTaxCategoriesParameters = z28.object({
|
|
6268
|
+
key: z28.string().min(2).max(256).optional().describe("User-defined unique identifier for the tax category"),
|
|
6269
|
+
name: z28.string().describe("Tax Category name"),
|
|
6270
|
+
description: z28.string().optional().describe("Tax Category description"),
|
|
6271
|
+
rates: z28.array(
|
|
6272
|
+
z28.object({
|
|
6273
|
+
name: z28.string().describe("Tax rate name"),
|
|
6274
|
+
amount: z28.number().min(0).max(1).optional().describe("Tax rate amount (0-1)"),
|
|
6275
|
+
includedInPrice: z28.boolean().optional().describe("Whether the tax is included in the price"),
|
|
6276
|
+
country: z28.string().describe("Country code (ISO 3166-1 alpha-2)"),
|
|
6277
|
+
state: z28.string().optional().describe("State within the country"),
|
|
6278
|
+
subRates: z28.array(
|
|
6279
|
+
z28.object({
|
|
6280
|
+
name: z28.string(),
|
|
6281
|
+
amount: z28.number().min(0).max(1).optional()
|
|
5597
6282
|
})
|
|
5598
6283
|
).optional().describe("Sub-rates for the tax rate")
|
|
5599
6284
|
})
|
|
5600
6285
|
).optional().describe("Array of tax rates")
|
|
5601
6286
|
});
|
|
5602
|
-
var updateTaxCategoriesParameters =
|
|
5603
|
-
id:
|
|
5604
|
-
key:
|
|
5605
|
-
version:
|
|
5606
|
-
actions:
|
|
5607
|
-
|
|
5608
|
-
action:
|
|
5609
|
-
}).and(
|
|
6287
|
+
var updateTaxCategoriesParameters = z28.object({
|
|
6288
|
+
id: z28.string().optional().describe("The ID of the tax category to update"),
|
|
6289
|
+
key: z28.string().optional().describe("The key of the tax category to update"),
|
|
6290
|
+
version: z28.number().int().describe("The current version of the tax category"),
|
|
6291
|
+
actions: z28.array(
|
|
6292
|
+
z28.object({
|
|
6293
|
+
action: z28.string().describe("The name of the update action to perform")
|
|
6294
|
+
}).and(z28.record(z28.string(), z28.any()).optional()).describe(
|
|
5610
6295
|
'Array of update actions to perform on the tax category. Each action should have an "action" field and other fields specific to that action type.'
|
|
5611
6296
|
)
|
|
5612
6297
|
).describe("Update actions")
|
|
5613
6298
|
});
|
|
5614
|
-
var deleteTaxCategoriesParameters =
|
|
5615
|
-
id:
|
|
5616
|
-
key:
|
|
5617
|
-
version:
|
|
6299
|
+
var deleteTaxCategoriesParameters = z28.object({
|
|
6300
|
+
id: z28.string().optional().describe("Tax Category ID"),
|
|
6301
|
+
key: z28.string().optional().describe("Tax Category key"),
|
|
6302
|
+
version: z28.number().int().describe("Current version (for optimistic locking)")
|
|
5618
6303
|
});
|
|
5619
6304
|
|
|
5620
6305
|
// src/resources/tax-categories/tax-categories.prompt.ts
|
|
@@ -5818,59 +6503,59 @@ async function deleteTaxCategories(context, apiClientFactory) {
|
|
|
5818
6503
|
}
|
|
5819
6504
|
|
|
5820
6505
|
// src/resources/types/types.schema.ts
|
|
5821
|
-
import { z as
|
|
5822
|
-
var readTypesParameters =
|
|
5823
|
-
id:
|
|
5824
|
-
key:
|
|
5825
|
-
where:
|
|
6506
|
+
import { z as z29 } from "zod";
|
|
6507
|
+
var readTypesParameters = z29.object({
|
|
6508
|
+
id: z29.string().optional().describe("Type ID"),
|
|
6509
|
+
key: z29.string().optional().describe("Type key"),
|
|
6510
|
+
where: z29.array(z29.string()).optional().describe(
|
|
5826
6511
|
'Query predicates specified as strings. Example: ["key = \\"my-type\\""]'
|
|
5827
6512
|
),
|
|
5828
|
-
sort:
|
|
6513
|
+
sort: z29.array(z29.string()).optional().describe(
|
|
5829
6514
|
'Sort criteria for the results. Example: ["key asc", "createdAt desc"]'
|
|
5830
6515
|
),
|
|
5831
|
-
limit:
|
|
6516
|
+
limit: z29.number().int().min(1).max(500).optional().describe(
|
|
5832
6517
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
5833
6518
|
),
|
|
5834
|
-
offset:
|
|
6519
|
+
offset: z29.number().int().min(0).optional().describe(
|
|
5835
6520
|
"The number of items to skip before starting to collect the result set."
|
|
5836
6521
|
),
|
|
5837
|
-
expand:
|
|
6522
|
+
expand: z29.array(z29.string()).optional().describe("Fields to expand. Example: []")
|
|
5838
6523
|
});
|
|
5839
|
-
var createTypesParameters =
|
|
5840
|
-
key:
|
|
5841
|
-
name:
|
|
6524
|
+
var createTypesParameters = z29.object({
|
|
6525
|
+
key: z29.string().min(2).max(256).describe("User-defined unique identifier for the type"),
|
|
6526
|
+
name: z29.record(z29.string()).describe(
|
|
5842
6527
|
"Type name (localized string, object with language codes as keys)"
|
|
5843
6528
|
),
|
|
5844
|
-
description:
|
|
5845
|
-
resourceTypeIds:
|
|
6529
|
+
description: z29.record(z29.string()).optional().describe("Type description (localized string)"),
|
|
6530
|
+
resourceTypeIds: z29.array(z29.string()).describe(
|
|
5846
6531
|
'Resource types that can be customized with this type. Example: ["category", "product"]'
|
|
5847
6532
|
),
|
|
5848
|
-
fieldDefinitions:
|
|
5849
|
-
|
|
5850
|
-
name:
|
|
5851
|
-
label:
|
|
5852
|
-
required:
|
|
5853
|
-
inputHint:
|
|
5854
|
-
type:
|
|
6533
|
+
fieldDefinitions: z29.array(
|
|
6534
|
+
z29.object({
|
|
6535
|
+
name: z29.string().describe("Field name"),
|
|
6536
|
+
label: z29.record(z29.string()).describe("Localized label for the field"),
|
|
6537
|
+
required: z29.boolean().optional().describe("Whether the field is required"),
|
|
6538
|
+
inputHint: z29.enum(["SingleLine", "MultiLine"]).optional().describe("Input hint for String fields"),
|
|
6539
|
+
type: z29.any().describe("Field type definition")
|
|
5855
6540
|
})
|
|
5856
6541
|
).optional().describe("Array of field definitions")
|
|
5857
6542
|
});
|
|
5858
|
-
var updateTypesParameters =
|
|
5859
|
-
id:
|
|
5860
|
-
key:
|
|
5861
|
-
version:
|
|
5862
|
-
actions:
|
|
5863
|
-
|
|
5864
|
-
action:
|
|
5865
|
-
}).and(
|
|
6543
|
+
var updateTypesParameters = z29.object({
|
|
6544
|
+
id: z29.string().optional().describe("The ID of the type to update"),
|
|
6545
|
+
key: z29.string().optional().describe("The key of the type to update"),
|
|
6546
|
+
version: z29.number().int().describe("The current version of the type"),
|
|
6547
|
+
actions: z29.array(
|
|
6548
|
+
z29.object({
|
|
6549
|
+
action: z29.string().describe("The name of the update action to perform")
|
|
6550
|
+
}).and(z29.record(z29.string(), z29.any()).optional()).describe(
|
|
5866
6551
|
'Array of update actions to perform on the type. Each action should have an "action" field and other fields specific to that action type.'
|
|
5867
6552
|
)
|
|
5868
6553
|
).describe("Update actions")
|
|
5869
6554
|
});
|
|
5870
|
-
var deleteTypesParameters =
|
|
5871
|
-
id:
|
|
5872
|
-
key:
|
|
5873
|
-
version:
|
|
6555
|
+
var deleteTypesParameters = z29.object({
|
|
6556
|
+
id: z29.string().optional().describe("Type ID"),
|
|
6557
|
+
key: z29.string().optional().describe("Type key"),
|
|
6558
|
+
version: z29.number().int().describe("Current version (for optimistic locking)")
|
|
5874
6559
|
});
|
|
5875
6560
|
|
|
5876
6561
|
// src/resources/types/types.prompt.ts
|
|
@@ -6068,51 +6753,51 @@ async function deleteTypes(context, apiClientFactory) {
|
|
|
6068
6753
|
}
|
|
6069
6754
|
|
|
6070
6755
|
// src/resources/zones/zones.schema.ts
|
|
6071
|
-
import { z as
|
|
6072
|
-
var readZonesParameters =
|
|
6073
|
-
id:
|
|
6074
|
-
key:
|
|
6075
|
-
where:
|
|
6756
|
+
import { z as z30 } from "zod";
|
|
6757
|
+
var readZonesParameters = z30.object({
|
|
6758
|
+
id: z30.string().optional().describe("Zone ID"),
|
|
6759
|
+
key: z30.string().optional().describe("Zone key"),
|
|
6760
|
+
where: z30.array(z30.string()).optional().describe(
|
|
6076
6761
|
'Query predicates specified as strings. Example: ["name = \\"Europe\\""]'
|
|
6077
6762
|
),
|
|
6078
|
-
sort:
|
|
6763
|
+
sort: z30.array(z30.string()).optional().describe(
|
|
6079
6764
|
'Sort criteria for the results. Example: ["name asc", "createdAt desc"]'
|
|
6080
6765
|
),
|
|
6081
|
-
limit:
|
|
6766
|
+
limit: z30.number().int().min(1).max(500).optional().describe(
|
|
6082
6767
|
"A limit on the number of objects to be returned. Limit can range between 1 and 500, and the default is 20."
|
|
6083
6768
|
),
|
|
6084
|
-
offset:
|
|
6769
|
+
offset: z30.number().int().min(0).optional().describe(
|
|
6085
6770
|
"The number of items to skip before starting to collect the result set."
|
|
6086
6771
|
),
|
|
6087
|
-
expand:
|
|
6772
|
+
expand: z30.array(z30.string()).optional().describe("Fields to expand. Example: []")
|
|
6088
6773
|
});
|
|
6089
|
-
var createZonesParameters =
|
|
6090
|
-
key:
|
|
6091
|
-
name:
|
|
6092
|
-
description:
|
|
6093
|
-
locations:
|
|
6094
|
-
|
|
6095
|
-
country:
|
|
6096
|
-
state:
|
|
6774
|
+
var createZonesParameters = z30.object({
|
|
6775
|
+
key: z30.string().min(2).max(256).optional().describe("User-defined unique identifier for the zone"),
|
|
6776
|
+
name: z30.string().describe("Zone name"),
|
|
6777
|
+
description: z30.string().optional().describe("Zone description"),
|
|
6778
|
+
locations: z30.array(
|
|
6779
|
+
z30.object({
|
|
6780
|
+
country: z30.string().describe("Country code (ISO 3166-1 alpha-2)"),
|
|
6781
|
+
state: z30.string().optional().describe("State within the country")
|
|
6097
6782
|
})
|
|
6098
6783
|
).optional().describe("Array of locations (countries and optionally states)")
|
|
6099
6784
|
});
|
|
6100
|
-
var updateZonesParameters =
|
|
6101
|
-
id:
|
|
6102
|
-
key:
|
|
6103
|
-
version:
|
|
6104
|
-
actions:
|
|
6105
|
-
|
|
6106
|
-
action:
|
|
6107
|
-
}).and(
|
|
6785
|
+
var updateZonesParameters = z30.object({
|
|
6786
|
+
id: z30.string().optional().describe("The ID of the zone to update"),
|
|
6787
|
+
key: z30.string().optional().describe("The key of the zone to update"),
|
|
6788
|
+
version: z30.number().int().describe("The current version of the zone"),
|
|
6789
|
+
actions: z30.array(
|
|
6790
|
+
z30.object({
|
|
6791
|
+
action: z30.string().describe("The name of the update action to perform")
|
|
6792
|
+
}).and(z30.record(z30.string(), z30.any()).optional()).describe(
|
|
6108
6793
|
'Array of update actions to perform on the zone. Each action should have an "action" field and other fields specific to that action type.'
|
|
6109
6794
|
)
|
|
6110
6795
|
).describe("Update actions")
|
|
6111
6796
|
});
|
|
6112
|
-
var deleteZonesParameters =
|
|
6113
|
-
id:
|
|
6114
|
-
key:
|
|
6115
|
-
version:
|
|
6797
|
+
var deleteZonesParameters = z30.object({
|
|
6798
|
+
id: z30.string().optional().describe("Zone ID"),
|
|
6799
|
+
key: z30.string().optional().describe("Zone key"),
|
|
6800
|
+
version: z30.number().int().describe("Current version (for optimistic locking)")
|
|
6116
6801
|
});
|
|
6117
6802
|
|
|
6118
6803
|
// src/resources/zones/zones.prompt.ts
|
|
@@ -6305,11 +6990,15 @@ export {
|
|
|
6305
6990
|
ApiClientFactory,
|
|
6306
6991
|
AttributeGroupsHandler,
|
|
6307
6992
|
BaseResourceHandler,
|
|
6993
|
+
CartsHandler,
|
|
6308
6994
|
CategoriesHandler,
|
|
6309
6995
|
ChannelsHandler,
|
|
6310
6996
|
CommercetoolsAPIClient,
|
|
6311
6997
|
CustomObjectsHandler,
|
|
6998
|
+
CustomerGroupsHandler,
|
|
6999
|
+
CustomerSearchHandler,
|
|
6312
7000
|
CustomersHandler,
|
|
7001
|
+
DEFAULT_API_URL,
|
|
6313
7002
|
DiscountCodesHandler,
|
|
6314
7003
|
ExtensionsHandler,
|
|
6315
7004
|
InventoryHandler,
|
|
@@ -6335,9 +7024,12 @@ export {
|
|
|
6335
7024
|
TypesHandler,
|
|
6336
7025
|
ZonesHandler,
|
|
6337
7026
|
createAttributeGroups,
|
|
7027
|
+
createCarts,
|
|
6338
7028
|
createCategories,
|
|
6339
7029
|
createChannels,
|
|
6340
7030
|
createCustomObjects,
|
|
7031
|
+
createCustomerGroups,
|
|
7032
|
+
createCustomerSearch,
|
|
6341
7033
|
createCustomers,
|
|
6342
7034
|
createDiscountCodes,
|
|
6343
7035
|
createExtensions,
|
|
@@ -6359,9 +7051,12 @@ export {
|
|
|
6359
7051
|
createTypes,
|
|
6360
7052
|
createZones,
|
|
6361
7053
|
deleteAttributeGroups,
|
|
7054
|
+
deleteCarts,
|
|
6362
7055
|
deleteCategories,
|
|
6363
7056
|
deleteChannels,
|
|
6364
7057
|
deleteCustomObjects,
|
|
7058
|
+
deleteCustomerGroups,
|
|
7059
|
+
deleteCustomerSearch,
|
|
6365
7060
|
deleteCustomers,
|
|
6366
7061
|
deleteDiscountCodes,
|
|
6367
7062
|
deleteExtensions,
|
|
@@ -6384,9 +7079,12 @@ export {
|
|
|
6384
7079
|
deleteZones,
|
|
6385
7080
|
getDecoratorRegisteredHandlers,
|
|
6386
7081
|
readAttributeGroups,
|
|
7082
|
+
readCarts,
|
|
6387
7083
|
readCategories,
|
|
6388
7084
|
readChannels,
|
|
6389
7085
|
readCustomObjects,
|
|
7086
|
+
readCustomerGroups,
|
|
7087
|
+
readCustomerSearch,
|
|
6390
7088
|
readCustomers,
|
|
6391
7089
|
readDiscountCodes,
|
|
6392
7090
|
readExtensions,
|
|
@@ -6409,9 +7107,12 @@ export {
|
|
|
6409
7107
|
readTypes,
|
|
6410
7108
|
readZones,
|
|
6411
7109
|
updateAttributeGroups,
|
|
7110
|
+
updateCarts,
|
|
6412
7111
|
updateCategories,
|
|
6413
7112
|
updateChannels,
|
|
6414
7113
|
updateCustomObjects,
|
|
7114
|
+
updateCustomerGroups,
|
|
7115
|
+
updateCustomerSearch,
|
|
6415
7116
|
updateCustomers,
|
|
6416
7117
|
updateDiscountCodes,
|
|
6417
7118
|
updateExtensions,
|