@51eat/sdk 0.0.51 → 0.0.53

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.
Files changed (140) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +17 -12
  4. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +33 -0
  5. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +123 -0
  6. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.ts +10 -0
  7. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.js +3 -0
  8. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.d.ts +12 -0
  9. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.js +3 -0
  10. package/dist/cjs/api/resources/business/resources/productOrders/client/requests/index.d.ts +2 -0
  11. package/dist/cjs/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.d.ts +4 -0
  12. package/dist/cjs/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.js +3 -0
  13. package/dist/cjs/api/resources/business/resources/productOrders/types/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/business/resources/productOrders/types/index.js +1 -0
  15. package/dist/cjs/api/resources/businessShipping/client/Client.d.ts +138 -0
  16. package/dist/cjs/api/resources/businessShipping/client/Client.js +566 -0
  17. package/dist/cjs/api/resources/businessShipping/client/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/businessShipping/client/index.js +17 -0
  19. package/dist/cjs/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.d.ts +10 -0
  20. package/dist/cjs/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.js +3 -0
  21. package/dist/cjs/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.d.ts +12 -0
  22. package/dist/cjs/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.js +3 -0
  23. package/dist/cjs/api/resources/businessShipping/client/requests/StoreShippingRateRequest.d.ts +23 -0
  24. package/dist/cjs/api/resources/businessShipping/client/requests/StoreShippingRateRequest.js +11 -0
  25. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.d.ts +9 -0
  26. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.js +3 -0
  27. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.ts +26 -0
  28. package/dist/cjs/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.js +11 -0
  29. package/dist/cjs/api/resources/businessShipping/client/requests/index.d.ts +5 -0
  30. package/dist/cjs/api/resources/businessShipping/client/requests/index.js +7 -0
  31. package/dist/cjs/api/resources/businessShipping/exports.d.ts +2 -0
  32. package/dist/cjs/api/resources/businessShipping/exports.js +21 -0
  33. package/dist/cjs/api/resources/businessShipping/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/businessShipping/index.js +18 -0
  35. package/dist/cjs/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.d.ts +4 -0
  36. package/dist/cjs/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.js +3 -0
  37. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.d.ts +6 -0
  38. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.js +3 -0
  39. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.d.ts +3 -0
  40. package/dist/cjs/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.js +3 -0
  41. package/dist/cjs/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.d.ts +4 -0
  42. package/dist/cjs/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.js +3 -0
  43. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.d.ts +4 -0
  44. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.js +3 -0
  45. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.d.ts +4 -0
  46. package/dist/cjs/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.js +3 -0
  47. package/dist/cjs/api/resources/businessShipping/types/index.d.ts +6 -0
  48. package/dist/cjs/api/resources/businessShipping/types/index.js +22 -0
  49. package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +44 -0
  50. package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +131 -0
  51. package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.d.ts +28 -0
  52. package/dist/cjs/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.js +3 -0
  53. package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.d.ts +12 -0
  54. package/dist/cjs/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.js +3 -0
  55. package/dist/cjs/api/resources/customer/resources/cart/client/requests/index.d.ts +2 -0
  56. package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.ts +11 -0
  57. package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.js +3 -0
  58. package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/customer/resources/cart/types/index.js +1 -0
  60. package/dist/cjs/api/resources/index.d.ts +3 -0
  61. package/dist/cjs/api/resources/index.js +4 -1
  62. package/dist/cjs/api/types/ShippingAccountResource.d.ts +10 -0
  63. package/dist/cjs/api/types/ShippingAccountResource.js +3 -0
  64. package/dist/cjs/api/types/ShippingRateResource.d.ts +12 -0
  65. package/dist/cjs/api/types/ShippingRateResource.js +3 -0
  66. package/dist/cjs/api/types/index.d.ts +2 -0
  67. package/dist/cjs/api/types/index.js +2 -0
  68. package/dist/cjs/version.d.ts +1 -1
  69. package/dist/cjs/version.js +1 -1
  70. package/dist/esm/BaseClient.mjs +2 -2
  71. package/dist/esm/Client.d.mts +3 -0
  72. package/dist/esm/Client.mjs +5 -0
  73. package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +33 -0
  74. package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +123 -0
  75. package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.d.mts +10 -0
  76. package/dist/esm/api/resources/business/resources/productOrders/client/requests/GetLabelRatesProductOrdersRequest.mjs +2 -0
  77. package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.d.mts +12 -0
  78. package/dist/esm/api/resources/business/resources/productOrders/client/requests/PurchaseLabelRequest.mjs +2 -0
  79. package/dist/esm/api/resources/business/resources/productOrders/client/requests/index.d.mts +2 -0
  80. package/dist/esm/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.d.mts +4 -0
  81. package/dist/esm/api/resources/business/resources/productOrders/types/PurchaseLabelProductOrdersResponse.mjs +2 -0
  82. package/dist/esm/api/resources/business/resources/productOrders/types/index.d.mts +1 -0
  83. package/dist/esm/api/resources/business/resources/productOrders/types/index.mjs +1 -0
  84. package/dist/esm/api/resources/businessShipping/client/Client.d.mts +138 -0
  85. package/dist/esm/api/resources/businessShipping/client/Client.mjs +529 -0
  86. package/dist/esm/api/resources/businessShipping/client/index.d.mts +1 -0
  87. package/dist/esm/api/resources/businessShipping/client/index.mjs +1 -0
  88. package/dist/esm/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.d.mts +10 -0
  89. package/dist/esm/api/resources/businessShipping/client/requests/DeleteBusinessShippingRateRequest.mjs +2 -0
  90. package/dist/esm/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.d.mts +12 -0
  91. package/dist/esm/api/resources/businessShipping/client/requests/SetupShippingAccountRequest.mjs +2 -0
  92. package/dist/esm/api/resources/businessShipping/client/requests/StoreShippingRateRequest.d.mts +23 -0
  93. package/dist/esm/api/resources/businessShipping/client/requests/StoreShippingRateRequest.mjs +8 -0
  94. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.d.mts +9 -0
  95. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingAccountRequest.mjs +2 -0
  96. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.d.mts +26 -0
  97. package/dist/esm/api/resources/businessShipping/client/requests/UpdateShippingRateRequest.mjs +8 -0
  98. package/dist/esm/api/resources/businessShipping/client/requests/index.d.mts +5 -0
  99. package/dist/esm/api/resources/businessShipping/client/requests/index.mjs +2 -0
  100. package/dist/esm/api/resources/businessShipping/exports.d.mts +2 -0
  101. package/dist/esm/api/resources/businessShipping/exports.mjs +3 -0
  102. package/dist/esm/api/resources/businessShipping/index.d.mts +2 -0
  103. package/dist/esm/api/resources/businessShipping/index.mjs +2 -0
  104. package/dist/esm/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.d.mts +4 -0
  105. package/dist/esm/api/resources/businessShipping/types/CreateBusinessShippingRateResponse.mjs +2 -0
  106. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.d.mts +6 -0
  107. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingAccountResponse.mjs +2 -0
  108. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.d.mts +3 -0
  109. package/dist/esm/api/resources/businessShipping/types/GetBusinessShippingSetupIntentResponse.mjs +2 -0
  110. package/dist/esm/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.d.mts +4 -0
  111. package/dist/esm/api/resources/businessShipping/types/ListBusinessShippingRatesResponse.mjs +2 -0
  112. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.d.mts +4 -0
  113. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingAccountResponse.mjs +2 -0
  114. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.d.mts +4 -0
  115. package/dist/esm/api/resources/businessShipping/types/UpdateBusinessShippingRateResponse.mjs +2 -0
  116. package/dist/esm/api/resources/businessShipping/types/index.d.mts +6 -0
  117. package/dist/esm/api/resources/businessShipping/types/index.mjs +6 -0
  118. package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +44 -0
  119. package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +131 -0
  120. package/dist/esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.d.mts +28 -0
  121. package/dist/esm/api/resources/customer/resources/cart/client/requests/GetShippingOptionsRequest.mjs +2 -0
  122. package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.d.mts +12 -0
  123. package/dist/esm/api/resources/customer/resources/cart/client/requests/SelectShippingOptionRequest.mjs +2 -0
  124. package/dist/esm/api/resources/customer/resources/cart/client/requests/index.d.mts +2 -0
  125. package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.mts +11 -0
  126. package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.mjs +2 -0
  127. package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +1 -0
  128. package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +1 -0
  129. package/dist/esm/api/resources/index.d.mts +3 -0
  130. package/dist/esm/api/resources/index.mjs +3 -0
  131. package/dist/esm/api/types/ShippingAccountResource.d.mts +10 -0
  132. package/dist/esm/api/types/ShippingAccountResource.mjs +2 -0
  133. package/dist/esm/api/types/ShippingRateResource.d.mts +12 -0
  134. package/dist/esm/api/types/ShippingRateResource.mjs +2 -0
  135. package/dist/esm/api/types/index.d.mts +2 -0
  136. package/dist/esm/api/types/index.mjs +2 -0
  137. package/dist/esm/version.d.mts +1 -1
  138. package/dist/esm/version.mjs +1 -1
  139. package/package.json +12 -1
  140. package/reference.md +696 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@51eat/sdk",
46
- "X-Fern-SDK-Version": "0.0.51",
47
- "User-Agent": "@51eat/sdk/0.0.51",
46
+ "X-Fern-SDK-Version": "0.0.53",
47
+ "User-Agent": "@51eat/sdk/0.0.53",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,6 +1,7 @@
1
1
  import { BusinessClient } from "./api/resources/business/client/Client.js";
2
2
  import { BusinessMessagingClient } from "./api/resources/businessMessaging/client/Client.js";
3
3
  import { BusinessProductsClient } from "./api/resources/businessProducts/client/Client.js";
4
+ import { BusinessShippingClient } from "./api/resources/businessShipping/client/Client.js";
4
5
  import { CustomerClient } from "./api/resources/customer/client/Client.js";
5
6
  import { CustomerEventsClient } from "./api/resources/customerEvents/client/Client.js";
6
7
  import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.js";
@@ -19,6 +20,7 @@ export declare class FiveOneEatClient {
19
20
  protected readonly _options: NormalizedClientOptionsWithAuth<FiveOneEatClient.Options>;
20
21
  protected _businessMessaging: BusinessMessagingClient | undefined;
21
22
  protected _businessProducts: BusinessProductsClient | undefined;
23
+ protected _businessShipping: BusinessShippingClient | undefined;
22
24
  protected _customerEvents: CustomerEventsClient | undefined;
23
25
  protected _customerMessaging: CustomerMessagingClient | undefined;
24
26
  protected _customerMyAccount: CustomerMyAccountClient | undefined;
@@ -29,6 +31,7 @@ export declare class FiveOneEatClient {
29
31
  constructor(options?: FiveOneEatClient.Options);
30
32
  get businessMessaging(): BusinessMessagingClient;
31
33
  get businessProducts(): BusinessProductsClient;
34
+ get businessShipping(): BusinessShippingClient;
32
35
  get customerEvents(): CustomerEventsClient;
33
36
  get customerMessaging(): CustomerMessagingClient;
34
37
  get customerMyAccount(): CustomerMyAccountClient;
@@ -47,12 +47,13 @@ exports.FiveOneEatClient = void 0;
47
47
  const Client_js_1 = require("./api/resources/business/client/Client.js");
48
48
  const Client_js_2 = require("./api/resources/businessMessaging/client/Client.js");
49
49
  const Client_js_3 = require("./api/resources/businessProducts/client/Client.js");
50
- const Client_js_4 = require("./api/resources/customer/client/Client.js");
51
- const Client_js_5 = require("./api/resources/customerEvents/client/Client.js");
52
- const Client_js_6 = require("./api/resources/customerMessaging/client/Client.js");
53
- const Client_js_7 = require("./api/resources/customerMyAccount/client/Client.js");
54
- const Client_js_8 = require("./api/resources/recordClick/client/Client.js");
55
- const Client_js_9 = require("./api/resources/serveAd/client/Client.js");
50
+ const Client_js_4 = require("./api/resources/businessShipping/client/Client.js");
51
+ const Client_js_5 = require("./api/resources/customer/client/Client.js");
52
+ const Client_js_6 = require("./api/resources/customerEvents/client/Client.js");
53
+ const Client_js_7 = require("./api/resources/customerMessaging/client/Client.js");
54
+ const Client_js_8 = require("./api/resources/customerMyAccount/client/Client.js");
55
+ const Client_js_9 = require("./api/resources/recordClick/client/Client.js");
56
+ const Client_js_10 = require("./api/resources/serveAd/client/Client.js");
56
57
  const BaseClient_js_1 = require("./BaseClient.js");
57
58
  const core = __importStar(require("./core/index.js"));
58
59
  class FiveOneEatClient {
@@ -67,29 +68,33 @@ class FiveOneEatClient {
67
68
  var _a;
68
69
  return ((_a = this._businessProducts) !== null && _a !== void 0 ? _a : (this._businessProducts = new Client_js_3.BusinessProductsClient(this._options)));
69
70
  }
71
+ get businessShipping() {
72
+ var _a;
73
+ return ((_a = this._businessShipping) !== null && _a !== void 0 ? _a : (this._businessShipping = new Client_js_4.BusinessShippingClient(this._options)));
74
+ }
70
75
  get customerEvents() {
71
76
  var _a;
72
- return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new Client_js_5.CustomerEventsClient(this._options)));
77
+ return ((_a = this._customerEvents) !== null && _a !== void 0 ? _a : (this._customerEvents = new Client_js_6.CustomerEventsClient(this._options)));
73
78
  }
74
79
  get customerMessaging() {
75
80
  var _a;
76
- return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new Client_js_6.CustomerMessagingClient(this._options)));
81
+ return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new Client_js_7.CustomerMessagingClient(this._options)));
77
82
  }
78
83
  get customerMyAccount() {
79
84
  var _a;
80
- return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new Client_js_7.CustomerMyAccountClient(this._options)));
85
+ return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new Client_js_8.CustomerMyAccountClient(this._options)));
81
86
  }
82
87
  get customer() {
83
88
  var _a;
84
- return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new Client_js_4.CustomerClient(this._options)));
89
+ return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new Client_js_5.CustomerClient(this._options)));
85
90
  }
86
91
  get recordClick() {
87
92
  var _a;
88
- return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_8.RecordClickClient(this._options)));
93
+ return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new Client_js_9.RecordClickClient(this._options)));
89
94
  }
90
95
  get serveAd() {
91
96
  var _a;
92
- return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_9.ServeAdClient(this._options)));
97
+ return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new Client_js_10.ServeAdClient(this._options)));
93
98
  }
94
99
  get business() {
95
100
  var _a;
@@ -106,4 +106,37 @@ export declare class ProductOrdersClient {
106
106
  */
107
107
  refund(request: FiveOneEat.business.RefundOrderRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.RefundProductOrdersResponse>;
108
108
  private __refund;
109
+ /**
110
+ * @param {FiveOneEat.business.GetLabelRatesProductOrdersRequest} request
111
+ * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
112
+ *
113
+ * @throws {@link FiveOneEat.UnauthorizedError}
114
+ * @throws {@link FiveOneEat.ForbiddenError}
115
+ * @throws {@link FiveOneEat.NotFoundError}
116
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
117
+ *
118
+ * @example
119
+ * await client.business.productOrders.getLabelRates({
120
+ * productOrder: "productOrder"
121
+ * })
122
+ */
123
+ getLabelRates(request: FiveOneEat.business.GetLabelRatesProductOrdersRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<string>;
124
+ private __getLabelRates;
125
+ /**
126
+ * @param {FiveOneEat.business.PurchaseLabelRequest} request
127
+ * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
128
+ *
129
+ * @throws {@link FiveOneEat.UnauthorizedError}
130
+ * @throws {@link FiveOneEat.ForbiddenError}
131
+ * @throws {@link FiveOneEat.NotFoundError}
132
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
133
+ *
134
+ * @example
135
+ * await client.business.productOrders.purchaseLabel({
136
+ * productOrder: "productOrder",
137
+ * provider_rate_id: "provider_rate_id"
138
+ * })
139
+ */
140
+ purchaseLabel(request: FiveOneEat.business.PurchaseLabelRequest, requestOptions?: ProductOrdersClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.PurchaseLabelProductOrdersResponse>;
141
+ private __purchaseLabel;
109
142
  }
@@ -425,5 +425,128 @@ class ProductOrdersClient {
425
425
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/product-orders/{productOrder}/refund");
426
426
  });
427
427
  }
428
+ /**
429
+ * @param {FiveOneEat.business.GetLabelRatesProductOrdersRequest} request
430
+ * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
431
+ *
432
+ * @throws {@link FiveOneEat.UnauthorizedError}
433
+ * @throws {@link FiveOneEat.ForbiddenError}
434
+ * @throws {@link FiveOneEat.NotFoundError}
435
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
436
+ *
437
+ * @example
438
+ * await client.business.productOrders.getLabelRates({
439
+ * productOrder: "productOrder"
440
+ * })
441
+ */
442
+ getLabelRates(request, requestOptions) {
443
+ return core.HttpResponsePromise.fromPromise(this.__getLabelRates(request, requestOptions));
444
+ }
445
+ __getLabelRates(request, requestOptions) {
446
+ return __awaiter(this, void 0, void 0, function* () {
447
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
448
+ const { productOrder } = request;
449
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
450
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
451
+ const _response = yield core.fetcher({
452
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/product-orders/${core.url.encodePathParam(productOrder)}/label-rates`),
453
+ method: "GET",
454
+ headers: _headers,
455
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
456
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
457
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
458
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
459
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
460
+ logging: this._options.logging,
461
+ });
462
+ if (_response.ok) {
463
+ return { data: _response.body, rawResponse: _response.rawResponse };
464
+ }
465
+ if (_response.error.reason === "status-code") {
466
+ switch (_response.error.statusCode) {
467
+ case 401:
468
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
469
+ case 403:
470
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
471
+ case 404:
472
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
473
+ case 422:
474
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
475
+ default:
476
+ throw new errors.FiveOneEatError({
477
+ statusCode: _response.error.statusCode,
478
+ body: _response.error.body,
479
+ rawResponse: _response.rawResponse,
480
+ });
481
+ }
482
+ }
483
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/product-orders/{productOrder}/label-rates");
484
+ });
485
+ }
486
+ /**
487
+ * @param {FiveOneEat.business.PurchaseLabelRequest} request
488
+ * @param {ProductOrdersClient.RequestOptions} requestOptions - Request-specific configuration.
489
+ *
490
+ * @throws {@link FiveOneEat.UnauthorizedError}
491
+ * @throws {@link FiveOneEat.ForbiddenError}
492
+ * @throws {@link FiveOneEat.NotFoundError}
493
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
494
+ *
495
+ * @example
496
+ * await client.business.productOrders.purchaseLabel({
497
+ * productOrder: "productOrder",
498
+ * provider_rate_id: "provider_rate_id"
499
+ * })
500
+ */
501
+ purchaseLabel(request, requestOptions) {
502
+ return core.HttpResponsePromise.fromPromise(this.__purchaseLabel(request, requestOptions));
503
+ }
504
+ __purchaseLabel(request, requestOptions) {
505
+ return __awaiter(this, void 0, void 0, function* () {
506
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
507
+ const { productOrder } = request, _body = __rest(request, ["productOrder"]);
508
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
509
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
510
+ const _response = yield core.fetcher({
511
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/product-orders/${core.url.encodePathParam(productOrder)}/purchase-label`),
512
+ method: "POST",
513
+ headers: _headers,
514
+ contentType: "application/json",
515
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
516
+ requestType: "json",
517
+ body: _body,
518
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
519
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
520
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
521
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
522
+ logging: this._options.logging,
523
+ });
524
+ if (_response.ok) {
525
+ return {
526
+ data: _response.body,
527
+ rawResponse: _response.rawResponse,
528
+ };
529
+ }
530
+ if (_response.error.reason === "status-code") {
531
+ switch (_response.error.statusCode) {
532
+ case 401:
533
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
534
+ case 403:
535
+ throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
536
+ case 404:
537
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
538
+ case 422:
539
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
540
+ default:
541
+ throw new errors.FiveOneEatError({
542
+ statusCode: _response.error.statusCode,
543
+ body: _response.error.body,
544
+ rawResponse: _response.rawResponse,
545
+ });
546
+ }
547
+ }
548
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/product-orders/{productOrder}/purchase-label");
549
+ });
550
+ }
428
551
  }
429
552
  exports.ProductOrdersClient = ProductOrdersClient;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * productOrder: "productOrder"
5
+ * }
6
+ */
7
+ export interface GetLabelRatesProductOrdersRequest {
8
+ /** The product order ID */
9
+ productOrder: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * productOrder: "productOrder",
5
+ * provider_rate_id: "provider_rate_id"
6
+ * }
7
+ */
8
+ export interface PurchaseLabelRequest {
9
+ /** The product order ID */
10
+ productOrder: string;
11
+ provider_rate_id: string;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,7 @@
1
1
  export type { FulfillProductOrdersRequest } from "./FulfillProductOrdersRequest.js";
2
+ export type { GetLabelRatesProductOrdersRequest } from "./GetLabelRatesProductOrdersRequest.js";
2
3
  export type { GetProductOrdersRequest } from "./GetProductOrdersRequest.js";
3
4
  export type { MarkPickedUpProductOrdersRequest } from "./MarkPickedUpProductOrdersRequest.js";
5
+ export type { PurchaseLabelRequest } from "./PurchaseLabelRequest.js";
4
6
  export type { RefundOrderRequest } from "./RefundOrderRequest.js";
5
7
  export type { StoreTrackingRequest } from "./StoreTrackingRequest.js";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../../../index.js";
2
+ export interface PurchaseLabelProductOrdersResponse {
3
+ data: FiveOneEat.BusinessProductOrder;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,4 +3,5 @@ export * from "./FulfillProductOrdersResponse.js";
3
3
  export * from "./GetProductOrdersResponse.js";
4
4
  export * from "./ListProductOrdersResponse.js";
5
5
  export * from "./MarkPickedUpProductOrdersResponse.js";
6
+ export * from "./PurchaseLabelProductOrdersResponse.js";
6
7
  export * from "./RefundProductOrdersResponse.js";
@@ -19,4 +19,5 @@ __exportStar(require("./FulfillProductOrdersResponse.js"), exports);
19
19
  __exportStar(require("./GetProductOrdersResponse.js"), exports);
20
20
  __exportStar(require("./ListProductOrdersResponse.js"), exports);
21
21
  __exportStar(require("./MarkPickedUpProductOrdersResponse.js"), exports);
22
+ __exportStar(require("./PurchaseLabelProductOrdersResponse.js"), exports);
22
23
  __exportStar(require("./RefundProductOrdersResponse.js"), exports);
@@ -0,0 +1,138 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as FiveOneEat from "../../../index.js";
5
+ export declare namespace BusinessShippingClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class BusinessShippingClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<BusinessShippingClient.Options>;
12
+ constructor(options?: BusinessShippingClient.Options);
13
+ /**
14
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
15
+ *
16
+ * @throws {@link FiveOneEat.UnauthorizedError}
17
+ *
18
+ * @example
19
+ * await client.businessShipping.getBusinessShippingAccount()
20
+ */
21
+ getBusinessShippingAccount(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetBusinessShippingAccountResponse>;
22
+ private __getBusinessShippingAccount;
23
+ /**
24
+ * Use the returned client_secret with the Stripe mobile SDK to collect
25
+ * a payment method for label billing. Pass the resulting pm_* ID to
26
+ * POST /shipping/account.
27
+ *
28
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link FiveOneEat.UnauthorizedError}
31
+ *
32
+ * @example
33
+ * await client.businessShipping.getBusinessShippingSetupIntent()
34
+ */
35
+ getBusinessShippingSetupIntent(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetBusinessShippingSetupIntentResponse>;
36
+ private __getBusinessShippingSetupIntent;
37
+ /**
38
+ * Creates a Stripe Customer for label billing, attaches the provided
39
+ * payment method, and upserts the ShippingAccount record.
40
+ *
41
+ * @param {FiveOneEat.SetupShippingAccountRequest} request
42
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
43
+ *
44
+ * @throws {@link FiveOneEat.UnauthorizedError}
45
+ * @throws {@link FiveOneEat.ForbiddenError}
46
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
47
+ *
48
+ * @example
49
+ * await client.businessShipping.setupBusinessShippingAccount({
50
+ * payment_method_id: "payment_method_id"
51
+ * })
52
+ */
53
+ setupBusinessShippingAccount(request: FiveOneEat.SetupShippingAccountRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<string>;
54
+ private __setupBusinessShippingAccount;
55
+ /**
56
+ * @param {FiveOneEat.UpdateShippingAccountRequest} request
57
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link FiveOneEat.UnauthorizedError}
60
+ * @throws {@link FiveOneEat.ForbiddenError}
61
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
62
+ *
63
+ * @example
64
+ * await client.businessShipping.updateBusinessShippingAccount()
65
+ */
66
+ updateBusinessShippingAccount(request?: FiveOneEat.UpdateShippingAccountRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.UpdateBusinessShippingAccountResponse>;
67
+ private __updateBusinessShippingAccount;
68
+ /**
69
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
70
+ *
71
+ * @throws {@link FiveOneEat.UnauthorizedError}
72
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
73
+ *
74
+ * @example
75
+ * await client.businessShipping.deleteBusinessShippingAccount()
76
+ */
77
+ deleteBusinessShippingAccount(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<void>;
78
+ private __deleteBusinessShippingAccount;
79
+ /**
80
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
81
+ *
82
+ * @throws {@link FiveOneEat.UnauthorizedError}
83
+ *
84
+ * @example
85
+ * await client.businessShipping.listBusinessShippingRates()
86
+ */
87
+ listBusinessShippingRates(requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.ListBusinessShippingRatesResponse>;
88
+ private __listBusinessShippingRates;
89
+ /**
90
+ * @param {FiveOneEat.StoreShippingRateRequest} request
91
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
92
+ *
93
+ * @throws {@link FiveOneEat.UnauthorizedError}
94
+ * @throws {@link FiveOneEat.ForbiddenError}
95
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
96
+ *
97
+ * @example
98
+ * await client.businessShipping.createBusinessShippingRate({
99
+ * name: "name",
100
+ * rate_type: "flat"
101
+ * })
102
+ */
103
+ createBusinessShippingRate(request: FiveOneEat.StoreShippingRateRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.CreateBusinessShippingRateResponse>;
104
+ private __createBusinessShippingRate;
105
+ /**
106
+ * @param {FiveOneEat.UpdateShippingRateRequest} request
107
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
108
+ *
109
+ * @throws {@link FiveOneEat.UnauthorizedError}
110
+ * @throws {@link FiveOneEat.ForbiddenError}
111
+ * @throws {@link FiveOneEat.NotFoundError}
112
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
113
+ *
114
+ * @example
115
+ * await client.businessShipping.updateBusinessShippingRate({
116
+ * shippingRate: "shippingRate",
117
+ * name: "name",
118
+ * rate_type: "flat"
119
+ * })
120
+ */
121
+ updateBusinessShippingRate(request: FiveOneEat.UpdateShippingRateRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.UpdateBusinessShippingRateResponse>;
122
+ private __updateBusinessShippingRate;
123
+ /**
124
+ * @param {FiveOneEat.DeleteBusinessShippingRateRequest} request
125
+ * @param {BusinessShippingClient.RequestOptions} requestOptions - Request-specific configuration.
126
+ *
127
+ * @throws {@link FiveOneEat.UnauthorizedError}
128
+ * @throws {@link FiveOneEat.ForbiddenError}
129
+ * @throws {@link FiveOneEat.NotFoundError}
130
+ *
131
+ * @example
132
+ * await client.businessShipping.deleteBusinessShippingRate({
133
+ * shippingRate: "shippingRate"
134
+ * })
135
+ */
136
+ deleteBusinessShippingRate(request: FiveOneEat.DeleteBusinessShippingRateRequest, requestOptions?: BusinessShippingClient.RequestOptions): core.HttpResponsePromise<void>;
137
+ private __deleteBusinessShippingRate;
138
+ }