@samoa-house-lib/shl-types 1.0.0 → 1.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './types';
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@samoa-house-lib/shl-types",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Types and constants shared between the SHL project's repo's",
5
- "main": "src/index.ts",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
6
8
  "scripts": {
7
9
  "build": "tsc",
8
10
  "test": "npm run test"
@@ -18,7 +20,6 @@
18
20
  "ts-node": "^10.9.2"
19
21
  },
20
22
  "dependencies": {
21
- "pg": "^8.11.5",
22
23
  "zod": "3.23.8"
23
24
  }
24
25
  }
package/src/types.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as z from 'zod'
2
2
  import { SectionVariant, TextVariant, ConditionVariant, ColumnNames } from "./constants"
3
- import { QueryResult } from 'pg'
4
3
 
5
4
  const unionFromEnum = (enumerable: object): z.ZodUnion<NonEmptyStringArray> => {
6
5
  return z.union(
@@ -11,16 +10,6 @@ const unionFromEnum = (enumerable: object): z.ZodUnion<NonEmptyStringArray> => {
11
10
  )
12
11
  }
13
12
 
14
-
15
- export interface ServiceResponse {
16
- readBatch: () => Promise<QueryResult | void>,
17
- readBy: (column_name: ColumnName, column_value: string) => Promise<QueryResult | void>,
18
- readLatest: () => Promise<QueryResult | void>,
19
- writeItem: (data: CreateBookRequest) => Promise<QueryResult | void>,
20
- updateItem: (colName: ColumnName, colValue: string, id: ShlID) => Promise<QueryResult | void>,
21
- createTable : () => Promise<QueryResult | void>
22
- }
23
-
24
13
  export type Book = z.infer<typeof dbEntrySchema>
25
14
  export type BookBatch = z.infer<typeof bookBatchSchema>
26
15
 
package/tsconfig.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2016",
4
- "module": "commonjs",
3
+ "target": "ES2020",
4
+ "module": "ES2020",
5
+ "declaration": true,
5
6
  "esModuleInterop": true,
6
7
  "forceConsistentCasingInFileNames": true,
7
8
  "strict": true,
8
- "skipLibCheck": true
9
+ "skipLibCheck": true,
10
+ "moduleResolution": "Bundler",
11
+ "outDir": "./dist"
9
12
  }
10
13
  }