@pulsetrackme/sdk 0.1.0 → 0.1.6

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,38 @@
1
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
2
+ type RequestOptions = {
3
+ headers?: Record<string, string>;
4
+ params?: Record<string, string | number | boolean>;
5
+ body?: unknown;
6
+ signal?: AbortSignal;
7
+ };
8
+ type SuccessResponse<T> = {
9
+ data: T;
10
+ error: null;
11
+ status: number;
12
+ ok: true;
13
+ };
14
+ type ErrorResponse = {
15
+ data: null;
16
+ error: Error;
17
+ status: number | null;
18
+ ok: false;
19
+ };
20
+ type ApiResponse<T = unknown> = SuccessResponse<T> | ErrorResponse;
21
+ declare class ApiError<T = unknown> extends Error {
22
+ readonly status: number;
23
+ readonly data: T | null;
24
+ constructor(message: string, status: number, data?: T | null);
25
+ }
26
+ export declare const api: {
27
+ get: <T = unknown>(url: string, options?: Omit<RequestOptions, "body">) => Promise<ApiResponse<T>>;
28
+ post: <T = unknown, B = unknown>(url: string, body?: B, options?: Omit<RequestOptions, "body">) => Promise<ApiResponse<T>>;
29
+ put: <T = unknown, B = unknown>(url: string, body?: B, options?: Omit<RequestOptions, "body">) => Promise<ApiResponse<T>>;
30
+ patch: <T = unknown, B = unknown>(url: string, body?: B, options?: Omit<RequestOptions, "body">) => Promise<ApiResponse<T>>;
31
+ delete: <T = unknown>(url: string, options?: RequestOptions) => Promise<ApiResponse<T>>;
32
+ config: {
33
+ request: <T = unknown>(method: HttpMethod, url: string, options?: RequestOptions) => Promise<ApiResponse<T>>;
34
+ fetchConfig: <T = any>(businessId: string) => Promise<ApiResponse<T>>;
35
+ };
36
+ };
37
+ export type { ApiResponse, RequestOptions, ApiError };
38
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"m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,CAAC,cAAc,EAAE,MAAM,CAAC;YAG/B,CAAC,YAAY,CAAC,iBACf,MAAM,SACJ,CAAC,YACC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;aAG9B,CAAC,iBAAiB,MAAM,YAAW,cAAc;;kBAnHrC,CAAC,oBACd,UAAU,OACb,MAAM,YACF,cAAc,KACtB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;sBAmFJ,CAAC,oBAAoB,MAAM,KAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;;CAiC1E,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ type SuccessResponse<T> = {
2
+ data: T;
3
+ error: null;
4
+ status: number;
5
+ ok: true;
6
+ };
7
+ type ErrorResponse = {
8
+ data: null;
9
+ error: Error;
10
+ status: number | null;
11
+ ok: false;
12
+ };
13
+ type ApiResponse<T = unknown> = SuccessResponse<T> | ErrorResponse;
14
+ export declare function fetchInitConfig<T = unknown>(token: string): Promise<ApiResponse<T>>;
15
+ export type { ApiResponse };
16
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/utils/init.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,EAAE,EAAE,KAAK,CAAC;CACX,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;AAmBnE,wBAAsB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAsDzF;AAED,YAAY,EAAE,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,49 +1,42 @@
1
1
  {
2
2
  "name": "@pulsetrackme/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.6",
4
4
  "description": "A lightweight analytics and feedback collection library for modern web applications",
5
5
  "type": "module",
6
- "main": "dist/index.cjs",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "files": [
10
- "dist"
11
- ],
6
+
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+
11
+ "unpkg": "./dist/pulsetrack.umd.min.js",
12
+ "jsdelivr": "./dist/pulsetrack.umd.min.js",
13
+
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js",
18
+ "require": "./dist/index.cjs",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+
24
+ "sideEffects": false,
25
+ "files": ["dist"],
26
+
12
27
  "scripts": {
13
28
  "build": "rollup -c",
14
- "watch": "rollup -c -w",
15
- "test": "echo \"Error: no test specified\" && exit 1"
29
+ "watch": "rollup -c -w"
16
30
  },
17
- "keywords": [
18
- "analytics",
19
- "feedback",
20
- "tracking",
21
- "user-behavior",
22
- "session-recording"
23
- ],
31
+
24
32
  "author": "Pulsetrack",
25
33
  "license": "UNLICENSED",
26
34
  "homepage": "https://rojastudio.xyz",
27
- "exports": {
28
- ".": {
29
- "import": "./dist/index.js",
30
- "require": "./dist/index.cjs"
31
- }
32
- },
33
- "devDependencies": {
34
- "@rollup/plugin-commonjs": "^29.0.0",
35
- "@rollup/plugin-node-resolve": "^16.0.3",
36
- "@rollup/plugin-terser": "^0.4.4",
37
- "@rollup/plugin-typescript": "^12.3.0",
38
- "@types/html2canvas": "^1.0.0",
39
- "rollup": "^4.54.0",
40
- "rollup-plugin-javascript-obfuscator": "^1.0.4",
41
- "typescript": "^5.9.3"
42
- },
35
+
43
36
  "dependencies": {
44
37
  "@fingerprintjs/fingerprintjs": "^5.0.1",
45
38
  "html2canvas": "^1.4.1",
46
39
  "rrweb": "^2.0.0-alpha.4",
47
40
  "tslib": "^2.8.1"
48
41
  }
49
- }
42
+ }