@stashfin/mysql2 1.4.2 → 1.4.4

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/models/Offer.d.ts CHANGED
@@ -7,8 +7,14 @@ interface Rule {
7
7
  interface Rules {
8
8
  data: Rule[];
9
9
  }
10
+ interface MetaData {
11
+ icon: string;
12
+ title: string;
13
+ eligibilityCriteria: string;
14
+ steps: string[];
15
+ }
10
16
  export interface OfferTable {
11
- id: bigint;
17
+ id: number;
12
18
  title: string;
13
19
  reward_type: string;
14
20
  amount: number;
@@ -27,11 +33,13 @@ export interface OfferTable {
27
33
  is_active: boolean;
28
34
  deleted: boolean;
29
35
  csv_segment: number;
30
- expiry: string;
36
+ sc_expiry: Date;
37
+ expiry: Date;
31
38
  rules: Rules;
39
+ metaData: MetaData;
32
40
  stats: string;
33
- created_at: string;
34
- updated_at: string;
41
+ created_at: Date;
42
+ updated_at: Date;
35
43
  created_by: string;
36
44
  }
37
45
  export interface OfferModel extends OfferTable, RowDataPacket {
@@ -2,29 +2,32 @@ import { RowDataPacket } from 'mysql2';
2
2
  export interface StashCashTable {
3
3
  id?: number;
4
4
  customer_id: number;
5
+ /** Defaults to: 0 */
5
6
  locked: number;
6
7
  unlocked: number;
7
- created_at: Date;
8
- updated_at: Date;
9
- is_active: boolean;
10
- is_deleted: boolean;
8
+ /** Defaults to: CURRENT_TIMESTAMP. */
9
+ created_at?: Date | null;
10
+ updated_at?: Date | null;
11
+ is_active?: string | 'Y';
12
+ is_deleted?: string | 'N';
11
13
  }
12
14
  export interface StashCashTrascationTable {
13
15
  id?: number;
14
- customer_id: number;
15
- campaign_id: number;
16
+ customer_id?: number;
17
+ campaign_id?: number;
16
18
  txn_id: number;
17
19
  sc_type: string;
18
- amount: number;
19
- balance: number;
20
+ amount?: number;
20
21
  remaining: number;
21
- txn_type: string;
22
- status: string;
23
- expiry: Date;
24
- created_at: Date;
25
- updated_at: Date;
26
- is_active: boolean;
27
- is_deleted: boolean;
22
+ txn_type: 'debit' | 'credit' | 'expired' | 'reversal';
23
+ /** Defaults to: active. */
24
+ status?: 'active' | 'inactive';
25
+ expiry?: Date | null;
26
+ /** Defaults to: CURRENT_TIMESTAMP. */
27
+ created_at?: Date | null;
28
+ updated_at?: Date | null;
29
+ is_active?: string | 'Y';
30
+ is_deleted?: string | 'N';
28
31
  }
29
32
  export interface StashCashModel extends StashCashTable, RowDataPacket {
30
33
  }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@stashfin/mysql2",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc --build",
9
+ "build:ws": "tsc --build && copy package.json dist/",
9
10
  "postbuild": "cp package.json dist/ ",
10
11
  "publish:patch": "npm version patch && npm run build && cd dist && npm publish --access public",
11
12
  "publish:minor": "npm version minor && npm run build && cd dist && npm publish --access public"
@@ -15,5 +16,8 @@
15
16
  "license": "ISC",
16
17
  "dependencies": {
17
18
  "mysql2": "^3.9.9"
19
+ },
20
+ "devDependencies": {
21
+ "cpy-cli": "^5.0.0"
18
22
  }
19
23
  }