@hartl-services/medusa-contracts 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,6 +27,7 @@ Consumer subpaths:
27
27
  - `@hartl-services/medusa-contracts/types/checkout-store`
28
28
  - `@hartl-services/medusa-contracts/types/plugin-features-store`
29
29
  - `@hartl-services/medusa-contracts/types/plugin-features-admin`
30
+ - `@hartl-services/medusa-contracts/types/tax-compliance-store`
30
31
  - `@hartl-services/medusa-contracts/schemas/affiliate`
31
32
  - `@hartl-services/medusa-contracts/schemas/batch-management`
32
33
  - `@hartl-services/medusa-contracts/schemas/documents`
@@ -37,6 +38,7 @@ Consumer subpaths:
37
38
  - `@hartl-services/medusa-contracts/schemas/password-policy`
38
39
  - `@hartl-services/medusa-contracts/schemas/checkout`
39
40
  - `@hartl-services/medusa-contracts/schemas/plugin-features`
41
+ - `@hartl-services/medusa-contracts/schemas/tax-compliance`
40
42
  - `@hartl-services/medusa-contracts/paths/affiliate`
41
43
  - `@hartl-services/medusa-contracts/paths/batch-management`
42
44
  - `@hartl-services/medusa-contracts/paths/documents`
@@ -46,6 +48,7 @@ Consumer subpaths:
46
48
  - `@hartl-services/medusa-contracts/paths/customer-auth`
47
49
  - `@hartl-services/medusa-contracts/paths/checkout`
48
50
  - `@hartl-services/medusa-contracts/paths/plugin-features`
51
+ - `@hartl-services/medusa-contracts/paths/tax-compliance`
49
52
 
50
53
  Server-only event subpaths (see "Server-only event contracts" below):
51
54
 
@@ -634,7 +637,11 @@ await sdk.client.fetch<AdminPluginActionRunResponse>(
634
637
  ```
635
638
 
636
639
  A `select` setting carries `options` (`{ value, label }[]`) and a string
637
- `value`/`default`; a `number` setting carries `min`/`max` (`null` = no bound).
640
+ `value`/`default`. An `ordered_list` setting carries `options` as well; its
641
+ string `value`/`default` lists the chosen option values in order, comma-separated
642
+ without spaces (`"finanzonline,vies"`). A setting group's `visible_when` is
643
+ `{ setting, equals }` (select or boolean) or `{ setting, includes }` (the
644
+ ordered list contains that option). A `number` setting carries `min`/`max` (`null` = no bound).
638
645
  An `image` setting's `value` is the public http(s) URL of an uploaded image.
639
646
  A `color` setting's `value` is a lowercase hex color `#rrggbb`. Every setting
640
647
  carries `group`: the section heading the Admin shows it under (`null` = none).
@@ -4,3 +4,11 @@ export declare const checkoutStorePaths: {
4
4
  readonly completionCheck: (cartId: string) => string;
5
5
  };
6
6
  };
7
+ /**
8
+ * Message of the 400 a store cart request gets when the cart's email belongs
9
+ * to a registered customer and the request is not authenticated as that
10
+ * customer (setting the email, a payment session, completion). A storefront
11
+ * matches on it to offer its login: the JS SDK's FetchError keeps only the
12
+ * message and status, and a bare 400 is shared with validation failures.
13
+ */
14
+ export declare const CUSTOMER_LOGIN_REQUIRED_MESSAGE = "F\u00FCr diese E-Mail-Adresse besteht bereits ein Kundenkonto. Bitte melde dich an, um die Bestellung abzuschlie\u00DFen.";
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkoutStorePaths = void 0;
3
+ exports.CUSTOMER_LOGIN_REQUIRED_MESSAGE = exports.checkoutStorePaths = void 0;
4
4
  exports.checkoutStorePaths = {
5
5
  post: {
6
6
  /** Runs the completion checks without completing (POST, no body). */
7
7
  completionCheck: (cartId) => `/store/carts/${encodeURIComponent(cartId)}/completion-check`,
8
8
  },
9
9
  };
10
+ /**
11
+ * Message of the 400 a store cart request gets when the cart's email belongs
12
+ * to a registered customer and the request is not authenticated as that
13
+ * customer (setting the email, a payment session, completion). A storefront
14
+ * matches on it to offer its login: the JS SDK's FetchError keeps only the
15
+ * message and status, and a bare 400 is shared with validation failures.
16
+ */
17
+ exports.CUSTOMER_LOGIN_REQUIRED_MESSAGE = "Für diese E-Mail-Adresse besteht bereits ein Kundenkonto. Bitte melde dich an, um die Bestellung abzuschließen.";
@@ -4,3 +4,11 @@ export const checkoutStorePaths = {
4
4
  completionCheck: (cartId) => `/store/carts/${encodeURIComponent(cartId)}/completion-check`,
5
5
  },
6
6
  };
7
+ /**
8
+ * Message of the 400 a store cart request gets when the cart's email belongs
9
+ * to a registered customer and the request is not authenticated as that
10
+ * customer (setting the email, a payment session, completion). A storefront
11
+ * matches on it to offer its login: the JS SDK's FetchError keeps only the
12
+ * message and status, and a bare 400 is shared with validation failures.
13
+ */
14
+ export const CUSTOMER_LOGIN_REQUIRED_MESSAGE = "Für diese E-Mail-Adresse besteht bereits ein Kundenkonto. Bitte melde dich an, um die Bestellung abzuschließen.";
@@ -28,7 +28,8 @@ export const AdminPluginFeatureSchema = z.object({
28
28
  });
29
29
  /**
30
30
  * `image` holds the public http(s) URL of an image uploaded in the Admin;
31
- * `color` a lowercase hex color `#rrggbb`; `date` a calendar day `YYYY-MM-DD`.
31
+ * `color` a lowercase hex color `#rrggbb`; `date` a calendar day `YYYY-MM-DD`;
32
+ * `ordered_list` the option values in order, comma-separated without spaces.
32
33
  */
33
34
  export const PluginSettingTypeSchema = z.enum([
34
35
  "string",
@@ -40,6 +41,7 @@ export const PluginSettingTypeSchema = z.enum([
40
41
  "image",
41
42
  "color",
42
43
  "date",
44
+ "ordered_list",
43
45
  ]);
44
46
  /** Where a setting's current value comes from. */
45
47
  export const PluginSettingSourceSchema = z.enum([
@@ -88,7 +90,7 @@ export const AdminPluginSecretSettingSchema = z.object({
88
90
  ...AdminPluginSettingBaseShape,
89
91
  type: z.literal("secret"),
90
92
  });
91
- /** One allowed value of a `select` setting. */
93
+ /** One allowed value of a `select` or `ordered_list` setting. */
92
94
  export const PluginSettingOptionSchema = z.object({
93
95
  value: z.string().min(1),
94
96
  label: z.string().min(1),
@@ -102,6 +104,20 @@ export const AdminPluginSelectSettingSchema = z.object({
102
104
  /** Current value; `null` when nothing is set. */
103
105
  value: z.string().nullable(),
104
106
  });
107
+ /**
108
+ * An ordered selection of the `options`: `value` is a comma-separated string
109
+ * of option values in order, e.g. `"finanzonline,vies"` (at least one, none
110
+ * twice).
111
+ */
112
+ export const AdminPluginOrderedListSettingSchema = z.object({
113
+ ...AdminPluginSettingBaseShape,
114
+ type: z.literal("ordered_list"),
115
+ /** The values the list may contain, in display order. */
116
+ options: z.array(PluginSettingOptionSchema).min(1),
117
+ default: z.string().nullable(),
118
+ /** Current value; `null` when nothing is set. */
119
+ value: z.string().nullable(),
120
+ });
105
121
  export const AdminPluginNumberSettingSchema = z.object({
106
122
  ...AdminPluginSettingBaseShape,
107
123
  type: z.literal("number"),
@@ -125,6 +141,7 @@ export const AdminPluginPlainSettingSchema = z.object({
125
141
  export const AdminPluginSettingSchema = z.union([
126
142
  AdminPluginSecretSettingSchema,
127
143
  AdminPluginSelectSettingSchema,
144
+ AdminPluginOrderedListSettingSchema,
128
145
  AdminPluginNumberSettingSchema,
129
146
  AdminPluginPlainSettingSchema,
130
147
  ]);
@@ -162,13 +179,21 @@ export const AdminPluginSettingGroupSchema = z.object({
162
179
  requires_feature: PluginFeatureKeySchema.nullable(),
163
180
  /**
164
181
  * The group applies only while the select or boolean setting `setting`
165
- * has the value `equals`; the Admin hides it otherwise. `null` = always.
182
+ * has the value `equals`, or while the ordered_list setting `setting`
183
+ * contains the option `includes`; the Admin hides it otherwise. `null` =
184
+ * always.
166
185
  */
167
186
  visible_when: z
168
- .object({
169
- setting: PluginFeatureKeySchema,
170
- equals: z.union([z.string(), z.boolean()]),
171
- })
187
+ .union([
188
+ z.object({
189
+ setting: PluginFeatureKeySchema,
190
+ equals: z.union([z.string(), z.boolean()]),
191
+ }),
192
+ z.object({
193
+ setting: PluginFeatureKeySchema,
194
+ includes: z.string().min(1),
195
+ }),
196
+ ])
172
197
  .nullable(),
173
198
  });
174
199
  export const AdminPluginFeaturesSchema = z.object({
@@ -22,7 +22,14 @@ export const taxCompliancePaths = {
22
22
  /** GET: the merchant country, for which no UID is asked or checked. */
23
23
  taxIdentificationPolicy: "/store/tax-identification-policy",
24
24
  carts: {
25
+ /**
26
+ * POST: checks the billing address UID (synchronously) and applies the
27
+ * result to the cart's taxes. GET: the current status of the cart's UID
28
+ * check, `pending` while a background check runs.
29
+ */
25
30
  taxIdentification: (cartId) => `/store/carts/${pathSegment(cartId)}/tax-identification`,
31
+ /** POST: starts the background UID check of the billing address and answers at once. */
32
+ taxIdentificationCheck: (cartId) => `/store/carts/${pathSegment(cartId)}/tax-identification/check`,
26
33
  },
27
34
  customers: {
28
35
  /** POST: checks company, UID (metadata) and address of a saved address of the logged-in customer. */
@@ -17,6 +17,32 @@ export const TaxIdentificationStatusSchema = z.enum([
17
17
  "invalid",
18
18
  "unavailable",
19
19
  ]);
20
+ /**
21
+ * Status of a background UID check of a cart: the evidence statuses plus
22
+ * `pending` while the check (or one of its retries) still runs.
23
+ */
24
+ export const TaxIdentificationCheckStatusSchema = z.enum([
25
+ "pending",
26
+ "eligible",
27
+ "ineligible",
28
+ "invalid",
29
+ "unavailable",
30
+ ]);
31
+ /** Starting a background check takes no input: company and UID come from the billing address. */
32
+ export const StartTaxIdentificationCheckSchema = z.object({}).strict();
33
+ /**
34
+ * Answer of the background check routes. `status` is `null` while the
35
+ * billing address carries no UID or names a company in the merchant country
36
+ * (no check), and on GET while no check was started for the billing address
37
+ * as it is now. Once it is no longer `pending`, call the cart
38
+ * tax-identification route (POST) to apply the result to the cart's taxes.
39
+ */
40
+ export const TaxIdentificationCheckResponseSchema = z.object({
41
+ status: TaxIdentificationCheckStatusSchema.nullable(),
42
+ message: z.string().nullable(),
43
+ });
44
+ export const StartTaxIdentificationCheckResponseSchema = TaxIdentificationCheckResponseSchema;
45
+ export const GetTaxIdentificationStatusResponseSchema = TaxIdentificationCheckResponseSchema;
20
46
  export const TaxIdentificationCartTotalsSchema = z.object({
21
47
  id: z.string().trim().min(1),
22
48
  currency_code: z.string().trim().min(1),
@@ -31,7 +31,8 @@ export declare const AdminPluginFeatureSchema: z.ZodObject<{
31
31
  }, z.core.$strip>;
32
32
  /**
33
33
  * `image` holds the public http(s) URL of an image uploaded in the Admin;
34
- * `color` a lowercase hex color `#rrggbb`; `date` a calendar day `YYYY-MM-DD`.
34
+ * `color` a lowercase hex color `#rrggbb`; `date` a calendar day `YYYY-MM-DD`;
35
+ * `ordered_list` the option values in order, comma-separated without spaces.
35
36
  */
36
37
  export declare const PluginSettingTypeSchema: z.ZodEnum<{
37
38
  string: "string";
@@ -43,6 +44,7 @@ export declare const PluginSettingTypeSchema: z.ZodEnum<{
43
44
  select: "select";
44
45
  image: "image";
45
46
  color: "color";
47
+ ordered_list: "ordered_list";
46
48
  }>;
47
49
  /** Where a setting's current value comes from. */
48
50
  export declare const PluginSettingSourceSchema: z.ZodEnum<{
@@ -79,7 +81,7 @@ export declare const AdminPluginSecretSettingSchema: z.ZodObject<{
79
81
  }>;
80
82
  section: z.ZodNullable<z.ZodString>;
81
83
  }, z.core.$strip>;
82
- /** One allowed value of a `select` setting. */
84
+ /** One allowed value of a `select` or `ordered_list` setting. */
83
85
  export declare const PluginSettingOptionSchema: z.ZodObject<{
84
86
  value: z.ZodString;
85
87
  label: z.ZodString;
@@ -113,6 +115,40 @@ export declare const AdminPluginSelectSettingSchema: z.ZodObject<{
113
115
  }>;
114
116
  section: z.ZodNullable<z.ZodString>;
115
117
  }, z.core.$strip>;
118
+ /**
119
+ * An ordered selection of the `options`: `value` is a comma-separated string
120
+ * of option values in order, e.g. `"finanzonline,vies"` (at least one, none
121
+ * twice).
122
+ */
123
+ export declare const AdminPluginOrderedListSettingSchema: z.ZodObject<{
124
+ type: z.ZodLiteral<"ordered_list">;
125
+ options: z.ZodArray<z.ZodObject<{
126
+ value: z.ZodString;
127
+ label: z.ZodString;
128
+ }, z.core.$strip>>;
129
+ default: z.ZodNullable<z.ZodString>;
130
+ value: z.ZodNullable<z.ZodString>;
131
+ key: z.ZodString;
132
+ label: z.ZodString;
133
+ description: z.ZodNullable<z.ZodString>;
134
+ group: z.ZodNullable<z.ZodString>;
135
+ required: z.ZodBoolean;
136
+ is_set: z.ZodBoolean;
137
+ source: z.ZodEnum<{
138
+ default: "default";
139
+ stored: "stored";
140
+ config: "config";
141
+ none: "none";
142
+ }>;
143
+ invalidates: z.ZodArray<z.ZodString>;
144
+ hint: z.ZodNullable<z.ZodString>;
145
+ placeholder: z.ZodNullable<z.ZodString>;
146
+ width: z.ZodEnum<{
147
+ full: "full";
148
+ half: "half";
149
+ }>;
150
+ section: z.ZodNullable<z.ZodString>;
151
+ }, z.core.$strip>;
116
152
  export declare const AdminPluginNumberSettingSchema: z.ZodObject<{
117
153
  type: z.ZodLiteral<"number">;
118
154
  min: z.ZodNullable<z.ZodNumber>;
@@ -223,6 +259,34 @@ export declare const AdminPluginSettingSchema: z.ZodUnion<readonly [z.ZodObject<
223
259
  half: "half";
224
260
  }>;
225
261
  section: z.ZodNullable<z.ZodString>;
262
+ }, z.core.$strip>, z.ZodObject<{
263
+ type: z.ZodLiteral<"ordered_list">;
264
+ options: z.ZodArray<z.ZodObject<{
265
+ value: z.ZodString;
266
+ label: z.ZodString;
267
+ }, z.core.$strip>>;
268
+ default: z.ZodNullable<z.ZodString>;
269
+ value: z.ZodNullable<z.ZodString>;
270
+ key: z.ZodString;
271
+ label: z.ZodString;
272
+ description: z.ZodNullable<z.ZodString>;
273
+ group: z.ZodNullable<z.ZodString>;
274
+ required: z.ZodBoolean;
275
+ is_set: z.ZodBoolean;
276
+ source: z.ZodEnum<{
277
+ default: "default";
278
+ stored: "stored";
279
+ config: "config";
280
+ none: "none";
281
+ }>;
282
+ invalidates: z.ZodArray<z.ZodString>;
283
+ hint: z.ZodNullable<z.ZodString>;
284
+ placeholder: z.ZodNullable<z.ZodString>;
285
+ width: z.ZodEnum<{
286
+ full: "full";
287
+ half: "half";
288
+ }>;
289
+ section: z.ZodNullable<z.ZodString>;
226
290
  }, z.core.$strip>, z.ZodObject<{
227
291
  type: z.ZodLiteral<"number">;
228
292
  min: z.ZodNullable<z.ZodNumber>;
@@ -351,6 +415,34 @@ export declare const AdminPluginSettingsSchema: z.ZodObject<{
351
415
  half: "half";
352
416
  }>;
353
417
  section: z.ZodNullable<z.ZodString>;
418
+ }, z.core.$strip>, z.ZodObject<{
419
+ type: z.ZodLiteral<"ordered_list">;
420
+ options: z.ZodArray<z.ZodObject<{
421
+ value: z.ZodString;
422
+ label: z.ZodString;
423
+ }, z.core.$strip>>;
424
+ default: z.ZodNullable<z.ZodString>;
425
+ value: z.ZodNullable<z.ZodString>;
426
+ key: z.ZodString;
427
+ label: z.ZodString;
428
+ description: z.ZodNullable<z.ZodString>;
429
+ group: z.ZodNullable<z.ZodString>;
430
+ required: z.ZodBoolean;
431
+ is_set: z.ZodBoolean;
432
+ source: z.ZodEnum<{
433
+ default: "default";
434
+ stored: "stored";
435
+ config: "config";
436
+ none: "none";
437
+ }>;
438
+ invalidates: z.ZodArray<z.ZodString>;
439
+ hint: z.ZodNullable<z.ZodString>;
440
+ placeholder: z.ZodNullable<z.ZodString>;
441
+ width: z.ZodEnum<{
442
+ full: "full";
443
+ half: "half";
444
+ }>;
445
+ section: z.ZodNullable<z.ZodString>;
354
446
  }, z.core.$strip>, z.ZodObject<{
355
447
  type: z.ZodLiteral<"number">;
356
448
  min: z.ZodNullable<z.ZodNumber>;
@@ -417,10 +509,13 @@ export declare const AdminPluginSettingGroupSchema: z.ZodObject<{
417
509
  description: z.ZodNullable<z.ZodString>;
418
510
  note: z.ZodNullable<z.ZodString>;
419
511
  requires_feature: z.ZodNullable<z.ZodString>;
420
- visible_when: z.ZodNullable<z.ZodObject<{
512
+ visible_when: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
421
513
  setting: z.ZodString;
422
514
  equals: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>;
423
- }, z.core.$strip>>;
515
+ }, z.core.$strip>, z.ZodObject<{
516
+ setting: z.ZodString;
517
+ includes: z.ZodString;
518
+ }, z.core.$strip>]>>;
424
519
  }, z.core.$strip>;
425
520
  export declare const AdminPluginFeaturesSchema: z.ZodObject<{
426
521
  plugin_key: z.ZodString;
@@ -489,6 +584,34 @@ export declare const AdminPluginFeaturesSchema: z.ZodObject<{
489
584
  half: "half";
490
585
  }>;
491
586
  section: z.ZodNullable<z.ZodString>;
587
+ }, z.core.$strip>, z.ZodObject<{
588
+ type: z.ZodLiteral<"ordered_list">;
589
+ options: z.ZodArray<z.ZodObject<{
590
+ value: z.ZodString;
591
+ label: z.ZodString;
592
+ }, z.core.$strip>>;
593
+ default: z.ZodNullable<z.ZodString>;
594
+ value: z.ZodNullable<z.ZodString>;
595
+ key: z.ZodString;
596
+ label: z.ZodString;
597
+ description: z.ZodNullable<z.ZodString>;
598
+ group: z.ZodNullable<z.ZodString>;
599
+ required: z.ZodBoolean;
600
+ is_set: z.ZodBoolean;
601
+ source: z.ZodEnum<{
602
+ default: "default";
603
+ stored: "stored";
604
+ config: "config";
605
+ none: "none";
606
+ }>;
607
+ invalidates: z.ZodArray<z.ZodString>;
608
+ hint: z.ZodNullable<z.ZodString>;
609
+ placeholder: z.ZodNullable<z.ZodString>;
610
+ width: z.ZodEnum<{
611
+ full: "full";
612
+ half: "half";
613
+ }>;
614
+ section: z.ZodNullable<z.ZodString>;
492
615
  }, z.core.$strip>, z.ZodObject<{
493
616
  type: z.ZodLiteral<"number">;
494
617
  min: z.ZodNullable<z.ZodNumber>;
@@ -575,10 +698,13 @@ export declare const AdminPluginFeaturesSchema: z.ZodObject<{
575
698
  description: z.ZodNullable<z.ZodString>;
576
699
  note: z.ZodNullable<z.ZodString>;
577
700
  requires_feature: z.ZodNullable<z.ZodString>;
578
- visible_when: z.ZodNullable<z.ZodObject<{
701
+ visible_when: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
579
702
  setting: z.ZodString;
580
703
  equals: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>;
581
- }, z.core.$strip>>;
704
+ }, z.core.$strip>, z.ZodObject<{
705
+ setting: z.ZodString;
706
+ includes: z.ZodString;
707
+ }, z.core.$strip>]>>;
582
708
  }, z.core.$strip>>;
583
709
  }, z.core.$strip>;
584
710
  export declare const AdminPluginFeaturesListResponseSchema: z.ZodObject<{
@@ -649,6 +775,34 @@ export declare const AdminPluginFeaturesListResponseSchema: z.ZodObject<{
649
775
  half: "half";
650
776
  }>;
651
777
  section: z.ZodNullable<z.ZodString>;
778
+ }, z.core.$strip>, z.ZodObject<{
779
+ type: z.ZodLiteral<"ordered_list">;
780
+ options: z.ZodArray<z.ZodObject<{
781
+ value: z.ZodString;
782
+ label: z.ZodString;
783
+ }, z.core.$strip>>;
784
+ default: z.ZodNullable<z.ZodString>;
785
+ value: z.ZodNullable<z.ZodString>;
786
+ key: z.ZodString;
787
+ label: z.ZodString;
788
+ description: z.ZodNullable<z.ZodString>;
789
+ group: z.ZodNullable<z.ZodString>;
790
+ required: z.ZodBoolean;
791
+ is_set: z.ZodBoolean;
792
+ source: z.ZodEnum<{
793
+ default: "default";
794
+ stored: "stored";
795
+ config: "config";
796
+ none: "none";
797
+ }>;
798
+ invalidates: z.ZodArray<z.ZodString>;
799
+ hint: z.ZodNullable<z.ZodString>;
800
+ placeholder: z.ZodNullable<z.ZodString>;
801
+ width: z.ZodEnum<{
802
+ full: "full";
803
+ half: "half";
804
+ }>;
805
+ section: z.ZodNullable<z.ZodString>;
652
806
  }, z.core.$strip>, z.ZodObject<{
653
807
  type: z.ZodLiteral<"number">;
654
808
  min: z.ZodNullable<z.ZodNumber>;
@@ -735,10 +889,13 @@ export declare const AdminPluginFeaturesListResponseSchema: z.ZodObject<{
735
889
  description: z.ZodNullable<z.ZodString>;
736
890
  note: z.ZodNullable<z.ZodString>;
737
891
  requires_feature: z.ZodNullable<z.ZodString>;
738
- visible_when: z.ZodNullable<z.ZodObject<{
892
+ visible_when: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
739
893
  setting: z.ZodString;
740
894
  equals: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>;
741
- }, z.core.$strip>>;
895
+ }, z.core.$strip>, z.ZodObject<{
896
+ setting: z.ZodString;
897
+ includes: z.ZodString;
898
+ }, z.core.$strip>]>>;
742
899
  }, z.core.$strip>>;
743
900
  }, z.core.$strip>>;
744
901
  }, z.core.$strip>;
@@ -810,6 +967,34 @@ export declare const AdminPluginFeaturesResponseSchema: z.ZodObject<{
810
967
  half: "half";
811
968
  }>;
812
969
  section: z.ZodNullable<z.ZodString>;
970
+ }, z.core.$strip>, z.ZodObject<{
971
+ type: z.ZodLiteral<"ordered_list">;
972
+ options: z.ZodArray<z.ZodObject<{
973
+ value: z.ZodString;
974
+ label: z.ZodString;
975
+ }, z.core.$strip>>;
976
+ default: z.ZodNullable<z.ZodString>;
977
+ value: z.ZodNullable<z.ZodString>;
978
+ key: z.ZodString;
979
+ label: z.ZodString;
980
+ description: z.ZodNullable<z.ZodString>;
981
+ group: z.ZodNullable<z.ZodString>;
982
+ required: z.ZodBoolean;
983
+ is_set: z.ZodBoolean;
984
+ source: z.ZodEnum<{
985
+ default: "default";
986
+ stored: "stored";
987
+ config: "config";
988
+ none: "none";
989
+ }>;
990
+ invalidates: z.ZodArray<z.ZodString>;
991
+ hint: z.ZodNullable<z.ZodString>;
992
+ placeholder: z.ZodNullable<z.ZodString>;
993
+ width: z.ZodEnum<{
994
+ full: "full";
995
+ half: "half";
996
+ }>;
997
+ section: z.ZodNullable<z.ZodString>;
813
998
  }, z.core.$strip>, z.ZodObject<{
814
999
  type: z.ZodLiteral<"number">;
815
1000
  min: z.ZodNullable<z.ZodNumber>;
@@ -896,10 +1081,13 @@ export declare const AdminPluginFeaturesResponseSchema: z.ZodObject<{
896
1081
  description: z.ZodNullable<z.ZodString>;
897
1082
  note: z.ZodNullable<z.ZodString>;
898
1083
  requires_feature: z.ZodNullable<z.ZodString>;
899
- visible_when: z.ZodNullable<z.ZodObject<{
1084
+ visible_when: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
900
1085
  setting: z.ZodString;
901
1086
  equals: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>;
902
- }, z.core.$strip>>;
1087
+ }, z.core.$strip>, z.ZodObject<{
1088
+ setting: z.ZodString;
1089
+ includes: z.ZodString;
1090
+ }, z.core.$strip>]>>;
903
1091
  }, z.core.$strip>>;
904
1092
  }, z.core.$strip>;
905
1093
  }, z.core.$strip>;
@@ -965,6 +1153,34 @@ export declare const AdminPluginSettingsResponseSchema: z.ZodObject<{
965
1153
  half: "half";
966
1154
  }>;
967
1155
  section: z.ZodNullable<z.ZodString>;
1156
+ }, z.core.$strip>, z.ZodObject<{
1157
+ type: z.ZodLiteral<"ordered_list">;
1158
+ options: z.ZodArray<z.ZodObject<{
1159
+ value: z.ZodString;
1160
+ label: z.ZodString;
1161
+ }, z.core.$strip>>;
1162
+ default: z.ZodNullable<z.ZodString>;
1163
+ value: z.ZodNullable<z.ZodString>;
1164
+ key: z.ZodString;
1165
+ label: z.ZodString;
1166
+ description: z.ZodNullable<z.ZodString>;
1167
+ group: z.ZodNullable<z.ZodString>;
1168
+ required: z.ZodBoolean;
1169
+ is_set: z.ZodBoolean;
1170
+ source: z.ZodEnum<{
1171
+ default: "default";
1172
+ stored: "stored";
1173
+ config: "config";
1174
+ none: "none";
1175
+ }>;
1176
+ invalidates: z.ZodArray<z.ZodString>;
1177
+ hint: z.ZodNullable<z.ZodString>;
1178
+ placeholder: z.ZodNullable<z.ZodString>;
1179
+ width: z.ZodEnum<{
1180
+ full: "full";
1181
+ half: "half";
1182
+ }>;
1183
+ section: z.ZodNullable<z.ZodString>;
968
1184
  }, z.core.$strip>, z.ZodObject<{
969
1185
  type: z.ZodLiteral<"number">;
970
1186
  min: z.ZodNullable<z.ZodNumber>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdminPluginActionRunsResponseSchema = exports.ListPluginActionRunsQuerySchema = exports.PLUGIN_ACTION_RUNS_MAX_LIMIT = exports.AdminPluginActionConflictResponseSchema = exports.AdminPluginActionRunResponseSchema = exports.PluginActionRunSchema = exports.PluginActionRunProgressSchema = exports.PluginActionRunStateSchema = exports.PluginActionRunStatusSchema = exports.RunPluginActionSchema = exports.UpdatePluginSettingsSchema = exports.PLUGIN_SETTING_MAX_STRING_LENGTH = exports.AdminPluginSettingsResponseSchema = exports.UpdatePluginFeaturesSchema = exports.AdminPluginFeaturesResponseSchema = exports.AdminPluginFeaturesListResponseSchema = exports.AdminPluginFeaturesSchema = exports.AdminPluginSettingGroupSchema = exports.AdminPluginSettingsSchema = exports.AdminPluginActionSchema = exports.PluginActionModeSchema = exports.AdminPluginSettingSchema = exports.AdminPluginPlainSettingSchema = exports.AdminPluginNumberSettingSchema = exports.AdminPluginSelectSettingSchema = exports.PluginSettingOptionSchema = exports.AdminPluginSecretSettingSchema = exports.PluginSettingValueSchema = exports.PluginSettingSourceSchema = exports.PluginSettingTypeSchema = exports.AdminPluginFeatureSchema = exports.StorePluginFeaturesResponseSchema = exports.StorePluginFeaturesListResponseSchema = exports.StorePluginFeaturesSchema = exports.PluginFeatureKeySchema = void 0;
3
+ exports.AdminPluginActionRunsResponseSchema = exports.ListPluginActionRunsQuerySchema = exports.PLUGIN_ACTION_RUNS_MAX_LIMIT = exports.AdminPluginActionConflictResponseSchema = exports.AdminPluginActionRunResponseSchema = exports.PluginActionRunSchema = exports.PluginActionRunProgressSchema = exports.PluginActionRunStateSchema = exports.PluginActionRunStatusSchema = exports.RunPluginActionSchema = exports.UpdatePluginSettingsSchema = exports.PLUGIN_SETTING_MAX_STRING_LENGTH = exports.AdminPluginSettingsResponseSchema = exports.UpdatePluginFeaturesSchema = exports.AdminPluginFeaturesResponseSchema = exports.AdminPluginFeaturesListResponseSchema = exports.AdminPluginFeaturesSchema = exports.AdminPluginSettingGroupSchema = exports.AdminPluginSettingsSchema = exports.AdminPluginActionSchema = exports.PluginActionModeSchema = exports.AdminPluginSettingSchema = exports.AdminPluginPlainSettingSchema = exports.AdminPluginNumberSettingSchema = exports.AdminPluginOrderedListSettingSchema = exports.AdminPluginSelectSettingSchema = exports.PluginSettingOptionSchema = exports.AdminPluginSecretSettingSchema = exports.PluginSettingValueSchema = exports.PluginSettingSourceSchema = exports.PluginSettingTypeSchema = exports.AdminPluginFeatureSchema = exports.StorePluginFeaturesResponseSchema = exports.StorePluginFeaturesListResponseSchema = exports.StorePluginFeaturesSchema = exports.PluginFeatureKeySchema = void 0;
4
4
  const zod_1 = require("@medusajs/framework/zod");
5
5
  const primitives_1 = require("../shared/primitives");
6
6
  /** Key format shared by plugin keys and feature keys. */
@@ -31,7 +31,8 @@ exports.AdminPluginFeatureSchema = zod_1.z.object({
31
31
  });
32
32
  /**
33
33
  * `image` holds the public http(s) URL of an image uploaded in the Admin;
34
- * `color` a lowercase hex color `#rrggbb`; `date` a calendar day `YYYY-MM-DD`.
34
+ * `color` a lowercase hex color `#rrggbb`; `date` a calendar day `YYYY-MM-DD`;
35
+ * `ordered_list` the option values in order, comma-separated without spaces.
35
36
  */
36
37
  exports.PluginSettingTypeSchema = zod_1.z.enum([
37
38
  "string",
@@ -43,6 +44,7 @@ exports.PluginSettingTypeSchema = zod_1.z.enum([
43
44
  "image",
44
45
  "color",
45
46
  "date",
47
+ "ordered_list",
46
48
  ]);
47
49
  /** Where a setting's current value comes from. */
48
50
  exports.PluginSettingSourceSchema = zod_1.z.enum([
@@ -91,7 +93,7 @@ exports.AdminPluginSecretSettingSchema = zod_1.z.object({
91
93
  ...AdminPluginSettingBaseShape,
92
94
  type: zod_1.z.literal("secret"),
93
95
  });
94
- /** One allowed value of a `select` setting. */
96
+ /** One allowed value of a `select` or `ordered_list` setting. */
95
97
  exports.PluginSettingOptionSchema = zod_1.z.object({
96
98
  value: zod_1.z.string().min(1),
97
99
  label: zod_1.z.string().min(1),
@@ -105,6 +107,20 @@ exports.AdminPluginSelectSettingSchema = zod_1.z.object({
105
107
  /** Current value; `null` when nothing is set. */
106
108
  value: zod_1.z.string().nullable(),
107
109
  });
110
+ /**
111
+ * An ordered selection of the `options`: `value` is a comma-separated string
112
+ * of option values in order, e.g. `"finanzonline,vies"` (at least one, none
113
+ * twice).
114
+ */
115
+ exports.AdminPluginOrderedListSettingSchema = zod_1.z.object({
116
+ ...AdminPluginSettingBaseShape,
117
+ type: zod_1.z.literal("ordered_list"),
118
+ /** The values the list may contain, in display order. */
119
+ options: zod_1.z.array(exports.PluginSettingOptionSchema).min(1),
120
+ default: zod_1.z.string().nullable(),
121
+ /** Current value; `null` when nothing is set. */
122
+ value: zod_1.z.string().nullable(),
123
+ });
108
124
  exports.AdminPluginNumberSettingSchema = zod_1.z.object({
109
125
  ...AdminPluginSettingBaseShape,
110
126
  type: zod_1.z.literal("number"),
@@ -128,6 +144,7 @@ exports.AdminPluginPlainSettingSchema = zod_1.z.object({
128
144
  exports.AdminPluginSettingSchema = zod_1.z.union([
129
145
  exports.AdminPluginSecretSettingSchema,
130
146
  exports.AdminPluginSelectSettingSchema,
147
+ exports.AdminPluginOrderedListSettingSchema,
131
148
  exports.AdminPluginNumberSettingSchema,
132
149
  exports.AdminPluginPlainSettingSchema,
133
150
  ]);
@@ -165,13 +182,21 @@ exports.AdminPluginSettingGroupSchema = zod_1.z.object({
165
182
  requires_feature: exports.PluginFeatureKeySchema.nullable(),
166
183
  /**
167
184
  * The group applies only while the select or boolean setting `setting`
168
- * has the value `equals`; the Admin hides it otherwise. `null` = always.
185
+ * has the value `equals`, or while the ordered_list setting `setting`
186
+ * contains the option `includes`; the Admin hides it otherwise. `null` =
187
+ * always.
169
188
  */
170
189
  visible_when: zod_1.z
171
- .object({
172
- setting: exports.PluginFeatureKeySchema,
173
- equals: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]),
174
- })
190
+ .union([
191
+ zod_1.z.object({
192
+ setting: exports.PluginFeatureKeySchema,
193
+ equals: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]),
194
+ }),
195
+ zod_1.z.object({
196
+ setting: exports.PluginFeatureKeySchema,
197
+ includes: zod_1.z.string().min(1),
198
+ }),
199
+ ])
175
200
  .nullable(),
176
201
  });
177
202
  exports.AdminPluginFeaturesSchema = zod_1.z.object({
@@ -21,7 +21,14 @@ export declare const taxCompliancePaths: {
21
21
  /** GET: the merchant country, for which no UID is asked or checked. */
22
22
  readonly taxIdentificationPolicy: "/store/tax-identification-policy";
23
23
  readonly carts: {
24
+ /**
25
+ * POST: checks the billing address UID (synchronously) and applies the
26
+ * result to the cart's taxes. GET: the current status of the cart's UID
27
+ * check, `pending` while a background check runs.
28
+ */
24
29
  readonly taxIdentification: (cartId: string) => string;
30
+ /** POST: starts the background UID check of the billing address and answers at once. */
31
+ readonly taxIdentificationCheck: (cartId: string) => string;
25
32
  };
26
33
  readonly customers: {
27
34
  /** POST: checks company, UID (metadata) and address of a saved address of the logged-in customer. */
@@ -25,7 +25,14 @@ exports.taxCompliancePaths = {
25
25
  /** GET: the merchant country, for which no UID is asked or checked. */
26
26
  taxIdentificationPolicy: "/store/tax-identification-policy",
27
27
  carts: {
28
+ /**
29
+ * POST: checks the billing address UID (synchronously) and applies the
30
+ * result to the cart's taxes. GET: the current status of the cart's UID
31
+ * check, `pending` while a background check runs.
32
+ */
28
33
  taxIdentification: (cartId) => `/store/carts/${pathSegment(cartId)}/tax-identification`,
34
+ /** POST: starts the background UID check of the billing address and answers at once. */
35
+ taxIdentificationCheck: (cartId) => `/store/carts/${pathSegment(cartId)}/tax-identification/check`,
29
36
  },
30
37
  customers: {
31
38
  /** POST: checks company, UID (metadata) and address of a saved address of the logged-in customer. */
@@ -15,6 +15,56 @@ export declare const TaxIdentificationStatusSchema: z.ZodEnum<{
15
15
  unavailable: "unavailable";
16
16
  invalid: "invalid";
17
17
  }>;
18
+ /**
19
+ * Status of a background UID check of a cart: the evidence statuses plus
20
+ * `pending` while the check (or one of its retries) still runs.
21
+ */
22
+ export declare const TaxIdentificationCheckStatusSchema: z.ZodEnum<{
23
+ pending: "pending";
24
+ eligible: "eligible";
25
+ ineligible: "ineligible";
26
+ unavailable: "unavailable";
27
+ invalid: "invalid";
28
+ }>;
29
+ /** Starting a background check takes no input: company and UID come from the billing address. */
30
+ export declare const StartTaxIdentificationCheckSchema: z.ZodObject<{}, z.core.$strict>;
31
+ /**
32
+ * Answer of the background check routes. `status` is `null` while the
33
+ * billing address carries no UID or names a company in the merchant country
34
+ * (no check), and on GET while no check was started for the billing address
35
+ * as it is now. Once it is no longer `pending`, call the cart
36
+ * tax-identification route (POST) to apply the result to the cart's taxes.
37
+ */
38
+ export declare const TaxIdentificationCheckResponseSchema: z.ZodObject<{
39
+ status: z.ZodNullable<z.ZodEnum<{
40
+ pending: "pending";
41
+ eligible: "eligible";
42
+ ineligible: "ineligible";
43
+ unavailable: "unavailable";
44
+ invalid: "invalid";
45
+ }>>;
46
+ message: z.ZodNullable<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ export declare const StartTaxIdentificationCheckResponseSchema: z.ZodObject<{
49
+ status: z.ZodNullable<z.ZodEnum<{
50
+ pending: "pending";
51
+ eligible: "eligible";
52
+ ineligible: "ineligible";
53
+ unavailable: "unavailable";
54
+ invalid: "invalid";
55
+ }>>;
56
+ message: z.ZodNullable<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ export declare const GetTaxIdentificationStatusResponseSchema: z.ZodObject<{
59
+ status: z.ZodNullable<z.ZodEnum<{
60
+ pending: "pending";
61
+ eligible: "eligible";
62
+ ineligible: "ineligible";
63
+ unavailable: "unavailable";
64
+ invalid: "invalid";
65
+ }>>;
66
+ message: z.ZodNullable<z.ZodString>;
67
+ }, z.core.$strip>;
18
68
  export declare const TaxIdentificationCartTotalsSchema: z.ZodObject<{
19
69
  id: z.ZodString;
20
70
  currency_code: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListCustomerTaxIdentificationsResponseSchema = exports.GetTaxIdentificationPolicyResponseSchema = exports.SubmitCustomerAddressTaxIdentificationResponseSchema = exports.CustomerAddressTaxIdentificationSchema = exports.SubmitTaxIdentificationResponseSchema = exports.TaxIdentificationCartTotalsSchema = exports.TaxIdentificationStatusSchema = exports.SubmitTaxIdentificationSchema = void 0;
3
+ exports.ListCustomerTaxIdentificationsResponseSchema = exports.GetTaxIdentificationPolicyResponseSchema = exports.SubmitCustomerAddressTaxIdentificationResponseSchema = exports.CustomerAddressTaxIdentificationSchema = exports.SubmitTaxIdentificationResponseSchema = exports.TaxIdentificationCartTotalsSchema = exports.GetTaxIdentificationStatusResponseSchema = exports.StartTaxIdentificationCheckResponseSchema = exports.TaxIdentificationCheckResponseSchema = exports.StartTaxIdentificationCheckSchema = exports.TaxIdentificationCheckStatusSchema = exports.TaxIdentificationStatusSchema = exports.SubmitTaxIdentificationSchema = void 0;
4
4
  const zod_1 = require("@medusajs/framework/zod");
5
5
  /**
6
6
  * Company and UID come from the cart's billing address (company and
@@ -20,6 +20,32 @@ exports.TaxIdentificationStatusSchema = zod_1.z.enum([
20
20
  "invalid",
21
21
  "unavailable",
22
22
  ]);
23
+ /**
24
+ * Status of a background UID check of a cart: the evidence statuses plus
25
+ * `pending` while the check (or one of its retries) still runs.
26
+ */
27
+ exports.TaxIdentificationCheckStatusSchema = zod_1.z.enum([
28
+ "pending",
29
+ "eligible",
30
+ "ineligible",
31
+ "invalid",
32
+ "unavailable",
33
+ ]);
34
+ /** Starting a background check takes no input: company and UID come from the billing address. */
35
+ exports.StartTaxIdentificationCheckSchema = zod_1.z.object({}).strict();
36
+ /**
37
+ * Answer of the background check routes. `status` is `null` while the
38
+ * billing address carries no UID or names a company in the merchant country
39
+ * (no check), and on GET while no check was started for the billing address
40
+ * as it is now. Once it is no longer `pending`, call the cart
41
+ * tax-identification route (POST) to apply the result to the cart's taxes.
42
+ */
43
+ exports.TaxIdentificationCheckResponseSchema = zod_1.z.object({
44
+ status: exports.TaxIdentificationCheckStatusSchema.nullable(),
45
+ message: zod_1.z.string().nullable(),
46
+ });
47
+ exports.StartTaxIdentificationCheckResponseSchema = exports.TaxIdentificationCheckResponseSchema;
48
+ exports.GetTaxIdentificationStatusResponseSchema = exports.TaxIdentificationCheckResponseSchema;
23
49
  exports.TaxIdentificationCartTotalsSchema = zod_1.z.object({
24
50
  id: zod_1.z.string().trim().min(1),
25
51
  currency_code: zod_1.z.string().trim().min(1),
@@ -1,10 +1,14 @@
1
1
  import type { z } from "@medusajs/framework/zod";
2
- import type { CustomerAddressTaxIdentificationSchema, GetTaxIdentificationPolicyResponseSchema, ListCustomerTaxIdentificationsResponseSchema, SubmitCustomerAddressTaxIdentificationResponseSchema, SubmitTaxIdentificationResponseSchema, SubmitTaxIdentificationSchema, TaxIdentificationCartTotalsSchema, TaxIdentificationStatusSchema } from "./schemas";
2
+ import type { CustomerAddressTaxIdentificationSchema, GetTaxIdentificationPolicyResponseSchema, GetTaxIdentificationStatusResponseSchema, StartTaxIdentificationCheckResponseSchema, StartTaxIdentificationCheckSchema, TaxIdentificationCheckStatusSchema, ListCustomerTaxIdentificationsResponseSchema, SubmitCustomerAddressTaxIdentificationResponseSchema, SubmitTaxIdentificationResponseSchema, SubmitTaxIdentificationSchema, TaxIdentificationCartTotalsSchema, TaxIdentificationStatusSchema } from "./schemas";
3
3
  /** Raw Store HTTP body before trim and uppercase normalization. */
4
4
  export type SubmitTaxIdentificationRequest = z.input<typeof SubmitTaxIdentificationSchema>;
5
5
  /** Validated Store HTTP body consumed by the route workflow. */
6
6
  export type SubmitTaxIdentification = z.infer<typeof SubmitTaxIdentificationSchema>;
7
7
  export type TaxIdentificationStatus = z.infer<typeof TaxIdentificationStatusSchema>;
8
+ export type TaxIdentificationCheckStatus = z.infer<typeof TaxIdentificationCheckStatusSchema>;
9
+ export type StartTaxIdentificationCheckRequest = z.input<typeof StartTaxIdentificationCheckSchema>;
10
+ export type StartTaxIdentificationCheckResponse = z.infer<typeof StartTaxIdentificationCheckResponseSchema>;
11
+ export type GetTaxIdentificationStatusResponse = z.infer<typeof GetTaxIdentificationStatusResponseSchema>;
8
12
  export type TaxIdentificationCartTotals = z.infer<typeof TaxIdentificationCartTotalsSchema>;
9
13
  export type SubmitTaxIdentificationResponse = z.infer<typeof SubmitTaxIdentificationResponseSchema>;
10
14
  export type CustomerAddressTaxIdentification = z.infer<typeof CustomerAddressTaxIdentificationSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hartl-services/medusa-contracts",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "files": [