Skip to content

Commit 6fce435

Browse files
committed
fix(camunda8): add optional tenantId to deployResourcesFromFiles
fixes #375
1 parent 96baf6b commit 6fce435

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import path from 'node:path'
2+
3+
import { CamundaRestClient } from '../../../c8/lib/CamundaRestClient'
4+
5+
let processDefinitionId: string
6+
const restClient = new CamundaRestClient()
7+
8+
test('It can deploy with a specific tenantId', async () => {
9+
const res = await restClient.deployResourcesFromFiles(
10+
[
11+
path.join(
12+
'.',
13+
'src',
14+
'__tests__',
15+
'testdata',
16+
'hello-world-complete-rest.bpmn'
17+
),
18+
],
19+
{ tenantId: 'green' }
20+
)
21+
processDefinitionId = res.processes[0].processDefinitionId
22+
expect(processDefinitionId).toBeTruthy()
23+
})

src/c8/lib/CamundaRestClient.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,10 @@ export class CamundaRestClient {
843843
*
844844
* @since 8.6.0
845845
*/
846-
public async deployResourcesFromFiles(files: string[]) {
846+
public async deployResourcesFromFiles(
847+
files: string[],
848+
{ tenantId }: { tenantId?: string } = {}
849+
) {
847850
const resources: { content: string; name: string }[] = []
848851

849852
for (const file of files) {
@@ -853,7 +856,7 @@ export class CamundaRestClient {
853856
})
854857
}
855858

856-
return this.deployResources(resources)
859+
return this.deployResources(resources, tenantId ?? this.tenantId)
857860
}
858861

859862
/**

0 commit comments

Comments
 (0)