@camunda8/sdk 8.9.0-alpha.14 → 8.9.0-alpha.16

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/MAINTAINER.md +8 -9
  3. package/README.md +27 -2
  4. package/dist/admin/lib/AdminApiClient.js +2 -3
  5. package/dist/admin/lib/AdminApiClient.js.map +1 -1
  6. package/dist/c8/lib/CamundaRestClient.d.ts +22 -4
  7. package/dist/c8/lib/CamundaRestClient.js +125 -33
  8. package/dist/c8/lib/CamundaRestClient.js.map +1 -1
  9. package/dist/c8/lib/TrackedGot.d.ts +3 -3
  10. package/dist/c8/lib/TrackedGot.js +3 -3
  11. package/dist/c8/lib/TrackedGot.js.map +1 -1
  12. package/dist/lib/Configuration.d.ts +1 -1
  13. package/dist/lib/Configuration.js.map +1 -1
  14. package/dist/lib/GotErrors.d.ts +5 -5
  15. package/dist/lib/GotErrors.js +3 -37
  16. package/dist/lib/GotErrors.js.map +1 -1
  17. package/dist/lib/GotHooks.d.ts +5 -26
  18. package/dist/lib/GotHooks.js +8 -46
  19. package/dist/lib/GotHooks.js.map +1 -1
  20. package/dist/lib/HttpClient.d.ts +194 -0
  21. package/dist/lib/HttpClient.js +749 -0
  22. package/dist/lib/HttpClient.js.map +1 -0
  23. package/dist/lib/index.d.ts +2 -0
  24. package/dist/lib/index.js +9 -1
  25. package/dist/lib/index.js.map +1 -1
  26. package/dist/modeler/lib/ModelerAPIClient.js +2 -3
  27. package/dist/modeler/lib/ModelerAPIClient.js.map +1 -1
  28. package/dist/oauth/lib/CookieAuthProvider.d.ts +2 -2
  29. package/dist/oauth/lib/CookieAuthProvider.js +2 -6
  30. package/dist/oauth/lib/CookieAuthProvider.js.map +1 -1
  31. package/dist/oauth/lib/OAuthProvider.js +2 -3
  32. package/dist/oauth/lib/OAuthProvider.js.map +1 -1
  33. package/dist/operate/lib/OperateApiClient.js +2 -6
  34. package/dist/operate/lib/OperateApiClient.js.map +1 -1
  35. package/dist/optimize/lib/OptimizeApiClient.d.ts +2 -2
  36. package/dist/optimize/lib/OptimizeApiClient.js +2 -6
  37. package/dist/optimize/lib/OptimizeApiClient.js.map +1 -1
  38. package/dist/optimize/lib/ReportResults.d.ts +2 -2
  39. package/dist/tasklist/lib/TasklistApiClient.js +2 -6
  40. package/dist/tasklist/lib/TasklistApiClient.js.map +1 -1
  41. package/dist/test-support/socketTap.d.ts +23 -0
  42. package/dist/test-support/socketTap.js +183 -0
  43. package/dist/test-support/socketTap.js.map +1 -0
  44. package/dist/zeebe/lib/ZBStreamWorker.d.ts +39 -1
  45. package/dist/zeebe/lib/ZBStreamWorker.js +213 -36
  46. package/dist/zeebe/lib/ZBStreamWorker.js.map +1 -1
  47. package/dist/zeebe/lib/cancelProcesses.js +8 -0
  48. package/dist/zeebe/lib/cancelProcesses.js.map +1 -1
  49. package/dist/zeebe/zb/ZeebeGrpcClient.d.ts +12 -3
  50. package/dist/zeebe/zb/ZeebeGrpcClient.js +10 -2
  51. package/dist/zeebe/zb/ZeebeGrpcClient.js.map +1 -1
  52. package/package.json +13 -7
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [8.9.0-alpha.16](https://github.com/camunda/camunda-8-js-sdk/compare/v8.9.0-alpha.15...v8.9.0-alpha.16) (2026-11-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **zeebe:** detect and recover from dead job streams in streamJobs ([#874](https://github.com/camunda/camunda-8-js-sdk/issues/874)) ([3bb3edc](https://github.com/camunda/camunda-8-js-sdk/commit/3bb3edcfd8e1d5958ff8171900812cf89b26a2d9))
7
+
8
+ # [8.9.0-alpha.15](https://github.com/camunda/camunda-8-js-sdk/compare/v8.9.0-alpha.14...v8.9.0-alpha.15) (2026-10-08)
9
+
10
+
11
+ ### Features
12
+
13
+ * replace got 11 with undici fetch for all REST calls ([#840](https://github.com/camunda/camunda-8-js-sdk/issues/840)) ([9d397c2](https://github.com/camunda/camunda-8-js-sdk/commit/9d397c21ef558c1e5f3c0c7e2ba4696130174bba)), closes [#837](https://github.com/camunda/camunda-8-js-sdk/issues/837)
14
+
1
15
  # [8.9.0-alpha.14](https://github.com/camunda/camunda-8-js-sdk/compare/v8.9.0-alpha.13...v8.9.0-alpha.14) (2026-10-08)
2
16
 
3
17
 
package/MAINTAINER.md CHANGED
@@ -32,8 +32,7 @@ When a new Camunda minor (e.g. `8.9`) is ready to be promoted to `latest`:
32
32
  ```
33
33
  2. Update the GitHub **repository variable** (Settings → Secrets and variables → Actions → Variables) `CAMUNDA_SDK_CURRENT_STABLE_MINOR` from `8.8` to `8.9`.
34
34
  3. The next merge to `stable/8.9` will publish to npm dist-tag `latest`. The previous current line (`stable/8.8`) automatically falls back to maintenance dist-tag `8.8-stable` on its next release.
35
- 4. Update [.github/workflows/integration-test-matrix-trigger.yaml](.github/workflows/integration-test-matrix-trigger.yaml) to add a daily compatibility-test trigger for the new branch (uncomment / duplicate the `trigger-stable-8-9` block).
36
- 5. Update [.github/renovate.json](.github/renovate.json) `baseBranchPatterns` if the previous stable line should be replaced as a Renovate target.
35
+ 4. Update [.github/renovate.json](.github/renovate.json) `baseBranchPatterns` if the previous stable line should be replaced as a Renovate target.
37
36
 
38
37
  No git tag manipulation is required — semantic-release reads existing tags and computes the next version per branch independently.
39
38
 
@@ -50,8 +49,7 @@ All workflows live under [.github/workflows/](.github/workflows/).
50
49
  | `commitlint.yml` | PR | Enforces conventional commits. |
51
50
  | `code-scanning.yml` | scheduled / push | CodeQL. |
52
51
  | `backport.yml` | PR closed, `/backport` comment | Creates backport PRs (e.g. `main` → `stable/8.8`) via `korthout/backport-action`. |
53
- | `integration-test-matrix.yml` | scheduled (02:00 UTC), manual dispatch | Cross-version client × server compatibility matrix. Runs **on a stable branch** and tests every released SDK version against every server version ≥ current minor. |
54
- | `integration-test-matrix-trigger.yaml` | scheduled (02:00 UTC) | Fans out the matrix run to each active stable branch (uses `gh workflow run --ref stable/<x.y>`). |
52
+ | `integration-test-matrix.yml` | scheduled (02:00 UTC), manual dispatch | Cross-version client × server compatibility matrix. Runs from `main` and tests released SDK versions (from git tags) ≥ the current minor against released server versions from the **next** minor onwards, plus `SNAPSHOT`. |
55
53
 
56
54
  ### CI vs. Release: why feature branches and `main`/`stable/**` are separated
57
55
 
@@ -128,16 +126,16 @@ After a successful release on `main`, the same job builds TypeDoc output (`npm r
128
126
 
129
127
  ## 4. Compatibility Matrix
130
128
 
131
- [integration-test-matrix.yml](.github/workflows/integration-test-matrix.yml) runs nightly on each active stable branch (driven by `integration-test-matrix-trigger.yaml`). It:
129
+ [integration-test-matrix.yml](.github/workflows/integration-test-matrix.yml) runs nightly from `main` (scheduled workflows only run from the default branch). Each job checks out the SDK **source from a release tag**, then overwrites `docker/docker-compose-matrix.yaml` with the copy from the branch the workflow runs on (`main` for scheduled runs). So the SDK under test comes from tags, while the test infrastructure comes from `main`. It:
132
130
 
133
- 1. Derives the current minor from the **latest stable git tag** on the branch (intentionally not from `package.json`, which may already be at a pre-release version).
131
+ 1. Derives the current minor from the **latest stable git tag in the repository** (intentionally not from `package.json`, which may already be at a pre-release version).
134
132
  2. Enumerates SDK client versions ≥ that minor from local git tags.
135
- 3. Enumerates Camunda server versions ≥ that minor from `camunda/camunda` git tags via `git ls-remote` (no clone).
133
+ 3. Enumerates released Camunda server versions from the **next** minor onwards (e.g. 8.9.x and later when the current minor is 8.8) from `camunda/camunda` git tags via `git ls-remote` (no clone), and adds `SNAPSHOT`. The matrix does not test same-minor pairs (e.g. an SDK 8.8 release against server 8.8). The current code is tested against its own minor by the regular CI and Release jobs (e.g. `local_integration_8_8`).
136
134
  4. Runs the full client × server matrix, with caching to avoid retesting known-good combinations.
137
135
 
138
136
  Manual dispatch supports pinning a `client_version`, a `server_version`, and `skip_cache` to force a full re-run.
139
137
 
140
- When promoting a new stable line, **add a trigger entry** in `integration-test-matrix-trigger.yaml` so the new branch is exercised nightly. Failure to do so means the new line silently loses compatibility coverage.
138
+ Because the minimum minor comes from the latest stable tag, promoting a new stable line (e.g. the first `v8.9.x` tag) drops the previous line's clients (`8.8.x`) from the matrix. If the previous line still needs nightly compatibility coverage, extend the client filter in `integration-test-matrix.yml` to include it. Running the workflow from the stable branch would not help: the tag list is the same on every branch.
141
139
 
142
140
  ---
143
141
 
@@ -146,7 +144,8 @@ When promoting a new stable line, **add a trigger entry** in `integration-test-m
146
144
  To ship a fix to a stable line:
147
145
 
148
146
  1. Land the fix on `main` via a normal PR (so `alpha` users get it immediately).
149
- 2. Add the appropriate `backport-stable/<x.y>` label on the merged PR (or comment `/backport stable/<x.y>`). [backport.yml](.github/workflows/backport.yml) creates the backport PR automatically; conflicts are committed as draft commits per the `experimental.conflict_resolution` setting.
147
+ 2. Add the appropriate `backport stable/<x.y>` label (with a space) on the PR, before or after merging (or comment `/backport stable/<x.y>`). [backport.yml](.github/workflows/backport.yml) creates the backport PR automatically. On a conflict it commits the conflict markers, opens the PR as a **draft**, and comments with the commands to resolve it locally (the `experimental.conflict_resolution: draft_commit_conflicts` setting). Resolve the conflict on that branch before marking it ready. CI's `conflict-markers` job fails while any `<<<<<<<`/`>>>>>>>` lines remain.
148
+ - **If `package-lock.json` is the only conflict** (typical for dependency updates), don't resolve it by hand — regenerate it instead of merging the markers. Reset **only the lockfile** to `stable/<x.y>` so any source files that cherry-picked cleanly are preserved: `git checkout stable/<x.y> -- package-lock.json`. Then regenerate it there with the same `npm update <packages> --package-lock-only` and **npm 10** (the npm that ships with Node 22, which CI uses, so the lockfile format matches), and commit the regenerated lockfile alongside the backported changes. Only when the backport is a pure dependency bump that touches nothing but `package-lock.json` is it safe to reset the whole branch to `stable/<x.y>` and force-push a single `chore(deps): …` commit — #865 is an example of that case.
150
149
  3. Merge the backport PR to `stable/<x.y>`. The Release workflow then runs the full integration suite and publishes to npm.
151
150
 
152
151
  Always land on `main` first unless the fix is genuinely stable-only (e.g. it touches code that no longer exists on `main`). Stable-only fixes should be opened directly against the `stable/<x.y>` branch.
package/README.md CHANGED
@@ -731,7 +731,7 @@ When `streamJobs` is called, it first opens a stream to receive any newly create
731
731
 
732
732
  ### Sidecar polling
733
733
 
734
- After the initial backfill, a low-frequency sidecar poll runs alongside the stream as a safety net. This catches edge cases the stream alone cannot handle — for example, jobs that are re-queued after a worker fails to complete them within the timeout, or jobs that arrive during a brief stream reconnect.
734
+ After the initial backfill, a low-frequency sidecar poll runs alongside the stream as a safety net. This catches edge cases the stream alone cannot handle — for example, jobs that are re-queued after a worker fails to complete them within the timeout, or jobs that arrive while a dead stream is being re-opened (see [Stream failure and recovery](#stream-failure-and-recovery)).
735
735
 
736
736
  Each poll is a command on the broker, so the default interval is deliberately long (30 seconds) to minimise server load. The stream remains the primary delivery mechanism.
737
737
 
@@ -740,12 +740,29 @@ Configure the sidecar poll with:
740
740
  - **`pollInterval`** — milliseconds between sidecar poll cycles. Defaults to `30000` (30 s). Set to `0` or `-1` to disable recurring polling entirely (the initial backfill poll still runs).
741
741
  - **`pollMaxJobsToActivate`** — maximum jobs per poll cycle (both initial and recurring). Defaults to `32`.
742
742
 
743
+ ### Stream failure and recovery
744
+
745
+ A job stream can die while the worker process keeps running: the connection drops, the gateway restarts or rejects the stream, or the server ends it. Without recovery, a worker whose stream has died receives only the jobs found by the low-frequency sidecar poll.
746
+
747
+ `streamJobs` detects a dead stream (an `error`, `end` or `close` event, or a failed attempt to open it) and, by default, re-opens it with exponential backoff (1 s, doubling to a cap of 30 s). Once the stream is re-established it runs one backfill poll to pick up jobs created while the stream was down. The backoff restarts from the beginning once a re-opened stream delivers a job or stays up for at least the maximum delay. Calling `close()` on the returned handle (or on the client) stops all reconnection attempts.
748
+
749
+ Observe and configure this with:
750
+
751
+ - **`onStreamError(error)`** — called when the stream errors or cannot be opened.
752
+ - **`onStreamEnd()`** — called when the server ends or closes the stream without an error.
753
+ - **`onStreamReconnect(attempt)`** — called before each attempt to re-open the stream. `attempt` is the number of consecutive failures, starting at 1.
754
+ - **`streamReconnect`** — `true` (the default), `false` to disable reconnection (the callbacks above still fire), or `{ initialDelayMs, maxDelayMs }` to tune the backoff.
755
+
756
+ The callbacks may be `async`. Exceptions thrown by these callbacks, and rejections of any promise they return, are caught and logged; they do not affect reconnection. If the stream cannot be opened on the first attempt and `streamReconnect` is `false`, the promise returned by `streamJobs` rejects with the underlying error.
757
+
758
+ `streamJobs` returns a promise, so `await` it to obtain the handle with the `close()` method.
759
+
743
760
  You can optionally pass a `jitter` parameter (in milliseconds) to delay the start by a random period up to that value. This is useful when starting multiple stream workers simultaneously, to avoid saturating the gateway at application startup.
744
761
 
745
762
  Example:
746
763
 
747
764
  ```typescript
748
- client.streamJobs({
765
+ const streamWorker = await client.streamJobs({
749
766
  type: 'payment-service',
750
767
  worker: 'my-worker',
751
768
  timeout: 30000,
@@ -760,7 +777,15 @@ client.streamJobs({
760
777
  pollMaxJobsToActivate: 64,
761
778
  // Optional: sidecar poll every 60 s instead of the default 30 s
762
779
  pollInterval: 60_000,
780
+ // Optional: be told when the job stream dies and when it is re-opened
781
+ onStreamError: (error) => console.error('Job stream failed', error),
782
+ onStreamReconnect: (attempt) => console.log(`Re-opening stream (${attempt})`),
783
+ // Optional: tune the reconnect backoff (default: 1 s doubling to 30 s)
784
+ streamReconnect: { initialDelayMs: 1000, maxDelayMs: 30_000 },
763
785
  })
786
+
787
+ // Stop the worker, including any pending reconnect
788
+ streamWorker.close()
764
789
  ```
765
790
 
766
791
  ## Multi-tenant workers
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AdminApiClient = void 0;
7
7
  const debug_1 = __importDefault(require("debug"));
8
- const got_1 = __importDefault(require("got"));
8
+ const HttpClient_1 = require("../../lib/HttpClient");
9
9
  const lib_1 = require("../../lib");
10
10
  const debug = (0, debug_1.default)('camunda:adminconsole');
11
11
  /**
@@ -22,10 +22,9 @@ class AdminApiClient {
22
22
  explicitFromConstructor: Object.prototype.hasOwnProperty.call(options?.config ?? {}, 'CAMUNDA_AUTH_STRATEGY'),
23
23
  });
24
24
  this.userAgentString = (0, lib_1.createUserAgentString)(config);
25
- this.rest = (0, lib_1.GetCustomCertificateBuffer)(config).then((certificateAuthority) => got_1.default.extend({
25
+ this.rest = (0, lib_1.GetCustomCertificateBuffer)(config).then((certificateAuthority) => HttpClient_1.http.extend({
26
26
  prefixUrl,
27
27
  retry: lib_1.GotRetryConfig,
28
- request: lib_1.GotRequestFunction,
29
28
  https: {
30
29
  certificateAuthority,
31
30
  },
@@ -1 +1 @@
1
- {"version":3,"file":"AdminApiClient.js","sourceRoot":"","sources":["../../../src/admin/lib/AdminApiClient.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqB;AACrB,8CAAqB;AAErB,mCAYkB;AAKlB,MAAM,KAAK,GAAG,IAAA,eAAC,EAAC,sBAAsB,CAAC,CAAA;AAEvC;;;GAGG;AACH,MAAa,cAAc;IAK1B,YAAY,OAGX;QACA,MAAM,MAAM,GAAG,oCAA8B,CAAC,0BAA0B,CACvE,OAAO,EAAE,MAAM,IAAI,EAAE,CACrB,CAAA;QACD,MAAM,SAAS,GAAG,IAAA,0BAAoB,EACrC,MAAM,CAAC,wBAAwB,EAC/B,0BAA0B,CAC1B,CAAA;QAED,IAAI,CAAC,aAAa;YACjB,OAAO,EAAE,aAAa;gBACtB,IAAA,4BAAsB,EAAC,MAAM,EAAE;oBAC9B,uBAAuB,EAAE,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAC5D,OAAO,EAAE,MAAM,IAAI,EAAE,EACrB,uBAAuB,CACvB;iBACD,CAAC,CAAA;QAEH,IAAI,CAAC,eAAe,GAAG,IAAA,2BAAqB,EAAC,MAAM,CAAC,CAAA;QACpD,IAAI,CAAC,IAAI,GAAG,IAAA,gCAA0B,EAAC,MAAM,CAAC,CAAC,IAAI,CAClD,CAAC,oBAAoB,EAAE,EAAE,CACxB,aAAG,CAAC,MAAM,CAAC;YACV,SAAS;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AO,IAAI;aACT,MAAM,CAAC,YAAY,WAAW,YAAY,QAAQ,EAAE,EAAE;YACtD,OAAO;SACP,CAAC;aACD,IAAI,EAAE,CAAA;IACT,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,iBAAiB;QACtB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAA;QAC5B,OAAO,IAAI,CAAC,eAAe,EAAE;YAC5B,OAAO;SACP,CAAC,CAAC,IAAI,EAAE,CAAA;IACV,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,oBAAoB;QACzB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAA;QAC5B,OAAO,IAAI,CAAC,cAAc,EAAE;YAC3B,OAAO;SACP,CAAC,CAAC,IAAI,EAAE,CAAA;IACV,CAAC;CACD;AAxpBD,wCAwpBC"}
@@ -1,13 +1,31 @@
1
1
  import { ReadStream } from 'node:fs';
2
- import { RequiredRetryOptions, Response } from 'got';
3
2
  import PCancelable from 'p-cancelable';
4
- import { Camunda8ClientConfiguration, LosslessDto } from '../../lib';
3
+ import { Camunda8ClientConfiguration, RequiredRetryOptions, Response, LosslessDto } from '../../lib';
5
4
  import { IHeadersProvider } from '../../oauth';
6
5
  import { ActivateJobsRequest, BroadcastSignalReq, CompleteJobRequest, ErrorJobWithVariables, FailJobRequest, JSONDoc, PublishMessageRequest, TopologyResponse } from '../../zeebe/types';
7
6
  import { ActivatedJob, AssignUserTaskRequest, BroadcastSignalResponse, CorrelateMessageResponse, CreateDocumentLinkRequest, CreateProcessInstanceRequest, CreateProcessInstanceResponse, CreateProcessInstanceWithResultResponse, DeployResourceResponse, DownloadDocumentRequest, ElementInstanceDetails, EvaluateDecisionRequest, EvaluateDecisionResponse, GetProcessDefinitionResponse, GetVariableResponse, JobUpdateChangeset, MigrationRequest, ModifyProcessInstanceRequest, NewUserInfo, PatchAuthorizationRequest, PublishMessageResponse, SearchElementInstancesRequest, SearchElementInstancesResponse, SearchIncidentsRequest, SearchIncidentsResponse, SearchProcessDefinitionsRequest, SearchProcessDefinitionsResponse, SearchProcessInstanceRequest, SearchProcessInstanceResponse, SearchTasksRequest, SearchUsersRequest, SearchUsersResponse, SearchUserTasksResponse, SearchUserTaskVariablesRequest, SearchUserTaskVariablesResponse, SearchVariablesRequest, SearchVariablesResponse, TaskChangeSet, UpdateElementVariableRequest, UploadDocumentRequest, UploadDocumentResponse, UploadDocumentsResponse, UserTask } from './C8Dto';
8
7
  import { Ctor, JsonApiEndpointRequest, RawApiEndpointRequest, UnknownRequestBody } from './C8DtoInternal';
9
8
  import { Logger } from './C8Logger';
10
9
  import { CamundaJobWorker, CamundaJobWorkerConfig } from './CamundaJobWorker';
10
+ /** Infer a file name from an fs.ReadStream-like `path`, as form-data used to. */
11
+ export declare function fileNameFromStream(stream: unknown): string | undefined;
12
+ /**
13
+ * Resolve the MIME type for a multipart part. Uses the caller-supplied
14
+ * `contentType` when present, otherwise infers it from the file name (as the
15
+ * previous `form-data` implementation did, e.g. `README.md` -> `text/markdown`).
16
+ */
17
+ export declare function resolveContentType(explicitType: string | undefined, fileName: string | undefined): string | undefined;
18
+ /**
19
+ * Produce a Blob for a multipart upload part.
20
+ *
21
+ * For real `fs.ReadStream`s backed by a file on disk we return a file-backed
22
+ * Blob via `fs.openAsBlob`, which lets undici stream the file lazily from disk
23
+ * rather than buffering the entire payload (and every concurrent part) into
24
+ * memory. Only non-file streams (e.g. in-memory `Readable`s that merely expose
25
+ * a `path` for filename inference) are buffered — their contents are already
26
+ * resident in memory, so no additional unbounded growth is introduced.
27
+ */
28
+ export declare function readStreamToBlob(stream: NodeJS.ReadableStream, type?: string): Promise<Blob>;
11
29
  /**
12
30
  * The client for the unified Camunda 8 Orchestration Cluster REST API.
13
31
  *
@@ -514,7 +532,7 @@ export declare class CamundaRestClient {
514
532
  * The filename is inferred from the filepath. If you are not reading the files from disk, you need to set the path, like this:
515
533
  *
516
534
  * ```typescript
517
- * // In-memory conversion: create Readable streams exposing a path so form-data infers filename
535
+ * // In-memory conversion: create Readable streams exposing a path so the SDK can infer the filename
518
536
  const streams: ReadStream[] = uploadedFiles.map((file) => {
519
537
  const stream = new Readable({
520
538
  read() {
@@ -522,7 +540,7 @@ const streams: ReadStream[] = uploadedFiles.map((file) => {
522
540
  this.push(null);
523
541
  }
524
542
  });
525
- // Provide minimal fs.ReadStream-like fields used by form-data for filename inference.
543
+ // Provide minimal fs.ReadStream-like fields used by the SDK for filename inference.
526
544
  (stream as any).path = file.originalname;
527
545
  (stream as any).close = () => stream.destroy();
528
546
  return stream as unknown as ReadStream;
@@ -1,19 +1,55 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
19
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
20
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
21
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
22
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
23
  };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
8
41
  var __importDefault = (this && this.__importDefault) || function (mod) {
9
42
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
43
  };
11
44
  Object.defineProperty(exports, "__esModule", { value: true });
12
45
  exports.CamundaRestClient = void 0;
13
- const node_fs_1 = __importDefault(require("node:fs"));
46
+ exports.fileNameFromStream = fileNameFromStream;
47
+ exports.resolveContentType = resolveContentType;
48
+ exports.readStreamToBlob = readStreamToBlob;
49
+ const node_fs_1 = __importStar(require("node:fs"));
50
+ const node_path_1 = __importDefault(require("node:path"));
14
51
  const debug_1 = require("debug");
15
- const form_data_1 = __importDefault(require("form-data"));
16
- const got_1 = __importDefault(require("got"));
52
+ const mime_types_1 = require("mime-types");
17
53
  const lossless_json_1 = require("lossless-json");
18
54
  const p_cancelable_1 = __importDefault(require("p-cancelable"));
19
55
  const lib_1 = require("../../lib");
@@ -25,6 +61,74 @@ const OriginTracing_1 = require("./OriginTracing");
25
61
  const RestApiJobClassFactory_1 = require("./RestApiJobClassFactory");
26
62
  const RestApiProcessInstanceClassFactory_1 = require("./RestApiProcessInstanceClassFactory");
27
63
  const TrackedGot_1 = require("./TrackedGot");
64
+ /** Infer a file name from an fs.ReadStream-like `path`, as form-data used to. */
65
+ function fileNameFromStream(stream) {
66
+ const p = stream.path;
67
+ return p ? node_path_1.default.basename(p.toString()) : undefined;
68
+ }
69
+ /**
70
+ * Resolve the MIME type for a multipart part. Uses the caller-supplied
71
+ * `contentType` when present, otherwise infers it from the file name (as the
72
+ * previous `form-data` implementation did, e.g. `README.md` -> `text/markdown`).
73
+ */
74
+ function resolveContentType(explicitType, fileName) {
75
+ if (explicitType)
76
+ return explicitType;
77
+ if (!fileName)
78
+ return undefined;
79
+ const inferred = (0, mime_types_1.lookup)(fileName);
80
+ return inferred === false ? undefined : inferred;
81
+ }
82
+ /**
83
+ * Produce a Blob for a multipart upload part.
84
+ *
85
+ * For real `fs.ReadStream`s backed by a file on disk we return a file-backed
86
+ * Blob via `fs.openAsBlob`, which lets undici stream the file lazily from disk
87
+ * rather than buffering the entire payload (and every concurrent part) into
88
+ * memory. Only non-file streams (e.g. in-memory `Readable`s that merely expose
89
+ * a `path` for filename inference) are buffered — their contents are already
90
+ * resident in memory, so no additional unbounded growth is introduced.
91
+ */
92
+ async function readStreamToBlob(stream, type) {
93
+ const filePath = stream.path;
94
+ // Only stream straight from disk for a pristine, whole-file fs.ReadStream.
95
+ // A partially consumed stream (bytesRead > 0) or one created with a byte
96
+ // range (start/end) must be buffered so we honour exactly the bytes the
97
+ // caller intended, rather than re-reading the entire file via openAsBlob.
98
+ const s = stream;
99
+ const isWholeFile = (s.start === undefined || s.start === 0) &&
100
+ (s.end === undefined || s.end === Infinity);
101
+ if (stream instanceof node_fs_1.ReadStream &&
102
+ filePath !== undefined &&
103
+ !s.bytesRead &&
104
+ isWholeFile) {
105
+ try {
106
+ const blob = await (0, node_fs_1.openAsBlob)(filePath, type ? { type } : undefined);
107
+ // openAsBlob re-reads the file from disk and never touches the
108
+ // caller's stream, so the stream's fd would stay open (the old
109
+ // buffering path consumed it, which auto-closed it). Destroy it
110
+ // here to release the fd. A pending fs.ReadStream still runs its
111
+ // open(2) after destroy(), and if the file has already been
112
+ // removed (e.g. a caller that deletes the temp file once the
113
+ // upload returns) the late open failure is emitted as an 'error'
114
+ // event on the destroyed stream — with no listener that is an
115
+ // uncaughtException that crashes the process. Attach a no-op
116
+ // listener so the intentionally destroyed stream can never take
117
+ // the process down.
118
+ stream.on('error', () => { });
119
+ stream.destroy();
120
+ return blob;
121
+ }
122
+ catch {
123
+ // Fall through to buffering if the file can't be opened as a Blob.
124
+ }
125
+ }
126
+ const chunks = [];
127
+ for await (const chunk of stream) {
128
+ chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
129
+ }
130
+ return new Blob([new Uint8Array(Buffer.concat(chunks))], type ? { type } : undefined);
131
+ }
28
132
  const trace = (0, debug_1.debug)('camunda:orchestration-rest');
29
133
  // Storage moved to TrackedGot.ts and imported above
30
134
  const CAMUNDA_REST_API_VERSION = 'v2';
@@ -98,10 +202,9 @@ let CamundaRestClient = class CamundaRestClient {
98
202
  this.tenantId = config.CAMUNDA_TENANT_ID;
99
203
  const baseUrl = (0, lib_1.RequireConfiguration)(config.ZEEBE_REST_ADDRESS, 'ZEEBE_REST_ADDRESS');
100
204
  this.prefixUrl = `${baseUrl}/${CAMUNDA_REST_API_VERSION}`;
101
- this.rest = (0, lib_1.GetCustomCertificateBuffer)(config).then((certificateAuthority) => (0, TrackedGot_1.createTrackedGot)(got_1.default.extend({
205
+ this.rest = (0, lib_1.GetCustomCertificateBuffer)(config).then((certificateAuthority) => (0, TrackedGot_1.createTrackedGot)(lib_1.http.extend({
102
206
  prefixUrl: this.prefixUrl,
103
207
  retry: options?.retry ?? lib_1.GotRetryConfig,
104
- request: lib_1.GotRequestFunction,
105
208
  https: {
106
209
  certificateAuthority,
107
210
  },
@@ -705,11 +808,10 @@ let CamundaRestClient = class CamundaRestClient {
705
808
  */
706
809
  async deployResources(resources, tenantId) {
707
810
  const headers = await this.getHeaders();
708
- const formData = new form_data_1.default();
811
+ const formData = new lib_1.FormData();
709
812
  resources.forEach((resource) => {
710
- formData.append(`resources`, resource.content, {
711
- filename: resource.name,
712
- });
813
+ const type = resolveContentType(undefined, resource.name);
814
+ formData.append(`resources`, new Blob([resource.content], type ? { type } : undefined), resource.name);
713
815
  });
714
816
  if (tenantId || this.tenantId) {
715
817
  formData.append('tenantId', tenantId ?? this.tenantId);
@@ -720,7 +822,6 @@ let CamundaRestClient = class CamundaRestClient {
720
822
  body: formData,
721
823
  headers: {
722
824
  ...headers,
723
- ...formData.getHeaders(),
724
825
  Accept: 'application/json',
725
826
  },
726
827
  parseJson: (text) => (0, lossless_json_1.parse)(text), // we parse the response with LosslessNumbers, with no Dto
@@ -903,19 +1004,15 @@ let CamundaRestClient = class CamundaRestClient {
903
1004
  */
904
1005
  async uploadDocument(request) {
905
1006
  const headers = await this.getHeaders();
906
- const formData = new form_data_1.default();
907
- const options = request.metadata?.contentType || request.metadata?.fileName
908
- ? {
909
- contentType: request.metadata?.contentType,
910
- filename: request.metadata?.fileName,
911
- }
912
- : {};
913
- formData.append('file', request.file, options);
1007
+ const formData = new lib_1.FormData();
1008
+ const fileName = request.metadata?.fileName ?? fileNameFromStream(request.file);
1009
+ const file = await readStreamToBlob(request.file, resolveContentType(request.metadata?.contentType, fileName));
1010
+ formData.append('file', file, fileName);
914
1011
  // Add other form fields
915
1012
  if (request.metadata) {
916
- formData.append('metadata', JSON.stringify(request.metadata), {
917
- contentType: 'application/json',
918
- });
1013
+ formData.append('metadata', new Blob([JSON.stringify(request.metadata)], {
1014
+ type: 'application/json',
1015
+ }));
919
1016
  }
920
1017
  return this.rest.then((rest) => rest
921
1018
  .post('documents', {
@@ -925,7 +1022,6 @@ let CamundaRestClient = class CamundaRestClient {
925
1022
  },
926
1023
  headers: {
927
1024
  ...headers,
928
- ...formData.getHeaders(),
929
1025
  accept: 'application/json',
930
1026
  },
931
1027
  body: formData,
@@ -965,7 +1061,7 @@ let CamundaRestClient = class CamundaRestClient {
965
1061
  * The filename is inferred from the filepath. If you are not reading the files from disk, you need to set the path, like this:
966
1062
  *
967
1063
  * ```typescript
968
- * // In-memory conversion: create Readable streams exposing a path so form-data infers filename
1064
+ * // In-memory conversion: create Readable streams exposing a path so the SDK can infer the filename
969
1065
  const streams: ReadStream[] = uploadedFiles.map((file) => {
970
1066
  const stream = new Readable({
971
1067
  read() {
@@ -973,7 +1069,7 @@ const streams: ReadStream[] = uploadedFiles.map((file) => {
973
1069
  this.push(null);
974
1070
  }
975
1071
  });
976
- // Provide minimal fs.ReadStream-like fields used by form-data for filename inference.
1072
+ // Provide minimal fs.ReadStream-like fields used by the SDK for filename inference.
977
1073
  (stream as any).path = file.originalname;
978
1074
  (stream as any).close = () => stream.destroy();
979
1075
  return stream as unknown as ReadStream;
@@ -985,9 +1081,10 @@ const streams: ReadStream[] = uploadedFiles.map((file) => {
985
1081
  */
986
1082
  async uploadDocuments(request) {
987
1083
  const headers = await this.getHeaders();
988
- const formData = new form_data_1.default();
1084
+ const formData = new lib_1.FormData();
989
1085
  for (const file of request.files) {
990
- formData.append('files', file);
1086
+ const fileName = fileNameFromStream(file);
1087
+ formData.append('files', await readStreamToBlob(file, resolveContentType(undefined, fileName)), fileName);
991
1088
  }
992
1089
  return this.rest.then((rest) => rest
993
1090
  .post('documents/batch', {
@@ -996,7 +1093,6 @@ const streams: ReadStream[] = uploadedFiles.map((file) => {
996
1093
  },
997
1094
  headers: {
998
1095
  ...headers,
999
- ...formData.getHeaders(),
1000
1096
  accept: 'application/json',
1001
1097
  },
1002
1098
  body: formData,
@@ -1175,14 +1271,10 @@ const streams: ReadStream[] = uploadedFiles.map((file) => {
1175
1271
  }
1176
1272
  gotRequest = rest(urlPath, req);
1177
1273
  gotRequest.catch(reject);
1178
- (await gotRequest).once('error', (err) => {
1179
- // Swallow the error, we don't want to crash the process
1180
- return err;
1181
- });
1182
1274
  if (request.json ?? true) {
1183
- return gotRequest.json().then(resolve);
1275
+ return gotRequest.json().then(resolve, reject);
1184
1276
  }
1185
- return gotRequest.then((response) => resolve(response.body));
1277
+ return gotRequest.then((response) => resolve(response.body), reject);
1186
1278
  }
1187
1279
  catch (e) {
1188
1280
  reject(e);