@infinitetoken/lumber-kit 0.3.8 → 0.4.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/cjs/constants/index.d.ts +2 -42
- package/dist/cjs/constants/index.d.ts.map +1 -1
- package/dist/cjs/constants/index.js +16 -53
- package/dist/cjs/constants/logLevel.d.ts +17 -0
- package/dist/cjs/constants/logLevel.d.ts.map +1 -0
- package/dist/cjs/constants/logLevel.js +31 -0
- package/dist/cjs/constants/subscription.d.ts +27 -0
- package/dist/cjs/constants/subscription.d.ts.map +1 -0
- package/dist/cjs/constants/subscription.js +28 -0
- package/dist/cjs/types/app.d.ts +61 -0
- package/dist/cjs/types/app.d.ts.map +1 -0
- package/dist/cjs/types/app.js +2 -0
- package/dist/cjs/types/deviceLink.d.ts +19 -0
- package/dist/cjs/types/deviceLink.d.ts.map +1 -0
- package/dist/cjs/types/deviceLink.js +2 -0
- package/dist/cjs/types/index.d.ts +8 -177
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +22 -0
- package/dist/cjs/types/log.d.ts +57 -0
- package/dist/cjs/types/log.d.ts.map +1 -0
- package/dist/cjs/types/log.js +2 -0
- package/dist/cjs/types/note.d.ts +38 -0
- package/dist/cjs/types/note.d.ts.map +1 -0
- package/dist/cjs/types/note.js +2 -0
- package/dist/cjs/types/response.d.ts +14 -0
- package/dist/cjs/types/response.d.ts.map +1 -0
- package/dist/cjs/types/response.js +2 -0
- package/dist/cjs/types/team.d.ts +34 -0
- package/dist/cjs/types/team.d.ts.map +1 -0
- package/dist/cjs/types/team.js +2 -0
- package/dist/cjs/types/timeseries.d.ts +30 -0
- package/dist/cjs/types/timeseries.d.ts.map +1 -0
- package/dist/cjs/types/timeseries.js +2 -0
- package/dist/cjs/types/user.d.ts +33 -0
- package/dist/cjs/types/user.d.ts.map +1 -0
- package/dist/cjs/types/user.js +2 -0
- package/dist/cjs/utils/index.d.ts +4 -1
- package/dist/cjs/utils/index.d.ts.map +1 -1
- package/dist/cjs/utils/index.js +17 -1
- package/dist/esm/constants/index.d.ts +2 -42
- package/dist/esm/constants/index.d.ts.map +1 -1
- package/dist/esm/constants/index.js +2 -52
- package/dist/esm/constants/logLevel.d.ts +17 -0
- package/dist/esm/constants/logLevel.d.ts.map +1 -0
- package/dist/esm/constants/logLevel.js +28 -0
- package/dist/esm/constants/subscription.d.ts +27 -0
- package/dist/esm/constants/subscription.d.ts.map +1 -0
- package/dist/esm/constants/subscription.js +25 -0
- package/dist/esm/types/app.d.ts +61 -0
- package/dist/esm/types/app.d.ts.map +1 -0
- package/dist/esm/types/app.js +1 -0
- package/dist/esm/types/deviceLink.d.ts +19 -0
- package/dist/esm/types/deviceLink.d.ts.map +1 -0
- package/dist/esm/types/deviceLink.js +1 -0
- package/dist/esm/types/index.d.ts +8 -177
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +8 -1
- package/dist/esm/types/log.d.ts +57 -0
- package/dist/esm/types/log.d.ts.map +1 -0
- package/dist/esm/types/log.js +1 -0
- package/dist/esm/types/note.d.ts +38 -0
- package/dist/esm/types/note.d.ts.map +1 -0
- package/dist/esm/types/note.js +1 -0
- package/dist/esm/types/response.d.ts +14 -0
- package/dist/esm/types/response.d.ts.map +1 -0
- package/dist/esm/types/response.js +1 -0
- package/dist/esm/types/team.d.ts +34 -0
- package/dist/esm/types/team.d.ts.map +1 -0
- package/dist/esm/types/team.js +1 -0
- package/dist/esm/types/timeseries.d.ts +30 -0
- package/dist/esm/types/timeseries.d.ts.map +1 -0
- package/dist/esm/types/timeseries.js +1 -0
- package/dist/esm/types/user.d.ts +33 -0
- package/dist/esm/types/user.d.ts.map +1 -0
- package/dist/esm/types/user.js +1 -0
- package/dist/esm/utils/index.d.ts +4 -1
- package/dist/esm/utils/index.d.ts.map +1 -1
- package/dist/esm/utils/index.js +14 -0
- package/package.json +1 -1
|
@@ -1,178 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
code?: string;
|
|
10
|
-
method?: string;
|
|
11
|
-
line?: number;
|
|
12
|
-
column?: number;
|
|
13
|
-
note?: string;
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Encrypted private container.
|
|
18
|
-
* payload = base64(authTag + ciphertext)
|
|
19
|
-
* nonce = base64(random IV)
|
|
20
|
-
* keyVersion enables future rotation support.
|
|
21
|
-
*/
|
|
22
|
-
export interface LogPrivate {
|
|
23
|
-
payload: string;
|
|
24
|
-
nonce: string;
|
|
25
|
-
keyVersion: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* API response shape for a stored log.
|
|
29
|
-
*/
|
|
30
|
-
export interface LogRecord {
|
|
31
|
-
id: string;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
appId: string;
|
|
35
|
-
requestId?: string;
|
|
36
|
-
traceId?: string;
|
|
37
|
-
level: LogLevel;
|
|
38
|
-
message: string;
|
|
39
|
-
flagged: boolean;
|
|
40
|
-
context?: LogContext;
|
|
41
|
-
metadata?: Record<string, unknown>;
|
|
42
|
-
private?: LogPrivate;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Wrapped application encryption key for a specific user.
|
|
46
|
-
*/
|
|
47
|
-
export interface AppEncryptedKey {
|
|
48
|
-
userId: string;
|
|
49
|
-
encryptedKey: string;
|
|
50
|
-
keyVersion: number;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* API response shape for a listed or fetched app.
|
|
54
|
-
* encryptedKey is the requesting user's wrapped copy of the app key, or null if none exists.
|
|
55
|
-
*/
|
|
56
|
-
export interface AppRecord {
|
|
57
|
-
id: string;
|
|
58
|
-
createdAt: string;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
name: string;
|
|
61
|
-
color?: string;
|
|
62
|
-
logoUrl?: string;
|
|
63
|
-
encryptedKey: string | null;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* App creation response.
|
|
67
|
-
* Initial wrapped encryption key may optionally be returned.
|
|
68
|
-
*/
|
|
69
|
-
export interface AppCreatedRecord extends AppRecord {
|
|
70
|
-
apiKey?: string;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Machine authentication credential.
|
|
74
|
-
*/
|
|
75
|
-
export interface ApiKeyRecord {
|
|
76
|
-
id: string;
|
|
77
|
-
createdAt: string;
|
|
78
|
-
updatedAt: string;
|
|
79
|
-
appId: string;
|
|
80
|
-
name?: string;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* App membership / authorization.
|
|
84
|
-
*/
|
|
85
|
-
export interface MembershipRecord {
|
|
86
|
-
id: string;
|
|
87
|
-
createdAt: string;
|
|
88
|
-
updatedAt: string;
|
|
89
|
-
appId: string;
|
|
90
|
-
userId: string;
|
|
91
|
-
role: 'owner' | 'admin' | 'read' | 'write';
|
|
92
|
-
}
|
|
93
|
-
export interface PushToken {
|
|
94
|
-
token: string;
|
|
95
|
-
deviceId?: string;
|
|
96
|
-
platform?: 'ios' | 'android' | 'web';
|
|
97
|
-
}
|
|
98
|
-
export interface NotificationPreference {
|
|
99
|
-
enabled?: boolean;
|
|
100
|
-
minimumLevel?: number;
|
|
101
|
-
}
|
|
102
|
-
export interface NotificationPreferences {
|
|
103
|
-
enabled?: boolean;
|
|
104
|
-
minimumLevel?: number;
|
|
105
|
-
perApp?: Record<string, NotificationPreference>;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Public user profile returned from API.
|
|
109
|
-
*/
|
|
110
|
-
export interface UserRecord {
|
|
111
|
-
id: string;
|
|
112
|
-
createdAt: string;
|
|
113
|
-
updatedAt: string;
|
|
114
|
-
email: string;
|
|
115
|
-
publicKey?: string;
|
|
116
|
-
appearance?: Appearance;
|
|
117
|
-
color?: string;
|
|
118
|
-
subscriptionLevel: SubscriptionLevel;
|
|
119
|
-
agreedToTermsVersion?: string;
|
|
120
|
-
notificationPreferences: NotificationPreferences;
|
|
121
|
-
pushTokens: PushToken[];
|
|
122
|
-
}
|
|
123
|
-
export interface ResponseMetadata {
|
|
124
|
-
requestId: string;
|
|
125
|
-
durationMs: number;
|
|
126
|
-
warnings?: string[];
|
|
127
|
-
cursor?: string | null;
|
|
128
|
-
hasMore?: boolean;
|
|
129
|
-
count?: number;
|
|
130
|
-
hiddenCount?: number;
|
|
131
|
-
}
|
|
132
|
-
export interface ApiResponse<T> {
|
|
133
|
-
data: T;
|
|
134
|
-
metadata: ResponseMetadata;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Filter params for GET /logs.
|
|
138
|
-
*/
|
|
139
|
-
export interface LogsQuery {
|
|
140
|
-
appIds?: string[];
|
|
141
|
-
levels?: LogLevel[];
|
|
142
|
-
text?: string;
|
|
143
|
-
flagged?: boolean;
|
|
144
|
-
from?: string;
|
|
145
|
-
to?: string;
|
|
146
|
-
sort?: string;
|
|
147
|
-
limit?: number;
|
|
148
|
-
cursor?: string;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Filter params for GET /apps.
|
|
152
|
-
*/
|
|
153
|
-
export interface AppsQuery {
|
|
154
|
-
limit?: number;
|
|
155
|
-
cursor?: string;
|
|
156
|
-
sort?: string;
|
|
157
|
-
from?: string;
|
|
158
|
-
to?: string;
|
|
159
|
-
}
|
|
160
|
-
export type DeviceLinkStatus = 'pending' | 'approved' | 'denied';
|
|
161
|
-
/**
|
|
162
|
-
* Response from POST /device-links.
|
|
163
|
-
*/
|
|
164
|
-
export interface DeviceLinkCreatedRecord {
|
|
165
|
-
id: string;
|
|
166
|
-
expiresAt: string;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Response from GET /device-links/:id.
|
|
170
|
-
* encryptedKey is present only when status is 'approved'.
|
|
171
|
-
*/
|
|
172
|
-
export interface DeviceLinkRecord {
|
|
173
|
-
id: string;
|
|
174
|
-
status: DeviceLinkStatus;
|
|
175
|
-
encryptedKey?: string;
|
|
176
|
-
expiresAt: string;
|
|
177
|
-
}
|
|
1
|
+
export * from './app';
|
|
2
|
+
export * from './deviceLink';
|
|
3
|
+
export * from './log';
|
|
4
|
+
export * from './note';
|
|
5
|
+
export * from './response';
|
|
6
|
+
export * from './team';
|
|
7
|
+
export * from './timeseries';
|
|
8
|
+
export * from './user';
|
|
178
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
|
package/dist/esm/types/index.js
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LogLevel } from '../constants';
|
|
2
|
+
/**
|
|
3
|
+
* Structured log context content.
|
|
4
|
+
*/
|
|
5
|
+
export interface LogContext {
|
|
6
|
+
requestId?: string;
|
|
7
|
+
traceId?: string;
|
|
8
|
+
code?: string;
|
|
9
|
+
method?: string;
|
|
10
|
+
line?: number;
|
|
11
|
+
column?: number;
|
|
12
|
+
note?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Encrypted private container.
|
|
17
|
+
* payload = base64(authTag + ciphertext)
|
|
18
|
+
* nonce = base64(random IV)
|
|
19
|
+
* keyVersion enables future rotation support.
|
|
20
|
+
*/
|
|
21
|
+
export interface LogPrivate {
|
|
22
|
+
payload: string;
|
|
23
|
+
nonce: string;
|
|
24
|
+
keyVersion: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* API response shape for a stored log.
|
|
28
|
+
*/
|
|
29
|
+
export interface LogRecord {
|
|
30
|
+
id: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
appId: string;
|
|
34
|
+
requestId?: string;
|
|
35
|
+
traceId?: string;
|
|
36
|
+
level: LogLevel;
|
|
37
|
+
message: string;
|
|
38
|
+
flagged: boolean;
|
|
39
|
+
context?: LogContext;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
private?: LogPrivate;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Filter params for GET /logs.
|
|
45
|
+
*/
|
|
46
|
+
export interface LogsQuery {
|
|
47
|
+
appIds?: string[];
|
|
48
|
+
levels?: LogLevel[];
|
|
49
|
+
text?: string;
|
|
50
|
+
flagged?: boolean;
|
|
51
|
+
from?: string;
|
|
52
|
+
to?: string;
|
|
53
|
+
sort?: string;
|
|
54
|
+
limit?: number;
|
|
55
|
+
cursor?: string;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/types/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,KAAK,EAAE,QAAQ,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IAEf,OAAO,EAAE,OAAO,CAAA;IAEhB,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAElC,OAAO,CAAC,EAAE,UAAU,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encrypted note content.
|
|
3
|
+
* payload = base64(authTag + ciphertext)
|
|
4
|
+
* nonce = base64(random IV)
|
|
5
|
+
* keyVersion enables future key rotation.
|
|
6
|
+
*/
|
|
7
|
+
export interface NotePrivate {
|
|
8
|
+
payload: string;
|
|
9
|
+
nonce: string;
|
|
10
|
+
keyVersion: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A short user-authored note, encrypted with the app key.
|
|
14
|
+
* Visible to all members of the associated app.
|
|
15
|
+
* Query by teamId in NotesQuery to build a cross-app team feed.
|
|
16
|
+
*/
|
|
17
|
+
export interface NoteRecord {
|
|
18
|
+
id: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
appId: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
private: NotePrivate;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Filter params for GET /notes.
|
|
27
|
+
*/
|
|
28
|
+
export interface NotesQuery {
|
|
29
|
+
appId?: string;
|
|
30
|
+
teamId?: string;
|
|
31
|
+
userId?: string;
|
|
32
|
+
from?: string;
|
|
33
|
+
to?: string;
|
|
34
|
+
sort?: string;
|
|
35
|
+
limit?: number;
|
|
36
|
+
cursor?: string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/types/note.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,EAAE,WAAW,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ResponseMetadata {
|
|
2
|
+
requestId: string;
|
|
3
|
+
durationMs: number;
|
|
4
|
+
warnings?: string[];
|
|
5
|
+
cursor?: string | null;
|
|
6
|
+
hasMore?: boolean;
|
|
7
|
+
count?: number;
|
|
8
|
+
hiddenCount?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiResponse<T> {
|
|
11
|
+
data: T;
|
|
12
|
+
metadata: ResponseMetadata;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/types/response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAA;IACP,QAAQ,EAAE,gBAAgB,CAAA;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SubscriptionLevel } from '../constants';
|
|
2
|
+
/**
|
|
3
|
+
* An organization that owns apps and pays for member usage.
|
|
4
|
+
* Team subscriptionLevel takes precedence over individual member levels.
|
|
5
|
+
*/
|
|
6
|
+
export interface TeamRecord {
|
|
7
|
+
id: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
name: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
imageUrl?: string;
|
|
13
|
+
subscriptionLevel: SubscriptionLevel;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Membership of a user in a team.
|
|
17
|
+
*/
|
|
18
|
+
export interface TeamMemberRecord {
|
|
19
|
+
id: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
teamId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
role: 'owner' | 'admin' | 'member';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Filter params for GET /teams.
|
|
28
|
+
*/
|
|
29
|
+
export interface TeamsQuery {
|
|
30
|
+
limit?: number;
|
|
31
|
+
cursor?: string;
|
|
32
|
+
sort?: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../src/types/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,iBAAiB,CAAA;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IAEd,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single time bucket in a timeseries response.
|
|
3
|
+
* date is an ISO date string (YYYY-MM-DD for 'day', ISO datetime for 'hour').
|
|
4
|
+
* byLevel optionally breaks down the count per LogLevel for severity-tinted rendering.
|
|
5
|
+
*/
|
|
6
|
+
export interface TimeseriesBucket {
|
|
7
|
+
date: string;
|
|
8
|
+
count: number;
|
|
9
|
+
byLevel?: Partial<Record<number, number>>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generic timeseries aggregate response. Reusable across logs, notifications, messages, etc.
|
|
13
|
+
*/
|
|
14
|
+
export interface TimeseriesResponse {
|
|
15
|
+
buckets: TimeseriesBucket[];
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
interval: 'day' | 'hour';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Filter params for GET /logs/timeseries.
|
|
22
|
+
*/
|
|
23
|
+
export interface LogTimeseriesQuery {
|
|
24
|
+
appIds?: string[];
|
|
25
|
+
levels?: number[];
|
|
26
|
+
from?: string;
|
|
27
|
+
to?: string;
|
|
28
|
+
interval?: 'day' | 'hour';
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=timeseries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeseries.d.ts","sourceRoot":"","sources":["../../../src/types/timeseries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Appearance = 'system' | 'dark' | 'light';
|
|
2
|
+
export interface PushToken {
|
|
3
|
+
token: string;
|
|
4
|
+
deviceId?: string;
|
|
5
|
+
platform?: 'ios' | 'android' | 'web';
|
|
6
|
+
}
|
|
7
|
+
export interface NotificationPreference {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
minimumLevel?: number;
|
|
10
|
+
lastReadAt?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface NotificationPreferences {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
minimumLevel?: number;
|
|
15
|
+
perApp?: Record<string, NotificationPreference>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Public user profile returned from API.
|
|
19
|
+
*/
|
|
20
|
+
export interface UserRecord {
|
|
21
|
+
id: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
email: string;
|
|
25
|
+
publicKey?: string;
|
|
26
|
+
appearance?: Appearance;
|
|
27
|
+
color?: string;
|
|
28
|
+
imageUrl?: string;
|
|
29
|
+
agreedToTermsVersion?: string;
|
|
30
|
+
notificationPreferences: NotificationPreferences;
|
|
31
|
+
pushTokens: PushToken[];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEpD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAA;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { LogLevel, SubscriptionLevel } from '../constants';
|
|
2
|
-
import { Appearance, DeviceLinkStatus } from '../types';
|
|
2
|
+
import { Appearance, DeviceLinkStatus, TeamMemberRecord } from '../types';
|
|
3
3
|
export declare const isValidAppearance: (value: unknown) => value is Appearance;
|
|
4
4
|
/** Accepts 3- and 6-digit hex color strings (#rgb, #rrggbb). */
|
|
5
5
|
export declare const isValidColor: (value: string) => boolean;
|
|
6
6
|
export declare const isValidLogLevel: (value: unknown) => value is LogLevel;
|
|
7
7
|
export declare const isValidSubscriptionLevel: (value: unknown) => value is SubscriptionLevel;
|
|
8
8
|
export declare const isValidDeviceLinkStatus: (value: unknown) => value is DeviceLinkStatus;
|
|
9
|
+
export declare const isValidTeamMemberRole: (value: unknown) => value is TeamMemberRecord["role"];
|
|
10
|
+
/** Accepts any valid absolute URL (https://..., http://..., etc.). */
|
|
11
|
+
export declare const isValidImageUrl: (value: unknown) => value is string;
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,iBAAiB,EAAsB,MAAM,cAAc,CAAA;AACzF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,iBAAiB,EAAsB,MAAM,cAAc,CAAA;AACzF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAIzE,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UAA4D,CAAA;AAExH,gEAAgE;AAChE,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAA2D,CAAA;AAExG,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,QAA6D,CAAA;AAEvH,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,iBAAyF,CAAA;AAI5J,eAAO,MAAM,uBAAuB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,gBAA0E,CAAA;AAI5I,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,gBAAgB,CAAC,MAAM,CAAgE,CAAA;AAEvJ,sEAAsE;AACtE,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAQzD,CAAA"}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -7,3 +7,17 @@ export const isValidLogLevel = (value) => logLevels.includes(value);
|
|
|
7
7
|
export const isValidSubscriptionLevel = (value) => subscriptionLevels.includes(value);
|
|
8
8
|
const deviceLinkStatuses = ['pending', 'approved', 'denied'];
|
|
9
9
|
export const isValidDeviceLinkStatus = (value) => deviceLinkStatuses.includes(value);
|
|
10
|
+
const teamMemberRoles = ['owner', 'admin', 'member'];
|
|
11
|
+
export const isValidTeamMemberRole = (value) => teamMemberRoles.includes(value);
|
|
12
|
+
/** Accepts any valid absolute URL (https://..., http://..., etc.). */
|
|
13
|
+
export const isValidImageUrl = (value) => {
|
|
14
|
+
if (typeof value !== 'string' || value.length === 0)
|
|
15
|
+
return false;
|
|
16
|
+
try {
|
|
17
|
+
new URL(value);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
};
|
package/package.json
CHANGED