@ptkl/sdk 1.11.0 → 1.13.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.
@@ -0,0 +1,77 @@
1
+ export type TimberSource = 'system' | 'user';
2
+ export type TimberLevel = 'debug' | 'info' | 'warn' | 'error';
3
+ export type TimberActorType = 'user' | 'api_key' | 'service' | 'system';
4
+ export interface TimberActor {
5
+ type: TimberActorType;
6
+ id: string;
7
+ name?: string;
8
+ ip?: string;
9
+ user_agent?: string;
10
+ }
11
+ export interface TimberChanges {
12
+ before?: Record<string, any>;
13
+ after?: Record<string, any>;
14
+ }
15
+ export interface TimberEntry {
16
+ id: string;
17
+ timestamp: string;
18
+ source: TimberSource;
19
+ level: TimberLevel;
20
+ service: string;
21
+ project_uuid: string;
22
+ actor: TimberActor;
23
+ action?: string;
24
+ resource_type?: string;
25
+ resource_id?: string;
26
+ resource_name?: string;
27
+ message?: string;
28
+ changes?: TimberChanges;
29
+ attributes?: Record<string, any>;
30
+ trace_id?: string;
31
+ span_id?: string;
32
+ request_id?: string;
33
+ }
34
+ export interface TimberQueryParams {
35
+ limit?: number;
36
+ cursor?: string;
37
+ source?: TimberSource;
38
+ level?: TimberLevel;
39
+ from?: string | Date;
40
+ to?: string | Date;
41
+ actor_id?: string;
42
+ actor_name?: string;
43
+ actor_type?: TimberActorType;
44
+ action?: string;
45
+ resource_type?: string;
46
+ resource_id?: string;
47
+ request_uuid?: string;
48
+ search?: string;
49
+ }
50
+ export interface TimberQueryResponse {
51
+ data: TimberEntry[];
52
+ meta: {
53
+ limit: number;
54
+ has_more: boolean;
55
+ next_cursor?: string;
56
+ };
57
+ }
58
+ export interface TimberWritePayload {
59
+ level?: TimberLevel;
60
+ message: string;
61
+ service?: string;
62
+ resource_type?: string;
63
+ resource_id?: string;
64
+ resource_name?: string;
65
+ attributes?: Record<string, any>;
66
+ trace_id?: string;
67
+ span_id?: string;
68
+ request_id?: string;
69
+ }
70
+ export type TimberLogPayload = Omit<TimberWritePayload, 'level'>;
71
+ export interface TimberUsage {
72
+ tier: 'free' | 'pro' | string;
73
+ period?: string;
74
+ bytes_ingested?: number;
75
+ gb_ingested?: number;
76
+ [key: string]: any;
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",