@infinitetoken/lumber-kit 0.8.0 → 1.0.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/README.md CHANGED
@@ -36,6 +36,7 @@ import { LogLevel, LogRecord, LogEncrypted, LogPayload, LogsQuery } from '@infin
36
36
  | `SubscriptionLevel` | `const enum` | Team tier: Hobby=0 Dev=1 Pro=2 Enterprise=3 |
37
37
  | `subscriptionLevelToName` | object | Maps `SubscriptionLevel` to `'hobby' \| 'dev' \| 'pro' \| 'enterprise'` |
38
38
  | `subscriptionLimits` | object | Per-tier limits (apps, seats, apiKeys, logRetentionDays, etc.) |
39
+ | `monthlyLogsCap` | object | Past `monthlyLogs`: the lowest level still taken (ERROR) and the hard stop's multiple (2), where every log is refused |
39
40
  | `isValidSubscriptionLevel` | function | Type guard for `SubscriptionLevel` values |
40
41
 
41
42
  ### Plans
@@ -140,6 +141,7 @@ A plugin sends only the token to the API (`Authorization: Bearer <token>`) and e
140
141
  | `buildLogPayload` | function | The `LogPayload` a log call encrypts, from its level, message, data and the plugin's automatic context |
141
142
  | `DEFAULT_API_ENDPOINT` | constant | `https://api.lumber.infinitetoken.com` |
142
143
  | `LOG_KEY_VERSION` | constant | `LogEncrypted`'s `keyVersion` (1) |
144
+ | `MAX_LOG_PAYLOAD_LENGTH` | constant | The longest `encrypted.payload` `POST /logs` takes (16 KB of base64); longer is refused with a 413 |
143
145
  | `logDelivery` | object | Attempts, retry delays and the pause after a 429 |
144
146
  | `logDeliveryOutcome` | function | `sent`, `retry`, `drop` or `pause` for a `POST /logs` status (null for a network error) |
145
147
  | `logRetryDelayMs` | function | The wait after a log's nth failed attempt: 1s, 2s, 4s, up to 30s |
@@ -388,7 +388,14 @@
388
388
  "string",
389
389
  "null"
390
390
  ],
391
- "description": "While the team has sent its plan's monthly logs, when new ones are taken again (the next UTC month); else null."
391
+ "description": "While the team has sent its plan's monthly logs, when every level is taken again (the next UTC month); else null. Until then only ERROR and FATAL are taken (monthlyLogsCap)."
392
+ },
393
+ "logsStoppedUntil": {
394
+ "type": [
395
+ "string",
396
+ "null"
397
+ ],
398
+ "description": "While the team is at its hard stop (twice its plan's monthly logs, monthlyLogsCap), when any log is taken again (the next UTC month); else null. Set only alongside logsCappedUntil."
392
399
  }
393
400
  },
394
401
  "required": [
@@ -447,7 +454,14 @@
447
454
  "string",
448
455
  "null"
449
456
  ],
450
- "description": "While the team has sent its plan's monthly logs, when new ones are taken again (the next UTC month); else null."
457
+ "description": "While the team has sent its plan's monthly logs, when every level is taken again (the next UTC month); else null. Until then only ERROR and FATAL are taken (monthlyLogsCap)."
458
+ },
459
+ "logsStoppedUntil": {
460
+ "type": [
461
+ "string",
462
+ "null"
463
+ ],
464
+ "description": "While the team is at its hard stop (twice its plan's monthly logs, monthlyLogsCap), when any log is taken again (the next UTC month); else null. Set only alongside logsCappedUntil."
451
465
  },
452
466
  "apiKey": {
453
467
  "type": "string"
@@ -1631,8 +1645,13 @@
1631
1645
  "count": {
1632
1646
  "type": "number"
1633
1647
  },
1634
- "hiddenCount": {
1635
- "type": "number"
1648
+ "dropped": {
1649
+ "type": "number",
1650
+ "description": "POST /logs past the team's monthly logs: how many logs it dropped (1), below ERROR (monthlyLogsCap)."
1651
+ },
1652
+ "cappedUntil": {
1653
+ "type": "string",
1654
+ "description": "With `dropped`: when every level is taken again (the next UTC month), an ISO time."
1636
1655
  }
1637
1656
  },
1638
1657
  "required": [
package/dist/index.d.mts CHANGED
@@ -22,8 +22,10 @@ declare const LOG_KEY_VERSION = 1;
22
22
  /**
23
23
  * How a plugin delivers logs: one POST /logs per log, in the order they were logged. A network error or a 5xx is a
24
24
  * failed attempt, tried again after `baseDelayMs`, doubling up to `maxDelayMs`, and dropped after `maxAttempts`. Any
25
- * other 4xx is dropped at once, since sending it again won't help. A 429 (the team's logs for the month are used up)
26
- * drops what's queued and every new log until its Retry-After, or for `pauseMs` when it has none.
25
+ * other 4xx (a 413 for a log over MAX_LOG_PAYLOAD_LENGTH among them) is dropped at once, since sending it again won't
26
+ * help. Any 2xx is sent, including the 200 the API answers when it drops a log below ERROR past the team's monthly
27
+ * logs (monthlyLogsCap). A 429 (the team is at its hard stop, twice its plan's monthly logs) drops what's queued and
28
+ * every new log until its Retry-After, or for `pauseMs` when it has none.
27
29
  */
28
30
  declare const logDelivery: {
29
31
  readonly maxAttempts: 5;
@@ -31,6 +33,12 @@ declare const logDelivery: {
31
33
  readonly maxDelayMs: 30000;
32
34
  readonly pauseMs: number;
33
35
  };
36
+ /**
37
+ * The longest `encrypted.payload` POST /logs takes, in characters: 16 KB of base64, about 12 KB of log as written (its
38
+ * message, context and metadata). A longer one is refused with a 413, which a plugin drops at once with a warning
39
+ * (Jay, 2026-11-13). The server can only measure the ciphertext.
40
+ */
41
+ declare const MAX_LOG_PAYLOAD_LENGTH: number;
34
42
 
35
43
  /** Log severity level. Numeric values match the existing Lumber-API level field. */
36
44
  declare const enum LogLevel {
@@ -135,8 +143,16 @@ interface AppRecord {
135
143
  teamAccess?: AppTeamAccess;
136
144
  /** How many days of its logs the app's team's plan keeps, null for no limit (and when missing). */
137
145
  retentionDays?: number | null;
138
- /** While the team has sent its plan's monthly logs, when new ones are taken again (the next UTC month); else null. */
146
+ /**
147
+ * While the team has sent its plan's monthly logs, when every level is taken again (the next UTC month); else null.
148
+ * Until then only ERROR and FATAL are taken (monthlyLogsCap).
149
+ */
139
150
  logsCappedUntil?: string | null;
151
+ /**
152
+ * While the team is at its hard stop (twice its plan's monthly logs, monthlyLogsCap), when any log is taken again
153
+ * (the next UTC month); else null. Set only alongside logsCappedUntil.
154
+ */
155
+ logsStoppedUntil?: string | null;
140
156
  }
141
157
  /**
142
158
  * App creation response.
@@ -546,7 +562,10 @@ interface ResponseMetadata {
546
562
  cursor?: string | null;
547
563
  hasMore?: boolean;
548
564
  count?: number;
549
- hiddenCount?: number;
565
+ /** POST /logs past the team's monthly logs: how many logs it dropped (1), below ERROR (monthlyLogsCap). */
566
+ dropped?: number;
567
+ /** With `dropped`: when every level is taken again (the next UTC month), an ISO time. */
568
+ cappedUntil?: string;
550
569
  }
551
570
  interface ApiResponse<T> {
552
571
  data: T;
@@ -717,6 +736,18 @@ type SubscriptionLimits = {
717
736
  };
718
737
  /** Per-level resource limits. Use Infinity to mean unlimited or disabled. */
719
738
  declare const subscriptionLimits: Record<SubscriptionLevel, SubscriptionLimits>;
739
+ /**
740
+ * What happens past a team's monthly logs (Jay, 2026-11-13: errors always get through). Past its plan's monthlyLogs,
741
+ * POST /logs still takes ERROR and FATAL and drops lower levels, answering a dropped log 200 with `metadata.dropped`
742
+ * so a plugin carries on, until `hardStopMultiple` times monthlyLogs, when it refuses every log with a 429 until the
743
+ * next UTC month. Only the logs it takes count in usage, so the hard stop measures what every device holds.
744
+ */
745
+ declare const monthlyLogsCap: {
746
+ /** The lowest level still taken past the cap. */
747
+ readonly minLevelPastCap: LogLevel.Error;
748
+ /** Where every log is refused, as a multiple of the plan's monthlyLogs. */
749
+ readonly hardStopMultiple: 2;
750
+ };
720
751
  type SubscriptionPlan = {
721
752
  /** Display name, as every surface shows it. */
722
753
  name: string;
@@ -735,8 +766,9 @@ declare const subscriptionPlans: Record<SubscriptionLevel, SubscriptionPlan>;
735
766
  */
736
767
  declare const buildLogPayload: (level: LogLevel, message: string, data?: LogData, autoContext?: Record<string, unknown>) => LogPayload;
737
768
  /**
738
- * What to do with a log once POST /logs answers with `status`, or null for no answer (a network error): sent on a 2xx,
739
- * pause on a 429, drop on any other 4xx, and retry on anything else.
769
+ * What to do with a log once POST /logs answers with `status`, or null for no answer (a network error): sent on a 2xx
770
+ * (the API's 200 for a log it dropped past the monthly cap too), pause on a 429, drop on any other 4xx, and retry on
771
+ * anything else.
740
772
  */
741
773
  declare const logDeliveryOutcome: (status: number | null) => LogDeliveryOutcome;
742
774
  /** How long to wait before trying a log again after its `failedAttempts`th failure: 1s, 2s, 4s and so on, up to 30s. */
@@ -786,4 +818,5 @@ declare const apiErrorCodeOf: (body: unknown) => ApiErrorCode | null;
786
818
  /** A push notification's data as PushData, or null for data no Lumber push sends. */
787
819
  declare const parsePushData: (data: unknown) => PushData | null;
788
820
 
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 };
821
+ export { APP_COLORS, DEFAULT_ACCENT, DEFAULT_API_ENDPOINT, DEFAULT_PUSH_THRESHOLD, DEFAULT_TIME_FORMAT, LOG_KEY_VERSION, LogLevel, MAX_LOG_PAYLOAD_LENGTH, PUSH_OFF, SubscriptionLevel, apiErrorCodeOf, apiErrorCodes, buildLogPayload, isApiErrorCode, isValidAppearance, isValidColor, isValidDeviceLinkStatus, isValidImageUrl, isValidLogLevel, isValidSubscriptionLevel, isValidTeamMemberRole, isValidTimeFormat, joinApiKey, logDelivery, logDeliveryOutcome, logLevelColors, logLevelNameToLevel, logLevelToName, logLevels, logRetryDelayMs, monthlyLogsCap, nameColor, normalizePushThreshold, normalizeTimeFormat, parsePushData, personColor, resolveAppColor, splitApiKey, subscriptionLevelToName, subscriptionLevels, subscriptionLimits, subscriptionPlans };
822
+ export type { ApiErrorBody, ApiErrorCode, ApiKeyRecord, ApiResponse, AppCreatedRecord, AppEncryptedKey, AppKeyUpsertBody, AppPermission, AppPersonRecord, AppRecord, AppTeamAccess, Appearance, AppsQuery, ClaimantKeyCheck, ClientToServerEvents, DeviceLinkApproveBody, DeviceLinkCreateBody, DeviceLinkCreatedRecord, DeviceLinkPlatform, DeviceLinkRecord, DeviceLinkStatus, FlagRecord, FlagsQuery, GuestRecord, HolderKeyCheck, InvitationRecord, KeyCheckResult, KeyHolder, KeyPin, LogContext, LogData, LogDeliveryOutcome, LogEncrypted, LogIngestBody, LogLevelName, LogPayload, LogRecord, LogTimeseriesQuery, LogsQuery, NoteEncrypted, NoteRecord, NotesQuery, NotificationPreference, NotificationPreferences, PendingAppKey, PendingDeviceLink, PushData, PushThreshold, PushToken, PushType, ResponseMetadata, ServerToClientEvents, SocketAppPayload, SubscriptionLevelName, SubscriptionLimits, SubscriptionPlan, SubscriptionPlanRecord, TeamMemberRecord, TeamRecord, TeamsQuery, TimeClock, TimeFormat, TimeZoneChoice, TimeseriesBucket, TimeseriesResponse, UserRecord };
package/dist/index.d.ts CHANGED
@@ -22,8 +22,10 @@ declare const LOG_KEY_VERSION = 1;
22
22
  /**
23
23
  * How a plugin delivers logs: one POST /logs per log, in the order they were logged. A network error or a 5xx is a
24
24
  * failed attempt, tried again after `baseDelayMs`, doubling up to `maxDelayMs`, and dropped after `maxAttempts`. Any
25
- * other 4xx is dropped at once, since sending it again won't help. A 429 (the team's logs for the month are used up)
26
- * drops what's queued and every new log until its Retry-After, or for `pauseMs` when it has none.
25
+ * other 4xx (a 413 for a log over MAX_LOG_PAYLOAD_LENGTH among them) is dropped at once, since sending it again won't
26
+ * help. Any 2xx is sent, including the 200 the API answers when it drops a log below ERROR past the team's monthly
27
+ * logs (monthlyLogsCap). A 429 (the team is at its hard stop, twice its plan's monthly logs) drops what's queued and
28
+ * every new log until its Retry-After, or for `pauseMs` when it has none.
27
29
  */
28
30
  declare const logDelivery: {
29
31
  readonly maxAttempts: 5;
@@ -31,6 +33,12 @@ declare const logDelivery: {
31
33
  readonly maxDelayMs: 30000;
32
34
  readonly pauseMs: number;
33
35
  };
36
+ /**
37
+ * The longest `encrypted.payload` POST /logs takes, in characters: 16 KB of base64, about 12 KB of log as written (its
38
+ * message, context and metadata). A longer one is refused with a 413, which a plugin drops at once with a warning
39
+ * (Jay, 2026-11-13). The server can only measure the ciphertext.
40
+ */
41
+ declare const MAX_LOG_PAYLOAD_LENGTH: number;
34
42
 
35
43
  /** Log severity level. Numeric values match the existing Lumber-API level field. */
36
44
  declare const enum LogLevel {
@@ -135,8 +143,16 @@ interface AppRecord {
135
143
  teamAccess?: AppTeamAccess;
136
144
  /** How many days of its logs the app's team's plan keeps, null for no limit (and when missing). */
137
145
  retentionDays?: number | null;
138
- /** While the team has sent its plan's monthly logs, when new ones are taken again (the next UTC month); else null. */
146
+ /**
147
+ * While the team has sent its plan's monthly logs, when every level is taken again (the next UTC month); else null.
148
+ * Until then only ERROR and FATAL are taken (monthlyLogsCap).
149
+ */
139
150
  logsCappedUntil?: string | null;
151
+ /**
152
+ * While the team is at its hard stop (twice its plan's monthly logs, monthlyLogsCap), when any log is taken again
153
+ * (the next UTC month); else null. Set only alongside logsCappedUntil.
154
+ */
155
+ logsStoppedUntil?: string | null;
140
156
  }
141
157
  /**
142
158
  * App creation response.
@@ -546,7 +562,10 @@ interface ResponseMetadata {
546
562
  cursor?: string | null;
547
563
  hasMore?: boolean;
548
564
  count?: number;
549
- hiddenCount?: number;
565
+ /** POST /logs past the team's monthly logs: how many logs it dropped (1), below ERROR (monthlyLogsCap). */
566
+ dropped?: number;
567
+ /** With `dropped`: when every level is taken again (the next UTC month), an ISO time. */
568
+ cappedUntil?: string;
550
569
  }
551
570
  interface ApiResponse<T> {
552
571
  data: T;
@@ -717,6 +736,18 @@ type SubscriptionLimits = {
717
736
  };
718
737
  /** Per-level resource limits. Use Infinity to mean unlimited or disabled. */
719
738
  declare const subscriptionLimits: Record<SubscriptionLevel, SubscriptionLimits>;
739
+ /**
740
+ * What happens past a team's monthly logs (Jay, 2026-11-13: errors always get through). Past its plan's monthlyLogs,
741
+ * POST /logs still takes ERROR and FATAL and drops lower levels, answering a dropped log 200 with `metadata.dropped`
742
+ * so a plugin carries on, until `hardStopMultiple` times monthlyLogs, when it refuses every log with a 429 until the
743
+ * next UTC month. Only the logs it takes count in usage, so the hard stop measures what every device holds.
744
+ */
745
+ declare const monthlyLogsCap: {
746
+ /** The lowest level still taken past the cap. */
747
+ readonly minLevelPastCap: LogLevel.Error;
748
+ /** Where every log is refused, as a multiple of the plan's monthlyLogs. */
749
+ readonly hardStopMultiple: 2;
750
+ };
720
751
  type SubscriptionPlan = {
721
752
  /** Display name, as every surface shows it. */
722
753
  name: string;
@@ -735,8 +766,9 @@ declare const subscriptionPlans: Record<SubscriptionLevel, SubscriptionPlan>;
735
766
  */
736
767
  declare const buildLogPayload: (level: LogLevel, message: string, data?: LogData, autoContext?: Record<string, unknown>) => LogPayload;
737
768
  /**
738
- * What to do with a log once POST /logs answers with `status`, or null for no answer (a network error): sent on a 2xx,
739
- * pause on a 429, drop on any other 4xx, and retry on anything else.
769
+ * What to do with a log once POST /logs answers with `status`, or null for no answer (a network error): sent on a 2xx
770
+ * (the API's 200 for a log it dropped past the monthly cap too), pause on a 429, drop on any other 4xx, and retry on
771
+ * anything else.
740
772
  */
741
773
  declare const logDeliveryOutcome: (status: number | null) => LogDeliveryOutcome;
742
774
  /** How long to wait before trying a log again after its `failedAttempts`th failure: 1s, 2s, 4s and so on, up to 30s. */
@@ -786,4 +818,5 @@ declare const apiErrorCodeOf: (body: unknown) => ApiErrorCode | null;
786
818
  /** A push notification's data as PushData, or null for data no Lumber push sends. */
787
819
  declare const parsePushData: (data: unknown) => PushData | null;
788
820
 
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 };
821
+ export { APP_COLORS, DEFAULT_ACCENT, DEFAULT_API_ENDPOINT, DEFAULT_PUSH_THRESHOLD, DEFAULT_TIME_FORMAT, LOG_KEY_VERSION, LogLevel, MAX_LOG_PAYLOAD_LENGTH, PUSH_OFF, SubscriptionLevel, apiErrorCodeOf, apiErrorCodes, buildLogPayload, isApiErrorCode, isValidAppearance, isValidColor, isValidDeviceLinkStatus, isValidImageUrl, isValidLogLevel, isValidSubscriptionLevel, isValidTeamMemberRole, isValidTimeFormat, joinApiKey, logDelivery, logDeliveryOutcome, logLevelColors, logLevelNameToLevel, logLevelToName, logLevels, logRetryDelayMs, monthlyLogsCap, nameColor, normalizePushThreshold, normalizeTimeFormat, parsePushData, personColor, resolveAppColor, splitApiKey, subscriptionLevelToName, subscriptionLevels, subscriptionLimits, subscriptionPlans };
822
+ export type { ApiErrorBody, ApiErrorCode, ApiKeyRecord, ApiResponse, AppCreatedRecord, AppEncryptedKey, AppKeyUpsertBody, AppPermission, AppPersonRecord, AppRecord, AppTeamAccess, Appearance, AppsQuery, ClaimantKeyCheck, ClientToServerEvents, DeviceLinkApproveBody, DeviceLinkCreateBody, DeviceLinkCreatedRecord, DeviceLinkPlatform, DeviceLinkRecord, DeviceLinkStatus, FlagRecord, FlagsQuery, GuestRecord, HolderKeyCheck, InvitationRecord, KeyCheckResult, KeyHolder, KeyPin, LogContext, LogData, LogDeliveryOutcome, LogEncrypted, LogIngestBody, LogLevelName, LogPayload, LogRecord, LogTimeseriesQuery, LogsQuery, NoteEncrypted, NoteRecord, NotesQuery, NotificationPreference, NotificationPreferences, PendingAppKey, PendingDeviceLink, PushData, PushThreshold, PushToken, PushType, ResponseMetadata, ServerToClientEvents, SocketAppPayload, SubscriptionLevelName, SubscriptionLimits, SubscriptionPlan, SubscriptionPlanRecord, TeamMemberRecord, TeamRecord, TeamsQuery, TimeClock, TimeFormat, TimeZoneChoice, TimeseriesBucket, TimeseriesResponse, UserRecord };
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __export(index_exports, {
27
27
  DEFAULT_TIME_FORMAT: () => DEFAULT_TIME_FORMAT,
28
28
  LOG_KEY_VERSION: () => LOG_KEY_VERSION,
29
29
  LogLevel: () => LogLevel,
30
+ MAX_LOG_PAYLOAD_LENGTH: () => MAX_LOG_PAYLOAD_LENGTH,
30
31
  PUSH_OFF: () => PUSH_OFF,
31
32
  SubscriptionLevel: () => SubscriptionLevel,
32
33
  apiErrorCodeOf: () => apiErrorCodeOf,
@@ -49,6 +50,7 @@ __export(index_exports, {
49
50
  logLevelToName: () => logLevelToName,
50
51
  logLevels: () => logLevels,
51
52
  logRetryDelayMs: () => logRetryDelayMs,
53
+ monthlyLogsCap: () => monthlyLogsCap,
52
54
  nameColor: () => nameColor,
53
55
  normalizePushThreshold: () => normalizePushThreshold,
54
56
  normalizeTimeFormat: () => normalizeTimeFormat,
@@ -126,6 +128,7 @@ var logDelivery = {
126
128
  maxDelayMs: 3e4,
127
129
  pauseMs: 60 * 60 * 1e3
128
130
  };
131
+ var MAX_LOG_PAYLOAD_LENGTH = 16 * 1024;
129
132
 
130
133
  // src/constants/notifications.ts
131
134
  var PUSH_OFF = 5;
@@ -148,11 +151,17 @@ var subscriptionLevelToName = {
148
151
  };
149
152
  var subscriptionLevels = [0 /* Hobby */, 1 /* Dev */, 2 /* Pro */, 3 /* Enterprise */];
150
153
  var subscriptionLimits = {
151
- [0 /* Hobby */]: { apps: 5, seats: 1, apiKeys: 1, logRetentionDays: 7, monthlyLogs: 1e4, realtimeLogs: false, minPushLevel: Infinity },
152
- [1 /* Dev */]: { apps: 10, seats: 5, apiKeys: 5, logRetentionDays: 30, monthlyLogs: 25e4, realtimeLogs: true, minPushLevel: 3 /* Error */ },
154
+ [0 /* Hobby */]: { apps: 5, seats: 1, apiKeys: 1, logRetentionDays: 7, monthlyLogs: 1e5, realtimeLogs: false, minPushLevel: 4 /* Fatal */ },
155
+ [1 /* Dev */]: { apps: 10, seats: 5, apiKeys: 5, logRetentionDays: 30, monthlyLogs: 5e5, realtimeLogs: true, minPushLevel: 3 /* Error */ },
153
156
  [2 /* Pro */]: { apps: 20, seats: 20, apiKeys: 15, logRetentionDays: 90, monthlyLogs: 2e6, realtimeLogs: true, minPushLevel: 2 /* Warn */ },
154
157
  [3 /* Enterprise */]: { apps: Infinity, seats: Infinity, apiKeys: Infinity, logRetentionDays: Infinity, monthlyLogs: Infinity, realtimeLogs: true, minPushLevel: 0 /* Debug */ }
155
158
  };
159
+ var monthlyLogsCap = {
160
+ /** The lowest level still taken past the cap. */
161
+ minLevelPastCap: 3 /* Error */,
162
+ /** Where every log is refused, as a multiple of the plan's monthlyLogs. */
163
+ hardStopMultiple: 2
164
+ };
156
165
  var subscriptionPlans = {
157
166
  [0 /* Hobby */]: { name: "Hobby", monthlyPrice: 0 },
158
167
  [1 /* Dev */]: { name: "Dev", monthlyPrice: 9 },
@@ -277,6 +286,7 @@ var parsePushData = (data) => {
277
286
  DEFAULT_TIME_FORMAT,
278
287
  LOG_KEY_VERSION,
279
288
  LogLevel,
289
+ MAX_LOG_PAYLOAD_LENGTH,
280
290
  PUSH_OFF,
281
291
  SubscriptionLevel,
282
292
  apiErrorCodeOf,
@@ -299,6 +309,7 @@ var parsePushData = (data) => {
299
309
  logLevelToName,
300
310
  logLevels,
301
311
  logRetryDelayMs,
312
+ monthlyLogsCap,
302
313
  nameColor,
303
314
  normalizePushThreshold,
304
315
  normalizeTimeFormat,
package/dist/index.mjs CHANGED
@@ -61,6 +61,7 @@ var logDelivery = {
61
61
  maxDelayMs: 3e4,
62
62
  pauseMs: 60 * 60 * 1e3
63
63
  };
64
+ var MAX_LOG_PAYLOAD_LENGTH = 16 * 1024;
64
65
 
65
66
  // src/constants/notifications.ts
66
67
  var PUSH_OFF = 5;
@@ -83,11 +84,17 @@ var subscriptionLevelToName = {
83
84
  };
84
85
  var subscriptionLevels = [0 /* Hobby */, 1 /* Dev */, 2 /* Pro */, 3 /* Enterprise */];
85
86
  var subscriptionLimits = {
86
- [0 /* Hobby */]: { apps: 5, seats: 1, apiKeys: 1, logRetentionDays: 7, monthlyLogs: 1e4, realtimeLogs: false, minPushLevel: Infinity },
87
- [1 /* Dev */]: { apps: 10, seats: 5, apiKeys: 5, logRetentionDays: 30, monthlyLogs: 25e4, realtimeLogs: true, minPushLevel: 3 /* Error */ },
87
+ [0 /* Hobby */]: { apps: 5, seats: 1, apiKeys: 1, logRetentionDays: 7, monthlyLogs: 1e5, realtimeLogs: false, minPushLevel: 4 /* Fatal */ },
88
+ [1 /* Dev */]: { apps: 10, seats: 5, apiKeys: 5, logRetentionDays: 30, monthlyLogs: 5e5, realtimeLogs: true, minPushLevel: 3 /* Error */ },
88
89
  [2 /* Pro */]: { apps: 20, seats: 20, apiKeys: 15, logRetentionDays: 90, monthlyLogs: 2e6, realtimeLogs: true, minPushLevel: 2 /* Warn */ },
89
90
  [3 /* Enterprise */]: { apps: Infinity, seats: Infinity, apiKeys: Infinity, logRetentionDays: Infinity, monthlyLogs: Infinity, realtimeLogs: true, minPushLevel: 0 /* Debug */ }
90
91
  };
92
+ var monthlyLogsCap = {
93
+ /** The lowest level still taken past the cap. */
94
+ minLevelPastCap: 3 /* Error */,
95
+ /** Where every log is refused, as a multiple of the plan's monthlyLogs. */
96
+ hardStopMultiple: 2
97
+ };
91
98
  var subscriptionPlans = {
92
99
  [0 /* Hobby */]: { name: "Hobby", monthlyPrice: 0 },
93
100
  [1 /* Dev */]: { name: "Dev", monthlyPrice: 9 },
@@ -211,6 +218,7 @@ export {
211
218
  DEFAULT_TIME_FORMAT,
212
219
  LOG_KEY_VERSION,
213
220
  LogLevel,
221
+ MAX_LOG_PAYLOAD_LENGTH,
214
222
  PUSH_OFF,
215
223
  SubscriptionLevel,
216
224
  apiErrorCodeOf,
@@ -233,6 +241,7 @@ export {
233
241
  logLevelToName,
234
242
  logLevels,
235
243
  logRetryDelayMs,
244
+ monthlyLogsCap,
236
245
  nameColor,
237
246
  normalizePushThreshold,
238
247
  normalizeTimeFormat,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitetoken/lumber-kit",
3
- "version": "0.8.0",
3
+ "version": "1.0.0",
4
4
  "description": "Shared TypeScript types and wire format contracts for the Lumber cloud logging suite",
5
5
  "keywords": [
6
6
  "lumber",
@@ -13,6 +13,10 @@
13
13
  "schema",
14
14
  "log-schema"
15
15
  ],
16
+ "homepage": "https://lumber.infinitetoken.com",
17
+ "bugs": {
18
+ "url": "https://github.com/infinitetoken/Lumber-Kit/issues"
19
+ },
16
20
  "repository": {
17
21
  "type": "git",
18
22
  "url": "git+https://github.com/infinitetoken/lumber-kit.git"
@@ -61,15 +65,15 @@
61
65
  "devDependencies": {
62
66
  "@infinitetoken/eslint-config": "^0.2.1",
63
67
  "@infinitetoken/jest-config": "^0.5.2",
64
- "@infinitetoken/tsconfig": "^0.6.0",
68
+ "@infinitetoken/tsconfig": "^0.7.0",
65
69
  "@types/jest": "^30.0.0",
66
- "@types/node": "^25.0.0",
70
+ "@types/node": "^26.6.6",
67
71
  "ajv": "^8.20.0",
68
72
  "eslint": "^10.2.1",
69
73
  "jest": "^30.4.2",
70
74
  "prettier": "^3.8.3",
71
75
  "ts-json-schema-generator": "^2.9.0",
72
- "tsup": "^8.5.1",
76
+ "tsup": "^9.0.0",
73
77
  "typescript": "^6.0.3"
74
78
  },
75
79
  "publishConfig": {