@51eat/sdk 0.0.22 → 0.0.23

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 (96) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/business/client/Client.d.ts +12 -0
  3. package/dist/cjs/api/resources/business/client/Client.js +30 -10
  4. package/dist/cjs/api/resources/business/resources/businesses/client/Client.d.ts +62 -0
  5. package/dist/cjs/api/resources/business/resources/businesses/client/Client.js +260 -0
  6. package/dist/cjs/api/resources/business/resources/businesses/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/business/resources/businesses/client/index.js +17 -0
  8. package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.ts +9 -0
  9. package/dist/cjs/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.js +3 -0
  10. package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.ts +9 -0
  11. package/dist/cjs/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.js +3 -0
  12. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.js +3 -0
  14. package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.d.ts +3 -0
  15. package/dist/cjs/api/resources/business/resources/businesses/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/business/resources/businesses/exports.d.ts +2 -0
  17. package/dist/cjs/api/resources/business/resources/businesses/exports.js +21 -0
  18. package/dist/cjs/api/resources/business/resources/businesses/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/business/resources/businesses/index.js +17 -0
  20. package/dist/cjs/api/resources/business/resources/categories/client/Client.d.ts +20 -0
  21. package/dist/cjs/api/resources/business/resources/categories/client/Client.js +96 -0
  22. package/dist/cjs/api/resources/business/resources/categories/client/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/business/resources/categories/client/index.js +2 -0
  24. package/dist/cjs/api/resources/business/resources/categories/exports.d.ts +2 -0
  25. package/dist/cjs/api/resources/business/resources/categories/exports.js +21 -0
  26. package/dist/cjs/api/resources/business/resources/categories/index.d.ts +1 -0
  27. package/dist/cjs/api/resources/business/resources/categories/index.js +17 -0
  28. package/dist/cjs/api/resources/business/resources/certifications/client/Client.d.ts +20 -0
  29. package/dist/cjs/api/resources/business/resources/certifications/client/Client.js +96 -0
  30. package/dist/cjs/api/resources/business/resources/certifications/client/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/business/resources/certifications/client/index.js +2 -0
  32. package/dist/cjs/api/resources/business/resources/certifications/exports.d.ts +2 -0
  33. package/dist/cjs/api/resources/business/resources/certifications/exports.js +21 -0
  34. package/dist/cjs/api/resources/business/resources/certifications/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/business/resources/certifications/index.js +17 -0
  36. package/dist/cjs/api/resources/business/resources/cuisines/client/Client.d.ts +20 -0
  37. package/dist/cjs/api/resources/business/resources/cuisines/client/Client.js +96 -0
  38. package/dist/cjs/api/resources/business/resources/cuisines/client/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/business/resources/cuisines/client/index.js +2 -0
  40. package/dist/cjs/api/resources/business/resources/cuisines/exports.d.ts +2 -0
  41. package/dist/cjs/api/resources/business/resources/cuisines/exports.js +21 -0
  42. package/dist/cjs/api/resources/business/resources/cuisines/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/business/resources/cuisines/index.js +17 -0
  44. package/dist/cjs/api/resources/business/resources/index.d.ts +5 -0
  45. package/dist/cjs/api/resources/business/resources/index.js +6 -1
  46. package/dist/cjs/version.d.ts +1 -1
  47. package/dist/cjs/version.js +1 -1
  48. package/dist/esm/BaseClient.mjs +2 -2
  49. package/dist/esm/api/resources/business/client/Client.d.mts +12 -0
  50. package/dist/esm/api/resources/business/client/Client.mjs +20 -0
  51. package/dist/esm/api/resources/business/resources/businesses/client/Client.d.mts +62 -0
  52. package/dist/esm/api/resources/business/resources/businesses/client/Client.mjs +223 -0
  53. package/dist/esm/api/resources/business/resources/businesses/client/index.d.mts +1 -0
  54. package/dist/esm/api/resources/business/resources/businesses/client/index.mjs +1 -0
  55. package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.d.mts +9 -0
  56. package/dist/esm/api/resources/business/resources/businesses/client/requests/DeleteBusinessesRequest.mjs +2 -0
  57. package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.d.mts +9 -0
  58. package/dist/esm/api/resources/business/resources/businesses/client/requests/GetBusinessesRequest.mjs +2 -0
  59. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.d.mts +9 -0
  60. package/dist/esm/api/resources/business/resources/businesses/client/requests/UpdateBusinessesRequest.mjs +2 -0
  61. package/dist/esm/api/resources/business/resources/businesses/client/requests/index.d.mts +3 -0
  62. package/dist/esm/api/resources/business/resources/businesses/client/requests/index.mjs +1 -0
  63. package/dist/esm/api/resources/business/resources/businesses/exports.d.mts +2 -0
  64. package/dist/esm/api/resources/business/resources/businesses/exports.mjs +3 -0
  65. package/dist/esm/api/resources/business/resources/businesses/index.d.mts +1 -0
  66. package/dist/esm/api/resources/business/resources/businesses/index.mjs +1 -0
  67. package/dist/esm/api/resources/business/resources/categories/client/Client.d.mts +20 -0
  68. package/dist/esm/api/resources/business/resources/categories/client/Client.mjs +59 -0
  69. package/dist/esm/api/resources/business/resources/categories/client/index.d.mts +1 -0
  70. package/dist/esm/api/resources/business/resources/categories/client/index.mjs +1 -0
  71. package/dist/esm/api/resources/business/resources/categories/exports.d.mts +2 -0
  72. package/dist/esm/api/resources/business/resources/categories/exports.mjs +3 -0
  73. package/dist/esm/api/resources/business/resources/categories/index.d.mts +1 -0
  74. package/dist/esm/api/resources/business/resources/categories/index.mjs +1 -0
  75. package/dist/esm/api/resources/business/resources/certifications/client/Client.d.mts +20 -0
  76. package/dist/esm/api/resources/business/resources/certifications/client/Client.mjs +59 -0
  77. package/dist/esm/api/resources/business/resources/certifications/client/index.d.mts +1 -0
  78. package/dist/esm/api/resources/business/resources/certifications/client/index.mjs +1 -0
  79. package/dist/esm/api/resources/business/resources/certifications/exports.d.mts +2 -0
  80. package/dist/esm/api/resources/business/resources/certifications/exports.mjs +3 -0
  81. package/dist/esm/api/resources/business/resources/certifications/index.d.mts +1 -0
  82. package/dist/esm/api/resources/business/resources/certifications/index.mjs +1 -0
  83. package/dist/esm/api/resources/business/resources/cuisines/client/Client.d.mts +20 -0
  84. package/dist/esm/api/resources/business/resources/cuisines/client/Client.mjs +59 -0
  85. package/dist/esm/api/resources/business/resources/cuisines/client/index.d.mts +1 -0
  86. package/dist/esm/api/resources/business/resources/cuisines/client/index.mjs +1 -0
  87. package/dist/esm/api/resources/business/resources/cuisines/exports.d.mts +2 -0
  88. package/dist/esm/api/resources/business/resources/cuisines/exports.mjs +3 -0
  89. package/dist/esm/api/resources/business/resources/cuisines/index.d.mts +1 -0
  90. package/dist/esm/api/resources/business/resources/cuisines/index.mjs +1 -0
  91. package/dist/esm/api/resources/business/resources/index.d.mts +5 -0
  92. package/dist/esm/api/resources/business/resources/index.mjs +5 -0
  93. package/dist/esm/version.d.mts +1 -1
  94. package/dist/esm/version.mjs +1 -1
  95. package/package.json +45 -1
  96. package/reference.md +362 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@51eat/sdk",
46
- "X-Fern-SDK-Version": "0.0.22",
47
- "User-Agent": "@51eat/sdk/0.0.22",
46
+ "X-Fern-SDK-Version": "0.0.23",
47
+ "User-Agent": "@51eat/sdk/0.0.23",
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);
@@ -2,6 +2,10 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import { AuthClient } from "../resources/auth/client/Client.js";
4
4
  import { BulletinsClient } from "../resources/bulletins/client/Client.js";
5
+ import { BusinessesClient } from "../resources/businesses/client/Client.js";
6
+ import { CategoriesClient } from "../resources/categories/client/Client.js";
7
+ import { CertificationsClient } from "../resources/certifications/client/Client.js";
8
+ import { CuisinesClient } from "../resources/cuisines/client/Client.js";
5
9
  import { GalleryClient } from "../resources/gallery/client/Client.js";
6
10
  import { MenusClient } from "../resources/menus/client/Client.js";
7
11
  import { MessagingClient } from "../resources/messaging/client/Client.js";
@@ -19,6 +23,10 @@ export declare class BusinessClient {
19
23
  protected _messaging: MessagingClient | undefined;
20
24
  protected _profile: ProfileClient | undefined;
21
25
  protected _pushNotifications: PushNotificationsClient | undefined;
26
+ protected _businesses: BusinessesClient | undefined;
27
+ protected _cuisines: CuisinesClient | undefined;
28
+ protected _certifications: CertificationsClient | undefined;
29
+ protected _categories: CategoriesClient | undefined;
22
30
  constructor(options?: BusinessClient.Options);
23
31
  get auth(): AuthClient;
24
32
  get bulletins(): BulletinsClient;
@@ -27,4 +35,8 @@ export declare class BusinessClient {
27
35
  get messaging(): MessagingClient;
28
36
  get profile(): ProfileClient;
29
37
  get pushNotifications(): PushNotificationsClient;
38
+ get businesses(): BusinessesClient;
39
+ get cuisines(): CuisinesClient;
40
+ get certifications(): CertificationsClient;
41
+ get categories(): CategoriesClient;
30
42
  }
@@ -5,11 +5,15 @@ exports.BusinessClient = void 0;
5
5
  const BaseClient_js_1 = require("../../../../BaseClient.js");
6
6
  const Client_js_1 = require("../resources/auth/client/Client.js");
7
7
  const Client_js_2 = require("../resources/bulletins/client/Client.js");
8
- const Client_js_3 = require("../resources/gallery/client/Client.js");
9
- const Client_js_4 = require("../resources/menus/client/Client.js");
10
- const Client_js_5 = require("../resources/messaging/client/Client.js");
11
- const Client_js_6 = require("../resources/profile/client/Client.js");
12
- const Client_js_7 = require("../resources/pushNotifications/client/Client.js");
8
+ const Client_js_3 = require("../resources/businesses/client/Client.js");
9
+ const Client_js_4 = require("../resources/categories/client/Client.js");
10
+ const Client_js_5 = require("../resources/certifications/client/Client.js");
11
+ const Client_js_6 = require("../resources/cuisines/client/Client.js");
12
+ const Client_js_7 = require("../resources/gallery/client/Client.js");
13
+ const Client_js_8 = require("../resources/menus/client/Client.js");
14
+ const Client_js_9 = require("../resources/messaging/client/Client.js");
15
+ const Client_js_10 = require("../resources/profile/client/Client.js");
16
+ const Client_js_11 = require("../resources/pushNotifications/client/Client.js");
13
17
  class BusinessClient {
14
18
  constructor(options = {}) {
15
19
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
@@ -24,23 +28,39 @@ class BusinessClient {
24
28
  }
25
29
  get gallery() {
26
30
  var _a;
27
- return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_3.GalleryClient(this._options)));
31
+ return ((_a = this._gallery) !== null && _a !== void 0 ? _a : (this._gallery = new Client_js_7.GalleryClient(this._options)));
28
32
  }
29
33
  get menus() {
30
34
  var _a;
31
- return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_4.MenusClient(this._options)));
35
+ return ((_a = this._menus) !== null && _a !== void 0 ? _a : (this._menus = new Client_js_8.MenusClient(this._options)));
32
36
  }
33
37
  get messaging() {
34
38
  var _a;
35
- return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_5.MessagingClient(this._options)));
39
+ return ((_a = this._messaging) !== null && _a !== void 0 ? _a : (this._messaging = new Client_js_9.MessagingClient(this._options)));
36
40
  }
37
41
  get profile() {
38
42
  var _a;
39
- return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_6.ProfileClient(this._options)));
43
+ return ((_a = this._profile) !== null && _a !== void 0 ? _a : (this._profile = new Client_js_10.ProfileClient(this._options)));
40
44
  }
41
45
  get pushNotifications() {
42
46
  var _a;
43
- return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_7.PushNotificationsClient(this._options)));
47
+ return ((_a = this._pushNotifications) !== null && _a !== void 0 ? _a : (this._pushNotifications = new Client_js_11.PushNotificationsClient(this._options)));
48
+ }
49
+ get businesses() {
50
+ var _a;
51
+ return ((_a = this._businesses) !== null && _a !== void 0 ? _a : (this._businesses = new Client_js_3.BusinessesClient(this._options)));
52
+ }
53
+ get cuisines() {
54
+ var _a;
55
+ return ((_a = this._cuisines) !== null && _a !== void 0 ? _a : (this._cuisines = new Client_js_6.CuisinesClient(this._options)));
56
+ }
57
+ get certifications() {
58
+ var _a;
59
+ return ((_a = this._certifications) !== null && _a !== void 0 ? _a : (this._certifications = new Client_js_5.CertificationsClient(this._options)));
60
+ }
61
+ get categories() {
62
+ var _a;
63
+ return ((_a = this._categories) !== null && _a !== void 0 ? _a : (this._categories = new Client_js_4.CategoriesClient(this._options)));
44
64
  }
45
65
  }
46
66
  exports.BusinessClient = BusinessClient;
@@ -0,0 +1,62 @@
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 type * as FiveOneEat from "../../../../../index.js";
5
+ export declare namespace BusinessesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class BusinessesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<BusinessesClient.Options>;
12
+ constructor(options?: BusinessesClient.Options);
13
+ /**
14
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
15
+ *
16
+ * @example
17
+ * await client.business.businesses.list()
18
+ */
19
+ list(requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
20
+ private __list;
21
+ /**
22
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @example
25
+ * await client.business.businesses.create()
26
+ */
27
+ create(requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
28
+ private __create;
29
+ /**
30
+ * @param {FiveOneEat.business.GetBusinessesRequest} request
31
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
32
+ *
33
+ * @example
34
+ * await client.business.businesses.get({
35
+ * business: "business"
36
+ * })
37
+ */
38
+ get(request: FiveOneEat.business.GetBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
39
+ private __get;
40
+ /**
41
+ * @param {FiveOneEat.business.UpdateBusinessesRequest} request
42
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
43
+ *
44
+ * @example
45
+ * await client.business.businesses.update({
46
+ * business: "business"
47
+ * })
48
+ */
49
+ update(request: FiveOneEat.business.UpdateBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
50
+ private __update;
51
+ /**
52
+ * @param {FiveOneEat.business.DeleteBusinessesRequest} request
53
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @example
56
+ * await client.business.businesses.delete({
57
+ * business: "business"
58
+ * })
59
+ */
60
+ delete(request: FiveOneEat.business.DeleteBusinessesRequest, requestOptions?: BusinessesClient.RequestOptions): core.HttpResponsePromise<void>;
61
+ private __delete;
62
+ }
@@ -0,0 +1,260 @@
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.BusinessesClient = 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
+ class BusinessesClient {
54
+ constructor(options = {}) {
55
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
56
+ }
57
+ /**
58
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
59
+ *
60
+ * @example
61
+ * await client.business.businesses.list()
62
+ */
63
+ list(requestOptions) {
64
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
65
+ }
66
+ __list(requestOptions) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
69
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
70
+ 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);
71
+ const _response = yield core.fetcher({
72
+ 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/businesses"),
73
+ method: "GET",
74
+ headers: _headers,
75
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
76
+ 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,
77
+ 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,
78
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
79
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
80
+ logging: this._options.logging,
81
+ });
82
+ if (_response.ok) {
83
+ return { data: undefined, rawResponse: _response.rawResponse };
84
+ }
85
+ if (_response.error.reason === "status-code") {
86
+ throw new errors.FiveOneEatError({
87
+ statusCode: _response.error.statusCode,
88
+ body: _response.error.body,
89
+ rawResponse: _response.rawResponse,
90
+ });
91
+ }
92
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/businesses");
93
+ });
94
+ }
95
+ /**
96
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
97
+ *
98
+ * @example
99
+ * await client.business.businesses.create()
100
+ */
101
+ create(requestOptions) {
102
+ return core.HttpResponsePromise.fromPromise(this.__create(requestOptions));
103
+ }
104
+ __create(requestOptions) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
107
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
108
+ 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);
109
+ const _response = yield core.fetcher({
110
+ 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/businesses"),
111
+ method: "POST",
112
+ headers: _headers,
113
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
114
+ 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,
115
+ 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,
116
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
117
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
118
+ logging: this._options.logging,
119
+ });
120
+ if (_response.ok) {
121
+ return { data: undefined, rawResponse: _response.rawResponse };
122
+ }
123
+ if (_response.error.reason === "status-code") {
124
+ throw new errors.FiveOneEatError({
125
+ statusCode: _response.error.statusCode,
126
+ body: _response.error.body,
127
+ rawResponse: _response.rawResponse,
128
+ });
129
+ }
130
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/businesses");
131
+ });
132
+ }
133
+ /**
134
+ * @param {FiveOneEat.business.GetBusinessesRequest} request
135
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
136
+ *
137
+ * @example
138
+ * await client.business.businesses.get({
139
+ * business: "business"
140
+ * })
141
+ */
142
+ get(request, requestOptions) {
143
+ return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
144
+ }
145
+ __get(request, requestOptions) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
148
+ const { business } = request;
149
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
150
+ 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);
151
+ const _response = yield core.fetcher({
152
+ 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/businesses/${core.url.encodePathParam(business)}`),
153
+ method: "GET",
154
+ headers: _headers,
155
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
156
+ 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,
157
+ 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,
158
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
159
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
160
+ logging: this._options.logging,
161
+ });
162
+ if (_response.ok) {
163
+ return { data: undefined, rawResponse: _response.rawResponse };
164
+ }
165
+ if (_response.error.reason === "status-code") {
166
+ throw new errors.FiveOneEatError({
167
+ statusCode: _response.error.statusCode,
168
+ body: _response.error.body,
169
+ rawResponse: _response.rawResponse,
170
+ });
171
+ }
172
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/business/businesses/{business}");
173
+ });
174
+ }
175
+ /**
176
+ * @param {FiveOneEat.business.UpdateBusinessesRequest} request
177
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
178
+ *
179
+ * @example
180
+ * await client.business.businesses.update({
181
+ * business: "business"
182
+ * })
183
+ */
184
+ update(request, requestOptions) {
185
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
186
+ }
187
+ __update(request, requestOptions) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
190
+ const { business } = request;
191
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
192
+ 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);
193
+ const _response = yield core.fetcher({
194
+ 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/businesses/${core.url.encodePathParam(business)}`),
195
+ method: "PUT",
196
+ headers: _headers,
197
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
198
+ 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,
199
+ 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,
200
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
201
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
202
+ logging: this._options.logging,
203
+ });
204
+ if (_response.ok) {
205
+ return { data: undefined, rawResponse: _response.rawResponse };
206
+ }
207
+ if (_response.error.reason === "status-code") {
208
+ throw new errors.FiveOneEatError({
209
+ statusCode: _response.error.statusCode,
210
+ body: _response.error.body,
211
+ rawResponse: _response.rawResponse,
212
+ });
213
+ }
214
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/business/businesses/{business}");
215
+ });
216
+ }
217
+ /**
218
+ * @param {FiveOneEat.business.DeleteBusinessesRequest} request
219
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
220
+ *
221
+ * @example
222
+ * await client.business.businesses.delete({
223
+ * business: "business"
224
+ * })
225
+ */
226
+ delete(request, requestOptions) {
227
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
228
+ }
229
+ __delete(request, requestOptions) {
230
+ return __awaiter(this, void 0, void 0, function* () {
231
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
232
+ const { business } = request;
233
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
234
+ 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);
235
+ const _response = yield core.fetcher({
236
+ 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/businesses/${core.url.encodePathParam(business)}`),
237
+ method: "DELETE",
238
+ headers: _headers,
239
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
240
+ 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,
241
+ 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,
242
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
243
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
244
+ logging: this._options.logging,
245
+ });
246
+ if (_response.ok) {
247
+ return { data: undefined, rawResponse: _response.rawResponse };
248
+ }
249
+ if (_response.error.reason === "status-code") {
250
+ throw new errors.FiveOneEatError({
251
+ statusCode: _response.error.statusCode,
252
+ body: _response.error.body,
253
+ rawResponse: _response.rawResponse,
254
+ });
255
+ }
256
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/business/businesses/{business}");
257
+ });
258
+ }
259
+ }
260
+ exports.BusinessesClient = BusinessesClient;
@@ -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
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface DeleteBusinessesRequest {
8
+ business: 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,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface GetBusinessesRequest {
8
+ business: 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,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface UpdateBusinessesRequest {
8
+ business: 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,3 @@
1
+ export type { DeleteBusinessesRequest } from "./DeleteBusinessesRequest.js";
2
+ export type { GetBusinessesRequest } from "./GetBusinessesRequest.js";
3
+ export type { UpdateBusinessesRequest } from "./UpdateBusinessesRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { BusinessesClient } 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.BusinessesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "BusinessesClient", { enumerable: true, get: function () { return Client_js_1.BusinessesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/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("./client/index.js"), exports);
@@ -0,0 +1,20 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
+ import * as core from "../../../../../../core/index.js";
4
+ export declare namespace CategoriesClient {
5
+ type Options = BaseClientOptions;
6
+ interface RequestOptions extends BaseRequestOptions {
7
+ }
8
+ }
9
+ export declare class CategoriesClient {
10
+ protected readonly _options: NormalizedClientOptionsWithAuth<CategoriesClient.Options>;
11
+ constructor(options?: CategoriesClient.Options);
12
+ /**
13
+ * @param {CategoriesClient.RequestOptions} requestOptions - Request-specific configuration.
14
+ *
15
+ * @example
16
+ * await client.business.categories.list()
17
+ */
18
+ list(requestOptions?: CategoriesClient.RequestOptions): core.HttpResponsePromise<void>;
19
+ private __list;
20
+ }