Skip to content

Commit

Permalink
Upgrade core deps to support v1 api (#260)
Browse files Browse the repository at this point in the history
* Add new api-vi package

* Upgrade to typescript >4.7.3 for trpc 11

* trpc init

* generate openapi document

* generate openapi document and types also

* sdk v1 with various clients

* Create new workspace folder packages-v1

* Fix issue with build

* init elysia

* Mounting apis in a single elysia app

* got elysia mount working

* Adding @elysia/swagger

* File renames

* Add __generated__ folder

* Add example models

* Improve thus models

* separate oas spec file

* Mount elysia inside next.js

* Separate context and allow endpoint to be passed into createHandlers for clarity

* fix build

* demonstrate usage of trpc client with trpc route

* Add test against openapi client

* Test openapi links also

* Removing all v1 code to stack prs

* Downgrade t3-env to be cjs compatible version

* downgrade further to 0.7.0 to be cjs

* 0.7.3 is the best one
  • Loading branch information
openint-bot authored Feb 14, 2025
1 parent 1b8d7c2 commit 3831513
Show file tree
Hide file tree
Showing 10 changed files with 427 additions and 200 deletions.
2 changes: 1 addition & 1 deletion apps/app-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@openint/env": "workspace:*",
"@openint/meta-service-postgres": "workspace:*",
"@openint/util": "workspace:*",
"@t3-oss/env-nextjs": "0.3.1",
"@t3-oss/env-nextjs": "0.7.3",
"chokidar": "3.5.3",
"cross-fetch": "4.0.0",
"execa": "6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/__tests__/healthcheck.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ test.each([
test('/api/trpc', async () => {
const trpc = createAppTrpcClient({apiUrl: endpoint('/api/trpc')})
const res = await trpc.getPublicEnv.query()
expect(res.NEXT_PUBLIC_NANGO_PUBLIC_KEY).toBeDefined()
expect(res['NEXT_PUBLIC_NANGO_PUBLIC_KEY']).toBeDefined()
})
10 changes: 6 additions & 4 deletions connectors/connector-plaid/PlaidClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
PlaidEnvironments,
Products,
} from 'plaid'
// Two separate zod version for now to minimize diff in current PR
import z2 from 'zod'
import {getDefaultProxyAgent, memoize, z, zCast, zFunction} from '@openint/util'
import {inferPlaidEnvFromToken} from './plaid-utils'
import type {WebhookShape} from './plaid.types'
Expand Down Expand Up @@ -91,10 +93,10 @@ export function makePlaidClient(config: {
export function getPlatformConfig(envName: EnvName) {
const env = createEnv({
server: {
int_plaid__CLIENT_ID: z.string(),
int_plaid__CLIENT_SECRET_SANDBOX: z.string(),
int_plaid__CLIENT_SECRET_DEVELOPMENT: z.string(),
int_plaid__CLIENT_SECRET_PRODUCTION: z.string(),
int_plaid__CLIENT_ID: z2.string(),
int_plaid__CLIENT_SECRET_SANDBOX: z2.string(),
int_plaid__CLIENT_SECRET_DEVELOPMENT: z2.string(),
int_plaid__CLIENT_SECRET_PRODUCTION: z2.string(),
},
runtimeEnv: process.env,
})
Expand Down
5 changes: 3 additions & 2 deletions connectors/connector-plaid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"@opensdks/fetch-links": "^0.0.22",
"@opensdks/runtime": "^0.0.19",
"@opensdks/sdk-plaid": "^0.0.19",
"@t3-oss/env-core": "0.7.1",
"@t3-oss/env-core": "0.7.3",
"plaid": "12.3.0",
"react-plaid-link": "3.3.2"
"react-plaid-link": "3.3.2",
"zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "*",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"ts-brand": "0.0.2",
"tsx": "3.12.2",
"turbo": "^1.10.16",
"typescript": "^5.6.2",
"typescript": "^5.7.3",
"typescript-snapshots-plugin": "^1.7.0",
"wait-on": "^8.0.1"
},
Expand Down
11 changes: 9 additions & 2 deletions packages/api/appRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,15 @@ export function oasWebhooksEventsMap(
type Schemas = NonNullable<ZodOpenApiComponentsObject['schemas']>
const components = {
schemas: mapKeys(
mapValues(eMap, (shape, name): Schemas[string] =>
z.object({...shape, name: z.literal(name), id: z.string().optional()}),
mapValues(
eMap,
(shape, name) =>
// Not sure why this is erroring, we should probably fix everywhere
z.object({
...shape,
name: z.literal(name),
id: z.string().optional(),
}) as unknown as Schemas[string],
),
(name) => `webhooks.${name}`,
),
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-frontend/hocs/WithConnectorConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const WithConnectorConnect = ({
const nangoProvider = ccfg.connector.nangoProvider

const nangoPublicKey =
_trpcReact.getPublicEnv.useQuery().data?.NEXT_PUBLIC_NANGO_PUBLIC_KEY
_trpcReact.getPublicEnv.useQuery().data?.['NEXT_PUBLIC_NANGO_PUBLIC_KEY']
const nangoFrontend = React.useMemo(
() =>
nangoPublicKey &&
Expand Down
2 changes: 1 addition & 1 deletion packages/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"module": "./index.ts",
"scripts": {},
"dependencies": {
"@opensdks/util-zod": "0.0.15",
"@opensdks/util-zod": "0.0.16",
"@t3-oss/env-nextjs": "0.7.3"
},
"devDependencies": {}
Expand Down
Loading

0 comments on commit 3831513

Please sign in to comment.