@01.software/cli 0.14.1 → 0.14.2
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.js +22 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -964,8 +964,6 @@ var productFieldShape = {
|
|
|
964
964
|
description: z2.string().optional().nullable(),
|
|
965
965
|
status: z2.string().optional(),
|
|
966
966
|
slug: z2.string().optional(),
|
|
967
|
-
primaryMediaItemId: IdSchema.optional().nullable(),
|
|
968
|
-
thumbnail: IdSchema.optional().nullable(),
|
|
969
967
|
images: z2.array(IdSchema).optional(),
|
|
970
968
|
mediaSets: RemovedLegacyMediaFieldSchema,
|
|
971
969
|
vendor: z2.string().optional().nullable(),
|
|
@@ -984,7 +982,17 @@ var productFieldShape = {
|
|
|
984
982
|
var PRODUCT_UPSERT_PRODUCT_FIELDS = Object.keys(
|
|
985
983
|
productFieldShape
|
|
986
984
|
);
|
|
987
|
-
var ProductFieldsSchema = z2.object(productFieldShape).passthrough()
|
|
985
|
+
var ProductFieldsSchema = z2.object(productFieldShape).passthrough().superRefine((value, ctx) => {
|
|
986
|
+
for (const field of ["primaryMediaItemId", "thumbnail"]) {
|
|
987
|
+
if (Object.prototype.hasOwnProperty.call(value, field)) {
|
|
988
|
+
ctx.addIssue({
|
|
989
|
+
code: "custom",
|
|
990
|
+
message: "Product media is ordered like Shopify. Use product.images and put the featured image first.",
|
|
991
|
+
path: [field]
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
});
|
|
988
996
|
var OptionValueObjectSchema = z2.object({
|
|
989
997
|
id: IdSchema.optional(),
|
|
990
998
|
value: z2.string().min(1, "Option value `value` is required"),
|
|
@@ -998,17 +1006,15 @@ var OptionValueObjectSchema = z2.object({
|
|
|
998
1006
|
images: RemovedLegacyMediaFieldSchema,
|
|
999
1007
|
metadata: z2.unknown().optional()
|
|
1000
1008
|
});
|
|
1001
|
-
var OptionValueInputSchema = OptionValueObjectSchema.passthrough().superRefine(
|
|
1002
|
-
(value,
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
1009
|
+
var OptionValueInputSchema = OptionValueObjectSchema.passthrough().superRefine((value, ctx) => {
|
|
1010
|
+
if (Object.prototype.hasOwnProperty.call(value, "swatchColor")) {
|
|
1011
|
+
ctx.addIssue({
|
|
1012
|
+
code: "custom",
|
|
1013
|
+
message: "Option value field `swatchColor` was removed. Use nested `swatch.color` instead.",
|
|
1014
|
+
path: ["swatchColor"]
|
|
1015
|
+
});
|
|
1010
1016
|
}
|
|
1011
|
-
);
|
|
1017
|
+
});
|
|
1012
1018
|
var OptionInputSchema = z2.object({
|
|
1013
1019
|
id: IdSchema.optional(),
|
|
1014
1020
|
title: z2.string().min(1, "Option `title` is required"),
|
|
@@ -1100,7 +1106,8 @@ var transactionStatusSchema = z3.enum([
|
|
|
1100
1106
|
"pending",
|
|
1101
1107
|
"paid",
|
|
1102
1108
|
"failed",
|
|
1103
|
-
"canceled"
|
|
1109
|
+
"canceled",
|
|
1110
|
+
"refunded"
|
|
1104
1111
|
]);
|
|
1105
1112
|
var financialStatusSchema = z3.enum([
|
|
1106
1113
|
"pending",
|
|
@@ -1970,7 +1977,7 @@ function registerTransactionCommands(program2, getClient2, getFormat2) {
|
|
|
1970
1977
|
const tx = program2.command("transaction").description("Transaction management");
|
|
1971
1978
|
tx.command("update").description("Update transaction status").requiredOption("--payment-id <id>", "Payment ID").requiredOption(
|
|
1972
1979
|
"--status <status>",
|
|
1973
|
-
"New status (pending, paid, failed, canceled)"
|
|
1980
|
+
"New status (pending, paid, failed, canceled, refunded)"
|
|
1974
1981
|
).option("--payment-method <method>", "Payment method").option("--receipt-url <url>", "Receipt URL").option("--payment-key <key>", "Provider payment key").option("--amount <n>", "Provider-confirmed amount").option("--dry-run", "Validate inputs without executing").action(async (opts) => {
|
|
1975
1982
|
try {
|
|
1976
1983
|
const data = parseWithSchema(
|