@picked/telemetry 0.0.86 → 0.0.87-next.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/cjs/index.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`@picked/telemetry`,t={unset:0,ok:1,error:2};function n(){return`0.0.86`}function r(e){return typeof e==`string`?{stringValue:e}:typeof e==`boolean`?{boolValue:e}:Number.isInteger(e)?{intValue:e.toString()}:{doubleValue:e}}function i(e){return Object.entries(e).map(([e,t])=>({key:e,value:r(t)}))}function a(e){return{traceId:e.traceId,spanId:e.spanId,...e.parentSpanId?{parentSpanId:e.parentSpanId}:{},name:e.name,kind:1,startTimeUnixNano:e.startTimeUnixNano,endTimeUnixNano:e.endTimeUnixNano,attributes:i(e.attributes),status:{code:t[e.status]}}}function o(t,r){return{resourceSpans:[{resource:{attributes:i(t)},scopeSpans:[{scope:{name:e,version:n()},spans:r.map(a)}]}]}}var s=`https://production.otel.picked.app/v1/traces`,c=50,l=3e3;function u(e){let t=e.endpoint??`https://production.otel.picked.app/v1/traces`,n=e.maxBatchSize??c,r=[];async function i(){if(r.length===0)return;let n=r;r=[];let i=globalThis.fetch;if(typeof i==`function`)try{await i(t,{method:`POST`,keepalive:!0,headers:{"Content-Type":`application/json`,...e.headers},body:JSON.stringify(o(e.resource,n)),signal:AbortSignal.timeout(l)})}catch{}}return{record:e=>{r.push(e),r.length>=n&&i()},flush:i,bufferedCount:()=>r.length}}var d=16,f=8;function p(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),t.every(e=>e===0)&&(t[0]=1),t}function m(e){let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return t}function h(){return m(p(d))}function g(){return m(p(f))}function _(e,t,n){return`00-${e}-${t}-${n?`01`:`00`}`}var v=1000000n;function y(e){let t=Math.trunc(e),n=Math.round((e-t)*Number(v));return(BigInt(t)*v+BigInt(n)).toString()}exports.DEFAULT_TELEMETRY_ENDPOINT=s,exports.createSpanId=g,exports.createTelemetryEmitter=u,exports.createTraceId=h,exports.formatTraceparent=_,exports.toUnixNano=y;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`@picked/telemetry`,t={unset:0,ok:1,error:2};function n(){return`0.0.87-next.1`}function r(e){return typeof e==`string`?{stringValue:e}:typeof e==`boolean`?{boolValue:e}:Number.isInteger(e)?{intValue:e.toString()}:{doubleValue:e}}function i(e){return Object.entries(e).map(([e,t])=>({key:e,value:r(t)}))}function a(e){return{traceId:e.traceId,spanId:e.spanId,...e.parentSpanId?{parentSpanId:e.parentSpanId}:{},name:e.name,kind:1,startTimeUnixNano:e.startTimeUnixNano,endTimeUnixNano:e.endTimeUnixNano,attributes:i(e.attributes),status:{code:t[e.status]}}}function o(t,r){return{resourceSpans:[{resource:{attributes:i(t)},scopeSpans:[{scope:{name:e,version:n()},spans:r.map(a)}]}]}}var s=`https://production.otel.picked.app/v1/traces`,c=50,l=3e3;function u(e){let t=e.endpoint??`https://production.otel.picked.app/v1/traces`,n=e.maxBatchSize??c,r=[];async function i(){if(r.length===0)return;let n=r;r=[];let i=globalThis.fetch;if(typeof i==`function`)try{await i(t,{method:`POST`,keepalive:!0,headers:{"Content-Type":`application/json`,...e.headers},body:JSON.stringify(o(e.resource,n)),signal:AbortSignal.timeout(l)})}catch{}}return{record:e=>{r.push(e),r.length>=n&&i()},flush:i,bufferedCount:()=>r.length}}var d=16,f=8;function p(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),t.every(e=>e===0)&&(t[0]=1),t}function m(e){let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return t}function h(){return m(p(d))}function g(){return m(p(f))}function _(e,t,n){return`00-${e}-${t}-${n?`01`:`00`}`}var v=1000000n;function y(e){let t=Math.trunc(e),n=Math.round((e-t)*Number(v));return(BigInt(t)*v+BigInt(n)).toString()}exports.DEFAULT_TELEMETRY_ENDPOINT=s,exports.createSpanId=g,exports.createTelemetryEmitter=u,exports.createTraceId=h,exports.formatTraceparent=_,exports.toUnixNano=y;
package/dist/esm/index.js CHANGED
@@ -5,7 +5,7 @@ var e = {
5
5
  error: 2
6
6
  };
7
7
  function t() {
8
- return "0.0.86";
8
+ return "0.0.87-next.1";
9
9
  }
10
10
  function n(e) {
11
11
  return typeof e == "string" ? { stringValue: e } : typeof e == "boolean" ? { boolValue: e } : Number.isInteger(e) ? { intValue: e.toString() } : { doubleValue: e };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/telemetry",
3
3
  "description": "Minimal OTLP/HTTP-JSON span emitter shared by the Picked SDK surfaces",
4
- "version": "0.0.86",
4
+ "version": "0.0.87-next.1",
5
5
  "dependencies": {},
6
6
  "devDependencies": {
7
7
  "@repo/eslint-config": "workspace:*",