@reddoorla/maintenance 0.36.0 → 0.36.1

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/cli/bin.js CHANGED
@@ -112,8 +112,10 @@ var init_client = __esm({
112
112
  // src/reports/airtable/websites.ts
113
113
  var websites_exports = {};
114
114
  __export(websites_exports, {
115
+ ACTIVE_STATUSES: () => ACTIVE_STATUSES,
115
116
  WEBSITES_TABLE: () => WEBSITES_TABLE,
116
117
  getWebsiteBySlug: () => getWebsiteBySlug,
118
+ isDashboardVisible: () => isDashboardVisible,
117
119
  listWebsites: () => listWebsites,
118
120
  mapRow: () => mapRow,
119
121
  siteSlug: () => siteSlug,
@@ -133,6 +135,9 @@ function trimToNull(raw) {
133
135
  const trimmed = raw.trim();
134
136
  return trimmed.length > 0 ? trimmed : null;
135
137
  }
138
+ function isDashboardVisible(site) {
139
+ return site.status !== null && ACTIVE_STATUSES.has(site.status);
140
+ }
136
141
  function mapRow(rec) {
137
142
  const f = rec.fields;
138
143
  const attachments = f["Header image"] ?? [];
@@ -167,12 +172,6 @@ function mapRow(rec) {
167
172
  securityVulnsHigh: f["Security Vulns High"] ?? null,
168
173
  securityVulnsModerate: f["Security Vulns Moderate"] ?? null,
169
174
  securityVulnsLow: f["Security Vulns Low"] ?? null,
170
- dashboardToken: (() => {
171
- const raw = f["Dashboard Token"];
172
- if (typeof raw !== "string") return null;
173
- const trimmed = raw.trim();
174
- return trimmed.length > 0 ? trimmed : null;
175
- })(),
176
175
  copyIntro: trimToNull(f["Copy \u2014 Intro"]),
177
176
  copyContact: trimToNull(f["Copy \u2014 Contact"]),
178
177
  copyFooter: trimToNull(f["Copy \u2014 Footer"]),
@@ -269,11 +268,15 @@ async function updateLaunched(base, recordId, at) {
269
268
  const fields = { Status: "maintenance", "Launched at": at };
270
269
  await base(WEBSITES_TABLE).update([{ id: recordId, fields }]);
271
270
  }
272
- var WEBSITES_TABLE;
271
+ var WEBSITES_TABLE, ACTIVE_STATUSES;
273
272
  var init_websites = __esm({
274
273
  "src/reports/airtable/websites.ts"() {
275
274
  "use strict";
276
275
  WEBSITES_TABLE = "Websites";
276
+ ACTIVE_STATUSES = /* @__PURE__ */ new Set([
277
+ "maintenance",
278
+ "launch period"
279
+ ]);
277
280
  }
278
281
  });
279
282
 
@@ -291,7 +294,7 @@ function fromAirtableBase(base, opts = {}) {
291
294
  );
292
295
  }
293
296
  const websites = await listWebsites(base);
294
- return websites.filter((w) => AUDITABLE_STATUSES.has(w.status ?? "") && w.url.length > 0).flatMap((w) => {
297
+ return websites.filter((w) => w.status !== null && ACTIVE_STATUSES.has(w.status) && w.url.length > 0).flatMap((w) => {
295
298
  const slug = siteSlug(w.name);
296
299
  if (slug.length === 0) {
297
300
  console.warn(
@@ -316,13 +319,11 @@ function fromAirtableBase(base, opts = {}) {
316
319
  });
317
320
  };
318
321
  }
319
- var AUDITABLE_STATUSES;
320
322
  var init_airtable = __esm({
321
323
  "src/inventory/airtable.ts"() {
322
324
  "use strict";
323
325
  init_websites();
324
326
  init_url();
325
- AUDITABLE_STATUSES = /* @__PURE__ */ new Set(["maintenance", "launch period"]);
326
327
  }
327
328
  });
328
329