@51eat/sdk 0.0.54 → 0.0.56

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 (156) 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 +15 -10
  4. package/dist/cjs/api/resources/business/resources/discounts/client/requests/StoreDiscountRequest.d.ts +2 -2
  5. package/dist/cjs/api/resources/business/resources/discounts/client/requests/UpdateDiscountRequest.d.ts +2 -2
  6. package/dist/cjs/api/resources/business/resources/productCategories/client/requests/StoreProductCategoryRequest.d.ts +1 -1
  7. package/dist/cjs/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.ts +1 -1
  8. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.d.ts +1 -1
  9. package/dist/cjs/api/resources/business/resources/productOrders/client/Client.js +4 -1
  10. package/dist/cjs/api/resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.d.ts +10 -0
  11. package/dist/cjs/api/resources/business/resources/productOrders/types/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/business/resources/productOrders/types/index.js +1 -0
  13. package/dist/cjs/api/resources/business/resources/products/client/requests/StoreProductRequest.d.ts +1 -1
  14. package/dist/cjs/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.ts +1 -1
  15. package/dist/cjs/api/resources/business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts +3 -3
  16. package/dist/cjs/api/resources/business/resources/stripeConnect/types/CreateAccountSessionStripeConnectResponse.d.ts +1 -1
  17. package/dist/cjs/api/resources/businessProducts/client/requests/AdjustInventoryRequest.d.ts +2 -10
  18. package/dist/cjs/api/resources/businessProducts/client/requests/AdjustInventoryRequest.js +0 -8
  19. package/dist/cjs/api/resources/customer/resources/businesses/client/Client.d.ts +13 -1
  20. package/dist/cjs/api/resources/customer/resources/businesses/client/Client.js +46 -1
  21. package/dist/cjs/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.d.ts +9 -0
  22. package/dist/cjs/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.js +3 -0
  23. package/dist/cjs/api/resources/customer/resources/businesses/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/customer/resources/cart/client/Client.d.ts +2 -2
  25. package/dist/cjs/api/resources/customer/resources/cart/client/Client.js +5 -2
  26. package/dist/cjs/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.ts +3 -3
  27. package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.d.ts +19 -0
  28. package/dist/cjs/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.js +3 -0
  29. package/dist/cjs/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.ts +2 -7
  30. package/dist/cjs/api/resources/customer/resources/cart/types/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/customer/resources/cart/types/index.js +1 -0
  32. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/CalculatePriceTicketingResponse.d.ts +13 -1
  33. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/ConfirmOrderTicketingResponse.d.ts +3 -3
  34. package/dist/cjs/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.ts +13 -2
  35. package/dist/cjs/api/resources/customer/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts +3 -3
  36. package/dist/cjs/api/resources/customerBusinesses/client/Client.d.ts +30 -0
  37. package/dist/cjs/api/resources/customerBusinesses/client/Client.js +125 -0
  38. package/dist/cjs/api/resources/customerBusinesses/client/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/customerBusinesses/client/index.js +17 -0
  40. package/dist/cjs/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.d.ts +12 -0
  41. package/dist/cjs/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.js +3 -0
  42. package/dist/cjs/api/resources/customerBusinesses/client/requests/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/customerBusinesses/client/requests/index.js +2 -0
  44. package/dist/cjs/api/resources/customerBusinesses/exports.d.ts +2 -0
  45. package/dist/cjs/api/resources/customerBusinesses/exports.js +21 -0
  46. package/dist/cjs/api/resources/customerBusinesses/index.d.ts +2 -0
  47. package/dist/cjs/api/resources/customerBusinesses/index.js +18 -0
  48. package/dist/cjs/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.d.ts +7 -0
  49. package/dist/cjs/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.js +3 -0
  50. package/dist/cjs/api/resources/customerBusinesses/types/index.d.ts +1 -0
  51. package/dist/cjs/api/resources/customerBusinesses/types/index.js +17 -0
  52. package/dist/cjs/api/resources/customerMyAccount/client/Client.d.ts +16 -0
  53. package/dist/cjs/api/resources/customerMyAccount/client/Client.js +54 -0
  54. package/dist/cjs/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.d.ts +9 -0
  55. package/dist/cjs/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.js +3 -0
  56. package/dist/cjs/api/resources/customerMyAccount/client/requests/index.d.ts +1 -0
  57. package/dist/cjs/api/resources/index.d.ts +3 -0
  58. package/dist/cjs/api/resources/index.js +4 -1
  59. package/dist/cjs/api/resources/serveAd/client/Client.d.ts +1 -1
  60. package/dist/cjs/api/resources/serveAd/client/Client.js +4 -1
  61. package/dist/cjs/api/resources/serveAd/types/AdsServeAdResponse.d.ts +2 -2
  62. package/dist/cjs/api/types/Ad.d.ts +1 -4
  63. package/dist/cjs/api/types/BusinessConversation.d.ts +1 -1
  64. package/dist/cjs/api/types/BusinessEventCheckInStats.d.ts +1 -1
  65. package/dist/cjs/api/types/BusinessEventSalesSummary.d.ts +1 -1
  66. package/dist/cjs/api/types/BusinessMenuItem.d.ts +22 -2
  67. package/dist/cjs/api/types/Conversation.d.ts +1 -1
  68. package/dist/cjs/api/types/CustomerProductOrderItem.d.ts +10 -1
  69. package/dist/cjs/api/types/InventoryChangeType.d.ts +9 -0
  70. package/dist/cjs/api/types/InventoryChangeType.js +12 -0
  71. package/dist/cjs/api/types/Ticket.d.ts +1 -0
  72. package/dist/cjs/api/types/index.d.ts +1 -1
  73. package/dist/cjs/api/types/index.js +1 -1
  74. package/dist/cjs/version.d.ts +1 -1
  75. package/dist/cjs/version.js +1 -1
  76. package/dist/esm/BaseClient.mjs +2 -2
  77. package/dist/esm/Client.d.mts +3 -0
  78. package/dist/esm/Client.mjs +5 -0
  79. package/dist/esm/api/resources/business/resources/discounts/client/requests/StoreDiscountRequest.d.mts +2 -2
  80. package/dist/esm/api/resources/business/resources/discounts/client/requests/UpdateDiscountRequest.d.mts +2 -2
  81. package/dist/esm/api/resources/business/resources/productCategories/client/requests/StoreProductCategoryRequest.d.mts +1 -1
  82. package/dist/esm/api/resources/business/resources/productCategories/client/requests/UpdateProductCategoryRequest.d.mts +1 -1
  83. package/dist/esm/api/resources/business/resources/productOrders/client/Client.d.mts +1 -1
  84. package/dist/esm/api/resources/business/resources/productOrders/client/Client.mjs +4 -1
  85. package/dist/esm/api/resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.d.mts +10 -0
  86. package/dist/esm/api/resources/business/resources/productOrders/types/index.d.mts +1 -0
  87. package/dist/esm/api/resources/business/resources/productOrders/types/index.mjs +1 -0
  88. package/dist/esm/api/resources/business/resources/products/client/requests/StoreProductRequest.d.mts +1 -1
  89. package/dist/esm/api/resources/business/resources/products/client/requests/UpdateProductRequest.d.mts +1 -1
  90. package/dist/esm/api/resources/business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts +3 -3
  91. package/dist/esm/api/resources/business/resources/stripeConnect/types/CreateAccountSessionStripeConnectResponse.d.mts +1 -1
  92. package/dist/esm/api/resources/businessProducts/client/requests/AdjustInventoryRequest.d.mts +2 -10
  93. package/dist/esm/api/resources/businessProducts/client/requests/AdjustInventoryRequest.mjs +0 -8
  94. package/dist/esm/api/resources/customer/resources/businesses/client/Client.d.mts +13 -1
  95. package/dist/esm/api/resources/customer/resources/businesses/client/Client.mjs +46 -1
  96. package/dist/esm/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.d.mts +9 -0
  97. package/dist/esm/api/resources/customer/resources/businesses/client/requests/GetPickupTimeslotsBusinessesRequest.mjs +2 -0
  98. package/dist/esm/api/resources/customer/resources/businesses/client/requests/index.d.mts +1 -0
  99. package/dist/esm/api/resources/customer/resources/cart/client/Client.d.mts +2 -2
  100. package/dist/esm/api/resources/customer/resources/cart/client/Client.mjs +5 -2
  101. package/dist/esm/api/resources/customer/resources/cart/client/requests/AddToCartRequest.d.mts +3 -3
  102. package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.d.mts +19 -0
  103. package/dist/esm/api/resources/customer/resources/cart/types/GetShippingOptionsCartResponseItem.mjs +2 -0
  104. package/dist/esm/api/resources/customer/resources/cart/types/SelectShippingOptionCartResponse.d.mts +2 -7
  105. package/dist/esm/api/resources/customer/resources/cart/types/index.d.mts +1 -0
  106. package/dist/esm/api/resources/customer/resources/cart/types/index.mjs +1 -0
  107. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/CalculatePriceTicketingResponse.d.mts +13 -1
  108. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/ConfirmOrderTicketingResponse.d.mts +3 -3
  109. package/dist/esm/api/resources/customer/resources/events/resources/ticketing/types/HoldTicketsTicketingResponse.d.mts +13 -2
  110. package/dist/esm/api/resources/customer/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts +3 -3
  111. package/dist/esm/api/resources/customerBusinesses/client/Client.d.mts +30 -0
  112. package/dist/esm/api/resources/customerBusinesses/client/Client.mjs +88 -0
  113. package/dist/esm/api/resources/customerBusinesses/client/index.d.mts +1 -0
  114. package/dist/esm/api/resources/customerBusinesses/client/index.mjs +1 -0
  115. package/dist/esm/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.d.mts +12 -0
  116. package/dist/esm/api/resources/customerBusinesses/client/requests/GetBusinessPickupTimeslotsRequest.mjs +2 -0
  117. package/dist/esm/api/resources/customerBusinesses/client/requests/index.d.mts +1 -0
  118. package/dist/esm/api/resources/customerBusinesses/client/requests/index.mjs +1 -0
  119. package/dist/esm/api/resources/customerBusinesses/exports.d.mts +2 -0
  120. package/dist/esm/api/resources/customerBusinesses/exports.mjs +3 -0
  121. package/dist/esm/api/resources/customerBusinesses/index.d.mts +2 -0
  122. package/dist/esm/api/resources/customerBusinesses/index.mjs +2 -0
  123. package/dist/esm/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.d.mts +7 -0
  124. package/dist/esm/api/resources/customerBusinesses/types/GetBusinessPickupTimeslotsResponse.mjs +2 -0
  125. package/dist/esm/api/resources/customerBusinesses/types/index.d.mts +1 -0
  126. package/dist/esm/api/resources/customerBusinesses/types/index.mjs +1 -0
  127. package/dist/esm/api/resources/customerMyAccount/client/Client.d.mts +16 -0
  128. package/dist/esm/api/resources/customerMyAccount/client/Client.mjs +54 -0
  129. package/dist/esm/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.d.mts +9 -0
  130. package/dist/esm/api/resources/customerMyAccount/client/requests/DownloadAppleWalletPassRequest.mjs +2 -0
  131. package/dist/esm/api/resources/customerMyAccount/client/requests/index.d.mts +1 -0
  132. package/dist/esm/api/resources/index.d.mts +3 -0
  133. package/dist/esm/api/resources/index.mjs +3 -0
  134. package/dist/esm/api/resources/serveAd/client/Client.d.mts +1 -1
  135. package/dist/esm/api/resources/serveAd/client/Client.mjs +4 -1
  136. package/dist/esm/api/resources/serveAd/types/AdsServeAdResponse.d.mts +2 -2
  137. package/dist/esm/api/types/Ad.d.mts +1 -4
  138. package/dist/esm/api/types/BusinessConversation.d.mts +1 -1
  139. package/dist/esm/api/types/BusinessEventCheckInStats.d.mts +1 -1
  140. package/dist/esm/api/types/BusinessEventSalesSummary.d.mts +1 -1
  141. package/dist/esm/api/types/BusinessMenuItem.d.mts +22 -2
  142. package/dist/esm/api/types/Conversation.d.mts +1 -1
  143. package/dist/esm/api/types/CustomerProductOrderItem.d.mts +10 -1
  144. package/dist/esm/api/types/InventoryChangeType.d.mts +9 -0
  145. package/dist/esm/api/types/InventoryChangeType.mjs +9 -0
  146. package/dist/esm/api/types/Ticket.d.mts +1 -0
  147. package/dist/esm/api/types/index.d.mts +1 -1
  148. package/dist/esm/api/types/index.mjs +1 -1
  149. package/dist/esm/version.d.mts +1 -1
  150. package/dist/esm/version.mjs +1 -1
  151. package/package.json +12 -1
  152. package/reference.md +188 -5
  153. package/dist/cjs/api/types/JsonResource.d.ts +0 -1
  154. package/dist/esm/api/types/JsonResource.d.mts +0 -1
  155. /package/dist/cjs/api/{types/JsonResource.js → resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.js} +0 -0
  156. /package/dist/esm/api/{types/JsonResource.mjs → resources/business/resources/productOrders/types/GetLabelRatesProductOrdersResponseItem.mjs} +0 -0
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.CustomerBusinessesClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const FiveOneEat = __importStar(require("../../../index.js"));
54
+ class CustomerBusinessesClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Returns available pickup timeslots for a business on a given date.
60
+ *
61
+ * @param {FiveOneEat.GetBusinessPickupTimeslotsRequest} request
62
+ * @param {CustomerBusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link FiveOneEat.UnauthorizedError}
65
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
66
+ *
67
+ * @example
68
+ * await client.customerBusinesses.getBusinessPickupTimeslots({
69
+ * handle: "katzs-deli",
70
+ * date: "2023-01-15"
71
+ * })
72
+ */
73
+ getBusinessPickupTimeslots(request, requestOptions) {
74
+ return core.HttpResponsePromise.fromPromise(this.__getBusinessPickupTimeslots(request, requestOptions));
75
+ }
76
+ __getBusinessPickupTimeslots(request, requestOptions) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
79
+ const { handle, date } = request;
80
+ const _queryParams = {
81
+ date,
82
+ };
83
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
84
+ 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);
85
+ const _response = yield core.fetcher({
86
+ 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, `customer/businesses/${core.url.encodePathParam(handle)}/pickup-timeslots`),
87
+ method: "GET",
88
+ headers: _headers,
89
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
90
+ queryString: core.url
91
+ .queryBuilder()
92
+ .addMany(_queryParams)
93
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
94
+ .build(),
95
+ 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,
96
+ 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,
97
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
98
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
99
+ logging: this._options.logging,
100
+ });
101
+ if (_response.ok) {
102
+ return {
103
+ data: _response.body,
104
+ rawResponse: _response.rawResponse,
105
+ };
106
+ }
107
+ if (_response.error.reason === "status-code") {
108
+ switch (_response.error.statusCode) {
109
+ case 401:
110
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
111
+ case 422:
112
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
113
+ default:
114
+ throw new errors.FiveOneEatError({
115
+ statusCode: _response.error.statusCode,
116
+ body: _response.error.body,
117
+ rawResponse: _response.rawResponse,
118
+ });
119
+ }
120
+ }
121
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/businesses/{handle}/pickup-timeslots");
122
+ });
123
+ }
124
+ }
125
+ exports.CustomerBusinessesClient = CustomerBusinessesClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * handle: "katzs-deli",
5
+ * date: "2023-01-15"
6
+ * }
7
+ */
8
+ export interface GetBusinessPickupTimeslotsRequest {
9
+ /** The business handle */
10
+ handle: string;
11
+ date: 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 });
@@ -0,0 +1 @@
1
+ export type { GetBusinessPickupTimeslotsRequest } from "./GetBusinessPickupTimeslotsRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { CustomerBusinessesClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.CustomerBusinessesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "CustomerBusinessesClient", { enumerable: true, get: function () { return Client_js_1.CustomerBusinessesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,7 @@
1
+ export type GetBusinessPickupTimeslotsResponse = {
2
+ date?: unknown | undefined;
3
+ timeslots: string[];
4
+ } | {
5
+ date?: unknown | undefined;
6
+ timeslots: string[];
7
+ };
@@ -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 @@
1
+ export * from "./GetBusinessPickupTimeslotsResponse.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./GetBusinessPickupTimeslotsResponse.js"), exports);
@@ -25,6 +25,22 @@ export declare class CustomerMyAccountClient {
25
25
  */
26
26
  getMyTicket(request: FiveOneEat.GetMyTicketRequest, requestOptions?: CustomerMyAccountClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.GetMyTicketResponse>;
27
27
  private __getMyTicket;
28
+ /**
29
+ * Returns a signed .pkpass file for import into Apple Wallet.
30
+ *
31
+ * @param {FiveOneEat.DownloadAppleWalletPassRequest} request
32
+ * @param {CustomerMyAccountClient.RequestOptions} requestOptions - Request-specific configuration.
33
+ *
34
+ * @throws {@link FiveOneEat.UnauthorizedError}
35
+ * @throws {@link FiveOneEat.NotFoundError}
36
+ *
37
+ * @example
38
+ * await client.customerMyAccount.downloadAppleWalletPass({
39
+ * ticketId: "ticketId"
40
+ * })
41
+ */
42
+ downloadAppleWalletPass(request: FiveOneEat.DownloadAppleWalletPassRequest, requestOptions?: CustomerMyAccountClient.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
43
+ private __downloadAppleWalletPass;
28
44
  /**
29
45
  * Retrieve a single ticket order belonging to the authenticated user.
30
46
  *
@@ -106,6 +106,60 @@ class CustomerMyAccountClient {
106
106
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/tickets/{ticketId}");
107
107
  });
108
108
  }
109
+ /**
110
+ * Returns a signed .pkpass file for import into Apple Wallet.
111
+ *
112
+ * @param {FiveOneEat.DownloadAppleWalletPassRequest} request
113
+ * @param {CustomerMyAccountClient.RequestOptions} requestOptions - Request-specific configuration.
114
+ *
115
+ * @throws {@link FiveOneEat.UnauthorizedError}
116
+ * @throws {@link FiveOneEat.NotFoundError}
117
+ *
118
+ * @example
119
+ * await client.customerMyAccount.downloadAppleWalletPass({
120
+ * ticketId: "ticketId"
121
+ * })
122
+ */
123
+ downloadAppleWalletPass(request, requestOptions) {
124
+ return core.HttpResponsePromise.fromPromise(this.__downloadAppleWalletPass(request, requestOptions));
125
+ }
126
+ __downloadAppleWalletPass(request, requestOptions) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
129
+ const { ticketId } = request;
130
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
131
+ 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);
132
+ const _response = yield core.fetcher({
133
+ 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, `customer/tickets/${core.url.encodePathParam(ticketId)}/wallet/apple`),
134
+ method: "GET",
135
+ headers: _headers,
136
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
137
+ 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,
138
+ 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,
139
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
140
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
141
+ logging: this._options.logging,
142
+ });
143
+ if (_response.ok) {
144
+ return { data: _response.body, rawResponse: _response.rawResponse };
145
+ }
146
+ if (_response.error.reason === "status-code") {
147
+ switch (_response.error.statusCode) {
148
+ case 401:
149
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
150
+ case 404:
151
+ throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
152
+ default:
153
+ throw new errors.FiveOneEatError({
154
+ statusCode: _response.error.statusCode,
155
+ body: _response.error.body,
156
+ rawResponse: _response.rawResponse,
157
+ });
158
+ }
159
+ }
160
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/customer/tickets/{ticketId}/wallet/apple");
161
+ });
162
+ }
109
163
  /**
110
164
  * Retrieve a single ticket order belonging to the authenticated user.
111
165
  *
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * ticketId: "ticketId"
5
+ * }
6
+ */
7
+ export interface DownloadAppleWalletPassRequest {
8
+ ticketId: string;
9
+ }
@@ -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,2 +1,3 @@
1
+ export type { DownloadAppleWalletPassRequest } from "./DownloadAppleWalletPassRequest.js";
1
2
  export type { GetMyTicketOrderRequest } from "./GetMyTicketOrderRequest.js";
2
3
  export type { GetMyTicketRequest } from "./GetMyTicketRequest.js";
@@ -11,6 +11,9 @@ export * from "./businessShipping/types/index.js";
11
11
  export * from "./customer/client/requests/index.js";
12
12
  export * as customer from "./customer/index.js";
13
13
  export * from "./customer/types/index.js";
14
+ export * from "./customerBusinesses/client/requests/index.js";
15
+ export * as customerBusinesses from "./customerBusinesses/index.js";
16
+ export * from "./customerBusinesses/types/index.js";
14
17
  export * from "./customerEvents/client/requests/index.js";
15
18
  export * as customerEvents from "./customerEvents/index.js";
16
19
  export * from "./customerMessaging/client/requests/index.js";
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.serveAd = exports.recordClick = exports.customerMyAccount = exports.customerMessaging = exports.customerEvents = exports.customer = exports.businessShipping = exports.businessProducts = exports.businessMessaging = exports.business = void 0;
39
+ exports.serveAd = exports.recordClick = exports.customerMyAccount = exports.customerMessaging = exports.customerEvents = exports.customerBusinesses = exports.customer = exports.businessShipping = exports.businessProducts = exports.businessMessaging = exports.business = void 0;
40
40
  exports.business = __importStar(require("./business/index.js"));
41
41
  __exportStar(require("./businessMessaging/client/requests/index.js"), exports);
42
42
  exports.businessMessaging = __importStar(require("./businessMessaging/index.js"));
@@ -50,6 +50,9 @@ __exportStar(require("./businessShipping/types/index.js"), exports);
50
50
  __exportStar(require("./customer/client/requests/index.js"), exports);
51
51
  exports.customer = __importStar(require("./customer/index.js"));
52
52
  __exportStar(require("./customer/types/index.js"), exports);
53
+ __exportStar(require("./customerBusinesses/client/requests/index.js"), exports);
54
+ exports.customerBusinesses = __importStar(require("./customerBusinesses/index.js"));
55
+ __exportStar(require("./customerBusinesses/types/index.js"), exports);
53
56
  __exportStar(require("./customerEvents/client/requests/index.js"), exports);
54
57
  exports.customerEvents = __importStar(require("./customerEvents/index.js"));
55
58
  __exportStar(require("./customerMessaging/client/requests/index.js"), exports);
@@ -22,6 +22,6 @@ export declare class ServeAdClient {
22
22
  * placement: "placement"
23
23
  * })
24
24
  */
25
- adsServeAd(request: FiveOneEat.AdsServeAdRequest, requestOptions?: ServeAdClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.AdsServeAdResponse>;
25
+ adsServeAd(request: FiveOneEat.AdsServeAdRequest, requestOptions?: ServeAdClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.AdsServeAdResponse | undefined>;
26
26
  private __adsServeAd;
27
27
  }
@@ -88,7 +88,10 @@ class ServeAdClient {
88
88
  logging: this._options.logging,
89
89
  });
90
90
  if (_response.ok) {
91
- return { data: _response.body, rawResponse: _response.rawResponse };
91
+ return {
92
+ data: _response.body,
93
+ rawResponse: _response.rawResponse,
94
+ };
92
95
  }
93
96
  if (_response.error.reason === "status-code") {
94
97
  switch (_response.error.statusCode) {
@@ -1,4 +1,4 @@
1
1
  import type * as FiveOneEat from "../../../index.js";
2
- export type AdsServeAdResponse = {
2
+ export interface AdsServeAdResponse {
3
3
  data: FiveOneEat.Ad;
4
- } | Record<string, unknown>;
4
+ }
@@ -1,11 +1,8 @@
1
1
  export interface Ad {
2
2
  id: string;
3
- image_url: Ad.ImageUrl;
3
+ image_url: string;
4
4
  alt_text: string;
5
5
  link_url: string;
6
6
  width: string;
7
7
  height: string;
8
8
  }
9
- export declare namespace Ad {
10
- type ImageUrl = string | "";
11
- }
@@ -15,6 +15,6 @@ export declare namespace BusinessConversation {
15
15
  interface LastMessage {
16
16
  id: string;
17
17
  content: string;
18
- created_at: string;
18
+ created_at: string | null;
19
19
  }
20
20
  }
@@ -1 +1 @@
1
- export type BusinessEventCheckInStats = unknown[];
1
+ export type BusinessEventCheckInStats = Record<string, unknown>;
@@ -1 +1 @@
1
- export type BusinessEventSalesSummary = unknown[];
1
+ export type BusinessEventSalesSummary = Record<string, unknown>;
@@ -8,8 +8,28 @@ export interface BusinessMenuItem {
8
8
  is_available: boolean;
9
9
  sort_order: number;
10
10
  image?: string | undefined;
11
- tags?: string | undefined;
12
- allergens?: string | undefined;
11
+ tags?: BusinessMenuItem.Tags.Item[] | undefined;
12
+ allergens?: BusinessMenuItem.Allergens.Item[] | undefined;
13
13
  variations?: FiveOneEat.BusinessMenuItemVariation[] | undefined;
14
14
  modifiers?: FiveOneEat.BusinessMenuItemModifier[] | undefined;
15
15
  }
16
+ export declare namespace BusinessMenuItem {
17
+ type Tags = Tags.Item[];
18
+ namespace Tags {
19
+ interface Item {
20
+ id: string;
21
+ name: string;
22
+ slug: string;
23
+ color: string;
24
+ }
25
+ }
26
+ type Allergens = Allergens.Item[];
27
+ namespace Allergens {
28
+ interface Item {
29
+ id: string;
30
+ name: string;
31
+ slug: string;
32
+ icon: string | null;
33
+ }
34
+ }
35
+ }
@@ -16,6 +16,6 @@ export declare namespace Conversation {
16
16
  interface LastMessage {
17
17
  id: string;
18
18
  content: string;
19
- created_at: string;
19
+ created_at: string | null;
20
20
  }
21
21
  }
@@ -8,7 +8,7 @@ export interface CustomerProductOrderItem {
8
8
  product_snapshot: unknown[] | null;
9
9
  product?: CustomerProductOrderItem.Product | undefined;
10
10
  variant?: (CustomerProductOrderItem.Variant | null) | undefined;
11
- downloads?: string | undefined;
11
+ downloads?: CustomerProductOrderItem.Downloads.Item[] | undefined;
12
12
  }
13
13
  export declare namespace CustomerProductOrderItem {
14
14
  interface Product {
@@ -20,4 +20,13 @@ export declare namespace CustomerProductOrderItem {
20
20
  id: string;
21
21
  name: string;
22
22
  }
23
+ type Downloads = Downloads.Item[];
24
+ namespace Downloads {
25
+ interface Item {
26
+ id: string;
27
+ download_token: string;
28
+ download_count: number;
29
+ expires_at: string | null;
30
+ }
31
+ }
23
32
  }
@@ -0,0 +1,9 @@
1
+ export declare const InventoryChangeType: {
2
+ readonly Restock: "restock";
3
+ readonly Damaged: "damaged";
4
+ readonly Shrinkage: "shrinkage";
5
+ readonly Returned: "returned";
6
+ readonly Correction: "correction";
7
+ readonly Other: "other";
8
+ };
9
+ export type InventoryChangeType = (typeof InventoryChangeType)[keyof typeof InventoryChangeType];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.InventoryChangeType = void 0;
5
+ exports.InventoryChangeType = {
6
+ Restock: "restock",
7
+ Damaged: "damaged",
8
+ Shrinkage: "shrinkage",
9
+ Returned: "returned",
10
+ Correction: "correction",
11
+ Other: "other",
12
+ };
@@ -5,6 +5,7 @@ export interface Ticket {
5
5
  qr_code: string | null;
6
6
  ticket_type?: Ticket.TicketType | undefined;
7
7
  used_at: string;
8
+ wallet_url: Record<string, string>;
8
9
  }
9
10
  export declare namespace Ticket {
10
11
  interface TicketType {
@@ -119,7 +119,7 @@ export * from "./FavoriteResponse.js";
119
119
  export * from "./ForbiddenErrorBody.js";
120
120
  export * from "./Image.js";
121
121
  export * from "./InternalServerErrorBody.js";
122
- export * from "./JsonResource.js";
122
+ export * from "./InventoryChangeType.js";
123
123
  export * from "./MenuItemSearchResult.js";
124
124
  export * from "./Message.js";
125
125
  export * from "./NotFoundErrorBody.js";
@@ -135,7 +135,7 @@ __exportStar(require("./FavoriteResponse.js"), exports);
135
135
  __exportStar(require("./ForbiddenErrorBody.js"), exports);
136
136
  __exportStar(require("./Image.js"), exports);
137
137
  __exportStar(require("./InternalServerErrorBody.js"), exports);
138
- __exportStar(require("./JsonResource.js"), exports);
138
+ __exportStar(require("./InventoryChangeType.js"), exports);
139
139
  __exportStar(require("./MenuItemSearchResult.js"), exports);
140
140
  __exportStar(require("./Message.js"), exports);
141
141
  __exportStar(require("./NotFoundErrorBody.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.54";
1
+ export declare const SDK_VERSION = "0.0.56";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.54";
4
+ exports.SDK_VERSION = "0.0.56";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@51eat/sdk",
9
- "X-Fern-SDK-Version": "0.0.54",
10
- "User-Agent": "@51eat/sdk/0.0.54",
9
+ "X-Fern-SDK-Version": "0.0.56",
10
+ "User-Agent": "@51eat/sdk/0.0.56",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -3,6 +3,7 @@ import { BusinessMessagingClient } from "./api/resources/businessMessaging/clien
3
3
  import { BusinessProductsClient } from "./api/resources/businessProducts/client/Client.mjs";
4
4
  import { BusinessShippingClient } from "./api/resources/businessShipping/client/Client.mjs";
5
5
  import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
6
+ import { CustomerBusinessesClient } from "./api/resources/customerBusinesses/client/Client.mjs";
6
7
  import { CustomerEventsClient } from "./api/resources/customerEvents/client/Client.mjs";
7
8
  import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.mjs";
8
9
  import { CustomerMyAccountClient } from "./api/resources/customerMyAccount/client/Client.mjs";
@@ -21,6 +22,7 @@ export declare class FiveOneEatClient {
21
22
  protected _businessMessaging: BusinessMessagingClient | undefined;
22
23
  protected _businessProducts: BusinessProductsClient | undefined;
23
24
  protected _businessShipping: BusinessShippingClient | undefined;
25
+ protected _customerBusinesses: CustomerBusinessesClient | undefined;
24
26
  protected _customerEvents: CustomerEventsClient | undefined;
25
27
  protected _customerMessaging: CustomerMessagingClient | undefined;
26
28
  protected _customerMyAccount: CustomerMyAccountClient | undefined;
@@ -32,6 +34,7 @@ export declare class FiveOneEatClient {
32
34
  get businessMessaging(): BusinessMessagingClient;
33
35
  get businessProducts(): BusinessProductsClient;
34
36
  get businessShipping(): BusinessShippingClient;
37
+ get customerBusinesses(): CustomerBusinessesClient;
35
38
  get customerEvents(): CustomerEventsClient;
36
39
  get customerMessaging(): CustomerMessagingClient;
37
40
  get customerMyAccount(): CustomerMyAccountClient;