@51eat/sdk 0.0.58 → 0.0.60

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 (200) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/errors/ConflictError.d.ts +1 -2
  3. package/dist/cjs/api/errors/InternalServerError.d.ts +1 -2
  4. package/dist/cjs/api/resources/business/client/Client.d.ts +3 -0
  5. package/dist/cjs/api/resources/business/client/Client.js +31 -26
  6. package/dist/cjs/api/resources/business/resources/claims/client/Client.d.ts +63 -0
  7. package/dist/cjs/api/resources/business/resources/claims/client/Client.js +281 -0
  8. package/dist/cjs/api/resources/business/resources/claims/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/business/resources/claims/client/index.js +17 -0
  10. package/dist/cjs/api/resources/business/resources/claims/client/requests/ClaimViaTokenClaimsRequest.d.ts +9 -0
  11. package/dist/cjs/api/resources/business/resources/claims/client/requests/ClaimViaTokenClaimsRequest.js +3 -0
  12. package/dist/cjs/api/resources/business/resources/claims/client/requests/ListClaimableBusinessesClaimsRequest.d.ts +14 -0
  13. package/dist/cjs/api/resources/business/resources/claims/client/requests/ListClaimableBusinessesClaimsRequest.js +3 -0
  14. package/dist/cjs/api/resources/business/resources/claims/client/requests/StoreClaimRequestRequest.d.ts +11 -0
  15. package/dist/cjs/api/resources/business/resources/claims/client/requests/StoreClaimRequestRequest.js +3 -0
  16. package/dist/cjs/api/resources/business/resources/claims/client/requests/index.d.ts +3 -0
  17. package/dist/cjs/api/resources/business/resources/claims/client/requests/index.js +2 -0
  18. package/dist/cjs/api/resources/business/resources/claims/exports.d.ts +2 -0
  19. package/dist/cjs/api/resources/business/resources/claims/exports.js +21 -0
  20. package/dist/cjs/api/resources/business/resources/claims/index.d.ts +2 -0
  21. package/dist/cjs/api/resources/business/resources/claims/index.js +18 -0
  22. package/dist/cjs/api/resources/business/resources/claims/types/ClaimViaTokenClaimsResponse.d.ts +4 -0
  23. package/dist/cjs/api/resources/business/resources/claims/types/ClaimViaTokenClaimsResponse.js +3 -0
  24. package/dist/cjs/api/resources/business/resources/claims/types/ListClaimRequestsClaimsResponse.d.ts +39 -0
  25. package/dist/cjs/api/resources/business/resources/claims/types/ListClaimRequestsClaimsResponse.js +3 -0
  26. package/dist/cjs/api/resources/business/resources/claims/types/ListClaimableBusinessesClaimsResponse.d.ts +39 -0
  27. package/dist/cjs/api/resources/business/resources/claims/types/ListClaimableBusinessesClaimsResponse.js +3 -0
  28. package/dist/cjs/api/resources/business/resources/claims/types/RequestClaimClaimsResponse.d.ts +4 -0
  29. package/dist/cjs/api/resources/business/resources/claims/types/RequestClaimClaimsResponse.js +3 -0
  30. package/dist/cjs/api/resources/business/resources/claims/types/index.d.ts +4 -0
  31. package/dist/cjs/api/resources/business/resources/claims/types/index.js +20 -0
  32. package/dist/cjs/api/resources/business/resources/index.d.ts +3 -0
  33. package/dist/cjs/api/resources/business/resources/index.js +4 -1
  34. package/dist/cjs/api/resources/customer/client/Client.d.ts +5 -2
  35. package/dist/cjs/api/resources/customer/client/Client.js +27 -22
  36. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/Client.d.ts +62 -0
  37. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/Client.js +234 -0
  38. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/index.js +17 -0
  40. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/requests/GetBusinessSubmissionsRequest.d.ts +10 -0
  41. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/requests/GetBusinessSubmissionsRequest.js +3 -0
  42. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/requests/StoreBusinessSubmissionRequest.d.ts +37 -0
  43. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/requests/StoreBusinessSubmissionRequest.js +3 -0
  44. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/requests/index.d.ts +2 -0
  45. package/dist/cjs/api/resources/customer/resources/businessSubmissions/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/customer/resources/businessSubmissions/exports.d.ts +3 -0
  47. package/dist/cjs/api/resources/customer/resources/businessSubmissions/exports.js +22 -0
  48. package/dist/cjs/api/resources/customer/resources/businessSubmissions/index.d.ts +3 -0
  49. package/dist/cjs/api/resources/customer/resources/businessSubmissions/index.js +19 -0
  50. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/index.d.ts +3 -0
  51. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/index.js +42 -0
  52. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/Client.d.ts +48 -0
  53. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/Client.js +189 -0
  54. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/index.d.ts +1 -0
  55. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/index.js +17 -0
  56. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/DeletePhotosRequest.d.ts +13 -0
  57. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/DeletePhotosRequest.js +3 -0
  58. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/UploadSubmissionPhotoRequest.d.ts +14 -0
  59. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/UploadSubmissionPhotoRequest.js +3 -0
  60. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/index.d.ts +2 -0
  61. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/index.js +2 -0
  62. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/exports.d.ts +2 -0
  63. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/exports.js +21 -0
  64. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/index.d.ts +2 -0
  65. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/index.js +18 -0
  66. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/types/UploadPhotosResponse.d.ts +4 -0
  67. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/types/UploadPhotosResponse.js +3 -0
  68. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/types/index.d.ts +1 -0
  69. package/dist/cjs/api/resources/customer/resources/businessSubmissions/resources/photos/types/index.js +17 -0
  70. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/CreateBusinessSubmissionsResponse.d.ts +4 -0
  71. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/CreateBusinessSubmissionsResponse.js +3 -0
  72. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/GetBusinessSubmissionsResponse.d.ts +4 -0
  73. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/GetBusinessSubmissionsResponse.js +3 -0
  74. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/ListBusinessSubmissionsResponse.d.ts +39 -0
  75. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/ListBusinessSubmissionsResponse.js +3 -0
  76. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/index.d.ts +3 -0
  77. package/dist/cjs/api/resources/customer/resources/businessSubmissions/types/index.js +19 -0
  78. package/dist/cjs/api/resources/customer/resources/index.d.ts +3 -0
  79. package/dist/cjs/api/resources/customer/resources/index.js +4 -1
  80. package/dist/cjs/api/types/BardIngredientSetValues.d.ts +15 -0
  81. package/dist/cjs/api/types/BardIngredientSetValues.js +3 -0
  82. package/dist/cjs/api/types/BardMenuItemSetValues.d.ts +2 -0
  83. package/dist/cjs/api/types/BardPhotoSpreadSetValues.d.ts +18 -0
  84. package/dist/cjs/api/types/BardPhotoSpreadSetValues.js +11 -0
  85. package/dist/cjs/api/types/BardPullQuoteSetValues.d.ts +4 -0
  86. package/dist/cjs/api/types/BardPullQuoteSetValues.js +3 -0
  87. package/dist/cjs/api/types/BardSetValues.d.ts +13 -1
  88. package/dist/cjs/api/types/BardTastingNotesSetValues.d.ts +15 -0
  89. package/dist/cjs/api/types/BardTastingNotesSetValues.js +3 -0
  90. package/dist/cjs/api/types/BusinessClaimRequest.d.ts +9 -0
  91. package/dist/cjs/api/types/BusinessClaimRequest.js +3 -0
  92. package/dist/cjs/api/types/ClaimableBusiness.d.ts +11 -0
  93. package/dist/cjs/api/types/ClaimableBusiness.js +3 -0
  94. package/dist/cjs/api/types/CustomerBusinessSubmission.d.ts +19 -0
  95. package/dist/cjs/api/types/CustomerBusinessSubmission.js +3 -0
  96. package/dist/cjs/api/types/index.d.ts +7 -0
  97. package/dist/cjs/api/types/index.js +7 -0
  98. package/dist/cjs/version.d.ts +1 -1
  99. package/dist/cjs/version.js +1 -1
  100. package/dist/esm/BaseClient.mjs +2 -2
  101. package/dist/esm/api/errors/ConflictError.d.mts +1 -2
  102. package/dist/esm/api/errors/InternalServerError.d.mts +1 -2
  103. package/dist/esm/api/resources/business/client/Client.d.mts +3 -0
  104. package/dist/esm/api/resources/business/client/Client.mjs +5 -0
  105. package/dist/esm/api/resources/business/resources/claims/client/Client.d.mts +63 -0
  106. package/dist/esm/api/resources/business/resources/claims/client/Client.mjs +244 -0
  107. package/dist/esm/api/resources/business/resources/claims/client/index.d.mts +1 -0
  108. package/dist/esm/api/resources/business/resources/claims/client/index.mjs +1 -0
  109. package/dist/esm/api/resources/business/resources/claims/client/requests/ClaimViaTokenClaimsRequest.d.mts +9 -0
  110. package/dist/esm/api/resources/business/resources/claims/client/requests/ClaimViaTokenClaimsRequest.mjs +2 -0
  111. package/dist/esm/api/resources/business/resources/claims/client/requests/ListClaimableBusinessesClaimsRequest.d.mts +14 -0
  112. package/dist/esm/api/resources/business/resources/claims/client/requests/ListClaimableBusinessesClaimsRequest.mjs +2 -0
  113. package/dist/esm/api/resources/business/resources/claims/client/requests/StoreClaimRequestRequest.d.mts +11 -0
  114. package/dist/esm/api/resources/business/resources/claims/client/requests/StoreClaimRequestRequest.mjs +2 -0
  115. package/dist/esm/api/resources/business/resources/claims/client/requests/index.d.mts +3 -0
  116. package/dist/esm/api/resources/business/resources/claims/client/requests/index.mjs +1 -0
  117. package/dist/esm/api/resources/business/resources/claims/exports.d.mts +2 -0
  118. package/dist/esm/api/resources/business/resources/claims/exports.mjs +3 -0
  119. package/dist/esm/api/resources/business/resources/claims/index.d.mts +2 -0
  120. package/dist/esm/api/resources/business/resources/claims/index.mjs +2 -0
  121. package/dist/esm/api/resources/business/resources/claims/types/ClaimViaTokenClaimsResponse.d.mts +4 -0
  122. package/dist/esm/api/resources/business/resources/claims/types/ClaimViaTokenClaimsResponse.mjs +2 -0
  123. package/dist/esm/api/resources/business/resources/claims/types/ListClaimRequestsClaimsResponse.d.mts +39 -0
  124. package/dist/esm/api/resources/business/resources/claims/types/ListClaimRequestsClaimsResponse.mjs +2 -0
  125. package/dist/esm/api/resources/business/resources/claims/types/ListClaimableBusinessesClaimsResponse.d.mts +39 -0
  126. package/dist/esm/api/resources/business/resources/claims/types/ListClaimableBusinessesClaimsResponse.mjs +2 -0
  127. package/dist/esm/api/resources/business/resources/claims/types/RequestClaimClaimsResponse.d.mts +4 -0
  128. package/dist/esm/api/resources/business/resources/claims/types/RequestClaimClaimsResponse.mjs +2 -0
  129. package/dist/esm/api/resources/business/resources/claims/types/index.d.mts +4 -0
  130. package/dist/esm/api/resources/business/resources/claims/types/index.mjs +4 -0
  131. package/dist/esm/api/resources/business/resources/index.d.mts +3 -0
  132. package/dist/esm/api/resources/business/resources/index.mjs +3 -0
  133. package/dist/esm/api/resources/customer/client/Client.d.mts +5 -2
  134. package/dist/esm/api/resources/customer/client/Client.mjs +9 -4
  135. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/Client.d.mts +62 -0
  136. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/Client.mjs +197 -0
  137. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/index.d.mts +1 -0
  138. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/index.mjs +1 -0
  139. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/requests/GetBusinessSubmissionsRequest.d.mts +10 -0
  140. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/requests/GetBusinessSubmissionsRequest.mjs +2 -0
  141. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/requests/StoreBusinessSubmissionRequest.d.mts +37 -0
  142. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/requests/StoreBusinessSubmissionRequest.mjs +2 -0
  143. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/requests/index.d.mts +2 -0
  144. package/dist/esm/api/resources/customer/resources/businessSubmissions/client/requests/index.mjs +1 -0
  145. package/dist/esm/api/resources/customer/resources/businessSubmissions/exports.d.mts +3 -0
  146. package/dist/esm/api/resources/customer/resources/businessSubmissions/exports.mjs +4 -0
  147. package/dist/esm/api/resources/customer/resources/businessSubmissions/index.d.mts +3 -0
  148. package/dist/esm/api/resources/customer/resources/businessSubmissions/index.mjs +3 -0
  149. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/index.d.mts +3 -0
  150. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/index.mjs +3 -0
  151. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/Client.d.mts +48 -0
  152. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/Client.mjs +152 -0
  153. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/index.d.mts +1 -0
  154. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/index.mjs +1 -0
  155. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/DeletePhotosRequest.d.mts +13 -0
  156. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/DeletePhotosRequest.mjs +2 -0
  157. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/UploadSubmissionPhotoRequest.d.mts +14 -0
  158. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/UploadSubmissionPhotoRequest.mjs +2 -0
  159. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/index.d.mts +2 -0
  160. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/client/requests/index.mjs +1 -0
  161. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/exports.d.mts +2 -0
  162. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/exports.mjs +3 -0
  163. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/index.d.mts +2 -0
  164. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/index.mjs +2 -0
  165. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/types/UploadPhotosResponse.d.mts +4 -0
  166. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/types/UploadPhotosResponse.mjs +2 -0
  167. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/types/index.d.mts +1 -0
  168. package/dist/esm/api/resources/customer/resources/businessSubmissions/resources/photos/types/index.mjs +1 -0
  169. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/CreateBusinessSubmissionsResponse.d.mts +4 -0
  170. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/CreateBusinessSubmissionsResponse.mjs +2 -0
  171. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/GetBusinessSubmissionsResponse.d.mts +4 -0
  172. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/GetBusinessSubmissionsResponse.mjs +2 -0
  173. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/ListBusinessSubmissionsResponse.d.mts +39 -0
  174. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/ListBusinessSubmissionsResponse.mjs +2 -0
  175. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/index.d.mts +3 -0
  176. package/dist/esm/api/resources/customer/resources/businessSubmissions/types/index.mjs +3 -0
  177. package/dist/esm/api/resources/customer/resources/index.d.mts +3 -0
  178. package/dist/esm/api/resources/customer/resources/index.mjs +3 -0
  179. package/dist/esm/api/types/BardIngredientSetValues.d.mts +15 -0
  180. package/dist/esm/api/types/BardIngredientSetValues.mjs +2 -0
  181. package/dist/esm/api/types/BardMenuItemSetValues.d.mts +2 -0
  182. package/dist/esm/api/types/BardPhotoSpreadSetValues.d.mts +18 -0
  183. package/dist/esm/api/types/BardPhotoSpreadSetValues.mjs +8 -0
  184. package/dist/esm/api/types/BardPullQuoteSetValues.d.mts +4 -0
  185. package/dist/esm/api/types/BardPullQuoteSetValues.mjs +2 -0
  186. package/dist/esm/api/types/BardSetValues.d.mts +13 -1
  187. package/dist/esm/api/types/BardTastingNotesSetValues.d.mts +15 -0
  188. package/dist/esm/api/types/BardTastingNotesSetValues.mjs +2 -0
  189. package/dist/esm/api/types/BusinessClaimRequest.d.mts +9 -0
  190. package/dist/esm/api/types/BusinessClaimRequest.mjs +2 -0
  191. package/dist/esm/api/types/ClaimableBusiness.d.mts +11 -0
  192. package/dist/esm/api/types/ClaimableBusiness.mjs +2 -0
  193. package/dist/esm/api/types/CustomerBusinessSubmission.d.mts +19 -0
  194. package/dist/esm/api/types/CustomerBusinessSubmission.mjs +2 -0
  195. package/dist/esm/api/types/index.d.mts +7 -0
  196. package/dist/esm/api/types/index.mjs +7 -0
  197. package/dist/esm/version.d.mts +1 -1
  198. package/dist/esm/version.mjs +1 -1
  199. package/package.json +45 -12
  200. package/reference.md +550 -100
@@ -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.58",
47
- "User-Agent": "@51eat/sdk/0.0.58",
46
+ "X-Fern-SDK-Version": "0.0.60",
47
+ "User-Agent": "@51eat/sdk/0.0.60",
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,5 @@
1
1
  import type * as core from "../../core/index.js";
2
2
  import * as errors from "../../errors/index.js";
3
- import type * as FiveOneEat from "../index.js";
4
3
  export declare class ConflictError extends errors.FiveOneEatError {
5
- constructor(body: FiveOneEat.ConflictErrorBody, rawResponse?: core.RawResponse);
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
6
5
  }
@@ -1,6 +1,5 @@
1
1
  import type * as core from "../../core/index.js";
2
2
  import * as errors from "../../errors/index.js";
3
- import type * as FiveOneEat from "../index.js";
4
3
  export declare class InternalServerError extends errors.FiveOneEatError {
5
- constructor(body: FiveOneEat.InternalServerErrorBody, rawResponse?: core.RawResponse);
4
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
6
5
  }
@@ -6,6 +6,7 @@ import { BulletinsClient } from "../resources/bulletins/client/Client.js";
6
6
  import { BusinessesClient } from "../resources/businesses/client/Client.js";
7
7
  import { CategoriesClient } from "../resources/categories/client/Client.js";
8
8
  import { CertificationsClient } from "../resources/certifications/client/Client.js";
9
+ import { ClaimsClient } from "../resources/claims/client/Client.js";
9
10
  import { CuisinesClient } from "../resources/cuisines/client/Client.js";
10
11
  import { DiscountsClient } from "../resources/discounts/client/Client.js";
11
12
  import { EventsClient } from "../resources/events/client/Client.js";
@@ -27,6 +28,7 @@ export declare class BusinessClient {
27
28
  protected _auth: AuthClient | undefined;
28
29
  protected _bulletins: BulletinsClient | undefined;
29
30
  protected _businesses: BusinessesClient | undefined;
31
+ protected _claims: ClaimsClient | undefined;
30
32
  protected _discounts: DiscountsClient | undefined;
31
33
  protected _events: EventsClient | undefined;
32
34
  protected _gallery: GalleryClient | undefined;
@@ -47,6 +49,7 @@ export declare class BusinessClient {
47
49
  get auth(): AuthClient;
48
50
  get bulletins(): BulletinsClient;
49
51
  get businesses(): BusinessesClient;
52
+ get claims(): ClaimsClient;
50
53
  get discounts(): DiscountsClient;
51
54
  get events(): EventsClient;
52
55
  get gallery(): GalleryClient;
@@ -9,19 +9,20 @@ const Client_js_3 = require("../resources/bulletins/client/Client.js");
9
9
  const Client_js_4 = require("../resources/businesses/client/Client.js");
10
10
  const Client_js_5 = require("../resources/categories/client/Client.js");
11
11
  const Client_js_6 = require("../resources/certifications/client/Client.js");
12
- const Client_js_7 = require("../resources/cuisines/client/Client.js");
13
- const Client_js_8 = require("../resources/discounts/client/Client.js");
14
- const Client_js_9 = require("../resources/events/client/Client.js");
15
- const Client_js_10 = require("../resources/gallery/client/Client.js");
16
- const Client_js_11 = require("../resources/menus/client/Client.js");
17
- const Client_js_12 = require("../resources/messaging/client/Client.js");
18
- const Client_js_13 = require("../resources/productCategories/client/Client.js");
19
- const Client_js_14 = require("../resources/productOrders/client/Client.js");
20
- const Client_js_15 = require("../resources/products/client/Client.js");
21
- const Client_js_16 = require("../resources/profile/client/Client.js");
22
- const Client_js_17 = require("../resources/pushNotifications/client/Client.js");
23
- const Client_js_18 = require("../resources/stripeConnect/client/Client.js");
24
- const Client_js_19 = require("../resources/temporaryLocations/client/Client.js");
12
+ const Client_js_7 = require("../resources/claims/client/Client.js");
13
+ const Client_js_8 = require("../resources/cuisines/client/Client.js");
14
+ const Client_js_9 = require("../resources/discounts/client/Client.js");
15
+ const Client_js_10 = require("../resources/events/client/Client.js");
16
+ const Client_js_11 = require("../resources/gallery/client/Client.js");
17
+ const Client_js_12 = require("../resources/menus/client/Client.js");
18
+ const Client_js_13 = require("../resources/messaging/client/Client.js");
19
+ const Client_js_14 = require("../resources/productCategories/client/Client.js");
20
+ const Client_js_15 = require("../resources/productOrders/client/Client.js");
21
+ const Client_js_16 = require("../resources/products/client/Client.js");
22
+ const Client_js_17 = require("../resources/profile/client/Client.js");
23
+ const Client_js_18 = require("../resources/pushNotifications/client/Client.js");
24
+ const Client_js_19 = require("../resources/stripeConnect/client/Client.js");
25
+ const Client_js_20 = require("../resources/temporaryLocations/client/Client.js");
25
26
  class BusinessClient {
26
27
  constructor(options = {}) {
27
28
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
@@ -38,53 +39,57 @@ class BusinessClient {
38
39
  var _a;
39
40
  return ((_a = this._businesses) !== null && _a !== void 0 ? _a : (this._businesses = new Client_js_4.BusinessesClient(this._options)));
40
41
  }
42
+ get claims() {
43
+ var _a;
44
+ return ((_a = this._claims) !== null && _a !== void 0 ? _a : (this._claims = new Client_js_7.ClaimsClient(this._options)));
45
+ }
41
46
  get discounts() {
42
47
  var _a;
43
- return ((_a = this._discounts) !== null && _a !== void 0 ? _a : (this._discounts = new Client_js_8.DiscountsClient(this._options)));
48
+ return ((_a = this._discounts) !== null && _a !== void 0 ? _a : (this._discounts = new Client_js_9.DiscountsClient(this._options)));
44
49
  }
45
50
  get events() {
46
51
  var _a;
47
- return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = new Client_js_9.EventsClient(this._options)));
52
+ return ((_a = this._events) !== null && _a !== void 0 ? _a : (this._events = new Client_js_10.EventsClient(this._options)));
48
53
  }
49
54
  get gallery() {
50
55
  var _a;
51
- return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_10.GalleryClient(this._options)));
56
+ return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_11.GalleryClient(this._options)));
52
57
  }
53
58
  get menus() {
54
59
  var _a;
55
- return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_11.MenusClient(this._options)));
60
+ return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_12.MenusClient(this._options)));
56
61
  }
57
62
  get messaging() {
58
63
  var _a;
59
- return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_12.MessagingClient(this._options)));
64
+ return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_13.MessagingClient(this._options)));
60
65
  }
61
66
  get productOrders() {
62
67
  var _a;
63
- return ((_a = this._productOrders) !== null && _a !== void 0 ? _a : (this._productOrders = new Client_js_14.ProductOrdersClient(this._options)));
68
+ return ((_a = this._productOrders) !== null && _a !== void 0 ? _a : (this._productOrders = new Client_js_15.ProductOrdersClient(this._options)));
64
69
  }
65
70
  get products() {
66
71
  var _a;
67
- return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Client_js_15.ProductsClient(this._options)));
72
+ return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Client_js_16.ProductsClient(this._options)));
68
73
  }
69
74
  get productCategories() {
70
75
  var _a;
71
- return ((_a = this._productCategories) !== null && _a !== void 0 ? _a : (this._productCategories = new Client_js_13.ProductCategoriesClient(this._options)));
76
+ return ((_a = this._productCategories) !== null && _a !== void 0 ? _a : (this._productCategories = new Client_js_14.ProductCategoriesClient(this._options)));
72
77
  }
73
78
  get profile() {
74
79
  var _a;
75
- return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_16.ProfileClient(this._options)));
80
+ return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_17.ProfileClient(this._options)));
76
81
  }
77
82
  get pushNotifications() {
78
83
  var _a;
79
- return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_17.PushNotificationsClient(this._options)));
84
+ return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_18.PushNotificationsClient(this._options)));
80
85
  }
81
86
  get stripeConnect() {
82
87
  var _a;
83
- return ((_a = this._stripeConnect) !== null && _a !== void 0 ? _a : (this._stripeConnect = new Client_js_18.StripeConnectClient(this._options)));
88
+ return ((_a = this._stripeConnect) !== null && _a !== void 0 ? _a : (this._stripeConnect = new Client_js_19.StripeConnectClient(this._options)));
84
89
  }
85
90
  get cuisines() {
86
91
  var _a;
87
- return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new Client_js_7.CuisinesClient(this._options)));
92
+ return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new Client_js_8.CuisinesClient(this._options)));
88
93
  }
89
94
  get certifications() {
90
95
  var _a;
@@ -100,7 +105,7 @@ class BusinessClient {
100
105
  }
101
106
  get temporaryLocations() {
102
107
  var _a;
103
- return ((_a = this._temporaryLocations) !== null && _a !== void 0 ? _a : (this._temporaryLocations = new Client_js_19.TemporaryLocationsClient(this._options)));
108
+ return ((_a = this._temporaryLocations) !== null && _a !== void 0 ? _a : (this._temporaryLocations = new Client_js_20.TemporaryLocationsClient(this._options)));
104
109
  }
105
110
  }
106
111
  exports.BusinessClient = BusinessClient;
@@ -0,0 +1,63 @@
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 ClaimsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ClaimsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ClaimsClient.Options>;
12
+ constructor(options?: ClaimsClient.Options);
13
+ /**
14
+ * @param {FiveOneEat.business.ListClaimableBusinessesClaimsRequest} request
15
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ *
17
+ * @throws {@link FiveOneEat.UnauthorizedError}
18
+ *
19
+ * @example
20
+ * await client.business.claims.listClaimableBusinesses()
21
+ */
22
+ listClaimableBusinesses(request?: FiveOneEat.business.ListClaimableBusinessesClaimsRequest, requestOptions?: ClaimsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListClaimableBusinessesClaimsResponse>;
23
+ private __listClaimableBusinesses;
24
+ /**
25
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link FiveOneEat.UnauthorizedError}
28
+ *
29
+ * @example
30
+ * await client.business.claims.listClaimRequests()
31
+ */
32
+ listClaimRequests(requestOptions?: ClaimsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ListClaimRequestsClaimsResponse>;
33
+ private __listClaimRequests;
34
+ /**
35
+ * @param {FiveOneEat.business.StoreClaimRequestRequest} request
36
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link FiveOneEat.UnauthorizedError}
39
+ * @throws {@link FiveOneEat.ConflictError}
40
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
41
+ *
42
+ * @example
43
+ * await client.business.claims.requestClaim({
44
+ * business_id: "business_id",
45
+ * message: "message"
46
+ * })
47
+ */
48
+ requestClaim(request: FiveOneEat.business.StoreClaimRequestRequest, requestOptions?: ClaimsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.RequestClaimClaimsResponse>;
49
+ private __requestClaim;
50
+ /**
51
+ * @param {FiveOneEat.business.ClaimViaTokenClaimsRequest} request
52
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
53
+ *
54
+ * @throws {@link FiveOneEat.UnauthorizedError}
55
+ *
56
+ * @example
57
+ * await client.business.claims.claimViaToken({
58
+ * token: "token"
59
+ * })
60
+ */
61
+ claimViaToken(request: FiveOneEat.business.ClaimViaTokenClaimsRequest, requestOptions?: ClaimsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.business.ClaimViaTokenClaimsResponse>;
62
+ private __claimViaToken;
63
+ }
@@ -0,0 +1,281 @@
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.ClaimsClient = 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 ClaimsClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * @param {FiveOneEat.business.ListClaimableBusinessesClaimsRequest} request
60
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link FiveOneEat.UnauthorizedError}
63
+ *
64
+ * @example
65
+ * await client.business.claims.listClaimableBusinesses()
66
+ */
67
+ listClaimableBusinesses(request = {}, requestOptions) {
68
+ return core.HttpResponsePromise.fromPromise(this.__listClaimableBusinesses(request, requestOptions));
69
+ }
70
+ __listClaimableBusinesses() {
71
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
72
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
73
+ const { q, lat, lng, radius } = request;
74
+ const _queryParams = {
75
+ q,
76
+ lat,
77
+ lng,
78
+ radius,
79
+ };
80
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
81
+ 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);
82
+ const _response = yield core.fetcher({
83
+ 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/claimable-businesses"),
84
+ method: "GET",
85
+ headers: _headers,
86
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
87
+ queryString: core.url
88
+ .queryBuilder()
89
+ .addMany(_queryParams)
90
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
91
+ .build(),
92
+ 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,
93
+ 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,
94
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
95
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
96
+ logging: this._options.logging,
97
+ });
98
+ if (_response.ok) {
99
+ return {
100
+ data: _response.body,
101
+ rawResponse: _response.rawResponse,
102
+ };
103
+ }
104
+ if (_response.error.reason === "status-code") {
105
+ switch (_response.error.statusCode) {
106
+ case 401:
107
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
108
+ default:
109
+ throw new errors.FiveOneEatError({
110
+ statusCode: _response.error.statusCode,
111
+ body: _response.error.body,
112
+ rawResponse: _response.rawResponse,
113
+ });
114
+ }
115
+ }
116
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/claimable-businesses");
117
+ });
118
+ }
119
+ /**
120
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
121
+ *
122
+ * @throws {@link FiveOneEat.UnauthorizedError}
123
+ *
124
+ * @example
125
+ * await client.business.claims.listClaimRequests()
126
+ */
127
+ listClaimRequests(requestOptions) {
128
+ return core.HttpResponsePromise.fromPromise(this.__listClaimRequests(requestOptions));
129
+ }
130
+ __listClaimRequests(requestOptions) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
133
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
134
+ 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);
135
+ const _response = yield core.fetcher({
136
+ 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/claim-requests"),
137
+ method: "GET",
138
+ headers: _headers,
139
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
140
+ 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,
141
+ 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,
142
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
143
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
144
+ logging: this._options.logging,
145
+ });
146
+ if (_response.ok) {
147
+ return {
148
+ data: _response.body,
149
+ rawResponse: _response.rawResponse,
150
+ };
151
+ }
152
+ if (_response.error.reason === "status-code") {
153
+ switch (_response.error.statusCode) {
154
+ case 401:
155
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
156
+ default:
157
+ throw new errors.FiveOneEatError({
158
+ statusCode: _response.error.statusCode,
159
+ body: _response.error.body,
160
+ rawResponse: _response.rawResponse,
161
+ });
162
+ }
163
+ }
164
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/claim-requests");
165
+ });
166
+ }
167
+ /**
168
+ * @param {FiveOneEat.business.StoreClaimRequestRequest} request
169
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
170
+ *
171
+ * @throws {@link FiveOneEat.UnauthorizedError}
172
+ * @throws {@link FiveOneEat.ConflictError}
173
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
174
+ *
175
+ * @example
176
+ * await client.business.claims.requestClaim({
177
+ * business_id: "business_id",
178
+ * message: "message"
179
+ * })
180
+ */
181
+ requestClaim(request, requestOptions) {
182
+ return core.HttpResponsePromise.fromPromise(this.__requestClaim(request, requestOptions));
183
+ }
184
+ __requestClaim(request, requestOptions) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
187
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
188
+ 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);
189
+ const _response = yield core.fetcher({
190
+ 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/claim-requests"),
191
+ method: "POST",
192
+ headers: _headers,
193
+ contentType: "application/json",
194
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
195
+ requestType: "json",
196
+ body: request,
197
+ 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,
198
+ 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,
199
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
200
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
201
+ logging: this._options.logging,
202
+ });
203
+ if (_response.ok) {
204
+ return {
205
+ data: _response.body,
206
+ rawResponse: _response.rawResponse,
207
+ };
208
+ }
209
+ if (_response.error.reason === "status-code") {
210
+ switch (_response.error.statusCode) {
211
+ case 401:
212
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
213
+ case 409:
214
+ throw new FiveOneEat.ConflictError(_response.error.body, _response.rawResponse);
215
+ case 422:
216
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
217
+ default:
218
+ throw new errors.FiveOneEatError({
219
+ statusCode: _response.error.statusCode,
220
+ body: _response.error.body,
221
+ rawResponse: _response.rawResponse,
222
+ });
223
+ }
224
+ }
225
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/claim-requests");
226
+ });
227
+ }
228
+ /**
229
+ * @param {FiveOneEat.business.ClaimViaTokenClaimsRequest} request
230
+ * @param {ClaimsClient.RequestOptions} requestOptions - Request-specific configuration.
231
+ *
232
+ * @throws {@link FiveOneEat.UnauthorizedError}
233
+ *
234
+ * @example
235
+ * await client.business.claims.claimViaToken({
236
+ * token: "token"
237
+ * })
238
+ */
239
+ claimViaToken(request, requestOptions) {
240
+ return core.HttpResponsePromise.fromPromise(this.__claimViaToken(request, requestOptions));
241
+ }
242
+ __claimViaToken(request, requestOptions) {
243
+ return __awaiter(this, void 0, void 0, function* () {
244
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
245
+ const { token } = request;
246
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
247
+ 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);
248
+ const _response = yield core.fetcher({
249
+ 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/claim-token/${core.url.encodePathParam(token)}`),
250
+ method: "POST",
251
+ headers: _headers,
252
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
253
+ 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,
254
+ 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,
255
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
256
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
257
+ logging: this._options.logging,
258
+ });
259
+ if (_response.ok) {
260
+ return {
261
+ data: _response.body,
262
+ rawResponse: _response.rawResponse,
263
+ };
264
+ }
265
+ if (_response.error.reason === "status-code") {
266
+ switch (_response.error.statusCode) {
267
+ case 401:
268
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
269
+ default:
270
+ throw new errors.FiveOneEatError({
271
+ statusCode: _response.error.statusCode,
272
+ body: _response.error.body,
273
+ rawResponse: _response.rawResponse,
274
+ });
275
+ }
276
+ }
277
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/claim-token/{token}");
278
+ });
279
+ }
280
+ }
281
+ exports.ClaimsClient = ClaimsClient;
@@ -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,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * token: "token"
5
+ * }
6
+ */
7
+ export interface ClaimViaTokenClaimsRequest {
8
+ token: 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,14 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface ListClaimableBusinessesClaimsRequest {
6
+ /** Name search */
7
+ q?: string;
8
+ /** Center latitude */
9
+ lat?: string;
10
+ /** Center longitude */
11
+ lng?: string;
12
+ /** Radius in kilometers (default 25) */
13
+ radius?: string;
14
+ }
@@ -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,11 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business_id: "business_id",
5
+ * message: "message"
6
+ * }
7
+ */
8
+ export interface StoreClaimRequestRequest {
9
+ business_id: string;
10
+ message: string;
11
+ }
@@ -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,3 @@
1
+ export type { ClaimViaTokenClaimsRequest } from "./ClaimViaTokenClaimsRequest.js";
2
+ export type { ListClaimableBusinessesClaimsRequest } from "./ListClaimableBusinessesClaimsRequest.js";
3
+ export type { StoreClaimRequestRequest } from "./StoreClaimRequestRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { ClaimsClient } 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.ClaimsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "ClaimsClient", { enumerable: true, get: function () { return Client_js_1.ClaimsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";