DiamondDragon
DiamondDragon
Explore posts from servers
CDCloudflare Developers
Created by DiamondDragon on 9/30/2024 in #workers-help
Error on remote worker: APIError: A request to the Cloudflare API
Ah I see. I changed the bounding name and am able to use dev now. Is there a way on my end to see MYBROWSER is bound more than once?
5 replies
CDCloudflare Developers
Created by DiamondDragon on 9/30/2024 in #workers-help
Error on remote worker: APIError: A request to the Cloudflare API
https://community.cloudflare.com/t/error-on-remote-worker-apierror-a-request-to-the-cloudflare-api-failed/716272 it appears to be this issue I get this runnign wrangler dev --remote wrangler 3.78.12
5 replies
CDCloudflare Developers
Created by kchro3 on 9/24/2024 in #workers-help
No such module "node:events"
No description
6 replies
CDCloudflare Developers
Created by murzin on 6/27/2024 in #workers-help
what's the point of workers?
@Murzin @Chaika it appears Jimp now works with CF workers https://github.com/jimp-dev/jimp/releases/tag/v1.0.2 (if it wasnt)
109 replies
DTDrizzle Team
Created by DiamondDragon on 9/6/2024 in #help
Drizzle Zod refining not working?
Ok I’ll check it out today. Thanks
3 replies
HHono
Created by DiamondDragon on 6/8/2024 in #help
Serialization of Date?
Hi, do you have any code samples on this? Basically, my code is looking ugly like this in order to handle typing the date strings back to Date 😦
const res = await apiClient.auth['auth-state'][':workOsUserId'].$get({
param: { workOsUserId },
})
if (!res.ok) {
throw new Error(`Error fetching auth state: ${res.status}`)
}
const data = await res.json()

if (data.user) {
return {
user: data.user
? {
...data.user,
createdAt: new Date(data.user.createdAt),
updatedAt: data.user.updatedAt ? new Date(data.user.updatedAt) : null,
}
: null,
organizations: data.organizations.map((org) => ({
...org,
createdAt: new Date(org.createdAt),
updatedAt: org.updatedAt ? new Date(org.updatedAt) : null,
})),
workspaces: data.workspaces.map((workspace) => ({
...workspace,
createdAt: new Date(workspace.createdAt),
updatedAt: workspace.updatedAt ? new Date(workspace.updatedAt) : null,
})),
}
}
return {
user: null,
organizations: [],
workspaces: [],
}
},
const res = await apiClient.auth['auth-state'][':workOsUserId'].$get({
param: { workOsUserId },
})
if (!res.ok) {
throw new Error(`Error fetching auth state: ${res.status}`)
}
const data = await res.json()

if (data.user) {
return {
user: data.user
? {
...data.user,
createdAt: new Date(data.user.createdAt),
updatedAt: data.user.updatedAt ? new Date(data.user.updatedAt) : null,
}
: null,
organizations: data.organizations.map((org) => ({
...org,
createdAt: new Date(org.createdAt),
updatedAt: org.updatedAt ? new Date(org.updatedAt) : null,
})),
workspaces: data.workspaces.map((workspace) => ({
...workspace,
createdAt: new Date(workspace.createdAt),
updatedAt: workspace.updatedAt ? new Date(workspace.updatedAt) : null,
})),
}
}
return {
user: null,
organizations: [],
workspaces: [],
}
},
10 replies
HHono
Created by DiamondDragon on 6/8/2024 in #help
Serialization of Date?
Still not solved, can you provide a working code sample? https://zenn.dev/kosei28/articles/hono-superjson for example I tried to implement this but most of the types used in this hcs proxy are not exported from hono today it seems? So the modified hcs client is not typesafe, or at least my attempt
10 replies