Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: Remove vdk2 and replace vdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Apr 19, 2024
1 parent 192747b commit 8fae867
Show file tree
Hide file tree
Showing 48 changed files with 148 additions and 184 deletions.
File renamed without changes.
File renamed without changes.
53 changes: 48 additions & 5 deletions kits/vdk/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
// // codegen:start {preset: barrel, include: "./{*.{ts,tsx},*/index.{ts,tsx}}", exclude: "./**/*.{d,spec,test,fixture,gen,node}.{ts,tsx}"}
// export * from './new-mapper'
// // codegen:end
import type {
HttpMethod,
JSONLike,
PathsWithMethod,
SuccessResponse,
} from 'openapi-typescript-helpers'

// export * from '@openint/zod'
export * from '@openint/vdk2'
export * from './mapper'
export * from './pagination'
export * from './provider'
export * from './trpc'
export * from './type-utils/PathsOf'
export * from './type-utils/StrictObj'

export * from '@opensdks/fetch-links'
export * from '@opensdks/util-zod'

export type {
OperationRequestBodyContent,
PathsWithMethod,
} from 'openapi-typescript-helpers'

export type ResponseFrom<
Paths extends {},
M extends HttpMethod,
P extends PathsWithMethod<Paths, M>,
> = JSONLike<
SuccessResponse<
M extends keyof Paths[P]
? 'responses' extends keyof Paths[P][M]
? Paths[P][M]['responses']
: never
: never
>
>

export * from './errors'

// re-exporting utiltities

export {mapKeys, mapValues, pick, uniq, uniqBy} from 'remeda'

// TODO: Remove me
export {
RouterMap,
VerticalRouterOpts,
proxyCallRemote,
proxyListRemoteRedux,
} from './deprecated'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 14 additions & 4 deletions kits/vdk/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{
"name": "@openint/vdk",
"description": "Vertical Development Kit",
"description": "Unified API Vertical Development Kit",
"dependencies": {
"@openint/types": "workspace:*",
"@openint/vdk2": "workspace:*",
"@openint/zod": "workspace:*",
"@jsonurl/jsonurl": "^1.1.7",
"@openint/env": "workspace:*",
"@opensdks/fetch-links": "0.0.18",
"@opensdks/sdk-nango": "0.0.4",
"@opensdks/sdk-supaglue": "0.0.3",
"@opensdks/util-zod": "0.0.15",
"@trpc/server": "10.40.0",
"remeda": "1.6.1"
},
"devDependencies": {
"@lilyrose2798/trpc-openapi": "1.3.10",
"@opensdks/runtime": "0.0.19",
"@opensdks/sdk-apollo": "0.0.21",
"@opensdks/sdk-outreach": "0.0.16",
"openapi-typescript-helpers": "^0.0.6"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion new-pattern/api/appRouter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// not sure about directly depending on vdk from api, but anyways
import {mgmtRouter} from '@openint/mgmt'
import {trpc} from '@openint/vdk2'
import {trpc} from '@openint/vdk'
import {crmRouter} from '@openint/vertical-crm'
import {salesEngagementRouter} from '@openint/vertical-sales-engagement2'

Expand Down
2 changes: 1 addition & 1 deletion new-pattern/api/createContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {RouterContext} from '@openint/vdk2'
import type {RouterContext} from '@openint/vdk'
import {
hubspotProvider,
msDynamics365SalesProvider,
Expand Down
4 changes: 2 additions & 2 deletions new-pattern/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createOpenApiFetchHandler} from '@lilyrose2798/trpc-openapi'
import {env} from '@openint/env'
import {isHttpError} from '@openint/vdk2'
import {isHttpError} from '@openint/vdk'
import {appRouter} from './appRouter'
import {createContext} from './createContext'

Expand Down Expand Up @@ -58,4 +58,4 @@ export function createAppHandler({
})
}

export {zByosHeaders, type ByosHeaders} from '@openint/vdk2'
export {zByosHeaders, type ByosHeaders} from '@openint/vdk'
2 changes: 1 addition & 1 deletion new-pattern/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@openint/events": "workspace:*",
"@openint/mgmt": "workspace:*",
"@openint/env": "workspace:*",
"@openint/vdk2": "workspace:*",
"@openint/vdk": "workspace:*",
"@openint/vertical-crm": "workspace:*",
"@openint/vertical-sales-engagement2": "workspace:*",
"remeda": "1.6.1"
Expand Down
2 changes: 1 addition & 1 deletion new-pattern/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@openint/vdk2": "workspace:*",
"@openint/vdk": "workspace:*",
"drizzle-kit": "^0.20.12",
"prettier": "3.1.0",
"prettier-plugin-sql": "0.16.0"
Expand Down
2 changes: 1 addition & 1 deletion new-pattern/db/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {env} from '@openint/env'
import type {ErrorType} from '@openint/vdk2'
import type {ErrorType} from '@openint/vdk'
import {sql} from 'drizzle-orm'
import {
customType,
Expand Down
2 changes: 1 addition & 1 deletion new-pattern/mgmt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@openint/db": "workspace:*",
"@openint/env": "workspace:*",
"@openint/events": "workspace:*",
"@openint/vdk2": "workspace:*",
"@openint/vdk": "workspace:*",
"cookie": "^0.6.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions new-pattern/mgmt/providers/nango-auth.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {envRequired} from '@openint/env'
import {inngest} from '@openint/events'
import {z} from '@openint/vdk2'
import {z} from '@openint/vdk'
import {
fromNangoConnectionId,
fromNangoProviderConfigKey,
toNangoConnectionId,
toNangoProviderConfigKey,
} from '@openint/vdk2/nangoProxyLink'
} from '@openint/vdk/nangoProxyLink'
import cookie from 'cookie'

const zOauthInitParams = z.object({
Expand Down
6 changes: 3 additions & 3 deletions new-pattern/mgmt/providers/nango-postgres-provider.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {db as _db, dbUpsert, eq, schema, sql} from '@openint/db'
import type {PathsWithMethod, ResponseFrom} from '@openint/vdk2'
import {NotAuthenticatedError, NotFoundError} from '@openint/vdk2'
import type {PathsWithMethod, ResponseFrom} from '@openint/vdk'
import {NotAuthenticatedError, NotFoundError} from '@openint/vdk'
import {
fromNangoConnectionId,
toNangoConnectionId,
toNangoProviderConfigKey,
} from '@openint/vdk2/nangoProxyLink'
} from '@openint/vdk/nangoProxyLink'
import type {NangoSDK, NangoSDKTypes} from '@opensdks/sdk-nango'
import {initNangoSDK} from '@opensdks/sdk-nango'
import type {unified} from '../router'
Expand Down
4 changes: 2 additions & 2 deletions new-pattern/mgmt/router.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {and, db, eq, schema} from '@openint/db'
import type {_Provider, ProviderFromRouter} from '@openint/vdk2'
import {NotImplementedError, publicProcedure, trpc, z} from '@openint/vdk2'
import type {_Provider, ProviderFromRouter} from '@openint/vdk'
import {NotImplementedError, publicProcedure, trpc, z} from '@openint/vdk'
import {nangoPostgresProvider} from './providers/nango-postgres-provider'
import {supaglueProvider} from './providers/supaglue-provider'
import * as unified from './unifiedModels'
Expand Down
2 changes: 1 addition & 1 deletion new-pattern/mgmt/unifiedModels.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {z} from '@openint/vdk2'
import {z} from '@openint/vdk'

/** workaround the issue that we get back date from db... need to figure out how to just get string */
// const zTimestamp = z
Expand Down
49 changes: 0 additions & 49 deletions new-pattern/vdk2/index.ts

This file was deleted.

21 changes: 0 additions & 21 deletions new-pattern/vdk2/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion new-pattern/worker/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import {env} from '@openint/env'
import type {Events} from '@openint/events'
import {initByosSDK} from '@openint/sdk2'
import {HTTPError, parseErrorInfo} from '../vdk2/errors'
import {HTTPError, parseErrorInfo} from '../../kits/vdk/errors'

/**
* Unlike functions, routines are designed to run without dependency on Inngest
Expand Down
Loading

0 comments on commit 8fae867

Please sign in to comment.