@51eat/sdk 0.0.41 → 0.0.42

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 (91) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +6 -0
  4. package/dist/cjs/Client.js +18 -8
  5. package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +27 -0
  6. package/dist/cjs/api/resources/businessMessaging/client/Client.js +124 -0
  7. package/dist/cjs/api/resources/businessMessaging/client/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/businessMessaging/client/index.js +17 -0
  9. package/dist/cjs/api/resources/businessMessaging/client/requests/SearchBusinessConversationsRequest.d.ts +14 -0
  10. package/dist/cjs/api/resources/businessMessaging/client/requests/SearchBusinessConversationsRequest.js +3 -0
  11. package/dist/cjs/api/resources/businessMessaging/client/requests/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/businessMessaging/client/requests/index.js +2 -0
  13. package/dist/cjs/api/resources/businessMessaging/exports.d.ts +2 -0
  14. package/dist/cjs/api/resources/businessMessaging/exports.js +21 -0
  15. package/dist/cjs/api/resources/businessMessaging/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/businessMessaging/index.js +18 -0
  17. package/dist/cjs/api/resources/businessMessaging/types/SearchBusinessConversationsResponse.d.ts +4 -0
  18. package/dist/cjs/api/resources/businessMessaging/types/SearchBusinessConversationsResponse.js +3 -0
  19. package/dist/cjs/api/resources/businessMessaging/types/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/businessMessaging/types/index.js +17 -0
  21. package/dist/cjs/api/resources/customerMessaging/client/Client.d.ts +27 -0
  22. package/dist/cjs/api/resources/customerMessaging/client/Client.js +124 -0
  23. package/dist/cjs/api/resources/customerMessaging/client/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/customerMessaging/client/index.js +17 -0
  25. package/dist/cjs/api/resources/customerMessaging/client/requests/SearchCustomerConversationsRequest.d.ts +14 -0
  26. package/dist/cjs/api/resources/customerMessaging/client/requests/SearchCustomerConversationsRequest.js +3 -0
  27. package/dist/cjs/api/resources/customerMessaging/client/requests/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/customerMessaging/client/requests/index.js +2 -0
  29. package/dist/cjs/api/resources/customerMessaging/exports.d.ts +2 -0
  30. package/dist/cjs/api/resources/customerMessaging/exports.js +21 -0
  31. package/dist/cjs/api/resources/customerMessaging/index.d.ts +2 -0
  32. package/dist/cjs/api/resources/customerMessaging/index.js +18 -0
  33. package/dist/cjs/api/resources/customerMessaging/types/SearchCustomerConversationsResponse.d.ts +4 -0
  34. package/dist/cjs/api/resources/customerMessaging/types/SearchCustomerConversationsResponse.js +3 -0
  35. package/dist/cjs/api/resources/customerMessaging/types/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/customerMessaging/types/index.js +17 -0
  37. package/dist/cjs/api/resources/index.d.ts +6 -0
  38. package/dist/cjs/api/resources/index.js +7 -1
  39. package/dist/cjs/api/types/ExploreEvent.d.ts +21 -0
  40. package/dist/cjs/api/types/ExploreEvent.js +3 -0
  41. package/dist/cjs/api/types/ExploreResponse.d.ts +1 -0
  42. package/dist/cjs/api/types/index.d.ts +1 -0
  43. package/dist/cjs/api/types/index.js +1 -0
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/BaseClient.mjs +2 -2
  47. package/dist/esm/Client.d.mts +6 -0
  48. package/dist/esm/Client.mjs +10 -0
  49. package/dist/esm/api/resources/businessMessaging/client/Client.d.mts +27 -0
  50. package/dist/esm/api/resources/businessMessaging/client/Client.mjs +87 -0
  51. package/dist/esm/api/resources/businessMessaging/client/index.d.mts +1 -0
  52. package/dist/esm/api/resources/businessMessaging/client/index.mjs +1 -0
  53. package/dist/esm/api/resources/businessMessaging/client/requests/SearchBusinessConversationsRequest.d.mts +14 -0
  54. package/dist/esm/api/resources/businessMessaging/client/requests/SearchBusinessConversationsRequest.mjs +2 -0
  55. package/dist/esm/api/resources/businessMessaging/client/requests/index.d.mts +1 -0
  56. package/dist/esm/api/resources/businessMessaging/client/requests/index.mjs +1 -0
  57. package/dist/esm/api/resources/businessMessaging/exports.d.mts +2 -0
  58. package/dist/esm/api/resources/businessMessaging/exports.mjs +3 -0
  59. package/dist/esm/api/resources/businessMessaging/index.d.mts +2 -0
  60. package/dist/esm/api/resources/businessMessaging/index.mjs +2 -0
  61. package/dist/esm/api/resources/businessMessaging/types/SearchBusinessConversationsResponse.d.mts +4 -0
  62. package/dist/esm/api/resources/businessMessaging/types/SearchBusinessConversationsResponse.mjs +2 -0
  63. package/dist/esm/api/resources/businessMessaging/types/index.d.mts +1 -0
  64. package/dist/esm/api/resources/businessMessaging/types/index.mjs +1 -0
  65. package/dist/esm/api/resources/customerMessaging/client/Client.d.mts +27 -0
  66. package/dist/esm/api/resources/customerMessaging/client/Client.mjs +87 -0
  67. package/dist/esm/api/resources/customerMessaging/client/index.d.mts +1 -0
  68. package/dist/esm/api/resources/customerMessaging/client/index.mjs +1 -0
  69. package/dist/esm/api/resources/customerMessaging/client/requests/SearchCustomerConversationsRequest.d.mts +14 -0
  70. package/dist/esm/api/resources/customerMessaging/client/requests/SearchCustomerConversationsRequest.mjs +2 -0
  71. package/dist/esm/api/resources/customerMessaging/client/requests/index.d.mts +1 -0
  72. package/dist/esm/api/resources/customerMessaging/client/requests/index.mjs +1 -0
  73. package/dist/esm/api/resources/customerMessaging/exports.d.mts +2 -0
  74. package/dist/esm/api/resources/customerMessaging/exports.mjs +3 -0
  75. package/dist/esm/api/resources/customerMessaging/index.d.mts +2 -0
  76. package/dist/esm/api/resources/customerMessaging/index.mjs +2 -0
  77. package/dist/esm/api/resources/customerMessaging/types/SearchCustomerConversationsResponse.d.mts +4 -0
  78. package/dist/esm/api/resources/customerMessaging/types/SearchCustomerConversationsResponse.mjs +2 -0
  79. package/dist/esm/api/resources/customerMessaging/types/index.d.mts +1 -0
  80. package/dist/esm/api/resources/customerMessaging/types/index.mjs +1 -0
  81. package/dist/esm/api/resources/index.d.mts +6 -0
  82. package/dist/esm/api/resources/index.mjs +6 -0
  83. package/dist/esm/api/types/ExploreEvent.d.mts +21 -0
  84. package/dist/esm/api/types/ExploreEvent.mjs +2 -0
  85. package/dist/esm/api/types/ExploreResponse.d.mts +1 -0
  86. package/dist/esm/api/types/index.d.mts +1 -0
  87. package/dist/esm/api/types/index.mjs +1 -0
  88. package/dist/esm/version.d.mts +1 -1
  89. package/dist/esm/version.mjs +1 -1
  90. package/package.json +23 -1
  91. package/reference.md +104 -0
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.js";
2
+ export interface SearchCustomerConversationsResponse {
3
+ data: FiveOneEat.Conversation[];
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./SearchCustomerConversationsResponse.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("./SearchCustomerConversationsResponse.js"), exports);
@@ -1,7 +1,13 @@
1
1
  export * as business from "./business/index.js";
2
+ export * from "./businessMessaging/client/requests/index.js";
3
+ export * as businessMessaging from "./businessMessaging/index.js";
4
+ export * from "./businessMessaging/types/index.js";
2
5
  export * from "./customer/client/requests/index.js";
3
6
  export * as customer from "./customer/index.js";
4
7
  export * from "./customer/types/index.js";
8
+ export * from "./customerMessaging/client/requests/index.js";
9
+ export * as customerMessaging from "./customerMessaging/index.js";
10
+ export * from "./customerMessaging/types/index.js";
5
11
  export * from "./customerMyAccount/client/requests/index.js";
6
12
  export * as customerMyAccount from "./customerMyAccount/index.js";
7
13
  export * from "./customerMyAccount/types/index.js";
@@ -36,11 +36,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.serveAd = exports.recordClick = exports.customerMyAccount = exports.customer = exports.business = void 0;
39
+ exports.serveAd = exports.recordClick = exports.customerMyAccount = exports.customerMessaging = exports.customer = exports.businessMessaging = exports.business = void 0;
40
40
  exports.business = __importStar(require("./business/index.js"));
41
+ __exportStar(require("./businessMessaging/client/requests/index.js"), exports);
42
+ exports.businessMessaging = __importStar(require("./businessMessaging/index.js"));
43
+ __exportStar(require("./businessMessaging/types/index.js"), exports);
41
44
  __exportStar(require("./customer/client/requests/index.js"), exports);
42
45
  exports.customer = __importStar(require("./customer/index.js"));
43
46
  __exportStar(require("./customer/types/index.js"), exports);
47
+ __exportStar(require("./customerMessaging/client/requests/index.js"), exports);
48
+ exports.customerMessaging = __importStar(require("./customerMessaging/index.js"));
49
+ __exportStar(require("./customerMessaging/types/index.js"), exports);
44
50
  __exportStar(require("./customerMyAccount/client/requests/index.js"), exports);
45
51
  exports.customerMyAccount = __importStar(require("./customerMyAccount/index.js"));
46
52
  __exportStar(require("./customerMyAccount/types/index.js"), exports);
@@ -0,0 +1,21 @@
1
+ export interface ExploreEvent {
2
+ id: string;
3
+ title: string;
4
+ description: string | null;
5
+ location: string | null;
6
+ starts_at: string;
7
+ ends_at: string;
8
+ latitude: number | null;
9
+ longitude: number | null;
10
+ is_featured: boolean;
11
+ business?: ExploreEvent.Business | undefined;
12
+ }
13
+ export declare namespace ExploreEvent {
14
+ interface Business {
15
+ id: string;
16
+ name: string;
17
+ handle: string;
18
+ logo: string;
19
+ category: string;
20
+ }
21
+ }
@@ -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 });
@@ -2,6 +2,7 @@ import type * as FiveOneEat from "../index.js";
2
2
  export interface ExploreResponse {
3
3
  businesses: FiveOneEat.ExploreBusiness[];
4
4
  temporary_locations: FiveOneEat.ExploreTemporaryLocation[];
5
+ events: FiveOneEat.ExploreEvent[];
5
6
  bounds: ExploreResponse.Bounds;
6
7
  }
7
8
  export declare namespace ExploreResponse {
@@ -108,6 +108,7 @@ export * from "./EventFeedItem.js";
108
108
  export * from "./EventFeedResponse.js";
109
109
  export * from "./EventSearchResult.js";
110
110
  export * from "./ExploreBusiness.js";
111
+ export * from "./ExploreEvent.js";
111
112
  export * from "./ExploreResponse.js";
112
113
  export * from "./ExploreTemporaryLocation.js";
113
114
  export * from "./FavoriteResponse.js";
@@ -124,6 +124,7 @@ __exportStar(require("./EventFeedItem.js"), exports);
124
124
  __exportStar(require("./EventFeedResponse.js"), exports);
125
125
  __exportStar(require("./EventSearchResult.js"), exports);
126
126
  __exportStar(require("./ExploreBusiness.js"), exports);
127
+ __exportStar(require("./ExploreEvent.js"), exports);
127
128
  __exportStar(require("./ExploreResponse.js"), exports);
128
129
  __exportStar(require("./ExploreTemporaryLocation.js"), exports);
129
130
  __exportStar(require("./FavoriteResponse.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.41";
1
+ export declare const SDK_VERSION = "0.0.42";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.41";
4
+ exports.SDK_VERSION = "0.0.42";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@51eat/sdk",
9
- "X-Fern-SDK-Version": "0.0.41",
10
- "User-Agent": "@51eat/sdk/0.0.41",
9
+ "X-Fern-SDK-Version": "0.0.42",
10
+ "User-Agent": "@51eat/sdk/0.0.42",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,5 +1,7 @@
1
1
  import { BusinessClient } from "./api/resources/business/client/Client.mjs";
2
+ import { BusinessMessagingClient } from "./api/resources/businessMessaging/client/Client.mjs";
2
3
  import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
4
+ import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.mjs";
3
5
  import { CustomerMyAccountClient } from "./api/resources/customerMyAccount/client/Client.mjs";
4
6
  import { RecordClickClient } from "./api/resources/recordClick/client/Client.mjs";
5
7
  import { ServeAdClient } from "./api/resources/serveAd/client/Client.mjs";
@@ -13,12 +15,16 @@ export declare namespace FiveOneEatClient {
13
15
  }
14
16
  export declare class FiveOneEatClient {
15
17
  protected readonly _options: NormalizedClientOptionsWithAuth<FiveOneEatClient.Options>;
18
+ protected _businessMessaging: BusinessMessagingClient | undefined;
19
+ protected _customerMessaging: CustomerMessagingClient | undefined;
16
20
  protected _customerMyAccount: CustomerMyAccountClient | undefined;
17
21
  protected _customer: CustomerClient | undefined;
18
22
  protected _recordClick: RecordClickClient | undefined;
19
23
  protected _serveAd: ServeAdClient | undefined;
20
24
  protected _business: BusinessClient | undefined;
21
25
  constructor(options?: FiveOneEatClient.Options);
26
+ get businessMessaging(): BusinessMessagingClient;
27
+ get customerMessaging(): CustomerMessagingClient;
22
28
  get customerMyAccount(): CustomerMyAccountClient;
23
29
  get customer(): CustomerClient;
24
30
  get recordClick(): RecordClickClient;
@@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  import { BusinessClient } from "./api/resources/business/client/Client.mjs";
12
+ import { BusinessMessagingClient } from "./api/resources/businessMessaging/client/Client.mjs";
12
13
  import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
14
+ import { CustomerMessagingClient } from "./api/resources/customerMessaging/client/Client.mjs";
13
15
  import { CustomerMyAccountClient } from "./api/resources/customerMyAccount/client/Client.mjs";
14
16
  import { RecordClickClient } from "./api/resources/recordClick/client/Client.mjs";
15
17
  import { ServeAdClient } from "./api/resources/serveAd/client/Client.mjs";
@@ -19,6 +21,14 @@ export class FiveOneEatClient {
19
21
  constructor(options = {}) {
20
22
  this._options = normalizeClientOptionsWithAuth(options);
21
23
  }
24
+ get businessMessaging() {
25
+ var _a;
26
+ return ((_a = this._businessMessaging) !== null && _a !== void 0 ? _a : (this._businessMessaging = new BusinessMessagingClient(this._options)));
27
+ }
28
+ get customerMessaging() {
29
+ var _a;
30
+ return ((_a = this._customerMessaging) !== null && _a !== void 0 ? _a : (this._customerMessaging = new CustomerMessagingClient(this._options)));
31
+ }
22
32
  get customerMyAccount() {
23
33
  var _a;
24
34
  return ((_a = this._customerMyAccount) !== null && _a !== void 0 ? _a : (this._customerMyAccount = new CustomerMyAccountClient(this._options)));
@@ -0,0 +1,27 @@
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 * as FiveOneEat from "../../../index.mjs";
5
+ export declare namespace BusinessMessagingClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class BusinessMessagingClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<BusinessMessagingClient.Options>;
12
+ constructor(options?: BusinessMessagingClient.Options);
13
+ /**
14
+ * @param {FiveOneEat.SearchBusinessConversationsRequest} request
15
+ * @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ *
17
+ * @throws {@link FiveOneEat.UnauthorizedError}
18
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
19
+ *
20
+ * @example
21
+ * await client.businessMessaging.searchBusinessConversations({
22
+ * q: "john"
23
+ * })
24
+ */
25
+ searchBusinessConversations(request: FiveOneEat.SearchBusinessConversationsRequest, requestOptions?: BusinessMessagingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.SearchBusinessConversationsResponse>;
26
+ private __searchBusinessConversations;
27
+ }
@@ -0,0 +1,87 @@
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
+ import * as FiveOneEat from "../../../index.mjs";
18
+ export class BusinessMessagingClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * @param {FiveOneEat.SearchBusinessConversationsRequest} request
24
+ * @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
25
+ *
26
+ * @throws {@link FiveOneEat.UnauthorizedError}
27
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
28
+ *
29
+ * @example
30
+ * await client.businessMessaging.searchBusinessConversations({
31
+ * q: "john"
32
+ * })
33
+ */
34
+ searchBusinessConversations(request, requestOptions) {
35
+ return core.HttpResponsePromise.fromPromise(this.__searchBusinessConversations(request, requestOptions));
36
+ }
37
+ __searchBusinessConversations(request, requestOptions) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
+ const { q, page, per_page: perPage } = request;
41
+ const _queryParams = {
42
+ q,
43
+ page,
44
+ per_page: perPage,
45
+ };
46
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
47
+ 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);
48
+ const _response = yield core.fetcher({
49
+ 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/messaging/conversations/search"),
50
+ method: "GET",
51
+ headers: _headers,
52
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
53
+ queryString: core.url
54
+ .queryBuilder()
55
+ .addMany(_queryParams)
56
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
57
+ .build(),
58
+ 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,
59
+ 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,
60
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
61
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
62
+ logging: this._options.logging,
63
+ });
64
+ if (_response.ok) {
65
+ return {
66
+ data: _response.body,
67
+ rawResponse: _response.rawResponse,
68
+ };
69
+ }
70
+ if (_response.error.reason === "status-code") {
71
+ switch (_response.error.statusCode) {
72
+ case 401:
73
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
74
+ case 422:
75
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
76
+ default:
77
+ throw new errors.FiveOneEatError({
78
+ statusCode: _response.error.statusCode,
79
+ body: _response.error.body,
80
+ rawResponse: _response.rawResponse,
81
+ });
82
+ }
83
+ }
84
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/messaging/conversations/search");
85
+ });
86
+ }
87
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * q: "john"
5
+ * }
6
+ */
7
+ export interface SearchBusinessConversationsRequest {
8
+ /** Customer name to search for */
9
+ q: string;
10
+ /** Page number for pagination */
11
+ page?: number;
12
+ /** Number of conversations per page */
13
+ per_page?: number;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { SearchBusinessConversationsRequest } from "./SearchBusinessConversationsRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { BusinessMessagingClient } 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 { BusinessMessagingClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.mjs";
2
+ export interface SearchBusinessConversationsResponse {
3
+ data: FiveOneEat.BusinessConversation[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./SearchBusinessConversationsResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./SearchBusinessConversationsResponse.mjs";
@@ -0,0 +1,27 @@
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 * as FiveOneEat from "../../../index.mjs";
5
+ export declare namespace CustomerMessagingClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class CustomerMessagingClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<CustomerMessagingClient.Options>;
12
+ constructor(options?: CustomerMessagingClient.Options);
13
+ /**
14
+ * @param {FiveOneEat.SearchCustomerConversationsRequest} request
15
+ * @param {CustomerMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ *
17
+ * @throws {@link FiveOneEat.UnauthorizedError}
18
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
19
+ *
20
+ * @example
21
+ * await client.customerMessaging.searchCustomerConversations({
22
+ * q: "pizza"
23
+ * })
24
+ */
25
+ searchCustomerConversations(request: FiveOneEat.SearchCustomerConversationsRequest, requestOptions?: CustomerMessagingClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.SearchCustomerConversationsResponse>;
26
+ private __searchCustomerConversations;
27
+ }
@@ -0,0 +1,87 @@
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
+ import * as FiveOneEat from "../../../index.mjs";
18
+ export class CustomerMessagingClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * @param {FiveOneEat.SearchCustomerConversationsRequest} request
24
+ * @param {CustomerMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
25
+ *
26
+ * @throws {@link FiveOneEat.UnauthorizedError}
27
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
28
+ *
29
+ * @example
30
+ * await client.customerMessaging.searchCustomerConversations({
31
+ * q: "pizza"
32
+ * })
33
+ */
34
+ searchCustomerConversations(request, requestOptions) {
35
+ return core.HttpResponsePromise.fromPromise(this.__searchCustomerConversations(request, requestOptions));
36
+ }
37
+ __searchCustomerConversations(request, requestOptions) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
+ const { q, page, per_page: perPage } = request;
41
+ const _queryParams = {
42
+ q,
43
+ page,
44
+ per_page: perPage,
45
+ };
46
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
47
+ 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);
48
+ const _response = yield core.fetcher({
49
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "customer/messaging/conversations/search"),
50
+ method: "GET",
51
+ headers: _headers,
52
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
53
+ queryString: core.url
54
+ .queryBuilder()
55
+ .addMany(_queryParams)
56
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
57
+ .build(),
58
+ 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,
59
+ 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,
60
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
61
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
62
+ logging: this._options.logging,
63
+ });
64
+ if (_response.ok) {
65
+ return {
66
+ data: _response.body,
67
+ rawResponse: _response.rawResponse,
68
+ };
69
+ }
70
+ if (_response.error.reason === "status-code") {
71
+ switch (_response.error.statusCode) {
72
+ case 401:
73
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
74
+ case 422:
75
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
76
+ default:
77
+ throw new errors.FiveOneEatError({
78
+ statusCode: _response.error.statusCode,
79
+ body: _response.error.body,
80
+ rawResponse: _response.rawResponse,
81
+ });
82
+ }
83
+ }
84
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/messaging/conversations/search");
85
+ });
86
+ }
87
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * q: "pizza"
5
+ * }
6
+ */
7
+ export interface SearchCustomerConversationsRequest {
8
+ /** Business name to search for */
9
+ q: string;
10
+ /** Page number for pagination */
11
+ page?: number;
12
+ /** Number of conversations per page */
13
+ per_page?: number;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { SearchCustomerConversationsRequest } from "./SearchCustomerConversationsRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { CustomerMessagingClient } 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 { CustomerMessagingClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,4 @@
1
+ import type * as FiveOneEat from "../../../index.mjs";
2
+ export interface SearchCustomerConversationsResponse {
3
+ data: FiveOneEat.Conversation[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./SearchCustomerConversationsResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./SearchCustomerConversationsResponse.mjs";
@@ -1,7 +1,13 @@
1
1
  export * as business from "./business/index.mjs";
2
+ export * from "./businessMessaging/client/requests/index.mjs";
3
+ export * as businessMessaging from "./businessMessaging/index.mjs";
4
+ export * from "./businessMessaging/types/index.mjs";
2
5
  export * from "./customer/client/requests/index.mjs";
3
6
  export * as customer from "./customer/index.mjs";
4
7
  export * from "./customer/types/index.mjs";
8
+ export * from "./customerMessaging/client/requests/index.mjs";
9
+ export * as customerMessaging from "./customerMessaging/index.mjs";
10
+ export * from "./customerMessaging/types/index.mjs";
5
11
  export * from "./customerMyAccount/client/requests/index.mjs";
6
12
  export * as customerMyAccount from "./customerMyAccount/index.mjs";
7
13
  export * from "./customerMyAccount/types/index.mjs";
@@ -1,7 +1,13 @@
1
1
  export * as business from "./business/index.mjs";
2
+ export * from "./businessMessaging/client/requests/index.mjs";
3
+ export * as businessMessaging from "./businessMessaging/index.mjs";
4
+ export * from "./businessMessaging/types/index.mjs";
2
5
  export * from "./customer/client/requests/index.mjs";
3
6
  export * as customer from "./customer/index.mjs";
4
7
  export * from "./customer/types/index.mjs";
8
+ export * from "./customerMessaging/client/requests/index.mjs";
9
+ export * as customerMessaging from "./customerMessaging/index.mjs";
10
+ export * from "./customerMessaging/types/index.mjs";
5
11
  export * from "./customerMyAccount/client/requests/index.mjs";
6
12
  export * as customerMyAccount from "./customerMyAccount/index.mjs";
7
13
  export * from "./customerMyAccount/types/index.mjs";