@logwolf/client-js 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 +1 -0
- package/dist/logwolf-client.d.ts +117 -0
- package/dist/logwolf-client.js +190 -0
- package/dist/logwolf-client.js.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# logwolf-client-js
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const LogwolfEventSeveritySchema: z.ZodEnum<{
|
|
4
|
+
info: "info";
|
|
5
|
+
warning: "warning";
|
|
6
|
+
error: "error";
|
|
7
|
+
critical: "critical";
|
|
8
|
+
}>;
|
|
9
|
+
type Severity = z.infer<typeof LogwolfEventSeveritySchema>;
|
|
10
|
+
declare const LogwolfEventDataSchema: z.ZodCodec<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
11
|
+
declare const LogwolfDatetimeSchema: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
|
|
12
|
+
declare const LogwolfEventSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
severity: z.ZodEnum<{
|
|
16
|
+
info: "info";
|
|
17
|
+
warning: "warning";
|
|
18
|
+
error: "error";
|
|
19
|
+
critical: "critical";
|
|
20
|
+
}>;
|
|
21
|
+
tags: z.ZodArray<z.ZodString>;
|
|
22
|
+
data: z.ZodCodec<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
23
|
+
duration: z.ZodOptional<z.ZodInt>;
|
|
24
|
+
created_at: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
|
|
25
|
+
updated_at: z.ZodCodec<z.ZodISODateTime, z.ZodDate>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
type LogwolfEventData = z.infer<typeof LogwolfEventSchema>;
|
|
28
|
+
declare const CreateLogwolfEventDTOSchema: z.ZodObject<{
|
|
29
|
+
severity: z.ZodEnum<{
|
|
30
|
+
info: "info";
|
|
31
|
+
warning: "warning";
|
|
32
|
+
error: "error";
|
|
33
|
+
critical: "critical";
|
|
34
|
+
}>;
|
|
35
|
+
data: z.ZodCodec<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
tags: z.ZodArray<z.ZodString>;
|
|
38
|
+
duration: z.ZodOptional<z.ZodInt>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
type CreateLogwolfEventDTO = z.infer<typeof CreateLogwolfEventDTOSchema>;
|
|
41
|
+
declare const DeleteLogwolfEventDTOSchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
type DeleteLogwolfEventDTO = z.infer<typeof DeleteLogwolfEventDTOSchema>;
|
|
45
|
+
type LogwolfApiResponse<T> = {
|
|
46
|
+
message: string;
|
|
47
|
+
} & ({
|
|
48
|
+
error: true;
|
|
49
|
+
} | {
|
|
50
|
+
error: false;
|
|
51
|
+
data: T;
|
|
52
|
+
});
|
|
53
|
+
declare const LogwolfConfigSchema: z.ZodObject<{
|
|
54
|
+
url: z.ZodURL;
|
|
55
|
+
apiKey: z.ZodString;
|
|
56
|
+
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
errorSampleRate: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
type LogwolfConfig = z.infer<typeof LogwolfConfigSchema>;
|
|
60
|
+
declare const LogwolfEventDTOSchema: z.ZodObject<{
|
|
61
|
+
severity: z.ZodEnum<{
|
|
62
|
+
info: "info";
|
|
63
|
+
warning: "warning";
|
|
64
|
+
error: "error";
|
|
65
|
+
critical: "critical";
|
|
66
|
+
}>;
|
|
67
|
+
data: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
tags: z.ZodArray<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
type LogwolfEventDTO = z.infer<typeof LogwolfEventDTOSchema>;
|
|
72
|
+
declare const PaginationSchema: z.ZodCodec<z.ZodCustom<URLSearchParams, URLSearchParams>, z.ZodObject<{
|
|
73
|
+
page: z.ZodNumber;
|
|
74
|
+
pageSize: z.ZodNumber;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
type Pagination = z.infer<typeof PaginationSchema>;
|
|
77
|
+
|
|
78
|
+
declare class LogwolfEvent {
|
|
79
|
+
readonly random: number;
|
|
80
|
+
readonly start: number;
|
|
81
|
+
readonly createdAt: Date;
|
|
82
|
+
name: LogwolfEventDTO['name'];
|
|
83
|
+
severity: LogwolfEventDTO['severity'];
|
|
84
|
+
readonly tags: LogwolfEventDTO['tags'];
|
|
85
|
+
readonly data: NonNullable<LogwolfEventDTO['data']>;
|
|
86
|
+
constructor(props: LogwolfEventDTO);
|
|
87
|
+
setName(n: string): void;
|
|
88
|
+
setSeverity(s: Severity): void;
|
|
89
|
+
set(key: string, value: unknown): void;
|
|
90
|
+
get(key: string): any;
|
|
91
|
+
addTag(t: string): void;
|
|
92
|
+
toJson(): string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
declare class Logwolf {
|
|
96
|
+
private readonly config;
|
|
97
|
+
constructor(config: LogwolfConfig);
|
|
98
|
+
private getHeaders;
|
|
99
|
+
private handleResponse;
|
|
100
|
+
private shouldCapture;
|
|
101
|
+
/**
|
|
102
|
+
* This bypasses `sampleRate` and `errorSampleRate`, every created event is sent to the server!
|
|
103
|
+
*/
|
|
104
|
+
create(p: LogwolfEvent): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* A captured event is subject to `sampleRate` and `errorSampleRate`, not all captured events are sent to the server!
|
|
107
|
+
*/
|
|
108
|
+
capture(p: LogwolfEvent): Promise<void>;
|
|
109
|
+
getAll(p?: Pagination): Promise<LogwolfEventData[]>;
|
|
110
|
+
getOne(id: string): Promise<LogwolfEventData | undefined>;
|
|
111
|
+
delete(dto: DeleteLogwolfEventDTO): Promise<void>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=index.d.ts.map
|
|
115
|
+
|
|
116
|
+
export { CreateLogwolfEventDTOSchema, DeleteLogwolfEventDTOSchema, Logwolf, LogwolfConfigSchema, LogwolfDatetimeSchema, LogwolfEvent, LogwolfEventDTOSchema, LogwolfEventDataSchema, LogwolfEventSchema, LogwolfEventSeveritySchema, PaginationSchema, Logwolf as default };
|
|
117
|
+
export type { CreateLogwolfEventDTO, DeleteLogwolfEventDTO, LogwolfApiResponse, LogwolfConfig, LogwolfEventDTO, LogwolfEventData, Pagination, Severity };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
|
|
3
|
+
const LogwolfEventSeveritySchema = z.enum(['info', 'warning', 'error', 'critical']);
|
|
4
|
+
const LogwolfEventDataSchema = z.codec(z.string(), z.record(z.string(), z.any()), {
|
|
5
|
+
decode: (jsonString, ctx) => {
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(jsonString);
|
|
8
|
+
}
|
|
9
|
+
catch (err) {
|
|
10
|
+
ctx.issues.push({
|
|
11
|
+
code: 'invalid_format',
|
|
12
|
+
format: 'json',
|
|
13
|
+
input: jsonString,
|
|
14
|
+
message: err.message,
|
|
15
|
+
});
|
|
16
|
+
return z.NEVER;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
encode: (value) => JSON.stringify(value),
|
|
20
|
+
});
|
|
21
|
+
const LogwolfDatetimeSchema = z.codec(z.iso.datetime(), z.date(), {
|
|
22
|
+
decode: (isoString) => new Date(isoString),
|
|
23
|
+
encode: (date) => date.toISOString(),
|
|
24
|
+
});
|
|
25
|
+
const LogwolfEventSchema = z.object({
|
|
26
|
+
id: z.string(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
severity: LogwolfEventSeveritySchema,
|
|
29
|
+
tags: z.array(z.string()),
|
|
30
|
+
data: LogwolfEventDataSchema,
|
|
31
|
+
duration: z.int().optional(),
|
|
32
|
+
created_at: LogwolfDatetimeSchema,
|
|
33
|
+
updated_at: LogwolfDatetimeSchema,
|
|
34
|
+
});
|
|
35
|
+
const CreateLogwolfEventDTOSchema = LogwolfEventSchema.pick({
|
|
36
|
+
name: true,
|
|
37
|
+
severity: true,
|
|
38
|
+
tags: true,
|
|
39
|
+
data: true,
|
|
40
|
+
duration: true,
|
|
41
|
+
});
|
|
42
|
+
const DeleteLogwolfEventDTOSchema = LogwolfEventSchema.pick({ id: true });
|
|
43
|
+
const LogwolfConfigSchema = z.object({
|
|
44
|
+
url: z.url(),
|
|
45
|
+
apiKey: z.string().startsWith('lw_'),
|
|
46
|
+
sampleRate: z.number().positive().lte(1).optional(),
|
|
47
|
+
errorSampleRate: z.number().positive().lte(1).optional(),
|
|
48
|
+
});
|
|
49
|
+
const LogwolfEventDTOSchema = LogwolfEventSchema.pick({
|
|
50
|
+
name: true,
|
|
51
|
+
severity: true,
|
|
52
|
+
tags: true,
|
|
53
|
+
data: true,
|
|
54
|
+
}).partial({
|
|
55
|
+
data: true,
|
|
56
|
+
});
|
|
57
|
+
const PaginationSchema = z.codec(z.instanceof(URLSearchParams), z.object({
|
|
58
|
+
page: z.number().positive(),
|
|
59
|
+
pageSize: z.number().positive(),
|
|
60
|
+
}), {
|
|
61
|
+
encode: (v) => {
|
|
62
|
+
return new URLSearchParams({ page: '' + v.page, pageSize: '' + v.pageSize });
|
|
63
|
+
},
|
|
64
|
+
decode: (v) => {
|
|
65
|
+
const page = v.get('page') ?? '0';
|
|
66
|
+
const pageSize = v.get('pageSize') ?? '0';
|
|
67
|
+
return { page: parseInt(page), pageSize: parseInt(pageSize) };
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
class Logwolf {
|
|
72
|
+
config;
|
|
73
|
+
constructor(config) {
|
|
74
|
+
LogwolfConfigSchema.parse(config);
|
|
75
|
+
this.config = config;
|
|
76
|
+
}
|
|
77
|
+
getHeaders() {
|
|
78
|
+
const headers = { 'Content-Type': 'application/json' };
|
|
79
|
+
if (this.config.apiKey) {
|
|
80
|
+
headers['Authorization'] = `Bearer ${this.config.apiKey}`;
|
|
81
|
+
}
|
|
82
|
+
return headers;
|
|
83
|
+
}
|
|
84
|
+
handleResponse(r) {
|
|
85
|
+
if (r.error)
|
|
86
|
+
throw new Error(r.message);
|
|
87
|
+
return r.data;
|
|
88
|
+
}
|
|
89
|
+
shouldCapture(e) {
|
|
90
|
+
switch (e.severity) {
|
|
91
|
+
case 'error':
|
|
92
|
+
return this.config.errorSampleRate === undefined || e.random >= 1 - this.config.errorSampleRate;
|
|
93
|
+
case 'critical':
|
|
94
|
+
return true;
|
|
95
|
+
default:
|
|
96
|
+
return this.config.sampleRate === undefined || e.random >= 1 - this.config.sampleRate;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* This bypasses `sampleRate` and `errorSampleRate`, every created event is sent to the server!
|
|
101
|
+
*/
|
|
102
|
+
async create(p) {
|
|
103
|
+
const url = new URL('/logs', this.config.url);
|
|
104
|
+
const res = await fetch(url, { method: 'POST', headers: this.getHeaders(), body: p.toJson() })
|
|
105
|
+
.then((r) => r.json())
|
|
106
|
+
.then((r) => this.handleResponse(r));
|
|
107
|
+
return res;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A captured event is subject to `sampleRate` and `errorSampleRate`, not all captured events are sent to the server!
|
|
111
|
+
*/
|
|
112
|
+
async capture(p) {
|
|
113
|
+
if (!this.shouldCapture(p))
|
|
114
|
+
return;
|
|
115
|
+
return await this.create(p);
|
|
116
|
+
}
|
|
117
|
+
async getAll(p) {
|
|
118
|
+
const params = p ? PaginationSchema.encode(p) : '';
|
|
119
|
+
const url = new URL('/logs?' + params, this.config.url);
|
|
120
|
+
const res = await fetch(url, { method: 'GET', headers: this.getHeaders() })
|
|
121
|
+
.then((r) => r.json())
|
|
122
|
+
.then((r) => this.handleResponse(r));
|
|
123
|
+
return z.array(LogwolfEventSchema).parse(res);
|
|
124
|
+
}
|
|
125
|
+
async getOne(id) {
|
|
126
|
+
const res = this.getAll().then((r) => {
|
|
127
|
+
return r.find((i) => i.id === id);
|
|
128
|
+
});
|
|
129
|
+
return res;
|
|
130
|
+
}
|
|
131
|
+
async delete(dto) {
|
|
132
|
+
const url = new URL('/logs', this.config.url);
|
|
133
|
+
const res = await fetch(url, {
|
|
134
|
+
method: 'DELETE',
|
|
135
|
+
headers: this.getHeaders(),
|
|
136
|
+
body: JSON.stringify(DeleteLogwolfEventDTOSchema.parse(dto)),
|
|
137
|
+
})
|
|
138
|
+
.then((r) => r.json())
|
|
139
|
+
.then((r) => this.handleResponse(r));
|
|
140
|
+
return res;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
class LogwolfEvent {
|
|
145
|
+
random = Math.random();
|
|
146
|
+
start = performance.now();
|
|
147
|
+
createdAt = new Date();
|
|
148
|
+
name;
|
|
149
|
+
severity;
|
|
150
|
+
tags;
|
|
151
|
+
data = {};
|
|
152
|
+
constructor(props) {
|
|
153
|
+
this.name = props.name;
|
|
154
|
+
this.severity = props.severity;
|
|
155
|
+
this.tags = props.tags;
|
|
156
|
+
if (props.data) {
|
|
157
|
+
this.data = props.data;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
setName(n) {
|
|
161
|
+
this.name = n;
|
|
162
|
+
}
|
|
163
|
+
setSeverity(s) {
|
|
164
|
+
this.severity = s;
|
|
165
|
+
}
|
|
166
|
+
set(key, value) {
|
|
167
|
+
this.data[key] = value;
|
|
168
|
+
}
|
|
169
|
+
get(key) {
|
|
170
|
+
return this.data[key];
|
|
171
|
+
}
|
|
172
|
+
addTag(t) {
|
|
173
|
+
this.tags.push(t);
|
|
174
|
+
}
|
|
175
|
+
toJson() {
|
|
176
|
+
const now = performance.now();
|
|
177
|
+
const duration = Math.floor(now - this.start);
|
|
178
|
+
const encoded = CreateLogwolfEventDTOSchema.encode({
|
|
179
|
+
name: this.name,
|
|
180
|
+
severity: this.severity,
|
|
181
|
+
tags: Array.from(new Set(this.tags)),
|
|
182
|
+
data: this.data,
|
|
183
|
+
duration: duration,
|
|
184
|
+
});
|
|
185
|
+
return JSON.stringify(encoded);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export { CreateLogwolfEventDTOSchema, DeleteLogwolfEventDTOSchema, Logwolf, LogwolfConfigSchema, LogwolfDatetimeSchema, LogwolfEvent, LogwolfEventDTOSchema, LogwolfEventDataSchema, LogwolfEventSchema, LogwolfEventSeveritySchema, PaginationSchema, Logwolf as default };
|
|
190
|
+
//# sourceMappingURL=logwolf-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logwolf-client.js","sources":["lib/schema.js","lib/client.js","lib/event.js"],"sourcesContent":["import z from 'zod';\nexport const LogwolfEventSeveritySchema = z.enum(['info', 'warning', 'error', 'critical']);\nexport const LogwolfEventDataSchema = z.codec(z.string(), z.record(z.string(), z.any()), {\n decode: (jsonString, ctx) => {\n try {\n return JSON.parse(jsonString);\n }\n catch (err) {\n ctx.issues.push({\n code: 'invalid_format',\n format: 'json',\n input: jsonString,\n message: err.message,\n });\n return z.NEVER;\n }\n },\n encode: (value) => JSON.stringify(value),\n});\nexport const LogwolfDatetimeSchema = z.codec(z.iso.datetime(), z.date(), {\n decode: (isoString) => new Date(isoString),\n encode: (date) => date.toISOString(),\n});\nexport const LogwolfEventSchema = z.object({\n id: z.string(),\n name: z.string(),\n severity: LogwolfEventSeveritySchema,\n tags: z.array(z.string()),\n data: LogwolfEventDataSchema,\n duration: z.int().optional(),\n created_at: LogwolfDatetimeSchema,\n updated_at: LogwolfDatetimeSchema,\n});\nexport const CreateLogwolfEventDTOSchema = LogwolfEventSchema.pick({\n name: true,\n severity: true,\n tags: true,\n data: true,\n duration: true,\n});\nexport const DeleteLogwolfEventDTOSchema = LogwolfEventSchema.pick({ id: true });\nexport const LogwolfConfigSchema = z.object({\n url: z.url(),\n apiKey: z.string().startsWith('lw_'),\n sampleRate: z.number().positive().lte(1).optional(),\n errorSampleRate: z.number().positive().lte(1).optional(),\n});\nexport const LogwolfEventDTOSchema = LogwolfEventSchema.pick({\n name: true,\n severity: true,\n tags: true,\n data: true,\n}).partial({\n data: true,\n});\nexport const PaginationSchema = z.codec(z.instanceof(URLSearchParams), z.object({\n page: z.number().positive(),\n pageSize: z.number().positive(),\n}), {\n encode: (v) => {\n return new URLSearchParams({ page: '' + v.page, pageSize: '' + v.pageSize });\n },\n decode: (v) => {\n const page = v.get('page') ?? '0';\n const pageSize = v.get('pageSize') ?? '0';\n return { page: parseInt(page), pageSize: parseInt(pageSize) };\n },\n});\n//# sourceMappingURL=schema.js.map","import z from 'zod';\nimport { DeleteLogwolfEventDTOSchema, LogwolfConfigSchema, LogwolfEventSchema, PaginationSchema, } from './schema';\nexport class Logwolf {\n config;\n constructor(config) {\n LogwolfConfigSchema.parse(config);\n this.config = config;\n }\n getHeaders() {\n const headers = { 'Content-Type': 'application/json' };\n if (this.config.apiKey) {\n headers['Authorization'] = `Bearer ${this.config.apiKey}`;\n }\n return headers;\n }\n handleResponse(r) {\n if (r.error)\n throw new Error(r.message);\n return r.data;\n }\n shouldCapture(e) {\n switch (e.severity) {\n case 'error':\n return this.config.errorSampleRate === undefined || e.random >= 1 - this.config.errorSampleRate;\n case 'critical':\n return true;\n default:\n return this.config.sampleRate === undefined || e.random >= 1 - this.config.sampleRate;\n }\n }\n /**\n * This bypasses `sampleRate` and `errorSampleRate`, every created event is sent to the server!\n */\n async create(p) {\n const url = new URL('/logs', this.config.url);\n const res = await fetch(url, { method: 'POST', headers: this.getHeaders(), body: p.toJson() })\n .then((r) => r.json())\n .then((r) => this.handleResponse(r));\n return res;\n }\n /**\n * A captured event is subject to `sampleRate` and `errorSampleRate`, not all captured events are sent to the server!\n */\n async capture(p) {\n if (!this.shouldCapture(p))\n return;\n return await this.create(p);\n }\n async getAll(p) {\n const params = p ? PaginationSchema.encode(p) : '';\n const url = new URL('/logs?' + params, this.config.url);\n const res = await fetch(url, { method: 'GET', headers: this.getHeaders() })\n .then((r) => r.json())\n .then((r) => this.handleResponse(r));\n return z.array(LogwolfEventSchema).parse(res);\n }\n async getOne(id) {\n const res = this.getAll().then((r) => {\n return r.find((i) => i.id === id);\n });\n return res;\n }\n async delete(dto) {\n const url = new URL('/logs', this.config.url);\n const res = await fetch(url, {\n method: 'DELETE',\n headers: this.getHeaders(),\n body: JSON.stringify(DeleteLogwolfEventDTOSchema.parse(dto)),\n })\n .then((r) => r.json())\n .then((r) => this.handleResponse(r));\n return res;\n }\n}\n//# sourceMappingURL=client.js.map","import { CreateLogwolfEventDTOSchema } from './schema';\nexport class LogwolfEvent {\n random = Math.random();\n start = performance.now();\n createdAt = new Date();\n name;\n severity;\n tags;\n data = {};\n constructor(props) {\n this.name = props.name;\n this.severity = props.severity;\n this.tags = props.tags;\n if (props.data) {\n this.data = props.data;\n }\n }\n setName(n) {\n this.name = n;\n }\n setSeverity(s) {\n this.severity = s;\n }\n set(key, value) {\n this.data[key] = value;\n }\n get(key) {\n return this.data[key];\n }\n addTag(t) {\n this.tags.push(t);\n }\n toJson() {\n const now = performance.now();\n const duration = Math.floor(now - this.start);\n const encoded = CreateLogwolfEventDTOSchema.encode({\n name: this.name,\n severity: this.severity,\n tags: Array.from(new Set(this.tags)),\n data: this.data,\n duration: duration,\n });\n return JSON.stringify(encoded);\n }\n}\n//# sourceMappingURL=event.js.map"],"names":[],"mappings":";;AACY,MAAC,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC;AAC7E,MAAC,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,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,GAAG,EAAE;AACb,QAAQ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC7B,IAAI;AACJ,IAAI,MAAM,CAAC,CAAC,EAAE;AACd,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACzB,IAAI;AACJ,IAAI,MAAM,GAAG;AACb,QAAQ,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE;AACrC,QAAQ,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC;AACrD,QAAQ,MAAM,OAAO,GAAG,2BAA2B,CAAC,MAAM,CAAC;AAC3D,YAAY,IAAI,EAAE,IAAI,CAAC,IAAI;AAC3B,YAAY,QAAQ,EAAE,IAAI,CAAC,QAAQ;AACnC,YAAY,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChD,YAAY,IAAI,EAAE,IAAI,CAAC,IAAI;AAC3B,YAAY,QAAQ,EAAE,QAAQ;AAC9B,SAAS,CAAC;AACV,QAAQ,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;AACtC,IAAI;AACJ;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@logwolf/client-js",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "JavaScript client for Logwolf",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"logwolf"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/jpricardo/logwolf#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/jpricardo/logwolf/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/jpricardo/logwolf.git"
|
|
15
|
+
},
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"author": "jpricardo",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/logwolf-client.js",
|
|
20
|
+
"types": "./dist/logwolf-client.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"./dist/logwolf-client.d.ts",
|
|
23
|
+
"./dist/logwolf-client.js",
|
|
24
|
+
"./dist/logwolf-client.js.map"
|
|
25
|
+
],
|
|
26
|
+
"directories": {
|
|
27
|
+
"lib": "lib"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc && rollup -c",
|
|
31
|
+
"test": "vitest",
|
|
32
|
+
"coverage": "vitest run --coverage",
|
|
33
|
+
"prepublishOnly": "npm run build"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
37
|
+
"@types/node": "^25.0.3",
|
|
38
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
39
|
+
"prettier": "^3.7.4",
|
|
40
|
+
"rollup": "^4.54.0",
|
|
41
|
+
"rollup-plugin-dts": "^6.3.0",
|
|
42
|
+
"tslib": "^2.8.1",
|
|
43
|
+
"typescript": "^5.9.3",
|
|
44
|
+
"vitest": "^4.0.16"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"zod": "^4.3.4"
|
|
48
|
+
}
|
|
49
|
+
}
|