@amaster.ai/client 1.1.43 → 1.1.45
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 +12 -0
- 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 +1 -0
- package/types/entity.d.ts +21 -0
package/README.md
CHANGED
|
@@ -198,6 +198,17 @@ const result = await client.entity.update("default", "users", 123, {
|
|
|
198
198
|
});
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
+
### Update Entities By Conditions
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
await client.entity.updateWhere(
|
|
205
|
+
"default",
|
|
206
|
+
"users",
|
|
207
|
+
{ status: "pending", "created_at[lt]": "2026-01-01" },
|
|
208
|
+
{ status: "expired" }
|
|
209
|
+
);
|
|
210
|
+
```
|
|
211
|
+
|
|
201
212
|
### Delete Entity
|
|
202
213
|
|
|
203
214
|
```typescript
|
|
@@ -738,6 +749,7 @@ Full CRUD API from `@amaster.ai/entity-client`:
|
|
|
738
749
|
- `get(source, entity, id)` - Get single entity
|
|
739
750
|
- `create(source, entity, data)` - Create new entity
|
|
740
751
|
- `update(source, entity, id, data)` - Update entity
|
|
752
|
+
- `updateWhere(source, entity, params, data)` - Update entities matching filter conditions
|
|
741
753
|
- `delete(source, entity, id)` - Delete entity
|
|
742
754
|
- `bulkUpdate(source, entity, items)` - Bulk update
|
|
743
755
|
- `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, FilterGroup, FilterItem, FilterOperator } from '@amaster.ai/entity-client';
|
|
4
|
+
export { EntityGetParams, EntityListResponse, EntityQueryParams, EntityUpdateWhereParams, 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, FilterGroup, FilterItem, FilterOperator } from '@amaster.ai/entity-client';
|
|
4
|
+
export { EntityGetParams, EntityListResponse, EntityQueryParams, EntityUpdateWhereParams, 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.45",
|
|
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/asr-client": "1.1.
|
|
76
|
-
"@amaster.ai/auth-client": "1.1.
|
|
77
|
-
"@amaster.ai/bpm-client": "1.1.
|
|
78
|
-
"@amaster.ai/copilot-client": "1.1.
|
|
79
|
-
"@amaster.ai/entity-client": "1.1.
|
|
80
|
-
"@amaster.ai/
|
|
81
|
-
"@amaster.ai/
|
|
82
|
-
"@amaster.ai/
|
|
83
|
-
"@amaster.ai/
|
|
84
|
-
"@amaster.ai/
|
|
75
|
+
"@amaster.ai/asr-client": "1.1.45",
|
|
76
|
+
"@amaster.ai/auth-client": "1.1.45",
|
|
77
|
+
"@amaster.ai/bpm-client": "1.1.45",
|
|
78
|
+
"@amaster.ai/copilot-client": "1.1.45",
|
|
79
|
+
"@amaster.ai/entity-client": "1.1.45",
|
|
80
|
+
"@amaster.ai/function-client": "1.1.45",
|
|
81
|
+
"@amaster.ai/s3-client": "1.1.45",
|
|
82
|
+
"@amaster.ai/tts-client": "1.1.45",
|
|
83
|
+
"@amaster.ai/workflow-client": "1.1.45",
|
|
84
|
+
"@amaster.ai/http-client": "1.1.45"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"axios": "^1.11.0"
|
|
@@ -106,6 +106,7 @@ describe('Type Tests', () => {
|
|
|
106
106
|
|
|
107
107
|
it('should expose the current downstream client methods', () => {
|
|
108
108
|
expectTypeOf<AmasterClient['entity']>().toHaveProperty('bulkUpdate');
|
|
109
|
+
expectTypeOf<AmasterClient['entity']>().toHaveProperty('updateWhere');
|
|
109
110
|
expectTypeOf<AmasterClient['entity']>().toHaveProperty('bulkDelete');
|
|
110
111
|
expectTypeOf<AmasterClient['bpm']>().toHaveProperty('startProcess');
|
|
111
112
|
expectTypeOf<AmasterClient['workflow']>().toHaveProperty('run');
|
package/types/entity.d.ts
CHANGED
|
@@ -189,6 +189,17 @@ export interface EntityGetParams {
|
|
|
189
189
|
__fields?: string[];
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Conditions used by `updateWhere()`.
|
|
194
|
+
*/
|
|
195
|
+
export interface EntityUpdateWhereParams {
|
|
196
|
+
/** Advanced filter (condition builder with AND/OR) */
|
|
197
|
+
__filter?: FilterGroup;
|
|
198
|
+
|
|
199
|
+
/** Simple filters using field=value or field[op]=value */
|
|
200
|
+
[key: string]: unknown;
|
|
201
|
+
}
|
|
202
|
+
|
|
192
203
|
// ==================== Response Types ====================
|
|
193
204
|
|
|
194
205
|
/**
|
|
@@ -361,6 +372,16 @@ export interface EntityClientAPI {
|
|
|
361
372
|
data: Record<string, unknown>
|
|
362
373
|
): Promise<ClientResult<T>>;
|
|
363
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Update all entities matching the provided conditions.
|
|
377
|
+
*/
|
|
378
|
+
updateWhere<T = Record<string, unknown>>(
|
|
379
|
+
source: string,
|
|
380
|
+
entity: string,
|
|
381
|
+
params: EntityUpdateWhereParams,
|
|
382
|
+
data: Record<string, unknown>
|
|
383
|
+
): Promise<ClientResult<T>>;
|
|
384
|
+
|
|
364
385
|
/**
|
|
365
386
|
* Delete an entity by ID
|
|
366
387
|
*
|