@mitumba/sdk 2.0.0 → 3.0.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/dist/index.d.mts CHANGED
@@ -2077,7 +2077,9 @@ interface Review {
2077
2077
  interface CreateReviewInput {
2078
2078
  rating: number;
2079
2079
  comment?: string;
2080
- order_id?: string;
2080
+ /** The delivered/completed order being reviewed. Required: the server rejects a review without it,
2081
+ * and each order may be reviewed at most once. */
2082
+ order_id: string;
2081
2083
  }
2082
2084
  interface ReviewableOrder {
2083
2085
  order_id: string;
@@ -2995,7 +2997,11 @@ declare class ReviewsModule {
2995
2997
  page: number;
2996
2998
  }>;
2997
2999
  /**
2998
- * Create a review for a store (authenticated).
3000
+ * Create a review for a store (authenticated). `input.order_id` is required.
3001
+ *
3002
+ * @throws {APIError} `review_not_allowed` when the order is not the caller's delivered/completed
3003
+ * purchase from this store, and `already_reviewed` when the order already has a review (one
3004
+ * review per order, enforced atomically server-side).
2999
3005
  */
3000
3006
  create(storeId: string, input: CreateReviewInput, options?: RequestOptions): Promise<{
3001
3007
  id: string;
@@ -3597,6 +3603,17 @@ declare class WholesaleModule {
3597
3603
  * @throws {APIError} On network or server errors
3598
3604
  */
3599
3605
  uploadBaleImage(baleId: string, file: Blob, index: number, options?: RequestOptions): Promise<BaleImageUploadResult>;
3606
+ /**
3607
+ * Remove a bale image from its slot (requires the owning wholesale store).
3608
+ *
3609
+ * @param baleId - The bale whose image is being removed
3610
+ * @param index - The slot index; slot 0 is the cover
3611
+ * @returns `{ ok: true }` on success
3612
+ * @throws {APIError} On network or server errors
3613
+ */
3614
+ removeBaleImage(baleId: string, index: number, options?: RequestOptions): Promise<{
3615
+ ok: true;
3616
+ }>;
3600
3617
  /** Browse the wholesale bale feed (public). */
3601
3618
  wholesaleFeed(params?: WholesaleFeedParams, options?: RequestOptions): Promise<{
3602
3619
  data: BaleFeedItem[];
package/dist/index.d.ts CHANGED
@@ -2077,7 +2077,9 @@ interface Review {
2077
2077
  interface CreateReviewInput {
2078
2078
  rating: number;
2079
2079
  comment?: string;
2080
- order_id?: string;
2080
+ /** The delivered/completed order being reviewed. Required: the server rejects a review without it,
2081
+ * and each order may be reviewed at most once. */
2082
+ order_id: string;
2081
2083
  }
2082
2084
  interface ReviewableOrder {
2083
2085
  order_id: string;
@@ -2995,7 +2997,11 @@ declare class ReviewsModule {
2995
2997
  page: number;
2996
2998
  }>;
2997
2999
  /**
2998
- * Create a review for a store (authenticated).
3000
+ * Create a review for a store (authenticated). `input.order_id` is required.
3001
+ *
3002
+ * @throws {APIError} `review_not_allowed` when the order is not the caller's delivered/completed
3003
+ * purchase from this store, and `already_reviewed` when the order already has a review (one
3004
+ * review per order, enforced atomically server-side).
2999
3005
  */
3000
3006
  create(storeId: string, input: CreateReviewInput, options?: RequestOptions): Promise<{
3001
3007
  id: string;
@@ -3597,6 +3603,17 @@ declare class WholesaleModule {
3597
3603
  * @throws {APIError} On network or server errors
3598
3604
  */
3599
3605
  uploadBaleImage(baleId: string, file: Blob, index: number, options?: RequestOptions): Promise<BaleImageUploadResult>;
3606
+ /**
3607
+ * Remove a bale image from its slot (requires the owning wholesale store).
3608
+ *
3609
+ * @param baleId - The bale whose image is being removed
3610
+ * @param index - The slot index; slot 0 is the cover
3611
+ * @returns `{ ok: true }` on success
3612
+ * @throws {APIError} On network or server errors
3613
+ */
3614
+ removeBaleImage(baleId: string, index: number, options?: RequestOptions): Promise<{
3615
+ ok: true;
3616
+ }>;
3600
3617
  /** Browse the wholesale bale feed (public). */
3601
3618
  wholesaleFeed(params?: WholesaleFeedParams, options?: RequestOptions): Promise<{
3602
3619
  data: BaleFeedItem[];
package/dist/index.js CHANGED
@@ -1737,7 +1737,11 @@ var ReviewsModule = class {
1737
1737
  );
1738
1738
  }
1739
1739
  /**
1740
- * Create a review for a store (authenticated).
1740
+ * Create a review for a store (authenticated). `input.order_id` is required.
1741
+ *
1742
+ * @throws {APIError} `review_not_allowed` when the order is not the caller's delivered/completed
1743
+ * purchase from this store, and `already_reviewed` when the order already has a review (one
1744
+ * review per order, enforced atomically server-side).
1741
1745
  */
1742
1746
  async create(storeId, input, options) {
1743
1747
  return this.client.post(`/listings/stores/${storeId}/reviews`, input, options);
@@ -2304,6 +2308,17 @@ var WholesaleModule = class {
2304
2308
  formData.append("index", String(index));
2305
2309
  return this.client.post(`/listings/bales/${baleId}/images/upload`, formData, options);
2306
2310
  }
2311
+ /**
2312
+ * Remove a bale image from its slot (requires the owning wholesale store).
2313
+ *
2314
+ * @param baleId - The bale whose image is being removed
2315
+ * @param index - The slot index; slot 0 is the cover
2316
+ * @returns `{ ok: true }` on success
2317
+ * @throws {APIError} On network or server errors
2318
+ */
2319
+ async removeBaleImage(baleId, index, options) {
2320
+ return this.client.delete(`/listings/bales/${baleId}/images/${index}`, void 0, options);
2321
+ }
2307
2322
  // ── Feed ──
2308
2323
  /** Browse the wholesale bale feed (public). */
2309
2324
  async wholesaleFeed(params, options) {