@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
@@ -0,0 +1,62 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ import type * as FiveOneEat from "../../../../../index.mjs";
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,223 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ export class BusinessesClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptionsWithAuth(options);
20
+ }
21
+ /**
22
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @example
25
+ * await client.business.businesses.list()
26
+ */
27
+ list(requestOptions) {
28
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
29
+ }
30
+ __list(requestOptions) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
33
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
34
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
35
+ const _response = yield core.fetcher({
36
+ 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"),
37
+ method: "GET",
38
+ headers: _headers,
39
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
40
+ 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,
41
+ 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,
42
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
43
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
44
+ logging: this._options.logging,
45
+ });
46
+ if (_response.ok) {
47
+ return { data: undefined, rawResponse: _response.rawResponse };
48
+ }
49
+ if (_response.error.reason === "status-code") {
50
+ throw new errors.FiveOneEatError({
51
+ statusCode: _response.error.statusCode,
52
+ body: _response.error.body,
53
+ rawResponse: _response.rawResponse,
54
+ });
55
+ }
56
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/businesses");
57
+ });
58
+ }
59
+ /**
60
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @example
63
+ * await client.business.businesses.create()
64
+ */
65
+ create(requestOptions) {
66
+ return core.HttpResponsePromise.fromPromise(this.__create(requestOptions));
67
+ }
68
+ __create(requestOptions) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
71
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
72
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
73
+ const _response = yield core.fetcher({
74
+ 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"),
75
+ method: "POST",
76
+ headers: _headers,
77
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
78
+ 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,
79
+ 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,
80
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
81
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
82
+ logging: this._options.logging,
83
+ });
84
+ if (_response.ok) {
85
+ return { data: undefined, rawResponse: _response.rawResponse };
86
+ }
87
+ if (_response.error.reason === "status-code") {
88
+ throw new errors.FiveOneEatError({
89
+ statusCode: _response.error.statusCode,
90
+ body: _response.error.body,
91
+ rawResponse: _response.rawResponse,
92
+ });
93
+ }
94
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/businesses");
95
+ });
96
+ }
97
+ /**
98
+ * @param {FiveOneEat.business.GetBusinessesRequest} request
99
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
100
+ *
101
+ * @example
102
+ * await client.business.businesses.get({
103
+ * business: "business"
104
+ * })
105
+ */
106
+ get(request, requestOptions) {
107
+ return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
108
+ }
109
+ __get(request, requestOptions) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
112
+ const { business } = request;
113
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
114
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
115
+ const _response = yield core.fetcher({
116
+ 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)}`),
117
+ method: "GET",
118
+ headers: _headers,
119
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
120
+ 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,
121
+ 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,
122
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
123
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
124
+ logging: this._options.logging,
125
+ });
126
+ if (_response.ok) {
127
+ return { data: undefined, rawResponse: _response.rawResponse };
128
+ }
129
+ if (_response.error.reason === "status-code") {
130
+ throw new errors.FiveOneEatError({
131
+ statusCode: _response.error.statusCode,
132
+ body: _response.error.body,
133
+ rawResponse: _response.rawResponse,
134
+ });
135
+ }
136
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/businesses/{business}");
137
+ });
138
+ }
139
+ /**
140
+ * @param {FiveOneEat.business.UpdateBusinessesRequest} request
141
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @example
144
+ * await client.business.businesses.update({
145
+ * business: "business"
146
+ * })
147
+ */
148
+ update(request, requestOptions) {
149
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
150
+ }
151
+ __update(request, requestOptions) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
154
+ const { business } = request;
155
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
156
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
157
+ const _response = yield core.fetcher({
158
+ 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)}`),
159
+ method: "PUT",
160
+ headers: _headers,
161
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
162
+ 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,
163
+ 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,
164
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
165
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
166
+ logging: this._options.logging,
167
+ });
168
+ if (_response.ok) {
169
+ return { data: undefined, rawResponse: _response.rawResponse };
170
+ }
171
+ if (_response.error.reason === "status-code") {
172
+ throw new errors.FiveOneEatError({
173
+ statusCode: _response.error.statusCode,
174
+ body: _response.error.body,
175
+ rawResponse: _response.rawResponse,
176
+ });
177
+ }
178
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/business/businesses/{business}");
179
+ });
180
+ }
181
+ /**
182
+ * @param {FiveOneEat.business.DeleteBusinessesRequest} request
183
+ * @param {BusinessesClient.RequestOptions} requestOptions - Request-specific configuration.
184
+ *
185
+ * @example
186
+ * await client.business.businesses.delete({
187
+ * business: "business"
188
+ * })
189
+ */
190
+ delete(request, requestOptions) {
191
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
192
+ }
193
+ __delete(request, requestOptions) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
196
+ const { business } = request;
197
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
198
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
199
+ const _response = yield core.fetcher({
200
+ 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)}`),
201
+ method: "DELETE",
202
+ headers: _headers,
203
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
204
+ 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,
205
+ 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,
206
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
207
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
208
+ logging: this._options.logging,
209
+ });
210
+ if (_response.ok) {
211
+ return { data: undefined, rawResponse: _response.rawResponse };
212
+ }
213
+ if (_response.error.reason === "status-code") {
214
+ throw new errors.FiveOneEatError({
215
+ statusCode: _response.error.statusCode,
216
+ body: _response.error.body,
217
+ rawResponse: _response.rawResponse,
218
+ });
219
+ }
220
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/business/businesses/{business}");
221
+ });
222
+ }
223
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface DeleteBusinessesRequest {
8
+ business: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface GetBusinessesRequest {
8
+ business: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * business: "business"
5
+ * }
6
+ */
7
+ export interface UpdateBusinessesRequest {
8
+ business: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { DeleteBusinessesRequest } from "./DeleteBusinessesRequest.mjs";
2
+ export type { GetBusinessesRequest } from "./GetBusinessesRequest.mjs";
3
+ export type { UpdateBusinessesRequest } from "./UpdateBusinessesRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { BusinessesClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { BusinessesClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,20 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
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
+ }
@@ -0,0 +1,59 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ export class CategoriesClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptionsWithAuth(options);
20
+ }
21
+ /**
22
+ * @param {CategoriesClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @example
25
+ * await client.business.categories.list()
26
+ */
27
+ list(requestOptions) {
28
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
29
+ }
30
+ __list(requestOptions) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
33
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
34
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
35
+ const _response = yield core.fetcher({
36
+ 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/categories"),
37
+ method: "GET",
38
+ headers: _headers,
39
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
40
+ 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,
41
+ 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,
42
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
43
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
44
+ logging: this._options.logging,
45
+ });
46
+ if (_response.ok) {
47
+ return { data: undefined, rawResponse: _response.rawResponse };
48
+ }
49
+ if (_response.error.reason === "status-code") {
50
+ throw new errors.FiveOneEatError({
51
+ statusCode: _response.error.statusCode,
52
+ body: _response.error.body,
53
+ rawResponse: _response.rawResponse,
54
+ });
55
+ }
56
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/categories");
57
+ });
58
+ }
59
+ }
@@ -0,0 +1,2 @@
1
+ export { CategoriesClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { CategoriesClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,20 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ export declare namespace CertificationsClient {
5
+ type Options = BaseClientOptions;
6
+ interface RequestOptions extends BaseRequestOptions {
7
+ }
8
+ }
9
+ export declare class CertificationsClient {
10
+ protected readonly _options: NormalizedClientOptionsWithAuth<CertificationsClient.Options>;
11
+ constructor(options?: CertificationsClient.Options);
12
+ /**
13
+ * @param {CertificationsClient.RequestOptions} requestOptions - Request-specific configuration.
14
+ *
15
+ * @example
16
+ * await client.business.certifications.list()
17
+ */
18
+ list(requestOptions?: CertificationsClient.RequestOptions): core.HttpResponsePromise<void>;
19
+ private __list;
20
+ }
@@ -0,0 +1,59 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
+ import * as core from "../../../../../../core/index.mjs";
14
+ import * as environments from "../../../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../../../errors/index.mjs";
17
+ export class CertificationsClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptionsWithAuth(options);
20
+ }
21
+ /**
22
+ * @param {CertificationsClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @example
25
+ * await client.business.certifications.list()
26
+ */
27
+ list(requestOptions) {
28
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
29
+ }
30
+ __list(requestOptions) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
33
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
34
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
35
+ const _response = yield core.fetcher({
36
+ 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/certifications"),
37
+ method: "GET",
38
+ headers: _headers,
39
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
40
+ 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,
41
+ 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,
42
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
43
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
44
+ logging: this._options.logging,
45
+ });
46
+ if (_response.ok) {
47
+ return { data: undefined, rawResponse: _response.rawResponse };
48
+ }
49
+ if (_response.error.reason === "status-code") {
50
+ throw new errors.FiveOneEatError({
51
+ statusCode: _response.error.statusCode,
52
+ body: _response.error.body,
53
+ rawResponse: _response.rawResponse,
54
+ });
55
+ }
56
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/certifications");
57
+ });
58
+ }
59
+ }
@@ -0,0 +1,2 @@
1
+ export { CertificationsClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { CertificationsClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,20 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.mjs";
3
+ import * as core from "../../../../../../core/index.mjs";
4
+ export declare namespace CuisinesClient {
5
+ type Options = BaseClientOptions;
6
+ interface RequestOptions extends BaseRequestOptions {
7
+ }
8
+ }
9
+ export declare class CuisinesClient {
10
+ protected readonly _options: NormalizedClientOptionsWithAuth<CuisinesClient.Options>;
11
+ constructor(options?: CuisinesClient.Options);
12
+ /**
13
+ * @param {CuisinesClient.RequestOptions} requestOptions - Request-specific configuration.
14
+ *
15
+ * @example
16
+ * await client.business.cuisines.list()
17
+ */
18
+ list(requestOptions?: CuisinesClient.RequestOptions): core.HttpResponsePromise<void>;
19
+ private __list;
20
+ }