@affogatosoftware/recorder 1.0.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/README.md +13 -0
- package/dist/browser/recorder.es.js +6136 -0
- package/dist/browser/recorder.iife.js +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/logger.d.ts +5 -0
- package/dist/logger.js +11 -0
- package/dist/recorder/eventRecorder.d.ts +48 -0
- package/dist/recorder/eventRecorder.js +399 -0
- package/dist/recorder/recorder.d.ts +49 -0
- package/dist/recorder/recorder.js +112 -0
- package/dist/recorder/sessionRecorder.d.ts +19 -0
- package/dist/recorder/sessionRecorder.js +104 -0
- package/dist/requests.d.ts +7 -0
- package/dist/requests.js +13 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +16 -0
- package/package.json +44 -0
package/dist/requests.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import axios, {} from "axios";
|
|
2
|
+
const api = axios.create({
|
|
3
|
+
baseURL: window.location.hostname.includes("localhost")
|
|
4
|
+
? "http://localhost:8080"
|
|
5
|
+
: "",
|
|
6
|
+
withCredentials: true,
|
|
7
|
+
});
|
|
8
|
+
export const get = (url, config) => api.get(url, config);
|
|
9
|
+
export const post = (url, data, config) => api.post(url, data, config);
|
|
10
|
+
export const del = (url, config) => api.delete(url, config);
|
|
11
|
+
export const put = (url, data, config) => api.put(url, data, config);
|
|
12
|
+
export const patch = (url, data, config) => api.patch(url, data, config);
|
|
13
|
+
export const postForm = (url, data, config) => api.postForm(url, data, config);
|
package/dist/utils.d.ts
ADDED
package/dist/utils.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function assertNever(x) {
|
|
2
|
+
throw new Error("Unexpected object: " + x);
|
|
3
|
+
}
|
|
4
|
+
export function capitalizeFirst(str) {
|
|
5
|
+
if (str == null)
|
|
6
|
+
return str; // empty / null safety
|
|
7
|
+
return str[0].toUpperCase() + str.slice(1);
|
|
8
|
+
}
|
|
9
|
+
export function msToReadable(ms) {
|
|
10
|
+
const seconds = Math.floor((ms / 1000) % 60);
|
|
11
|
+
const minutes = Math.floor((ms / 1000 / 60));
|
|
12
|
+
return `${numberToPaddedString(minutes)}:${numberToPaddedString(seconds)}`;
|
|
13
|
+
}
|
|
14
|
+
export function numberToPaddedString(n) {
|
|
15
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
16
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@affogatosoftware/recorder",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Chris Ryan",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"browser": "./dist/browser/recorder.iife.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"unpkg": "./dist/browser/recorder.iife.js",
|
|
16
|
+
"jsdelivr": "./dist/browser/recorder.iife.js",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/pyrrhic/recorder.git"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.build.json",
|
|
24
|
+
"build:browser": "vite build",
|
|
25
|
+
"prepublishOnly": "npm run build && npm run build:browser"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"typescript": "~5.8.3",
|
|
29
|
+
"vite": "^7.0.0",
|
|
30
|
+
"vite-plugin-dts": "^4.5.4"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"axios": "^1.10.0",
|
|
34
|
+
"rrweb": "^2.0.0-alpha.4",
|
|
35
|
+
"ua-parser-js": "^2.0.4"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"dist/browser"
|
|
43
|
+
]
|
|
44
|
+
}
|