@chatu-ai/builder-sdk-mock 0.8.7 → 0.9.0
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/dist/index.js +13 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -115,6 +115,19 @@ export function createMockBuilderClient(script) {
|
|
|
115
115
|
set: async () => ({ ok: true }),
|
|
116
116
|
remove: async () => ({ ok: true, removed: true }),
|
|
117
117
|
},
|
|
118
|
+
auth: {
|
|
119
|
+
users: async () => ({
|
|
120
|
+
ok: true,
|
|
121
|
+
users: [
|
|
122
|
+
{ id: 'u1', email: 'alice@example.com', name: '爱丽丝', avatar: null, createdAt: Date.now() - 86400000, lastLoginAt: Date.now(), disabled: false, meta: {} },
|
|
123
|
+
{ id: 'u2', email: 'bob@example.com', name: 'Bob', avatar: null, createdAt: Date.now() - 172800000, lastLoginAt: Date.now() - 3600000, disabled: true, meta: {} },
|
|
124
|
+
],
|
|
125
|
+
total: 2,
|
|
126
|
+
nextSkip: null,
|
|
127
|
+
}),
|
|
128
|
+
updateUser: async (_id, userId, patch) => ({ ok: true, user: { id: userId, email: 'alice@example.com', ...patch } }),
|
|
129
|
+
removeUser: async () => ({ ok: true, removed: true }),
|
|
130
|
+
},
|
|
118
131
|
db: {
|
|
119
132
|
collections: async () => ({ ok: true, collections: [{ name: 'todos', count: 2 }] }),
|
|
120
133
|
query: async () => ({ ok: true, docs: [{ _id: 'a1', _createdAt: Date.now(), _updatedAt: Date.now(), title: 'mock todo', done: false }], total: 1, nextSkip: null }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatu-ai/builder-sdk-mock",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Mock BuilderClient for @chatu-ai/builder-sdk: scripted event replay with latency & disconnect injection",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"node": ">=18"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@chatu-ai/builder-sdk": "0.
|
|
44
|
+
"@chatu-ai/builder-sdk": "0.9.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^5.7.0",
|