@amaster.ai/client 1.1.46 → 1.1.47
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/README.md +4 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +11 -11
- package/types/__tests__/type-checks.test-d.ts +9 -0
- package/types/entity.d.ts +5 -1
- package/types/index.d.ts +2 -0
package/README.md
CHANGED
|
@@ -201,12 +201,14 @@ const result = await client.entity.update("default", "users", 123, {
|
|
|
201
201
|
### Update Entities By Conditions
|
|
202
202
|
|
|
203
203
|
```typescript
|
|
204
|
-
await client.entity.updateWhere(
|
|
204
|
+
const result = await client.entity.updateWhere(
|
|
205
205
|
"default",
|
|
206
206
|
"users",
|
|
207
207
|
{ status: "pending", "created_at[lt]": "2026-01-01" },
|
|
208
208
|
{ status: "expired" }
|
|
209
209
|
);
|
|
210
|
+
|
|
211
|
+
console.log(result.data?.affectedRows);
|
|
210
212
|
```
|
|
211
213
|
|
|
212
214
|
### Delete Entity
|
|
@@ -749,7 +751,7 @@ Full CRUD API from `@amaster.ai/entity-client`:
|
|
|
749
751
|
- `get(source, entity, id)` - Get single entity
|
|
750
752
|
- `create(source, entity, data)` - Create new entity
|
|
751
753
|
- `update(source, entity, id, data)` - Update entity
|
|
752
|
-
- `updateWhere(source, entity, params, data)` - Update entities matching filter conditions
|
|
754
|
+
- `updateWhere(source, entity, params, data)` - Update entities matching filter conditions and return affected rows
|
|
753
755
|
- `delete(source, entity, id)` - Delete entity
|
|
754
756
|
- `bulkUpdate(source, entity, items)` - Bulk update
|
|
755
757
|
- `bulkDelete(source, entity, ids)` - Bulk delete
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuthClient } from '@amaster.ai/auth-client';
|
|
2
2
|
export { LoginParams, LoginResponse, OAuthProvider, Permission, RegisterParams, Role, Session, User } from '@amaster.ai/auth-client';
|
|
3
3
|
import { EntityClient } from '@amaster.ai/entity-client';
|
|
4
|
-
export { EntityGetParams, EntityListResponse, EntityQueryParams, EntityUpdateWhereParams, FilterGroup, FilterItem, FilterOperator } from '@amaster.ai/entity-client';
|
|
4
|
+
export { EntityGetParams, EntityListResponse, EntityQueryParams, EntityUpdateWhereParams, EntityUpdateWhereResponse, FilterGroup, FilterItem, FilterOperator } from '@amaster.ai/entity-client';
|
|
5
5
|
import { BpmClient } from '@amaster.ai/bpm-client';
|
|
6
6
|
export { ActivityInstanceTree, CamundaVariable, HistoryActivityInstance, HistoryProcessInstance, HistoryTask, ProcessInstance, ProcessVariable, Task, TaskFormSchema, TaskQueryParams, UserOperationLog } from '@amaster.ai/bpm-client';
|
|
7
7
|
import { WorkflowClient } from '@amaster.ai/workflow-client';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuthClient } from '@amaster.ai/auth-client';
|
|
2
2
|
export { LoginParams, LoginResponse, OAuthProvider, Permission, RegisterParams, Role, Session, User } from '@amaster.ai/auth-client';
|
|
3
3
|
import { EntityClient } from '@amaster.ai/entity-client';
|
|
4
|
-
export { EntityGetParams, EntityListResponse, EntityQueryParams, EntityUpdateWhereParams, FilterGroup, FilterItem, FilterOperator } from '@amaster.ai/entity-client';
|
|
4
|
+
export { EntityGetParams, EntityListResponse, EntityQueryParams, EntityUpdateWhereParams, EntityUpdateWhereResponse, FilterGroup, FilterItem, FilterOperator } from '@amaster.ai/entity-client';
|
|
5
5
|
import { BpmClient } from '@amaster.ai/bpm-client';
|
|
6
6
|
export { ActivityInstanceTree, CamundaVariable, HistoryActivityInstance, HistoryProcessInstance, HistoryTask, ProcessInstance, ProcessVariable, Task, TaskFormSchema, TaskQueryParams, UserOperationLog } from '@amaster.ai/bpm-client';
|
|
7
7
|
import { WorkflowClient } from '@amaster.ai/workflow-client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/client",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.47",
|
|
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/
|
|
78
|
-
"@amaster.ai/
|
|
79
|
-
"@amaster.ai/
|
|
80
|
-
"@amaster.ai/
|
|
81
|
-
"@amaster.ai/
|
|
82
|
-
"@amaster.ai/
|
|
83
|
-
"@amaster.ai/
|
|
84
|
-
"@amaster.ai/
|
|
75
|
+
"@amaster.ai/asr-client": "1.1.47",
|
|
76
|
+
"@amaster.ai/auth-client": "1.1.47",
|
|
77
|
+
"@amaster.ai/bpm-client": "1.1.47",
|
|
78
|
+
"@amaster.ai/copilot-client": "1.1.47",
|
|
79
|
+
"@amaster.ai/entity-client": "1.1.47",
|
|
80
|
+
"@amaster.ai/function-client": "1.1.47",
|
|
81
|
+
"@amaster.ai/http-client": "1.1.47",
|
|
82
|
+
"@amaster.ai/tts-client": "1.1.47",
|
|
83
|
+
"@amaster.ai/workflow-client": "1.1.47",
|
|
84
|
+
"@amaster.ai/s3-client": "1.1.47"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"axios": "^1.11.0"
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
ClientResult,
|
|
13
13
|
ClientError,
|
|
14
14
|
EntityListResponse,
|
|
15
|
+
EntityUpdateWhereResponse,
|
|
15
16
|
LoginParams,
|
|
16
17
|
User,
|
|
17
18
|
Task,
|
|
@@ -107,6 +108,14 @@ describe('Type Tests', () => {
|
|
|
107
108
|
it('should expose the current downstream client methods', () => {
|
|
108
109
|
expectTypeOf<AmasterClient['entity']>().toHaveProperty('bulkUpdate');
|
|
109
110
|
expectTypeOf<AmasterClient['entity']>().toHaveProperty('updateWhere');
|
|
111
|
+
const updateWhereResult: Promise<ClientResult<EntityUpdateWhereResponse>> =
|
|
112
|
+
({} as AmasterClient).entity.updateWhere(
|
|
113
|
+
'default',
|
|
114
|
+
'users',
|
|
115
|
+
{ status: 'active' },
|
|
116
|
+
{ status: 'inactive' }
|
|
117
|
+
);
|
|
118
|
+
expectTypeOf(updateWhereResult).toMatchTypeOf<Promise<ClientResult<EntityUpdateWhereResponse>>>();
|
|
110
119
|
expectTypeOf<AmasterClient['entity']>().toHaveProperty('bulkDelete');
|
|
111
120
|
expectTypeOf<AmasterClient['bpm']>().toHaveProperty('startProcess');
|
|
112
121
|
expectTypeOf<AmasterClient['workflow']>().toHaveProperty('run');
|
package/types/entity.d.ts
CHANGED
|
@@ -200,6 +200,10 @@ export interface EntityUpdateWhereParams {
|
|
|
200
200
|
[key: string]: unknown;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
export interface EntityUpdateWhereResponse {
|
|
204
|
+
affectedRows: number;
|
|
205
|
+
}
|
|
206
|
+
|
|
203
207
|
// ==================== Response Types ====================
|
|
204
208
|
|
|
205
209
|
/**
|
|
@@ -375,7 +379,7 @@ export interface EntityClientAPI {
|
|
|
375
379
|
/**
|
|
376
380
|
* Update all entities matching the provided conditions.
|
|
377
381
|
*/
|
|
378
|
-
updateWhere<T =
|
|
382
|
+
updateWhere<T = EntityUpdateWhereResponse>(
|
|
379
383
|
source: string,
|
|
380
384
|
entity: string,
|
|
381
385
|
params: EntityUpdateWhereParams,
|