@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.
@@ -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
@@ -1,3 +1,4 @@
1
1
  export * from './classes.platformclient.js';
2
+ export * from './coremail/classes.coremailconnector.js';
2
3
  export * from './email/classes.emailconnector.js';
3
4
  export * from './webpush/classes.webpushconnector.js';
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 typedserver from '@api.global/typedserver';
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
- typedserver,
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: {