@51eat/sdk 0.0.21 → 0.0.22

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 (104) hide show
  1. package/README.md +16 -13
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +0 -6
  4. package/dist/cjs/Client.js +10 -20
  5. package/dist/cjs/api/resources/business/client/Client.d.ts +5 -2
  6. package/dist/cjs/api/resources/business/client/Client.js +7 -2
  7. package/dist/cjs/api/resources/business/resources/index.d.ts +4 -0
  8. package/dist/cjs/api/resources/business/resources/index.js +5 -1
  9. package/dist/cjs/api/resources/business/resources/messaging/client/Client.d.ts +24 -1
  10. package/dist/cjs/api/resources/business/resources/messaging/client/Client.js +107 -0
  11. package/dist/cjs/api/resources/business/resources/messaging/client/index.d.ts +1 -1
  12. package/dist/cjs/api/resources/business/resources/messaging/client/index.js +15 -0
  13. package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.ts → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.d.ts} +1 -1
  14. package/dist/cjs/api/resources/business/resources/messaging/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/business/resources/pushNotifications/client/Client.d.ts +47 -0
  16. package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/Client.js +22 -22
  17. package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.ts → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.d.ts} +1 -1
  18. package/dist/cjs/api/resources/business/resources/pushNotifications/client/requests/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/business/resources/pushNotifications/exports.d.ts +2 -0
  20. package/dist/cjs/api/resources/{businessMessaging → business/resources/pushNotifications}/exports.js +2 -2
  21. package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.ts → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.ts} +1 -1
  22. package/dist/cjs/api/resources/business/resources/pushNotifications/types/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/types/index.js +1 -1
  24. package/dist/cjs/api/resources/index.d.ts +0 -5
  25. package/dist/cjs/api/resources/index.js +1 -6
  26. package/dist/cjs/version.d.ts +1 -1
  27. package/dist/cjs/version.js +1 -1
  28. package/dist/esm/BaseClient.mjs +2 -2
  29. package/dist/esm/Client.d.mts +0 -6
  30. package/dist/esm/Client.mjs +0 -10
  31. package/dist/esm/api/resources/business/client/Client.d.mts +5 -2
  32. package/dist/esm/api/resources/business/client/Client.mjs +7 -2
  33. package/dist/esm/api/resources/business/resources/index.d.mts +4 -0
  34. package/dist/esm/api/resources/business/resources/index.mjs +4 -0
  35. package/dist/esm/api/resources/business/resources/messaging/client/Client.d.mts +24 -1
  36. package/dist/esm/api/resources/business/resources/messaging/client/Client.mjs +74 -0
  37. package/dist/esm/api/resources/business/resources/messaging/client/index.d.mts +1 -1
  38. package/dist/esm/api/resources/business/resources/messaging/client/index.mjs +1 -1
  39. package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.mts → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.d.mts} +1 -1
  40. package/dist/esm/api/resources/business/resources/messaging/client/requests/index.d.mts +1 -0
  41. package/dist/esm/api/resources/business/resources/pushNotifications/client/Client.d.mts +47 -0
  42. package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/Client.mjs +20 -20
  43. package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.mts → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.d.mts} +1 -1
  44. package/dist/esm/api/resources/business/resources/pushNotifications/client/requests/index.d.mts +2 -0
  45. package/dist/esm/api/resources/business/resources/pushNotifications/exports.d.mts +2 -0
  46. package/dist/esm/api/resources/{businessMessaging → business/resources/pushNotifications}/exports.mjs +1 -1
  47. package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.mts → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.d.mts} +1 -1
  48. package/dist/esm/api/resources/business/resources/pushNotifications/types/index.d.mts +1 -0
  49. package/dist/esm/api/resources/business/resources/pushNotifications/types/index.mjs +1 -0
  50. package/dist/esm/api/resources/index.d.mts +0 -5
  51. package/dist/esm/api/resources/index.mjs +0 -5
  52. package/dist/esm/version.d.mts +1 -1
  53. package/dist/esm/version.mjs +1 -1
  54. package/package.json +23 -34
  55. package/reference.md +202 -202
  56. package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +0 -32
  57. package/dist/cjs/api/resources/businessMessaging/client/Client.js +0 -118
  58. package/dist/cjs/api/resources/businessMessaging/client/requests/index.d.ts +0 -1
  59. package/dist/cjs/api/resources/businessMessaging/exports.d.ts +0 -2
  60. package/dist/cjs/api/resources/businessMessaging/index.d.ts +0 -1
  61. package/dist/cjs/api/resources/businessMessaging/index.js +0 -17
  62. package/dist/cjs/api/resources/businessPushNotifications/client/Client.d.ts +0 -47
  63. package/dist/cjs/api/resources/businessPushNotifications/client/index.d.ts +0 -1
  64. package/dist/cjs/api/resources/businessPushNotifications/client/index.js +0 -17
  65. package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.d.ts +0 -2
  66. package/dist/cjs/api/resources/businessPushNotifications/exports.d.ts +0 -2
  67. package/dist/cjs/api/resources/businessPushNotifications/exports.js +0 -21
  68. package/dist/cjs/api/resources/businessPushNotifications/types/index.d.ts +0 -1
  69. package/dist/esm/api/resources/businessMessaging/client/Client.d.mts +0 -32
  70. package/dist/esm/api/resources/businessMessaging/client/Client.mjs +0 -81
  71. package/dist/esm/api/resources/businessMessaging/client/requests/index.d.mts +0 -1
  72. package/dist/esm/api/resources/businessMessaging/exports.d.mts +0 -2
  73. package/dist/esm/api/resources/businessMessaging/index.d.mts +0 -1
  74. package/dist/esm/api/resources/businessMessaging/index.mjs +0 -1
  75. package/dist/esm/api/resources/businessPushNotifications/client/Client.d.mts +0 -47
  76. package/dist/esm/api/resources/businessPushNotifications/client/index.d.mts +0 -1
  77. package/dist/esm/api/resources/businessPushNotifications/client/index.mjs +0 -1
  78. package/dist/esm/api/resources/businessPushNotifications/client/requests/index.d.mts +0 -2
  79. package/dist/esm/api/resources/businessPushNotifications/exports.d.mts +0 -2
  80. package/dist/esm/api/resources/businessPushNotifications/exports.mjs +0 -3
  81. package/dist/esm/api/resources/businessPushNotifications/types/index.d.mts +0 -1
  82. package/dist/esm/api/resources/businessPushNotifications/types/index.mjs +0 -1
  83. /package/dist/cjs/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.js → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.js} +0 -0
  84. /package/dist/cjs/api/resources/{businessMessaging → business/resources/messaging}/client/requests/index.js +0 -0
  85. /package/dist/cjs/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.d.ts +0 -0
  86. /package/dist/cjs/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.js +0 -0
  87. /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.d.ts +0 -0
  88. /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.js +0 -0
  89. /package/dist/cjs/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.js → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.js} +0 -0
  90. /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/index.js +0 -0
  91. /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.d.ts +0 -0
  92. /package/dist/cjs/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.js +0 -0
  93. /package/dist/cjs/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.js → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.js} +0 -0
  94. /package/dist/esm/api/resources/{businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.mjs → business/resources/messaging/client/requests/ChannelAuthMessagingRequest.mjs} +0 -0
  95. /package/dist/esm/api/resources/{businessMessaging → business/resources/messaging}/client/requests/index.mjs +0 -0
  96. /package/dist/esm/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.d.mts +0 -0
  97. /package/dist/esm/api/resources/{businessMessaging → business/resources/pushNotifications}/client/index.mjs +0 -0
  98. /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.d.mts +0 -0
  99. /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/StorePushTokenRequest.mjs +0 -0
  100. /package/dist/esm/api/resources/{businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.mjs → business/resources/pushNotifications/client/requests/UnregisterPushNotificationsRequest.mjs} +0 -0
  101. /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/client/requests/index.mjs +0 -0
  102. /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.d.mts +0 -0
  103. /package/dist/esm/api/resources/{businessPushNotifications → business/resources/pushNotifications}/index.mjs +0 -0
  104. /package/dist/esm/api/resources/{businessPushNotifications/types/RegisterBusinessPushTokenResponse.mjs → business/resources/pushNotifications/types/RegisterPushNotificationsResponse.mjs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@51eat/sdk",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,28 +22,6 @@
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
- },
47
25
  "./customerEvents": {
48
26
  "import": {
49
27
  "types": "./dist/esm/api/resources/customerEvents/exports.d.mts",
@@ -154,6 +132,17 @@
154
132
  },
155
133
  "default": "./dist/cjs/api/resources/business/resources/menus/exports.js"
156
134
  },
135
+ "./business/messaging": {
136
+ "import": {
137
+ "types": "./dist/esm/api/resources/business/resources/messaging/exports.d.mts",
138
+ "default": "./dist/esm/api/resources/business/resources/messaging/exports.mjs"
139
+ },
140
+ "require": {
141
+ "types": "./dist/cjs/api/resources/business/resources/messaging/exports.d.ts",
142
+ "default": "./dist/cjs/api/resources/business/resources/messaging/exports.js"
143
+ },
144
+ "default": "./dist/cjs/api/resources/business/resources/messaging/exports.js"
145
+ },
157
146
  "./business/profile": {
158
147
  "import": {
159
148
  "types": "./dist/esm/api/resources/business/resources/profile/exports.d.mts",
@@ -165,6 +154,17 @@
165
154
  },
166
155
  "default": "./dist/cjs/api/resources/business/resources/profile/exports.js"
167
156
  },
157
+ "./business/pushNotifications": {
158
+ "import": {
159
+ "types": "./dist/esm/api/resources/business/resources/pushNotifications/exports.d.mts",
160
+ "default": "./dist/esm/api/resources/business/resources/pushNotifications/exports.mjs"
161
+ },
162
+ "require": {
163
+ "types": "./dist/cjs/api/resources/business/resources/pushNotifications/exports.d.ts",
164
+ "default": "./dist/cjs/api/resources/business/resources/pushNotifications/exports.js"
165
+ },
166
+ "default": "./dist/cjs/api/resources/business/resources/pushNotifications/exports.js"
167
+ },
168
168
  "./business/auth/tokens": {
169
169
  "import": {
170
170
  "types": "./dist/esm/api/resources/business/resources/auth/resources/tokens/exports.d.mts",
@@ -220,17 +220,6 @@
220
220
  },
221
221
  "default": "./dist/cjs/api/resources/business/resources/menus/resources/items/resources/modifiers/exports.js"
222
222
  },
223
- "./business/messaging": {
224
- "import": {
225
- "types": "./dist/esm/api/resources/business/resources/messaging/exports.d.mts",
226
- "default": "./dist/esm/api/resources/business/resources/messaging/exports.mjs"
227
- },
228
- "require": {
229
- "types": "./dist/cjs/api/resources/business/resources/messaging/exports.d.ts",
230
- "default": "./dist/cjs/api/resources/business/resources/messaging/exports.js"
231
- },
232
- "default": "./dist/cjs/api/resources/business/resources/messaging/exports.js"
233
- },
234
223
  "./business/messaging/conversations": {
235
224
  "import": {
236
225
  "types": "./dist/esm/api/resources/business/resources/messaging/resources/conversations/exports.d.mts",
package/reference.md CHANGED
@@ -1,206 +1,4 @@
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
-
204
2
  ## Customer: Events
205
3
  <details><summary><code>client.customerEvents.<a href="/src/api/resources/customerEvents/client/Client.ts">holdTickets</a>({ ...params }) -> FiveOneEat.HoldTicketsResponse</code></summary>
206
4
  <dl>
@@ -2081,6 +1879,75 @@ await client.business.menus.delete({
2081
1879
  </dl>
2082
1880
 
2083
1881
 
1882
+ </dd>
1883
+ </dl>
1884
+ </details>
1885
+
1886
+ ## Business Messaging
1887
+ <details><summary><code>client.business.messaging.<a href="/src/api/resources/business/resources/messaging/client/Client.ts">channelAuth</a>({ ...params }) -> number</code></summary>
1888
+ <dl>
1889
+ <dd>
1890
+
1891
+ #### 📝 Description
1892
+
1893
+ <dl>
1894
+ <dd>
1895
+
1896
+ <dl>
1897
+ <dd>
1898
+
1899
+ This endpoint is used by the business companion mobile app to authenticate with
1900
+ Pusher channels. It validates that the authenticated business user has
1901
+ permission to access the requested channel, scoped to their active business.
1902
+ </dd>
1903
+ </dl>
1904
+ </dd>
1905
+ </dl>
1906
+
1907
+ #### 🔌 Usage
1908
+
1909
+ <dl>
1910
+ <dd>
1911
+
1912
+ <dl>
1913
+ <dd>
1914
+
1915
+ ```typescript
1916
+ await client.business.messaging.channelAuth({
1917
+ channel_name: "channel_name",
1918
+ socket_id: "socket_id"
1919
+ });
1920
+
1921
+ ```
1922
+ </dd>
1923
+ </dl>
1924
+ </dd>
1925
+ </dl>
1926
+
1927
+ #### ⚙️ Parameters
1928
+
1929
+ <dl>
1930
+ <dd>
1931
+
1932
+ <dl>
1933
+ <dd>
1934
+
1935
+ **request:** `FiveOneEat.business.ChannelAuthMessagingRequest`
1936
+
1937
+ </dd>
1938
+ </dl>
1939
+
1940
+ <dl>
1941
+ <dd>
1942
+
1943
+ **requestOptions:** `MessagingClient.RequestOptions`
1944
+
1945
+ </dd>
1946
+ </dl>
1947
+ </dd>
1948
+ </dl>
1949
+
1950
+
2084
1951
  </dd>
2085
1952
  </dl>
2086
1953
  </details>
@@ -2330,6 +2197,139 @@ await client.business.profile.syncCertifications({
2330
2197
  </dl>
2331
2198
 
2332
2199
 
2200
+ </dd>
2201
+ </dl>
2202
+ </details>
2203
+
2204
+ ## Business PushNotifications
2205
+ <details><summary><code>client.business.pushNotifications.<a href="/src/api/resources/business/resources/pushNotifications/client/Client.ts">register</a>({ ...params }) -> FiveOneEat.RegisterPushNotificationsResponse</code></summary>
2206
+ <dl>
2207
+ <dd>
2208
+
2209
+ #### 📝 Description
2210
+
2211
+ <dl>
2212
+ <dd>
2213
+
2214
+ <dl>
2215
+ <dd>
2216
+
2217
+ Register (or update) the authenticated business user's Expo push token for a
2218
+ device. If a `device_id` is provided, an existing registration for that device
2219
+ is updated.
2220
+ </dd>
2221
+ </dl>
2222
+ </dd>
2223
+ </dl>
2224
+
2225
+ #### 🔌 Usage
2226
+
2227
+ <dl>
2228
+ <dd>
2229
+
2230
+ <dl>
2231
+ <dd>
2232
+
2233
+ ```typescript
2234
+ await client.business.pushNotifications.register({
2235
+ token: "token"
2236
+ });
2237
+
2238
+ ```
2239
+ </dd>
2240
+ </dl>
2241
+ </dd>
2242
+ </dl>
2243
+
2244
+ #### ⚙️ Parameters
2245
+
2246
+ <dl>
2247
+ <dd>
2248
+
2249
+ <dl>
2250
+ <dd>
2251
+
2252
+ **request:** `FiveOneEat.business.StorePushTokenRequest`
2253
+
2254
+ </dd>
2255
+ </dl>
2256
+
2257
+ <dl>
2258
+ <dd>
2259
+
2260
+ **requestOptions:** `PushNotificationsClient.RequestOptions`
2261
+
2262
+ </dd>
2263
+ </dl>
2264
+ </dd>
2265
+ </dl>
2266
+
2267
+
2268
+ </dd>
2269
+ </dl>
2270
+ </details>
2271
+
2272
+ <details><summary><code>client.business.pushNotifications.<a href="/src/api/resources/business/resources/pushNotifications/client/Client.ts">unregister</a>({ ...params }) -> void</code></summary>
2273
+ <dl>
2274
+ <dd>
2275
+
2276
+ #### 📝 Description
2277
+
2278
+ <dl>
2279
+ <dd>
2280
+
2281
+ <dl>
2282
+ <dd>
2283
+
2284
+ Delete the authenticated business user's Expo push token registration.
2285
+ </dd>
2286
+ </dl>
2287
+ </dd>
2288
+ </dl>
2289
+
2290
+ #### 🔌 Usage
2291
+
2292
+ <dl>
2293
+ <dd>
2294
+
2295
+ <dl>
2296
+ <dd>
2297
+
2298
+ ```typescript
2299
+ await client.business.pushNotifications.unregister({
2300
+ token: "token"
2301
+ });
2302
+
2303
+ ```
2304
+ </dd>
2305
+ </dl>
2306
+ </dd>
2307
+ </dl>
2308
+
2309
+ #### ⚙️ Parameters
2310
+
2311
+ <dl>
2312
+ <dd>
2313
+
2314
+ <dl>
2315
+ <dd>
2316
+
2317
+ **request:** `FiveOneEat.business.UnregisterPushNotificationsRequest`
2318
+
2319
+ </dd>
2320
+ </dl>
2321
+
2322
+ <dl>
2323
+ <dd>
2324
+
2325
+ **requestOptions:** `PushNotificationsClient.RequestOptions`
2326
+
2327
+ </dd>
2328
+ </dl>
2329
+ </dd>
2330
+ </dl>
2331
+
2332
+
2333
2333
  </dd>
2334
2334
  </dl>
2335
2335
  </details>
@@ -1,32 +0,0 @@
1
- import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
- import * as core from "../../../../core/index.js";
4
- import * as FiveOneEat from "../../../index.js";
5
- export declare namespace 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
- * This endpoint is used by the business companion mobile app to authenticate with
15
- * Pusher channels. It validates that the authenticated business user has
16
- * permission to access the requested channel, scoped to their active business.
17
- *
18
- * @param {FiveOneEat.BusinessChannelAuthAuthenticateRequest} request
19
- * @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
20
- *
21
- * @throws {@link FiveOneEat.UnauthorizedError}
22
- * @throws {@link FiveOneEat.UnprocessableEntityError}
23
- *
24
- * @example
25
- * await client.businessMessaging.businessChannelAuthAuthenticate({
26
- * channel_name: "channel_name",
27
- * socket_id: "socket_id"
28
- * })
29
- */
30
- businessChannelAuthAuthenticate(request: FiveOneEat.BusinessChannelAuthAuthenticateRequest, requestOptions?: BusinessMessagingClient.RequestOptions): core.HttpResponsePromise<number>;
31
- private __businessChannelAuthAuthenticate;
32
- }
@@ -1,118 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.BusinessMessagingClient = void 0;
47
- const BaseClient_js_1 = require("../../../../BaseClient.js");
48
- const headers_js_1 = require("../../../../core/headers.js");
49
- const core = __importStar(require("../../../../core/index.js"));
50
- const environments = __importStar(require("../../../../environments.js"));
51
- const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
- const errors = __importStar(require("../../../../errors/index.js"));
53
- const FiveOneEat = __importStar(require("../../../index.js"));
54
- class BusinessMessagingClient {
55
- constructor(options = {}) {
56
- this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
- }
58
- /**
59
- * This endpoint is used by the business companion mobile app to authenticate with
60
- * Pusher channels. It validates that the authenticated business user has
61
- * permission to access the requested channel, scoped to their active business.
62
- *
63
- * @param {FiveOneEat.BusinessChannelAuthAuthenticateRequest} request
64
- * @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
65
- *
66
- * @throws {@link FiveOneEat.UnauthorizedError}
67
- * @throws {@link FiveOneEat.UnprocessableEntityError}
68
- *
69
- * @example
70
- * await client.businessMessaging.businessChannelAuthAuthenticate({
71
- * channel_name: "channel_name",
72
- * socket_id: "socket_id"
73
- * })
74
- */
75
- businessChannelAuthAuthenticate(request, requestOptions) {
76
- return core.HttpResponsePromise.fromPromise(this.__businessChannelAuthAuthenticate(request, requestOptions));
77
- }
78
- __businessChannelAuthAuthenticate(request, requestOptions) {
79
- return __awaiter(this, void 0, void 0, function* () {
80
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
81
- const _authRequest = yield this._options.authProvider.getAuthRequest();
82
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
83
- const _response = yield core.fetcher({
84
- 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/channels/auth"),
85
- method: "POST",
86
- headers: _headers,
87
- contentType: "application/json",
88
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
89
- requestType: "json",
90
- body: request,
91
- 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,
92
- 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,
93
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
94
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
95
- logging: this._options.logging,
96
- });
97
- if (_response.ok) {
98
- return { data: _response.body, rawResponse: _response.rawResponse };
99
- }
100
- if (_response.error.reason === "status-code") {
101
- switch (_response.error.statusCode) {
102
- case 401:
103
- throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
104
- case 422:
105
- throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
106
- default:
107
- throw new errors.FiveOneEatError({
108
- statusCode: _response.error.statusCode,
109
- body: _response.error.body,
110
- rawResponse: _response.rawResponse,
111
- });
112
- }
113
- }
114
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/business/channels/auth");
115
- });
116
- }
117
- }
118
- exports.BusinessMessagingClient = BusinessMessagingClient;
@@ -1 +0,0 @@
1
- export type { BusinessChannelAuthAuthenticateRequest } from "./BusinessChannelAuthAuthenticateRequest.js";
@@ -1,2 +0,0 @@
1
- export { BusinessMessagingClient } from "./client/Client.js";
2
- export * from "./client/index.js";
@@ -1 +0,0 @@
1
- export * from "./client/index.js";
@@ -1,17 +0,0 @@
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);