@serve.zone/platformclient 3.0.0 → 4.0.0
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/.smartconfig.json +4 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.platformclient.d.ts +16 -5
- package/dist_ts/classes.platformclient.js +118 -44
- package/dist_ts/email/classes.emailconnector.d.ts +10 -9
- package/dist_ts/email/classes.emailconnector.js +45 -111
- package/dist_ts/email/classes.letterconnector.js +2 -2
- package/dist_ts/email/classes.pushnotificationconnector.js +2 -2
- package/dist_ts/email/classes.smsconnector.js +3 -3
- package/dist_ts/webpush/classes.webpushconnector.js +6 -9
- package/package.json +10 -10
- package/readme.md +37 -8
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.platformclient.ts +118 -49
- package/ts/email/classes.emailconnector.ts +53 -127
- package/ts/email/classes.letterconnector.ts +1 -1
- package/ts/email/classes.pushnotificationconnector.ts +1 -1
- package/ts/email/classes.smsconnector.ts +2 -2
- package/ts/webpush/classes.webpushconnector.ts +5 -7
- /package/{license → license.md} +0 -0
|
@@ -21,7 +21,7 @@ export class SzLetterConnector {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const typedRequest =
|
|
24
|
-
this.platformClientRef.
|
|
24
|
+
this.platformClientRef.requireTypedSocket().createTypedRequest<plugins.servezoneInterfaces.platform.letter.IReq_SendLetter>(
|
|
25
25
|
'sendLetter'
|
|
26
26
|
);
|
|
27
27
|
const response = await typedRequest.fire(optionsArg);
|
|
@@ -20,7 +20,7 @@ export class SzPushNotificationConnector {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const typedRequest =
|
|
23
|
-
this.platformClientRef.
|
|
23
|
+
this.platformClientRef.requireTypedSocket().createTypedRequest<plugins.servezoneInterfaces.platform.pushnotification.IReq_SendPushNotification>(
|
|
24
24
|
'sendPushNotification'
|
|
25
25
|
);
|
|
26
26
|
const response = await typedRequest.fire(optionsArg);
|
|
@@ -22,7 +22,7 @@ export class SzSmsConnector {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const typedrequest = this.platformClientRef.
|
|
25
|
+
const typedrequest = this.platformClientRef.requireTypedSocket().createTypedRequest<plugins.servezoneInterfaces.platform.sms.IReq_SendSms>(
|
|
26
26
|
'sendSms'
|
|
27
27
|
);
|
|
28
28
|
const response = await typedrequest.fire(messageArg);
|
|
@@ -40,7 +40,7 @@ export class SzSmsConnector {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
const typedrequest =
|
|
43
|
-
this.platformClientRef.
|
|
43
|
+
this.platformClientRef.requireTypedSocket().createTypedRequest<plugins.servezoneInterfaces.platform.sms.IReq_SendVerificationCode>(
|
|
44
44
|
'sendVerificationCode'
|
|
45
45
|
);
|
|
46
46
|
const response = await typedrequest.fire(recipientArg);
|
|
@@ -182,12 +182,8 @@ export class SzWebPushConnector {
|
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
if (socketPromise) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
await pendingSocket.stop();
|
|
188
|
-
} catch {
|
|
189
|
-
// A failed or aborted connection leaves no socket to close.
|
|
190
|
-
}
|
|
185
|
+
const pendingSocket = await socketPromise.catch(() => undefined);
|
|
186
|
+
await pendingSocket?.stop();
|
|
191
187
|
}
|
|
192
188
|
}
|
|
193
189
|
|
|
@@ -268,6 +264,7 @@ export class SzWebPushConnector {
|
|
|
268
264
|
}
|
|
269
265
|
|
|
270
266
|
private async getWebPushTypedSocket(urlArg: string): Promise<plugins.typedsocket.TypedSocket> {
|
|
267
|
+
this.platformClientRef.assertRunning();
|
|
271
268
|
const normalizedUrl = this.normalizeTypedSocketUrl(urlArg);
|
|
272
269
|
if (this.webPushTypedSocket && this.webPushTypedSocketUrl === normalizedUrl) {
|
|
273
270
|
return this.webPushTypedSocket;
|
|
@@ -278,11 +275,12 @@ export class SzWebPushConnector {
|
|
|
278
275
|
if (this.webPushTypedSocket || this.webPushTypedSocketPromise) {
|
|
279
276
|
await this.stop();
|
|
280
277
|
}
|
|
278
|
+
this.platformClientRef.assertRunning();
|
|
281
279
|
this.webPushTypedSocketUrl = normalizedUrl;
|
|
282
280
|
const abortController = new AbortController();
|
|
283
281
|
this.webPushTypedSocketAbortController = abortController;
|
|
284
282
|
const socketPromise = plugins.typedsocket.TypedSocket.createClient(
|
|
285
|
-
|
|
283
|
+
new plugins.typedrequest.TypedRouter(),
|
|
286
284
|
normalizedUrl,
|
|
287
285
|
{ autoReconnect: true, abortSignal: abortController.signal },
|
|
288
286
|
);
|
/package/{license → license.md}
RENAMED
|
File without changes
|