@onereach/types-contacts-api 5.18.6-beta.2830.0 → 5.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -316,4 +316,4 @@ export interface SharedBookContactPermissionParamsDto extends ReturnType<typeof
316
316
  export interface UpdateSharedBookContactPermissionDto extends CreateSharedBookContactPermissionDto {
317
317
  }
318
318
  export {};
319
- export const DB_ACTUAL_VERSION = '1';
319
+ export const DB_TARGET_VERSION = '1';
package/dist/cjs/index.js CHANGED
@@ -33,4 +33,4 @@ var SharedBookStatus;
33
33
  SharedBookStatus["deletedFromTarget"] = "deletedFromTarget";
34
34
  SharedBookStatus["deletedFromSource"] = "deletedFromSource";
35
35
  })(SharedBookStatus = exports.SharedBookStatus || (exports.SharedBookStatus = {}));
36
- exports.DB_ACTUAL_VERSION = '1';
36
+ exports.DB_TARGET_VERSION = '1';
@@ -1 +1 @@
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"}
1
+ {"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"}
@@ -316,4 +316,4 @@ export interface SharedBookContactPermissionParamsDto extends ReturnType<typeof
316
316
  export interface UpdateSharedBookContactPermissionDto extends CreateSharedBookContactPermissionDto {
317
317
  }
318
318
  export {};
319
- export const DB_ACTUAL_VERSION = '1';
319
+ export const DB_TARGET_VERSION = '1';
package/dist/esm/index.js CHANGED
@@ -30,4 +30,4 @@ export var SharedBookStatus;
30
30
  SharedBookStatus["deletedFromTarget"] = "deletedFromTarget";
31
31
  SharedBookStatus["deletedFromSource"] = "deletedFromSource";
32
32
  })(SharedBookStatus || (SharedBookStatus = {}));
33
- export var DB_ACTUAL_VERSION = '1';
33
+ export var DB_TARGET_VERSION = '1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@onereach/types-contacts-api",
3
3
  "description": "Generated types for Contacts Api",
4
- "version": "5.18.6-beta.2830.0",
4
+ "version": "5.19.0",
5
5
  "author": "OneReach.ai",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -24,5 +24,6 @@
24
24
  "rimraf": "5.0.1",
25
25
  "ts-morph": "17.0.1",
26
26
  "ts-node": "10.9.1"
27
- }
27
+ },
28
+ "gitHead": "267cc79e565378b4880248f61312a9291d398549"
28
29
  }
@@ -1,5 +1,14 @@
1
1
  /**
2
- * script should be launched from the contacts-mono project root
2
+ * Inserts DB_TARGET_VERSION = <packages/api/config/contacts_api.yaml.DB_VERSIONS.target>
3
+ * into types dist:
4
+ * - in both cjs and esm bundles
5
+ * - and into dist/db-versions.json
6
+ *
7
+ * Script is run as a part of pnpm build:types command,
8
+ * To run independently, execute the following command from the `contacts-mono` root:
9
+ * <code>
10
+ * pnpm types:db-versions
11
+ * </code>
3
12
  */
4
13
  import fs from 'fs';
5
14
  import yaml from 'js-yaml';
@@ -7,8 +16,8 @@ import yaml from 'js-yaml';
7
16
  const fileName = 'contacts_api.yaml';
8
17
  const pathToFile = 'packages/api/config';
9
18
  const dbVersionsPath = 'DB_VERSIONS';
10
- const actualDbKey = 'actual';
11
- const varName = 'DB_ACTUAL_VERSION';
19
+ const targetDbKey = 'target';
20
+ const varName = 'DB_TARGET_VERSION';
12
21
 
13
22
  const appendLineToFile = (file: string, line: string) => {
14
23
  const doc = fs.readFileSync(file, 'utf-8');
@@ -27,10 +36,10 @@ try {
27
36
  throw new Error(`${dbVersionsPath} property has not been found in ${fileName}`);
28
37
  }
29
38
 
30
- const actualDbVersion = doc[dbVersionsPath][actualDbKey];
31
- if (!actualDbKey) {
39
+ const actualDbVersion = doc[dbVersionsPath][targetDbKey];
40
+ if (!targetDbKey) {
32
41
  throw new Error(`${
33
- actualDbKey
42
+ targetDbKey
34
43
  } property has not been found in ${fileName} document, under the ${dbVersionsPath} path`);
35
44
  }
36
45