@iveri/contracts 0.123.0 → 0.125.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 +6 -0
- package/dist/api/commerce/commerce-refusal.enum.d.ts +42 -0
- package/dist/api/commerce/commerce-refusal.enum.js +43 -0
- package/dist/api/commerce/index.d.ts +1 -0
- package/dist/api/commerce/index.js +1 -0
- package/dist/api/gym/gym-booking-refusal.enum.d.ts +5 -0
- package/dist/api/gym/gym-booking-refusal.enum.js +5 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@ entry offers exactly `types` and `default`. The CommonJS build and the `typesVer
|
|
|
8
8
|
gone, so a consumer resolves the subpaths under `moduleResolution` `nodenext` or `bundler` — and
|
|
9
9
|
under Node 26 a CommonJS consumer still loads it, through `require`. See `CHANGELOG.md`.
|
|
10
10
|
|
|
11
|
+
Release `0.124.0` adds `@iveri/contracts/commerce` with `CommerceRefusal`: the shop's refusals a person can act on,
|
|
12
|
+
sent as `details.reason` so the merchant panel, the shop's website and its app say them in the reader's language.
|
|
13
|
+
`saved-full` keeps the value `commerce-api` already sent. The shopfront passes on only the six a shopper meets
|
|
14
|
+
(`out-of-stock`, `not-for-sale`, `mixed-currency`, `not-awaiting-payment`, `not-cancellable`, `saved-full`), never a
|
|
15
|
+
detail beside them.
|
|
16
|
+
|
|
11
17
|
Release `0.117.0` adds `RealtimeResourceType.CLINIC_LOCATION` (`clinic.location`) and
|
|
12
18
|
`RealtimeEventType.CLINIC_LOCATION_UPDATED`: one clinic branch's room, which reception's calendar
|
|
13
19
|
follows so a visit booked, moved or settled at the desk next to it shows at once. The event names the
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Commerce refusal a person can act on, sent as `details.reason` so a client says it in the reader's language rather
|
|
3
|
+
* than showing the API's English.
|
|
4
|
+
*
|
|
5
|
+
* Two audiences read these. The first six reach a shopper through `commerce-storefront-api`, which passes on the reason
|
|
6
|
+
* and nothing else; the rest are the merchant's, in the panel. **A detail named here is the merchant's**: the shopfront
|
|
7
|
+
* never forwards one, because `out-of-stock`'s `quantityAvailable` is exactly the number a shop must not publish.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum CommerceRefusal {
|
|
10
|
+
/** Not enough stock for a line; `details.quantityAvailable` says how many could be sold (merchant only). */
|
|
11
|
+
OUT_OF_STOCK = "out-of-stock",
|
|
12
|
+
/** The product, or the chosen variant of it, is no longer sold. */
|
|
13
|
+
NOT_FOR_SALE = "not-for-sale",
|
|
14
|
+
/** The lines are priced in different currencies, so they cannot be one order. */
|
|
15
|
+
MIXED_CURRENCY = "mixed-currency",
|
|
16
|
+
/** The order is paid, or called off, so there is nothing to pay now. */
|
|
17
|
+
NOT_AWAITING_PAYMENT = "not-awaiting-payment",
|
|
18
|
+
/** The order has moved on or been paid for, so the shopper can no longer call it off. */
|
|
19
|
+
NOT_CANCELLABLE = "not-cancellable",
|
|
20
|
+
/** The shopper's saved list holds as many products as it can; `details.limit` says how many. */
|
|
21
|
+
SAVED_FULL = "saved-full",
|
|
22
|
+
/** Another product or category already has that web address. */
|
|
23
|
+
SLUG_TAKEN = "slug-taken",
|
|
24
|
+
/** Another product or variant already has that SKU. */
|
|
25
|
+
SKU_TAKEN = "sku-taken",
|
|
26
|
+
/** The product already has a variant with exactly these options. */
|
|
27
|
+
VARIANT_OPTIONS_TAKEN = "variant-options-taken",
|
|
28
|
+
/** A product keeps at least one variant; archive the product instead. */
|
|
29
|
+
LAST_VARIANT = "last-variant",
|
|
30
|
+
/** The adjustment would leave less stock than open orders hold; `details.quantityReserved` says how much they hold. */
|
|
31
|
+
STOCK_BELOW_RESERVED = "stock-below-reserved",
|
|
32
|
+
/** A product holds at most `details.limit` images. */
|
|
33
|
+
IMAGE_LIMIT = "image-limit",
|
|
34
|
+
/** Only a confirmed order can be prepared for shipping. */
|
|
35
|
+
ORDER_NOT_CONFIRMED = "order-not-confirmed",
|
|
36
|
+
/** The order already has a shipment. */
|
|
37
|
+
FULFILLMENT_EXISTS = "fulfillment-exists",
|
|
38
|
+
/** A courier collects only a packed shipment. */
|
|
39
|
+
NOT_PACKED = "not-packed",
|
|
40
|
+
/** This shop is not set up to send couriers. */
|
|
41
|
+
COURIERS_OFF = "couriers-off"
|
|
42
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Commerce refusal a person can act on, sent as `details.reason` so a client says it in the reader's language rather
|
|
3
|
+
* than showing the API's English.
|
|
4
|
+
*
|
|
5
|
+
* Two audiences read these. The first six reach a shopper through `commerce-storefront-api`, which passes on the reason
|
|
6
|
+
* and nothing else; the rest are the merchant's, in the panel. **A detail named here is the merchant's**: the shopfront
|
|
7
|
+
* never forwards one, because `out-of-stock`'s `quantityAvailable` is exactly the number a shop must not publish.
|
|
8
|
+
*/
|
|
9
|
+
export var CommerceRefusal;
|
|
10
|
+
(function (CommerceRefusal) {
|
|
11
|
+
/** Not enough stock for a line; `details.quantityAvailable` says how many could be sold (merchant only). */
|
|
12
|
+
CommerceRefusal["OUT_OF_STOCK"] = "out-of-stock";
|
|
13
|
+
/** The product, or the chosen variant of it, is no longer sold. */
|
|
14
|
+
CommerceRefusal["NOT_FOR_SALE"] = "not-for-sale";
|
|
15
|
+
/** The lines are priced in different currencies, so they cannot be one order. */
|
|
16
|
+
CommerceRefusal["MIXED_CURRENCY"] = "mixed-currency";
|
|
17
|
+
/** The order is paid, or called off, so there is nothing to pay now. */
|
|
18
|
+
CommerceRefusal["NOT_AWAITING_PAYMENT"] = "not-awaiting-payment";
|
|
19
|
+
/** The order has moved on or been paid for, so the shopper can no longer call it off. */
|
|
20
|
+
CommerceRefusal["NOT_CANCELLABLE"] = "not-cancellable";
|
|
21
|
+
/** The shopper's saved list holds as many products as it can; `details.limit` says how many. */
|
|
22
|
+
CommerceRefusal["SAVED_FULL"] = "saved-full";
|
|
23
|
+
/** Another product or category already has that web address. */
|
|
24
|
+
CommerceRefusal["SLUG_TAKEN"] = "slug-taken";
|
|
25
|
+
/** Another product or variant already has that SKU. */
|
|
26
|
+
CommerceRefusal["SKU_TAKEN"] = "sku-taken";
|
|
27
|
+
/** The product already has a variant with exactly these options. */
|
|
28
|
+
CommerceRefusal["VARIANT_OPTIONS_TAKEN"] = "variant-options-taken";
|
|
29
|
+
/** A product keeps at least one variant; archive the product instead. */
|
|
30
|
+
CommerceRefusal["LAST_VARIANT"] = "last-variant";
|
|
31
|
+
/** The adjustment would leave less stock than open orders hold; `details.quantityReserved` says how much they hold. */
|
|
32
|
+
CommerceRefusal["STOCK_BELOW_RESERVED"] = "stock-below-reserved";
|
|
33
|
+
/** A product holds at most `details.limit` images. */
|
|
34
|
+
CommerceRefusal["IMAGE_LIMIT"] = "image-limit";
|
|
35
|
+
/** Only a confirmed order can be prepared for shipping. */
|
|
36
|
+
CommerceRefusal["ORDER_NOT_CONFIRMED"] = "order-not-confirmed";
|
|
37
|
+
/** The order already has a shipment. */
|
|
38
|
+
CommerceRefusal["FULFILLMENT_EXISTS"] = "fulfillment-exists";
|
|
39
|
+
/** A courier collects only a packed shipment. */
|
|
40
|
+
CommerceRefusal["NOT_PACKED"] = "not-packed";
|
|
41
|
+
/** This shop is not set up to send couriers. */
|
|
42
|
+
CommerceRefusal["COURIERS_OFF"] = "couriers-off";
|
|
43
|
+
})(CommerceRefusal || (CommerceRefusal = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './commerce-refusal.enum.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './commerce-refusal.enum.js';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/** Why somebody cannot have a place. Sent as `details.reason` so a client can say it in the member's language. */
|
|
2
2
|
export declare enum GymBookingRefusal {
|
|
3
3
|
NO_MEMBERSHIP = "no-membership",
|
|
4
|
+
/**
|
|
5
|
+
* A membership that would cover the class is frozen that day. Said instead of `no-membership` or
|
|
6
|
+
* `no-class-access`, which would send somebody who holds the right plan to buy another.
|
|
7
|
+
*/
|
|
8
|
+
FROZEN = "frozen",
|
|
4
9
|
NO_CLASS_ACCESS = "no-class-access",
|
|
5
10
|
NO_CREDITS = "no-credits",
|
|
6
11
|
WRONG_BRANCH = "wrong-branch",
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
export var GymBookingRefusal;
|
|
3
3
|
(function (GymBookingRefusal) {
|
|
4
4
|
GymBookingRefusal["NO_MEMBERSHIP"] = "no-membership";
|
|
5
|
+
/**
|
|
6
|
+
* A membership that would cover the class is frozen that day. Said instead of `no-membership` or
|
|
7
|
+
* `no-class-access`, which would send somebody who holds the right plan to buy another.
|
|
8
|
+
*/
|
|
9
|
+
GymBookingRefusal["FROZEN"] = "frozen";
|
|
5
10
|
GymBookingRefusal["NO_CLASS_ACCESS"] = "no-class-access";
|
|
6
11
|
GymBookingRefusal["NO_CREDITS"] = "no-credits";
|
|
7
12
|
GymBookingRefusal["WRONG_BRANCH"] = "wrong-branch";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iveri/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.125.0",
|
|
4
4
|
"description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -92,6 +92,10 @@
|
|
|
92
92
|
"types": "./dist/api/billing/index.d.ts",
|
|
93
93
|
"default": "./dist/api/billing/index.js"
|
|
94
94
|
},
|
|
95
|
+
"./commerce": {
|
|
96
|
+
"types": "./dist/api/commerce/index.d.ts",
|
|
97
|
+
"default": "./dist/api/commerce/index.js"
|
|
98
|
+
},
|
|
95
99
|
"./package.json": "./package.json"
|
|
96
100
|
},
|
|
97
101
|
"sideEffects": false,
|