entity-client 1.0.24 → 1.0.26
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/dist/EntityAppServerApi.d.ts +49 -0
- package/dist/EntityServerApi.d.ts +24 -0
- package/dist/client/base.d.ts +13 -0
- package/dist/client/base.js +1 -1
- package/dist/client/base.js.map +3 -3
- package/dist/client/request.d.ts +6 -0
- package/dist/client/request.js +1 -1
- package/dist/client/request.js.map +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/mixins/app/plugins/alimtalk.d.ts +3 -0
- package/dist/mixins/app/plugins/friendtalk.d.ts +3 -0
- package/dist/mixins/app/plugins/holidays.d.ts +3 -0
- package/dist/mixins/app/plugins/identity.d.ts +3 -0
- package/dist/mixins/app/plugins/llm.d.ts +3 -0
- package/dist/mixins/app/plugins/ocr.d.ts +3 -0
- package/dist/mixins/app/plugins/pg.d.ts +3 -0
- package/dist/mixins/app/plugins/push.d.ts +3 -0
- package/dist/mixins/app/plugins/sms.d.ts +3 -0
- package/dist/mixins/app/plugins/taxinvoice.d.ts +3 -0
- package/dist/mixins/app/routes/account.d.ts +3 -0
- package/dist/mixins/app/routes/board.d.ts +4 -0
- package/dist/mixins/app/routes/board.js +1 -1
- package/dist/mixins/app/routes/board.js.map +2 -2
- package/dist/mixins/app/routes/email-verify.d.ts +3 -0
- package/dist/mixins/app/routes/oauth.d.ts +3 -0
- package/dist/mixins/app/routes/password-reset.d.ts +3 -0
- package/dist/mixins/app/routes/two-factor.d.ts +3 -0
- package/dist/mixins/server/admin.d.ts +3 -0
- package/dist/mixins/server/auth.d.ts +3 -0
- package/dist/mixins/server/auth.js +1 -1
- package/dist/mixins/server/auth.js.map +3 -3
- package/dist/mixins/server/entity.d.ts +3 -0
- package/dist/mixins/server/file.d.ts +3 -0
- package/dist/mixins/server/push.d.ts +3 -0
- package/dist/mixins/server/smtp.d.ts +3 -0
- package/dist/mixins/server/transaction.d.ts +3 -0
- package/dist/mixins/server/utils.d.ts +3 -0
- package/dist/react.js +1 -1
- package/dist/react.js.map +3 -3
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
|
@@ -11,12 +11,14 @@ declare const EntityAppServerApi_base: {
|
|
|
11
11
|
apiKey: string;
|
|
12
12
|
hmacSecret: string;
|
|
13
13
|
encryptRequests: boolean;
|
|
14
|
+
debugPlainSecret: string;
|
|
14
15
|
csrfEnabled: boolean;
|
|
15
16
|
csrfHeaderName: string;
|
|
16
17
|
csrfCookieName: string;
|
|
17
18
|
csrfRefresher: (() => Promise<void>) | null;
|
|
18
19
|
requestAbortControllers: Map<string, AbortController>;
|
|
19
20
|
activeTxId: string | null;
|
|
21
|
+
initialHealthFired: boolean;
|
|
20
22
|
keepSession: boolean;
|
|
21
23
|
refreshBuffer: number;
|
|
22
24
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -39,6 +41,7 @@ declare const EntityAppServerApi_base: {
|
|
|
39
41
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
40
42
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
41
43
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
44
|
+
fireInitialHealth(): void;
|
|
42
45
|
setToken(token: string): void;
|
|
43
46
|
setAccessTokenFromResponse(token: string): void;
|
|
44
47
|
syncRealtimeWithToken(): void;
|
|
@@ -97,12 +100,14 @@ declare const EntityAppServerApi_base: {
|
|
|
97
100
|
apiKey: string;
|
|
98
101
|
hmacSecret: string;
|
|
99
102
|
encryptRequests: boolean;
|
|
103
|
+
debugPlainSecret: string;
|
|
100
104
|
csrfEnabled: boolean;
|
|
101
105
|
csrfHeaderName: string;
|
|
102
106
|
csrfCookieName: string;
|
|
103
107
|
csrfRefresher: (() => Promise<void>) | null;
|
|
104
108
|
requestAbortControllers: Map<string, AbortController>;
|
|
105
109
|
activeTxId: string | null;
|
|
110
|
+
initialHealthFired: boolean;
|
|
106
111
|
keepSession: boolean;
|
|
107
112
|
refreshBuffer: number;
|
|
108
113
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -125,6 +130,7 @@ declare const EntityAppServerApi_base: {
|
|
|
125
130
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
126
131
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
127
132
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
133
|
+
fireInitialHealth(): void;
|
|
128
134
|
setToken(token: string): void;
|
|
129
135
|
setAccessTokenFromResponse(token: string): void;
|
|
130
136
|
syncRealtimeWithToken(): void;
|
|
@@ -186,12 +192,14 @@ declare const EntityAppServerApi_base: {
|
|
|
186
192
|
apiKey: string;
|
|
187
193
|
hmacSecret: string;
|
|
188
194
|
encryptRequests: boolean;
|
|
195
|
+
debugPlainSecret: string;
|
|
189
196
|
csrfEnabled: boolean;
|
|
190
197
|
csrfHeaderName: string;
|
|
191
198
|
csrfCookieName: string;
|
|
192
199
|
csrfRefresher: (() => Promise<void>) | null;
|
|
193
200
|
requestAbortControllers: Map<string, AbortController>;
|
|
194
201
|
activeTxId: string | null;
|
|
202
|
+
initialHealthFired: boolean;
|
|
195
203
|
keepSession: boolean;
|
|
196
204
|
refreshBuffer: number;
|
|
197
205
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -214,6 +222,7 @@ declare const EntityAppServerApi_base: {
|
|
|
214
222
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
215
223
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
216
224
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
225
|
+
fireInitialHealth(): void;
|
|
217
226
|
setToken(token: string): void;
|
|
218
227
|
setAccessTokenFromResponse(token: string): void;
|
|
219
228
|
syncRealtimeWithToken(): void;
|
|
@@ -276,12 +285,14 @@ declare const EntityAppServerApi_base: {
|
|
|
276
285
|
apiKey: string;
|
|
277
286
|
hmacSecret: string;
|
|
278
287
|
encryptRequests: boolean;
|
|
288
|
+
debugPlainSecret: string;
|
|
279
289
|
csrfEnabled: boolean;
|
|
280
290
|
csrfHeaderName: string;
|
|
281
291
|
csrfCookieName: string;
|
|
282
292
|
csrfRefresher: (() => Promise<void>) | null;
|
|
283
293
|
requestAbortControllers: Map<string, AbortController>;
|
|
284
294
|
activeTxId: string | null;
|
|
295
|
+
initialHealthFired: boolean;
|
|
285
296
|
keepSession: boolean;
|
|
286
297
|
refreshBuffer: number;
|
|
287
298
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -304,6 +315,7 @@ declare const EntityAppServerApi_base: {
|
|
|
304
315
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
305
316
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
306
317
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
318
|
+
fireInitialHealth(): void;
|
|
307
319
|
setToken(token: string): void;
|
|
308
320
|
setAccessTokenFromResponse(token: string): void;
|
|
309
321
|
syncRealtimeWithToken(): void;
|
|
@@ -368,12 +380,14 @@ declare const EntityAppServerApi_base: {
|
|
|
368
380
|
apiKey: string;
|
|
369
381
|
hmacSecret: string;
|
|
370
382
|
encryptRequests: boolean;
|
|
383
|
+
debugPlainSecret: string;
|
|
371
384
|
csrfEnabled: boolean;
|
|
372
385
|
csrfHeaderName: string;
|
|
373
386
|
csrfCookieName: string;
|
|
374
387
|
csrfRefresher: (() => Promise<void>) | null;
|
|
375
388
|
requestAbortControllers: Map<string, AbortController>;
|
|
376
389
|
activeTxId: string | null;
|
|
390
|
+
initialHealthFired: boolean;
|
|
377
391
|
keepSession: boolean;
|
|
378
392
|
refreshBuffer: number;
|
|
379
393
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -396,6 +410,7 @@ declare const EntityAppServerApi_base: {
|
|
|
396
410
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
397
411
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
398
412
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
413
|
+
fireInitialHealth(): void;
|
|
399
414
|
setToken(token: string): void;
|
|
400
415
|
setAccessTokenFromResponse(token: string): void;
|
|
401
416
|
syncRealtimeWithToken(): void;
|
|
@@ -459,12 +474,14 @@ declare const EntityAppServerApi_base: {
|
|
|
459
474
|
apiKey: string;
|
|
460
475
|
hmacSecret: string;
|
|
461
476
|
encryptRequests: boolean;
|
|
477
|
+
debugPlainSecret: string;
|
|
462
478
|
csrfEnabled: boolean;
|
|
463
479
|
csrfHeaderName: string;
|
|
464
480
|
csrfCookieName: string;
|
|
465
481
|
csrfRefresher: (() => Promise<void>) | null;
|
|
466
482
|
requestAbortControllers: Map<string, AbortController>;
|
|
467
483
|
activeTxId: string | null;
|
|
484
|
+
initialHealthFired: boolean;
|
|
468
485
|
keepSession: boolean;
|
|
469
486
|
refreshBuffer: number;
|
|
470
487
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -487,6 +504,7 @@ declare const EntityAppServerApi_base: {
|
|
|
487
504
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
488
505
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
489
506
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
507
|
+
fireInitialHealth(): void;
|
|
490
508
|
setToken(token: string): void;
|
|
491
509
|
setAccessTokenFromResponse(token: string): void;
|
|
492
510
|
syncRealtimeWithToken(): void;
|
|
@@ -552,12 +570,14 @@ declare const EntityAppServerApi_base: {
|
|
|
552
570
|
apiKey: string;
|
|
553
571
|
hmacSecret: string;
|
|
554
572
|
encryptRequests: boolean;
|
|
573
|
+
debugPlainSecret: string;
|
|
555
574
|
csrfEnabled: boolean;
|
|
556
575
|
csrfHeaderName: string;
|
|
557
576
|
csrfCookieName: string;
|
|
558
577
|
csrfRefresher: (() => Promise<void>) | null;
|
|
559
578
|
requestAbortControllers: Map<string, AbortController>;
|
|
560
579
|
activeTxId: string | null;
|
|
580
|
+
initialHealthFired: boolean;
|
|
561
581
|
keepSession: boolean;
|
|
562
582
|
refreshBuffer: number;
|
|
563
583
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -580,6 +600,7 @@ declare const EntityAppServerApi_base: {
|
|
|
580
600
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
581
601
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
582
602
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
603
|
+
fireInitialHealth(): void;
|
|
583
604
|
setToken(token: string): void;
|
|
584
605
|
setAccessTokenFromResponse(token: string): void;
|
|
585
606
|
syncRealtimeWithToken(): void;
|
|
@@ -672,12 +693,14 @@ declare const EntityAppServerApi_base: {
|
|
|
672
693
|
apiKey: string;
|
|
673
694
|
hmacSecret: string;
|
|
674
695
|
encryptRequests: boolean;
|
|
696
|
+
debugPlainSecret: string;
|
|
675
697
|
csrfEnabled: boolean;
|
|
676
698
|
csrfHeaderName: string;
|
|
677
699
|
csrfCookieName: string;
|
|
678
700
|
csrfRefresher: (() => Promise<void>) | null;
|
|
679
701
|
requestAbortControllers: Map<string, AbortController>;
|
|
680
702
|
activeTxId: string | null;
|
|
703
|
+
initialHealthFired: boolean;
|
|
681
704
|
keepSession: boolean;
|
|
682
705
|
refreshBuffer: number;
|
|
683
706
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -700,6 +723,7 @@ declare const EntityAppServerApi_base: {
|
|
|
700
723
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
701
724
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
702
725
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
726
|
+
fireInitialHealth(): void;
|
|
703
727
|
setToken(token: string): void;
|
|
704
728
|
setAccessTokenFromResponse(token: string): void;
|
|
705
729
|
syncRealtimeWithToken(): void;
|
|
@@ -761,12 +785,14 @@ declare const EntityAppServerApi_base: {
|
|
|
761
785
|
apiKey: string;
|
|
762
786
|
hmacSecret: string;
|
|
763
787
|
encryptRequests: boolean;
|
|
788
|
+
debugPlainSecret: string;
|
|
764
789
|
csrfEnabled: boolean;
|
|
765
790
|
csrfHeaderName: string;
|
|
766
791
|
csrfCookieName: string;
|
|
767
792
|
csrfRefresher: (() => Promise<void>) | null;
|
|
768
793
|
requestAbortControllers: Map<string, AbortController>;
|
|
769
794
|
activeTxId: string | null;
|
|
795
|
+
initialHealthFired: boolean;
|
|
770
796
|
keepSession: boolean;
|
|
771
797
|
refreshBuffer: number;
|
|
772
798
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -789,6 +815,7 @@ declare const EntityAppServerApi_base: {
|
|
|
789
815
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
790
816
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
791
817
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
818
|
+
fireInitialHealth(): void;
|
|
792
819
|
setToken(token: string): void;
|
|
793
820
|
setAccessTokenFromResponse(token: string): void;
|
|
794
821
|
syncRealtimeWithToken(): void;
|
|
@@ -853,12 +880,14 @@ declare const EntityAppServerApi_base: {
|
|
|
853
880
|
apiKey: string;
|
|
854
881
|
hmacSecret: string;
|
|
855
882
|
encryptRequests: boolean;
|
|
883
|
+
debugPlainSecret: string;
|
|
856
884
|
csrfEnabled: boolean;
|
|
857
885
|
csrfHeaderName: string;
|
|
858
886
|
csrfCookieName: string;
|
|
859
887
|
csrfRefresher: (() => Promise<void>) | null;
|
|
860
888
|
requestAbortControllers: Map<string, AbortController>;
|
|
861
889
|
activeTxId: string | null;
|
|
890
|
+
initialHealthFired: boolean;
|
|
862
891
|
keepSession: boolean;
|
|
863
892
|
refreshBuffer: number;
|
|
864
893
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -881,6 +910,7 @@ declare const EntityAppServerApi_base: {
|
|
|
881
910
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
882
911
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
883
912
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
913
|
+
fireInitialHealth(): void;
|
|
884
914
|
setToken(token: string): void;
|
|
885
915
|
setAccessTokenFromResponse(token: string): void;
|
|
886
916
|
syncRealtimeWithToken(): void;
|
|
@@ -944,12 +974,14 @@ declare const EntityAppServerApi_base: {
|
|
|
944
974
|
apiKey: string;
|
|
945
975
|
hmacSecret: string;
|
|
946
976
|
encryptRequests: boolean;
|
|
977
|
+
debugPlainSecret: string;
|
|
947
978
|
csrfEnabled: boolean;
|
|
948
979
|
csrfHeaderName: string;
|
|
949
980
|
csrfCookieName: string;
|
|
950
981
|
csrfRefresher: (() => Promise<void>) | null;
|
|
951
982
|
requestAbortControllers: Map<string, AbortController>;
|
|
952
983
|
activeTxId: string | null;
|
|
984
|
+
initialHealthFired: boolean;
|
|
953
985
|
keepSession: boolean;
|
|
954
986
|
refreshBuffer: number;
|
|
955
987
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -972,6 +1004,7 @@ declare const EntityAppServerApi_base: {
|
|
|
972
1004
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
973
1005
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
974
1006
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
1007
|
+
fireInitialHealth(): void;
|
|
975
1008
|
setToken(token: string): void;
|
|
976
1009
|
setAccessTokenFromResponse(token: string): void;
|
|
977
1010
|
syncRealtimeWithToken(): void;
|
|
@@ -1036,12 +1069,14 @@ declare const EntityAppServerApi_base: {
|
|
|
1036
1069
|
apiKey: string;
|
|
1037
1070
|
hmacSecret: string;
|
|
1038
1071
|
encryptRequests: boolean;
|
|
1072
|
+
debugPlainSecret: string;
|
|
1039
1073
|
csrfEnabled: boolean;
|
|
1040
1074
|
csrfHeaderName: string;
|
|
1041
1075
|
csrfCookieName: string;
|
|
1042
1076
|
csrfRefresher: (() => Promise<void>) | null;
|
|
1043
1077
|
requestAbortControllers: Map<string, AbortController>;
|
|
1044
1078
|
activeTxId: string | null;
|
|
1079
|
+
initialHealthFired: boolean;
|
|
1045
1080
|
keepSession: boolean;
|
|
1046
1081
|
refreshBuffer: number;
|
|
1047
1082
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -1064,6 +1099,7 @@ declare const EntityAppServerApi_base: {
|
|
|
1064
1099
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
1065
1100
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
1066
1101
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
1102
|
+
fireInitialHealth(): void;
|
|
1067
1103
|
setToken(token: string): void;
|
|
1068
1104
|
setAccessTokenFromResponse(token: string): void;
|
|
1069
1105
|
syncRealtimeWithToken(): void;
|
|
@@ -1126,12 +1162,14 @@ declare const EntityAppServerApi_base: {
|
|
|
1126
1162
|
apiKey: string;
|
|
1127
1163
|
hmacSecret: string;
|
|
1128
1164
|
encryptRequests: boolean;
|
|
1165
|
+
debugPlainSecret: string;
|
|
1129
1166
|
csrfEnabled: boolean;
|
|
1130
1167
|
csrfHeaderName: string;
|
|
1131
1168
|
csrfCookieName: string;
|
|
1132
1169
|
csrfRefresher: (() => Promise<void>) | null;
|
|
1133
1170
|
requestAbortControllers: Map<string, AbortController>;
|
|
1134
1171
|
activeTxId: string | null;
|
|
1172
|
+
initialHealthFired: boolean;
|
|
1135
1173
|
keepSession: boolean;
|
|
1136
1174
|
refreshBuffer: number;
|
|
1137
1175
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -1154,6 +1192,7 @@ declare const EntityAppServerApi_base: {
|
|
|
1154
1192
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
1155
1193
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
1156
1194
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
1195
|
+
fireInitialHealth(): void;
|
|
1157
1196
|
setToken(token: string): void;
|
|
1158
1197
|
setAccessTokenFromResponse(token: string): void;
|
|
1159
1198
|
syncRealtimeWithToken(): void;
|
|
@@ -1216,12 +1255,14 @@ declare const EntityAppServerApi_base: {
|
|
|
1216
1255
|
apiKey: string;
|
|
1217
1256
|
hmacSecret: string;
|
|
1218
1257
|
encryptRequests: boolean;
|
|
1258
|
+
debugPlainSecret: string;
|
|
1219
1259
|
csrfEnabled: boolean;
|
|
1220
1260
|
csrfHeaderName: string;
|
|
1221
1261
|
csrfCookieName: string;
|
|
1222
1262
|
csrfRefresher: (() => Promise<void>) | null;
|
|
1223
1263
|
requestAbortControllers: Map<string, AbortController>;
|
|
1224
1264
|
activeTxId: string | null;
|
|
1265
|
+
initialHealthFired: boolean;
|
|
1225
1266
|
keepSession: boolean;
|
|
1226
1267
|
refreshBuffer: number;
|
|
1227
1268
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -1244,6 +1285,7 @@ declare const EntityAppServerApi_base: {
|
|
|
1244
1285
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
1245
1286
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
1246
1287
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
1288
|
+
fireInitialHealth(): void;
|
|
1247
1289
|
setToken(token: string): void;
|
|
1248
1290
|
setAccessTokenFromResponse(token: string): void;
|
|
1249
1291
|
syncRealtimeWithToken(): void;
|
|
@@ -1304,6 +1346,7 @@ declare const EntityAppServerApi_base: {
|
|
|
1304
1346
|
getBoardPost<T = unknown>(seq: number): Promise<T>;
|
|
1305
1347
|
createBoardPost<T = unknown>(category: string, body: Record<string, unknown>): Promise<T>;
|
|
1306
1348
|
updateBoardPost<T = unknown>(seq: number, body: Record<string, unknown>): Promise<T>;
|
|
1349
|
+
expireBoardPost<T = unknown>(seq: number): Promise<T>;
|
|
1307
1350
|
deleteBoardPost<T = unknown>(seq: number): Promise<T>;
|
|
1308
1351
|
listBoardComments<T = unknown>(postSeq: number, query?: Record<string, unknown>): Promise<T>;
|
|
1309
1352
|
createBoardComment<T = unknown>(postSeq: number, body: Record<string, unknown>): Promise<T>;
|
|
@@ -1334,12 +1377,14 @@ declare const EntityAppServerApi_base: {
|
|
|
1334
1377
|
apiKey: string;
|
|
1335
1378
|
hmacSecret: string;
|
|
1336
1379
|
encryptRequests: boolean;
|
|
1380
|
+
debugPlainSecret: string;
|
|
1337
1381
|
csrfEnabled: boolean;
|
|
1338
1382
|
csrfHeaderName: string;
|
|
1339
1383
|
csrfCookieName: string;
|
|
1340
1384
|
csrfRefresher: (() => Promise<void>) | null;
|
|
1341
1385
|
requestAbortControllers: Map<string, AbortController>;
|
|
1342
1386
|
activeTxId: string | null;
|
|
1387
|
+
initialHealthFired: boolean;
|
|
1343
1388
|
keepSession: boolean;
|
|
1344
1389
|
refreshBuffer: number;
|
|
1345
1390
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -1362,6 +1407,7 @@ declare const EntityAppServerApi_base: {
|
|
|
1362
1407
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
1363
1408
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
1364
1409
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
1410
|
+
fireInitialHealth(): void;
|
|
1365
1411
|
setToken(token: string): void;
|
|
1366
1412
|
setAccessTokenFromResponse(token: string): void;
|
|
1367
1413
|
syncRealtimeWithToken(): void;
|
|
@@ -1429,12 +1475,14 @@ declare const EntityAppServerApi_base: {
|
|
|
1429
1475
|
apiKey: string;
|
|
1430
1476
|
hmacSecret: string;
|
|
1431
1477
|
encryptRequests: boolean;
|
|
1478
|
+
debugPlainSecret: string;
|
|
1432
1479
|
csrfEnabled: boolean;
|
|
1433
1480
|
csrfHeaderName: string;
|
|
1434
1481
|
csrfCookieName: string;
|
|
1435
1482
|
csrfRefresher: (() => Promise<void>) | null;
|
|
1436
1483
|
requestAbortControllers: Map<string, AbortController>;
|
|
1437
1484
|
activeTxId: string | null;
|
|
1485
|
+
initialHealthFired: boolean;
|
|
1438
1486
|
keepSession: boolean;
|
|
1439
1487
|
refreshBuffer: number;
|
|
1440
1488
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -1457,6 +1505,7 @@ declare const EntityAppServerApi_base: {
|
|
|
1457
1505
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
1458
1506
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
1459
1507
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
1508
|
+
fireInitialHealth(): void;
|
|
1460
1509
|
setToken(token: string): void;
|
|
1461
1510
|
setAccessTokenFromResponse(token: string): void;
|
|
1462
1511
|
syncRealtimeWithToken(): void;
|
|
@@ -42,12 +42,14 @@ declare const EntityServerApi_base: {
|
|
|
42
42
|
apiKey: string;
|
|
43
43
|
hmacSecret: string;
|
|
44
44
|
encryptRequests: boolean;
|
|
45
|
+
debugPlainSecret: string;
|
|
45
46
|
csrfEnabled: boolean;
|
|
46
47
|
csrfHeaderName: string;
|
|
47
48
|
csrfCookieName: string;
|
|
48
49
|
csrfRefresher: (() => Promise<void>) | null;
|
|
49
50
|
requestAbortControllers: Map<string, AbortController>;
|
|
50
51
|
activeTxId: string | null;
|
|
52
|
+
initialHealthFired: boolean;
|
|
51
53
|
keepSession: boolean;
|
|
52
54
|
refreshBuffer: number;
|
|
53
55
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -70,6 +72,7 @@ declare const EntityServerApi_base: {
|
|
|
70
72
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
71
73
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
72
74
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
75
|
+
fireInitialHealth(): void;
|
|
73
76
|
setToken(token: string): void;
|
|
74
77
|
setAccessTokenFromResponse(token: string): void;
|
|
75
78
|
syncRealtimeWithToken(): void;
|
|
@@ -130,12 +133,14 @@ declare const EntityServerApi_base: {
|
|
|
130
133
|
apiKey: string;
|
|
131
134
|
hmacSecret: string;
|
|
132
135
|
encryptRequests: boolean;
|
|
136
|
+
debugPlainSecret: string;
|
|
133
137
|
csrfEnabled: boolean;
|
|
134
138
|
csrfHeaderName: string;
|
|
135
139
|
csrfCookieName: string;
|
|
136
140
|
csrfRefresher: (() => Promise<void>) | null;
|
|
137
141
|
requestAbortControllers: Map<string, AbortController>;
|
|
138
142
|
activeTxId: string | null;
|
|
143
|
+
initialHealthFired: boolean;
|
|
139
144
|
keepSession: boolean;
|
|
140
145
|
refreshBuffer: number;
|
|
141
146
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -158,6 +163,7 @@ declare const EntityServerApi_base: {
|
|
|
158
163
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
159
164
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
160
165
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
166
|
+
fireInitialHealth(): void;
|
|
161
167
|
setToken(token: string): void;
|
|
162
168
|
setAccessTokenFromResponse(token: string): void;
|
|
163
169
|
syncRealtimeWithToken(): void;
|
|
@@ -280,12 +286,14 @@ declare const EntityServerApi_base: {
|
|
|
280
286
|
apiKey: string;
|
|
281
287
|
hmacSecret: string;
|
|
282
288
|
encryptRequests: boolean;
|
|
289
|
+
debugPlainSecret: string;
|
|
283
290
|
csrfEnabled: boolean;
|
|
284
291
|
csrfHeaderName: string;
|
|
285
292
|
csrfCookieName: string;
|
|
286
293
|
csrfRefresher: (() => Promise<void>) | null;
|
|
287
294
|
requestAbortControllers: Map<string, AbortController>;
|
|
288
295
|
activeTxId: string | null;
|
|
296
|
+
initialHealthFired: boolean;
|
|
289
297
|
keepSession: boolean;
|
|
290
298
|
refreshBuffer: number;
|
|
291
299
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -308,6 +316,7 @@ declare const EntityServerApi_base: {
|
|
|
308
316
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
309
317
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
310
318
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
319
|
+
fireInitialHealth(): void;
|
|
311
320
|
setToken(token: string): void;
|
|
312
321
|
setAccessTokenFromResponse(token: string): void;
|
|
313
322
|
syncRealtimeWithToken(): void;
|
|
@@ -374,12 +383,14 @@ declare const EntityServerApi_base: {
|
|
|
374
383
|
apiKey: string;
|
|
375
384
|
hmacSecret: string;
|
|
376
385
|
encryptRequests: boolean;
|
|
386
|
+
debugPlainSecret: string;
|
|
377
387
|
csrfEnabled: boolean;
|
|
378
388
|
csrfHeaderName: string;
|
|
379
389
|
csrfCookieName: string;
|
|
380
390
|
csrfRefresher: (() => Promise<void>) | null;
|
|
381
391
|
requestAbortControllers: Map<string, AbortController>;
|
|
382
392
|
activeTxId: string | null;
|
|
393
|
+
initialHealthFired: boolean;
|
|
383
394
|
keepSession: boolean;
|
|
384
395
|
refreshBuffer: number;
|
|
385
396
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -402,6 +413,7 @@ declare const EntityServerApi_base: {
|
|
|
402
413
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
403
414
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
404
415
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
416
|
+
fireInitialHealth(): void;
|
|
405
417
|
setToken(token: string): void;
|
|
406
418
|
setAccessTokenFromResponse(token: string): void;
|
|
407
419
|
syncRealtimeWithToken(): void;
|
|
@@ -486,12 +498,14 @@ declare const EntityServerApi_base: {
|
|
|
486
498
|
apiKey: string;
|
|
487
499
|
hmacSecret: string;
|
|
488
500
|
encryptRequests: boolean;
|
|
501
|
+
debugPlainSecret: string;
|
|
489
502
|
csrfEnabled: boolean;
|
|
490
503
|
csrfHeaderName: string;
|
|
491
504
|
csrfCookieName: string;
|
|
492
505
|
csrfRefresher: (() => Promise<void>) | null;
|
|
493
506
|
requestAbortControllers: Map<string, AbortController>;
|
|
494
507
|
activeTxId: string | null;
|
|
508
|
+
initialHealthFired: boolean;
|
|
495
509
|
keepSession: boolean;
|
|
496
510
|
refreshBuffer: number;
|
|
497
511
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -514,6 +528,7 @@ declare const EntityServerApi_base: {
|
|
|
514
528
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
515
529
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
516
530
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
531
|
+
fireInitialHealth(): void;
|
|
517
532
|
setToken(token: string): void;
|
|
518
533
|
setAccessTokenFromResponse(token: string): void;
|
|
519
534
|
syncRealtimeWithToken(): void;
|
|
@@ -633,12 +648,14 @@ declare const EntityServerApi_base: {
|
|
|
633
648
|
apiKey: string;
|
|
634
649
|
hmacSecret: string;
|
|
635
650
|
encryptRequests: boolean;
|
|
651
|
+
debugPlainSecret: string;
|
|
636
652
|
csrfEnabled: boolean;
|
|
637
653
|
csrfHeaderName: string;
|
|
638
654
|
csrfCookieName: string;
|
|
639
655
|
csrfRefresher: (() => Promise<void>) | null;
|
|
640
656
|
requestAbortControllers: Map<string, AbortController>;
|
|
641
657
|
activeTxId: string | null;
|
|
658
|
+
initialHealthFired: boolean;
|
|
642
659
|
keepSession: boolean;
|
|
643
660
|
refreshBuffer: number;
|
|
644
661
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -661,6 +678,7 @@ declare const EntityServerApi_base: {
|
|
|
661
678
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
662
679
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
663
680
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
681
|
+
fireInitialHealth(): void;
|
|
664
682
|
setToken(token: string): void;
|
|
665
683
|
setAccessTokenFromResponse(token: string): void;
|
|
666
684
|
syncRealtimeWithToken(): void;
|
|
@@ -784,12 +802,14 @@ declare const EntityServerApi_base: {
|
|
|
784
802
|
apiKey: string;
|
|
785
803
|
hmacSecret: string;
|
|
786
804
|
encryptRequests: boolean;
|
|
805
|
+
debugPlainSecret: string;
|
|
787
806
|
csrfEnabled: boolean;
|
|
788
807
|
csrfHeaderName: string;
|
|
789
808
|
csrfCookieName: string;
|
|
790
809
|
csrfRefresher: (() => Promise<void>) | null;
|
|
791
810
|
requestAbortControllers: Map<string, AbortController>;
|
|
792
811
|
activeTxId: string | null;
|
|
812
|
+
initialHealthFired: boolean;
|
|
793
813
|
keepSession: boolean;
|
|
794
814
|
refreshBuffer: number;
|
|
795
815
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -812,6 +832,7 @@ declare const EntityServerApi_base: {
|
|
|
812
832
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
813
833
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
814
834
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
835
|
+
fireInitialHealth(): void;
|
|
815
836
|
setToken(token: string): void;
|
|
816
837
|
setAccessTokenFromResponse(token: string): void;
|
|
817
838
|
syncRealtimeWithToken(): void;
|
|
@@ -904,11 +925,13 @@ declare const EntityServerApi_base: {
|
|
|
904
925
|
apiKey: string;
|
|
905
926
|
hmacSecret: string;
|
|
906
927
|
encryptRequests: boolean;
|
|
928
|
+
debugPlainSecret: string;
|
|
907
929
|
csrfEnabled: boolean;
|
|
908
930
|
csrfHeaderName: string;
|
|
909
931
|
csrfCookieName: string;
|
|
910
932
|
requestAbortControllers: Map<string, AbortController>;
|
|
911
933
|
activeTxId: string | null;
|
|
934
|
+
initialHealthFired: boolean;
|
|
912
935
|
keepSession: boolean;
|
|
913
936
|
refreshBuffer: number;
|
|
914
937
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -931,6 +954,7 @@ declare const EntityServerApi_base: {
|
|
|
931
954
|
realtimeStatusListeners: Set<import("./types.js").RealtimeStatusListener>;
|
|
932
955
|
realtimeEventListeners: Map<string, Set<import("./types.js").RealtimeMessageListener>>;
|
|
933
956
|
configure(options: Partial<import("./types.js").EntityServerClientOptions>): void;
|
|
957
|
+
fireInitialHealth(): void;
|
|
934
958
|
setToken(token: string): void;
|
|
935
959
|
syncRealtimeWithToken(): void;
|
|
936
960
|
setAnonymousPacketToken(token: string): void;
|
package/dist/client/base.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare class EntityServerClientBase {
|
|
|
8
8
|
apiKey: string;
|
|
9
9
|
hmacSecret: string;
|
|
10
10
|
encryptRequests: boolean;
|
|
11
|
+
/** dev 디버그 평문 시크릿. 설정 시 요청을 평문 전송하고 `X-Debug-Plain` 헤더를 보낸다. */
|
|
12
|
+
debugPlainSecret: string;
|
|
11
13
|
csrfEnabled: boolean;
|
|
12
14
|
csrfHeaderName: string;
|
|
13
15
|
csrfCookieName: string;
|
|
@@ -15,6 +17,8 @@ export declare class EntityServerClientBase {
|
|
|
15
17
|
csrfRefresher: (() => Promise<void>) | null;
|
|
16
18
|
requestAbortControllers: Map<string, AbortController>;
|
|
17
19
|
activeTxId: string | null;
|
|
20
|
+
/** @internal 브라우저에서 첫 구성 시 health 1회 자동 호출했는지 여부 */
|
|
21
|
+
initialHealthFired: boolean;
|
|
18
22
|
keepSession: boolean;
|
|
19
23
|
refreshBuffer: number;
|
|
20
24
|
onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
|
|
@@ -45,6 +49,15 @@ export declare class EntityServerClientBase {
|
|
|
45
49
|
constructor(options?: EntityServerClientOptions);
|
|
46
50
|
/** baseUrl, token, encryptRequests 값을 런타임에 갱신합니다. */
|
|
47
51
|
configure(options: Partial<EntityServerClientOptions>): void;
|
|
52
|
+
/**
|
|
53
|
+
* 브라우저에서 클라이언트가 처음 구성될 때 `/v1/health` 를 1회 자동 호출한다.
|
|
54
|
+
*
|
|
55
|
+
* CSRF·anon 쿠키 발급과 패킷 암호화 협상(`X-Packet-Encryption`)을 앱 진입 즉시 선반영해,
|
|
56
|
+
* 프런트 라우트(`/login` 등)와 무관하게 항상 health 가 최소 1회 돌도록 보장한다.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
fireInitialHealth(): void;
|
|
48
61
|
/** 인증 요청에 사용할 JWT Access Token을 설정합니다. */
|
|
49
62
|
setToken(token: string): void;
|
|
50
63
|
/** 응답 헤더로 받은 access token 갱신을 반영한다. */
|
package/dist/client/base.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readEnv as m}from"./utils.js";import{derivePacketKey as u,parseRequestBody as f}from"./packet.js";import{entityRequest as l}from"./request.js";const c="/v1/realtime";class y{baseUrl;token;anonymousPacketToken;apiKey;hmacSecret;encryptRequests;csrfEnabled;csrfHeaderName;csrfCookieName;csrfRefresher=null;requestAbortControllers=new Map;activeTxId=null;keepSession;refreshBuffer;onTokenRefreshed;onSessionExpired;onHealthChange;sessionRefreshToken=null;refreshTimer=null;healthTickTimer=null;healthTickPromise=null;realtimeEnabled;realtimePath;realtimeAutoReconnect;realtimeReconnectDelayMs;realtimeStatus;realtimeSocket=null;realtimeConnectPromise=null;realtimeReconnectTimer=null;realtimeShouldReconnect=!1;realtimeMessageListeners=new Set;realtimeStatusListeners=new Set;realtimeEventListeners=new Map;constructor(e={}){const t=m("VITE_ENTITY_SERVER_URL");this.baseUrl=(e.baseUrl??t??"").replace(/\/$/,""),this.token=e.token??"",this.anonymousPacketToken=e.anonymousPacketToken??"",this.apiKey=e.apiKey??"",this.hmacSecret=e.hmacSecret??"",this.encryptRequests=e.encryptRequests??!1,this.csrfEnabled=e.csrfEnabled??!1,this.csrfHeaderName=e.csrfHeaderName??"x-csrf-token",this.csrfCookieName=e.csrfCookieName??"_csrf",this.keepSession=e.keepSession??!1,this.refreshBuffer=e.refreshBuffer??60,this.onTokenRefreshed=e.onTokenRefreshed,this.onSessionExpired=e.onSessionExpired,this.onHealthChange=e.onHealthChange,this.realtimeEnabled=!1,this.realtimePath=c,this.realtimeAutoReconnect=!0,this.realtimeReconnectDelayMs=3e3,this.realtimeStatus="idle",this.applyRealtimeOptions(e.realtime),typeof e.healthTickInterval=="number"&&e.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(e.healthTickInterval,!1))}configure(e){typeof e.baseUrl=="string"&&(this.baseUrl=e.baseUrl.replace(/\/$/,"")),typeof e.token=="string"&&(this.token=e.token),typeof e.anonymousPacketToken=="string"&&(this.anonymousPacketToken=e.anonymousPacketToken),typeof e.encryptRequests=="boolean"&&(this.encryptRequests=e.encryptRequests),typeof e.csrfEnabled=="boolean"&&(this.csrfEnabled=e.csrfEnabled),typeof e.csrfHeaderName=="string"&&(this.csrfHeaderName=e.csrfHeaderName),typeof e.csrfCookieName=="string"&&(this.csrfCookieName=e.csrfCookieName),typeof e.apiKey=="string"&&(this.apiKey=e.apiKey),typeof e.hmacSecret=="string"&&(this.hmacSecret=e.hmacSecret),typeof e.keepSession=="boolean"&&(this.keepSession=e.keepSession),typeof e.refreshBuffer=="number"&&(this.refreshBuffer=e.refreshBuffer),e.onTokenRefreshed&&(this.onTokenRefreshed=e.onTokenRefreshed),e.onSessionExpired&&(this.onSessionExpired=e.onSessionExpired),e.onHealthChange&&(this.onHealthChange=e.onHealthChange),typeof e.realtime<"u"&&this.applyRealtimeOptions(e.realtime),typeof e.healthTickInterval=="number"&&e.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(e.healthTickInterval,!1))}setToken(e){this.token=e,this.syncRealtimeWithToken()}setAccessTokenFromResponse(e){this.token=e,this.syncRealtimeWithToken()}syncRealtimeWithToken(){if(!this.token){this.disconnectRealtime("token_cleared");return}!this.realtimeEnabled||typeof WebSocket>"u"||this.connectRealtime().catch(()=>{})}setAnonymousPacketToken(e){this.anonymousPacketToken=e}setApiKey(e){this.apiKey=e}setHmacSecret(e){this.hmacSecret=e}setEncryptRequests(e){this.encryptRequests=e}setCsrfEnabled(e){this.csrfEnabled=e}addRealtimeListener(e){this.realtimeMessageListeners.add(e)}removeRealtimeListener(e){this.realtimeMessageListeners.delete(e)}addRealtimeStatusListener(e){this.realtimeStatusListeners.add(e)}removeRealtimeStatusListener(e){this.realtimeStatusListeners.delete(e)}addRealtimeEventListener(e,t){const i=String(e).trim();i&&(this.realtimeEventListeners.has(i)||this.realtimeEventListeners.set(i,new Set),this.realtimeEventListeners.get(i).add(t))}removeRealtimeEventListener(e,t){const i=String(e).trim();if(!i)return;const s=this.realtimeEventListeners.get(i);s&&(s.delete(t),s.size===0&&this.realtimeEventListeners.delete(i))}async connectRealtime(){if(!this.realtimeEnabled){this.setRealtimeStatus("disabled","realtime_disabled");return}if(!this.token)throw new Error("Cannot open realtime connection without access token.");if(typeof WebSocket>"u")throw new Error("WebSocket is not available in this environment.");if(this.realtimeSocket&&this.realtimeSocket.readyState===WebSocket.OPEN)return;if(this.realtimeSocket&&this.realtimeSocket.readyState===WebSocket.CONNECTING&&this.realtimeConnectPromise)return this.realtimeConnectPromise;this.clearRealtimeReconnectTimer(),this.realtimeShouldReconnect=this.realtimeAutoReconnect,this.setRealtimeStatus("connecting","connect_requested");const e=new WebSocket(this.buildRealtimeUrl());return this.realtimeSocket=e,this.realtimeConnectPromise=new Promise((t,i)=>{let s=!1;const r=()=>{s||(s=!0,this.realtimeConnectPromise=null,t())},n=a=>{s||(s=!0,this.realtimeConnectPromise=null,i(a))};e.addEventListener("open",()=>{this.setRealtimeStatus("open","socket_open"),r()}),e.addEventListener("message",a=>{this.handleRealtimeMessage(a.data)}),e.addEventListener("error",()=>{this.setRealtimeStatus("closed","socket_error",new Error("Realtime socket error."))}),e.addEventListener("close",a=>{this.realtimeSocket===e&&(this.realtimeSocket=null);const o=a.reason||"socket_closed",h=new Error(`Realtime socket closed (${a.code}${a.reason?`: ${a.reason}`:""}).`);this.setRealtimeStatus("closed",o,h),s||n(h),this.realtimeShouldReconnect&&this.realtimeEnabled&&this.realtimeAutoReconnect&&this.token&&this.scheduleRealtimeReconnect(o)})}),this.realtimeConnectPromise}disconnectRealtime(e="client_disconnect"){if(this.realtimeShouldReconnect=!1,this.clearRealtimeReconnectTimer(),this.realtimeSocket){const t=this.realtimeSocket;this.realtimeSocket=null;try{(t.readyState===WebSocket.OPEN||t.readyState===WebSocket.CONNECTING)&&t.close(1e3,e)}catch{}}this.realtimeConnectPromise=null,this.setRealtimeStatus(this.realtimeEnabled?"idle":"disabled",e)}sendRealtime(e){return!this.realtimeSocket||this.realtimeSocket.readyState!==WebSocket.OPEN?!1:(this.realtimeSocket.send(JSON.stringify(e)),!0)}subscribeRealtime(e){return this.sendRealtime({type:"subscribe",channel:"session",event:"session.subscribe",data:{subscriptions:e}})}unsubscribeRealtime(e){return this.sendRealtime({type:"unsubscribe",channel:"session",event:"session.unsubscribe",data:{subscriptions:e}})}startHealthTick(e=300*1e3,t=!0){this.stopHealthTick();const i=()=>{this.healthTickPromise||(this.healthTickPromise=(this.csrfRefresher?this.csrfRefresher():Promise.resolve()).then(()=>{this.onHealthChange?.(!0)}).catch(()=>{this.onHealthChange?.(!1)}).finally(()=>{this.healthTickPromise=null}))};t&&i(),this.healthTickTimer=setInterval(i,e)}stopHealthTick(){this.healthTickTimer!==null&&(clearInterval(this.healthTickTimer),this.healthTickTimer=null),this.healthTickPromise=null}scheduleKeepSession(e,t,i){this.clearRefreshTimer(),this.sessionRefreshToken=e;const s=Math.max((t-this.refreshBuffer)*1e3,0);this.refreshTimer=setTimeout(async()=>{if(this.sessionRefreshToken)try{const r=await i(this.sessionRefreshToken);this.onTokenRefreshed?.(r.access_token,r.expires_in),this.scheduleKeepSession(this.sessionRefreshToken,r.expires_in,i)}catch(r){this.clearRefreshTimer(),this.onSessionExpired?.(r instanceof Error?r:new Error(String(r)))}},s)}clearRefreshTimer(){this.refreshTimer!==null&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}stopKeepSession(){this.clearRefreshTimer(),this.sessionRefreshToken=null}applyRealtimeOptions(e){const t=typeof e=="boolean"?{enabled:e}:e??{};if(this.realtimeEnabled=t.enabled??!1,this.realtimePath=String(t.path??c).trim()||c,this.realtimeAutoReconnect=t.autoReconnect??!0,this.realtimeReconnectDelayMs=Math.max(250,t.reconnectDelayMs??3e3),!this.realtimeEnabled){this.disconnectRealtime("realtime_disabled");return}this.setRealtimeStatus("idle","realtime_enabled")}buildRealtimeUrl(){const e=this.baseUrl||m("VITE_ENTITY_SERVER_URL")||"",t=typeof window<"u"?window.location.origin:"",i=e||t;if(!i)throw new Error("Realtime connection requires baseUrl.");const s=new URL(i,t||void 0),r=s.pathname==="/"?"":s.pathname.replace(/\/+$/,""),n=`/${this.realtimePath.replace(/^\/+/,"")}`;return s.pathname=`${r}${n}`||n,s.search="",s.hash="",s.protocol=s.protocol==="https:"?"wss:":"ws:",s.searchParams.set("access_token",this.token),s.toString()}handleRealtimeMessage(e){if(typeof e!="string")return;let t;try{t=JSON.parse(e)}catch{return}for(const s of this.realtimeMessageListeners)s(t);const i=this.realtimeEventListeners.get(t.event);if(i)for(const s of i)s(t)}scheduleRealtimeReconnect(e){this.clearRealtimeReconnectTimer(),this.realtimeReconnectTimer=setTimeout(()=>{this.realtimeReconnectTimer=null,!(!this.realtimeEnabled||!this.token)&&(this.setRealtimeStatus("connecting",`${e}:reconnect`),this.connectRealtime().catch(()=>{}))},this.realtimeReconnectDelayMs)}clearRealtimeReconnectTimer(){this.realtimeReconnectTimer!==null&&(clearTimeout(this.realtimeReconnectTimer),this.realtimeReconnectTimer=null)}setRealtimeStatus(e,t,i){const s=this.realtimeStatus;if(!(s===e&&typeof t>"u"&&typeof i>"u")){this.realtimeStatus=e;for(const r of this.realtimeStatusListeners)r({status:e,previousStatus:s,...t?{reason:t}:{},...i?{error:i}:{}})}}applyCsrfHealth(){if(!(typeof document>"u")){for(const e of document.cookie.split(";")){const t=e.indexOf("=");if(!(t<0)&&e.substring(0,t).trim()===this.csrfCookieName){this.csrfEnabled=!!e.substring(t+1).trim();return}}this.csrfEnabled=!1}}readRequestBody(e,t="application/json",i=!1){const s=u(this.hmacSecret,this.token||this.anonymousPacketToken);return f(e,t,i,s)}get reqOpts(){return{baseUrl:this.baseUrl,token:this.token,anonymousPacketToken:this.anonymousPacketToken,apiKey:this.apiKey,hmacSecret:this.hmacSecret,encryptRequests:this.encryptRequests,csrfEnabled:this.csrfEnabled,csrfHeaderName:this.csrfHeaderName,csrfCookieName:this.csrfCookieName,refreshCsrfCookie:this.csrfEnabled?this.csrfRefresher:null,requestAbortControllers:this.requestAbortControllers,onAccessToken:e=>{this.setAccessTokenFromResponse(e)}}}prepareRequest(e){return Promise.resolve()}get http(){const e=this;return{get(t,i=!0,s,r){return e.prepareRequest(i).then(()=>l(e.reqOpts,"GET",t,void 0,i,s,r??!0))},post(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"POST",t,i,s,r,n??!0))},put(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"PUT",t,i,s,r,n??!0))},patch(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"PATCH",t,i,s,r,n??!0))},delete(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"DELETE",t,i,s,r,n??!0))}}}request(e,t,i,s=!0,r,n){return this.prepareRequest(s).then(()=>l(this.reqOpts,e,t,i,s,r,n??!0))}async requestBinary(e,t,i,s=!0){await this.prepareRequest(s);const r={"Content-Type":"application/json"};s&&this.token&&(r.Authorization=`Bearer ${this.token}`),this.apiKey&&(r["X-API-Key"]=this.apiKey);const n=await fetch(this.baseUrl+t,{method:e,headers:r,...i!=null?{body:JSON.stringify(i)}:{},credentials:"include"});if(!n.ok){const a=await n.text(),o=new Error(`HTTP ${n.status}: ${a}`);throw o.status=n.status,o}return n.arrayBuffer()}async requestForm(e,t,i,s=!0){const r={};s&&this.token&&(r.Authorization=`Bearer ${this.token}`),this.apiKey&&(r["X-API-Key"]=this.apiKey);const n=await fetch(this.baseUrl+t,{method:e,headers:r,body:i,credentials:"include"}),a=await n.json();if(!a.ok){const o=new Error(a.message??`EntityServer error (HTTP ${n.status})`);throw o.status=n.status,o}return a}async requestFormBinary(e,t,i,s=!0){const r={};s&&this.token&&(r.Authorization=`Bearer ${this.token}`),this.apiKey&&(r["X-API-Key"]=this.apiKey);const n=await fetch(this.baseUrl+t,{method:e,headers:r,body:i,credentials:"include"});if(!n.ok){const a=await n.text(),o=new Error(`HTTP ${n.status}: ${a}`);throw o.status=n.status,o}return n.arrayBuffer()}}export{y as EntityServerClientBase};
|
|
1
|
+
import{readEnv as m}from"./utils.js";import{derivePacketKey as u,parseRequestBody as f}from"./packet.js";import{entityRequest as l}from"./request.js";const c="/v1/realtime";class T{baseUrl;token;anonymousPacketToken;apiKey;hmacSecret;encryptRequests;debugPlainSecret;csrfEnabled;csrfHeaderName;csrfCookieName;csrfRefresher=null;requestAbortControllers=new Map;activeTxId=null;initialHealthFired=!1;keepSession;refreshBuffer;onTokenRefreshed;onSessionExpired;onHealthChange;sessionRefreshToken=null;refreshTimer=null;healthTickTimer=null;healthTickPromise=null;realtimeEnabled;realtimePath;realtimeAutoReconnect;realtimeReconnectDelayMs;realtimeStatus;realtimeSocket=null;realtimeConnectPromise=null;realtimeReconnectTimer=null;realtimeShouldReconnect=!1;realtimeMessageListeners=new Set;realtimeStatusListeners=new Set;realtimeEventListeners=new Map;constructor(e={}){const t=m("VITE_ENTITY_SERVER_URL");this.baseUrl=(e.baseUrl??t??"").replace(/\/$/,""),this.token=e.token??"",this.anonymousPacketToken=e.anonymousPacketToken??"",this.apiKey=e.apiKey??"",this.hmacSecret=e.hmacSecret??"",this.encryptRequests=e.encryptRequests??!1,this.debugPlainSecret=e.debugPlainSecret??"",this.csrfEnabled=e.csrfEnabled??!1,this.csrfHeaderName=e.csrfHeaderName??"x-csrf-token",this.csrfCookieName=e.csrfCookieName??"_csrf",this.keepSession=e.keepSession??!1,this.refreshBuffer=e.refreshBuffer??60,this.onTokenRefreshed=e.onTokenRefreshed,this.onSessionExpired=e.onSessionExpired,this.onHealthChange=e.onHealthChange,this.realtimeEnabled=!1,this.realtimePath=c,this.realtimeAutoReconnect=!0,this.realtimeReconnectDelayMs=3e3,this.realtimeStatus="idle",this.applyRealtimeOptions(e.realtime),typeof e.healthTickInterval=="number"&&e.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(e.healthTickInterval,!1)),this.fireInitialHealth()}configure(e){typeof e.baseUrl=="string"&&(this.baseUrl=e.baseUrl.replace(/\/$/,"")),typeof e.token=="string"&&(this.token=e.token),typeof e.anonymousPacketToken=="string"&&(this.anonymousPacketToken=e.anonymousPacketToken),typeof e.encryptRequests=="boolean"&&(this.encryptRequests=e.encryptRequests),typeof e.debugPlainSecret=="string"&&(this.debugPlainSecret=e.debugPlainSecret),typeof e.csrfEnabled=="boolean"&&(this.csrfEnabled=e.csrfEnabled),typeof e.csrfHeaderName=="string"&&(this.csrfHeaderName=e.csrfHeaderName),typeof e.csrfCookieName=="string"&&(this.csrfCookieName=e.csrfCookieName),typeof e.apiKey=="string"&&(this.apiKey=e.apiKey),typeof e.hmacSecret=="string"&&(this.hmacSecret=e.hmacSecret),typeof e.keepSession=="boolean"&&(this.keepSession=e.keepSession),typeof e.refreshBuffer=="number"&&(this.refreshBuffer=e.refreshBuffer),e.onTokenRefreshed&&(this.onTokenRefreshed=e.onTokenRefreshed),e.onSessionExpired&&(this.onSessionExpired=e.onSessionExpired),e.onHealthChange&&(this.onHealthChange=e.onHealthChange),typeof e.realtime<"u"&&this.applyRealtimeOptions(e.realtime),typeof e.healthTickInterval=="number"&&e.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(e.healthTickInterval,!1)),this.fireInitialHealth()}fireInitialHealth(){if(this.initialHealthFired||typeof document>"u"||!this.baseUrl)return;this.initialHealthFired=!0;const e=this;typeof e.checkHealth=="function"&&Promise.resolve().then(()=>e.checkHealth(!1).catch(()=>{}))}setToken(e){this.token=e,this.syncRealtimeWithToken()}setAccessTokenFromResponse(e){this.token=e,this.syncRealtimeWithToken()}syncRealtimeWithToken(){if(!this.token){this.disconnectRealtime("token_cleared");return}!this.realtimeEnabled||typeof WebSocket>"u"||this.connectRealtime().catch(()=>{})}setAnonymousPacketToken(e){this.anonymousPacketToken=e}setApiKey(e){this.apiKey=e}setHmacSecret(e){this.hmacSecret=e}setEncryptRequests(e){this.encryptRequests=e}setCsrfEnabled(e){this.csrfEnabled=e}addRealtimeListener(e){this.realtimeMessageListeners.add(e)}removeRealtimeListener(e){this.realtimeMessageListeners.delete(e)}addRealtimeStatusListener(e){this.realtimeStatusListeners.add(e)}removeRealtimeStatusListener(e){this.realtimeStatusListeners.delete(e)}addRealtimeEventListener(e,t){const i=String(e).trim();i&&(this.realtimeEventListeners.has(i)||this.realtimeEventListeners.set(i,new Set),this.realtimeEventListeners.get(i).add(t))}removeRealtimeEventListener(e,t){const i=String(e).trim();if(!i)return;const s=this.realtimeEventListeners.get(i);s&&(s.delete(t),s.size===0&&this.realtimeEventListeners.delete(i))}async connectRealtime(){if(!this.realtimeEnabled){this.setRealtimeStatus("disabled","realtime_disabled");return}if(!this.token)throw new Error("Cannot open realtime connection without access token.");if(typeof WebSocket>"u")throw new Error("WebSocket is not available in this environment.");if(this.realtimeSocket&&this.realtimeSocket.readyState===WebSocket.OPEN)return;if(this.realtimeSocket&&this.realtimeSocket.readyState===WebSocket.CONNECTING&&this.realtimeConnectPromise)return this.realtimeConnectPromise;this.clearRealtimeReconnectTimer(),this.realtimeShouldReconnect=this.realtimeAutoReconnect,this.setRealtimeStatus("connecting","connect_requested");const e=new WebSocket(this.buildRealtimeUrl());return this.realtimeSocket=e,this.realtimeConnectPromise=new Promise((t,i)=>{let s=!1;const r=()=>{s||(s=!0,this.realtimeConnectPromise=null,t())},n=a=>{s||(s=!0,this.realtimeConnectPromise=null,i(a))};e.addEventListener("open",()=>{this.setRealtimeStatus("open","socket_open"),r()}),e.addEventListener("message",a=>{this.handleRealtimeMessage(a.data)}),e.addEventListener("error",()=>{this.setRealtimeStatus("closed","socket_error",new Error("Realtime socket error."))}),e.addEventListener("close",a=>{this.realtimeSocket===e&&(this.realtimeSocket=null);const o=a.reason||"socket_closed",h=new Error(`Realtime socket closed (${a.code}${a.reason?`: ${a.reason}`:""}).`);this.setRealtimeStatus("closed",o,h),s||n(h),this.realtimeShouldReconnect&&this.realtimeEnabled&&this.realtimeAutoReconnect&&this.token&&this.scheduleRealtimeReconnect(o)})}),this.realtimeConnectPromise}disconnectRealtime(e="client_disconnect"){if(this.realtimeShouldReconnect=!1,this.clearRealtimeReconnectTimer(),this.realtimeSocket){const t=this.realtimeSocket;this.realtimeSocket=null;try{(t.readyState===WebSocket.OPEN||t.readyState===WebSocket.CONNECTING)&&t.close(1e3,e)}catch{}}this.realtimeConnectPromise=null,this.setRealtimeStatus(this.realtimeEnabled?"idle":"disabled",e)}sendRealtime(e){return!this.realtimeSocket||this.realtimeSocket.readyState!==WebSocket.OPEN?!1:(this.realtimeSocket.send(JSON.stringify(e)),!0)}subscribeRealtime(e){return this.sendRealtime({type:"subscribe",channel:"session",event:"session.subscribe",data:{subscriptions:e}})}unsubscribeRealtime(e){return this.sendRealtime({type:"unsubscribe",channel:"session",event:"session.unsubscribe",data:{subscriptions:e}})}startHealthTick(e=300*1e3,t=!0){this.stopHealthTick();const i=()=>{this.healthTickPromise||(this.healthTickPromise=(this.csrfRefresher?this.csrfRefresher():Promise.resolve()).then(()=>{this.onHealthChange?.(!0)}).catch(()=>{this.onHealthChange?.(!1)}).finally(()=>{this.healthTickPromise=null}))};t&&i(),this.healthTickTimer=setInterval(i,e)}stopHealthTick(){this.healthTickTimer!==null&&(clearInterval(this.healthTickTimer),this.healthTickTimer=null),this.healthTickPromise=null}scheduleKeepSession(e,t,i){this.clearRefreshTimer(),this.sessionRefreshToken=e;const s=Math.max((t-this.refreshBuffer)*1e3,0);this.refreshTimer=setTimeout(async()=>{if(this.sessionRefreshToken)try{const r=await i(this.sessionRefreshToken);this.onTokenRefreshed?.(r.access_token,r.expires_in),this.scheduleKeepSession(this.sessionRefreshToken,r.expires_in,i)}catch(r){this.clearRefreshTimer(),this.onSessionExpired?.(r instanceof Error?r:new Error(String(r)))}},s)}clearRefreshTimer(){this.refreshTimer!==null&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}stopKeepSession(){this.clearRefreshTimer(),this.sessionRefreshToken=null}applyRealtimeOptions(e){const t=typeof e=="boolean"?{enabled:e}:e??{};if(this.realtimeEnabled=t.enabled??!1,this.realtimePath=String(t.path??c).trim()||c,this.realtimeAutoReconnect=t.autoReconnect??!0,this.realtimeReconnectDelayMs=Math.max(250,t.reconnectDelayMs??3e3),!this.realtimeEnabled){this.disconnectRealtime("realtime_disabled");return}this.setRealtimeStatus("idle","realtime_enabled")}buildRealtimeUrl(){const e=this.baseUrl||m("VITE_ENTITY_SERVER_URL")||"",t=typeof window<"u"?window.location.origin:"",i=e||t;if(!i)throw new Error("Realtime connection requires baseUrl.");const s=new URL(i,t||void 0),r=s.pathname==="/"?"":s.pathname.replace(/\/+$/,""),n=`/${this.realtimePath.replace(/^\/+/,"")}`;return s.pathname=`${r}${n}`||n,s.search="",s.hash="",s.protocol=s.protocol==="https:"?"wss:":"ws:",s.searchParams.set("access_token",this.token),s.toString()}handleRealtimeMessage(e){if(typeof e!="string")return;let t;try{t=JSON.parse(e)}catch{return}for(const s of this.realtimeMessageListeners)s(t);const i=this.realtimeEventListeners.get(t.event);if(i)for(const s of i)s(t)}scheduleRealtimeReconnect(e){this.clearRealtimeReconnectTimer(),this.realtimeReconnectTimer=setTimeout(()=>{this.realtimeReconnectTimer=null,!(!this.realtimeEnabled||!this.token)&&(this.setRealtimeStatus("connecting",`${e}:reconnect`),this.connectRealtime().catch(()=>{}))},this.realtimeReconnectDelayMs)}clearRealtimeReconnectTimer(){this.realtimeReconnectTimer!==null&&(clearTimeout(this.realtimeReconnectTimer),this.realtimeReconnectTimer=null)}setRealtimeStatus(e,t,i){const s=this.realtimeStatus;if(!(s===e&&typeof t>"u"&&typeof i>"u")){this.realtimeStatus=e;for(const r of this.realtimeStatusListeners)r({status:e,previousStatus:s,...t?{reason:t}:{},...i?{error:i}:{}})}}applyCsrfHealth(){if(!(typeof document>"u")){for(const e of document.cookie.split(";")){const t=e.indexOf("=");if(!(t<0)&&e.substring(0,t).trim()===this.csrfCookieName){this.csrfEnabled=!!e.substring(t+1).trim();return}}this.csrfEnabled=!1}}readRequestBody(e,t="application/json",i=!1){const s=u(this.hmacSecret,this.token||this.anonymousPacketToken);return f(e,t,i,s)}get reqOpts(){return{baseUrl:this.baseUrl,token:this.token,anonymousPacketToken:this.anonymousPacketToken,apiKey:this.apiKey,hmacSecret:this.hmacSecret,encryptRequests:this.encryptRequests,csrfEnabled:this.csrfEnabled,csrfHeaderName:this.csrfHeaderName,csrfCookieName:this.csrfCookieName,refreshCsrfCookie:this.csrfEnabled?this.csrfRefresher:null,requestAbortControllers:this.requestAbortControllers,debugPlainSecret:this.debugPlainSecret,onAccessToken:e=>{this.setAccessTokenFromResponse(e)}}}prepareRequest(e){return Promise.resolve()}get http(){const e=this;return{get(t,i=!0,s,r){return e.prepareRequest(i).then(()=>l(e.reqOpts,"GET",t,void 0,i,s,r??!0))},post(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"POST",t,i,s,r,n??!0))},put(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"PUT",t,i,s,r,n??!0))},patch(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"PATCH",t,i,s,r,n??!0))},delete(t,i,s=!0,r,n){return e.prepareRequest(s).then(()=>l(e.reqOpts,"DELETE",t,i,s,r,n??!0))}}}request(e,t,i,s=!0,r,n){return this.prepareRequest(s).then(()=>l(this.reqOpts,e,t,i,s,r,n??!0))}async requestBinary(e,t,i,s=!0){await this.prepareRequest(s);const r={"Content-Type":"application/json"};s&&this.token&&(r.Authorization=`Bearer ${this.token}`),this.apiKey&&(r["X-API-Key"]=this.apiKey);const n=await fetch(this.baseUrl+t,{method:e,headers:r,...i!=null?{body:JSON.stringify(i)}:{},credentials:"include"});if(!n.ok){const a=await n.text(),o=new Error(`HTTP ${n.status}: ${a}`);throw o.status=n.status,o}return n.arrayBuffer()}async requestForm(e,t,i,s=!0){const r={};s&&this.token&&(r.Authorization=`Bearer ${this.token}`),this.apiKey&&(r["X-API-Key"]=this.apiKey);const n=await fetch(this.baseUrl+t,{method:e,headers:r,body:i,credentials:"include"}),a=await n.json();if(!a.ok){const o=new Error(a.message??`EntityServer error (HTTP ${n.status})`);throw o.status=n.status,o}return a}async requestFormBinary(e,t,i,s=!0){const r={};s&&this.token&&(r.Authorization=`Bearer ${this.token}`),this.apiKey&&(r["X-API-Key"]=this.apiKey);const n=await fetch(this.baseUrl+t,{method:e,headers:r,body:i,credentials:"include"});if(!n.ok){const a=await n.text(),o=new Error(`HTTP ${n.status}: ${a}`);throw o.status=n.status,o}return n.arrayBuffer()}}export{T as EntityServerClientBase};
|
|
2
2
|
//# sourceMappingURL=base.js.map
|