@serve.zone/platformclient 2.3.0 → 3.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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.platformclient.d.ts +11 -1
- package/dist_ts/classes.platformclient.js +64 -32
- package/dist_ts/coremail/classes.coremailconnector.d.ts +72 -0
- package/dist_ts/coremail/classes.coremailconnector.js +663 -0
- package/dist_ts/email/classes.emailconnector.d.ts +0 -1
- package/dist_ts/email/classes.emailconnector.js +2 -16
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +2 -1
- package/dist_ts/plugins.d.ts +2 -2
- package/dist_ts/plugins.js +3 -3
- package/dist_ts/webpush/classes.webpushconnector.js +2 -23
- package/package.json +8 -8
- package/readme.md +64 -12
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.platformclient.ts +77 -34
- package/ts/coremail/classes.coremailconnector.ts +931 -0
- package/ts/email/classes.emailconnector.ts +1 -13
- package/ts/index.ts +1 -0
- package/ts/plugins.ts +2 -2
- package/ts/webpush/classes.webpushconnector.ts +1 -28
|
@@ -384,19 +384,7 @@ export class SzEmailConnector {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
private async readMailEnvVar(envNameArg: string): Promise<string | undefined> {
|
|
387
|
-
return await this.platformClientRef.getConfiguredEnvVar(envNameArg)
|
|
388
|
-
|| this.getCredentialEnvVarFromBindings(envNameArg);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
private getCredentialEnvVarFromBindings(envNameArg: string): string | undefined {
|
|
392
|
-
for (const binding of this.platformClientRef.platformBindings || []) {
|
|
393
|
-
if (binding.desiredState === 'disabled' || binding.status === 'failed') continue;
|
|
394
|
-
if (binding.capability !== 'email') continue;
|
|
395
|
-
for (const credential of binding.credentials || []) {
|
|
396
|
-
const value = credential.env?.[envNameArg];
|
|
397
|
-
if (value) return value;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
387
|
+
return await this.platformClientRef.getConfiguredEnvVar(envNameArg);
|
|
400
388
|
}
|
|
401
389
|
|
|
402
390
|
private hasAnyMailEnvValue(envArg?: {
|
package/ts/index.ts
CHANGED
package/ts/plugins.ts
CHANGED
|
@@ -17,11 +17,11 @@ export {
|
|
|
17
17
|
|
|
18
18
|
// @api.global scope
|
|
19
19
|
import * as typedrequest from '@api.global/typedrequest';
|
|
20
|
-
import * as
|
|
20
|
+
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
|
21
21
|
import * as typedsocket from '@api.global/typedsocket';
|
|
22
22
|
|
|
23
23
|
export {
|
|
24
24
|
typedrequest,
|
|
25
|
-
|
|
25
|
+
typedrequestInterfaces,
|
|
26
26
|
typedsocket,
|
|
27
27
|
}
|
|
@@ -238,34 +238,7 @@ export class SzWebPushConnector {
|
|
|
238
238
|
if (this.hasCredentialBundleValue(directEnv)) {
|
|
239
239
|
return directEnv;
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
const bindingCredentialBundles: Array<Partial<IServiceWebPushCredentials>> = [];
|
|
243
|
-
for (const binding of this.platformClientRef.platformBindings || []) {
|
|
244
|
-
if (
|
|
245
|
-
binding.capability !== 'pushnotification'
|
|
246
|
-
|| binding.desiredState !== 'enabled'
|
|
247
|
-
|| binding.status !== 'ready'
|
|
248
|
-
) {
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
for (const credential of binding.credentials || []) {
|
|
252
|
-
const credentialBundle = this.normalizeCredentialBundle({
|
|
253
|
-
typedUrl: credential.env?.WEB_PUSH_TYPED_URL,
|
|
254
|
-
credentialId: credential.env?.WEB_PUSH_API_CREDENTIAL_ID,
|
|
255
|
-
credentialSecret: credential.env?.WEB_PUSH_API_CREDENTIAL_SECRET,
|
|
256
|
-
});
|
|
257
|
-
if (this.hasCredentialBundleValue(credentialBundle)) {
|
|
258
|
-
bindingCredentialBundles.push(credentialBundle);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
if (bindingCredentialBundles.length > 1) {
|
|
264
|
-
throw new Error(
|
|
265
|
-
'Multiple ready Web Push credential bundles are configured; exactly one is required',
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
return bindingCredentialBundles[0] || {};
|
|
241
|
+
return {};
|
|
269
242
|
}
|
|
270
243
|
|
|
271
244
|
private normalizeCredentialBundle(bundleArg: {
|