@camstack/addon-notifiers 1.2.132 → 1.2.134

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/addon.js CHANGED
@@ -53385,7 +53385,7 @@ function buildEmailDescriptor(providers = []) {
53385
53385
  type: "select",
53386
53386
  key: "smtpAddonId",
53387
53387
  label: "Email provider",
53388
- description: options.length === 0 ? "No ready provider yet. Open Connectivity → Email, install Google Services or SMTP, then Verify." : "Which Connectivity → Email entry delivers this target.",
53388
+ description: options.length === 0 ? "No Email provider installed. Open Connectivity → Email, install Google Services or SMTP, then Verify." : "Which Connectivity → Email entry delivers this target. Verify it under Connectivity → Email if the label says not verified.",
53389
53389
  required: true,
53390
53390
  options
53391
53391
  },
@@ -53451,7 +53451,7 @@ function createEmailAdapter(smtp) {
53451
53451
  return {
53452
53452
  descriptor: buildEmailDescriptor(),
53453
53453
  hydrateDescriptor: async () => {
53454
- return buildEmailDescriptor(await smtp.listReadyProviders?.() ?? []);
53454
+ return buildEmailDescriptor(await smtp.listProviders?.() ?? []);
53455
53455
  },
53456
53456
  destinationKeys: ["to", "smtpAddonId"],
53457
53457
  async sendDirect(config, prepared) {
@@ -56842,7 +56842,7 @@ var NotifiersAddon = class extends BaseAddon {
56842
56842
  if (!api) this.ctx.logger.warn("notifiers: no ctx.api — targets persist in-memory only");
56843
56843
  const store = new TargetStore(port);
56844
56844
  await store.init();
56845
- const listReadyProviders = async () => {
56845
+ const listProviders = async () => {
56846
56846
  if (api === void 0) return [];
56847
56847
  const [providers, addons] = await Promise.all([api.addons.listCapabilityProviders.query({ capName: "smtp-provider" }), api.addons.list.query()]);
56848
56848
  const names = /* @__PURE__ */ new Map();
@@ -56853,16 +56853,25 @@ var NotifiersAddon = class extends BaseAddon {
56853
56853
  const out = [];
56854
56854
  for (const p of providers) {
56855
56855
  if (!p.isActive) continue;
56856
+ const name = names.get(p.addonId) ?? p.addonId;
56856
56857
  try {
56857
56858
  const status = await api.smtpProvider.getStatus.query({ addonId: p.addonId });
56858
- if (!status.ready) continue;
56859
- const name = names.get(p.addonId) ?? p.addonId;
56859
+ const hostBit = status.host !== "" ? status.host : p.addonId;
56860
+ const label = status.ready ? `${name} — ${hostBit}` : `${name} — ${hostBit} (not verified)`;
56860
56861
  out.push({
56861
56862
  value: p.addonId,
56862
- label: status.host !== "" ? `${name} — ${status.host}` : name,
56863
- description: p.addonId
56863
+ label,
56864
+ description: p.addonId,
56865
+ ready: status.ready
56864
56866
  });
56865
- } catch {}
56867
+ } catch {
56868
+ out.push({
56869
+ value: p.addonId,
56870
+ label: `${name} (status unavailable)`,
56871
+ description: p.addonId,
56872
+ ready: false
56873
+ });
56874
+ }
56866
56875
  }
56867
56876
  return out;
56868
56877
  };
@@ -56877,9 +56886,10 @@ var NotifiersAddon = class extends BaseAddon {
56877
56886
  ...input.addonId !== void 0 ? { addonId: input.addonId } : {}
56878
56887
  })).messageId };
56879
56888
  },
56880
- listReadyProviders,
56889
+ listProviders,
56881
56890
  resolveDefaultAddonId: async () => {
56882
- return (await listReadyProviders())[0]?.value;
56891
+ const providers = await listProviders();
56892
+ return providers.find((p) => p.ready === true)?.value ?? providers[0]?.value;
56883
56893
  }
56884
56894
  } : void 0);
56885
56895
  const provider = createNotificationOutputProvider({
package/dist/addon.mjs CHANGED
@@ -53358,7 +53358,7 @@ function buildEmailDescriptor(providers = []) {
53358
53358
  type: "select",
53359
53359
  key: "smtpAddonId",
53360
53360
  label: "Email provider",
53361
- description: options.length === 0 ? "No ready provider yet. Open Connectivity → Email, install Google Services or SMTP, then Verify." : "Which Connectivity → Email entry delivers this target.",
53361
+ description: options.length === 0 ? "No Email provider installed. Open Connectivity → Email, install Google Services or SMTP, then Verify." : "Which Connectivity → Email entry delivers this target. Verify it under Connectivity → Email if the label says not verified.",
53362
53362
  required: true,
53363
53363
  options
53364
53364
  },
@@ -53424,7 +53424,7 @@ function createEmailAdapter(smtp) {
53424
53424
  return {
53425
53425
  descriptor: buildEmailDescriptor(),
53426
53426
  hydrateDescriptor: async () => {
53427
- return buildEmailDescriptor(await smtp.listReadyProviders?.() ?? []);
53427
+ return buildEmailDescriptor(await smtp.listProviders?.() ?? []);
53428
53428
  },
53429
53429
  destinationKeys: ["to", "smtpAddonId"],
53430
53430
  async sendDirect(config, prepared) {
@@ -56815,7 +56815,7 @@ var NotifiersAddon = class extends BaseAddon {
56815
56815
  if (!api) this.ctx.logger.warn("notifiers: no ctx.api — targets persist in-memory only");
56816
56816
  const store = new TargetStore(port);
56817
56817
  await store.init();
56818
- const listReadyProviders = async () => {
56818
+ const listProviders = async () => {
56819
56819
  if (api === void 0) return [];
56820
56820
  const [providers, addons] = await Promise.all([api.addons.listCapabilityProviders.query({ capName: "smtp-provider" }), api.addons.list.query()]);
56821
56821
  const names = /* @__PURE__ */ new Map();
@@ -56826,16 +56826,25 @@ var NotifiersAddon = class extends BaseAddon {
56826
56826
  const out = [];
56827
56827
  for (const p of providers) {
56828
56828
  if (!p.isActive) continue;
56829
+ const name = names.get(p.addonId) ?? p.addonId;
56829
56830
  try {
56830
56831
  const status = await api.smtpProvider.getStatus.query({ addonId: p.addonId });
56831
- if (!status.ready) continue;
56832
- const name = names.get(p.addonId) ?? p.addonId;
56832
+ const hostBit = status.host !== "" ? status.host : p.addonId;
56833
+ const label = status.ready ? `${name} — ${hostBit}` : `${name} — ${hostBit} (not verified)`;
56833
56834
  out.push({
56834
56835
  value: p.addonId,
56835
- label: status.host !== "" ? `${name} — ${status.host}` : name,
56836
- description: p.addonId
56836
+ label,
56837
+ description: p.addonId,
56838
+ ready: status.ready
56837
56839
  });
56838
- } catch {}
56840
+ } catch {
56841
+ out.push({
56842
+ value: p.addonId,
56843
+ label: `${name} (status unavailable)`,
56844
+ description: p.addonId,
56845
+ ready: false
56846
+ });
56847
+ }
56839
56848
  }
56840
56849
  return out;
56841
56850
  };
@@ -56850,9 +56859,10 @@ var NotifiersAddon = class extends BaseAddon {
56850
56859
  ...input.addonId !== void 0 ? { addonId: input.addonId } : {}
56851
56860
  })).messageId };
56852
56861
  },
56853
- listReadyProviders,
56862
+ listProviders,
56854
56863
  resolveDefaultAddonId: async () => {
56855
- return (await listReadyProviders())[0]?.value;
56864
+ const providers = await listProviders();
56865
+ return providers.find((p) => p.ready === true)?.value ?? providers[0]?.value;
56856
56866
  }
56857
56867
  } : void 0);
56858
56868
  const provider = createNotificationOutputProvider({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-notifiers",
3
- "version": "1.2.132",
3
+ "version": "1.2.134",
4
4
  "description": "System notifiers addon for CamStack — a `notification-output` collection provider hosting per-kind notifier adapters (ntfy, pushover, gotify, telegram, discord, webhook, zentik).",
5
5
  "keywords": [
6
6
  "camstack",