@51eat/sdk 0.0.31 → 0.0.32

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 (126) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/resources/auth/client/Client.d.ts +35 -0
  3. package/dist/cjs/api/resources/business/resources/auth/client/Client.js +115 -0
  4. package/dist/cjs/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.d.ts +9 -0
  5. package/dist/cjs/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.js +3 -0
  6. package/dist/cjs/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.d.ts +15 -0
  7. package/dist/cjs/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.js +3 -0
  8. package/dist/cjs/api/resources/business/resources/auth/client/requests/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.d.ts +9 -0
  10. package/dist/cjs/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.js +10 -0
  11. package/dist/cjs/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.d.ts +9 -0
  12. package/dist/cjs/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.js +10 -0
  13. package/dist/cjs/api/resources/business/resources/auth/types/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/business/resources/auth/types/index.js +2 -0
  15. package/dist/cjs/api/resources/customer/resources/auth/client/Client.d.ts +79 -0
  16. package/dist/cjs/api/resources/customer/resources/auth/client/Client.js +286 -0
  17. package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.d.ts +9 -0
  18. package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.js +3 -0
  19. package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.d.ts +15 -0
  20. package/dist/cjs/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.js +3 -0
  21. package/dist/cjs/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.d.ts +11 -0
  22. package/dist/cjs/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.js +3 -0
  23. package/dist/cjs/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.ts +10 -0
  24. package/dist/cjs/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.js +3 -0
  25. package/dist/cjs/api/resources/customer/resources/auth/client/requests/index.d.ts +4 -0
  26. package/dist/cjs/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.d.ts +4 -0
  27. package/dist/cjs/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.js +3 -0
  28. package/dist/cjs/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.d.ts +9 -0
  29. package/dist/cjs/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.js +10 -0
  30. package/dist/cjs/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.d.ts +9 -0
  31. package/dist/cjs/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.js +10 -0
  32. package/dist/cjs/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.d.ts +4 -0
  33. package/dist/cjs/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.js +3 -0
  34. package/dist/cjs/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.d.ts +4 -0
  35. package/dist/cjs/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.js +3 -0
  36. package/dist/cjs/api/resources/customer/resources/auth/types/index.d.ts +5 -0
  37. package/dist/cjs/api/resources/customer/resources/auth/types/index.js +5 -0
  38. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.ts +39 -0
  39. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.js +137 -0
  40. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.d.ts +20 -0
  41. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.js +3 -0
  42. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.d.ts +18 -0
  43. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.js +3 -0
  44. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.ts +2 -0
  45. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.d.ts +4 -0
  46. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.js +3 -0
  47. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.d.ts +4 -0
  48. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.js +3 -0
  49. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.d.ts +2 -0
  50. package/dist/cjs/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.js +2 -0
  51. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.d.ts +2 -1
  52. package/dist/cjs/api/resources/customer/resources/discovery/client/Client.js +15 -5
  53. package/dist/cjs/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.d.ts +8 -0
  54. package/dist/cjs/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.js +3 -0
  55. package/dist/cjs/api/resources/customer/resources/discovery/client/requests/index.d.ts +1 -0
  56. package/dist/cjs/api/types/CustomerReplyResponse.d.ts +5 -0
  57. package/dist/cjs/api/types/CustomerReplyResponse.js +3 -0
  58. package/dist/cjs/api/types/CustomerUser.d.ts +1 -0
  59. package/dist/cjs/api/types/index.d.ts +1 -0
  60. package/dist/cjs/api/types/index.js +1 -0
  61. package/dist/cjs/version.d.ts +1 -1
  62. package/dist/cjs/version.js +1 -1
  63. package/dist/esm/BaseClient.mjs +2 -2
  64. package/dist/esm/api/resources/business/resources/auth/client/Client.d.mts +35 -0
  65. package/dist/esm/api/resources/business/resources/auth/client/Client.mjs +115 -0
  66. package/dist/esm/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.d.mts +9 -0
  67. package/dist/esm/api/resources/business/resources/auth/client/requests/ForgotPasswordRequest.mjs +2 -0
  68. package/dist/esm/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.d.mts +15 -0
  69. package/dist/esm/api/resources/business/resources/auth/client/requests/ResetPasswordRequest.mjs +2 -0
  70. package/dist/esm/api/resources/business/resources/auth/client/requests/index.d.mts +2 -0
  71. package/dist/esm/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.d.mts +9 -0
  72. package/dist/esm/api/resources/business/resources/auth/types/ForgotPasswordAuthResponse.mjs +7 -0
  73. package/dist/esm/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.d.mts +9 -0
  74. package/dist/esm/api/resources/business/resources/auth/types/ResetPasswordAuthResponse.mjs +7 -0
  75. package/dist/esm/api/resources/business/resources/auth/types/index.d.mts +2 -0
  76. package/dist/esm/api/resources/business/resources/auth/types/index.mjs +2 -0
  77. package/dist/esm/api/resources/customer/resources/auth/client/Client.d.mts +79 -0
  78. package/dist/esm/api/resources/customer/resources/auth/client/Client.mjs +287 -1
  79. package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.d.mts +9 -0
  80. package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest.mjs +2 -0
  81. package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.d.mts +15 -0
  82. package/dist/esm/api/resources/customer/resources/auth/client/requests/AppHttpRequestsApiV1CustomerAuthResetPasswordRequest.mjs +2 -0
  83. package/dist/esm/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.d.mts +11 -0
  84. package/dist/esm/api/resources/customer/resources/auth/client/requests/UpdateUserRequest.mjs +2 -0
  85. package/dist/esm/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.d.mts +10 -0
  86. package/dist/esm/api/resources/customer/resources/auth/client/requests/UploadAvatarRequest.mjs +2 -0
  87. package/dist/esm/api/resources/customer/resources/auth/client/requests/index.d.mts +4 -0
  88. package/dist/esm/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.d.mts +4 -0
  89. package/dist/esm/api/resources/customer/resources/auth/types/DeleteAvatarAuthResponse.mjs +2 -0
  90. package/dist/esm/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.d.mts +9 -0
  91. package/dist/esm/api/resources/customer/resources/auth/types/ForgotPasswordAuthResponse.mjs +7 -0
  92. package/dist/esm/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.d.mts +9 -0
  93. package/dist/esm/api/resources/customer/resources/auth/types/ResetPasswordAuthResponse.mjs +7 -0
  94. package/dist/esm/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.d.mts +4 -0
  95. package/dist/esm/api/resources/customer/resources/auth/types/UpdateProfileAuthResponse.mjs +2 -0
  96. package/dist/esm/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.d.mts +4 -0
  97. package/dist/esm/api/resources/customer/resources/auth/types/UploadAvatarAuthResponse.mjs +2 -0
  98. package/dist/esm/api/resources/customer/resources/auth/types/index.d.mts +5 -0
  99. package/dist/esm/api/resources/customer/resources/auth/types/index.mjs +5 -0
  100. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.d.mts +39 -0
  101. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/Client.mjs +137 -0
  102. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.d.mts +20 -0
  103. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/ListRepliesCommentsRequest.mjs +2 -0
  104. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.d.mts +18 -0
  105. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/StoreBulletinCommentReplyRequest.mjs +2 -0
  106. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/client/requests/index.d.mts +2 -0
  107. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.d.mts +4 -0
  108. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ListRepliesCommentsResponse.mjs +2 -0
  109. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.d.mts +4 -0
  110. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/ReplyCommentsResponse.mjs +2 -0
  111. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.d.mts +2 -0
  112. package/dist/esm/api/resources/customer/resources/businesses/resources/bulletins/resources/comments/types/index.mjs +2 -0
  113. package/dist/esm/api/resources/customer/resources/discovery/client/Client.d.mts +2 -1
  114. package/dist/esm/api/resources/customer/resources/discovery/client/Client.mjs +15 -5
  115. package/dist/esm/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.d.mts +8 -0
  116. package/dist/esm/api/resources/customer/resources/discovery/client/requests/CategoriesDiscoveryRequest.mjs +2 -0
  117. package/dist/esm/api/resources/customer/resources/discovery/client/requests/index.d.mts +1 -0
  118. package/dist/esm/api/types/CustomerReplyResponse.d.mts +5 -0
  119. package/dist/esm/api/types/CustomerReplyResponse.mjs +2 -0
  120. package/dist/esm/api/types/CustomerUser.d.mts +1 -0
  121. package/dist/esm/api/types/index.d.mts +1 -0
  122. package/dist/esm/api/types/index.mjs +1 -0
  123. package/dist/esm/version.d.mts +1 -1
  124. package/dist/esm/version.mjs +1 -1
  125. package/package.json +1 -1
  126. package/reference.md +683 -86
@@ -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.31",
47
- "User-Agent": "@51eat/sdk/0.0.31",
46
+ "X-Fern-SDK-Version": "0.0.32",
47
+ "User-Agent": "@51eat/sdk/0.0.32",
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);
@@ -49,6 +49,41 @@ export declare class AuthClient {
49
49
  */
50
50
  login(request: FiveOneEat.business.LoginBusinessRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.LoginAuthResponse>;
51
51
  private __login;
52
+ /**
53
+ * Sends a password reset link to the provided email address if an account exists.
54
+ * Always returns a 200 response to prevent email enumeration.
55
+ *
56
+ * @param {FiveOneEat.business.ForgotPasswordRequest} request
57
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
60
+ *
61
+ * @example
62
+ * await client.business.auth.forgotPassword({
63
+ * email: "email"
64
+ * })
65
+ */
66
+ forgotPassword(request: FiveOneEat.business.ForgotPasswordRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ForgotPasswordAuthResponse>;
67
+ private __forgotPassword;
68
+ /**
69
+ * Validates the reset token and updates the user's password. All existing API tokens
70
+ * are revoked after a successful reset, requiring re-authentication on all devices.
71
+ *
72
+ * @param {FiveOneEat.business.ResetPasswordRequest} request
73
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.business.auth.resetPassword({
79
+ * token: "token",
80
+ * email: "email",
81
+ * password: "password",
82
+ * password_confirmation: "password_confirmation"
83
+ * })
84
+ */
85
+ resetPassword(request: FiveOneEat.business.ResetPasswordRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ResetPasswordAuthResponse>;
86
+ private __resetPassword;
52
87
  /**
53
88
  * Retrieve the current authenticated business user with their active business and all owned businesses.
54
89
  *
@@ -176,6 +176,121 @@ class AuthClient {
176
176
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/login");
177
177
  });
178
178
  }
179
+ /**
180
+ * Sends a password reset link to the provided email address if an account exists.
181
+ * Always returns a 200 response to prevent email enumeration.
182
+ *
183
+ * @param {FiveOneEat.business.ForgotPasswordRequest} request
184
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
185
+ *
186
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
187
+ *
188
+ * @example
189
+ * await client.business.auth.forgotPassword({
190
+ * email: "email"
191
+ * })
192
+ */
193
+ forgotPassword(request, requestOptions) {
194
+ return core.HttpResponsePromise.fromPromise(this.__forgotPassword(request, requestOptions));
195
+ }
196
+ __forgotPassword(request, requestOptions) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
199
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
200
+ const _response = yield core.fetcher({
201
+ 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/forgot-password"),
202
+ method: "POST",
203
+ headers: _headers,
204
+ contentType: "application/json",
205
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
206
+ requestType: "json",
207
+ body: request,
208
+ 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,
209
+ 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,
210
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
211
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
212
+ logging: this._options.logging,
213
+ });
214
+ if (_response.ok) {
215
+ return {
216
+ data: _response.body,
217
+ rawResponse: _response.rawResponse,
218
+ };
219
+ }
220
+ if (_response.error.reason === "status-code") {
221
+ switch (_response.error.statusCode) {
222
+ case 422:
223
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
224
+ default:
225
+ throw new errors.FiveOneEatError({
226
+ statusCode: _response.error.statusCode,
227
+ body: _response.error.body,
228
+ rawResponse: _response.rawResponse,
229
+ });
230
+ }
231
+ }
232
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/forgot-password");
233
+ });
234
+ }
235
+ /**
236
+ * Validates the reset token and updates the user's password. All existing API tokens
237
+ * are revoked after a successful reset, requiring re-authentication on all devices.
238
+ *
239
+ * @param {FiveOneEat.business.ResetPasswordRequest} request
240
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
241
+ *
242
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
243
+ *
244
+ * @example
245
+ * await client.business.auth.resetPassword({
246
+ * token: "token",
247
+ * email: "email",
248
+ * password: "password",
249
+ * password_confirmation: "password_confirmation"
250
+ * })
251
+ */
252
+ resetPassword(request, requestOptions) {
253
+ return core.HttpResponsePromise.fromPromise(this.__resetPassword(request, requestOptions));
254
+ }
255
+ __resetPassword(request, requestOptions) {
256
+ return __awaiter(this, void 0, void 0, function* () {
257
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
258
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
259
+ const _response = yield core.fetcher({
260
+ 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/reset-password"),
261
+ method: "POST",
262
+ headers: _headers,
263
+ contentType: "application/json",
264
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
265
+ requestType: "json",
266
+ body: request,
267
+ 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,
268
+ 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,
269
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
270
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
271
+ logging: this._options.logging,
272
+ });
273
+ if (_response.ok) {
274
+ return {
275
+ data: _response.body,
276
+ rawResponse: _response.rawResponse,
277
+ };
278
+ }
279
+ if (_response.error.reason === "status-code") {
280
+ switch (_response.error.statusCode) {
281
+ case 422:
282
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
283
+ default:
284
+ throw new errors.FiveOneEatError({
285
+ statusCode: _response.error.statusCode,
286
+ body: _response.error.body,
287
+ rawResponse: _response.rawResponse,
288
+ });
289
+ }
290
+ }
291
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/reset-password");
292
+ });
293
+ }
179
294
  /**
180
295
  * Retrieve the current authenticated business user with their active business and all owned businesses.
181
296
  *
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * email: "email"
5
+ * }
6
+ */
7
+ export interface ForgotPasswordRequest {
8
+ email: 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 });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * token: "token",
5
+ * email: "email",
6
+ * password: "password",
7
+ * password_confirmation: "password_confirmation"
8
+ * }
9
+ */
10
+ export interface ResetPasswordRequest {
11
+ token: string;
12
+ email: string;
13
+ password: string;
14
+ password_confirmation: string;
15
+ }
@@ -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,4 +1,6 @@
1
+ export type { ForgotPasswordRequest } from "./ForgotPasswordRequest.js";
1
2
  export type { LoginBusinessRequest } from "./LoginBusinessRequest.js";
2
3
  export type { LogoutAuthRequest } from "./LogoutAuthRequest.js";
3
4
  export type { RegisterBusinessRequest } from "./RegisterBusinessRequest.js";
5
+ export type { ResetPasswordRequest } from "./ResetPasswordRequest.js";
4
6
  export type { SwitchBusinessAuthRequest } from "./SwitchBusinessAuthRequest.js";
@@ -0,0 +1,9 @@
1
+ export interface ForgotPasswordAuthResponse {
2
+ message: ForgotPasswordAuthResponse.Message;
3
+ }
4
+ export declare namespace ForgotPasswordAuthResponse {
5
+ const Message: {
6
+ readonly AResetLinkWillBeSentIfTheAccountExists: "A reset link will be sent if the account exists.";
7
+ };
8
+ type Message = (typeof Message)[keyof typeof Message];
9
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ForgotPasswordAuthResponse = void 0;
5
+ var ForgotPasswordAuthResponse;
6
+ (function (ForgotPasswordAuthResponse) {
7
+ ForgotPasswordAuthResponse.Message = {
8
+ AResetLinkWillBeSentIfTheAccountExists: "A reset link will be sent if the account exists.",
9
+ };
10
+ })(ForgotPasswordAuthResponse || (exports.ForgotPasswordAuthResponse = ForgotPasswordAuthResponse = {}));
@@ -0,0 +1,9 @@
1
+ export interface ResetPasswordAuthResponse {
2
+ message: ResetPasswordAuthResponse.Message;
3
+ }
4
+ export declare namespace ResetPasswordAuthResponse {
5
+ const Message: {
6
+ readonly YourPasswordHasBeenReset: "Your password has been reset.";
7
+ };
8
+ type Message = (typeof Message)[keyof typeof Message];
9
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ResetPasswordAuthResponse = void 0;
5
+ var ResetPasswordAuthResponse;
6
+ (function (ResetPasswordAuthResponse) {
7
+ ResetPasswordAuthResponse.Message = {
8
+ YourPasswordHasBeenReset: "Your password has been reset.",
9
+ };
10
+ })(ResetPasswordAuthResponse || (exports.ResetPasswordAuthResponse = ResetPasswordAuthResponse = {}));
@@ -1,6 +1,8 @@
1
+ export * from "./ForgotPasswordAuthResponse.js";
1
2
  export * from "./LoginAuthResponse.js";
2
3
  export * from "./LogoutAllAuthResponse.js";
3
4
  export * from "./LogoutAuthResponse.js";
4
5
  export * from "./MeAuthResponse.js";
5
6
  export * from "./RegisterAuthResponse.js";
7
+ export * from "./ResetPasswordAuthResponse.js";
6
8
  export * from "./SwitchBusinessAuthResponse.js";
@@ -14,9 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ForgotPasswordAuthResponse.js"), exports);
17
18
  __exportStar(require("./LoginAuthResponse.js"), exports);
18
19
  __exportStar(require("./LogoutAllAuthResponse.js"), exports);
19
20
  __exportStar(require("./LogoutAuthResponse.js"), exports);
20
21
  __exportStar(require("./MeAuthResponse.js"), exports);
21
22
  __exportStar(require("./RegisterAuthResponse.js"), exports);
23
+ __exportStar(require("./ResetPasswordAuthResponse.js"), exports);
22
24
  __exportStar(require("./SwitchBusinessAuthResponse.js"), exports);
@@ -49,6 +49,41 @@ export declare class AuthClient {
49
49
  */
50
50
  login(request: FiveOneEat.customer.LoginCustomerRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.LoginAuthResponse>;
51
51
  private __login;
52
+ /**
53
+ * Sends a password reset link to the provided email address if an account exists.
54
+ * Always returns a 200 response to prevent email enumeration.
55
+ *
56
+ * @param {FiveOneEat.customer.AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest} request
57
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
60
+ *
61
+ * @example
62
+ * await client.customer.auth.forgotPassword({
63
+ * email: "email"
64
+ * })
65
+ */
66
+ forgotPassword(request: FiveOneEat.customer.AppHttpRequestsApiV1CustomerAuthForgotPasswordRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ForgotPasswordAuthResponse>;
67
+ private __forgotPassword;
68
+ /**
69
+ * Validates the reset token and updates the user's password. All existing API tokens
70
+ * are revoked after a successful reset, requiring re-authentication on all devices.
71
+ *
72
+ * @param {FiveOneEat.customer.AppHttpRequestsApiV1CustomerAuthResetPasswordRequest} request
73
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.customer.auth.resetPassword({
79
+ * token: "token",
80
+ * email: "email",
81
+ * password: "password",
82
+ * password_confirmation: "password_confirmation"
83
+ * })
84
+ */
85
+ resetPassword(request: FiveOneEat.customer.AppHttpRequestsApiV1CustomerAuthResetPasswordRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.ResetPasswordAuthResponse>;
86
+ private __resetPassword;
52
87
  /**
53
88
  * Retrieve the current authenticated user's profile information.
54
89
  *
@@ -61,6 +96,50 @@ export declare class AuthClient {
61
96
  */
62
97
  me(requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.MeAuthResponse>;
63
98
  private __me;
99
+ /**
100
+ * Update name, email, and/or password. All fields are optional. To change the
101
+ * password, `current_password` must be provided alongside `password` and `password_confirmation`.
102
+ *
103
+ * @param {FiveOneEat.customer.UpdateUserRequest} request
104
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
105
+ *
106
+ * @throws {@link FiveOneEat.UnauthorizedError}
107
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
108
+ *
109
+ * @example
110
+ * await client.customer.auth.updateProfile()
111
+ */
112
+ updateProfile(request?: FiveOneEat.customer.UpdateUserRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.UpdateProfileAuthResponse>;
113
+ private __updateProfile;
114
+ /**
115
+ * Upload and replace the avatar for the authenticated customer. Any existing avatar file will be deleted.
116
+ *
117
+ * @param {FiveOneEat.customer.UploadAvatarRequest} request
118
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
119
+ *
120
+ * @throws {@link FiveOneEat.UnauthorizedError}
121
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
122
+ *
123
+ * @example
124
+ * import { createReadStream } from "fs";
125
+ * await client.customer.auth.uploadAvatar({
126
+ * avatar: fs.createReadStream("/path/to/your/file")
127
+ * })
128
+ */
129
+ uploadAvatar(request: FiveOneEat.customer.UploadAvatarRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.UploadAvatarAuthResponse>;
130
+ private __uploadAvatar;
131
+ /**
132
+ * Remove the avatar for the authenticated customer. Returns the updated user with a null avatar_url.
133
+ *
134
+ * @param {AuthClient.RequestOptions} requestOptions - Request-specific configuration.
135
+ *
136
+ * @throws {@link FiveOneEat.UnauthorizedError}
137
+ *
138
+ * @example
139
+ * await client.customer.auth.deleteAvatar()
140
+ */
141
+ deleteAvatar(requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.DeleteAvatarAuthResponse>;
142
+ private __deleteAvatar;
64
143
  /**
65
144
  * Revoke the current API token and log out the user.
66
145
  *