@thorprovider/types 5.7.0 → 5.7.1
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 +38 -3
- package/dist/index.d.ts +38 -3
- package/package.json +1 -1
- package/src/admin/DropshippingAdmin.ts +33 -3
- package/src/auth.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -1992,6 +1992,7 @@ interface SubmitApplicationBody {
|
|
|
1992
1992
|
selfie_url: string;
|
|
1993
1993
|
additional_comments?: string | null;
|
|
1994
1994
|
consent: boolean;
|
|
1995
|
+
turnstile_token: string;
|
|
1995
1996
|
}
|
|
1996
1997
|
/**
|
|
1997
1998
|
* Aplicación creada, devuelta en la respuesta 201 de
|
|
@@ -2043,6 +2044,10 @@ type SubmitApplicationResult = {
|
|
|
2043
2044
|
ok: false;
|
|
2044
2045
|
reason: 'rate_limited';
|
|
2045
2046
|
retryAfterSeconds: number;
|
|
2047
|
+
} | {
|
|
2048
|
+
ok: false;
|
|
2049
|
+
reason: 'challenge_failed';
|
|
2050
|
+
message?: string;
|
|
2046
2051
|
} | {
|
|
2047
2052
|
ok: false;
|
|
2048
2053
|
reason: 'invalid_data';
|
|
@@ -4397,7 +4402,16 @@ interface DropshipperOrderItem {
|
|
|
4397
4402
|
profit: DropshipperItemProfit;
|
|
4398
4403
|
metadata: null;
|
|
4399
4404
|
}
|
|
4400
|
-
/**
|
|
4405
|
+
/**
|
|
4406
|
+
* Order totals with profit breakdown.
|
|
4407
|
+
*
|
|
4408
|
+
* All monetary fields (`subtotal`, `tax_total`, `shipping_total`,
|
|
4409
|
+
* `discount_total`, `total`, `net_revenue`, `cost_total`, `profit`) are
|
|
4410
|
+
* expressed in MINOR units of the order's `currency_code` (e.g. cents for
|
|
4411
|
+
* two-decimal currencies; the raw integer for zero-decimal currencies such as
|
|
4412
|
+
* JPY). `margin_percent` is unitless. Consumers must NOT apply a fixed `/100`;
|
|
4413
|
+
* divide by `10^minorDigits(currencyCode)` only at the presentation boundary.
|
|
4414
|
+
*/
|
|
4401
4415
|
interface DropshipperOrderTotals {
|
|
4402
4416
|
subtotal: number;
|
|
4403
4417
|
tax_total: number;
|
|
@@ -4409,7 +4423,14 @@ interface DropshipperOrderTotals {
|
|
|
4409
4423
|
profit: number;
|
|
4410
4424
|
margin_percent: number;
|
|
4411
4425
|
}
|
|
4412
|
-
/**
|
|
4426
|
+
/**
|
|
4427
|
+
* Timeline event on an order.
|
|
4428
|
+
*
|
|
4429
|
+
* `amount` (when present) is expressed in MINOR units of `currency_code`
|
|
4430
|
+
* (e.g. cents for two-decimal currencies). Historical events may not carry
|
|
4431
|
+
* `amount`/`currency_code`; when absent, consumers must fall back to the raw
|
|
4432
|
+
* `description` text and MUST NOT apply any unit conversion.
|
|
4433
|
+
*/
|
|
4413
4434
|
interface DropshipperOrderTimelineEvent {
|
|
4414
4435
|
id: string;
|
|
4415
4436
|
code: string;
|
|
@@ -4417,6 +4438,10 @@ interface DropshipperOrderTimelineEvent {
|
|
|
4417
4438
|
description: string;
|
|
4418
4439
|
type: "info" | "success" | "warning" | "error";
|
|
4419
4440
|
timestamp: string;
|
|
4441
|
+
/** Amount in minor units of `currency_code` (payment/refund events). */
|
|
4442
|
+
amount?: number;
|
|
4443
|
+
/** Currency the `amount` is expressed in (payment/refund events). */
|
|
4444
|
+
currency_code?: string;
|
|
4420
4445
|
}
|
|
4421
4446
|
/** Payment collection on an order */
|
|
4422
4447
|
interface DropshipperPaymentSession {
|
|
@@ -4628,7 +4653,17 @@ interface DropshipperOrderFulfillment {
|
|
|
4628
4653
|
items: DropshipperFulfillmentItem[];
|
|
4629
4654
|
labels: DropshipperFulfillmentLabel[];
|
|
4630
4655
|
}
|
|
4631
|
-
/**
|
|
4656
|
+
/**
|
|
4657
|
+
* Full order detail as returned by GET /admin/thor/dropshipper/orders/:id.
|
|
4658
|
+
*
|
|
4659
|
+
* All monetary fields across the payload (order totals, items, shipping
|
|
4660
|
+
* methods, payment collections, returns, exchanges/claims, transactions,
|
|
4661
|
+
* financial summary, timeline `amount`) are expressed in MINOR units of the
|
|
4662
|
+
* order's `currency_code` (e.g. cents for two-decimal currencies; the raw
|
|
4663
|
+
* integer for zero-decimal currencies such as JPY). Consumers must NOT apply
|
|
4664
|
+
* a fixed `/100`; divide by `10^minorDigits(currencyCode)` only at the
|
|
4665
|
+
* presentation boundary.
|
|
4666
|
+
*/
|
|
4632
4667
|
interface DropshipperOrderDetail {
|
|
4633
4668
|
id: string;
|
|
4634
4669
|
display_id: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1992,6 +1992,7 @@ interface SubmitApplicationBody {
|
|
|
1992
1992
|
selfie_url: string;
|
|
1993
1993
|
additional_comments?: string | null;
|
|
1994
1994
|
consent: boolean;
|
|
1995
|
+
turnstile_token: string;
|
|
1995
1996
|
}
|
|
1996
1997
|
/**
|
|
1997
1998
|
* Aplicación creada, devuelta en la respuesta 201 de
|
|
@@ -2043,6 +2044,10 @@ type SubmitApplicationResult = {
|
|
|
2043
2044
|
ok: false;
|
|
2044
2045
|
reason: 'rate_limited';
|
|
2045
2046
|
retryAfterSeconds: number;
|
|
2047
|
+
} | {
|
|
2048
|
+
ok: false;
|
|
2049
|
+
reason: 'challenge_failed';
|
|
2050
|
+
message?: string;
|
|
2046
2051
|
} | {
|
|
2047
2052
|
ok: false;
|
|
2048
2053
|
reason: 'invalid_data';
|
|
@@ -4397,7 +4402,16 @@ interface DropshipperOrderItem {
|
|
|
4397
4402
|
profit: DropshipperItemProfit;
|
|
4398
4403
|
metadata: null;
|
|
4399
4404
|
}
|
|
4400
|
-
/**
|
|
4405
|
+
/**
|
|
4406
|
+
* Order totals with profit breakdown.
|
|
4407
|
+
*
|
|
4408
|
+
* All monetary fields (`subtotal`, `tax_total`, `shipping_total`,
|
|
4409
|
+
* `discount_total`, `total`, `net_revenue`, `cost_total`, `profit`) are
|
|
4410
|
+
* expressed in MINOR units of the order's `currency_code` (e.g. cents for
|
|
4411
|
+
* two-decimal currencies; the raw integer for zero-decimal currencies such as
|
|
4412
|
+
* JPY). `margin_percent` is unitless. Consumers must NOT apply a fixed `/100`;
|
|
4413
|
+
* divide by `10^minorDigits(currencyCode)` only at the presentation boundary.
|
|
4414
|
+
*/
|
|
4401
4415
|
interface DropshipperOrderTotals {
|
|
4402
4416
|
subtotal: number;
|
|
4403
4417
|
tax_total: number;
|
|
@@ -4409,7 +4423,14 @@ interface DropshipperOrderTotals {
|
|
|
4409
4423
|
profit: number;
|
|
4410
4424
|
margin_percent: number;
|
|
4411
4425
|
}
|
|
4412
|
-
/**
|
|
4426
|
+
/**
|
|
4427
|
+
* Timeline event on an order.
|
|
4428
|
+
*
|
|
4429
|
+
* `amount` (when present) is expressed in MINOR units of `currency_code`
|
|
4430
|
+
* (e.g. cents for two-decimal currencies). Historical events may not carry
|
|
4431
|
+
* `amount`/`currency_code`; when absent, consumers must fall back to the raw
|
|
4432
|
+
* `description` text and MUST NOT apply any unit conversion.
|
|
4433
|
+
*/
|
|
4413
4434
|
interface DropshipperOrderTimelineEvent {
|
|
4414
4435
|
id: string;
|
|
4415
4436
|
code: string;
|
|
@@ -4417,6 +4438,10 @@ interface DropshipperOrderTimelineEvent {
|
|
|
4417
4438
|
description: string;
|
|
4418
4439
|
type: "info" | "success" | "warning" | "error";
|
|
4419
4440
|
timestamp: string;
|
|
4441
|
+
/** Amount in minor units of `currency_code` (payment/refund events). */
|
|
4442
|
+
amount?: number;
|
|
4443
|
+
/** Currency the `amount` is expressed in (payment/refund events). */
|
|
4444
|
+
currency_code?: string;
|
|
4420
4445
|
}
|
|
4421
4446
|
/** Payment collection on an order */
|
|
4422
4447
|
interface DropshipperPaymentSession {
|
|
@@ -4628,7 +4653,17 @@ interface DropshipperOrderFulfillment {
|
|
|
4628
4653
|
items: DropshipperFulfillmentItem[];
|
|
4629
4654
|
labels: DropshipperFulfillmentLabel[];
|
|
4630
4655
|
}
|
|
4631
|
-
/**
|
|
4656
|
+
/**
|
|
4657
|
+
* Full order detail as returned by GET /admin/thor/dropshipper/orders/:id.
|
|
4658
|
+
*
|
|
4659
|
+
* All monetary fields across the payload (order totals, items, shipping
|
|
4660
|
+
* methods, payment collections, returns, exchanges/claims, transactions,
|
|
4661
|
+
* financial summary, timeline `amount`) are expressed in MINOR units of the
|
|
4662
|
+
* order's `currency_code` (e.g. cents for two-decimal currencies; the raw
|
|
4663
|
+
* integer for zero-decimal currencies such as JPY). Consumers must NOT apply
|
|
4664
|
+
* a fixed `/100`; divide by `10^minorDigits(currencyCode)` only at the
|
|
4665
|
+
* presentation boundary.
|
|
4666
|
+
*/
|
|
4632
4667
|
interface DropshipperOrderDetail {
|
|
4633
4668
|
id: string;
|
|
4634
4669
|
display_id: number;
|
package/package.json
CHANGED
|
@@ -617,7 +617,16 @@ export interface DropshipperOrderItem {
|
|
|
617
617
|
metadata: null;
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
-
/**
|
|
620
|
+
/**
|
|
621
|
+
* Order totals with profit breakdown.
|
|
622
|
+
*
|
|
623
|
+
* All monetary fields (`subtotal`, `tax_total`, `shipping_total`,
|
|
624
|
+
* `discount_total`, `total`, `net_revenue`, `cost_total`, `profit`) are
|
|
625
|
+
* expressed in MINOR units of the order's `currency_code` (e.g. cents for
|
|
626
|
+
* two-decimal currencies; the raw integer for zero-decimal currencies such as
|
|
627
|
+
* JPY). `margin_percent` is unitless. Consumers must NOT apply a fixed `/100`;
|
|
628
|
+
* divide by `10^minorDigits(currencyCode)` only at the presentation boundary.
|
|
629
|
+
*/
|
|
621
630
|
export interface DropshipperOrderTotals {
|
|
622
631
|
subtotal: number;
|
|
623
632
|
tax_total: number;
|
|
@@ -630,7 +639,14 @@ export interface DropshipperOrderTotals {
|
|
|
630
639
|
margin_percent: number;
|
|
631
640
|
}
|
|
632
641
|
|
|
633
|
-
/**
|
|
642
|
+
/**
|
|
643
|
+
* Timeline event on an order.
|
|
644
|
+
*
|
|
645
|
+
* `amount` (when present) is expressed in MINOR units of `currency_code`
|
|
646
|
+
* (e.g. cents for two-decimal currencies). Historical events may not carry
|
|
647
|
+
* `amount`/`currency_code`; when absent, consumers must fall back to the raw
|
|
648
|
+
* `description` text and MUST NOT apply any unit conversion.
|
|
649
|
+
*/
|
|
634
650
|
export interface DropshipperOrderTimelineEvent {
|
|
635
651
|
id: string;
|
|
636
652
|
code: string;
|
|
@@ -638,6 +654,10 @@ export interface DropshipperOrderTimelineEvent {
|
|
|
638
654
|
description: string;
|
|
639
655
|
type: "info" | "success" | "warning" | "error";
|
|
640
656
|
timestamp: string;
|
|
657
|
+
/** Amount in minor units of `currency_code` (payment/refund events). */
|
|
658
|
+
amount?: number;
|
|
659
|
+
/** Currency the `amount` is expressed in (payment/refund events). */
|
|
660
|
+
currency_code?: string;
|
|
641
661
|
}
|
|
642
662
|
|
|
643
663
|
/** Payment collection on an order */
|
|
@@ -869,7 +889,17 @@ export interface DropshipperOrderFulfillment {
|
|
|
869
889
|
labels: DropshipperFulfillmentLabel[];
|
|
870
890
|
}
|
|
871
891
|
|
|
872
|
-
/**
|
|
892
|
+
/**
|
|
893
|
+
* Full order detail as returned by GET /admin/thor/dropshipper/orders/:id.
|
|
894
|
+
*
|
|
895
|
+
* All monetary fields across the payload (order totals, items, shipping
|
|
896
|
+
* methods, payment collections, returns, exchanges/claims, transactions,
|
|
897
|
+
* financial summary, timeline `amount`) are expressed in MINOR units of the
|
|
898
|
+
* order's `currency_code` (e.g. cents for two-decimal currencies; the raw
|
|
899
|
+
* integer for zero-decimal currencies such as JPY). Consumers must NOT apply
|
|
900
|
+
* a fixed `/100`; divide by `10^minorDigits(currencyCode)` only at the
|
|
901
|
+
* presentation boundary.
|
|
902
|
+
*/
|
|
873
903
|
export interface DropshipperOrderDetail {
|
|
874
904
|
id: string;
|
|
875
905
|
display_id: number;
|
package/src/auth.ts
CHANGED
|
@@ -245,6 +245,7 @@ export interface SubmitApplicationBody {
|
|
|
245
245
|
selfie_url: string;
|
|
246
246
|
additional_comments?: string | null;
|
|
247
247
|
consent: boolean;
|
|
248
|
+
turnstile_token: string;
|
|
248
249
|
}
|
|
249
250
|
|
|
250
251
|
/**
|
|
@@ -293,6 +294,7 @@ export type SubmitApplicationResult =
|
|
|
293
294
|
| { ok: true; application: SubmitApplicationCreated }
|
|
294
295
|
| { ok: false; reason: 'conflict'; application: SubmitApplicationConflictApplication }
|
|
295
296
|
| { ok: false; reason: 'rate_limited'; retryAfterSeconds: number }
|
|
297
|
+
| { ok: false; reason: 'challenge_failed'; message?: string }
|
|
296
298
|
| { ok: false; reason: 'invalid_data'; fields?: Record<string, string[]> };
|
|
297
299
|
|
|
298
300
|
/**
|