@reddoorla/maintenance 0.36.0 → 0.37.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.
@@ -73,8 +73,10 @@ var init_client = __esm({
73
73
  // src/reports/airtable/websites.ts
74
74
  var websites_exports = {};
75
75
  __export(websites_exports, {
76
+ ACTIVE_STATUSES: () => ACTIVE_STATUSES,
76
77
  WEBSITES_TABLE: () => WEBSITES_TABLE,
77
78
  getWebsiteBySlug: () => getWebsiteBySlug,
79
+ isDashboardVisible: () => isDashboardVisible,
78
80
  listWebsites: () => listWebsites,
79
81
  mapRow: () => mapRow,
80
82
  siteSlug: () => siteSlug,
@@ -94,6 +96,9 @@ function trimToNull(raw) {
94
96
  const trimmed = raw.trim();
95
97
  return trimmed.length > 0 ? trimmed : null;
96
98
  }
99
+ function isDashboardVisible(site) {
100
+ return site.status !== null && ACTIVE_STATUSES.has(site.status);
101
+ }
97
102
  function mapRow(rec) {
98
103
  const f = rec.fields;
99
104
  const attachments = f["Header image"] ?? [];
@@ -128,12 +133,6 @@ function mapRow(rec) {
128
133
  securityVulnsHigh: f["Security Vulns High"] ?? null,
129
134
  securityVulnsModerate: f["Security Vulns Moderate"] ?? null,
130
135
  securityVulnsLow: f["Security Vulns Low"] ?? null,
131
- dashboardToken: (() => {
132
- const raw = f["Dashboard Token"];
133
- if (typeof raw !== "string") return null;
134
- const trimmed = raw.trim();
135
- return trimmed.length > 0 ? trimmed : null;
136
- })(),
137
136
  copyIntro: trimToNull(f["Copy \u2014 Intro"]),
138
137
  copyContact: trimToNull(f["Copy \u2014 Contact"]),
139
138
  copyFooter: trimToNull(f["Copy \u2014 Footer"]),
@@ -230,11 +229,15 @@ async function updateLaunched(base, recordId, at) {
230
229
  const fields = { Status: "maintenance", "Launched at": at };
231
230
  await base(WEBSITES_TABLE).update([{ id: recordId, fields }]);
232
231
  }
233
- var WEBSITES_TABLE;
232
+ var WEBSITES_TABLE, ACTIVE_STATUSES;
234
233
  var init_websites = __esm({
235
234
  "src/reports/airtable/websites.ts"() {
236
235
  "use strict";
237
236
  WEBSITES_TABLE = "Websites";
237
+ ACTIVE_STATUSES = /* @__PURE__ */ new Set([
238
+ "maintenance",
239
+ "launch period"
240
+ ]);
238
241
  }
239
242
  });
240
243
 
@@ -252,7 +255,7 @@ function fromAirtableBase(base, opts = {}) {
252
255
  );
253
256
  }
254
257
  const websites = await listWebsites(base);
255
- return websites.filter((w) => AUDITABLE_STATUSES.has(w.status ?? "") && w.url.length > 0).flatMap((w) => {
258
+ return websites.filter((w) => w.status !== null && ACTIVE_STATUSES.has(w.status) && w.url.length > 0).flatMap((w) => {
256
259
  const slug = siteSlug(w.name);
257
260
  if (slug.length === 0) {
258
261
  console.warn(
@@ -277,13 +280,11 @@ function fromAirtableBase(base, opts = {}) {
277
280
  });
278
281
  };
279
282
  }
280
- var AUDITABLE_STATUSES;
281
283
  var init_airtable = __esm({
282
284
  "src/inventory/airtable.ts"() {
283
285
  "use strict";
284
286
  init_websites();
285
287
  init_url();
286
- AUDITABLE_STATUSES = /* @__PURE__ */ new Set(["maintenance", "launch period"]);
287
288
  }
288
289
  });
289
290