Skip to content

Commit

Permalink
Add new schema exported types
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Feb 15, 2024
1 parent f2ca95c commit 7633d85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/generatedTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as v0_1_0 from './v0.1.0'
import * as v0_10_0 from './v0.10.0'
import * as v0_11_0 from './v0.11.0'
import * as v0_12_0 from './v0.12.0'
import * as v0_2_0 from './v0.2.0'
import * as v0_3_0 from './v0.3.0'
import * as v0_4_0 from './v0.4.0'
Expand All @@ -12,19 +13,21 @@ import * as v0_7_0 from './v0.7.0'
import * as v0_8_0 from './v0.8.0'
import * as v0_9_0 from './v0.9.0'

export * as latest from './v0.11.0'
export * as latest from './v0.12.0'

export const LATEST_APP_DATA_VERSION = '0.11.0'
export const LATEST_APP_DATA_VERSION = '0.12.0'
export const LATEST_QUOTE_METADATA_VERSION = '0.3.0'
export const LATEST_REFERRER_METADATA_VERSION = '0.2.0'
export const LATEST_ORDER_CLASS_METADATA_VERSION = '0.3.0'
export const LATEST_UTM_METADATA_VERSION = '0.2.0'
export const LATEST_HOOKS_METADATA_VERSION = '0.1.0'
export const LATEST_SIGNER_METADATA_VERSION = '0.1.0'
export const LATEST_WIDGET_METADATA_VERSION = '0.1.0'
export const LATEST_PARTNER_FEE_METADATA_VERSION = '0.1.0'

export type LatestAppDataDocVersion = v0_11_0.AppDataRootSchema
export type LatestAppDataDocVersion = v0_12_0.AppDataRootSchema
export type AnyAppDataDocVersion =
| v0_12_0.AppDataRootSchema
| v0_11_0.AppDataRootSchema
| v0_10_0.AppDataRootSchema
| v0_9_0.AppDataRootSchema
Expand All @@ -38,6 +41,7 @@ export type AnyAppDataDocVersion =
| v0_1_0.AppDataRootSchema

export {
v0_12_0,
v0_11_0,
v0_10_0,
v0_9_0,
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const LATEST_UTM_METADATA_VERSION = '${extractSemver(latestUtmVersion)}'
export const LATEST_HOOKS_METADATA_VERSION = '${extractSemver(latestHooksVersion)}'
export const LATEST_SIGNER_METADATA_VERSION = '${extractSemver(latestSignerVersion)}'
export const LATEST_WIDGET_METADATA_VERSION = '${extractSemver(latestWidgetVersion)}'
export const LATEST_PARTNER_FEE_METADATA_VERSION = '${extractSemver(latestWidgetVersion)}'
export type LatestAppDataDocVersion = ${latestExport}.AppDataRootSchema
export type AnyAppDataDocVersion = ${allVersions}
Expand All @@ -100,7 +101,7 @@ function extractSemver(name: string): string {
}

async function getLatestMetadataDocVersion(
metadataDocName: 'quote' | 'referrer' | 'orderClass' | 'utm' | 'hooks' | 'signer' | 'widget'
metadataDocName: 'quote' | 'referrer' | 'orderClass' | 'utm' | 'hooks' | 'signer' | 'widget' | 'partnerFee'
): Promise<string> {
const metadataPath = path.join(SCHEMAS_SRC_PATH, metadataDocName)
const versions = await fs.promises.readdir(metadataPath)
Expand Down

0 comments on commit 7633d85

Please sign in to comment.