mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-01 02:01:40 +00:00
style: apply biome formatting and lint fixes for CI
This commit is contained in:
parent
adc9019eab
commit
b5722da157
5 changed files with 32 additions and 13 deletions
|
|
@ -110,9 +110,11 @@ async function main() {
|
|||
|
||||
if (values.out) {
|
||||
await writeFile(values.out, output, "utf-8")
|
||||
console.error(`✓ Successfully exported memories for '${tag}' to ${values.out}`)
|
||||
console.error(
|
||||
`✓ Successfully exported memories for '${tag}' to ${values.out}`,
|
||||
)
|
||||
} else {
|
||||
process.stdout.write(output + "\n")
|
||||
process.stdout.write(`${output}\n`)
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
console.error(
|
||||
|
|
|
|||
|
|
@ -9,10 +9,18 @@ import {
|
|||
|
||||
function createMockFetch(responses: MemoriesListResponse[]) {
|
||||
let callCount = 0
|
||||
const fetchMock = async (url: string | URL | Request, init?: RequestInit) => {
|
||||
const fetchMock = async (
|
||||
_url: string | URL | Request,
|
||||
_init?: RequestInit,
|
||||
) => {
|
||||
const pageResponse = responses[callCount] || {
|
||||
memoryEntries: [],
|
||||
pagination: { currentPage: callCount + 1, limit: 10, totalItems: 0, totalPages: 1 },
|
||||
pagination: {
|
||||
currentPage: callCount + 1,
|
||||
limit: 10,
|
||||
totalItems: 0,
|
||||
totalPages: 1,
|
||||
},
|
||||
}
|
||||
callCount++
|
||||
|
||||
|
|
@ -35,7 +43,10 @@ describe("listMemoriesRequest", () => {
|
|||
let capturedUrl = ""
|
||||
let capturedInit: RequestInit | undefined
|
||||
|
||||
const customFetch = async (url: string | URL | Request, init?: RequestInit) => {
|
||||
const customFetch = async (
|
||||
url: string | URL | Request,
|
||||
init?: RequestInit,
|
||||
) => {
|
||||
capturedUrl = String(url)
|
||||
capturedInit = init
|
||||
return {
|
||||
|
|
@ -53,7 +64,12 @@ describe("listMemoriesRequest", () => {
|
|||
updatedAt: "2026-09-01T10:00:00.000Z",
|
||||
},
|
||||
],
|
||||
pagination: { currentPage: 1, limit: 10, totalItems: 1, totalPages: 1 },
|
||||
pagination: {
|
||||
currentPage: 1,
|
||||
limit: 10,
|
||||
totalItems: 1,
|
||||
totalPages: 1,
|
||||
},
|
||||
}),
|
||||
} as Response
|
||||
}
|
||||
|
|
@ -67,9 +83,9 @@ describe("listMemoriesRequest", () => {
|
|||
|
||||
expect(capturedUrl).toBe("http://localhost:6767/v4/memories/list")
|
||||
expect(capturedInit?.method).toBe("POST")
|
||||
expect((capturedInit?.headers as Record<string, string>)?.Authorization).toBe(
|
||||
"Bearer sm_test_key",
|
||||
)
|
||||
expect(
|
||||
(capturedInit?.headers as Record<string, string>)?.Authorization,
|
||||
).toBe("Bearer sm_test_key")
|
||||
const parsedBody = JSON.parse(String(capturedInit?.body))
|
||||
expect(parsedBody.containerTags).toEqual(["user_123"])
|
||||
expect(parsedBody.page).toBe(1)
|
||||
|
|
@ -83,7 +99,8 @@ describe("listMemoriesRequest", () => {
|
|||
ok: false,
|
||||
status: 400,
|
||||
statusText: "Bad Request",
|
||||
text: async () => JSON.stringify({ error: "Container tag is required" }),
|
||||
text: async () =>
|
||||
JSON.stringify({ error: "Container tag is required" }),
|
||||
}) as unknown as Response
|
||||
|
||||
expect(
|
||||
|
|
|
|||
|
|
@ -24,4 +24,3 @@ export {
|
|||
type ExportMemoriesOptions,
|
||||
type MemoriesExportData,
|
||||
} from "./shared"
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,9 @@ export async function exportMemoriesAsMarkdown(
|
|||
lines.push(`- **Created:** ${m.createdAt}`)
|
||||
lines.push(`- **Updated:** ${m.updatedAt}`)
|
||||
if (m.documentIds && m.documentIds.length > 0) {
|
||||
lines.push(`- **Source Documents:** ${m.documentIds.map((d) => `\`${d}\``).join(", ")}`)
|
||||
lines.push(
|
||||
`- **Source Documents:** ${m.documentIds.map((d) => `\`${d}\``).join(", ")}`,
|
||||
)
|
||||
}
|
||||
if (m.history && m.history.length > 0) {
|
||||
lines.push(`- **Previous Revisions:** ${m.history.length}`)
|
||||
|
|
|
|||
|
|
@ -66,4 +66,3 @@ export {
|
|||
type ExportMemoriesOptions,
|
||||
type MemoriesExportData,
|
||||
} from "./export-memories"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue