Skip to content

Commit

Permalink
feat: Expose on-demand sync via OpenAPI and add param for async
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Feb 18, 2024
1 parent 442cd53 commit a0370e7
Show file tree
Hide file tree
Showing 8 changed files with 332 additions and 27 deletions.
4 changes: 2 additions & 2 deletions apps/web/inngest/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const syncPipeline = inngest.createFunction(
...contextFactory.fromViewer({role: 'system'}),
remoteResourceId: null,
})
.syncPipeline([pipelineId, {}])
.syncPipeline({id: pipelineId})
console.log('did sync pipeline', pipelineId)
return pipelineId
},
Expand All @@ -90,7 +90,7 @@ export const syncResource = inngest.createFunction(
...contextFactory.fromViewer({role: 'system'}),
remoteResourceId: null,
})
.syncResource([resourceId, {}])
.syncResource({id: resourceId})

console.log('did sync pipeline', resourceId)
return resourceId
Expand Down
4 changes: 2 additions & 2 deletions apps/web/vcommands/vcommand-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const pipelineCommands = {
icon: 'RefreshCw',
execute: ({params: {pipeline}, ctx}) => {
void ctx.withToast(() =>
ctx.trpcCtx.client.syncPipeline.mutate([pipeline.id, {}]),
ctx.trpcCtx.client.syncPipeline.mutate({id: pipeline.id}),
)
},
}),
Expand Down Expand Up @@ -85,7 +85,7 @@ export const resourceCommands = {
icon: 'RefreshCw',
execute: ({params: {resource}, ctx}) => {
void ctx.withToast(() =>
ctx.trpcCtx.client.syncResource.mutate([resource.id, {}]),
ctx.trpcCtx.client.syncResource.mutate({id: resource.id}),
)
},
}),
Expand Down
6 changes: 3 additions & 3 deletions kits/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"scripts": {
"build": "tsc -p ./tsconfig.json",
"clean": "rm -rf ./dist",
"generate": "pnpm generate:schema && pnpm generate:types",
"generate:schema": "NEXT_PUBLIC_SERVER_URL=https://app.venice.is npx tsx ../../apps/web/lib-server/appRouter.ts > ./venice.oas.json",
"generate:types": "openapi-typescript ./venice.oas.json --output ./venice.oas.d.ts",
"gen": "pnpm gen:schema && pnpm gen:types",
"gen:schema": "NEXT_PUBLIC_SERVER_URL=https://app.venice.is npx tsx ../../apps/web/lib-server/appRouter.ts > ./venice.oas.json",
"gen:types": "openapi-typescript ./venice.oas.json --output ./venice.oas.d.ts",
"pub": "pnpm publish --no-git-checks --access public"
},
"dependencies": {
Expand Down
131 changes: 131 additions & 0 deletions kits/sdk/venice.oas.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

145 changes: 144 additions & 1 deletion kits/sdk/venice.oas.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

1 comment on commit a0370e7

@vercel
Copy link

@vercel vercel bot commented on a0370e7 Feb 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

venice – ./

venice-venice.vercel.app
venice-git-production-venice.vercel.app
usevenice.vercel.app
app.venice.is

Please sign in to comment.