@camunda8/orchestration-cluster-api 1.1.5 → 1.2.0

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/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
- ## [1.1.5](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.4...v1.1.5) (2025-11-13)
1
+ # [1.2.0](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.5...v1.2.0) (2025-11-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * add silly level logging ([a8a4aad](https://github.com/camunda/orchestration-cluster-api-js/commit/a8a4aadd3556d5c441d63d2a9b3943a68dc747e5))
2
7
 
8
+ ## [1.1.5](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.4...v1.1.5) (2025-11-13)
3
9
 
4
10
  ### Bug Fixes
5
11
 
6
- * use creds from SaaS correctly. fixes [#28](https://github.com/camunda/orchestration-cluster-api-js/issues/28) ([348bc9e](https://github.com/camunda/orchestration-cluster-api-js/commit/348bc9e3916b7a549ddd17215cd4367877805216))
12
+ - use creds from SaaS correctly. fixes [#28](https://github.com/camunda/orchestration-cluster-api-js/issues/28) ([348bc9e](https://github.com/camunda/orchestration-cluster-api-js/commit/348bc9e3916b7a549ddd17215cd4367877805216))
7
13
 
8
14
  ## [1.1.4](https://github.com/camunda/orchestration-cluster-api-js/compare/v1.1.3...v1.1.4) (2025-11-13)
9
15
 
package/README.md CHANGED
@@ -806,6 +806,10 @@ To enable debug logs via env:
806
806
  CAMUNDA_SDK_LOG_LEVEL=debug
807
807
  ```
808
808
 
809
+ ### Unsafe Deep Diagnostics (`silly`)
810
+
811
+ Setting `CAMUNDA_SDK_LOG_LEVEL=silly` enables the deepest diagnostics. In addition to everything at `trace`, the SDK will emit HTTP request and response body previews for all HTTP methods under the `telemetry` scope (log line contains `http.body`). This can leak sensitive information (secrets, PII). A warning (`log.level.silly.enabled`) is emitted on client construction. Use only for short‑lived local debugging; never enable in production or share captured logs externally. Body output is truncated (max ~4KB) and form-data parts identify uploaded files as `[File]`.
812
+
809
813
  ### Bring Your Own Logger
810
814
 
811
815
  Provide a `transport` function to forward structured `LogEvent` objects into any logging library.
@@ -2,7 +2,7 @@ import {
2
2
  __export,
3
3
  __require,
4
4
  createLogger
5
- } from "./chunk-IEZVLX66.js";
5
+ } from "./chunk-W6JB7JZH.js";
6
6
 
7
7
  // src/runtime/errors.ts
8
8
  function isSdkError(e) {
@@ -8864,9 +8864,9 @@ var SCHEMA = {
8864
8864
  },
8865
8865
  CAMUNDA_SDK_LOG_LEVEL: {
8866
8866
  type: "enum",
8867
- choices: ["silent", "error", "warn", "info", "debug", "trace"],
8867
+ choices: ["silent", "error", "warn", "info", "debug", "trace", "silly"],
8868
8868
  default: "error",
8869
- doc: "SDK log level."
8869
+ doc: 'SDK log level. "silly" adds unsafe deep diagnostics including HTTP request and response bodies.'
8870
8870
  },
8871
8871
  CAMUNDA_SDK_TELEMETRY_LOG: {
8872
8872
  type: "boolean",
@@ -9624,7 +9624,7 @@ function installAuthInterceptor(client2, getStrategy, getAuthHeaders) {
9624
9624
  }
9625
9625
 
9626
9626
  // src/runtime/version.ts
9627
- var packageVersion = "1.1.5";
9627
+ var packageVersion = "1.2.0";
9628
9628
 
9629
9629
  // src/runtime/supportLogger.ts
9630
9630
  var NoopSupportLogger = class {
@@ -9825,6 +9825,46 @@ function wrapFetch(orig, opts) {
9825
9825
  const requestId = "r" + (++globalRequestCounter).toString(36);
9826
9826
  const correlationId = opts.correlation ? opts.correlation() : void 0;
9827
9827
  const start = Date.now();
9828
+ let bodyPreview;
9829
+ try {
9830
+ const lvl = logger?.level?.();
9831
+ if (lvl === "silly" && (method === "POST" || method === "PUT" || method === "PATCH")) {
9832
+ let body = init?.body;
9833
+ if (body === void 0 && typeof Request !== "undefined" && input instanceof Request) {
9834
+ try {
9835
+ body = await input.clone().text();
9836
+ } catch {
9837
+ body = void 0;
9838
+ }
9839
+ }
9840
+ if (body !== void 0 && body !== null) {
9841
+ if (typeof body === "string") bodyPreview = body;
9842
+ else if (body instanceof URLSearchParams) bodyPreview = body.toString();
9843
+ else if (typeof FormData !== "undefined" && body instanceof FormData) {
9844
+ const entries = [];
9845
+ for (const [k, v] of body.entries()) {
9846
+ entries.push(`${k}=${typeof v === "string" ? v.slice(0, 200) : "[File]"}`);
9847
+ }
9848
+ bodyPreview = entries.join("&");
9849
+ } else if (body instanceof Blob) {
9850
+ bodyPreview = `[Blob size=${body.size}]`;
9851
+ } else if (body instanceof ArrayBuffer) {
9852
+ bodyPreview = `[ArrayBuffer byteLength=${body.byteLength}]`;
9853
+ } else if (body instanceof Uint8Array) {
9854
+ bodyPreview = `[Uint8Array length=${body.length}]`;
9855
+ } else if (typeof body === "object") {
9856
+ try {
9857
+ bodyPreview = JSON.stringify(body).slice(0, 4e3);
9858
+ } catch {
9859
+ bodyPreview = "[Unstringifiable object body]";
9860
+ }
9861
+ }
9862
+ if (bodyPreview && bodyPreview.length > 4e3)
9863
+ bodyPreview = bodyPreview.slice(0, 4e3) + "\u2026";
9864
+ }
9865
+ }
9866
+ } catch {
9867
+ }
9828
9868
  const startEvt = {
9829
9869
  type: "http.start",
9830
9870
  ts: start,
@@ -9837,6 +9877,11 @@ function wrapFetch(orig, opts) {
9837
9877
  try {
9838
9878
  hooks?.beforeRequest?.(startEvt);
9839
9879
  mirrorLog(startEvt);
9880
+ if (bodyPreview && logger?.level?.() === "silly") {
9881
+ logger.silly(() => [
9882
+ `op=${method} ${redactedUrl} http.body requestId=${requestId} size=${bodyPreview.length} preview=${bodyPreview}`
9883
+ ]);
9884
+ }
9840
9885
  } catch {
9841
9886
  }
9842
9887
  try {
@@ -9858,6 +9903,44 @@ function wrapFetch(orig, opts) {
9858
9903
  mirrorLog(endEvt);
9859
9904
  } catch {
9860
9905
  }
9906
+ try {
9907
+ if (logger?.level?.() === "silly") {
9908
+ let respPreview;
9909
+ const cloned = res.clone();
9910
+ const ctype = cloned.headers.get("Content-Type") || "";
9911
+ let originalSize;
9912
+ if (/^(application\/json|text\/)/i.test(ctype)) {
9913
+ try {
9914
+ const text = await cloned.text();
9915
+ originalSize = text.length;
9916
+ respPreview = text.slice(0, 4e3);
9917
+ if (text.length > 4e3) respPreview += "\u2026";
9918
+ } catch {
9919
+ respPreview = void 0;
9920
+ }
9921
+ } else if (/multipart\//i.test(ctype)) {
9922
+ respPreview = "[multipart body omitted]";
9923
+ } else if (/octet-stream|binary/i.test(ctype)) {
9924
+ respPreview = "[binary body omitted]";
9925
+ } else {
9926
+ try {
9927
+ const text = await cloned.text();
9928
+ if (text) {
9929
+ originalSize = text.length;
9930
+ respPreview = text.slice(0, 200);
9931
+ if (text.length > 200) respPreview += "\u2026";
9932
+ }
9933
+ } catch {
9934
+ }
9935
+ }
9936
+ if (respPreview) {
9937
+ logger.silly(() => [
9938
+ `op=${method} ${redactedUrl} http.response requestId=${requestId} status=${res.status} size=${originalSize} preview=${respPreview}`
9939
+ ]);
9940
+ }
9941
+ }
9942
+ } catch {
9943
+ }
9861
9944
  try {
9862
9945
  const opName = `${endEvt.method} ${endEvt.url}`;
9863
9946
  opts.supportLogger?.log(
@@ -10660,7 +10743,7 @@ var CamundaClient = class {
10660
10743
  });
10661
10744
  } else if (
10662
10745
  // Auto-enable mirror telemetry when trace level and user did not explicitly set CAMUNDA_SDK_TELEMETRY_LOG to a disabling value.
10663
- this._log.level() === "trace" && !this._config.telemetry?.log && // No explicit override provided
10746
+ /^(trace|silly)$/.test(this._log.level()) && !this._config.telemetry?.log && // No explicit override provided
10664
10747
  this._overrides["CAMUNDA_SDK_TELEMETRY_LOG"] === void 0 && // And env var either absent or truthy enabling value
10665
10748
  (typeof process === "undefined" || process.env["CAMUNDA_SDK_TELEMETRY_LOG"] === void 0 || /^(1|true|yes|on)$/i.test(process.env["CAMUNDA_SDK_TELEMETRY_LOG"] || ""))
10666
10749
  ) {
@@ -10677,6 +10760,12 @@ var CamundaClient = class {
10677
10760
  fetch: this._fetch,
10678
10761
  throwOnError: opts.throwOnError !== false
10679
10762
  });
10763
+ if (this._log.level() === "silly") {
10764
+ this._log.warn(
10765
+ "log.level.silly.enabled",
10766
+ "HTTP request and response bodies will be logged; this may leak sensitive information. Use only for local debugging."
10767
+ );
10768
+ }
10680
10769
  installAuthInterceptor(
10681
10770
  this._client,
10682
10771
  () => this._config.auth.strategy,
@@ -10755,7 +10844,7 @@ var CamundaClient = class {
10755
10844
  supportLogger: this._supportLogger,
10756
10845
  mirrorToLog: true
10757
10846
  });
10758
- } else if (this._log.level() === "trace" && !this._config.telemetry?.log && this._overrides["CAMUNDA_SDK_TELEMETRY_LOG"] === void 0 && (typeof process === "undefined" || process.env["CAMUNDA_SDK_TELEMETRY_LOG"] === void 0 || /^(1|true|yes|on)$/i.test(process.env["CAMUNDA_SDK_TELEMETRY_LOG"] || ""))) {
10847
+ } else if (/^(trace|silly)$/.test(this._log.level()) && !this._config.telemetry?.log && this._overrides["CAMUNDA_SDK_TELEMETRY_LOG"] === void 0 && (typeof process === "undefined" || process.env["CAMUNDA_SDK_TELEMETRY_LOG"] === void 0 || /^(1|true|yes|on)$/i.test(process.env["CAMUNDA_SDK_TELEMETRY_LOG"] || ""))) {
10759
10848
  this._fetch = wrapFetch(this._fetch || fetch, {
10760
10849
  hooks: void 0,
10761
10850
  correlation: this._config.telemetry?.correlation ? () => getCorrelation() : void 0,
@@ -18783,4 +18872,4 @@ export {
18783
18872
  withTimeoutTE,
18784
18873
  eventuallyTE
18785
18874
  };
18786
- //# sourceMappingURL=chunk-IXOWDFIB.js.map
18875
+ //# sourceMappingURL=chunk-7RIALC7K.js.map