@fixflow/sdk 0.1.2 → 0.1.3

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,409 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isNode = isNode;
7
+ exports.getRuntime = getRuntime;
8
+ exports.extractFile = extractFile;
9
+ exports.extractLine = extractLine;
10
+ exports.capture = capture;
11
+ exports.setupApiTracking = setupApiTracking;
12
+ exports.setupGlobalHandlers = setupGlobalHandlers;
13
+ exports.registerAutoCapture = registerAutoCapture;
14
+ const sender_js_1 = require("./sender.js");
15
+ const core_js_1 = require("./core.js");
16
+ const axios_1 = __importDefault(require("axios"));
17
+ let autoCaptureRegistered = false;
18
+ let fetchTrackingRegistered = false;
19
+ let axiosTrackingRegistered = false;
20
+ function isReactNative() {
21
+ try {
22
+ const nav = globalThis.navigator;
23
+ return nav?.product === "ReactNative";
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ }
29
+ function isNode() {
30
+ try {
31
+ const nodeProcess = globalThis.process;
32
+ return typeof nodeProcess !== "undefined" && nodeProcess.release?.name === "node";
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ }
38
+ function getRuntime() {
39
+ try {
40
+ if (isReactNative()) {
41
+ return "react-native";
42
+ }
43
+ return isNode() ? "node" : "browser";
44
+ }
45
+ catch {
46
+ return "node";
47
+ }
48
+ }
49
+ function extractFile(stack) {
50
+ try {
51
+ if (!stack) {
52
+ return undefined;
53
+ }
54
+ const match = stack.match(/(?:at\s+.*\()?(.+):\d+:\d+\)?/);
55
+ return match?.[1];
56
+ }
57
+ catch {
58
+ return undefined;
59
+ }
60
+ }
61
+ function extractLine(stack) {
62
+ try {
63
+ if (!stack) {
64
+ return undefined;
65
+ }
66
+ const match = stack.match(/:(\d+):\d+\)?/);
67
+ if (!match?.[1]) {
68
+ return undefined;
69
+ }
70
+ const line = Number(match[1]);
71
+ return Number.isFinite(line) ? line : undefined;
72
+ }
73
+ catch {
74
+ return undefined;
75
+ }
76
+ }
77
+ function getEnv() {
78
+ try {
79
+ const nodeProcess = globalThis.process;
80
+ if (nodeProcess?.env?.NODE_ENV) {
81
+ return nodeProcess.env.NODE_ENV;
82
+ }
83
+ if (isNode()) {
84
+ return "production";
85
+ }
86
+ }
87
+ catch {
88
+ // noop
89
+ }
90
+ return "unknown";
91
+ }
92
+ function getNodeVersion() {
93
+ try {
94
+ const nodeProcess = globalThis.process;
95
+ return nodeProcess?.version;
96
+ }
97
+ catch {
98
+ return undefined;
99
+ }
100
+ }
101
+ function getNodePlatform() {
102
+ try {
103
+ const nodeProcess = globalThis.process;
104
+ return nodeProcess?.platform;
105
+ }
106
+ catch {
107
+ return undefined;
108
+ }
109
+ }
110
+ function markCaptured(error) {
111
+ try {
112
+ if (error.__fixflow) {
113
+ return true;
114
+ }
115
+ error.__fixflow = true;
116
+ return false;
117
+ }
118
+ catch {
119
+ return true;
120
+ }
121
+ }
122
+ function normalizeError(input) {
123
+ try {
124
+ if (input instanceof Error) {
125
+ return input;
126
+ }
127
+ return new Error(typeof input === "string" ? input : "Unknown error");
128
+ }
129
+ catch {
130
+ return new Error("Unknown error");
131
+ }
132
+ }
133
+ function normalizeRejectionReason(reason) {
134
+ try {
135
+ if (reason instanceof Error) {
136
+ return reason;
137
+ }
138
+ return new Error(JSON.stringify(reason));
139
+ }
140
+ catch {
141
+ return new Error("Unhandled promise rejection");
142
+ }
143
+ }
144
+ async function capture(error) {
145
+ try {
146
+ const safeError = normalizeError(error);
147
+ if (markCaptured(safeError)) {
148
+ return;
149
+ }
150
+ await (0, sender_js_1.sendError)({
151
+ message: safeError.message || "Unknown error",
152
+ stack: safeError.stack,
153
+ file: extractFile(safeError.stack),
154
+ line: extractLine(safeError.stack),
155
+ runtime: getRuntime(),
156
+ env: getEnv(),
157
+ nodeVersion: isNode() ? getNodeVersion() : undefined,
158
+ platform: isNode() ? getNodePlatform() : undefined,
159
+ type: "error",
160
+ });
161
+ }
162
+ catch {
163
+ // SDK should never throw
164
+ }
165
+ }
166
+ async function sendApiEvent(data) {
167
+ try {
168
+ await (0, sender_js_1.sendError)({
169
+ message: data.message,
170
+ runtime: getRuntime(),
171
+ env: getEnv(),
172
+ nodeVersion: isNode() ? getNodeVersion() : undefined,
173
+ platform: isNode() ? getNodePlatform() : undefined,
174
+ type: "api",
175
+ url: data.url,
176
+ status: data.status,
177
+ duration: data.duration,
178
+ });
179
+ }
180
+ catch {
181
+ // SDK should never throw
182
+ }
183
+ }
184
+ function setupApiTracking() {
185
+ try {
186
+ if ((0, core_js_1.shouldTrackFetch)() && !fetchTrackingRegistered && typeof window !== "undefined" && typeof window.fetch === "function") {
187
+ fetchTrackingRegistered = true;
188
+ const originalFetch = window.fetch.bind(window);
189
+ window.fetch = async (...args) => {
190
+ const start = Date.now();
191
+ let requestUrl = "";
192
+ try {
193
+ const input = args[0];
194
+ requestUrl = typeof input === "string" ? input : input instanceof Request ? input.url : "";
195
+ }
196
+ catch {
197
+ // noop
198
+ }
199
+ try {
200
+ const response = await originalFetch(...args);
201
+ const duration = Date.now() - start;
202
+ const threshold = (0, core_js_1.getSlowThreshold)();
203
+ if (!response.ok || duration > threshold) {
204
+ void sendApiEvent({
205
+ message: !response.ok ? "API request failed" : "API request slow",
206
+ url: requestUrl,
207
+ status: response.status,
208
+ duration,
209
+ });
210
+ }
211
+ return response;
212
+ }
213
+ catch (error) {
214
+ const duration = Date.now() - start;
215
+ void sendApiEvent({
216
+ message: "API request error",
217
+ url: requestUrl,
218
+ duration,
219
+ });
220
+ throw error;
221
+ }
222
+ };
223
+ }
224
+ if ((0, core_js_1.shouldTrackAxios)() && !axiosTrackingRegistered) {
225
+ axiosTrackingRegistered = true;
226
+ const axiosClient = (0, core_js_1.getTrackingAxios)() ?? axios_1.default;
227
+ axiosClient.interceptors.request.use((config) => {
228
+ try {
229
+ const meta = config.__fixflowMeta || {
230
+ startTime: Date.now(),
231
+ };
232
+ config.__fixflowMeta = meta;
233
+ }
234
+ catch {
235
+ // noop
236
+ }
237
+ return config;
238
+ });
239
+ axiosClient.interceptors.response.use((response) => {
240
+ try {
241
+ const startTime = response.config.__fixflowMeta?.startTime ||
242
+ Date.now();
243
+ const duration = Date.now() - startTime;
244
+ const threshold = (0, core_js_1.getSlowThreshold)();
245
+ let requestUrl = "";
246
+ try {
247
+ requestUrl = axiosClient.getUri(response.config);
248
+ }
249
+ catch {
250
+ requestUrl = response.config?.url || "";
251
+ }
252
+ if (!response.status || response.status >= 400 || duration > threshold) {
253
+ void sendApiEvent({
254
+ message: response.status >= 400 ? "API request failed" : "API request slow",
255
+ url: requestUrl || response.config?.url,
256
+ status: response.status,
257
+ duration,
258
+ });
259
+ }
260
+ }
261
+ catch {
262
+ // noop
263
+ }
264
+ return response;
265
+ }, (error) => {
266
+ try {
267
+ const config = (error?.config || {});
268
+ const startTime = config.__fixflowMeta?.startTime || Date.now();
269
+ const duration = Date.now() - startTime;
270
+ let requestUrl = "";
271
+ try {
272
+ requestUrl = axiosClient.getUri(config);
273
+ }
274
+ catch {
275
+ requestUrl = config.url || "";
276
+ }
277
+ void sendApiEvent({
278
+ message: "API request error",
279
+ url: requestUrl || config.url,
280
+ status: error?.response?.status,
281
+ duration,
282
+ });
283
+ }
284
+ catch {
285
+ // noop
286
+ }
287
+ return Promise.reject(error);
288
+ });
289
+ }
290
+ }
291
+ catch {
292
+ // SDK should never throw
293
+ }
294
+ }
295
+ function setupGlobalHandlers() {
296
+ try {
297
+ if (autoCaptureRegistered) {
298
+ return;
299
+ }
300
+ autoCaptureRegistered = true;
301
+ const nodeProcess = globalThis.process;
302
+ if (isNode() && typeof nodeProcess?.on === "function") {
303
+ nodeProcess.on("uncaughtException", (error) => {
304
+ try {
305
+ void capture(normalizeError(error));
306
+ }
307
+ catch {
308
+ // noop
309
+ }
310
+ });
311
+ nodeProcess.on("unhandledRejection", (reason) => {
312
+ try {
313
+ void capture(normalizeRejectionReason(reason));
314
+ }
315
+ catch {
316
+ // noop
317
+ }
318
+ });
319
+ nodeProcess.on("beforeExit", (code) => {
320
+ try {
321
+ console.debug("[FixFlow] process beforeExit", code);
322
+ }
323
+ catch {
324
+ // noop
325
+ }
326
+ });
327
+ nodeProcess.on("exit", (code) => {
328
+ try {
329
+ console.debug("[FixFlow] process exit", code);
330
+ }
331
+ catch {
332
+ // noop
333
+ }
334
+ });
335
+ }
336
+ if (isReactNative()) {
337
+ const rnGlobal = globalThis;
338
+ if (typeof rnGlobal.ErrorUtils?.setGlobalHandler === "function") {
339
+ const previousHandler = typeof rnGlobal.ErrorUtils.getGlobalHandler === "function"
340
+ ? rnGlobal.ErrorUtils.getGlobalHandler()
341
+ : undefined;
342
+ rnGlobal.ErrorUtils.setGlobalHandler((error, isFatal) => {
343
+ try {
344
+ void capture(normalizeError(error));
345
+ }
346
+ catch {
347
+ // noop
348
+ }
349
+ try {
350
+ if (typeof previousHandler === "function") {
351
+ previousHandler(error, isFatal);
352
+ }
353
+ }
354
+ catch {
355
+ // noop
356
+ }
357
+ });
358
+ }
359
+ return;
360
+ }
361
+ if (typeof window !== "undefined") {
362
+ const previousOnError = window.onerror;
363
+ const previousUnhandledRejection = window.onunhandledrejection;
364
+ window.onerror = (message, source, lineno, _colno, error) => {
365
+ try {
366
+ const normalized = normalizeError(error ?? message);
367
+ if (!normalized.stack && source) {
368
+ normalized.stack = `at ${source}:${lineno || 0}:0`;
369
+ }
370
+ void capture(normalized);
371
+ }
372
+ catch {
373
+ // noop
374
+ }
375
+ try {
376
+ if (typeof previousOnError === "function") {
377
+ return previousOnError(message, source, lineno, _colno, error);
378
+ }
379
+ }
380
+ catch {
381
+ // noop
382
+ }
383
+ return false;
384
+ };
385
+ window.onunhandledrejection = (event) => {
386
+ try {
387
+ void capture(normalizeRejectionReason(event.reason));
388
+ }
389
+ catch {
390
+ // noop
391
+ }
392
+ try {
393
+ if (typeof previousUnhandledRejection === "function") {
394
+ previousUnhandledRejection.call(window, event);
395
+ }
396
+ }
397
+ catch {
398
+ // noop
399
+ }
400
+ };
401
+ }
402
+ }
403
+ catch {
404
+ // SDK should never throw
405
+ }
406
+ }
407
+ function registerAutoCapture() {
408
+ setupGlobalHandlers();
409
+ }
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initConfig = initConfig;
4
+ exports.getTrackingAxios = getTrackingAxios;
5
+ exports.getProjectKey = getProjectKey;
6
+ exports.getEndpoint = getEndpoint;
7
+ exports.isInitialized = isInitialized;
8
+ exports.shouldTrackFetch = shouldTrackFetch;
9
+ exports.shouldTrackAxios = shouldTrackAxios;
10
+ exports.getSlowThreshold = getSlowThreshold;
11
+ exports.syncRemoteApiTrackingConfig = syncRemoteApiTrackingConfig;
12
+ const DEFAULT_ENDPOINT = "https://api.tryfixflow.com/sdk/error";
13
+ const DEFAULT_SLOW_THRESHOLD = 1000;
14
+ let projectKey = "";
15
+ let endpoint = DEFAULT_ENDPOINT;
16
+ let trackFetch = false;
17
+ let trackAxios = false;
18
+ let slowThreshold = DEFAULT_SLOW_THRESHOLD;
19
+ let trackingAxios;
20
+ let remoteApiTrackingEnabled = null;
21
+ let remoteTrackInDevelopment = false;
22
+ function initConfig(key, options) {
23
+ try {
24
+ if (typeof key !== "string" || key.trim() === "") {
25
+ return;
26
+ }
27
+ projectKey = key;
28
+ endpoint = options?.endpoint || DEFAULT_ENDPOINT;
29
+ trackFetch = Boolean(options?.trackFetch);
30
+ trackAxios = Boolean(options?.trackAxios);
31
+ slowThreshold =
32
+ typeof options?.slowThreshold === "number" && Number.isFinite(options.slowThreshold)
33
+ ? Math.max(0, options.slowThreshold)
34
+ : DEFAULT_SLOW_THRESHOLD;
35
+ trackingAxios = options?.axios;
36
+ }
37
+ catch {
38
+ // SDK should never throw
39
+ }
40
+ }
41
+ function getTrackingAxios() {
42
+ try {
43
+ return trackingAxios;
44
+ }
45
+ catch {
46
+ return undefined;
47
+ }
48
+ }
49
+ function getProjectKey() {
50
+ try {
51
+ return projectKey;
52
+ }
53
+ catch {
54
+ return "";
55
+ }
56
+ }
57
+ function getEndpoint() {
58
+ try {
59
+ return endpoint || DEFAULT_ENDPOINT;
60
+ }
61
+ catch {
62
+ return DEFAULT_ENDPOINT;
63
+ }
64
+ }
65
+ function isInitialized() {
66
+ try {
67
+ return Boolean(projectKey);
68
+ }
69
+ catch {
70
+ return false;
71
+ }
72
+ }
73
+ function shouldTrackFetch() {
74
+ try {
75
+ const enabled = remoteApiTrackingEnabled !== null ? remoteApiTrackingEnabled : trackFetch;
76
+ if (!enabled)
77
+ return false;
78
+ if (isDevelopmentEnvironment() && !remoteTrackInDevelopment)
79
+ return false;
80
+ return true;
81
+ }
82
+ catch {
83
+ return false;
84
+ }
85
+ }
86
+ function shouldTrackAxios() {
87
+ try {
88
+ const enabled = remoteApiTrackingEnabled !== null ? remoteApiTrackingEnabled : trackAxios;
89
+ if (!enabled)
90
+ return false;
91
+ if (isDevelopmentEnvironment() && !remoteTrackInDevelopment)
92
+ return false;
93
+ return true;
94
+ }
95
+ catch {
96
+ return false;
97
+ }
98
+ }
99
+ function getSlowThreshold() {
100
+ try {
101
+ return slowThreshold;
102
+ }
103
+ catch {
104
+ return DEFAULT_SLOW_THRESHOLD;
105
+ }
106
+ }
107
+ function getSdkConfigEndpoint() {
108
+ const base = getEndpoint().replace(/\/+$/, "");
109
+ if (base.endsWith("/sdk/error")) {
110
+ const suffix = "/sdk/error";
111
+ return `${base.slice(0, -suffix.length)}/sdk/config`;
112
+ }
113
+ return `${base}/config`;
114
+ }
115
+ async function syncRemoteApiTrackingConfig() {
116
+ try {
117
+ const key = getProjectKey();
118
+ if (!key)
119
+ return;
120
+ const configUrl = `${getSdkConfigEndpoint()}/${encodeURIComponent(key)}`;
121
+ const response = await fetch(configUrl, { method: "GET" });
122
+ if (!response.ok)
123
+ return;
124
+ const data = (await response.json());
125
+ if (typeof data?.apiTrackingEnabled === "boolean") {
126
+ remoteApiTrackingEnabled = data.apiTrackingEnabled;
127
+ }
128
+ if (typeof data?.trackInDevelopment === "boolean") {
129
+ remoteTrackInDevelopment = data.trackInDevelopment;
130
+ }
131
+ }
132
+ catch {
133
+ // SDK should never throw
134
+ }
135
+ }
136
+ function isDevelopmentEnvironment() {
137
+ try {
138
+ const processObj = globalThis.process;
139
+ const env = processObj?.env || {};
140
+ const value = env.ENVIRONMENT || env.NODE_ENV || "";
141
+ return String(value).toLowerCase() === "development";
142
+ }
143
+ catch {
144
+ return false;
145
+ }
146
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.capture = void 0;
4
+ exports.init = init;
5
+ exports.captureError = captureError;
6
+ const core_js_1 = require("./core.js");
7
+ const capture_js_1 = require("./capture.js");
8
+ Object.defineProperty(exports, "capture", { enumerable: true, get: function () { return capture_js_1.capture; } });
9
+ function init(projectKey, options) {
10
+ try {
11
+ (0, core_js_1.initConfig)(projectKey, options);
12
+ (0, capture_js_1.registerAutoCapture)();
13
+ void (0, core_js_1.syncRemoteApiTrackingConfig)().finally(() => {
14
+ (0, capture_js_1.setupApiTracking)();
15
+ });
16
+ }
17
+ catch {
18
+ // SDK should never throw
19
+ }
20
+ }
21
+ function captureError(error) {
22
+ try {
23
+ void (0, capture_js_1.capture)(error);
24
+ }
25
+ catch {
26
+ // SDK should never throw
27
+ }
28
+ }
29
+ const fixflow = {
30
+ init,
31
+ capture: capture_js_1.capture,
32
+ captureError,
33
+ };
34
+ exports.default = fixflow;
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.sendError = sendError;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const core_js_1 = require("./core.js");
9
+ async function sendError(payload) {
10
+ try {
11
+ if (!(0, core_js_1.isInitialized)()) {
12
+ return;
13
+ }
14
+ const key = (0, core_js_1.getProjectKey)();
15
+ const endpoint = (0, core_js_1.getEndpoint)();
16
+ if (!key || !endpoint) {
17
+ return;
18
+ }
19
+ await axios_1.default.post(endpoint, {
20
+ projectKey: key,
21
+ message: payload.message,
22
+ stack: payload.stack,
23
+ file: payload.file,
24
+ line: payload.line,
25
+ runtime: payload.runtime,
26
+ env: payload.env,
27
+ nodeVersion: payload.nodeVersion,
28
+ platform: payload.platform,
29
+ type: payload.type,
30
+ url: payload.url,
31
+ status: payload.status,
32
+ duration: payload.duration,
33
+ });
34
+ }
35
+ catch {
36
+ // Silent fail by design
37
+ }
38
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { Runtime } from "./types.js";
2
+ export declare function isNode(): boolean;
3
+ export declare function getRuntime(): Runtime;
4
+ export declare function extractFile(stack?: string): string | undefined;
5
+ export declare function extractLine(stack?: string): number | undefined;
6
+ export declare function capture(error: Error): Promise<void>;
7
+ export declare function setupApiTracking(): void;
8
+ export declare function setupGlobalHandlers(): void;
9
+ export declare function registerAutoCapture(): void;
@@ -0,0 +1,11 @@
1
+ import type { AxiosStatic } from "axios";
2
+ import type { InitOptions } from "./types.js";
3
+ export declare function initConfig(key: string, options?: InitOptions): void;
4
+ export declare function getTrackingAxios(): AxiosStatic | undefined;
5
+ export declare function getProjectKey(): string;
6
+ export declare function getEndpoint(): string;
7
+ export declare function isInitialized(): boolean;
8
+ export declare function shouldTrackFetch(): boolean;
9
+ export declare function shouldTrackAxios(): boolean;
10
+ export declare function getSlowThreshold(): number;
11
+ export declare function syncRemoteApiTrackingConfig(): Promise<void>;
@@ -0,0 +1,11 @@
1
+ import { capture } from "./capture.js";
2
+ import type { InitOptions } from "./types.js";
3
+ export declare function init(projectKey: string, options?: InitOptions): void;
4
+ export { capture };
5
+ export declare function captureError(error: Error): void;
6
+ declare const fixflow: {
7
+ init: typeof init;
8
+ capture: typeof capture;
9
+ captureError: typeof captureError;
10
+ };
11
+ export default fixflow;
@@ -0,0 +1 @@
1
+ {"type": "module"}
@@ -0,0 +1,2 @@
1
+ import type { ErrorPayload } from "./types.js";
2
+ export declare function sendError(payload: Omit<ErrorPayload, "projectKey">): Promise<void>;
@@ -0,0 +1,33 @@
1
+ import type { AxiosStatic } from "axios";
2
+ export interface InitOptions {
3
+ /** Override ingest URL. Defaults to `https://api.fixflow.ai/sdk/error`. Only set for self-hosted APIs. */
4
+ endpoint?: string;
5
+ trackFetch?: boolean;
6
+ trackAxios?: boolean;
7
+ slowThreshold?: number;
8
+ /**
9
+ * Your application's `axios` import. Required in Node when `trackAxios` is true:
10
+ * npm often installs a separate `axios` copy inside `@fixflow/sdk`, so interceptors
11
+ * on the SDK's default axios would not see requests made with your app's axios.
12
+ */
13
+ axios?: AxiosStatic;
14
+ }
15
+ export type Runtime = "node" | "browser" | "react-native";
16
+ export interface ErrorPayload {
17
+ projectKey: string;
18
+ message: string;
19
+ stack?: string;
20
+ file?: string;
21
+ line?: number;
22
+ runtime: Runtime;
23
+ env: string;
24
+ nodeVersion?: string;
25
+ platform?: string;
26
+ type?: "error" | "api";
27
+ url?: string;
28
+ status?: number;
29
+ duration?: number;
30
+ }
31
+ export type FixflowError = Error & {
32
+ __fixflow?: boolean;
33
+ };
package/package.json CHANGED
@@ -1,14 +1,24 @@
1
1
  {
2
2
  "name": "@fixflow/sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "FixFlow SDK for error capture",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "license": "MIT",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.js",
7
+ "types": "./dist/index.d.ts",
8
8
  "type": "module",
9
- "files": ["dist"],
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/esm/index.js",
12
+ "require": "./dist/cjs/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "license": "MIT",
17
+ "files": [
18
+ "dist"
19
+ ],
10
20
  "scripts": {
11
- "build": "tsc"
21
+ "build": "rm -rf dist && tsc && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json && tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > dist/esm/package.json"
12
22
  },
13
23
  "dependencies": {
14
24
  "axios": "^1.13.0"
@@ -24,4 +34,4 @@
24
34
  "devDependencies": {
25
35
  "typescript": "^5.9.2"
26
36
  }
27
- }
37
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes