@amaster.ai/client 1.1.50 → 1.1.51
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/package.json +11 -11
- package/types/__tests__/type-checks.test-d.ts +37 -0
- package/types/bpm.d.ts +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.51",
|
|
4
4
|
"description": "Unified API client for Amaster platform - All services in one package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@amaster.ai/
|
|
76
|
-
"@amaster.ai/
|
|
77
|
-
"@amaster.ai/copilot-client": "1.1.
|
|
78
|
-
"@amaster.ai/entity-client": "1.1.
|
|
79
|
-
"@amaster.ai/
|
|
80
|
-
"@amaster.ai/
|
|
81
|
-
"@amaster.ai/
|
|
82
|
-
"@amaster.ai/tts-client": "1.1.
|
|
83
|
-
"@amaster.ai/
|
|
84
|
-
"@amaster.ai/
|
|
75
|
+
"@amaster.ai/asr-client": "1.1.51",
|
|
76
|
+
"@amaster.ai/auth-client": "1.1.51",
|
|
77
|
+
"@amaster.ai/copilot-client": "1.1.51",
|
|
78
|
+
"@amaster.ai/entity-client": "1.1.51",
|
|
79
|
+
"@amaster.ai/function-client": "1.1.51",
|
|
80
|
+
"@amaster.ai/http-client": "1.1.51",
|
|
81
|
+
"@amaster.ai/s3-client": "1.1.51",
|
|
82
|
+
"@amaster.ai/tts-client": "1.1.51",
|
|
83
|
+
"@amaster.ai/workflow-client": "1.1.51",
|
|
84
|
+
"@amaster.ai/bpm-client": "1.1.51"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"axios": "^1.11.0"
|
|
@@ -190,6 +190,17 @@ describe('Type Tests', () => {
|
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
describe('BPM Types', () => {
|
|
193
|
+
it('should accept businessKey when starting a process', () => {
|
|
194
|
+
type StartProcessInputs = Parameters<AmasterClient['bpm']['startProcess']>[1];
|
|
195
|
+
|
|
196
|
+
expectTypeOf<{
|
|
197
|
+
businessKey: string;
|
|
198
|
+
variables: {
|
|
199
|
+
expense_id: { value: string; type: 'String' };
|
|
200
|
+
};
|
|
201
|
+
}>().toMatchTypeOf<StartProcessInputs>();
|
|
202
|
+
});
|
|
203
|
+
|
|
193
204
|
it('should have correct Task structure', () => {
|
|
194
205
|
expectTypeOf<Task>().toMatchTypeOf<{
|
|
195
206
|
id: string;
|
|
@@ -206,5 +217,31 @@ describe('Type Tests', () => {
|
|
|
206
217
|
businessKey?: string;
|
|
207
218
|
}>();
|
|
208
219
|
});
|
|
220
|
+
|
|
221
|
+
it('should allow BPM variable submissions with business keys', () => {
|
|
222
|
+
expectTypeOf<Parameters<AmasterClient['bpm']['startProcess']>[1]>().toMatchTypeOf<{
|
|
223
|
+
businessKey?: string;
|
|
224
|
+
variables: {
|
|
225
|
+
recordId: {
|
|
226
|
+
value: string;
|
|
227
|
+
type: 'String';
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
}>();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it('should not expose business keys on BPM task completion submissions', () => {
|
|
234
|
+
expectTypeOf<Parameters<AmasterClient['bpm']['completeTask']>[1]>().toMatchTypeOf<{
|
|
235
|
+
variables: {
|
|
236
|
+
approved: {
|
|
237
|
+
value: boolean;
|
|
238
|
+
type: 'Boolean';
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
}>();
|
|
242
|
+
expectTypeOf<Parameters<AmasterClient['bpm']['completeTask']>[1]>().not.toMatchTypeOf<{
|
|
243
|
+
businessKey?: string;
|
|
244
|
+
}>();
|
|
245
|
+
});
|
|
209
246
|
});
|
|
210
247
|
});
|
package/types/bpm.d.ts
CHANGED
|
@@ -79,6 +79,14 @@ export interface VariableSubmission {
|
|
|
79
79
|
variables: Record<string, CamundaVariable>;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Process start payload. `businessKey` is only valid when starting a process,
|
|
84
|
+
* not when completing a task.
|
|
85
|
+
*/
|
|
86
|
+
export interface ProcessStartSubmission extends VariableSubmission {
|
|
87
|
+
businessKey?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
82
90
|
// ==================== Process Types ====================
|
|
83
91
|
|
|
84
92
|
/**
|
|
@@ -392,7 +400,7 @@ export interface BpmClientAPI {
|
|
|
392
400
|
*/
|
|
393
401
|
startProcess(
|
|
394
402
|
processKey: string,
|
|
395
|
-
inputs?: Record<string, CamundaVariableValue> |
|
|
403
|
+
inputs?: Record<string, CamundaVariableValue> | ProcessStartSubmission
|
|
396
404
|
): Promise<ClientResult<ProcessInstance>>;
|
|
397
405
|
|
|
398
406
|
/**
|