deltas-js 1.0.0 → 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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(i,n)=>{for(var t in n)o(i,t,{get:n[t],enumerable:!0})},p=(i,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of d(n))!g.call(i,e)&&e!==t&&o(i,e,{get:()=>n[e],enumerable:!(s=a(n,e))||s.enumerable});return i};var y=i=>p(o({},"__esModule",{value:!0}),i);var l={};h(l,{default:()=>r});module.exports=y(l);var r=class{constructor(n,t){typeof n=="string"?(this.host=n.replace(/\/+$/,""),this.apiKey=t):(this.host=n.host.replace(/\/+$/,""),this.apiKey=n.apiKey)}send(n,t){try{fetch(`${this.host}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(t),keepalive:!0})}catch{}}log(n,t,s){this.send("/log",{what:n,data:t,user_id:s})}info(n,t,s){this.send("/log/info",{what:n,data:t,user_id:s})}warn(n,t,s){this.send("/log/warn",{what:n,data:t,user_id:s})}error(n,t,s){this.send("/log/error",{what:n,data:t,user_id:s})}fyi(n,t,s){this.send("/fyi",{what:n,data:t,user_id:s})}notify(n,t,s){this.send("/notify",{what:n,data:t,user_id:s})}email(n,t,s){this.send("/email",{what:n,data:t,user_id:s})}run(n,t,s){this.send("/run",{what:n,data:t,user_id:s})}};
1
+ "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var p=(n,s)=>{for(var t in s)o(n,t,{get:s[t],enumerable:!0})},g=(n,s,t,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of d(s))!h.call(n,i)&&i!==t&&o(n,i,{get:()=>s[i],enumerable:!(e=a(s,i))||e.enumerable});return n};var y=n=>g(o({},"__esModule",{value:!0}),n);var l={};p(l,{default:()=>r});module.exports=y(l);var r=class{constructor(s,t){if(typeof s=="string")this.host=s.replace(/\/+$/,""),this.apiKey=t;else if(s&&typeof s=="object")this.host=s.host.replace(/\/+$/,""),this.apiKey=s.apiKey;else if(this.host=(process.env.DELTAS_HOST||"").replace(/\/+$/,""),this.apiKey=process.env.DELTAS_API_KEY||"",!this.host||!this.apiKey)throw new Error("Deltas: host and apiKey must be provided either as arguments or via DELTAS_HOST and DELTAS_API_KEY environment variables")}send(s,t){try{fetch(`${this.host}${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(t),keepalive:!0})}catch{}}log(s,t,e){this.send("/log",{what:s,data:t,user_id:e})}info(s,t,e){this.send("/log/info",{what:s,data:t,user_id:e})}warn(s,t,e){this.send("/log/warn",{what:s,data:t,user_id:e})}error(s,t,e){this.send("/log/error",{what:s,data:t,user_id:e})}fyi(s,t,e){this.send("/fyi",{what:s,data:t,user_id:e})}notify(s,t,e){this.send("/notify",{what:s,data:t,user_id:e})}email(s,t,e){this.send("/email",{what:s,data:t,user_id:e})}run(s,t,e){this.send("/run",{what:s,data:t,user_id:e})}};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var i=class{constructor(n,t){typeof n=="string"?(this.host=n.replace(/\/+$/,""),this.apiKey=t):(this.host=n.host.replace(/\/+$/,""),this.apiKey=n.apiKey)}send(n,t){try{fetch(`${this.host}${n}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(t),keepalive:!0})}catch{}}log(n,t,s){this.send("/log",{what:n,data:t,user_id:s})}info(n,t,s){this.send("/log/info",{what:n,data:t,user_id:s})}warn(n,t,s){this.send("/log/warn",{what:n,data:t,user_id:s})}error(n,t,s){this.send("/log/error",{what:n,data:t,user_id:s})}fyi(n,t,s){this.send("/fyi",{what:n,data:t,user_id:s})}notify(n,t,s){this.send("/notify",{what:n,data:t,user_id:s})}email(n,t,s){this.send("/email",{what:n,data:t,user_id:s})}run(n,t,s){this.send("/run",{what:n,data:t,user_id:s})}};export{i as default};
1
+ var n=class{constructor(s,t){if(typeof s=="string")this.host=s.replace(/\/+$/,""),this.apiKey=t;else if(s&&typeof s=="object")this.host=s.host.replace(/\/+$/,""),this.apiKey=s.apiKey;else if(this.host=(process.env.DELTAS_HOST||"").replace(/\/+$/,""),this.apiKey=process.env.DELTAS_API_KEY||"",!this.host||!this.apiKey)throw new Error("Deltas: host and apiKey must be provided either as arguments or via DELTAS_HOST and DELTAS_API_KEY environment variables")}send(s,t){try{fetch(`${this.host}${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(t),keepalive:!0})}catch{}}log(s,t,e){this.send("/log",{what:s,data:t,user_id:e})}info(s,t,e){this.send("/log/info",{what:s,data:t,user_id:e})}warn(s,t,e){this.send("/log/warn",{what:s,data:t,user_id:e})}error(s,t,e){this.send("/log/error",{what:s,data:t,user_id:e})}fyi(s,t,e){this.send("/fyi",{what:s,data:t,user_id:e})}notify(s,t,e){this.send("/notify",{what:s,data:t,user_id:e})}email(s,t,e){this.send("/email",{what:s,data:t,user_id:e})}run(s,t,e){this.send("/run",{what:s,data:t,user_id:e})}};export{n as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deltas-js",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "JS/TS Server SDK for deltas.dev",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -46,5 +46,8 @@
46
46
  "devDependencies": {
47
47
  "tsup": "^8.5.1",
48
48
  "typescript": "^5.9.3"
49
+ },
50
+ "dependencies": {
51
+ "@types/node": "^25.0.9"
49
52
  }
50
53
  }