@infinitetoken/lumber-kit 0.7.0 → 0.8.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.
package/dist/index.d.mts CHANGED
@@ -49,48 +49,6 @@ declare const logLevelNameToLevel: Record<LogLevelName, LogLevel>;
49
49
  /** All valid log levels, ordered from least to most severe. */
50
50
  declare const logLevels: readonly LogLevel[];
51
51
 
52
- /** A push threshold one past Fatal, which no log reaches: log pushes are off (the account's, or one app's). */
53
- declare const PUSH_OFF = 5;
54
- /** The lowest log level that pushes, or PUSH_OFF. Stored as a notification preference's `minimumLevel`. */
55
- type PushThreshold = LogLevel | typeof PUSH_OFF;
56
- /** The threshold a user gets when none is set. */
57
- declare const DEFAULT_PUSH_THRESHOLD: PushThreshold;
58
-
59
- /** User subscription level. Mirrors User.subscriptionLevel in Lumber-API. */
60
- declare const enum SubscriptionLevel {
61
- Hobby = 0,
62
- Dev = 1,
63
- Pro = 2,
64
- Enterprise = 3
65
- }
66
- /** String name for each subscription level, suitable for display and Redux state. */
67
- type SubscriptionLevelName = 'hobby' | 'dev' | 'pro' | 'enterprise';
68
- /** Maps numeric subscription level to its string level name. */
69
- declare const subscriptionLevelToName: Record<SubscriptionLevel, SubscriptionLevelName>;
70
- /** All valid subscription levels, ordered from least to most severe. */
71
- declare const subscriptionLevels: readonly SubscriptionLevel[];
72
- type SubscriptionLimits = {
73
- apps: number;
74
- seats: number;
75
- apiKeys: number;
76
- logRetentionDays: number;
77
- monthlyLogs: number;
78
- /** Whether real-time WebSocket log streaming is available. */
79
- realtimeLogs: boolean;
80
- /** Minimum log level that triggers a push notification. Infinity means push is disabled. */
81
- minPushLevel: number;
82
- };
83
- /** Per-level resource limits. Use Infinity to mean unlimited or disabled. */
84
- declare const subscriptionLimits: Record<SubscriptionLevel, SubscriptionLimits>;
85
- type SubscriptionPlan = {
86
- /** Display name, as every surface shows it. */
87
- name: string;
88
- /** Monthly price in US dollars: 0 for free, null when priced per customer. */
89
- monthlyPrice: number | null;
90
- };
91
- /** Each level's name and price. Stripe holds the prices themselves; these must match what it charges. */
92
- declare const subscriptionPlans: Record<SubscriptionLevel, SubscriptionPlan>;
93
-
94
52
  /**
95
53
  * An organization that owns apps and pays for member usage.
96
54
  * Team subscriptionLevel takes precedence over individual member levels.
@@ -667,6 +625,18 @@ interface LogTimeseriesQuery {
667
625
  }
668
626
 
669
627
  type Appearance = 'system' | 'dark' | 'light';
628
+ /** A 24-hour clock (`19:15:44`) or a 12-hour one (`7:15:44 PM`). */
629
+ type TimeClock = '24h' | '12h';
630
+ /** The device's own time zone, or UTC. */
631
+ type TimeZoneChoice = 'local' | 'utc';
632
+ /**
633
+ * How a user reads times, on every device: the clock, and the zone that times, days and hours are in (the log list, the
634
+ * heatmap, pushes).
635
+ */
636
+ interface TimeFormat {
637
+ clock: TimeClock;
638
+ zone: TimeZoneChoice;
639
+ }
670
640
  interface PushToken {
671
641
  token: string;
672
642
  deviceId?: string;
@@ -701,6 +671,8 @@ interface UserRecord {
701
671
  appearance?: Appearance;
702
672
  color?: string;
703
673
  imageUrl?: string;
674
+ /** Null until the user picks one (DEFAULT_TIME_FORMAT). Missing from an API before it was kept. */
675
+ timeFormat?: TimeFormat | null;
704
676
  agreedToTermsVersion?: string;
705
677
  notificationPreferences: NotificationPreferences;
706
678
  pushTokens: PushToken[];
@@ -710,6 +682,50 @@ interface UserRecord {
710
682
  notesReadAt?: Record<string, string>;
711
683
  }
712
684
 
685
+ /** A push threshold one past Fatal, which no log reaches: log pushes are off (the account's, or one app's). */
686
+ declare const PUSH_OFF = 5;
687
+ /** The lowest log level that pushes, or PUSH_OFF. Stored as a notification preference's `minimumLevel`. */
688
+ type PushThreshold = LogLevel | typeof PUSH_OFF;
689
+ /** The threshold a user gets when none is set. */
690
+ declare const DEFAULT_PUSH_THRESHOLD: PushThreshold;
691
+ /** The time format a user gets until they pick one: 24-hour, in the device's own time zone. */
692
+ declare const DEFAULT_TIME_FORMAT: TimeFormat;
693
+
694
+ /** User subscription level. Mirrors User.subscriptionLevel in Lumber-API. */
695
+ declare const enum SubscriptionLevel {
696
+ Hobby = 0,
697
+ Dev = 1,
698
+ Pro = 2,
699
+ Enterprise = 3
700
+ }
701
+ /** String name for each subscription level, suitable for display and Redux state. */
702
+ type SubscriptionLevelName = 'hobby' | 'dev' | 'pro' | 'enterprise';
703
+ /** Maps numeric subscription level to its string level name. */
704
+ declare const subscriptionLevelToName: Record<SubscriptionLevel, SubscriptionLevelName>;
705
+ /** All valid subscription levels, ordered from least to most severe. */
706
+ declare const subscriptionLevels: readonly SubscriptionLevel[];
707
+ type SubscriptionLimits = {
708
+ apps: number;
709
+ seats: number;
710
+ apiKeys: number;
711
+ logRetentionDays: number;
712
+ monthlyLogs: number;
713
+ /** Whether real-time WebSocket log streaming is available. */
714
+ realtimeLogs: boolean;
715
+ /** Minimum log level that triggers a push notification. Infinity means push is disabled. */
716
+ minPushLevel: number;
717
+ };
718
+ /** Per-level resource limits. Use Infinity to mean unlimited or disabled. */
719
+ declare const subscriptionLimits: Record<SubscriptionLevel, SubscriptionLimits>;
720
+ type SubscriptionPlan = {
721
+ /** Display name, as every surface shows it. */
722
+ name: string;
723
+ /** Monthly price in US dollars: 0 for free, null when priced per customer. */
724
+ monthlyPrice: number | null;
725
+ };
726
+ /** Each level's name and price. Stripe holds the prices themselves; these must match what it charges. */
727
+ declare const subscriptionPlans: Record<SubscriptionLevel, SubscriptionPlan>;
728
+
713
729
  /**
714
730
  * The plaintext a plugin encrypts for one log call: its level and message, requestId and traceId when given, the
715
731
  * plugin's automatic context (pid, hostname and the like) with the call's context over it, and the call's other keys
@@ -727,6 +743,10 @@ declare const logDeliveryOutcome: (status: number | null) => LogDeliveryOutcome;
727
743
  declare const logRetryDelayMs: (failedAttempts: number) => number;
728
744
 
729
745
  declare const isValidAppearance: (value: unknown) => value is Appearance;
746
+ /** A time format as sent or stored: an object with a known clock and zone, and nothing else. */
747
+ declare const isValidTimeFormat: (value: unknown) => value is TimeFormat;
748
+ /** A stored or sent time format, each part the default (DEFAULT_TIME_FORMAT) when it's missing or unknown. */
749
+ declare const normalizeTimeFormat: (value: unknown) => TimeFormat;
730
750
  /** Accepts 3- and 6-digit hex color strings (#rgb, #rrggbb). */
731
751
  declare const isValidColor: (value: string) => boolean;
732
752
  /**
@@ -766,4 +786,4 @@ declare const apiErrorCodeOf: (body: unknown) => ApiErrorCode | null;
766
786
  /** A push notification's data as PushData, or null for data no Lumber push sends. */
767
787
  declare const parsePushData: (data: unknown) => PushData | null;
768
788
 
769
- export { APP_COLORS, type ApiErrorBody, type ApiErrorCode, type ApiKeyRecord, type ApiResponse, type AppCreatedRecord, type AppEncryptedKey, type AppKeyUpsertBody, type AppPermission, type AppPersonRecord, type AppRecord, type AppTeamAccess, type Appearance, type AppsQuery, type ClaimantKeyCheck, type ClientToServerEvents, DEFAULT_ACCENT, DEFAULT_API_ENDPOINT, DEFAULT_PUSH_THRESHOLD, type DeviceLinkApproveBody, type DeviceLinkCreateBody, type DeviceLinkCreatedRecord, type DeviceLinkPlatform, type DeviceLinkRecord, type DeviceLinkStatus, type FlagRecord, type FlagsQuery, type GuestRecord, type HolderKeyCheck, type InvitationRecord, type KeyCheckResult, type KeyHolder, type KeyPin, LOG_KEY_VERSION, type LogContext, type LogData, type LogDeliveryOutcome, type LogEncrypted, type LogIngestBody, LogLevel, type LogLevelName, type LogPayload, type LogRecord, type LogTimeseriesQuery, type LogsQuery, type NoteEncrypted, type NoteRecord, type NotesQuery, type NotificationPreference, type NotificationPreferences, PUSH_OFF, type PendingAppKey, type PendingDeviceLink, type PushData, type PushThreshold, type PushToken, type PushType, type ResponseMetadata, type ServerToClientEvents, type SocketAppPayload, SubscriptionLevel, type SubscriptionLevelName, type SubscriptionLimits, type SubscriptionPlan, type SubscriptionPlanRecord, type TeamMemberRecord, type TeamRecord, type TeamsQuery, type TimeseriesBucket, type TimeseriesResponse, type UserRecord, apiErrorCodeOf, apiErrorCodes, buildLogPayload, isApiErrorCode, isValidAppearance, isValidColor, isValidDeviceLinkStatus, isValidImageUrl, isValidLogLevel, isValidSubscriptionLevel, isValidTeamMemberRole, joinApiKey, logDelivery, logDeliveryOutcome, logLevelColors, logLevelNameToLevel, logLevelToName, logLevels, logRetryDelayMs, nameColor, normalizePushThreshold, parsePushData, personColor, resolveAppColor, splitApiKey, subscriptionLevelToName, subscriptionLevels, subscriptionLimits, subscriptionPlans };
789
+ export { APP_COLORS, type ApiErrorBody, type ApiErrorCode, type ApiKeyRecord, type ApiResponse, type AppCreatedRecord, type AppEncryptedKey, type AppKeyUpsertBody, type AppPermission, type AppPersonRecord, type AppRecord, type AppTeamAccess, type Appearance, type AppsQuery, type ClaimantKeyCheck, type ClientToServerEvents, DEFAULT_ACCENT, DEFAULT_API_ENDPOINT, DEFAULT_PUSH_THRESHOLD, DEFAULT_TIME_FORMAT, type DeviceLinkApproveBody, type DeviceLinkCreateBody, type DeviceLinkCreatedRecord, type DeviceLinkPlatform, type DeviceLinkRecord, type DeviceLinkStatus, type FlagRecord, type FlagsQuery, type GuestRecord, type HolderKeyCheck, type InvitationRecord, type KeyCheckResult, type KeyHolder, type KeyPin, LOG_KEY_VERSION, type LogContext, type LogData, type LogDeliveryOutcome, type LogEncrypted, type LogIngestBody, LogLevel, type LogLevelName, type LogPayload, type LogRecord, type LogTimeseriesQuery, type LogsQuery, type NoteEncrypted, type NoteRecord, type NotesQuery, type NotificationPreference, type NotificationPreferences, PUSH_OFF, type PendingAppKey, type PendingDeviceLink, type PushData, type PushThreshold, type PushToken, type PushType, type ResponseMetadata, type ServerToClientEvents, type SocketAppPayload, SubscriptionLevel, type SubscriptionLevelName, type SubscriptionLimits, type SubscriptionPlan, type SubscriptionPlanRecord, type TeamMemberRecord, type TeamRecord, type TeamsQuery, type TimeClock, type TimeFormat, type TimeZoneChoice, type TimeseriesBucket, type TimeseriesResponse, type UserRecord, apiErrorCodeOf, apiErrorCodes, buildLogPayload, isApiErrorCode, isValidAppearance, isValidColor, isValidDeviceLinkStatus, isValidImageUrl, isValidLogLevel, isValidSubscriptionLevel, isValidTeamMemberRole, isValidTimeFormat, joinApiKey, logDelivery, logDeliveryOutcome, logLevelColors, logLevelNameToLevel, logLevelToName, logLevels, logRetryDelayMs, nameColor, normalizePushThreshold, normalizeTimeFormat, parsePushData, personColor, resolveAppColor, splitApiKey, subscriptionLevelToName, subscriptionLevels, subscriptionLimits, subscriptionPlans };
package/dist/index.d.ts CHANGED
@@ -49,48 +49,6 @@ declare const logLevelNameToLevel: Record<LogLevelName, LogLevel>;
49
49
  /** All valid log levels, ordered from least to most severe. */
50
50
  declare const logLevels: readonly LogLevel[];
51
51
 
52
- /** A push threshold one past Fatal, which no log reaches: log pushes are off (the account's, or one app's). */
53
- declare const PUSH_OFF = 5;
54
- /** The lowest log level that pushes, or PUSH_OFF. Stored as a notification preference's `minimumLevel`. */
55
- type PushThreshold = LogLevel | typeof PUSH_OFF;
56
- /** The threshold a user gets when none is set. */
57
- declare const DEFAULT_PUSH_THRESHOLD: PushThreshold;
58
-
59
- /** User subscription level. Mirrors User.subscriptionLevel in Lumber-API. */
60
- declare const enum SubscriptionLevel {
61
- Hobby = 0,
62
- Dev = 1,
63
- Pro = 2,
64
- Enterprise = 3
65
- }
66
- /** String name for each subscription level, suitable for display and Redux state. */
67
- type SubscriptionLevelName = 'hobby' | 'dev' | 'pro' | 'enterprise';
68
- /** Maps numeric subscription level to its string level name. */
69
- declare const subscriptionLevelToName: Record<SubscriptionLevel, SubscriptionLevelName>;
70
- /** All valid subscription levels, ordered from least to most severe. */
71
- declare const subscriptionLevels: readonly SubscriptionLevel[];
72
- type SubscriptionLimits = {
73
- apps: number;
74
- seats: number;
75
- apiKeys: number;
76
- logRetentionDays: number;
77
- monthlyLogs: number;
78
- /** Whether real-time WebSocket log streaming is available. */
79
- realtimeLogs: boolean;
80
- /** Minimum log level that triggers a push notification. Infinity means push is disabled. */
81
- minPushLevel: number;
82
- };
83
- /** Per-level resource limits. Use Infinity to mean unlimited or disabled. */
84
- declare const subscriptionLimits: Record<SubscriptionLevel, SubscriptionLimits>;
85
- type SubscriptionPlan = {
86
- /** Display name, as every surface shows it. */
87
- name: string;
88
- /** Monthly price in US dollars: 0 for free, null when priced per customer. */
89
- monthlyPrice: number | null;
90
- };
91
- /** Each level's name and price. Stripe holds the prices themselves; these must match what it charges. */
92
- declare const subscriptionPlans: Record<SubscriptionLevel, SubscriptionPlan>;
93
-
94
52
  /**
95
53
  * An organization that owns apps and pays for member usage.
96
54
  * Team subscriptionLevel takes precedence over individual member levels.
@@ -667,6 +625,18 @@ interface LogTimeseriesQuery {
667
625
  }
668
626
 
669
627
  type Appearance = 'system' | 'dark' | 'light';
628
+ /** A 24-hour clock (`19:15:44`) or a 12-hour one (`7:15:44 PM`). */
629
+ type TimeClock = '24h' | '12h';
630
+ /** The device's own time zone, or UTC. */
631
+ type TimeZoneChoice = 'local' | 'utc';
632
+ /**
633
+ * How a user reads times, on every device: the clock, and the zone that times, days and hours are in (the log list, the
634
+ * heatmap, pushes).
635
+ */
636
+ interface TimeFormat {
637
+ clock: TimeClock;
638
+ zone: TimeZoneChoice;
639
+ }
670
640
  interface PushToken {
671
641
  token: string;
672
642
  deviceId?: string;
@@ -701,6 +671,8 @@ interface UserRecord {
701
671
  appearance?: Appearance;
702
672
  color?: string;
703
673
  imageUrl?: string;
674
+ /** Null until the user picks one (DEFAULT_TIME_FORMAT). Missing from an API before it was kept. */
675
+ timeFormat?: TimeFormat | null;
704
676
  agreedToTermsVersion?: string;
705
677
  notificationPreferences: NotificationPreferences;
706
678
  pushTokens: PushToken[];
@@ -710,6 +682,50 @@ interface UserRecord {
710
682
  notesReadAt?: Record<string, string>;
711
683
  }
712
684
 
685
+ /** A push threshold one past Fatal, which no log reaches: log pushes are off (the account's, or one app's). */
686
+ declare const PUSH_OFF = 5;
687
+ /** The lowest log level that pushes, or PUSH_OFF. Stored as a notification preference's `minimumLevel`. */
688
+ type PushThreshold = LogLevel | typeof PUSH_OFF;
689
+ /** The threshold a user gets when none is set. */
690
+ declare const DEFAULT_PUSH_THRESHOLD: PushThreshold;
691
+ /** The time format a user gets until they pick one: 24-hour, in the device's own time zone. */
692
+ declare const DEFAULT_TIME_FORMAT: TimeFormat;
693
+
694
+ /** User subscription level. Mirrors User.subscriptionLevel in Lumber-API. */
695
+ declare const enum SubscriptionLevel {
696
+ Hobby = 0,
697
+ Dev = 1,
698
+ Pro = 2,
699
+ Enterprise = 3
700
+ }
701
+ /** String name for each subscription level, suitable for display and Redux state. */
702
+ type SubscriptionLevelName = 'hobby' | 'dev' | 'pro' | 'enterprise';
703
+ /** Maps numeric subscription level to its string level name. */
704
+ declare const subscriptionLevelToName: Record<SubscriptionLevel, SubscriptionLevelName>;
705
+ /** All valid subscription levels, ordered from least to most severe. */
706
+ declare const subscriptionLevels: readonly SubscriptionLevel[];
707
+ type SubscriptionLimits = {
708
+ apps: number;
709
+ seats: number;
710
+ apiKeys: number;
711
+ logRetentionDays: number;
712
+ monthlyLogs: number;
713
+ /** Whether real-time WebSocket log streaming is available. */
714
+ realtimeLogs: boolean;
715
+ /** Minimum log level that triggers a push notification. Infinity means push is disabled. */
716
+ minPushLevel: number;
717
+ };
718
+ /** Per-level resource limits. Use Infinity to mean unlimited or disabled. */
719
+ declare const subscriptionLimits: Record<SubscriptionLevel, SubscriptionLimits>;
720
+ type SubscriptionPlan = {
721
+ /** Display name, as every surface shows it. */
722
+ name: string;
723
+ /** Monthly price in US dollars: 0 for free, null when priced per customer. */
724
+ monthlyPrice: number | null;
725
+ };
726
+ /** Each level's name and price. Stripe holds the prices themselves; these must match what it charges. */
727
+ declare const subscriptionPlans: Record<SubscriptionLevel, SubscriptionPlan>;
728
+
713
729
  /**
714
730
  * The plaintext a plugin encrypts for one log call: its level and message, requestId and traceId when given, the
715
731
  * plugin's automatic context (pid, hostname and the like) with the call's context over it, and the call's other keys
@@ -727,6 +743,10 @@ declare const logDeliveryOutcome: (status: number | null) => LogDeliveryOutcome;
727
743
  declare const logRetryDelayMs: (failedAttempts: number) => number;
728
744
 
729
745
  declare const isValidAppearance: (value: unknown) => value is Appearance;
746
+ /** A time format as sent or stored: an object with a known clock and zone, and nothing else. */
747
+ declare const isValidTimeFormat: (value: unknown) => value is TimeFormat;
748
+ /** A stored or sent time format, each part the default (DEFAULT_TIME_FORMAT) when it's missing or unknown. */
749
+ declare const normalizeTimeFormat: (value: unknown) => TimeFormat;
730
750
  /** Accepts 3- and 6-digit hex color strings (#rgb, #rrggbb). */
731
751
  declare const isValidColor: (value: string) => boolean;
732
752
  /**
@@ -766,4 +786,4 @@ declare const apiErrorCodeOf: (body: unknown) => ApiErrorCode | null;
766
786
  /** A push notification's data as PushData, or null for data no Lumber push sends. */
767
787
  declare const parsePushData: (data: unknown) => PushData | null;
768
788
 
769
- export { APP_COLORS, type ApiErrorBody, type ApiErrorCode, type ApiKeyRecord, type ApiResponse, type AppCreatedRecord, type AppEncryptedKey, type AppKeyUpsertBody, type AppPermission, type AppPersonRecord, type AppRecord, type AppTeamAccess, type Appearance, type AppsQuery, type ClaimantKeyCheck, type ClientToServerEvents, DEFAULT_ACCENT, DEFAULT_API_ENDPOINT, DEFAULT_PUSH_THRESHOLD, type DeviceLinkApproveBody, type DeviceLinkCreateBody, type DeviceLinkCreatedRecord, type DeviceLinkPlatform, type DeviceLinkRecord, type DeviceLinkStatus, type FlagRecord, type FlagsQuery, type GuestRecord, type HolderKeyCheck, type InvitationRecord, type KeyCheckResult, type KeyHolder, type KeyPin, LOG_KEY_VERSION, type LogContext, type LogData, type LogDeliveryOutcome, type LogEncrypted, type LogIngestBody, LogLevel, type LogLevelName, type LogPayload, type LogRecord, type LogTimeseriesQuery, type LogsQuery, type NoteEncrypted, type NoteRecord, type NotesQuery, type NotificationPreference, type NotificationPreferences, PUSH_OFF, type PendingAppKey, type PendingDeviceLink, type PushData, type PushThreshold, type PushToken, type PushType, type ResponseMetadata, type ServerToClientEvents, type SocketAppPayload, SubscriptionLevel, type SubscriptionLevelName, type SubscriptionLimits, type SubscriptionPlan, type SubscriptionPlanRecord, type TeamMemberRecord, type TeamRecord, type TeamsQuery, type TimeseriesBucket, type TimeseriesResponse, type UserRecord, apiErrorCodeOf, apiErrorCodes, buildLogPayload, isApiErrorCode, isValidAppearance, isValidColor, isValidDeviceLinkStatus, isValidImageUrl, isValidLogLevel, isValidSubscriptionLevel, isValidTeamMemberRole, joinApiKey, logDelivery, logDeliveryOutcome, logLevelColors, logLevelNameToLevel, logLevelToName, logLevels, logRetryDelayMs, nameColor, normalizePushThreshold, parsePushData, personColor, resolveAppColor, splitApiKey, subscriptionLevelToName, subscriptionLevels, subscriptionLimits, subscriptionPlans };
789
+ export { APP_COLORS, type ApiErrorBody, type ApiErrorCode, type ApiKeyRecord, type ApiResponse, type AppCreatedRecord, type AppEncryptedKey, type AppKeyUpsertBody, type AppPermission, type AppPersonRecord, type AppRecord, type AppTeamAccess, type Appearance, type AppsQuery, type ClaimantKeyCheck, type ClientToServerEvents, DEFAULT_ACCENT, DEFAULT_API_ENDPOINT, DEFAULT_PUSH_THRESHOLD, DEFAULT_TIME_FORMAT, type DeviceLinkApproveBody, type DeviceLinkCreateBody, type DeviceLinkCreatedRecord, type DeviceLinkPlatform, type DeviceLinkRecord, type DeviceLinkStatus, type FlagRecord, type FlagsQuery, type GuestRecord, type HolderKeyCheck, type InvitationRecord, type KeyCheckResult, type KeyHolder, type KeyPin, LOG_KEY_VERSION, type LogContext, type LogData, type LogDeliveryOutcome, type LogEncrypted, type LogIngestBody, LogLevel, type LogLevelName, type LogPayload, type LogRecord, type LogTimeseriesQuery, type LogsQuery, type NoteEncrypted, type NoteRecord, type NotesQuery, type NotificationPreference, type NotificationPreferences, PUSH_OFF, type PendingAppKey, type PendingDeviceLink, type PushData, type PushThreshold, type PushToken, type PushType, type ResponseMetadata, type ServerToClientEvents, type SocketAppPayload, SubscriptionLevel, type SubscriptionLevelName, type SubscriptionLimits, type SubscriptionPlan, type SubscriptionPlanRecord, type TeamMemberRecord, type TeamRecord, type TeamsQuery, type TimeClock, type TimeFormat, type TimeZoneChoice, type TimeseriesBucket, type TimeseriesResponse, type UserRecord, apiErrorCodeOf, apiErrorCodes, buildLogPayload, isApiErrorCode, isValidAppearance, isValidColor, isValidDeviceLinkStatus, isValidImageUrl, isValidLogLevel, isValidSubscriptionLevel, isValidTeamMemberRole, isValidTimeFormat, joinApiKey, logDelivery, logDeliveryOutcome, logLevelColors, logLevelNameToLevel, logLevelToName, logLevels, logRetryDelayMs, nameColor, normalizePushThreshold, normalizeTimeFormat, parsePushData, personColor, resolveAppColor, splitApiKey, subscriptionLevelToName, subscriptionLevels, subscriptionLimits, subscriptionPlans };
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __export(index_exports, {
24
24
  DEFAULT_ACCENT: () => DEFAULT_ACCENT,
25
25
  DEFAULT_API_ENDPOINT: () => DEFAULT_API_ENDPOINT,
26
26
  DEFAULT_PUSH_THRESHOLD: () => DEFAULT_PUSH_THRESHOLD,
27
+ DEFAULT_TIME_FORMAT: () => DEFAULT_TIME_FORMAT,
27
28
  LOG_KEY_VERSION: () => LOG_KEY_VERSION,
28
29
  LogLevel: () => LogLevel,
29
30
  PUSH_OFF: () => PUSH_OFF,
@@ -39,6 +40,7 @@ __export(index_exports, {
39
40
  isValidLogLevel: () => isValidLogLevel,
40
41
  isValidSubscriptionLevel: () => isValidSubscriptionLevel,
41
42
  isValidTeamMemberRole: () => isValidTeamMemberRole,
43
+ isValidTimeFormat: () => isValidTimeFormat,
42
44
  joinApiKey: () => joinApiKey,
43
45
  logDelivery: () => logDelivery,
44
46
  logDeliveryOutcome: () => logDeliveryOutcome,
@@ -49,6 +51,7 @@ __export(index_exports, {
49
51
  logRetryDelayMs: () => logRetryDelayMs,
50
52
  nameColor: () => nameColor,
51
53
  normalizePushThreshold: () => normalizePushThreshold,
54
+ normalizeTimeFormat: () => normalizeTimeFormat,
52
55
  parsePushData: () => parsePushData,
53
56
  personColor: () => personColor,
54
57
  resolveAppColor: () => resolveAppColor,
@@ -127,6 +130,7 @@ var logDelivery = {
127
130
  // src/constants/notifications.ts
128
131
  var PUSH_OFF = 5;
129
132
  var DEFAULT_PUSH_THRESHOLD = 2 /* Warn */;
133
+ var DEFAULT_TIME_FORMAT = { clock: "24h", zone: "local" };
130
134
 
131
135
  // src/constants/subscription.ts
132
136
  var SubscriptionLevel = /* @__PURE__ */ ((SubscriptionLevel3) => {
@@ -185,6 +189,17 @@ var logRetryDelayMs = (failedAttempts) => Math.min(logDelivery.baseDelayMs * 2 *
185
189
  // src/utils/index.ts
186
190
  var appearanceValues = ["system", "dark", "light"];
187
191
  var isValidAppearance = (value) => appearanceValues.includes(value);
192
+ var timeClocks = ["24h", "12h"];
193
+ var timeZoneChoices = ["local", "utc"];
194
+ var isValidTimeFormat = (value) => {
195
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
196
+ const { clock, zone, ...rest } = value;
197
+ return timeClocks.includes(clock) && timeZoneChoices.includes(zone) && Object.keys(rest).length === 0;
198
+ };
199
+ var normalizeTimeFormat = (value) => {
200
+ const { clock, zone } = value && typeof value === "object" ? value : {};
201
+ return { clock: timeClocks.includes(clock) ? clock : DEFAULT_TIME_FORMAT.clock, zone: timeZoneChoices.includes(zone) ? zone : DEFAULT_TIME_FORMAT.zone };
202
+ };
188
203
  var isValidColor = (value) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(value);
189
204
  var hashName = (name) => {
190
205
  let hash = 2166136261;
@@ -259,6 +274,7 @@ var parsePushData = (data) => {
259
274
  DEFAULT_ACCENT,
260
275
  DEFAULT_API_ENDPOINT,
261
276
  DEFAULT_PUSH_THRESHOLD,
277
+ DEFAULT_TIME_FORMAT,
262
278
  LOG_KEY_VERSION,
263
279
  LogLevel,
264
280
  PUSH_OFF,
@@ -274,6 +290,7 @@ var parsePushData = (data) => {
274
290
  isValidLogLevel,
275
291
  isValidSubscriptionLevel,
276
292
  isValidTeamMemberRole,
293
+ isValidTimeFormat,
277
294
  joinApiKey,
278
295
  logDelivery,
279
296
  logDeliveryOutcome,
@@ -284,6 +301,7 @@ var parsePushData = (data) => {
284
301
  logRetryDelayMs,
285
302
  nameColor,
286
303
  normalizePushThreshold,
304
+ normalizeTimeFormat,
287
305
  parsePushData,
288
306
  personColor,
289
307
  resolveAppColor,
package/dist/index.mjs CHANGED
@@ -65,6 +65,7 @@ var logDelivery = {
65
65
  // src/constants/notifications.ts
66
66
  var PUSH_OFF = 5;
67
67
  var DEFAULT_PUSH_THRESHOLD = 2 /* Warn */;
68
+ var DEFAULT_TIME_FORMAT = { clock: "24h", zone: "local" };
68
69
 
69
70
  // src/constants/subscription.ts
70
71
  var SubscriptionLevel = /* @__PURE__ */ ((SubscriptionLevel3) => {
@@ -123,6 +124,17 @@ var logRetryDelayMs = (failedAttempts) => Math.min(logDelivery.baseDelayMs * 2 *
123
124
  // src/utils/index.ts
124
125
  var appearanceValues = ["system", "dark", "light"];
125
126
  var isValidAppearance = (value) => appearanceValues.includes(value);
127
+ var timeClocks = ["24h", "12h"];
128
+ var timeZoneChoices = ["local", "utc"];
129
+ var isValidTimeFormat = (value) => {
130
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
131
+ const { clock, zone, ...rest } = value;
132
+ return timeClocks.includes(clock) && timeZoneChoices.includes(zone) && Object.keys(rest).length === 0;
133
+ };
134
+ var normalizeTimeFormat = (value) => {
135
+ const { clock, zone } = value && typeof value === "object" ? value : {};
136
+ return { clock: timeClocks.includes(clock) ? clock : DEFAULT_TIME_FORMAT.clock, zone: timeZoneChoices.includes(zone) ? zone : DEFAULT_TIME_FORMAT.zone };
137
+ };
126
138
  var isValidColor = (value) => /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(value);
127
139
  var hashName = (name) => {
128
140
  let hash = 2166136261;
@@ -196,6 +208,7 @@ export {
196
208
  DEFAULT_ACCENT,
197
209
  DEFAULT_API_ENDPOINT,
198
210
  DEFAULT_PUSH_THRESHOLD,
211
+ DEFAULT_TIME_FORMAT,
199
212
  LOG_KEY_VERSION,
200
213
  LogLevel,
201
214
  PUSH_OFF,
@@ -211,6 +224,7 @@ export {
211
224
  isValidLogLevel,
212
225
  isValidSubscriptionLevel,
213
226
  isValidTeamMemberRole,
227
+ isValidTimeFormat,
214
228
  joinApiKey,
215
229
  logDelivery,
216
230
  logDeliveryOutcome,
@@ -221,6 +235,7 @@ export {
221
235
  logRetryDelayMs,
222
236
  nameColor,
223
237
  normalizePushThreshold,
238
+ normalizeTimeFormat,
224
239
  parsePushData,
225
240
  personColor,
226
241
  resolveAppColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitetoken/lumber-kit",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Shared TypeScript types and wire format contracts for the Lumber cloud logging suite",
5
5
  "keywords": [
6
6
  "lumber",