serve-socket 1.0.6 → 1.0.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serve-socket",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Real-time WebSocket service for restaurant waiter coordination",
5
5
  "license": "MIT",
6
6
  "author": "Serve+ Team",
@@ -17,21 +17,16 @@
17
17
  "package.json"
18
18
  ],
19
19
  "peerDependencies": {
20
- "@angular/common": "^20.3.0",
21
- "@angular/core": "^20.3.0"
20
+ "@angular/common": "^19.0.0 || ^20.0.0",
21
+ "@angular/core": "^19.0.0 || ^20.0.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "tslib": "^2.3.0"
25
25
  },
26
- "sideEffects": false,
27
- "module": "fesm2022/serve-socket.mjs",
28
- "exports": {
29
- "./package.json": {
30
- "default": "./package.json"
31
- },
32
- ".": {
33
- "types": "./index.d.ts",
34
- "default": "./fesm2022/serve-socket.mjs"
35
- }
36
- }
26
+ "scripts": {
27
+ "build": "ng build serve-socket",
28
+ "publish": "npm publish",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "sideEffects": false
37
32
  }
@@ -1,449 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { NgModule, InjectionToken, Inject, Injectable, inject } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import { HttpClientModule, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
5
- import { BehaviorSubject, Subject, Observable, firstValueFrom } from 'rxjs';
6
- import { io } from 'socket.io-client';
7
-
8
- /**
9
- * @deprecated Use provideRealtimeStore() with standalone components instead
10
- */
11
- class RealtimeStoreModule {
12
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RealtimeStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.14", ngImport: i0, type: RealtimeStoreModule, imports: [CommonModule,
14
- HttpClientModule // Kept for backward compatibility with Angular <14
15
- ] });
16
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RealtimeStoreModule, imports: [CommonModule,
17
- HttpClientModule // Kept for backward compatibility with Angular <14
18
- ] });
19
- }
20
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RealtimeStoreModule, decorators: [{
21
- type: NgModule,
22
- args: [{
23
- declarations: [],
24
- imports: [
25
- CommonModule,
26
- HttpClientModule // Kept for backward compatibility with Angular <14
27
- ],
28
- exports: []
29
- }]
30
- }] });
31
-
32
- const defaultRealtimeStoreEnvironment = {
33
- // apiUrl: `http://${window.location.hostname}:3030`,
34
- apiUrl: `http://http://192.168.1.111:3030`,
35
- };
36
-
37
- const REALTIME_STORE_ENVIRONMENT = new InjectionToken('REALTIME_STORE_ENVIRONMENT');
38
-
39
- /**
40
- * API Gateway
41
- *
42
- *
43
- *
44
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
45
- * https://openapi-generator.tech
46
- * Do not edit the class manually.
47
- */
48
- var SocketGateways;
49
- (function (SocketGateways) {
50
- SocketGateways.ResponseEnum = {
51
- CustomerCreateCartSuccess: 'customer:create:cart:success',
52
- CustomerRemoveFromCartSuccess: 'customer:remove:from:cart:success',
53
- CustomerGetMenuSuccess: 'customer:get:menu:success',
54
- TableJoinRequestSuccess: 'table:join:request:success',
55
- TableJoinRequestApprovedSuccess: 'table:join:request:approved:success',
56
- ErrorMessageSuccess: 'error:message:success',
57
- SuccessMessageSuccess: 'success:message:success',
58
- WarningMessageSuccess: 'warning:message:success',
59
- AuthCustomerLoginPendingGetSuccess: 'auth:customer:login:pending:get:success',
60
- CustomerUpdateIsPaidSuccess: 'customer:update:is-paid:success',
61
- TableCreatedSuccess: 'table:created:success',
62
- TableAssignedSuccess: 'table:assigned:success',
63
- TableStatusUpdatedSuccess: 'table:status:updated:success',
64
- TableReleasedSuccess: 'table:released:success'
65
- };
66
- SocketGateways.RequestEnum = {
67
- AuthCustomerLogin: 'auth:customer:login',
68
- AuthCustomerLoginReconnect: 'auth:customer:login:reconnect',
69
- PosLogin: 'pos:login',
70
- CustomerGetCart: 'customer:get:cart',
71
- CustomerGetOneCart: 'customer:get-one:cart',
72
- CustomerRemoveFromCart: 'customer:remove:from:cart',
73
- CustomerUpdateCart: 'customer:update:cart',
74
- GetCartByWaiter: 'get:cart:by:waiter',
75
- GetAllCarts: 'get:all:carts',
76
- CustomerGetMenu: 'customer:get:menu',
77
- ErrorMessage: 'error:message',
78
- SuccessMessage: 'success:message',
79
- JoinRoom: 'join:room',
80
- GetTheming: 'get:theming',
81
- CustomerCartItemStatusUpdate: 'customer:cart:item:status:update',
82
- CustomerGetMenuItemReviews: 'customer:get:menu-item:reviews',
83
- CustomerCreateMenuItemReview: 'customer:create:menu-item:review',
84
- CustomerGetRequestsByTable: 'customer:get:requests:by:table',
85
- WaiterGetRequestsByTable: 'waiter:get:requests:by:table',
86
- CustomerCallWaiter: 'customer:call:waiter',
87
- WaiterReceiveCall: 'waiter:receive:call',
88
- WaiterCallAcknowledged: 'waiter:call:acknowledged',
89
- CustomerGetCallWaiterRequests: 'customer:get:call:waiter:requests',
90
- WaiterGetCalls: 'waiter:get:calls',
91
- WaiterGetAvailable: 'waiter:get:available',
92
- WaiterCallCreate: 'waiter:call:create',
93
- WaiterCallResolve: 'waiter:call:resolve',
94
- TableAssignToWaiter: 'table:assign:to:waiter',
95
- AuthCustomerLoginApprove: 'auth:customer:login:approve',
96
- AuthCustomerLoginPendingGet: 'auth:customer:login:pending:get',
97
- AuthCustomerApprovalPendingGetSuccess: 'auth:customer:approval:pending:get:success',
98
- AuthCustomerApprovalPendingGetForWaiter: 'auth:customer:approval:pending:get:for:waiter',
99
- PosLogin2: 'pos:login',
100
- PosValidateBranchCode: 'pos:validate:branch:code',
101
- PosWaiterLogin: 'pos:waiter:login',
102
- WaiterGetTables: 'waiter:get:tables',
103
- WaiterGetLoggedIn: 'waiter:get:logged:in',
104
- TableGetAll: 'table:get:all',
105
- TableCreate: 'table:create',
106
- TableAssign: 'table:assign',
107
- TableUpdateStatus: 'table:update:status',
108
- TableRelease: 'table:release',
109
- WaiterGetTablesDetails: 'waiter:get:tables:details',
110
- TableGetDetails: 'table:get:details',
111
- PosWaiterCreate: 'pos:waiter:create'
112
- };
113
- })(SocketGateways || (SocketGateways = {}));
114
-
115
- // Define string constants instead of enum to avoid type errors with string values
116
- const SocketEvents = {
117
- CUSTOMER_CONNECT: SocketGateways.RequestEnum.AuthCustomerLogin,
118
- CUSTOMER_RECONNECT: SocketGateways.RequestEnum.AuthCustomerLoginReconnect,
119
- CUSTOMER_GET_CART: SocketGateways.RequestEnum.CustomerGetCart,
120
- CUSTOMER_GET_ONE_CART: SocketGateways.RequestEnum.CustomerGetOneCart,
121
- CUSTOMER_REMOVE_FROM_CART: SocketGateways.RequestEnum.CustomerRemoveFromCart,
122
- CUSTOMER_CREATE_UPDATE_CART: SocketGateways.RequestEnum.CustomerUpdateCart,
123
- CUSTOMER_GET_MENU: SocketGateways.RequestEnum.CustomerGetMenu,
124
- ERROR_MESSAGE: SocketGateways.RequestEnum.ErrorMessage,
125
- SUCCESS_MESSAGE: SocketGateways.RequestEnum.SuccessMessage,
126
- JOIN_ROOM: SocketGateways.RequestEnum.JoinRoom,
127
- GET_THEMING: SocketGateways.RequestEnum.GetTheming,
128
- CUSTOMER_CART_ITEM_STATUS_UPDATE: SocketGateways.RequestEnum.CustomerCartItemStatusUpdate,
129
- CUSTOMER_GET_MENU_ITEM_REVIEWS: SocketGateways.RequestEnum.CustomerGetMenuItemReviews,
130
- CUSTOMER_CREATE_MENU_ITEM_REVIEW: SocketGateways.RequestEnum.CustomerCreateMenuItemReview,
131
- CUSTOMER_GET_REQUESTS_BY_TABLE: SocketGateways.RequestEnum.CustomerGetRequestsByTable,
132
- WAITER_GET_REQUESTS_BY_TABLE: SocketGateways.RequestEnum.WaiterGetRequestsByTable,
133
- CUSTOMER_CALL_WAITER: SocketGateways.RequestEnum.CustomerCallWaiter,
134
- WAITER_RECEIVE_CALL: SocketGateways.RequestEnum.WaiterReceiveCall,
135
- WAITER_CALL_ACKNOWLEDGED: SocketGateways.RequestEnum.WaiterCallAcknowledged,
136
- CUSTOMER_GET_CALL_WAITER_REQUESTS: SocketGateways.RequestEnum.CustomerGetCallWaiterRequests,
137
- APPROVE_CUSTOMER_LOGIN: SocketGateways.RequestEnum.AuthCustomerLoginApprove,
138
- GET_PENDING_CUSTOMER_LOGINS: SocketGateways.RequestEnum.AuthCustomerLoginPendingGet,
139
- POS_LOGIN: SocketGateways.RequestEnum.PosLogin,
140
- GET_ALL_TABLES: SocketGateways.RequestEnum.TableGetAll,
141
- CREATE_TABLE: SocketGateways.RequestEnum.TableCreate,
142
- ASSIGN_TABLE: SocketGateways.RequestEnum.TableAssign,
143
- UPDATE_TABLE_STATUS: SocketGateways.RequestEnum.TableUpdateStatus,
144
- RELEASE_TABLE: SocketGateways.RequestEnum.TableRelease
145
- };
146
- const SocketSuccessEvents = {
147
- // Map to SocketGateways.ResponseEnum
148
- CUSTOMER_CREATE_OR_UPDATE_CART_SUCCESS: SocketGateways.ResponseEnum.CustomerCreateCartSuccess,
149
- CUSTOMER_REMOVE_FROM_CART_SUCCESS: SocketGateways.ResponseEnum.CustomerRemoveFromCartSuccess,
150
- CUSTOMER_GET_MENU_SUCCESS: SocketGateways.ResponseEnum.CustomerGetMenuSuccess,
151
- TABLE_JOIN_REQUEST_SENT_SUCCESS: SocketGateways.ResponseEnum.TableJoinRequestSuccess,
152
- TABLE_JOIN_REQUEST_APPROVED_SUCCESS: SocketGateways.ResponseEnum.TableJoinRequestApprovedSuccess,
153
- ERROR_MESSAGE_SUCCESS: SocketGateways.ResponseEnum.ErrorMessageSuccess,
154
- SUCCESS_MESSAGE_SUCCESS: SocketGateways.ResponseEnum.SuccessMessageSuccess,
155
- WARNING_MESSAGE_SUCCESS: SocketGateways.ResponseEnum.WarningMessageSuccess,
156
- GET_PENDING_CUSTOMER_LOGINS_SUCCESS: SocketGateways.ResponseEnum.AuthCustomerLoginPendingGetSuccess,
157
- CUSTOMER_UPDATE_IS_PAID_SUCCESS: SocketGateways.ResponseEnum.CustomerUpdateIsPaidSuccess,
158
- TABLE_CREATED: SocketGateways.ResponseEnum.TableCreatedSuccess,
159
- TABLE_ASSIGNED: SocketGateways.ResponseEnum.TableAssignedSuccess,
160
- TABLE_STATUS_UPDATED: SocketGateways.ResponseEnum.TableStatusUpdatedSuccess,
161
- TABLE_RELEASED: SocketGateways.ResponseEnum.TableReleasedSuccess,
162
- // Add WAITER_RECEIVE_CALL which appears to be missing from the ResponseEnum
163
- WAITER_RECEIVE_CALL: 'waiter:receive:call'
164
- };
165
- class SocketService {
166
- environment;
167
- socket;
168
- url;
169
- connectionStatusSubject = new BehaviorSubject(false);
170
- connectionStatus$ = this.connectionStatusSubject.asObservable();
171
- reconnectSubject = new Subject();
172
- reconnect$ = this.reconnectSubject.asObservable();
173
- constructor(environment = defaultRealtimeStoreEnvironment) {
174
- this.environment = environment;
175
- this.url = this.environment.apiUrl;
176
- this.setupSocketConnection();
177
- }
178
- setupSocketConnection() {
179
- this.socket = io(this.url, {
180
- transports: ['websocket'],
181
- autoConnect: true
182
- });
183
- this.socket.on('connect', () => {
184
- console.log('Socket connected');
185
- this.connectionStatusSubject.next(true);
186
- });
187
- this.socket.on('disconnect', () => {
188
- console.log('Socket disconnected');
189
- this.connectionStatusSubject.next(false);
190
- });
191
- this.socket.on('reconnect', () => {
192
- console.log('Socket reconnected');
193
- this.connectionStatusSubject.next(true);
194
- this.reconnectSubject.next();
195
- });
196
- }
197
- connect() {
198
- if (!this.socket.connected) {
199
- this.socket.connect();
200
- }
201
- }
202
- disconnect() {
203
- if (this.socket.connected) {
204
- this.socket.disconnect();
205
- }
206
- }
207
- emit(event, data) {
208
- this.socket.emit(event, data);
209
- }
210
- on(event) {
211
- return new Observable(observer => {
212
- this.socket.on(event, (data) => {
213
- observer.next(data);
214
- });
215
- return () => {
216
- this.socket.off(event);
217
- };
218
- });
219
- }
220
- once(event) {
221
- return new Observable(observer => {
222
- this.socket.once(event, (data) => {
223
- observer.next(data);
224
- observer.complete();
225
- });
226
- return () => {
227
- this.socket.off(event);
228
- };
229
- });
230
- }
231
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SocketService, deps: [{ token: REALTIME_STORE_ENVIRONMENT }], target: i0.ɵɵFactoryTarget.Injectable });
232
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SocketService });
233
- }
234
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SocketService, decorators: [{
235
- type: Injectable
236
- }], ctorParameters: () => [{ type: undefined, decorators: [{
237
- type: Inject,
238
- args: [REALTIME_STORE_ENVIRONMENT]
239
- }] }] });
240
-
241
- class BaseStore {
242
- socketService;
243
- dataSubject = new BehaviorSubject([]);
244
- data$ = this.dataSubject.asObservable();
245
- loadingSubject = new BehaviorSubject(false);
246
- loading$ = this.loadingSubject.asObservable();
247
- errorSubject = new BehaviorSubject(null);
248
- error$ = this.errorSubject.asObservable();
249
- constructor(socketService) {
250
- this.socketService = socketService;
251
- Promise.resolve().then(() => this.refresh());
252
- this.socketService.reconnect$.subscribe(() => {
253
- this.refresh();
254
- });
255
- }
256
- refresh() {
257
- this.preload().then(x => this.dataSubject.next(x));
258
- }
259
- // Helper methods for stores
260
- updateItems(items) {
261
- this.dataSubject.next(items);
262
- }
263
- addItem(item) {
264
- const currentItems = this.dataSubject.value;
265
- this.dataSubject.next([...currentItems, item]);
266
- }
267
- updateItem(updatedItem, idField) {
268
- const currentItems = this.dataSubject.value;
269
- const updatedItems = currentItems.map(item => item[idField] === updatedItem[idField]
270
- ? { ...item, ...updatedItem }
271
- : item);
272
- this.dataSubject.next(updatedItems);
273
- }
274
- removeItem(id, idField) {
275
- const currentItems = this.dataSubject.value;
276
- const filteredItems = currentItems.filter(item => item[idField] !== id);
277
- this.dataSubject.next(filteredItems);
278
- }
279
- setLoading(isLoading) {
280
- this.loadingSubject.next(isLoading);
281
- }
282
- setError(error) {
283
- this.errorSubject.next(error);
284
- }
285
- // Helper to subscribe to socket events with typesafety
286
- subscribeToEvent(event, handler) {
287
- this.socketService.on(event).subscribe(handler);
288
- }
289
- getAll() {
290
- return this.dataSubject.value;
291
- }
292
- getById(id, idField) {
293
- return this.dataSubject.value.find(item => item[idField] === id);
294
- }
295
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: BaseStore, deps: [{ token: SocketService }], target: i0.ɵɵFactoryTarget.Injectable });
296
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: BaseStore });
297
- }
298
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: BaseStore, decorators: [{
299
- type: Injectable
300
- }], ctorParameters: () => [{ type: SocketService }] });
301
-
302
- class TableStore extends BaseStore {
303
- socketService = inject(SocketService);
304
- constructor() {
305
- const socketService = inject(SocketService);
306
- super(socketService);
307
- this.subscribeToEvent(SocketSuccessEvents.TABLE_CREATED, (table) => this.addItem(table));
308
- this.subscribeToEvent(SocketSuccessEvents.TABLE_ASSIGNED, (table) => this.updateItem(table, 'id'));
309
- this.subscribeToEvent(SocketSuccessEvents.TABLE_STATUS_UPDATED, (table) => this.updateItem(table, 'id'));
310
- this.subscribeToEvent(SocketSuccessEvents.TABLE_RELEASED, (table) => this.updateItem(table, 'id'));
311
- }
312
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
313
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableStore });
314
- }
315
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableStore, decorators: [{
316
- type: Injectable
317
- }], ctorParameters: () => [] });
318
-
319
- class CartStore extends BaseStore {
320
- socketService;
321
- constructor(socketService) {
322
- super(socketService);
323
- this.socketService = socketService;
324
- // Subscribe to cart socket events
325
- this.subscribeToEvent(SocketSuccessEvents.CUSTOMER_CREATE_OR_UPDATE_CART_SUCCESS, (cart) => this.updateItem(cart, 'id'));
326
- this.subscribeToEvent(SocketSuccessEvents.CUSTOMER_REMOVE_FROM_CART_SUCCESS, (data) => {
327
- // We need to fetch the updated cart after an item is removed
328
- this.preload();
329
- });
330
- }
331
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CartStore, deps: [{ token: SocketService }], target: i0.ɵɵFactoryTarget.Injectable });
332
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CartStore });
333
- }
334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CartStore, decorators: [{
335
- type: Injectable
336
- }], ctorParameters: () => [{ type: SocketService }] });
337
-
338
- class MenuStore extends BaseStore {
339
- socketService;
340
- constructor(socketService) {
341
- super(socketService);
342
- this.socketService = socketService;
343
- // Subscribe to menu socket events
344
- this.subscribeToEvent(SocketSuccessEvents.CUSTOMER_GET_MENU_SUCCESS, (menuItems) => this.updateItems(menuItems));
345
- }
346
- async getMenu(branchId) {
347
- this.socketService.emit(SocketEvents.CUSTOMER_GET_MENU, { branchId });
348
- }
349
- async getMenuItemReviews(menuItemId) {
350
- this.socketService.emit(SocketEvents.CUSTOMER_GET_MENU_ITEM_REVIEWS, { menuItemId });
351
- }
352
- async createMenuItemReview(menuItemId, rating, comment) {
353
- this.socketService.emit(SocketEvents.CUSTOMER_CREATE_MENU_ITEM_REVIEW, {
354
- menuItemId,
355
- rating,
356
- comment
357
- });
358
- }
359
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MenuStore, deps: [{ token: SocketService }], target: i0.ɵɵFactoryTarget.Injectable });
360
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MenuStore });
361
- }
362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: MenuStore, decorators: [{
363
- type: Injectable
364
- }], ctorParameters: () => [{ type: SocketService }] });
365
-
366
- class CallWaiterStore extends BaseStore {
367
- socketService;
368
- constructor(socketService) {
369
- super(socketService);
370
- this.socketService = socketService;
371
- // We need to listen for incoming waiter calls
372
- this.socketService.on(SocketSuccessEvents.WAITER_RECEIVE_CALL).subscribe((request) => {
373
- this.addItem(request);
374
- });
375
- }
376
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CallWaiterStore, deps: [{ token: SocketService }], target: i0.ɵɵFactoryTarget.Injectable });
377
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CallWaiterStore });
378
- }
379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CallWaiterStore, decorators: [{
380
- type: Injectable
381
- }], ctorParameters: () => [{ type: SocketService }] });
382
-
383
- class CustomerLoginStore extends BaseStore {
384
- socketService;
385
- constructor(socketService) {
386
- super(socketService);
387
- this.socketService = socketService;
388
- this.subscribeToEvent(SocketSuccessEvents.GET_PENDING_CUSTOMER_LOGINS_SUCCESS, (logins) => this.updateItems(logins));
389
- }
390
- getPendingLogins() {
391
- this.socketService.emit(SocketEvents.GET_PENDING_CUSTOMER_LOGINS);
392
- }
393
- async approveCustomerLogin(customerId, tableId, customerAuthControllerApproveCustomerLogin) {
394
- const approveData = {
395
- customerId,
396
- tableId
397
- };
398
- try {
399
- await firstValueFrom(customerAuthControllerApproveCustomerLogin(approveData));
400
- this.removeItem(customerId, 'id');
401
- }
402
- catch (error) {
403
- console.error(`Failed to approve customer login for ${customerId}:`, error);
404
- this.setError(`Failed to approve customer login`);
405
- }
406
- }
407
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CustomerLoginStore, deps: [{ token: SocketService }], target: i0.ɵɵFactoryTarget.Injectable });
408
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CustomerLoginStore });
409
- }
410
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CustomerLoginStore, decorators: [{
411
- type: Injectable
412
- }], ctorParameters: () => [{ type: SocketService }] });
413
-
414
- /**
415
- * Provides all services needed for the realtime store to function.
416
- * Use this function in your standalone application's bootstrapApplication providers array.
417
- *
418
- * @example
419
- * ```typescript
420
- * bootstrapApplication(AppComponent, {
421
- * providers: [
422
- * provideRealtimeStore()
423
- * ]
424
- * });
425
- * ```
426
- */
427
- function provideRealtimeStore() {
428
- return [
429
- provideHttpClient(withInterceptorsFromDi())
430
- ];
431
- }
432
-
433
- function provideRealtimeStoreEnvironment(environment) {
434
- return {
435
- provide: REALTIME_STORE_ENVIRONMENT,
436
- useValue: environment
437
- };
438
- }
439
-
440
- /*
441
- * Public API Surface of realtime-store
442
- */
443
-
444
- /**
445
- * Generated bundle index. Do not edit.
446
- */
447
-
448
- export { BaseStore, CallWaiterStore, CartStore, CustomerLoginStore, MenuStore, REALTIME_STORE_ENVIRONMENT, RealtimeStoreModule, SocketEvents, SocketService, SocketSuccessEvents, TableStore, defaultRealtimeStoreEnvironment, provideRealtimeStore, provideRealtimeStoreEnvironment };
449
- //# sourceMappingURL=serve-socket.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve-socket.mjs","sources":["../../../projects/serve-socket/src/lib/realtime-store.module.ts","../../../projects/serve-socket/src/lib/environment/realtime-store-environment.interface.ts","../../../projects/serve-socket/src/lib/environment/realtime-store-environment.token.ts","../../../projects/serve-socket/src/lib/model/socketGateways.ts","../../../projects/serve-socket/src/lib/socket.service.ts","../../../projects/serve-socket/src/lib/base-store.ts","../../../projects/serve-socket/src/lib/stores/table.store.ts","../../../projects/serve-socket/src/lib/stores/cart.store.ts","../../../projects/serve-socket/src/lib/stores/menu.store.ts","../../../projects/serve-socket/src/lib/stores/call-waiter.store.ts","../../../projects/serve-socket/src/lib/stores/customer-login.store.ts","../../../projects/serve-socket/src/lib/providers.ts","../../../projects/serve-socket/src/lib/providers/realtime-store-environment.provider.ts","../../../projects/serve-socket/src/public-api.ts","../../../projects/serve-socket/src/serve-socket.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\n\n/**\n * @deprecated Use provideRealtimeStore() with standalone components instead\n */\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n HttpClientModule // Kept for backward compatibility with Angular <14\n ],\n exports: []\n})\nexport class RealtimeStoreModule { }\n","export interface RealtimeStoreEnvironment {\n apiUrl: string;\n}\n\nexport const defaultRealtimeStoreEnvironment: RealtimeStoreEnvironment = {\n // apiUrl: `http://${window.location.hostname}:3030`,\n apiUrl: `http://http://192.168.1.111:3030`,\n};","import { InjectionToken } from '@angular/core';\nimport { RealtimeStoreEnvironment } from './realtime-store-environment.interface';\n\nexport const REALTIME_STORE_ENVIRONMENT = new InjectionToken<RealtimeStoreEnvironment>('REALTIME_STORE_ENVIRONMENT');","/**\n * API Gateway\n *\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nexport interface SocketGateways { \n /**\n * All possible socket success events emitted by the server\n */\n response: SocketGateways.ResponseEnum;\n /**\n * Auth message patterns for the socket gateway\n */\n request: SocketGateways.RequestEnum;\n}\nexport namespace SocketGateways {\n export const ResponseEnum = {\n CustomerCreateCartSuccess: 'customer:create:cart:success',\n CustomerRemoveFromCartSuccess: 'customer:remove:from:cart:success',\n CustomerGetMenuSuccess: 'customer:get:menu:success',\n TableJoinRequestSuccess: 'table:join:request:success',\n TableJoinRequestApprovedSuccess: 'table:join:request:approved:success',\n ErrorMessageSuccess: 'error:message:success',\n SuccessMessageSuccess: 'success:message:success',\n WarningMessageSuccess: 'warning:message:success',\n AuthCustomerLoginPendingGetSuccess: 'auth:customer:login:pending:get:success',\n CustomerUpdateIsPaidSuccess: 'customer:update:is-paid:success',\n TableCreatedSuccess: 'table:created:success',\n TableAssignedSuccess: 'table:assigned:success',\n TableStatusUpdatedSuccess: 'table:status:updated:success',\n TableReleasedSuccess: 'table:released:success'\n } as const;\n export type ResponseEnum = typeof ResponseEnum[keyof typeof ResponseEnum];\n export const RequestEnum = {\n AuthCustomerLogin: 'auth:customer:login',\n AuthCustomerLoginReconnect: 'auth:customer:login:reconnect',\n PosLogin: 'pos:login',\n CustomerGetCart: 'customer:get:cart',\n CustomerGetOneCart: 'customer:get-one:cart',\n CustomerRemoveFromCart: 'customer:remove:from:cart',\n CustomerUpdateCart: 'customer:update:cart',\n GetCartByWaiter: 'get:cart:by:waiter',\n GetAllCarts: 'get:all:carts',\n CustomerGetMenu: 'customer:get:menu',\n ErrorMessage: 'error:message',\n SuccessMessage: 'success:message',\n JoinRoom: 'join:room',\n GetTheming: 'get:theming',\n CustomerCartItemStatusUpdate: 'customer:cart:item:status:update',\n CustomerGetMenuItemReviews: 'customer:get:menu-item:reviews',\n CustomerCreateMenuItemReview: 'customer:create:menu-item:review',\n CustomerGetRequestsByTable: 'customer:get:requests:by:table',\n WaiterGetRequestsByTable: 'waiter:get:requests:by:table',\n CustomerCallWaiter: 'customer:call:waiter',\n WaiterReceiveCall: 'waiter:receive:call',\n WaiterCallAcknowledged: 'waiter:call:acknowledged',\n CustomerGetCallWaiterRequests: 'customer:get:call:waiter:requests',\n WaiterGetCalls: 'waiter:get:calls',\n WaiterGetAvailable: 'waiter:get:available',\n WaiterCallCreate: 'waiter:call:create',\n WaiterCallResolve: 'waiter:call:resolve',\n TableAssignToWaiter: 'table:assign:to:waiter',\n AuthCustomerLoginApprove: 'auth:customer:login:approve',\n AuthCustomerLoginPendingGet: 'auth:customer:login:pending:get',\n AuthCustomerApprovalPendingGetSuccess: 'auth:customer:approval:pending:get:success',\n AuthCustomerApprovalPendingGetForWaiter: 'auth:customer:approval:pending:get:for:waiter',\n PosLogin2: 'pos:login',\n PosValidateBranchCode: 'pos:validate:branch:code',\n PosWaiterLogin: 'pos:waiter:login',\n WaiterGetTables: 'waiter:get:tables',\n WaiterGetLoggedIn: 'waiter:get:logged:in',\n TableGetAll: 'table:get:all',\n TableCreate: 'table:create',\n TableAssign: 'table:assign',\n TableUpdateStatus: 'table:update:status',\n TableRelease: 'table:release',\n WaiterGetTablesDetails: 'waiter:get:tables:details',\n TableGetDetails: 'table:get:details',\n PosWaiterCreate: 'pos:waiter:create'\n } as const;\n export type RequestEnum = typeof RequestEnum[keyof typeof RequestEnum];\n}\n\n\n","import { Injectable, Inject } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { io, Socket } from 'socket.io-client';\n// import { SocketGateways } from '@serve-plus/client-api';\nimport { REALTIME_STORE_ENVIRONMENT, RealtimeStoreEnvironment, defaultRealtimeStoreEnvironment } from './environment';\nimport { SocketGateways } from './model/socketGateways';\n\n// Define string constants instead of enum to avoid type errors with string values\nexport const SocketEvents = {\n CUSTOMER_CONNECT: SocketGateways.RequestEnum.AuthCustomerLogin,\n CUSTOMER_RECONNECT: SocketGateways.RequestEnum.AuthCustomerLoginReconnect,\n CUSTOMER_GET_CART: SocketGateways.RequestEnum.CustomerGetCart,\n CUSTOMER_GET_ONE_CART: SocketGateways.RequestEnum.CustomerGetOneCart,\n CUSTOMER_REMOVE_FROM_CART: SocketGateways.RequestEnum.CustomerRemoveFromCart,\n CUSTOMER_CREATE_UPDATE_CART: SocketGateways.RequestEnum.CustomerUpdateCart,\n CUSTOMER_GET_MENU: SocketGateways.RequestEnum.CustomerGetMenu,\n ERROR_MESSAGE: SocketGateways.RequestEnum.ErrorMessage,\n SUCCESS_MESSAGE: SocketGateways.RequestEnum.SuccessMessage,\n JOIN_ROOM: SocketGateways.RequestEnum.JoinRoom,\n GET_THEMING: SocketGateways.RequestEnum.GetTheming,\n CUSTOMER_CART_ITEM_STATUS_UPDATE: SocketGateways.RequestEnum.CustomerCartItemStatusUpdate,\n CUSTOMER_GET_MENU_ITEM_REVIEWS: SocketGateways.RequestEnum.CustomerGetMenuItemReviews,\n CUSTOMER_CREATE_MENU_ITEM_REVIEW: SocketGateways.RequestEnum.CustomerCreateMenuItemReview,\n CUSTOMER_GET_REQUESTS_BY_TABLE: SocketGateways.RequestEnum.CustomerGetRequestsByTable,\n WAITER_GET_REQUESTS_BY_TABLE: SocketGateways.RequestEnum.WaiterGetRequestsByTable,\n CUSTOMER_CALL_WAITER: SocketGateways.RequestEnum.CustomerCallWaiter,\n WAITER_RECEIVE_CALL: SocketGateways.RequestEnum.WaiterReceiveCall,\n WAITER_CALL_ACKNOWLEDGED: SocketGateways.RequestEnum.WaiterCallAcknowledged,\n CUSTOMER_GET_CALL_WAITER_REQUESTS: SocketGateways.RequestEnum.CustomerGetCallWaiterRequests,\n APPROVE_CUSTOMER_LOGIN: SocketGateways.RequestEnum.AuthCustomerLoginApprove,\n GET_PENDING_CUSTOMER_LOGINS: SocketGateways.RequestEnum.AuthCustomerLoginPendingGet,\n POS_LOGIN: SocketGateways.RequestEnum.PosLogin,\n GET_ALL_TABLES: SocketGateways.RequestEnum.TableGetAll,\n CREATE_TABLE: SocketGateways.RequestEnum.TableCreate,\n ASSIGN_TABLE: SocketGateways.RequestEnum.TableAssign,\n UPDATE_TABLE_STATUS: SocketGateways.RequestEnum.TableUpdateStatus,\n RELEASE_TABLE: SocketGateways.RequestEnum.TableRelease\n};\n\nexport const SocketSuccessEvents = {\n // Map to SocketGateways.ResponseEnum\n CUSTOMER_CREATE_OR_UPDATE_CART_SUCCESS: SocketGateways.ResponseEnum.CustomerCreateCartSuccess,\n CUSTOMER_REMOVE_FROM_CART_SUCCESS: SocketGateways.ResponseEnum.CustomerRemoveFromCartSuccess,\n CUSTOMER_GET_MENU_SUCCESS: SocketGateways.ResponseEnum.CustomerGetMenuSuccess,\n TABLE_JOIN_REQUEST_SENT_SUCCESS: SocketGateways.ResponseEnum.TableJoinRequestSuccess,\n TABLE_JOIN_REQUEST_APPROVED_SUCCESS: SocketGateways.ResponseEnum.TableJoinRequestApprovedSuccess,\n ERROR_MESSAGE_SUCCESS: SocketGateways.ResponseEnum.ErrorMessageSuccess,\n SUCCESS_MESSAGE_SUCCESS: SocketGateways.ResponseEnum.SuccessMessageSuccess,\n WARNING_MESSAGE_SUCCESS: SocketGateways.ResponseEnum.WarningMessageSuccess,\n GET_PENDING_CUSTOMER_LOGINS_SUCCESS: SocketGateways.ResponseEnum.AuthCustomerLoginPendingGetSuccess,\n CUSTOMER_UPDATE_IS_PAID_SUCCESS: SocketGateways.ResponseEnum.CustomerUpdateIsPaidSuccess,\n TABLE_CREATED: SocketGateways.ResponseEnum.TableCreatedSuccess,\n TABLE_ASSIGNED: SocketGateways.ResponseEnum.TableAssignedSuccess,\n TABLE_STATUS_UPDATED: SocketGateways.ResponseEnum.TableStatusUpdatedSuccess,\n TABLE_RELEASED: SocketGateways.ResponseEnum.TableReleasedSuccess,\n\n // Add WAITER_RECEIVE_CALL which appears to be missing from the ResponseEnum\n WAITER_RECEIVE_CALL: 'waiter:receive:call'\n};\n\n@Injectable()\nexport class SocketService {\n private socket!: Socket;\n private url: string;\n\n private connectionStatusSubject = new BehaviorSubject<boolean>(false);\n public connectionStatus$ = this.connectionStatusSubject.asObservable();\n\n private reconnectSubject = new Subject<void>();\n public reconnect$ = this.reconnectSubject.asObservable();\n\n constructor(\n @Inject(REALTIME_STORE_ENVIRONMENT) private environment: RealtimeStoreEnvironment = defaultRealtimeStoreEnvironment\n ) {\n this.url = this.environment.apiUrl;\n this.setupSocketConnection();\n }\n\n private setupSocketConnection(): void {\n this.socket = io(this.url, {\n transports: ['websocket'],\n autoConnect: true\n });\n\n this.socket.on('connect', () => {\n console.log('Socket connected');\n this.connectionStatusSubject.next(true);\n });\n\n this.socket.on('disconnect', () => {\n console.log('Socket disconnected');\n this.connectionStatusSubject.next(false);\n });\n\n this.socket.on('reconnect', () => {\n console.log('Socket reconnected');\n this.connectionStatusSubject.next(true);\n this.reconnectSubject.next();\n });\n }\n\n public connect(): void {\n if (!this.socket.connected) {\n this.socket.connect();\n }\n }\n\n public disconnect(): void {\n if (this.socket.connected) {\n this.socket.disconnect();\n }\n }\n\n public emit(event: string, data?: any): void {\n this.socket.emit(event, data);\n }\n\n public on<T>(event: string): Observable<T> {\n return new Observable<T>(observer => {\n this.socket.on(event, (data: T) => {\n observer.next(data);\n });\n\n return () => {\n this.socket.off(event);\n };\n });\n }\n\n public once<T>(event: string): Observable<T> {\n return new Observable<T>(observer => {\n this.socket.once(event, (data: T) => {\n observer.next(data);\n observer.complete();\n });\n\n return () => {\n this.socket.off(event);\n };\n });\n }\n}\n","import { BehaviorSubject, Observable } from 'rxjs';\nimport { SocketService } from './socket.service';\nimport { Injectable } from '@angular/core';\n\n@Injectable()\nexport abstract class BaseStore<T> {\n protected dataSubject = new BehaviorSubject<T[]>([]);\n public data$: Observable<T[]> = this.dataSubject.asObservable();\n\n protected loadingSubject = new BehaviorSubject<boolean>(false);\n public loading$: Observable<boolean> = this.loadingSubject.asObservable();\n\n protected errorSubject = new BehaviorSubject<string | null>(null);\n public error$: Observable<string | null> = this.errorSubject.asObservable();\n\n constructor(\n protected socketService: SocketService\n ) {\n Promise.resolve().then(() => this.refresh());\n\n this.socketService.reconnect$.subscribe(() => {\n this.refresh();\n });\n }\n\n private refresh() {\n this.preload().then(x => this.dataSubject.next(x));\n }\n\n // Abstract methods to be implemented by specific stores\n public abstract preload(): Promise<T[]>;\n\n // Helper methods for stores\n protected updateItems(items: T[]): void {\n this.dataSubject.next(items);\n }\n\n protected addItem(item: T): void {\n const currentItems = this.dataSubject.value;\n this.dataSubject.next([...currentItems, item]);\n }\n\n protected updateItem(updatedItem: Partial<T>, idField: keyof T): void {\n const currentItems = this.dataSubject.value;\n const updatedItems = currentItems.map(item =>\n item[idField] === updatedItem[idField]\n ? { ...item, ...updatedItem }\n : item\n );\n this.dataSubject.next(updatedItems);\n }\n\n protected removeItem(id: any, idField: keyof T): void {\n const currentItems = this.dataSubject.value;\n const filteredItems = currentItems.filter(item => item[idField] !== id);\n this.dataSubject.next(filteredItems);\n }\n\n protected setLoading(isLoading: boolean): void {\n this.loadingSubject.next(isLoading);\n }\n\n protected setError(error: string | null): void {\n this.errorSubject.next(error);\n }\n\n // Helper to subscribe to socket events with typesafety\n protected subscribeToEvent<R>(\n event: string,\n handler: (data: R) => void\n ): void {\n this.socketService.on<R>(event).subscribe(handler);\n }\n\n getAll(): T[] {\n return this.dataSubject.value;\n }\n\n getById(id: any, idField: keyof T): T | undefined {\n return this.dataSubject.value.find(item => item[idField] === id);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { BaseStore } from '../base-store';\nimport { SocketService } from '../socket.service';\nimport { SocketSuccessEvents } from '../socket.service';\nimport { TableResponseDto } from '../model/tableResponseDto';\n\n@Injectable()\nexport abstract class TableStore extends BaseStore<TableResponseDto> {\n protected override socketService = inject(SocketService);\n\n constructor() {\n const socketService = inject(SocketService);\n super(socketService);\n\n this.subscribeToEvent<TableResponseDto>(\n SocketSuccessEvents.TABLE_CREATED,\n (table) => this.addItem(table)\n );\n\n this.subscribeToEvent<TableResponseDto>(\n SocketSuccessEvents.TABLE_ASSIGNED,\n (table) => this.updateItem(table, 'id')\n );\n\n this.subscribeToEvent<TableResponseDto>(\n SocketSuccessEvents.TABLE_STATUS_UPDATED,\n (table) => this.updateItem(table, 'id')\n );\n\n this.subscribeToEvent<TableResponseDto>(\n SocketSuccessEvents.TABLE_RELEASED,\n (table) => this.updateItem(table, 'id')\n );\n }\n\n public abstract override preload(): Promise<TableResponseDto[]>;\n}\n","import { Injectable } from '@angular/core';\nimport { BaseStore } from '../base-store';\nimport { SocketService } from '../socket.service';\nimport { SocketSuccessEvents } from '../socket.service';\nimport { CartDto } from '../model/cartDto';\n\n@Injectable()\nexport abstract class CartStore extends BaseStore<CartDto> {\n constructor(\n protected override socketService: SocketService\n ) {\n super(socketService);\n\n // Subscribe to cart socket events\n this.subscribeToEvent<CartDto>(\n SocketSuccessEvents.CUSTOMER_CREATE_OR_UPDATE_CART_SUCCESS,\n (cart) => this.updateItem(cart, 'id')\n );\n\n this.subscribeToEvent<{ cartId: string, itemId: string }>(\n SocketSuccessEvents.CUSTOMER_REMOVE_FROM_CART_SUCCESS,\n (data) => {\n // We need to fetch the updated cart after an item is removed\n this.preload();\n }\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { firstValueFrom } from 'rxjs';\nimport { BaseStore } from '../base-store';\nimport { SocketService } from '../socket.service';\nimport { SocketEvents, SocketSuccessEvents } from '../socket.service';\nimport { MenuItemDto } from '../model/menuItemDto';\n\n@Injectable()\nexport abstract class MenuStore extends BaseStore<MenuItemDto> {\n constructor(\n protected override socketService: SocketService\n ) {\n super(socketService);\n\n // Subscribe to menu socket events\n this.subscribeToEvent<MenuItemDto[]>(\n SocketSuccessEvents.CUSTOMER_GET_MENU_SUCCESS,\n (menuItems) => this.updateItems(menuItems)\n );\n }\n\n public async getMenu(branchId: string): Promise<void> {\n this.socketService.emit(SocketEvents.CUSTOMER_GET_MENU, { branchId });\n }\n\n public async getMenuItemReviews(menuItemId: string): Promise<void> {\n this.socketService.emit(SocketEvents.CUSTOMER_GET_MENU_ITEM_REVIEWS, { menuItemId });\n }\n\n public async createMenuItemReview(menuItemId: string, rating: number, comment: string): Promise<void> {\n this.socketService.emit(SocketEvents.CUSTOMER_CREATE_MENU_ITEM_REVIEW, {\n menuItemId,\n rating,\n comment\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseStore } from '../base-store';\nimport { SocketService } from '../socket.service';\nimport { SocketSuccessEvents } from '../socket.service';\nimport { WaiterCallResponseDto } from '../model/waiterCallResponseDto';\n\n@Injectable()\nexport abstract class CallWaiterStore extends BaseStore<WaiterCallResponseDto> {\n constructor(\n protected override socketService: SocketService\n ) {\n super(socketService);\n\n // We need to listen for incoming waiter calls\n this.socketService.on<WaiterCallResponseDto>(\n SocketSuccessEvents.WAITER_RECEIVE_CALL\n ).subscribe((request: WaiterCallResponseDto) => {\n this.addItem(request);\n });\n }\n\n public abstract override preload(): Promise<WaiterCallResponseDto[]>;\n}\n","import { Injectable } from '@angular/core';\nimport { firstValueFrom, Observable } from 'rxjs';\nimport { BaseStore } from '../base-store';\nimport { SocketService } from '../socket.service';\nimport { SocketEvents, SocketSuccessEvents } from '../socket.service';\nimport { CustomerAuthControllerApproveCustomerLoginRequest } from '../model/customerAuthControllerApproveCustomerLoginRequest';\nimport { CustomerLoginRequestDto } from '../model/customerLoginRequestDto';\n\n@Injectable()\nexport abstract class CustomerLoginStore extends BaseStore<CustomerLoginRequestDto> {\n constructor(\n protected override socketService: SocketService\n ) {\n super(socketService);\n this.subscribeToEvent<CustomerLoginRequestDto[]>(\n SocketSuccessEvents.GET_PENDING_CUSTOMER_LOGINS_SUCCESS,\n (logins) => this.updateItems(logins)\n );\n }\n\n public getPendingLogins(): void {\n this.socketService.emit(SocketEvents.GET_PENDING_CUSTOMER_LOGINS);\n }\n\n public async approveCustomerLogin(customerId: string,\n tableId: string,\n customerAuthControllerApproveCustomerLogin: (payload: CustomerAuthControllerApproveCustomerLoginRequest)\n => Observable<CustomerAuthControllerApproveCustomerLoginRequest>\n ): Promise<void> {\n const approveData: CustomerAuthControllerApproveCustomerLoginRequest = {\n customerId,\n tableId\n };\n\n try {\n await firstValueFrom(\n customerAuthControllerApproveCustomerLogin(approveData)\n );\n\n this.removeItem(customerId, 'id');\n } catch (error) {\n console.error(`Failed to approve customer login for ${customerId}:`, error);\n this.setError(`Failed to approve customer login`);\n }\n }\n}\n","import { EnvironmentProviders, importProvidersFrom } from '@angular/core';\nimport { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';\n\n/**\n * Provides all services needed for the realtime store to function.\n * Use this function in your standalone application's bootstrapApplication providers array.\n * \n * @example\n * ```typescript\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideRealtimeStore()\n * ]\n * });\n * ```\n */\nexport function provideRealtimeStore(): EnvironmentProviders[] {\n return [\n provideHttpClient(withInterceptorsFromDi())\n ];\n}\n","import { Provider } from '@angular/core';\nimport { REALTIME_STORE_ENVIRONMENT, RealtimeStoreEnvironment } from '../environment';\n\nexport function provideRealtimeStoreEnvironment(environment: RealtimeStoreEnvironment): Provider {\n return {\n provide: REALTIME_STORE_ENVIRONMENT,\n useValue: environment\n };\n}","/*\n * Public API Surface of realtime-store\n */\n\nexport * from './lib/realtime-store.module';\nexport * from './lib/socket.service';\nexport * from './lib/base-store';\nexport * from './lib/stores/table.store';\nexport * from './lib/stores/cart.store';\nexport * from './lib/stores/menu.store';\nexport * from './lib/stores/call-waiter.store';\nexport * from './lib/stores/customer-login.store';\nexport * from './lib/providers';\nexport * from './lib/environment';\nexport * from './lib/providers/realtime-store-environment.provider';\nexport * from './lib/model/waiterCallResponseDto';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SocketService"],"mappings":";;;;;;;AAIA;;AAEG;MASU,mBAAmB,CAAA;wGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EA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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAlB,kBAAkB,EAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBADvC;;;ACLD;;;;;;;;;;;;AAYG;SACa,oBAAoB,GAAA;IAChC,OAAO;QACH,iBAAiB,CAAC,sBAAsB,EAAE;KAC7C;AACL;;ACjBM,SAAU,+BAA+B,CAAC,WAAqC,EAAA;IACjF,OAAO;AACH,QAAA,OAAO,EAAE,0BAA0B;AACnC,QAAA,QAAQ,EAAE;KACb;AACL;;ACRA;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts DELETED
@@ -1,650 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import * as i2 from '@angular/common/http';
5
- import { Observable, BehaviorSubject } from 'rxjs';
6
-
7
- /**
8
- * @deprecated Use provideRealtimeStore() with standalone components instead
9
- */
10
- declare class RealtimeStoreModule {
11
- static ɵfac: i0.ɵɵFactoryDeclaration<RealtimeStoreModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<RealtimeStoreModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule], never>;
13
- static ɵinj: i0.ɵɵInjectorDeclaration<RealtimeStoreModule>;
14
- }
15
-
16
- interface RealtimeStoreEnvironment {
17
- apiUrl: string;
18
- }
19
- declare const defaultRealtimeStoreEnvironment: RealtimeStoreEnvironment;
20
-
21
- declare const REALTIME_STORE_ENVIRONMENT: InjectionToken<RealtimeStoreEnvironment>;
22
-
23
- declare const SocketEvents: {
24
- CUSTOMER_CONNECT: "auth:customer:login";
25
- CUSTOMER_RECONNECT: "auth:customer:login:reconnect";
26
- CUSTOMER_GET_CART: "customer:get:cart";
27
- CUSTOMER_GET_ONE_CART: "customer:get-one:cart";
28
- CUSTOMER_REMOVE_FROM_CART: "customer:remove:from:cart";
29
- CUSTOMER_CREATE_UPDATE_CART: "customer:update:cart";
30
- CUSTOMER_GET_MENU: "customer:get:menu";
31
- ERROR_MESSAGE: "error:message";
32
- SUCCESS_MESSAGE: "success:message";
33
- JOIN_ROOM: "join:room";
34
- GET_THEMING: "get:theming";
35
- CUSTOMER_CART_ITEM_STATUS_UPDATE: "customer:cart:item:status:update";
36
- CUSTOMER_GET_MENU_ITEM_REVIEWS: "customer:get:menu-item:reviews";
37
- CUSTOMER_CREATE_MENU_ITEM_REVIEW: "customer:create:menu-item:review";
38
- CUSTOMER_GET_REQUESTS_BY_TABLE: "customer:get:requests:by:table";
39
- WAITER_GET_REQUESTS_BY_TABLE: "waiter:get:requests:by:table";
40
- CUSTOMER_CALL_WAITER: "customer:call:waiter";
41
- WAITER_RECEIVE_CALL: "waiter:receive:call";
42
- WAITER_CALL_ACKNOWLEDGED: "waiter:call:acknowledged";
43
- CUSTOMER_GET_CALL_WAITER_REQUESTS: "customer:get:call:waiter:requests";
44
- APPROVE_CUSTOMER_LOGIN: "auth:customer:login:approve";
45
- GET_PENDING_CUSTOMER_LOGINS: "auth:customer:login:pending:get";
46
- POS_LOGIN: "pos:login";
47
- GET_ALL_TABLES: "table:get:all";
48
- CREATE_TABLE: "table:create";
49
- ASSIGN_TABLE: "table:assign";
50
- UPDATE_TABLE_STATUS: "table:update:status";
51
- RELEASE_TABLE: "table:release";
52
- };
53
- declare const SocketSuccessEvents: {
54
- CUSTOMER_CREATE_OR_UPDATE_CART_SUCCESS: "customer:create:cart:success";
55
- CUSTOMER_REMOVE_FROM_CART_SUCCESS: "customer:remove:from:cart:success";
56
- CUSTOMER_GET_MENU_SUCCESS: "customer:get:menu:success";
57
- TABLE_JOIN_REQUEST_SENT_SUCCESS: "table:join:request:success";
58
- TABLE_JOIN_REQUEST_APPROVED_SUCCESS: "table:join:request:approved:success";
59
- ERROR_MESSAGE_SUCCESS: "error:message:success";
60
- SUCCESS_MESSAGE_SUCCESS: "success:message:success";
61
- WARNING_MESSAGE_SUCCESS: "warning:message:success";
62
- GET_PENDING_CUSTOMER_LOGINS_SUCCESS: "auth:customer:login:pending:get:success";
63
- CUSTOMER_UPDATE_IS_PAID_SUCCESS: "customer:update:is-paid:success";
64
- TABLE_CREATED: "table:created:success";
65
- TABLE_ASSIGNED: "table:assigned:success";
66
- TABLE_STATUS_UPDATED: "table:status:updated:success";
67
- TABLE_RELEASED: "table:released:success";
68
- WAITER_RECEIVE_CALL: string;
69
- };
70
- declare class SocketService {
71
- private environment;
72
- private socket;
73
- private url;
74
- private connectionStatusSubject;
75
- connectionStatus$: Observable<boolean>;
76
- private reconnectSubject;
77
- reconnect$: Observable<void>;
78
- constructor(environment?: RealtimeStoreEnvironment);
79
- private setupSocketConnection;
80
- connect(): void;
81
- disconnect(): void;
82
- emit(event: string, data?: any): void;
83
- on<T>(event: string): Observable<T>;
84
- once<T>(event: string): Observable<T>;
85
- static ɵfac: i0.ɵɵFactoryDeclaration<SocketService, never>;
86
- static ɵprov: i0.ɵɵInjectableDeclaration<SocketService>;
87
- }
88
-
89
- declare abstract class BaseStore<T> {
90
- protected socketService: SocketService;
91
- protected dataSubject: BehaviorSubject<T[]>;
92
- data$: Observable<T[]>;
93
- protected loadingSubject: BehaviorSubject<boolean>;
94
- loading$: Observable<boolean>;
95
- protected errorSubject: BehaviorSubject<string | null>;
96
- error$: Observable<string | null>;
97
- constructor(socketService: SocketService);
98
- private refresh;
99
- abstract preload(): Promise<T[]>;
100
- protected updateItems(items: T[]): void;
101
- protected addItem(item: T): void;
102
- protected updateItem(updatedItem: Partial<T>, idField: keyof T): void;
103
- protected removeItem(id: any, idField: keyof T): void;
104
- protected setLoading(isLoading: boolean): void;
105
- protected setError(error: string | null): void;
106
- protected subscribeToEvent<R>(event: string, handler: (data: R) => void): void;
107
- getAll(): T[];
108
- getById(id: any, idField: keyof T): T | undefined;
109
- static ɵfac: i0.ɵɵFactoryDeclaration<BaseStore<any>, never>;
110
- static ɵprov: i0.ɵɵInjectableDeclaration<BaseStore<any>>;
111
- }
112
-
113
- /**
114
- * API Gateway
115
- *
116
- *
117
- *
118
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
119
- * https://openapi-generator.tech
120
- * Do not edit the class manually.
121
- */
122
- interface WaiterDto {
123
- /**
124
- * Unique identifier of the waiter
125
- */
126
- id: string;
127
- /**
128
- * Name of the waiter
129
- */
130
- name: string;
131
- /**
132
- * Unique username for the waiter
133
- */
134
- username: string;
135
- /**
136
- * Encrypted password for the waiter
137
- */
138
- password?: string;
139
- /**
140
- * Socket key for real-time communication
141
- */
142
- socketKey?: string;
143
- /**
144
- * Tables assigned to this waiter
145
- */
146
- tables?: Array<string>;
147
- }
148
-
149
- /**
150
- * API Gateway
151
- *
152
- *
153
- *
154
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
155
- * https://openapi-generator.tech
156
- * Do not edit the class manually.
157
- */
158
- interface CallWaiterDtoCustomer {
159
- id: string;
160
- name: string;
161
- verified: boolean;
162
- isHost: boolean;
163
- tableId: string;
164
- }
165
-
166
- /**
167
- * API Gateway
168
- *
169
- *
170
- *
171
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
172
- * https://openapi-generator.tech
173
- * Do not edit the class manually.
174
- */
175
-
176
- interface CallWaiterDto {
177
- /**
178
- * Unique identifier of the call waiter request
179
- */
180
- id: string;
181
- /**
182
- * ID of the customer making the waiter call
183
- */
184
- customerId: string;
185
- /**
186
- * Whether the waiter call has been resolved
187
- */
188
- isResolved: boolean;
189
- /**
190
- * Message or reason for calling the waiter
191
- */
192
- message?: string;
193
- customer?: CallWaiterDtoCustomer;
194
- }
195
-
196
- /**
197
- * API Gateway
198
- *
199
- *
200
- *
201
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
202
- * https://openapi-generator.tech
203
- * Do not edit the class manually.
204
- */
205
-
206
- interface CartDto {
207
- /**
208
- * UUID of the cart
209
- */
210
- id?: string;
211
- /**
212
- * UUID of the table associated with this cart
213
- */
214
- tableId: string;
215
- /**
216
- * UUID of the menu item for this cart
217
- */
218
- menuItemId: string;
219
- /**
220
- * Customer cart items within this cart
221
- */
222
- customerCarts?: Array<CustomerCartDto>;
223
- }
224
-
225
- /**
226
- * API Gateway
227
- *
228
- *
229
- *
230
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
231
- * https://openapi-generator.tech
232
- * Do not edit the class manually.
233
- */
234
-
235
- interface CustomerCartDto {
236
- /**
237
- * UUID of the customer cart item
238
- */
239
- id?: string;
240
- /**
241
- * UUID of the customer placing the order
242
- */
243
- customerId: string;
244
- /**
245
- * Customer details
246
- */
247
- customer?: CustomerDto;
248
- /**
249
- * UUID of the main cart this item belongs to
250
- */
251
- cartItemId: string;
252
- /**
253
- * Cart item details
254
- */
255
- cartItem?: CartDto;
256
- /**
257
- * Quantity of the item ordered by this customer
258
- */
259
- quantity: number;
260
- /**
261
- * Current status of this customer\'s cart item
262
- */
263
- status?: CustomerCartDto.StatusEnum;
264
- /**
265
- * Timestamp of when the customer cart item was added
266
- */
267
- time?: string;
268
- }
269
- declare namespace CustomerCartDto {
270
- const StatusEnum: {
271
- readonly CheckedOut: "checked_out";
272
- readonly Preparing: "preparing";
273
- readonly Prepared: "PREPARED";
274
- readonly Delivered: "delivered";
275
- readonly Cancelled: "cancelled";
276
- readonly New: "new";
277
- };
278
- type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum];
279
- }
280
-
281
- /**
282
- * API Gateway
283
- *
284
- *
285
- *
286
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
287
- * https://openapi-generator.tech
288
- * Do not edit the class manually.
289
- */
290
-
291
- interface CustomerDto {
292
- /**
293
- * Unique identifier of the customer
294
- */
295
- id: string;
296
- /**
297
- * Name of the customer
298
- */
299
- name: string;
300
- /**
301
- * Whether the customer is verified
302
- */
303
- verified: boolean;
304
- /**
305
- * Whether the customer is the host
306
- */
307
- isHost: boolean;
308
- /**
309
- * Table information where the customer is seated
310
- */
311
- table?: TableResponseDto;
312
- /**
313
- * Unique identifier of the table
314
- */
315
- tableId: string;
316
- /**
317
- * Customer cart items
318
- */
319
- carts?: Array<CustomerCartDto>;
320
- /**
321
- * Waiter call requests made by this customer
322
- */
323
- waiterCalls?: Array<CallWaiterDto>;
324
- }
325
-
326
- /**
327
- * API Gateway
328
- *
329
- *
330
- *
331
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
332
- * https://openapi-generator.tech
333
- * Do not edit the class manually.
334
- */
335
-
336
- interface TableResponseDto {
337
- /**
338
- * Unique table identifier
339
- */
340
- id: string;
341
- /**
342
- * Host ID (customer who created the table)
343
- */
344
- hostId?: string;
345
- /**
346
- * Host customer information
347
- */
348
- host?: CustomerDto;
349
- /**
350
- * Tip amount for the table
351
- */
352
- tip: number;
353
- /**
354
- * Table number
355
- */
356
- number: number;
357
- /**
358
- * Seating capacity of the table
359
- */
360
- capacity: number;
361
- /**
362
- * Current status of the table
363
- */
364
- status: TableResponseDto.StatusEnum;
365
- /**
366
- * Branch ID where the table belongs
367
- */
368
- branchId: string;
369
- /**
370
- * Whether the table is waiter-managed
371
- */
372
- waiterManaged?: boolean;
373
- /**
374
- * Assigned waiter information
375
- */
376
- waiter?: WaiterDto;
377
- /**
378
- * Carts associated with this table
379
- */
380
- carts?: Array<CartDto>;
381
- customers: Array<Array<CustomerDto>>;
382
- /**
383
- * Whether the waiter is being called by the table
384
- */
385
- callingWaiter?: boolean;
386
- }
387
- declare namespace TableResponseDto {
388
- const StatusEnum: {
389
- readonly Free: "free";
390
- readonly Occupied: "occupied";
391
- readonly Reserved: "reserved";
392
- };
393
- type StatusEnum = typeof StatusEnum[keyof typeof StatusEnum];
394
- }
395
-
396
- declare abstract class TableStore extends BaseStore<TableResponseDto> {
397
- protected socketService: SocketService;
398
- constructor();
399
- abstract preload(): Promise<TableResponseDto[]>;
400
- static ɵfac: i0.ɵɵFactoryDeclaration<TableStore, never>;
401
- static ɵprov: i0.ɵɵInjectableDeclaration<TableStore>;
402
- }
403
-
404
- declare abstract class CartStore extends BaseStore<CartDto> {
405
- protected socketService: SocketService;
406
- constructor(socketService: SocketService);
407
- static ɵfac: i0.ɵɵFactoryDeclaration<CartStore, never>;
408
- static ɵprov: i0.ɵɵInjectableDeclaration<CartStore>;
409
- }
410
-
411
- /**
412
- * API Gateway
413
- *
414
- *
415
- *
416
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
417
- * https://openapi-generator.tech
418
- * Do not edit the class manually.
419
- */
420
- interface MenuItemReviewStatsDto {
421
- /**
422
- * Average star rating for the menu item, or null if there are no reviews.
423
- */
424
- average: number | null;
425
- /**
426
- * Total number of reviews for the menu item.
427
- */
428
- count: number;
429
- }
430
-
431
- /**
432
- * API Gateway
433
- *
434
- *
435
- *
436
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
437
- * https://openapi-generator.tech
438
- * Do not edit the class manually.
439
- */
440
- interface MenuItemReviewDto {
441
- /**
442
- * Menu Item ID
443
- */
444
- menuItemId: string;
445
- /**
446
- * Customer ID
447
- */
448
- customerId?: string;
449
- /**
450
- * Star rating
451
- */
452
- starRating: number;
453
- /**
454
- * Review message
455
- */
456
- message?: string;
457
- }
458
-
459
- /**
460
- * API Gateway
461
- *
462
- *
463
- *
464
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
465
- * https://openapi-generator.tech
466
- * Do not edit the class manually.
467
- */
468
-
469
- interface MenuItemDto {
470
- /**
471
- * Id of the menu item
472
- */
473
- id: string;
474
- /**
475
- * Name of the menu item
476
- */
477
- name: string;
478
- /**
479
- * Image URL or base64 string
480
- */
481
- image: string;
482
- /**
483
- * Price of the menu item
484
- */
485
- price: number;
486
- /**
487
- * Indicates if the menu item is prepared in the kitchen
488
- */
489
- isKitchenPrepared: boolean;
490
- /**
491
- * Description of the menu item
492
- */
493
- description: string;
494
- /**
495
- * UUID of the menu group this item belongs to
496
- */
497
- menuGroupId: string;
498
- /**
499
- * List of reviews for the menu item
500
- */
501
- reviews?: Array<MenuItemReviewDto>;
502
- /**
503
- * Review statistics for the menu item
504
- */
505
- reviewStats?: MenuItemReviewStatsDto;
506
- }
507
-
508
- declare abstract class MenuStore extends BaseStore<MenuItemDto> {
509
- protected socketService: SocketService;
510
- constructor(socketService: SocketService);
511
- getMenu(branchId: string): Promise<void>;
512
- getMenuItemReviews(menuItemId: string): Promise<void>;
513
- createMenuItemReview(menuItemId: string, rating: number, comment: string): Promise<void>;
514
- static ɵfac: i0.ɵɵFactoryDeclaration<MenuStore, never>;
515
- static ɵprov: i0.ɵɵInjectableDeclaration<MenuStore>;
516
- }
517
-
518
- /**
519
- * API Gateway
520
- *
521
- *
522
- *
523
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
524
- * https://openapi-generator.tech
525
- * Do not edit the class manually.
526
- */
527
-
528
- interface WaiterCallResponseDto {
529
- /**
530
- * Unique identifier of the waiter call
531
- */
532
- id: string;
533
- /**
534
- * ID of the customer making the call
535
- */
536
- customerId: string;
537
- /**
538
- * Whether the call has been resolved
539
- */
540
- isResolved: boolean;
541
- /**
542
- * Message or reason for the call
543
- */
544
- message: string;
545
- /**
546
- * ID of the table where the call was made
547
- */
548
- tableId: string;
549
- /**
550
- * Table number for easy identification
551
- */
552
- tableNumber: number;
553
- /**
554
- * Customer information who made the call
555
- */
556
- customer?: CustomerDto;
557
- }
558
-
559
- declare abstract class CallWaiterStore extends BaseStore<WaiterCallResponseDto> {
560
- protected socketService: SocketService;
561
- constructor(socketService: SocketService);
562
- abstract preload(): Promise<WaiterCallResponseDto[]>;
563
- static ɵfac: i0.ɵɵFactoryDeclaration<CallWaiterStore, never>;
564
- static ɵprov: i0.ɵɵInjectableDeclaration<CallWaiterStore>;
565
- }
566
-
567
- /**
568
- * API Gateway
569
- *
570
- *
571
- *
572
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
573
- * https://openapi-generator.tech
574
- * Do not edit the class manually.
575
- */
576
- interface CustomerAuthControllerApproveCustomerLoginRequest {
577
- /**
578
- * Customer ID to approve
579
- */
580
- customerId: string;
581
- /**
582
- * Table ID for the customer
583
- */
584
- tableId: string;
585
- }
586
-
587
- /**
588
- * API Gateway
589
- *
590
- *
591
- *
592
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
593
- * https://openapi-generator.tech
594
- * Do not edit the class manually.
595
- */
596
- interface CustomerLoginRequestDto {
597
- /**
598
- * Id of the customer.
599
- */
600
- id?: string;
601
- /**
602
- * Name of the customer.
603
- */
604
- name: string;
605
- /**
606
- * Unique identifier for the restaurant where the customer is located.
607
- */
608
- restaurantId: string;
609
- /**
610
- * Unique identifier for the branch of the restaurant.
611
- */
612
- branchId: string;
613
- /**
614
- * The table number assigned to the customer.
615
- */
616
- tableNo: number;
617
- /**
618
- * The table id assigned to the customer.
619
- */
620
- tableId: string;
621
- }
622
-
623
- declare abstract class CustomerLoginStore extends BaseStore<CustomerLoginRequestDto> {
624
- protected socketService: SocketService;
625
- constructor(socketService: SocketService);
626
- getPendingLogins(): void;
627
- approveCustomerLogin(customerId: string, tableId: string, customerAuthControllerApproveCustomerLogin: (payload: CustomerAuthControllerApproveCustomerLoginRequest) => Observable<CustomerAuthControllerApproveCustomerLoginRequest>): Promise<void>;
628
- static ɵfac: i0.ɵɵFactoryDeclaration<CustomerLoginStore, never>;
629
- static ɵprov: i0.ɵɵInjectableDeclaration<CustomerLoginStore>;
630
- }
631
-
632
- /**
633
- * Provides all services needed for the realtime store to function.
634
- * Use this function in your standalone application's bootstrapApplication providers array.
635
- *
636
- * @example
637
- * ```typescript
638
- * bootstrapApplication(AppComponent, {
639
- * providers: [
640
- * provideRealtimeStore()
641
- * ]
642
- * });
643
- * ```
644
- */
645
- declare function provideRealtimeStore(): EnvironmentProviders[];
646
-
647
- declare function provideRealtimeStoreEnvironment(environment: RealtimeStoreEnvironment): Provider;
648
-
649
- export { BaseStore, CallWaiterStore, CartStore, CustomerLoginStore, MenuStore, REALTIME_STORE_ENVIRONMENT, RealtimeStoreModule, SocketEvents, SocketService, SocketSuccessEvents, TableStore, defaultRealtimeStoreEnvironment, provideRealtimeStore, provideRealtimeStoreEnvironment };
650
- export type { RealtimeStoreEnvironment, WaiterCallResponseDto };