@iveri/contracts 0.146.0 → 0.148.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 +2 -0
- package/dist/api/clinic/clinic-refusal.enum.d.ts +3 -1
- package/dist/api/clinic/clinic-refusal.enum.js +2 -0
- package/dist/api/commerce/commerce-refusal.enum.d.ts +4 -2
- package/dist/api/commerce/commerce-refusal.enum.js +3 -1
- package/dist/api/commerce/index.d.ts +11 -0
- package/dist/api/commerce/index.js +11 -0
- package/dist/api/commerce/merchant-product-review.type.d.ts +24 -0
- package/dist/api/commerce/merchant-product-review.type.js +1 -0
- package/dist/api/commerce/merchant-product-reviews-page.type.d.ts +8 -0
- package/dist/api/commerce/merchant-product-reviews-page.type.js +1 -0
- package/dist/api/commerce/product-review-limits.constant.d.ts +8 -0
- package/dist/api/commerce/product-review-limits.constant.js +8 -0
- package/dist/api/commerce/product-review-reply-body.type.d.ts +4 -0
- package/dist/api/commerce/product-review-reply-body.type.js +1 -0
- package/dist/api/commerce/product-review-reply.type.d.ts +6 -0
- package/dist/api/commerce/product-review-reply.type.js +1 -0
- package/dist/api/commerce/product-review-summary.type.d.ts +11 -0
- package/dist/api/commerce/product-review-summary.type.js +1 -0
- package/dist/api/commerce/shopper-product-review.type.d.ts +15 -0
- package/dist/api/commerce/shopper-product-review.type.js +1 -0
- package/dist/api/commerce/shopper-review-state.type.d.ts +11 -0
- package/dist/api/commerce/shopper-review-state.type.js +1 -0
- package/dist/api/commerce/storefront-product-review.type.d.ts +23 -0
- package/dist/api/commerce/storefront-product-review.type.js +1 -0
- package/dist/api/commerce/storefront-product-reviews-page.type.d.ts +10 -0
- package/dist/api/commerce/storefront-product-reviews-page.type.js +1 -0
- package/dist/api/commerce/write-product-review-body.type.d.ts +8 -0
- package/dist/api/commerce/write-product-review-body.type.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -322,6 +322,8 @@ Conduit's outbox.
|
|
|
322
322
|
`UniboxAgents` under `@iveri/contracts/unibox`, so the inbox picks agents by name.
|
|
323
323
|
- Version `0.139.0` adds a trainer's notes on a member: `GymTrainerNote`, `GymTrainerNotes`, `SaveGymTrainerNoteRequest`,
|
|
324
324
|
`GymMyTrainerNote` and the `GymRefusal` member `not-their-trainer` under `@iveri/contracts/gym`.
|
|
325
|
+
- Version `0.148.0` adds the `ClinicRefusal` member `beyond-booking-horizon`, for a date past how far ahead a clinic
|
|
326
|
+
takes bookings.
|
|
325
327
|
- Version `0.146.0` adds the Unibox AI agent's daily token cap (`AiAgentSetting.dailyTokenCap`,
|
|
326
328
|
`AgentRunRequest.dailyTokenCap`, the `AgentRunOutcome` members `cap-reached` and `cap-pending`, `AgentRunDailySpend`
|
|
327
329
|
and `UniboxAiUsageMetric`), and a clinic's automatic deposit refund on a client's cancellation:
|
|
@@ -16,5 +16,7 @@ export declare enum ClinicRefusal {
|
|
|
16
16
|
/** A refund of this online payment is still being confirmed with the bank; wait for it before asking again. */
|
|
17
17
|
ONLINE_REFUND_PENDING = "online-refund-pending",
|
|
18
18
|
/** This clinic cannot give online payments back from here; the money goes back from the payment provider. */
|
|
19
|
-
ONLINE_REFUND_UNAVAILABLE = "online-refund-unavailable"
|
|
19
|
+
ONLINE_REFUND_UNAVAILABLE = "online-refund-unavailable",
|
|
20
|
+
/** The date is further ahead than the clinic takes bookings; `details.bookingHorizonDays` says how far. */
|
|
21
|
+
BEYOND_BOOKING_HORIZON = "beyond-booking-horizon"
|
|
20
22
|
}
|
|
@@ -18,4 +18,6 @@ export var ClinicRefusal;
|
|
|
18
18
|
ClinicRefusal["ONLINE_REFUND_PENDING"] = "online-refund-pending";
|
|
19
19
|
/** This clinic cannot give online payments back from here; the money goes back from the payment provider. */
|
|
20
20
|
ClinicRefusal["ONLINE_REFUND_UNAVAILABLE"] = "online-refund-unavailable";
|
|
21
|
+
/** The date is further ahead than the clinic takes bookings; `details.bookingHorizonDays` says how far. */
|
|
22
|
+
ClinicRefusal["BEYOND_BOOKING_HORIZON"] = "beyond-booking-horizon";
|
|
21
23
|
})(ClinicRefusal || (ClinicRefusal = {}));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
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
3
|
* than showing the API's English.
|
|
4
4
|
*
|
|
5
|
-
* Two audiences read these. The first six reach a shopper through `commerce-storefront-api`, which passes on the reason
|
|
5
|
+
* Two audiences read these. The first six, and `review-not-purchased`, reach a shopper through `commerce-storefront-api`, which passes on the reason
|
|
6
6
|
* and nothing else; the rest are the merchant's, in the panel. **A detail named here is the merchant's**: the shopfront
|
|
7
7
|
* never forwards one, because `out-of-stock`'s `quantityAvailable` is exactly the number a shop must not publish.
|
|
8
8
|
*/
|
|
@@ -49,5 +49,7 @@ export declare enum CommerceRefusal {
|
|
|
49
49
|
/** The bank refused to give the money back, or could not; nothing was returned. Asking again tries once more. */
|
|
50
50
|
REFUND_FAILED = "refund-failed",
|
|
51
51
|
/** A refund of this order is still being confirmed with the bank; it finishes on its own. */
|
|
52
|
-
REFUND_PENDING = "refund-pending"
|
|
52
|
+
REFUND_PENDING = "refund-pending",
|
|
53
|
+
/** Only a shopper with a delivered order holding the product may review it. */
|
|
54
|
+
REVIEW_NOT_PURCHASED = "review-not-purchased"
|
|
53
55
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
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
3
|
* than showing the API's English.
|
|
4
4
|
*
|
|
5
|
-
* Two audiences read these. The first six reach a shopper through `commerce-storefront-api`, which passes on the reason
|
|
5
|
+
* Two audiences read these. The first six, and `review-not-purchased`, reach a shopper through `commerce-storefront-api`, which passes on the reason
|
|
6
6
|
* and nothing else; the rest are the merchant's, in the panel. **A detail named here is the merchant's**: the shopfront
|
|
7
7
|
* never forwards one, because `out-of-stock`'s `quantityAvailable` is exactly the number a shop must not publish.
|
|
8
8
|
*/
|
|
@@ -51,4 +51,6 @@ export var CommerceRefusal;
|
|
|
51
51
|
CommerceRefusal["REFUND_FAILED"] = "refund-failed";
|
|
52
52
|
/** A refund of this order is still being confirmed with the bank; it finishes on its own. */
|
|
53
53
|
CommerceRefusal["REFUND_PENDING"] = "refund-pending";
|
|
54
|
+
/** Only a shopper with a delivered order holding the product may review it. */
|
|
55
|
+
CommerceRefusal["REVIEW_NOT_PURCHASED"] = "review-not-purchased";
|
|
54
56
|
})(CommerceRefusal || (CommerceRefusal = {}));
|
|
@@ -1 +1,12 @@
|
|
|
1
1
|
export * from './commerce-refusal.enum.js';
|
|
2
|
+
export * from './merchant-product-review.type.js';
|
|
3
|
+
export * from './merchant-product-reviews-page.type.js';
|
|
4
|
+
export * from './product-review-limits.constant.js';
|
|
5
|
+
export * from './product-review-reply-body.type.js';
|
|
6
|
+
export * from './product-review-reply.type.js';
|
|
7
|
+
export * from './product-review-summary.type.js';
|
|
8
|
+
export * from './shopper-product-review.type.js';
|
|
9
|
+
export * from './shopper-review-state.type.js';
|
|
10
|
+
export * from './storefront-product-review.type.js';
|
|
11
|
+
export * from './storefront-product-reviews-page.type.js';
|
|
12
|
+
export * from './write-product-review-body.type.js';
|
|
@@ -1 +1,12 @@
|
|
|
1
1
|
export * from './commerce-refusal.enum.js';
|
|
2
|
+
export * from './merchant-product-review.type.js';
|
|
3
|
+
export * from './merchant-product-reviews-page.type.js';
|
|
4
|
+
export * from './product-review-limits.constant.js';
|
|
5
|
+
export * from './product-review-reply-body.type.js';
|
|
6
|
+
export * from './product-review-reply.type.js';
|
|
7
|
+
export * from './product-review-summary.type.js';
|
|
8
|
+
export * from './shopper-product-review.type.js';
|
|
9
|
+
export * from './shopper-review-state.type.js';
|
|
10
|
+
export * from './storefront-product-review.type.js';
|
|
11
|
+
export * from './storefront-product-reviews-page.type.js';
|
|
12
|
+
export * from './write-product-review-body.type.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ProductReviewReply } from './product-review-reply.type.js';
|
|
5
|
+
/**
|
|
6
|
+
* A review as the shop sees it in its panel, hidden ones included. The shop may reply and hide, never change or delete
|
|
7
|
+
* the shopper's words, so nothing here is editable but `reply` and `isHidden`.
|
|
8
|
+
*/
|
|
9
|
+
export interface MerchantProductReview {
|
|
10
|
+
id: UUID;
|
|
11
|
+
productId: UUID;
|
|
12
|
+
productName: string;
|
|
13
|
+
productSlug: string;
|
|
14
|
+
rating: number;
|
|
15
|
+
body: Nullable<string>;
|
|
16
|
+
/** First name and last initial, as on the shop's page; null when not known right now or the account is gone. */
|
|
17
|
+
authorName: Nullable<string>;
|
|
18
|
+
isAuthorDeleted: boolean;
|
|
19
|
+
createdAt: IsoDateTime;
|
|
20
|
+
editedAt: Nullable<IsoDateTime>;
|
|
21
|
+
isHidden: boolean;
|
|
22
|
+
hiddenAt: Nullable<IsoDateTime>;
|
|
23
|
+
reply: Nullable<ProductReviewReply>;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MerchantProductReview } from './merchant-product-review.type.js';
|
|
2
|
+
/** The shop's reviews, newest first, one page at a time. */
|
|
3
|
+
export interface MerchantProductReviewsPage {
|
|
4
|
+
items: MerchantProductReview[];
|
|
5
|
+
total: number;
|
|
6
|
+
limit: number;
|
|
7
|
+
offset: number;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The lowest rating a review may give. */
|
|
2
|
+
export declare const PRODUCT_REVIEW_MIN_RATING = 1;
|
|
3
|
+
/** The highest rating a review may give: stars out of five. */
|
|
4
|
+
export declare const PRODUCT_REVIEW_MAX_RATING = 5;
|
|
5
|
+
/** The longest a review's text may be, after trimming. Plain text; no markup is rendered anywhere. */
|
|
6
|
+
export declare const PRODUCT_REVIEW_BODY_MAX_LENGTH = 2000;
|
|
7
|
+
/** The longest a shop's public reply to a review may be, after trimming. */
|
|
8
|
+
export declare const PRODUCT_REVIEW_REPLY_MAX_LENGTH = 2000;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The lowest rating a review may give. */
|
|
2
|
+
export const PRODUCT_REVIEW_MIN_RATING = 1;
|
|
3
|
+
/** The highest rating a review may give: stars out of five. */
|
|
4
|
+
export const PRODUCT_REVIEW_MAX_RATING = 5;
|
|
5
|
+
/** The longest a review's text may be, after trimming. Plain text; no markup is rendered anywhere. */
|
|
6
|
+
export const PRODUCT_REVIEW_BODY_MAX_LENGTH = 2000;
|
|
7
|
+
/** The longest a shop's public reply to a review may be, after trimming. */
|
|
8
|
+
export const PRODUCT_REVIEW_REPLY_MAX_LENGTH = 2000;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
2
|
+
/**
|
|
3
|
+
* How a product is rated on the shop's page: the average of its visible reviews and how many there are. A review the
|
|
4
|
+
* shop hid counts in neither. `averageRating` is null when nobody has reviewed it, never 0, because no reviews is not a
|
|
5
|
+
* rating of nothing.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProductReviewSummary {
|
|
8
|
+
/** The mean rating, one decimal place, from 1 to 5; null with no visible reviews. */
|
|
9
|
+
averageRating: Nullable<number>;
|
|
10
|
+
reviewCount: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ProductReviewReply } from './product-review-reply.type.js';
|
|
5
|
+
/** A shopper's own review of one product, as they see it to change or remove it. */
|
|
6
|
+
export interface ShopperProductReview {
|
|
7
|
+
id: UUID;
|
|
8
|
+
rating: number;
|
|
9
|
+
body: Nullable<string>;
|
|
10
|
+
createdAt: IsoDateTime;
|
|
11
|
+
editedAt: Nullable<IsoDateTime>;
|
|
12
|
+
/** True when the shop has hidden it from its page; the author is told, rather than wondering where it went. */
|
|
13
|
+
isHidden: boolean;
|
|
14
|
+
reply: Nullable<ProductReviewReply>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
2
|
+
import type { ShopperProductReview } from './shopper-product-review.type.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether a signed-in shopper may review a product, and their review if they wrote one. **`canReview` is true only when
|
|
5
|
+
* they have an order holding the product that was delivered** (fulfilled); a review already written stays theirs to
|
|
6
|
+
* change or remove either way.
|
|
7
|
+
*/
|
|
8
|
+
export interface ShopperReviewState {
|
|
9
|
+
canReview: boolean;
|
|
10
|
+
review: Nullable<ShopperProductReview>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ProductReviewReply } from './product-review-reply.type.js';
|
|
5
|
+
/**
|
|
6
|
+
* One review as anybody may read it on the shop's page. The author is named by first name and last initial, read from
|
|
7
|
+
* identity when the review is read, so a renamed shopper reads as they are now; never an email, never the order.
|
|
8
|
+
*/
|
|
9
|
+
export interface StorefrontProductReview {
|
|
10
|
+
id: UUID;
|
|
11
|
+
/** 1 to 5. */
|
|
12
|
+
rating: number;
|
|
13
|
+
/** The shopper's own words, plain text; null when they gave only a rating. */
|
|
14
|
+
body: Nullable<string>;
|
|
15
|
+
/** "Nino K."; null when the author is not known right now or no longer has an account. */
|
|
16
|
+
authorName: Nullable<string>;
|
|
17
|
+
/** True when identity says the author no longer has an account; a client then says so rather than naming them. */
|
|
18
|
+
isAuthorDeleted: boolean;
|
|
19
|
+
createdAt: IsoDateTime;
|
|
20
|
+
/** When the author last changed it; null when never. */
|
|
21
|
+
editedAt: Nullable<IsoDateTime>;
|
|
22
|
+
reply: Nullable<ProductReviewReply>;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProductReviewSummary } from './product-review-summary.type.js';
|
|
2
|
+
import type { StorefrontProductReview } from './storefront-product-review.type.js';
|
|
3
|
+
/** A product's visible reviews, newest first, one page at a time, with the summary of all of them. */
|
|
4
|
+
export interface StorefrontProductReviewsPage {
|
|
5
|
+
summary: ProductReviewSummary;
|
|
6
|
+
items: StorefrontProductReview[];
|
|
7
|
+
total: number;
|
|
8
|
+
limit: number;
|
|
9
|
+
offset: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
2
|
+
/** Writing or changing one's own review: the whole review each time, since there is one per shopper and product. */
|
|
3
|
+
export interface WriteProductReviewBody {
|
|
4
|
+
/** A whole number from 1 to 5. */
|
|
5
|
+
rating: number;
|
|
6
|
+
/** Plain text, trimmed, at most 2000 characters; empty or null keeps only the rating. */
|
|
7
|
+
body?: Nullable<string>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|