stone-analytics 0.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.
@@ -0,0 +1,5 @@
1
+ declare const makeTimeBasedUID: () => string;
2
+ declare const setSessionId: () => void;
3
+ declare const setClientId: () => void;
4
+
5
+ export { makeTimeBasedUID, setClientId, setSessionId };
@@ -0,0 +1,5 @@
1
+ declare const makeTimeBasedUID: () => string;
2
+ declare const setSessionId: () => void;
3
+ declare const setClientId: () => void;
4
+
5
+ export { makeTimeBasedUID, setClientId, setSessionId };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},x=(t,e,n,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of m(e))!c.call(t,o)&&o!==n&&s(t,o,{get:()=>e[o],enumerable:!(d=a(e,o))||d.enumerable});return t};var I=t=>x(s({},"__esModule",{value:!0}),t);var g={};p(g,{makeTimeBasedUID:()=>i,setClientId:()=>f,setSessionId:()=>_});module.exports=I(g);var r=require("cookies-next"),i=()=>String(Date.now())+String(Math.floor(Math.random()*(999999999-1e8+1))+1e8),_=()=>{let t=i();(0,r.setCookie)("st_session_id",t)},f=()=>{let t=i();(0,r.setCookie)("st_client_id",t,{maxAge:31536e3})};0&&(module.exports={makeTimeBasedUID,setClientId,setSessionId});
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/utils.ts"],"sourcesContent":["export * from './utils/utils'","import { setCookie } from \"cookies-next\"\n\nexport const makeTimeBasedUID = () => {\n return String(Date.now()) + String(Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000);\n}\n\nexport const setSessionId = () => {\n const newId = makeTimeBasedUID()\n setCookie('st_session_id', newId)\n}\n\nexport const setClientId = () => {\n const newId = makeTimeBasedUID()\n //на год\n setCookie('st_client_id', newId, { maxAge: 31536000 })\n}"],"mappings":"4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,gBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAL,GCAA,IAAAM,EAA0B,wBAEbC,EAAmB,IACvB,OAAO,KAAK,IAAI,CAAC,EAAI,OAAO,KAAK,MAAM,KAAK,OAAO,GAAK,UAAY,IAAY,EAAE,EAAI,GAAS,EAG3FC,EAAe,IAAM,CAChC,IAAMC,EAAQF,EAAiB,KAC/B,aAAU,gBAAiBE,CAAK,CAClC,EAEaC,EAAc,IAAM,CAC/B,IAAMD,EAAQF,EAAiB,KAE/B,aAAU,eAAgBE,EAAO,CAAE,OAAQ,OAAS,CAAC,CACvD","names":["src_exports","__export","makeTimeBasedUID","setClientId","setSessionId","__toCommonJS","import_cookies_next","makeTimeBasedUID","setSessionId","newId","setClientId"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{setCookie as e}from"cookies-next";var o=()=>String(Date.now())+String(Math.floor(Math.random()*(999999999-1e8+1))+1e8),s=()=>{let t=o();e("st_session_id",t)},r=()=>{let t=o();e("st_client_id",t,{maxAge:31536e3})};export{o as makeTimeBasedUID,r as setClientId,s as setSessionId};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/utils.ts"],"sourcesContent":["import { setCookie } from \"cookies-next\"\n\nexport const makeTimeBasedUID = () => {\n return String(Date.now()) + String(Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000);\n}\n\nexport const setSessionId = () => {\n const newId = makeTimeBasedUID()\n setCookie('st_session_id', newId)\n}\n\nexport const setClientId = () => {\n const newId = makeTimeBasedUID()\n //на год\n setCookie('st_client_id', newId, { maxAge: 31536000 })\n}"],"mappings":"AAAA,OAAS,aAAAA,MAAiB,eAEnB,IAAMC,EAAmB,IACvB,OAAO,KAAK,IAAI,CAAC,EAAI,OAAO,KAAK,MAAM,KAAK,OAAO,GAAK,UAAY,IAAY,EAAE,EAAI,GAAS,EAG3FC,EAAe,IAAM,CAChC,IAAMC,EAAQF,EAAiB,EAC/BD,EAAU,gBAAiBG,CAAK,CAClC,EAEaC,EAAc,IAAM,CAC/B,IAAMD,EAAQF,EAAiB,EAE/BD,EAAU,eAAgBG,EAAO,CAAE,OAAQ,OAAS,CAAC,CACvD","names":["setCookie","makeTimeBasedUID","setSessionId","newId","setClientId"]}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "stone-analytics",
3
+ "version": "0.0.1",
4
+ "description": "send stanal",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./*": "./dist/*"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "prepublishOnly": "npm run build"
21
+ },
22
+ "dependencies": {
23
+ "cookies-next": "^2.1.2"
24
+ },
25
+ "devDependencies": {
26
+ "tsup": "^7.0.0",
27
+ "typescript": "^5.8.2"
28
+ },
29
+ "engines": {
30
+ "node": ">=18"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "license": "MIT"
36
+ }