@camunda8/orchestration-cluster-api 10.0.0-alpha.41 → 10.0.0-alpha.43

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.
@@ -74,4 +74,4 @@ function createLogger(opts = {}) {
74
74
  export {
75
75
  createLogger
76
76
  };
77
- //# sourceMappingURL=chunk-KQ4UL2WX.js.map
77
+ //# sourceMappingURL=chunk-LXWPMQOS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/runtime/logger.ts"],"sourcesContent":["// Per-client logger (no global singleton). Construct via createLogger.\n\n// Added 'silly' for deep diagnostics (unsafe: logs HTTP bodies when enabled elsewhere)\nexport type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silly';\nexport interface LogEvent {\n level: LogLevel;\n scope: string;\n ts: number;\n args: any[];\n code?: string;\n data?: any;\n}\nexport type LogTransport = (e: LogEvent) => void;\nconst ORDER: Record<LogLevel, number> = {\n silent: 0,\n error: 1,\n warn: 2,\n info: 3,\n debug: 4,\n trace: 5,\n silly: 6,\n};\n\nexport interface Logger {\n level(): LogLevel;\n setLevel(level: LogLevel): void; // internal use\n setTransport(t?: LogTransport): void; // internal use\n error(...a: any[]): void;\n warn(...a: any[]): void;\n info(...a: any[]): void;\n debug(...a: any[]): void;\n trace(...a: any[]): void;\n silly(...a: any[]): void;\n scope(child: string): Logger;\n code(level: LogLevel, code: string, msg: string, data?: any): void;\n}\n\nexport interface CreateLoggerOptions {\n level?: LogLevel;\n transport?: LogTransport;\n scope?: string;\n}\n\nexport function createLogger(opts: CreateLoggerOptions = {}): Logger {\n let currentLevel: LogLevel = opts.level || 'error';\n let transport: LogTransport | undefined = opts.transport;\n const baseScope = opts.scope || '';\n\n function isEnabled(need: LogLevel) {\n return ORDER[currentLevel] >= ORDER[need];\n }\n function evalArgs(args: any[]): any[] {\n // Support lazy function args: if an arg is a function with zero arity, call it.\n return args.flatMap((a) => (typeof a === 'function' && a.length === 0 ? a() : a));\n }\n function emit(level: LogLevel, scope: string, rawArgs: any[]) {\n if (!isEnabled(level)) return;\n const args = evalArgs(rawArgs);\n // biome-ignore lint/plugin: log event timestamp: must be real wall-clock to correlate with external logs\n const evt: LogEvent = { level, scope, ts: Date.now(), args };\n if (transport) {\n try {\n transport(evt);\n } catch {\n /* ignore transport errors */\n }\n } else {\n const tag = `[camunda-sdk][${level}]${scope ? `[${scope}]` : ''}`;\n const method = level === 'error' ? 'error' : level === 'warn' ? 'warn' : 'log';\n\n console[method](tag, ...args);\n }\n }\n function emitCode(level: LogLevel, scope: string, code: string, msg: string, data?: any) {\n if (!isEnabled(level)) return;\n // biome-ignore lint/plugin: log event timestamp: must be real wall-clock to correlate with external logs\n const evt: LogEvent = { level, scope, ts: Date.now(), args: [msg], code, data };\n if (transport) {\n try {\n transport(evt);\n } catch {}\n } else {\n const tag = `[camunda-sdk][${level}]${scope ? `[${scope}]` : ''}`;\n const method = level === 'error' ? 'error' : level === 'warn' ? 'warn' : 'log';\n\n console[method](tag, `${code}:`, msg, data ?? '');\n }\n }\n const make = (scope: string): Logger => ({\n level: () => currentLevel,\n setLevel(l: LogLevel) {\n currentLevel = l;\n },\n setTransport(t?: LogTransport) {\n transport = t;\n },\n error: (...a: any[]) => emit('error', scope, a),\n warn: (...a: any[]) => emit('warn', scope, a),\n info: (...a: any[]) => emit('info', scope, a),\n debug: (...a: any[]) => emit('debug', scope, a),\n trace: (...a: any[]) => emit('trace', scope, a),\n silly: (...a: any[]) => emit('silly', scope, a),\n scope(child: string) {\n return make(scope ? `${scope}:${child}` : child);\n },\n code(l: LogLevel, code: string, msg: string, data?: any) {\n emitCode(l, scope, code, msg, data);\n },\n });\n return make(baseScope);\n}\n"],"mappings":";AAaA,IAAM,QAAkC;AAAA,EACtC,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;AAsBO,SA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I,KAAK,KAAK,QAAQ,EAAE;AAAA,IAClD;AAAA,EACF;AACA,QAAM,OAAO,CAAC,WAA2B;AAAA,IACvC,OAAO,MAAM;AAAA,IACb,SAAS,GAAa;AACpB,qBAAe;AAAA,IACjB;AAAA,IACA,aAAa,GAAkB;AAC7B,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,MAAa,KAAK,SAAS,OAAO,CAAC;AAAA,IAC9C,MAAM,IAAI,MAAa,KAAK,QAAQ,OAAO,CAAC;AAAA,IAC5C,MAAM,IAAI,MAAa,KAAK,QAAQ,OAAO,CAAC;AAAA,IAC5C,OAAO,IAAI,MAAa,KAAK,SAAS,OAAO,CAAC;AAAA,IAC9C,OAAO,IAAI,MAAa,KAAK,SAAS,OAAO,CAAC;AAAA,IAC9C,OAAO,IAAI,MAAa,KAAK,SAAS,OAAO,CAAC;AAAA,IAC9C,MAAM,OAAe;AACnB,aAAO,KAAK,QAAQ,GAAG,KAAK,IAAI,KAAK,KAAK,KAAK;AAAA,IACjD;AAAA,IACA,KAAK,GAAa,MAAc,KAAa,MAAY;AACvD,eAAS,GAAG,OAAO,MAAM,KAAK,IAAI;AAAA,IACpC;AAAA,EACF;AACA,SAAO,KAAK,SAAS;AACvB;","names":[]}
@@ -12851,6 +12851,7 @@ var OAuthManager = class {
12851
12851
  if (attempt === 0) {
12852
12852
  const evt = {
12853
12853
  type: "auth.start",
12854
+ // biome-ignore lint/plugin: telemetry event timestamp: must be real wall-clock so emitted events correlate with external logs, and never drives cadence
12854
12855
  ts: Date.now(),
12855
12856
  audience: this.cfg.tokenAudience,
12856
12857
  endpoint: this.cfg.oauth.oauthUrl,
@@ -12902,6 +12903,7 @@ var OAuthManager = class {
12902
12903
  try {
12903
12904
  const evt = {
12904
12905
  type: "auth.success",
12906
+ // biome-ignore lint/plugin: telemetry event timestamp: must be real wall-clock so emitted events correlate with external logs, and never drives cadence
12905
12907
  ts: Date.now(),
12906
12908
  audience: this.cfg.tokenAudience,
12907
12909
  endpoint: this.cfg.oauth.oauthUrl,
@@ -12926,6 +12928,7 @@ var OAuthManager = class {
12926
12928
  try {
12927
12929
  this.tHooks?.retry?.({
12928
12930
  type: "retry",
12931
+ // biome-ignore lint/plugin: telemetry event timestamp: must be real wall-clock so emitted events correlate with external logs, and never drives cadence
12929
12932
  ts: Date.now(),
12930
12933
  attempt,
12931
12934
  nextDelayMs: Math.round(sleep),
@@ -12941,6 +12944,7 @@ var OAuthManager = class {
12941
12944
  try {
12942
12945
  const evt = {
12943
12946
  type: "auth.error",
12947
+ // biome-ignore lint/plugin: telemetry event timestamp: must be real wall-clock so emitted events correlate with external logs, and never drives cadence
12944
12948
  ts: Date.now(),
12945
12949
  audience: this.cfg.tokenAudience,
12946
12950
  endpoint: this.cfg.oauth.oauthUrl,
@@ -14234,7 +14238,7 @@ function createLogger(opts = {}) {
14234
14238
  }
14235
14239
 
14236
14240
  // src/runtime/version.ts
14237
- var packageVersion = "10.0.0-alpha.41";
14241
+ var packageVersion = "10.0.0-alpha.43";
14238
14242
 
14239
14243
  // src/runtime/supportLogger.ts
14240
14244
  var NoopSupportLogger = class {
@@ -14880,6 +14884,7 @@ function detectExtrasAndMaybeThrow(opts) {
14880
14884
  const payload = {
14881
14885
  operationId,
14882
14886
  extras,
14887
+ // biome-ignore lint/plugin: capture-artifact timestamp: records when the capture was written, not cadence
14883
14888
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
14884
14889
  sample: value
14885
14890
  };
@@ -15051,8 +15056,8 @@ var BackpressureManager = class {
15051
15056
  // current backoff delay in ms (0 = no backoff)
15052
15057
  constructor(opts = {}) {
15053
15058
  this.logger = opts.logger;
15054
- this.now = opts.now || (() => Date.now());
15055
- this.sleep = opts.sleep || ((ms) => new Promise((r) => setTimeout(r, ms)));
15059
+ this.now = opts.now || (() => liveClock.now());
15060
+ this.sleep = opts.sleep || ((ms) => liveClock.sleep(ms));
15056
15061
  this.cfg = {
15057
15062
  enabled: true,
15058
15063
  initialMaxConcurrency: null,