@51eat/sdk 0.0.20 → 0.0.21

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 (89) hide show
  1. package/README.md +13 -16
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +6 -0
  4. package/dist/cjs/Client.js +20 -10
  5. package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +32 -0
  6. package/dist/cjs/api/resources/businessMessaging/client/Client.js +118 -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/BusinessChannelAuthAuthenticateRequest.d.ts +13 -0
  10. package/dist/cjs/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.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 +1 -0
  16. package/dist/cjs/api/resources/businessMessaging/index.js +17 -0
  17. package/dist/cjs/api/resources/businessPushNotifications/client/Client.d.ts +47 -0
  18. package/dist/cjs/api/resources/businessPushNotifications/client/Client.js +182 -0
  19. package/dist/cjs/api/resources/businessPushNotifications/client/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/businessPushNotifications/client/index.js +17 -0
  21. package/dist/cjs/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.ts +9 -0
  22. package/dist/cjs/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.js +3 -0
  23. package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.d.ts +2 -0
  24. package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.js +5 -0
  25. package/dist/cjs/api/resources/businessPushNotifications/exports.d.ts +2 -0
  26. package/dist/cjs/api/resources/businessPushNotifications/exports.js +21 -0
  27. package/dist/cjs/api/resources/businessPushNotifications/index.d.ts +2 -0
  28. package/dist/cjs/api/resources/businessPushNotifications/index.js +18 -0
  29. package/dist/cjs/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.ts +7 -0
  30. package/dist/cjs/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.js +3 -0
  31. package/dist/cjs/api/resources/businessPushNotifications/types/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/businessPushNotifications/types/index.js +17 -0
  33. package/dist/cjs/api/resources/customer/resources/pushNotifications/client/Client.d.ts +2 -2
  34. package/dist/cjs/api/resources/customer/resources/pushNotifications/client/Client.js +1 -1
  35. package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.d.ts +19 -0
  36. package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.js +11 -0
  37. package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/index.d.ts +1 -1
  38. package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/index.js +3 -3
  39. package/dist/cjs/api/resources/index.d.ts +5 -0
  40. package/dist/cjs/api/resources/index.js +6 -1
  41. package/dist/cjs/version.d.ts +1 -1
  42. package/dist/cjs/version.js +1 -1
  43. package/dist/esm/BaseClient.mjs +2 -2
  44. package/dist/esm/Client.d.mts +6 -0
  45. package/dist/esm/Client.mjs +10 -0
  46. package/dist/esm/api/resources/businessMessaging/client/Client.d.mts +32 -0
  47. package/dist/esm/api/resources/businessMessaging/client/Client.mjs +81 -0
  48. package/dist/esm/api/resources/businessMessaging/client/index.d.mts +1 -0
  49. package/dist/esm/api/resources/businessMessaging/client/index.mjs +1 -0
  50. package/dist/esm/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.mts +13 -0
  51. package/dist/esm/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.mjs +2 -0
  52. package/dist/esm/api/resources/businessMessaging/client/requests/index.d.mts +1 -0
  53. package/dist/esm/api/resources/businessMessaging/client/requests/index.mjs +1 -0
  54. package/dist/esm/api/resources/businessMessaging/exports.d.mts +2 -0
  55. package/dist/esm/api/resources/businessMessaging/exports.mjs +3 -0
  56. package/dist/esm/api/resources/businessMessaging/index.d.mts +1 -0
  57. package/dist/esm/api/resources/businessMessaging/index.mjs +1 -0
  58. package/dist/esm/api/resources/businessPushNotifications/client/Client.d.mts +47 -0
  59. package/dist/esm/api/resources/businessPushNotifications/client/Client.mjs +145 -0
  60. package/dist/esm/api/resources/businessPushNotifications/client/index.d.mts +1 -0
  61. package/dist/esm/api/resources/businessPushNotifications/client/index.mjs +1 -0
  62. package/dist/esm/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.mts +9 -0
  63. package/dist/esm/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.mjs +2 -0
  64. package/dist/esm/api/resources/businessPushNotifications/client/requests/index.d.mts +2 -0
  65. package/dist/esm/api/resources/businessPushNotifications/client/requests/index.mjs +1 -0
  66. package/dist/esm/api/resources/businessPushNotifications/exports.d.mts +2 -0
  67. package/dist/esm/api/resources/businessPushNotifications/exports.mjs +3 -0
  68. package/dist/esm/api/resources/businessPushNotifications/index.d.mts +2 -0
  69. package/dist/esm/api/resources/businessPushNotifications/index.mjs +2 -0
  70. package/dist/esm/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.mts +7 -0
  71. package/dist/esm/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.mjs +2 -0
  72. package/dist/esm/api/resources/businessPushNotifications/types/index.d.mts +1 -0
  73. package/dist/esm/api/resources/businessPushNotifications/types/index.mjs +1 -0
  74. package/dist/esm/api/resources/customer/resources/pushNotifications/client/Client.d.mts +2 -2
  75. package/dist/esm/api/resources/customer/resources/pushNotifications/client/Client.mjs +1 -1
  76. package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.d.mts +19 -0
  77. package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.mjs +8 -0
  78. package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/index.d.mts +1 -1
  79. package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/index.mjs +1 -1
  80. package/dist/esm/api/resources/index.d.mts +5 -0
  81. package/dist/esm/api/resources/index.mjs +5 -0
  82. package/dist/esm/version.d.mts +1 -1
  83. package/dist/esm/version.mjs +1 -1
  84. package/package.json +23 -1
  85. package/reference.md +203 -1
  86. /package/dist/cjs/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.d.ts +0 -0
  87. /package/dist/cjs/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.js +0 -0
  88. /package/dist/esm/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.d.mts +0 -0
  89. /package/dist/esm/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.mjs +0 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * channel_name: "channel_name",
5
+ * socket_id: "socket_id"
6
+ * }
7
+ */
8
+ export interface BusinessChannelAuthAuthenticateRequest {
9
+ /** string */
10
+ channel_name: string;
11
+ /** string */
12
+ socket_id: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { BusinessChannelAuthAuthenticateRequest } from "./BusinessChannelAuthAuthenticateRequest.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 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,47 @@
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 BusinessPushNotificationsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class BusinessPushNotificationsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<BusinessPushNotificationsClient.Options>;
12
+ constructor(options?: BusinessPushNotificationsClient.Options);
13
+ /**
14
+ * Register (or update) the authenticated business user's Expo push token for a
15
+ * device. If a `device_id` is provided, an existing registration for that device
16
+ * is updated.
17
+ *
18
+ * @param {FiveOneEat.StorePushTokenRequest} request
19
+ * @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link FiveOneEat.UnauthorizedError}
22
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
23
+ *
24
+ * @example
25
+ * await client.businessPushNotifications.registerBusinessPushToken({
26
+ * token: "token"
27
+ * })
28
+ */
29
+ registerBusinessPushToken(request: FiveOneEat.StorePushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.RegisterBusinessPushTokenResponse>;
30
+ private __registerBusinessPushToken;
31
+ /**
32
+ * Delete the authenticated business user's Expo push token registration.
33
+ *
34
+ * @param {FiveOneEat.UnregisterBusinessPushTokenRequest} request
35
+ * @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link FiveOneEat.UnauthorizedError}
38
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
39
+ *
40
+ * @example
41
+ * await client.businessPushNotifications.unregisterBusinessPushToken({
42
+ * token: "token"
43
+ * })
44
+ */
45
+ unregisterBusinessPushToken(request: FiveOneEat.UnregisterBusinessPushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<void>;
46
+ private __unregisterBusinessPushToken;
47
+ }
@@ -0,0 +1,145 @@
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 BusinessPushNotificationsClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Register (or update) the authenticated business user's Expo push token for a
24
+ * device. If a `device_id` is provided, an existing registration for that device
25
+ * is updated.
26
+ *
27
+ * @param {FiveOneEat.StorePushTokenRequest} request
28
+ * @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link FiveOneEat.UnauthorizedError}
31
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
32
+ *
33
+ * @example
34
+ * await client.businessPushNotifications.registerBusinessPushToken({
35
+ * token: "token"
36
+ * })
37
+ */
38
+ registerBusinessPushToken(request, requestOptions) {
39
+ return core.HttpResponsePromise.fromPromise(this.__registerBusinessPushToken(request, requestOptions));
40
+ }
41
+ __registerBusinessPushToken(request, requestOptions) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
44
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
45
+ 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);
46
+ const _response = yield core.fetcher({
47
+ 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/push-tokens"),
48
+ method: "POST",
49
+ headers: _headers,
50
+ contentType: "application/json",
51
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
52
+ requestType: "json",
53
+ body: request,
54
+ 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,
55
+ 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,
56
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
57
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
58
+ logging: this._options.logging,
59
+ });
60
+ if (_response.ok) {
61
+ return {
62
+ data: _response.body,
63
+ rawResponse: _response.rawResponse,
64
+ };
65
+ }
66
+ if (_response.error.reason === "status-code") {
67
+ switch (_response.error.statusCode) {
68
+ case 401:
69
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
70
+ case 422:
71
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
72
+ default:
73
+ throw new errors.FiveOneEatError({
74
+ statusCode: _response.error.statusCode,
75
+ body: _response.error.body,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ }
79
+ }
80
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/push-tokens");
81
+ });
82
+ }
83
+ /**
84
+ * Delete the authenticated business user's Expo push token registration.
85
+ *
86
+ * @param {FiveOneEat.UnregisterBusinessPushTokenRequest} request
87
+ * @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
88
+ *
89
+ * @throws {@link FiveOneEat.UnauthorizedError}
90
+ * @throws {@link FiveOneEat.UnprocessableEntityError}
91
+ *
92
+ * @example
93
+ * await client.businessPushNotifications.unregisterBusinessPushToken({
94
+ * token: "token"
95
+ * })
96
+ */
97
+ unregisterBusinessPushToken(request, requestOptions) {
98
+ return core.HttpResponsePromise.fromPromise(this.__unregisterBusinessPushToken(request, requestOptions));
99
+ }
100
+ __unregisterBusinessPushToken(request, requestOptions) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
103
+ const { token } = request;
104
+ const _queryParams = {
105
+ token,
106
+ };
107
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
108
+ 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);
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/push-tokens"),
111
+ method: "DELETE",
112
+ headers: _headers,
113
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
114
+ queryString: core.url
115
+ .queryBuilder()
116
+ .addMany(_queryParams)
117
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
118
+ .build(),
119
+ 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,
120
+ 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,
121
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
122
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
123
+ logging: this._options.logging,
124
+ });
125
+ if (_response.ok) {
126
+ return { data: undefined, rawResponse: _response.rawResponse };
127
+ }
128
+ if (_response.error.reason === "status-code") {
129
+ switch (_response.error.statusCode) {
130
+ case 401:
131
+ throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
132
+ case 422:
133
+ throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
134
+ default:
135
+ throw new errors.FiveOneEatError({
136
+ statusCode: _response.error.statusCode,
137
+ body: _response.error.body,
138
+ rawResponse: _response.rawResponse,
139
+ });
140
+ }
141
+ }
142
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/business/push-tokens");
143
+ });
144
+ }
145
+ }
@@ -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
+ * token: "token"
5
+ * }
6
+ */
7
+ export interface UnregisterBusinessPushTokenRequest {
8
+ token: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,2 @@
1
+ export { StorePushTokenRequest } from "./StorePushTokenRequest.mjs";
2
+ export type { UnregisterBusinessPushTokenRequest } from "./UnregisterBusinessPushTokenRequest.mjs";
@@ -0,0 +1 @@
1
+ export { StorePushTokenRequest } from "./StorePushTokenRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { BusinessPushNotificationsClient } 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 { BusinessPushNotificationsClient } 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,7 @@
1
+ export interface RegisterBusinessPushTokenResponse {
2
+ id: string;
3
+ token: string;
4
+ device_id: string;
5
+ device_name: string;
6
+ platform: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./RegisterBusinessPushTokenResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./RegisterBusinessPushTokenResponse.mjs";
@@ -14,7 +14,7 @@ export declare class PushNotificationsClient {
14
14
  * Register (or update) the authenticated user's Expo push token for a device. If
15
15
  * a `device_id` is provided, an existing registration for that device is updated.
16
16
  *
17
- * @param {FiveOneEat.customer.StorePushTokenRequest} request
17
+ * @param {FiveOneEat.customer.AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest} request
18
18
  * @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
19
19
  *
20
20
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -25,7 +25,7 @@ export declare class PushNotificationsClient {
25
25
  * token: "token"
26
26
  * })
27
27
  */
28
- register(request: FiveOneEat.customer.StorePushTokenRequest, requestOptions?: PushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.RegisterPushNotificationsResponse>;
28
+ register(request: FiveOneEat.customer.AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest, requestOptions?: PushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.customer.RegisterPushNotificationsResponse>;
29
29
  private __register;
30
30
  /**
31
31
  * Delete the authenticated user's Expo push token registration.
@@ -23,7 +23,7 @@ export class PushNotificationsClient {
23
23
  * Register (or update) the authenticated user's Expo push token for a device. If
24
24
  * a `device_id` is provided, an existing registration for that device is updated.
25
25
  *
26
- * @param {FiveOneEat.customer.StorePushTokenRequest} request
26
+ * @param {FiveOneEat.customer.AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest} request
27
27
  * @param {PushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
29
  * @throws {@link FiveOneEat.UnauthorizedError}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * token: "token"
5
+ * }
6
+ */
7
+ export interface AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest {
8
+ token: string;
9
+ device_id?: string | null;
10
+ device_name?: string | null;
11
+ platform?: AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.Platform | null;
12
+ }
13
+ export declare namespace AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest {
14
+ const Platform: {
15
+ readonly Ios: "ios";
16
+ readonly Android: "android";
17
+ };
18
+ type Platform = (typeof Platform)[keyof typeof Platform];
19
+ }
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest;
3
+ (function (AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest) {
4
+ AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.Platform = {
5
+ Ios: "ios",
6
+ Android: "android",
7
+ };
8
+ })(AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest || (AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest = {}));
@@ -1,2 +1,2 @@
1
- export { StorePushTokenRequest } from "./StorePushTokenRequest.mjs";
1
+ export { AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest } from "./AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.mjs";
2
2
  export type { UnregisterPushNotificationsRequest } from "./UnregisterPushNotificationsRequest.mjs";
@@ -1 +1 @@
1
- export { StorePushTokenRequest } from "./StorePushTokenRequest.mjs";
1
+ export { AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest } from "./AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.mjs";
@@ -1,4 +1,9 @@
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 "./businessPushNotifications/client/requests/index.mjs";
5
+ export * as businessPushNotifications from "./businessPushNotifications/index.mjs";
6
+ export * from "./businessPushNotifications/types/index.mjs";
2
7
  export * from "./customer/client/requests/index.mjs";
3
8
  export * as customer from "./customer/index.mjs";
4
9
  export * from "./customer/types/index.mjs";
@@ -1,4 +1,9 @@
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 "./businessPushNotifications/client/requests/index.mjs";
5
+ export * as businessPushNotifications from "./businessPushNotifications/index.mjs";
6
+ export * from "./businessPushNotifications/types/index.mjs";
2
7
  export * from "./customer/client/requests/index.mjs";
3
8
  export * as customer from "./customer/index.mjs";
4
9
  export * from "./customer/types/index.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.20";
1
+ export declare const SDK_VERSION = "0.0.21";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.20";
1
+ export const SDK_VERSION = "0.0.21";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@51eat/sdk",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,6 +22,28 @@
22
22
  },
23
23
  "default": "./dist/cjs/index.js"
24
24
  },
25
+ "./businessMessaging": {
26
+ "import": {
27
+ "types": "./dist/esm/api/resources/businessMessaging/exports.d.mts",
28
+ "default": "./dist/esm/api/resources/businessMessaging/exports.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/cjs/api/resources/businessMessaging/exports.d.ts",
32
+ "default": "./dist/cjs/api/resources/businessMessaging/exports.js"
33
+ },
34
+ "default": "./dist/cjs/api/resources/businessMessaging/exports.js"
35
+ },
36
+ "./businessPushNotifications": {
37
+ "import": {
38
+ "types": "./dist/esm/api/resources/businessPushNotifications/exports.d.mts",
39
+ "default": "./dist/esm/api/resources/businessPushNotifications/exports.mjs"
40
+ },
41
+ "require": {
42
+ "types": "./dist/cjs/api/resources/businessPushNotifications/exports.d.ts",
43
+ "default": "./dist/cjs/api/resources/businessPushNotifications/exports.js"
44
+ },
45
+ "default": "./dist/cjs/api/resources/businessPushNotifications/exports.js"
46
+ },
25
47
  "./customerEvents": {
26
48
  "import": {
27
49
  "types": "./dist/esm/api/resources/customerEvents/exports.d.mts",
package/reference.md CHANGED
@@ -1,4 +1,206 @@
1
1
  # Reference
2
+ ## Business: Messaging
3
+ <details><summary><code>client.businessMessaging.<a href="/src/api/resources/businessMessaging/client/Client.ts">businessChannelAuthAuthenticate</a>({ ...params }) -> number</code></summary>
4
+ <dl>
5
+ <dd>
6
+
7
+ #### 📝 Description
8
+
9
+ <dl>
10
+ <dd>
11
+
12
+ <dl>
13
+ <dd>
14
+
15
+ This endpoint is used by the business companion mobile app to authenticate with
16
+ Pusher channels. It validates that the authenticated business user has
17
+ permission to access the requested channel, scoped to their active business.
18
+ </dd>
19
+ </dl>
20
+ </dd>
21
+ </dl>
22
+
23
+ #### 🔌 Usage
24
+
25
+ <dl>
26
+ <dd>
27
+
28
+ <dl>
29
+ <dd>
30
+
31
+ ```typescript
32
+ await client.businessMessaging.businessChannelAuthAuthenticate({
33
+ channel_name: "channel_name",
34
+ socket_id: "socket_id"
35
+ });
36
+
37
+ ```
38
+ </dd>
39
+ </dl>
40
+ </dd>
41
+ </dl>
42
+
43
+ #### ⚙️ Parameters
44
+
45
+ <dl>
46
+ <dd>
47
+
48
+ <dl>
49
+ <dd>
50
+
51
+ **request:** `FiveOneEat.BusinessChannelAuthAuthenticateRequest`
52
+
53
+ </dd>
54
+ </dl>
55
+
56
+ <dl>
57
+ <dd>
58
+
59
+ **requestOptions:** `BusinessMessagingClient.RequestOptions`
60
+
61
+ </dd>
62
+ </dl>
63
+ </dd>
64
+ </dl>
65
+
66
+
67
+ </dd>
68
+ </dl>
69
+ </details>
70
+
71
+ ## Business: Push Notifications
72
+ <details><summary><code>client.businessPushNotifications.<a href="/src/api/resources/businessPushNotifications/client/Client.ts">registerBusinessPushToken</a>({ ...params }) -> FiveOneEat.RegisterBusinessPushTokenResponse</code></summary>
73
+ <dl>
74
+ <dd>
75
+
76
+ #### 📝 Description
77
+
78
+ <dl>
79
+ <dd>
80
+
81
+ <dl>
82
+ <dd>
83
+
84
+ Register (or update) the authenticated business user's Expo push token for a
85
+ device. If a `device_id` is provided, an existing registration for that device
86
+ is updated.
87
+ </dd>
88
+ </dl>
89
+ </dd>
90
+ </dl>
91
+
92
+ #### 🔌 Usage
93
+
94
+ <dl>
95
+ <dd>
96
+
97
+ <dl>
98
+ <dd>
99
+
100
+ ```typescript
101
+ await client.businessPushNotifications.registerBusinessPushToken({
102
+ token: "token"
103
+ });
104
+
105
+ ```
106
+ </dd>
107
+ </dl>
108
+ </dd>
109
+ </dl>
110
+
111
+ #### ⚙️ Parameters
112
+
113
+ <dl>
114
+ <dd>
115
+
116
+ <dl>
117
+ <dd>
118
+
119
+ **request:** `FiveOneEat.StorePushTokenRequest`
120
+
121
+ </dd>
122
+ </dl>
123
+
124
+ <dl>
125
+ <dd>
126
+
127
+ **requestOptions:** `BusinessPushNotificationsClient.RequestOptions`
128
+
129
+ </dd>
130
+ </dl>
131
+ </dd>
132
+ </dl>
133
+
134
+
135
+ </dd>
136
+ </dl>
137
+ </details>
138
+
139
+ <details><summary><code>client.businessPushNotifications.<a href="/src/api/resources/businessPushNotifications/client/Client.ts">unregisterBusinessPushToken</a>({ ...params }) -> void</code></summary>
140
+ <dl>
141
+ <dd>
142
+
143
+ #### 📝 Description
144
+
145
+ <dl>
146
+ <dd>
147
+
148
+ <dl>
149
+ <dd>
150
+
151
+ Delete the authenticated business user's Expo push token registration.
152
+ </dd>
153
+ </dl>
154
+ </dd>
155
+ </dl>
156
+
157
+ #### 🔌 Usage
158
+
159
+ <dl>
160
+ <dd>
161
+
162
+ <dl>
163
+ <dd>
164
+
165
+ ```typescript
166
+ await client.businessPushNotifications.unregisterBusinessPushToken({
167
+ token: "token"
168
+ });
169
+
170
+ ```
171
+ </dd>
172
+ </dl>
173
+ </dd>
174
+ </dl>
175
+
176
+ #### ⚙️ Parameters
177
+
178
+ <dl>
179
+ <dd>
180
+
181
+ <dl>
182
+ <dd>
183
+
184
+ **request:** `FiveOneEat.UnregisterBusinessPushTokenRequest`
185
+
186
+ </dd>
187
+ </dl>
188
+
189
+ <dl>
190
+ <dd>
191
+
192
+ **requestOptions:** `BusinessPushNotificationsClient.RequestOptions`
193
+
194
+ </dd>
195
+ </dl>
196
+ </dd>
197
+ </dl>
198
+
199
+
200
+ </dd>
201
+ </dl>
202
+ </details>
203
+
2
204
  ## Customer: Events
3
205
  <details><summary><code>client.customerEvents.<a href="/src/api/resources/customerEvents/client/Client.ts">holdTickets</a>({ ...params }) -> FiveOneEat.HoldTicketsResponse</code></summary>
4
206
  <dl>
@@ -5390,7 +5592,7 @@ await client.customer.pushNotifications.register({
5390
5592
  <dl>
5391
5593
  <dd>
5392
5594
 
5393
- **request:** `FiveOneEat.customer.StorePushTokenRequest`
5595
+ **request:** `FiveOneEat.customer.AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest`
5394
5596
 
5395
5597
  </dd>
5396
5598
  </dl>