@onereach/types-contacts-api
Advanced tools
Comparing version 5.18.6-beta.2830.0 to 5.18.6-beta.2831.0
@@ -319,2 +319,2 @@ declare function OmitType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Omit<T, typeof keys[number]>; | ||
export {}; | ||
export const DB_ACTUAL_VERSION = '1'; | ||
export const DB_TARGET_VERSION = '1'; |
@@ -36,2 +36,2 @@ "use strict"; | ||
})(SharedBookStatus = exports.SharedBookStatus || (exports.SharedBookStatus = {})); | ||
exports.DB_ACTUAL_VERSION = '1'; | ||
exports.DB_TARGET_VERSION = '1'; |
@@ -1,1 +0,1 @@ | ||
{"actual":"1","description":"While upgrading the actual db version value add `previous` key to DB_VERSIONS, as an array of objects describing \"previous\" version. Example: DB_VERSIONS:\n actual : '3'\n previous:\n - dbVersion : '2'\n contactsVersion : '5.16.1'\n - dbVersion : '1'\n contactsVersion : '5.0.0'\n"} | ||
{"target":"1","description":"While upgrading the target db version value add `previous` key to DB_VERSIONS, as an array of objects describing \"previous\" version. Example: DB_VERSIONS:\n target : '1'\n previous:\n - dbVersion : '2'\n contactsVersion : '5.16.1'\n - dbVersion : '1'\n contactsVersion : '5.0.0'\n"} |
@@ -319,2 +319,2 @@ declare function OmitType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Omit<T, typeof keys[number]>; | ||
export {}; | ||
export const DB_ACTUAL_VERSION = '1'; | ||
export const DB_TARGET_VERSION = '1'; |
@@ -33,2 +33,2 @@ export var BatchProcessStatus; | ||
})(SharedBookStatus || (SharedBookStatus = {})); | ||
export var DB_ACTUAL_VERSION = '1'; | ||
export var DB_TARGET_VERSION = '1'; |
{ | ||
"name": "@onereach/types-contacts-api", | ||
"description": "Generated types for Contacts Api", | ||
"version": "5.18.6-beta.2830.0", | ||
"version": "5.18.6-beta.2831.0", | ||
"author": "OneReach.ai", | ||
@@ -6,0 +6,0 @@ "main": "dist/cjs/index.js", |
/** | ||
* script should be launched from the contacts-mono project root | ||
* Inserts DB_TARGET_VERSION = <packages/api/config/contacts_api.yaml.DB_VERSIONS.target> | ||
* into types dist: | ||
* - in both cjs and esm bundles | ||
* - and into dist/db-versions.json | ||
* | ||
* Script is run as a part of pnpm build:types command, | ||
* To run independently, execute the following command from the `contacts-mono` root: | ||
* <code> | ||
* pnpm types:db-versions | ||
* </code> | ||
*/ | ||
@@ -10,4 +19,4 @@ import fs from 'fs'; | ||
const dbVersionsPath = 'DB_VERSIONS'; | ||
const actualDbKey = 'actual'; | ||
const varName = 'DB_ACTUAL_VERSION'; | ||
const targetDbKey = 'target'; | ||
const varName = 'DB_TARGET_VERSION'; | ||
@@ -31,6 +40,6 @@ const appendLineToFile = (file: string, line: string) => { | ||
const actualDbVersion = doc[dbVersionsPath][actualDbKey]; | ||
if (!actualDbKey) { | ||
const actualDbVersion = doc[dbVersionsPath][targetDbKey]; | ||
if (!targetDbKey) { | ||
throw new Error(`${ | ||
actualDbKey | ||
targetDbKey | ||
} property has not been found in ${fileName} document, under the ${dbVersionsPath} path`); | ||
@@ -37,0 +46,0 @@ } |
33926
987