@burdenoff/microfe-timecampus 2026.1206.2 → 2026.1206.3
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/generated/global-types.d.ts +7409 -959
- package/dist/generated/wspace-operations.d.ts +46 -12
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +107058 -11342
- package/dist/generated/wspace-types.js +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.js +2 -1
- package/dist/timecampus/pages/channels/channelCatalog.js.map +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelCatalog.js","names":["ChannelType","SyncStatus","PrivacyMode","ChannelStatus","PullProviderGroup","CHANNEL_SETUP_HINT","AUTOMATIC_CHANNEL_HINT","CLI_CHANNEL_HINT","channelSetupHint","type","TimeCampusCaptureChannelType","provider","CHANNEL_CATALOG","INTEGRATION_ENTRY","catalogEntry","entry","oauthCallbackUrl","apiGatewayUrl","pullHealth","channel","TimeCampusCaptureChannelSyncStatus","PRIVACY_OPTIONS","TimeCampusCaptureChannelPrivacyMode","privacyLabel","o","mode","statusDisplay","status","TimeCampusCaptureChannelStatus","formatSyncInterval","minutes","formatRetention","days","isOverdue","syncIntervalMinutes","lastSyncAt","now","parseOptionalPositiveInt","trimmed","raw","value","max","matchesChannelSearch","q","query","PULL_PROVIDER_GROUP_LABELS","TimeCampusCapturePullProviderGroup","pullProviderGroupLabel","known","group","words","PULL_PROVIDER_GROUP_ORDER","groupPullProviders","byGroup","providers","list","rank","index","a","b"],"sources":["../../../../src/timecampus/pages/channels/channelCatalog.ts"],"sourcesContent":["/**\n * Capture-channel catalogue and display helpers (BOFF-4036).\n *\n * Pure functions only, so the page stays thin and this logic is unit-tested.\n */\nimport {\n TimeCampusCaptureChannelPrivacyMode as PrivacyMode,\n TimeCampusCaptureChannelStatus as ChannelStatus,\n TimeCampusCaptureChannelSyncStatus as SyncStatus,\n TimeCampusCaptureChannelType as ChannelType,\n TimeCampusCapturePullProviderGroup as PullProviderGroup,\n} from \"@/generated/wspace-types\";\n\nexport interface ChannelCatalogEntry {\n type: ChannelType;\n label: string;\n description: string;\n /** Name suggested when connecting a channel of this type. */\n defaultName: string;\n}\n\nexport const CHANNEL_SETUP_HINT =\n \"Sources send this ID as channelId when they push activity to TimeCampus \" +\n \"(ingestTimeCampusCaptureEvents). Use it from the API, your own scripts or \" +\n \"any client that lets you set a channel ID; events then follow this \" +\n \"channel's status, privacy and retention settings.\";\n\nexport const AUTOMATIC_CHANNEL_HINT =\n \"The TimeCampus mobile app registers this channel for your device and \" +\n \"sends its activity here automatically, so there is nothing to copy. \" +\n \"Pause or disconnect the channel to stop capture on the device; its \" +\n \"privacy and retention settings apply to everything it sends.\";\n\nexport const CLI_CHANNEL_HINT =\n \"The TimeCampus CLI saves this channel for the selected workspace when you run \" +\n \"timecampus channel connect. Send timing events explicitly with \" +\n \"timecampus capture send <file> or pipe JSON to timecampus capture send -. \" +\n \"The CLI does not collect shell history.\";\n\nexport function channelSetupHint(\n type: ChannelType,\n provider?: string | null,\n): string {\n if (type === ChannelType.Mobile) return AUTOMATIC_CHANNEL_HINT;\n if (type === ChannelType.Cli && provider === \"timecampus-cli\")\n return CLI_CHANNEL_HINT;\n return CHANNEL_SETUP_HINT;\n}\n\nexport const CHANNEL_CATALOG: readonly ChannelCatalogEntry[] = [\n {\n type: ChannelType.Browser,\n label: \"Browser Extension\",\n description: \"Active tabs and sites from Chrome, Edge or Firefox.\",\n defaultName: \"Browser Extension\",\n },\n {\n type: ChannelType.Desktop,\n label: \"Desktop App\",\n description: \"Foreground applications and windows on your computer.\",\n defaultName: \"Desktop App\",\n },\n {\n type: ChannelType.Mobile,\n label: \"Mobile App\",\n description:\n \"App usage captured by the TimeCampus mobile app. The app connects this channel for you.\",\n defaultName: \"Mobile App\",\n },\n {\n type: ChannelType.Ide,\n label: \"IDE Plugin\",\n description: \"Coding time from VS Code and other editors.\",\n defaultName: \"IDE Plugin\",\n },\n {\n type: ChannelType.Cli,\n label: \"Command Line\",\n description:\n \"Send timing events explicitly from a file or standard input with the TimeCampus CLI.\",\n defaultName: \"Command Line\",\n },\n {\n type: ChannelType.Calendar,\n label: \"Calendar Sync\",\n description: \"Meetings and events from your calendar.\",\n defaultName: \"Calendar\",\n },\n {\n type: ChannelType.Api,\n label: \"API Client\",\n description: \"Your own scripts or tools posting activity through the API.\",\n defaultName: \"API Client\",\n },\n {\n type: ChannelType.Custom,\n label: \"Custom Source\",\n description: \"Anything else that can describe how your time was spent.\",\n defaultName: \"Custom Source\",\n },\n];\n\n/**\n * Channels pulled from a connected account (BOFF-10441). Not offered in the\n * push-source picker: they are created from \"Connect an account\".\n */\nconst INTEGRATION_ENTRY: ChannelCatalogEntry = {\n type: ChannelType.Integration,\n label: \"Connected App\",\n description: \"Activity TimeCampus pulls from an app you connected.\",\n defaultName: \"Connected App\",\n};\n\nexport function catalogEntry(type: ChannelType): ChannelCatalogEntry {\n if (type === ChannelType.Integration) return INTEGRATION_ENTRY;\n return (\n CHANNEL_CATALOG.find((entry) => entry.type === type) ??\n CHANNEL_CATALOG[CHANNEL_CATALOG.length - 1]!\n );\n}\n\n/**\n * The integrations OAuth callback on the workspace gateway. The shell passes\n * the gateway origin; a full GraphQL URL is reduced to its origin so the\n * redirect matches what the OAuth app registered.\n */\nexport function oauthCallbackUrl(\n apiGatewayUrl: string | null | undefined,\n): string {\n if (!apiGatewayUrl) return \"/integrations/oauth/callback\";\n const base = apiGatewayUrl\n .replace(/\\/workspaces\\/graphql\\/?$/, \"\")\n .replace(/\\/+$/, \"\");\n return `${base}/integrations/oauth/callback`;\n}\n\nexport type PullHealth = \"ok\" | \"reconnect\" | \"error\";\n\n/**\n * How a pulled channel is doing: it needs the account connected again once\n * its connection was revoked or the last sync said so, shows an error when\n * the last sync failed or was skipped, and is fine otherwise.\n */\nexport function pullHealth(channel: {\n pullSync: boolean;\n integrationRevokedAt?: string | null;\n lastSyncStatus?: SyncStatus | null;\n}): PullHealth {\n if (!channel.pullSync) return \"ok\";\n if (\n channel.integrationRevokedAt ||\n channel.lastSyncStatus === SyncStatus.ReconnectRequired\n ) {\n return \"reconnect\";\n }\n if (\n channel.lastSyncStatus === SyncStatus.Failed ||\n channel.lastSyncStatus === SyncStatus.Skipped\n ) {\n return \"error\";\n }\n return \"ok\";\n}\n\nexport const PRIVACY_OPTIONS: readonly {\n value: PrivacyMode;\n label: string;\n description: string;\n}[] = [\n {\n value: PrivacyMode.Full,\n label: \"Full detail\",\n description: \"Keep titles, URLs and details as the source sends them.\",\n },\n {\n value: PrivacyMode.TitlesOnly,\n label: \"Titles only\",\n description: \"Keep window and page titles; drop URLs and extra details.\",\n },\n {\n value: PrivacyMode.AggregateOnly,\n label: \"Aggregate only\",\n description:\n \"Keep only the app, category and timing. Titles and URLs never reach the server.\",\n },\n];\n\nexport function privacyLabel(mode: PrivacyMode): string {\n return PRIVACY_OPTIONS.find((o) => o.value === mode)?.label ?? mode;\n}\n\nexport type StatusTone = \"success\" | \"warning\" | \"muted\";\n\nexport function statusDisplay(status: ChannelStatus): {\n label: string;\n tone: StatusTone;\n} {\n switch (status) {\n case ChannelStatus.Active:\n return { label: \"Connected\", tone: \"success\" };\n case ChannelStatus.Paused:\n return { label: \"Paused\", tone: \"warning\" };\n default:\n return { label: \"Disconnected\", tone: \"muted\" };\n }\n}\n\n/** \"Every 15 minutes\", \"Hourly\", \"Daily\", or \"On demand\" when unset. */\nexport function formatSyncInterval(minutes: number | null | undefined): string {\n if (minutes == null) return \"On demand\";\n if (minutes === 60) return \"Hourly\";\n if (minutes === 1440) return \"Daily\";\n if (minutes === 10080) return \"Weekly\";\n if (minutes % 1440 === 0) return `Every ${minutes / 1440} days`;\n if (minutes % 60 === 0) return `Every ${minutes / 60} hours`;\n return minutes === 1 ? \"Every minute\" : `Every ${minutes} minutes`;\n}\n\nexport function formatRetention(days: number | null | undefined): string {\n if (days == null) return \"Kept until you delete it\";\n if (days === 1) return \"1 day\";\n return `${days} days`;\n}\n\n/**\n * True when an ACTIVE channel has missed more than two of its declared sync\n * intervals, so the user can see a source has gone quiet.\n */\nexport function isOverdue(\n status: ChannelStatus,\n lastSyncAt: string | null | undefined,\n syncIntervalMinutes: number | null | undefined,\n now: Date = new Date(),\n): boolean {\n if (status !== ChannelStatus.Active || !syncIntervalMinutes || !lastSyncAt) {\n return false;\n }\n const elapsedMs = now.getTime() - new Date(lastSyncAt).getTime();\n return elapsedMs > syncIntervalMinutes * 2 * 60_000;\n}\n\n/** Parse an optional positive whole-number form field; \"\" → null. */\nexport function parseOptionalPositiveInt(\n raw: string,\n max: number,\n): { ok: true; value: number | null } | { ok: false } {\n const trimmed = raw.trim();\n if (!trimmed) return { ok: true, value: null };\n if (!/^\\d+$/.test(trimmed)) return { ok: false };\n const value = Number(trimmed);\n if (value < 1 || value > max) return { ok: false };\n return { ok: true, value };\n}\n\n/** Case-insensitive match on name, provider and the type's label. */\nexport function matchesChannelSearch(\n channel: { name: string; provider?: string | null; type: ChannelType },\n query: string,\n): boolean {\n const q = query.trim().toLowerCase();\n if (!q) return true;\n return [\n channel.name,\n channel.provider ?? \"\",\n catalogEntry(channel.type).label,\n ]\n .join(\" \")\n .toLowerCase()\n .includes(q);\n}\n\n/** Headings for the connector groups on the Channels page, in display order (BOFF-4207). */\nexport const PULL_PROVIDER_GROUP_LABELS: Record<PullProviderGroup, string> = {\n [PullProviderGroup.Calendar]: \"Calendar\",\n [PullProviderGroup.Chat]: \"Chat\",\n [PullProviderGroup.Email]: \"Email\",\n [PullProviderGroup.Code]: \"Code\",\n [PullProviderGroup.ProjectManagement]: \"Project management\",\n [PullProviderGroup.Documents]: \"Documents\",\n};\n\n/**\n * The heading for a connector group. A group the page does not know yet\n * (the service added it first) is shown by its name, e.g. \"WHITEBOARD\" as\n * \"Whiteboard\", so its heading is never blank.\n */\nexport function pullProviderGroupLabel(group: PullProviderGroup): string {\n const known: string | undefined = PULL_PROVIDER_GROUP_LABELS[group];\n if (known) return known;\n const words = String(group).toLowerCase().replace(/_/g, \" \").trim();\n return words ? words.charAt(0).toUpperCase() + words.slice(1) : \"Other\";\n}\n\nconst PULL_PROVIDER_GROUP_ORDER = Object.keys(\n PULL_PROVIDER_GROUP_LABELS,\n) as PullProviderGroup[];\n\n/**\n * Connectors grouped for display: groups in a fixed order, empty groups\n * dropped, and connectors kept in the order the service lists them. A group\n * the page does not know yet goes last rather than being hidden.\n */\nexport function groupPullProviders<T extends { group: PullProviderGroup }>(\n providers: readonly T[],\n): Array<{ group: PullProviderGroup; providers: T[] }> {\n const byGroup = new Map<PullProviderGroup, T[]>();\n for (const provider of providers) {\n const list = byGroup.get(provider.group) ?? [];\n list.push(provider);\n byGroup.set(provider.group, list);\n }\n const rank = (group: PullProviderGroup) => {\n const index = PULL_PROVIDER_GROUP_ORDER.indexOf(group);\n return index === -1 ? PULL_PROVIDER_GROUP_ORDER.length : index;\n };\n return [...byGroup.entries()]\n .sort(([a], [b]) => rank(a) - rank(b))\n .map(([group, list]) => ({ group, providers: list }));\n}\n"],"mappings":";;AAqBA,IAAaK,IACX,0QAKWC,IACX,4QAKWC,IACX;AAKF,SAAgBC,EACd,GACA,GACQ;CAIR,OAHIC,MAAST,EAAY,SAAeM,IACpCG,MAAST,EAAY,OAAOW,MAAa,mBACpCJ,IACFF;AACT;AAEA,IAAaO,IAAkD;CAC7D;EACE,MAAMZ,EAAY;EAClB,OAAO;EACP,aAAa;EACb,aAAa;CACf;CACA;EACE,MAAMA,EAAY;EAClB,OAAO;EACP,aAAa;EACb,aAAa;CACf;CACA;EACE,MAAMA,EAAY;EAClB,OAAO;EACP,aACE;EACF,aAAa;CACf;CACA;EACE,MAAMA,EAAY;EAClB,OAAO;EACP,aAAa;EACb,aAAa;CACf;CACA;EACE,MAAMA,EAAY;EAClB,OAAO;EACP,aACE;EACF,aAAa;CACf;CACA;EACE,MAAMA,EAAY;EAClB,OAAO;EACP,aAAa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oBAAoB;EACtCA,EAAkB,YAAY;AACjC;AAOA,SAAgB2C,EAAuB,GAAkC;CACvE,IAAMC,IAA4BH,EAA2BI;CAC7D,IAAID,GAAO,OAAOA;CAClB,IAAME,IAAQ,OAAOD,CAAK,CAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,MAAM,GAAG,CAAC,CAAC,KAAK;CAClE,OAAOC,IAAQA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAM,MAAM,CAAC,IAAI;AAClE;AAEA,IAAMC,IAA4B,OAAO,KACvCN,CACF;AAOA,SAAgBO,EACd,GACqD;CACrD,IAAMC,oBAAU,IAAI,IAA4B;CAChD,KAAK,IAAM1C,KAAY2C,GAAW;EAChC,IAAMC,IAAOF,EAAQ,IAAI1C,EAAS,KAAK,KAAK,CAAC;EAE7C,AADA4C,EAAK,KAAK5C,CAAQ,GAClB0C,EAAQ,IAAI1C,EAAS,OAAO4C,CAAI;CAClC;CACA,IAAMC,KAAQ,MAA6B;EACzC,IAAMC,IAAQN,EAA0B,QAAQF,CAAK;EACrD,OAAOQ,MAAU,KAAKN,EAA0B,SAASM;CAC3D;CACA,OAAO,CAAC,GAAGJ,EAAQ,QAAQ,CAAC,CAAC,CAC1B,MAAM,CAACK,IAAI,CAACC,OAAOH,EAAKE,CAAC,IAAIF,EAAKG,CAAC,CAAC,CAAC,CACrC,KAAK,CAACV,GAAOM,QAAW;EAAE;EAAO,WAAWA;CAAK,EAAE;AACxD"}
|
|
1
|
+
{"version":3,"file":"channelCatalog.js","names":["ChannelType","SyncStatus","PrivacyMode","ChannelStatus","PullProviderGroup","CHANNEL_SETUP_HINT","AUTOMATIC_CHANNEL_HINT","CLI_CHANNEL_HINT","channelSetupHint","type","TimeCampusCaptureChannelType","provider","CHANNEL_CATALOG","INTEGRATION_ENTRY","catalogEntry","entry","oauthCallbackUrl","apiGatewayUrl","pullHealth","channel","TimeCampusCaptureChannelSyncStatus","PRIVACY_OPTIONS","TimeCampusCaptureChannelPrivacyMode","privacyLabel","o","mode","statusDisplay","status","TimeCampusCaptureChannelStatus","formatSyncInterval","minutes","formatRetention","days","isOverdue","syncIntervalMinutes","lastSyncAt","now","parseOptionalPositiveInt","trimmed","raw","value","max","matchesChannelSearch","q","query","PULL_PROVIDER_GROUP_LABELS","TimeCampusCapturePullProviderGroup","pullProviderGroupLabel","known","group","words","PULL_PROVIDER_GROUP_ORDER","groupPullProviders","byGroup","providers","list","rank","index","a","b"],"sources":["../../../../src/timecampus/pages/channels/channelCatalog.ts"],"sourcesContent":["/**\n * Capture-channel catalogue and display helpers (BOFF-4036).\n *\n * Pure functions only, so the page stays thin and this logic is unit-tested.\n */\nimport {\n TimeCampusCaptureChannelPrivacyMode as PrivacyMode,\n TimeCampusCaptureChannelStatus as ChannelStatus,\n TimeCampusCaptureChannelSyncStatus as SyncStatus,\n TimeCampusCaptureChannelType as ChannelType,\n TimeCampusCapturePullProviderGroup as PullProviderGroup,\n} from \"@/generated/wspace-types\";\n\nexport interface ChannelCatalogEntry {\n type: ChannelType;\n label: string;\n description: string;\n /** Name suggested when connecting a channel of this type. */\n defaultName: string;\n}\n\nexport const CHANNEL_SETUP_HINT =\n \"Sources send this ID as channelId when they push activity to TimeCampus \" +\n \"(ingestTimeCampusCaptureEvents). Use it from the API, your own scripts or \" +\n \"any client that lets you set a channel ID; events then follow this \" +\n \"channel's status, privacy and retention settings.\";\n\nexport const AUTOMATIC_CHANNEL_HINT =\n \"The TimeCampus mobile app registers this channel for your device and \" +\n \"sends its activity here automatically, so there is nothing to copy. \" +\n \"Pause or disconnect the channel to stop capture on the device; its \" +\n \"privacy and retention settings apply to everything it sends.\";\n\nexport const CLI_CHANNEL_HINT =\n \"The TimeCampus CLI saves this channel for the selected workspace when you run \" +\n \"timecampus channel connect. Send timing events explicitly with \" +\n \"timecampus capture send <file> or pipe JSON to timecampus capture send -. \" +\n \"The CLI does not collect shell history.\";\n\nexport function channelSetupHint(\n type: ChannelType,\n provider?: string | null,\n): string {\n if (type === ChannelType.Mobile) return AUTOMATIC_CHANNEL_HINT;\n if (type === ChannelType.Cli && provider === \"timecampus-cli\")\n return CLI_CHANNEL_HINT;\n return CHANNEL_SETUP_HINT;\n}\n\nexport const CHANNEL_CATALOG: readonly ChannelCatalogEntry[] = [\n {\n type: ChannelType.Browser,\n label: \"Browser Extension\",\n description: \"Active tabs and sites from Chrome, Edge or Firefox.\",\n defaultName: \"Browser Extension\",\n },\n {\n type: ChannelType.Desktop,\n label: \"Desktop App\",\n description: \"Foreground applications and windows on your computer.\",\n defaultName: \"Desktop App\",\n },\n {\n type: ChannelType.Mobile,\n label: \"Mobile App\",\n description:\n \"App usage captured by the TimeCampus mobile app. The app connects this channel for you.\",\n defaultName: \"Mobile App\",\n },\n {\n type: ChannelType.Ide,\n label: \"IDE Plugin\",\n description: \"Coding time from VS Code and other editors.\",\n defaultName: \"IDE Plugin\",\n },\n {\n type: ChannelType.Cli,\n label: \"Command Line\",\n description:\n \"Send timing events explicitly from a file or standard input with the TimeCampus CLI.\",\n defaultName: \"Command Line\",\n },\n {\n type: ChannelType.Calendar,\n label: \"Calendar Sync\",\n description: \"Meetings and events from your calendar.\",\n defaultName: \"Calendar\",\n },\n {\n type: ChannelType.Api,\n label: \"API Client\",\n description: \"Your own scripts or tools posting activity through the API.\",\n defaultName: \"API Client\",\n },\n {\n type: ChannelType.Custom,\n label: \"Custom Source\",\n description: \"Anything else that can describe how your time was spent.\",\n defaultName: \"Custom Source\",\n },\n];\n\n/**\n * Channels pulled from a connected account (BOFF-10441). Not offered in the\n * push-source picker: they are created from \"Connect an account\".\n */\nconst INTEGRATION_ENTRY: ChannelCatalogEntry = {\n type: ChannelType.Integration,\n label: \"Connected App\",\n description: \"Activity TimeCampus pulls from an app you connected.\",\n defaultName: \"Connected App\",\n};\n\nexport function catalogEntry(type: ChannelType): ChannelCatalogEntry {\n if (type === ChannelType.Integration) return INTEGRATION_ENTRY;\n return (\n CHANNEL_CATALOG.find((entry) => entry.type === type) ??\n CHANNEL_CATALOG[CHANNEL_CATALOG.length - 1]!\n );\n}\n\n/**\n * The integrations OAuth callback on the workspace gateway. The shell passes\n * the gateway origin; a full GraphQL URL is reduced to its origin so the\n * redirect matches what the OAuth app registered.\n */\nexport function oauthCallbackUrl(\n apiGatewayUrl: string | null | undefined,\n): string {\n if (!apiGatewayUrl) return \"/integrations/oauth/callback\";\n const base = apiGatewayUrl\n .replace(/\\/workspaces\\/graphql\\/?$/, \"\")\n .replace(/\\/+$/, \"\");\n return `${base}/integrations/oauth/callback`;\n}\n\nexport type PullHealth = \"ok\" | \"reconnect\" | \"error\";\n\n/**\n * How a pulled channel is doing: it needs the account connected again once\n * its connection was revoked or the last sync said so, shows an error when\n * the last sync failed or was skipped, and is fine otherwise.\n */\nexport function pullHealth(channel: {\n pullSync: boolean;\n integrationRevokedAt?: string | null;\n lastSyncStatus?: SyncStatus | null;\n}): PullHealth {\n if (!channel.pullSync) return \"ok\";\n if (\n channel.integrationRevokedAt ||\n channel.lastSyncStatus === SyncStatus.ReconnectRequired\n ) {\n return \"reconnect\";\n }\n if (\n channel.lastSyncStatus === SyncStatus.Failed ||\n channel.lastSyncStatus === SyncStatus.Skipped\n ) {\n return \"error\";\n }\n return \"ok\";\n}\n\nexport const PRIVACY_OPTIONS: readonly {\n value: PrivacyMode;\n label: string;\n description: string;\n}[] = [\n {\n value: PrivacyMode.Full,\n label: \"Full detail\",\n description: \"Keep titles, URLs and details as the source sends them.\",\n },\n {\n value: PrivacyMode.TitlesOnly,\n label: \"Titles only\",\n description: \"Keep window and page titles; drop URLs and extra details.\",\n },\n {\n value: PrivacyMode.AggregateOnly,\n label: \"Aggregate only\",\n description:\n \"Keep only the app, category and timing. Titles and URLs never reach the server.\",\n },\n];\n\nexport function privacyLabel(mode: PrivacyMode): string {\n return PRIVACY_OPTIONS.find((o) => o.value === mode)?.label ?? mode;\n}\n\nexport type StatusTone = \"success\" | \"warning\" | \"muted\";\n\nexport function statusDisplay(status: ChannelStatus): {\n label: string;\n tone: StatusTone;\n} {\n switch (status) {\n case ChannelStatus.Active:\n return { label: \"Connected\", tone: \"success\" };\n case ChannelStatus.Paused:\n return { label: \"Paused\", tone: \"warning\" };\n default:\n return { label: \"Disconnected\", tone: \"muted\" };\n }\n}\n\n/** \"Every 15 minutes\", \"Hourly\", \"Daily\", or \"On demand\" when unset. */\nexport function formatSyncInterval(minutes: number | null | undefined): string {\n if (minutes == null) return \"On demand\";\n if (minutes === 60) return \"Hourly\";\n if (minutes === 1440) return \"Daily\";\n if (minutes === 10080) return \"Weekly\";\n if (minutes % 1440 === 0) return `Every ${minutes / 1440} days`;\n if (minutes % 60 === 0) return `Every ${minutes / 60} hours`;\n return minutes === 1 ? \"Every minute\" : `Every ${minutes} minutes`;\n}\n\nexport function formatRetention(days: number | null | undefined): string {\n if (days == null) return \"Kept until you delete it\";\n if (days === 1) return \"1 day\";\n return `${days} days`;\n}\n\n/**\n * True when an ACTIVE channel has missed more than two of its declared sync\n * intervals, so the user can see a source has gone quiet.\n */\nexport function isOverdue(\n status: ChannelStatus,\n lastSyncAt: string | null | undefined,\n syncIntervalMinutes: number | null | undefined,\n now: Date = new Date(),\n): boolean {\n if (status !== ChannelStatus.Active || !syncIntervalMinutes || !lastSyncAt) {\n return false;\n }\n const elapsedMs = now.getTime() - new Date(lastSyncAt).getTime();\n return elapsedMs > syncIntervalMinutes * 2 * 60_000;\n}\n\n/** Parse an optional positive whole-number form field; \"\" → null. */\nexport function parseOptionalPositiveInt(\n raw: string,\n max: number,\n): { ok: true; value: number | null } | { ok: false } {\n const trimmed = raw.trim();\n if (!trimmed) return { ok: true, value: null };\n if (!/^\\d+$/.test(trimmed)) return { ok: false };\n const value = Number(trimmed);\n if (value < 1 || value > max) return { ok: false };\n return { ok: true, value };\n}\n\n/** Case-insensitive match on name, provider and the type's label. */\nexport function matchesChannelSearch(\n channel: { name: string; provider?: string | null; type: ChannelType },\n query: string,\n): boolean {\n const q = query.trim().toLowerCase();\n if (!q) return true;\n return [\n channel.name,\n channel.provider ?? \"\",\n catalogEntry(channel.type).label,\n ]\n .join(\" \")\n .toLowerCase()\n .includes(q);\n}\n\n/** Headings for the connector groups on the Channels page, in display order (BOFF-4207). */\nexport const PULL_PROVIDER_GROUP_LABELS: Record<PullProviderGroup, string> = {\n [PullProviderGroup.Calendar]: \"Calendar\",\n [PullProviderGroup.Chat]: \"Chat\",\n [PullProviderGroup.Email]: \"Email\",\n [PullProviderGroup.Code]: \"Code\",\n [PullProviderGroup.ProjectManagement]: \"Project management\",\n [PullProviderGroup.Documents]: \"Documents\",\n [PullProviderGroup.Sales]: \"Sales\",\n};\n\n/**\n * The heading for a connector group. A group the page does not know yet\n * (the service added it first) is shown by its name, e.g. \"WHITEBOARD\" as\n * \"Whiteboard\", so its heading is never blank.\n */\nexport function pullProviderGroupLabel(group: PullProviderGroup): string {\n const known: string | undefined = PULL_PROVIDER_GROUP_LABELS[group];\n if (known) return known;\n const words = String(group).toLowerCase().replace(/_/g, \" \").trim();\n return words ? words.charAt(0).toUpperCase() + words.slice(1) : \"Other\";\n}\n\nconst PULL_PROVIDER_GROUP_ORDER = Object.keys(\n PULL_PROVIDER_GROUP_LABELS,\n) as PullProviderGroup[];\n\n/**\n * Connectors grouped for display: groups in a fixed order, empty groups\n * dropped, and connectors kept in the order the service lists them. A group\n * the page does not know yet goes last rather than being hidden.\n */\nexport function groupPullProviders<T extends { group: PullProviderGroup }>(\n providers: readonly T[],\n): Array<{ group: PullProviderGroup; providers: T[] }> {\n const byGroup = new Map<PullProviderGroup, T[]>();\n for (const provider of providers) {\n const list = byGroup.get(provider.group) ?? [];\n list.push(provider);\n byGroup.set(provider.group, list);\n }\n const rank = (group: PullProviderGroup) => {\n const index = PULL_PROVIDER_GROUP_ORDER.indexOf(group);\n return index === -1 ? PULL_PROVIDER_GROUP_ORDER.length : index;\n };\n return [...byGroup.entries()]\n .sort(([a], [b]) => rank(a) - rank(b))\n .map(([group, list]) => ({ group, providers: list }));\n}\n"],"mappings":";;A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,MAAU,KAAKN,EAA0B,SAASM;CAC3D;CACA,OAAO,CAAC,GAAGJ,EAAQ,QAAQ,CAAC,CAAC,CAC1B,MAAM,CAACK,IAAI,CAACC,OAAOH,EAAKE,CAAC,IAAIF,EAAKG,CAAC,CAAC,CAAC,CACrC,KAAK,CAACV,GAAOM,QAAW;EAAE;EAAO,WAAWA;CAAK,EAAE;AACxD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-timecampus",
|
|
3
|
-
"version": "2026.1206.
|
|
3
|
+
"version": "2026.1206.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Algoshred/microfe-timecampus.git"
|
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
"verify:dts": "bun scripts/verify-dts.ts",
|
|
36
36
|
"codegen": "graphql-codegen --project wspace && graphql-codegen --project global",
|
|
37
37
|
"codegen:all": "bun run schema:pull && bun run codegen",
|
|
38
|
-
"schema:pull": "
|
|
38
|
+
"schema:pull": "bash scripts/schema-pull.sh",
|
|
39
|
+
"schema:check": "bash scripts/schema-pull.sh --check",
|
|
40
|
+
"schema:pull:introspect": "bash scripts/schema-pull.sh --mode introspect",
|
|
39
41
|
"lint": "eslint .",
|
|
40
42
|
"format": "bun fmt src",
|
|
41
43
|
"format:check": "bun fmt --check src",
|