@betterbugs/rrweb-plugin-sequential-id-record 2.0.0-alpha.19

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 ADDED
@@ -0,0 +1,202 @@
1
+ # @rrweb/rrweb-plugin-sequential-id-record
2
+
3
+ Use this plugin in combination with the [@rrweb/rrweb-plugin-sequential-id-replay](../rrweb-plugin-sequential-id-replay) plugin to record and replay events with a sequential id.
4
+ See the [guide](../../../guide.md) for more info on rrweb.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm install @rrweb/rrweb-plugin-sequential-id-record
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```js
15
+ import rrweb from 'rrweb';
16
+ import { getRecordSequentialIdPlugin } from '@rrweb/rrweb-plugin-sequential-id-record';
17
+
18
+ rrweb.record({
19
+ emit: function emit(event) {
20
+ // send events to server
21
+ },
22
+ plugins: [
23
+ getRecordSequentialIdPlugin({
24
+ key: '_sid', // default value
25
+ }),
26
+ ],
27
+ });
28
+ ```
29
+
30
+ ## Sponsors
31
+
32
+ [Become a sponsor](https://opencollective.com/rrweb#sponsor) and get your logo on our README on Github with a link to your site.
33
+
34
+ ### Gold Sponsors 🥇
35
+
36
+ <div dir="auto">
37
+
38
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/0/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
39
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/1/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
40
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/2/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
41
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/3/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
42
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/4/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
43
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/5/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
44
+ <a href="https://opencollective.com/rrweb/tiers/gold-sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/gold-sponsor/6/avatar.svg?requireActive=false&avatarHeight=225" alt="sponsor"></a>
45
+
46
+ </div>
47
+
48
+ ### Silver Sponsors 🥈
49
+
50
+ <div dir="auto">
51
+
52
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/0/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
53
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/1/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
54
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/2/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
55
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/3/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
56
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/4/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
57
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/5/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
58
+ <a href="https://opencollective.com/rrweb/tiers/silver-sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/silver-sponsor/6/avatar.svg?requireActive=false&avatarHeight=158" alt="sponsor"></a>
59
+
60
+ </div>
61
+
62
+ ### Bronze Sponsors 🥉
63
+
64
+ <div dir="auto">
65
+
66
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/0/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
67
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/1/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
68
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/2/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
69
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/3/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
70
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/4/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
71
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/5/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
72
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/6/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
73
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/7/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
74
+ <a href="https://opencollective.com/rrweb/tiers/sponsors/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/rrweb/tiers/sponsors/8/avatar.svg?requireActive=false&avatarHeight=70" alt="sponsor"></a>
75
+
76
+ </div>
77
+
78
+ ### Backers
79
+
80
+ <a href="https://opencollective.com/rrweb#sponsor" rel="nofollow"><img src="https://opencollective.com/rrweb/tiers/backers.svg?avatarHeight=36"></a>
81
+
82
+ ## Core Team Members
83
+
84
+ <table>
85
+ <tr>
86
+ <td align="center">
87
+ <a href="https://github.com/Yuyz0112">
88
+ <img
89
+ src="https://avatars.githubusercontent.com/u/13651389?s=100"
90
+ width="100px;"
91
+ alt=""
92
+ />
93
+ <br /><sub><b>Yuyz0112</b></sub>
94
+ <br /><br />
95
+ </a>
96
+ </td>
97
+ <td align="center">
98
+ <a href="https://github.com/YunFeng0817">
99
+ <img
100
+ src="https://avatars.githubusercontent.com/u/27533910?s=100"
101
+ width="100px;"
102
+ alt=""
103
+ />
104
+ <br /><sub><b>Yun Feng</b></sub>
105
+ <br /><br />
106
+ </a>
107
+ </td>
108
+ <td align="center">
109
+ <a href="https://github.com/eoghanmurray">
110
+ <img
111
+ src="https://avatars.githubusercontent.com/u/156780?s=100"
112
+ width="100px;"
113
+ alt=""
114
+ />
115
+ <br /><sub><b>eoghanmurray</b></sub>
116
+ <br /><br />
117
+ </a>
118
+ </td>
119
+ <td align="center">
120
+ <a href="https://github.com/Juice10">
121
+ <img
122
+ src="https://avatars.githubusercontent.com/u/4106?s=100"
123
+ width="100px;"
124
+ alt=""
125
+ />
126
+ <br /><sub><b>Juice10</b></sub>
127
+ <br /><sub>open for rrweb consulting</sub>
128
+ </a>
129
+ </td>
130
+ </tr>
131
+ </table>
132
+
133
+ ## Who's using rrweb?
134
+
135
+ <table>
136
+ <tr>
137
+ <td align="center">
138
+ <a href="http://www.smartx.com/" target="_blank">
139
+ <img width="195px" src="https://www.rrweb.io/logos/smartx.png">
140
+ </a>
141
+ </td>
142
+ <td align="center">
143
+ <a href="https://posthog.com?utm_source=rrweb&utm_medium=sponsorship&utm_campaign=open-source-sponsorship" target="_blank">
144
+ <img width="195px" src="https://www.rrweb.io/logos/posthog.png">
145
+ </a>
146
+ </td>
147
+ <td align="center">
148
+ <a href="https://statcounter.com/session-replay/" target="_blank">
149
+ <img width="195px" src="https://statcounter.com/images/logo-statcounter-arc-blue.svg">
150
+ </a>
151
+ </td>
152
+ <td align="center">
153
+ <a href="https://recordonce.com/" target="_blank">
154
+ <img width="195px" alt="Smart screen recording for SaaS" src="https://uploads-ssl.webflow.com/5f3d133183156245630d4446/5f3d1940abe8db8612c23521_Record-Once-logo-554x80px.svg">
155
+ </a>
156
+ </td>
157
+ </tr>
158
+ <tr>
159
+ <td align="center">
160
+ <a href="https://cux.io" target="_blank">
161
+ <img style="padding: 8px" alt="The first ever UX automation tool" width="195px" src="https://cux.io/cux-logo.svg">
162
+ </a>
163
+ </td>
164
+ <td align="center">
165
+ <a href="https://remsupp.com" target="_blank">
166
+ <img style="padding: 8px" alt="Remote Access & Co-Browsing" width="195px" src="https://remsupp.com/images/logo.png">
167
+ </a>
168
+ </td>
169
+ <td align="center">
170
+ <a href="https://highlight.io" target="_blank">
171
+ <img style="padding: 8px" alt="The open source, fullstack Monitoring Platform." width="195px" src="https://github.com/highlight/highlight/raw/main/highlight.io/public/images/logo.png">
172
+ </a>
173
+ </td>
174
+ <td align="center">
175
+ <a href="https://analyzee.io" target="_blank">
176
+ <img style="padding: 8px" alt="Comprehensive data analytics platform that empowers businesses to gain valuable insights and make data-driven decisions." width="195px" src="https://cdn.analyzee.io/assets/analyzee-logo.png">
177
+ </a>
178
+ </td>
179
+ </tr>
180
+ <tr>
181
+ <td align="center">
182
+ <a href="https://requestly.io" target="_blank">
183
+ <img style="padding: 8px" alt="Intercept, Modify, Record & Replay HTTP Requests." width="195px" src="https://github.com/requestly/requestly/assets/16779465/652552db-c867-44cb-9bb5-94a2026e04ca">
184
+ </a>
185
+ </td>
186
+ <td align="center">
187
+ <a href="https://gleap.io" target="_blank">
188
+ <img style="padding: 8px" alt="In-app bug reporting & customer feedback platform." width="195px" src="https://assets-global.website-files.com/6506f3f29c68b1724807619d/6506f56010237164c6306591_GleapLogo.svg">
189
+ </a>
190
+ </td>
191
+ <td align="center">
192
+ <a href="https://uxwizz.com" target="_blank">
193
+ <img style="padding: 8px" alt="Self-hosted website analytics with heatmaps and session recordings." width="195px" src="https://github.com/UXWizz/public-files/raw/main/assets/logo.png">
194
+ </a>
195
+ </td>
196
+ <td align="center">
197
+ <a href="https://www.howdygo.com" target="_blank">
198
+ <img style="padding: 8px" alt="Interactive product demos for small marketing teams" width="195px" src="https://assets-global.website-files.com/650afb446f1dd5bd410f00cc/650b2cec6188ff54dd9b01e1_Logo.svg">
199
+ </a>
200
+ </td>
201
+ </tr>
202
+ </table>
@@ -0,0 +1,11 @@
1
+ import { RecordPlugin } from '@betterbugs/types';
2
+
3
+ export declare const getRecordSequentialIdPlugin: (options?: Partial<SequentialIdOptions>) => RecordPlugin;
4
+
5
+ export declare const PLUGIN_NAME = "rrweb/sequential-id@1";
6
+
7
+ export declare type SequentialIdOptions = {
8
+ key: string;
9
+ };
10
+
11
+ export { }
@@ -0,0 +1,11 @@
1
+ import { RecordPlugin } from '@betterbugs/types';
2
+
3
+ export declare const getRecordSequentialIdPlugin: (options?: Partial<SequentialIdOptions>) => RecordPlugin;
4
+
5
+ export declare const PLUGIN_NAME = "rrweb/sequential-id@1";
6
+
7
+ export declare type SequentialIdOptions = {
8
+ key: string;
9
+ };
10
+
11
+ export { }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const defaultOptions = {
4
+ key: "_sid"
5
+ };
6
+ const PLUGIN_NAME = "rrweb/sequential-id@1";
7
+ const getRecordSequentialIdPlugin = (options) => {
8
+ const _options = options ? Object.assign({}, defaultOptions, options) : defaultOptions;
9
+ let id = 0;
10
+ return {
11
+ name: PLUGIN_NAME,
12
+ eventProcessor(event) {
13
+ Object.assign(event, {
14
+ [_options.key]: ++id
15
+ });
16
+ return event;
17
+ },
18
+ options: _options
19
+ };
20
+ };
21
+ exports.PLUGIN_NAME = PLUGIN_NAME;
22
+ exports.getRecordSequentialIdPlugin = getRecordSequentialIdPlugin;
23
+ //# sourceMappingURL=rrweb-plugin-sequential-id-record.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rrweb-plugin-sequential-id-record.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { RecordPlugin } from '@betterbugs/types';\n\nexport type SequentialIdOptions = {\n key: string;\n};\n\nconst defaultOptions: SequentialIdOptions = {\n key: '_sid',\n};\n\nexport const PLUGIN_NAME = 'rrweb/sequential-id@1';\n\nexport const getRecordSequentialIdPlugin: (\n options?: Partial<SequentialIdOptions>,\n) => RecordPlugin = (options) => {\n const _options = options\n ? Object.assign({}, defaultOptions, options)\n : defaultOptions;\n let id = 0;\n\n return {\n name: PLUGIN_NAME,\n eventProcessor(event) {\n Object.assign(event, {\n [_options.key]: ++id,\n });\n return event;\n },\n options: _options,\n };\n};\n"],"names":[],"mappings":";;AAMA,MAAM,iBAAsC;AAAA,EAC1C,KAAK;AACP;AAEO,MAAM,cAAc;AAEd,MAAA,8BAEO,CAAC,YAAY;AACzB,QAAA,WAAW,UACb,OAAO,OAAO,CAAA,GAAI,gBAAgB,OAAO,IACzC;AACJ,MAAI,KAAK;AAEF,SAAA;AAAA,IACL,MAAM;AAAA,IACN,eAAe,OAAO;AACpB,aAAO,OAAO,OAAO;AAAA,QACnB,CAAC,SAAS,GAAG,GAAG,EAAE;AAAA,MAAA,CACnB;AACM,aAAA;AAAA,IACT;AAAA,IACA,SAAS;AAAA,EAAA;AAEb;;;"}
@@ -0,0 +1,23 @@
1
+ const defaultOptions = {
2
+ key: "_sid"
3
+ };
4
+ const PLUGIN_NAME = "rrweb/sequential-id@1";
5
+ const getRecordSequentialIdPlugin = (options) => {
6
+ const _options = options ? Object.assign({}, defaultOptions, options) : defaultOptions;
7
+ let id = 0;
8
+ return {
9
+ name: PLUGIN_NAME,
10
+ eventProcessor(event) {
11
+ Object.assign(event, {
12
+ [_options.key]: ++id
13
+ });
14
+ return event;
15
+ },
16
+ options: _options
17
+ };
18
+ };
19
+ export {
20
+ PLUGIN_NAME,
21
+ getRecordSequentialIdPlugin
22
+ };
23
+ //# sourceMappingURL=rrweb-plugin-sequential-id-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rrweb-plugin-sequential-id-record.js","sources":["../src/index.ts"],"sourcesContent":["import type { RecordPlugin } from '@betterbugs/types';\n\nexport type SequentialIdOptions = {\n key: string;\n};\n\nconst defaultOptions: SequentialIdOptions = {\n key: '_sid',\n};\n\nexport const PLUGIN_NAME = 'rrweb/sequential-id@1';\n\nexport const getRecordSequentialIdPlugin: (\n options?: Partial<SequentialIdOptions>,\n) => RecordPlugin = (options) => {\n const _options = options\n ? Object.assign({}, defaultOptions, options)\n : defaultOptions;\n let id = 0;\n\n return {\n name: PLUGIN_NAME,\n eventProcessor(event) {\n Object.assign(event, {\n [_options.key]: ++id,\n });\n return event;\n },\n options: _options,\n };\n};\n"],"names":[],"mappings":"AAMA,MAAM,iBAAsC;AAAA,EAC1C,KAAK;AACP;AAEO,MAAM,cAAc;AAEd,MAAA,8BAEO,CAAC,YAAY;AACzB,QAAA,WAAW,UACb,OAAO,OAAO,CAAA,GAAI,gBAAgB,OAAO,IACzC;AACJ,MAAI,KAAK;AAEF,SAAA;AAAA,IACL,MAAM;AAAA,IACN,eAAe,OAAO;AACpB,aAAO,OAAO,OAAO;AAAA,QACnB,CAAC,SAAS,GAAG,GAAG,EAAE;AAAA,MAAA,CACnB;AACM,aAAA;AAAA,IACT;AAAA,IACA,SAAS;AAAA,EAAA;AAEb;"}
@@ -0,0 +1,53 @@
1
+ (function (g, f) {
2
+ if ("object" == typeof exports && "object" == typeof module) {
3
+ module.exports = f();
4
+ } else if ("function" == typeof define && define.amd) {
5
+ define("rrwebPluginSequentialIdRecord", [], f);
6
+ } else if ("object" == typeof exports) {
7
+ exports["rrwebPluginSequentialIdRecord"] = f();
8
+ } else {
9
+ g["rrwebPluginSequentialIdRecord"] = f();
10
+ }
11
+ }(this, () => {
12
+ var exports = {};
13
+ var module = { exports };
14
+ "use strict";
15
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
16
+ const defaultOptions = {
17
+ key: "_sid"
18
+ };
19
+ const PLUGIN_NAME = "rrweb/sequential-id@1";
20
+ const getRecordSequentialIdPlugin = (options) => {
21
+ const _options = options ? Object.assign({}, defaultOptions, options) : defaultOptions;
22
+ let id = 0;
23
+ return {
24
+ name: PLUGIN_NAME,
25
+ eventProcessor(event) {
26
+ Object.assign(event, {
27
+ [_options.key]: ++id
28
+ });
29
+ return event;
30
+ },
31
+ options: _options
32
+ };
33
+ };
34
+ exports.PLUGIN_NAME = PLUGIN_NAME;
35
+ exports.getRecordSequentialIdPlugin = getRecordSequentialIdPlugin;
36
+ if (typeof module.exports == "object" && typeof exports == "object") {
37
+ var __cp = (to, from, except, desc) => {
38
+ if ((from && typeof from === "object") || typeof from === "function") {
39
+ for (let key of Object.getOwnPropertyNames(from)) {
40
+ if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
41
+ Object.defineProperty(to, key, {
42
+ get: () => from[key],
43
+ enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
44
+ });
45
+ }
46
+ }
47
+ return to;
48
+ };
49
+ module.exports = __cp(module.exports, exports);
50
+ }
51
+ return module.exports;
52
+ }))
53
+ //# sourceMappingURL=rrweb-plugin-sequential-id-record.umd.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["import type { RecordPlugin } from '@betterbugs/types';\n\nexport type SequentialIdOptions = {\n key: string;\n};\n\nconst defaultOptions: SequentialIdOptions = {\n key: '_sid',\n};\n\nexport const PLUGIN_NAME = 'rrweb/sequential-id@1';\n\nexport const getRecordSequentialIdPlugin: (\n options?: Partial<SequentialIdOptions>,\n) => RecordPlugin = (options) => {\n const _options = options\n ? Object.assign({}, defaultOptions, options)\n : defaultOptions;\n let id = 0;\n\n return {\n name: PLUGIN_NAME,\n eventProcessor(event) {\n Object.assign(event, {\n [_options.key]: ++id,\n });\n return event;\n },\n options: _options,\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAMA,MAAM,iBAAsC;EAC1C,KAAK;AACP;AAEO,MAAM,cAAc;AAEd,MAAA,8BAEO,CAAC,YAAY;AACzB,QAAA,WAAW,UACb,OAAO,OAAO,CAAA,GAAI,gBAAgB,OAAO,IACzC;AACJ,MAAI,KAAK;AAEF,SAAA;IACL,MAAM;IACN,eAAe,OAAO;AACpB,aAAO,OAAO,OAAO;QACnB,CAAC,SAAS,GAAG,GAAG,EAAE;MAAA,CACnB;AACM,aAAA;IACT;IACA,SAAS;EAAA;AAEb;;;",
6
+ "names": []
7
+ }
@@ -0,0 +1,32 @@
1
+ (function (g, f) {
2
+ if ("object" == typeof exports && "object" == typeof module) {
3
+ module.exports = f();
4
+ } else if ("function" == typeof define && define.amd) {
5
+ define("rrwebPluginSequentialIdRecord", [], f);
6
+ } else if ("object" == typeof exports) {
7
+ exports["rrwebPluginSequentialIdRecord"] = f();
8
+ } else {
9
+ g["rrwebPluginSequentialIdRecord"] = f();
10
+ }
11
+ }(this, () => {
12
+ var exports = {};
13
+ var module = { exports };
14
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={key:"_sid"},i="rrweb/sequential-id@1",r=e=>{const t=e?Object.assign({},s,e):s;let o=0;return{name:i,eventProcessor(n){return Object.assign(n,{[t.key]:++o}),n},options:t}};exports.PLUGIN_NAME=i;exports.getRecordSequentialIdPlugin=r;
15
+ if (typeof module.exports == "object" && typeof exports == "object") {
16
+ var __cp = (to, from, except, desc) => {
17
+ if ((from && typeof from === "object") || typeof from === "function") {
18
+ for (let key of Object.getOwnPropertyNames(from)) {
19
+ if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
20
+ Object.defineProperty(to, key, {
21
+ get: () => from[key],
22
+ enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
23
+ });
24
+ }
25
+ }
26
+ return to;
27
+ };
28
+ module.exports = __cp(module.exports, exports);
29
+ }
30
+ return module.exports;
31
+ }))
32
+ //# sourceMappingURL=rrweb-plugin-sequential-id-record.umd.min.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["import type { RecordPlugin } from '@betterbugs/types';\n\nexport type SequentialIdOptions = {\n key: string;\n};\n\nconst defaultOptions: SequentialIdOptions = {\n key: '_sid',\n};\n\nexport const PLUGIN_NAME = 'rrweb/sequential-id@1';\n\nexport const getRecordSequentialIdPlugin: (\n options?: Partial<SequentialIdOptions>,\n) => RecordPlugin = (options) => {\n const _options = options\n ? Object.assign({}, defaultOptions, options)\n : defaultOptions;\n let id = 0;\n\n return {\n name: PLUGIN_NAME,\n eventProcessor(event) {\n Object.assign(event, {\n [_options.key]: ++id,\n });\n return event;\n },\n options: _options,\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;gFAMA,MAAMA,EAAsC,CAC1C,IAAK,MACP,EAEaC,EAAc,wBAEdC,EAEQC,GAAY,CACzB,MAAAC,EAAWD,EACb,OAAO,OAAO,CAAA,EAAIH,EAAgBG,CAAO,EACzCH,EACJ,IAAIK,EAAK,EAEF,MAAA,CACL,KAAMJ,EACN,eAAeK,EAAO,CACpB,cAAO,OAAOA,EAAO,CACnB,CAACF,EAAS,GAAG,EAAG,EAAEC,CAAA,CACnB,EACMC,CACT,EACA,QAASF,CAAA,CAEb",
6
+ "names": ["defaultOptions", "PLUGIN_NAME", "getRecordSequentialIdPlugin", "options", "_options", "id", "event"]
7
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@betterbugs/rrweb-plugin-sequential-id-record",
3
+ "version": "2.0.0-alpha.19",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "",
8
+ "type": "module",
9
+ "main": "./dist/rrweb-plugin-sequential-id-record.umd.cjs",
10
+ "module": "./dist/rrweb-plugin-sequential-id-record.js",
11
+ "unpkg": "./dist/rrweb-plugin-sequential-id-record.umd.cjs",
12
+ "typings": "dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/rrweb-plugin-sequential-id-record.js"
18
+ },
19
+ "require": {
20
+ "types": "./dist/index.d.cts",
21
+ "default": "./dist/rrweb-plugin-sequential-id-record.umd.cjs"
22
+ }
23
+ }
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "package.json"
28
+ ],
29
+ "scripts": {
30
+ "dev": "vite build --watch",
31
+ "build": "yarn turbo run prepublish",
32
+ "check-types": "tsc -noEmit",
33
+ "prepublish": "tsc -noEmit && vite build"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/BetterBugs-Team/rrweb.git"
38
+ },
39
+ "keywords": [
40
+ "rrweb",
41
+ "betterbugs"
42
+ ],
43
+ "author": "BetterBugs-Team",
44
+ "license": "MIT",
45
+ "bugs": {
46
+ "url": "https://github.com/BetterBugs-Team/rrweb/issues"
47
+ },
48
+ "homepage": "https://github.com/BetterBugs-Team/rrweb#readme",
49
+ "devDependencies": {
50
+ "@betterbugs/rrweb": "^2.0.0-alpha.19",
51
+ "typescript": "^5.4.5",
52
+ "vite": "^5.3.1",
53
+ "vite-plugin-dts": "^3.9.1"
54
+ },
55
+ "peerDependencies": {
56
+ "@betterbugs/rrweb": "^2.0.0-alpha.19"
57
+ }
58
+ }