@chatu-ai/builder-sdk-mock 0.8.0 → 0.8.1

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -108,6 +108,13 @@ export function createMockBuilderClient(script) {
108
108
  set: async () => ({ ok: true }),
109
109
  remove: async () => ({ ok: true, removed: true }),
110
110
  },
111
+ db: {
112
+ collections: async () => ({ ok: true, collections: [{ name: 'todos', count: 2 }] }),
113
+ query: async () => ({ ok: true, docs: [{ _id: 'a1', _createdAt: Date.now(), _updatedAt: Date.now(), title: 'mock todo', done: false }], total: 1, nextSkip: null }),
114
+ replace: async (_id, _coll, docId, doc) => ({ ok: true, doc: { _id: docId, ...doc } }),
115
+ remove: async () => ({ ok: true, removed: true }),
116
+ drop: async () => ({ ok: true, dropped: true }),
117
+ },
111
118
  storage: {
112
119
  list: async () => ({ ok: true, items: [{ key: 'uploads/a.png', size: 1024, lastModified: new Date().toISOString() }], nextCursor: null }),
113
120
  sign: async (_id, key) => ({ ok: true, url: `https://mock.invalid/${key}` }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatu-ai/builder-sdk-mock",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
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.8.0"
44
+ "@chatu-ai/builder-sdk": "0.8.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "typescript": "^5.7.0",