()
| 25 | ) {} |
| 26 | |
| 27 | async getNamespaces(): Promise<SavedDocNamespace[]> { |
| 28 | if (this.cacheNamespaceList) { |
| 29 | return this.cacheNamespaceList; |
| 30 | } |
| 31 | |
| 32 | const queries = await getOuterbaseQueryList(this.workspaceId, this.baseId); |
| 33 | |
| 34 | this.cacheNamespaceList = [ |
| 35 | { |
| 36 | id: "default", |
| 37 | name: "Workspace", |
| 38 | createdAt: Date.now(), |
| 39 | updatedAt: Date.now(), |
| 40 | }, |
| 41 | ]; |
| 42 | |
| 43 | this.cacheDocs = { |
| 44 | default: queries.items.map((q) => ({ |
| 45 | id: q.id, |
| 46 | namespace: { |
| 47 | id: "default", |
| 48 | name: "Workspace", |
| 49 | createdAt: Date.now(), |
| 50 | updatedAt: Date.now(), |
| 51 | }, |
| 52 | name: q.name, |
| 53 | content: q.query, |
| 54 | type: "sql", |
| 55 | data: q, |
| 56 | createdAt: Date.now(), |
| 57 | updatedAt: Date.now(), |
| 58 | })), |
| 59 | }; |
| 60 | |
| 61 | return this.cacheNamespaceList; |
| 62 | } |
| 63 | |
| 64 | async createNamespace(): Promise<SavedDocNamespace> { |
| 65 | throw new Error("Not implemented"); |
no test coverage detected