@konplit-services/common 1.0.200 → 1.0.202

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.
@@ -134,5 +134,38 @@ declare const schemaDefinition: (_key: string) => {
134
134
  };
135
135
  };
136
136
  };
137
+ "konplit_sample_test.cards": {
138
+ bsonType: string;
139
+ properties: {
140
+ expiryYear: {
141
+ encrypt: {
142
+ bsonType: string;
143
+ algorithm: string;
144
+ keyId: string[];
145
+ };
146
+ };
147
+ expiryMonth: {
148
+ encrypt: {
149
+ bsonType: string;
150
+ algorithm: string;
151
+ keyId: string[];
152
+ };
153
+ };
154
+ cardPan: {
155
+ encrypt: {
156
+ bsonType: string;
157
+ algorithm: string;
158
+ keyId: string[];
159
+ };
160
+ };
161
+ cardHolder: {
162
+ encrypt: {
163
+ bsonType: string;
164
+ algorithm: string;
165
+ keyId: string[];
166
+ };
167
+ };
168
+ };
169
+ };
137
170
  };
138
171
  export { schemaDefinition };
@@ -4,139 +4,172 @@ exports.schemaDefinition = void 0;
4
4
  const schemaDefinition = (_key) => {
5
5
  const schema = {
6
6
  "konplit.merchantbusinesses": {
7
- bsonType: 'object',
7
+ bsonType: "object",
8
8
  properties: {
9
9
  keys: {
10
- bsonType: 'object',
10
+ bsonType: "object",
11
11
  properties: {
12
12
  kpLivePrivate: {
13
13
  encrypt: {
14
- bsonType: 'string',
15
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
16
- keyId: [_key]
17
- }
14
+ bsonType: "string",
15
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
16
+ keyId: [_key],
17
+ },
18
18
  },
19
19
  kpTestPrivate: {
20
20
  encrypt: {
21
- bsonType: 'string',
22
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
23
- keyId: [_key]
24
- }
21
+ bsonType: "string",
22
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
23
+ keyId: [_key],
24
+ },
25
25
  },
26
26
  kpLiveEncryption: {
27
27
  encrypt: {
28
- bsonType: 'string',
29
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
30
- keyId: [_key]
31
- }
28
+ bsonType: "string",
29
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
30
+ keyId: [_key],
31
+ },
32
32
  },
33
33
  },
34
34
  },
35
- }
35
+ },
36
36
  },
37
37
  "konplit.merchantcustomers": {
38
- bsonType: 'object',
38
+ bsonType: "object",
39
39
  properties: {
40
40
  email: {
41
41
  encrypt: {
42
- bsonType: 'string',
43
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
44
- keyId: [_key]
45
- }
42
+ bsonType: "string",
43
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
44
+ keyId: [_key],
45
+ },
46
46
  },
47
47
  phone: {
48
48
  encrypt: {
49
- bsonType: 'string',
50
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
51
- keyId: [_key]
52
- }
49
+ bsonType: "string",
50
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
51
+ keyId: [_key],
52
+ },
53
53
  },
54
54
  publicKey: {
55
55
  encrypt: {
56
- bsonType: 'string',
57
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
58
- keyId: [_key]
59
- }
56
+ bsonType: "string",
57
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
58
+ keyId: [_key],
59
+ },
60
60
  },
61
- }
61
+ },
62
62
  },
63
63
  "konplit.blacklistedcards": {
64
- bsonType: 'object',
64
+ bsonType: "object",
65
65
  properties: {
66
66
  card_pan: {
67
67
  encrypt: {
68
- bsonType: 'string',
69
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
70
- keyId: [_key]
71
- }
68
+ bsonType: "string",
69
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
70
+ keyId: [_key],
71
+ },
72
72
  },
73
73
  card_expiry_date: {
74
74
  encrypt: {
75
- bsonType: 'string',
76
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
77
- keyId: [_key]
78
- }
75
+ bsonType: "string",
76
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
77
+ keyId: [_key],
78
+ },
79
79
  },
80
80
  card_holder_name: {
81
81
  encrypt: {
82
- bsonType: 'string',
83
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
84
- keyId: [_key]
85
- }
82
+ bsonType: "string",
83
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
84
+ keyId: [_key],
85
+ },
86
86
  },
87
- }
87
+ },
88
88
  },
89
89
  "konplit.subaccounts": {
90
- bsonType: 'object',
90
+ bsonType: "object",
91
91
  properties: {
92
92
  account_number: {
93
93
  encrypt: {
94
- bsonType: 'string',
95
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
96
- keyId: [_key]
97
- }
94
+ bsonType: "string",
95
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
96
+ keyId: [_key],
97
+ },
98
98
  },
99
- }
99
+ },
100
100
  },
101
101
  "konplit.cards": {
102
- bsonType: 'object',
102
+ bsonType: "object",
103
103
  properties: {
104
104
  expiry_year: {
105
105
  encrypt: {
106
- bsonType: 'string',
107
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
108
- keyId: [_key]
109
- }
106
+ bsonType: "string",
107
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
108
+ keyId: [_key],
109
+ },
110
110
  },
111
111
  expiry_month: {
112
112
  encrypt: {
113
- bsonType: 'string',
114
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
115
- keyId: [_key]
116
- }
113
+ bsonType: "string",
114
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
115
+ keyId: [_key],
116
+ },
117
117
  },
118
118
  card_pan: {
119
119
  encrypt: {
120
- bsonType: 'string',
121
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
122
- keyId: [_key]
123
- }
120
+ bsonType: "string",
121
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
122
+ keyId: [_key],
123
+ },
124
124
  },
125
125
  card_holder: {
126
126
  encrypt: {
127
- bsonType: 'string',
128
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
129
- keyId: [_key]
130
- }
127
+ bsonType: "string",
128
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
129
+ keyId: [_key],
130
+ },
131
131
  },
132
132
  token_expir_date: {
133
133
  encrypt: {
134
- bsonType: 'string',
135
- algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic',
136
- keyId: [_key]
137
- }
138
- }
139
- }
134
+ bsonType: "string",
135
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
136
+ keyId: [_key],
137
+ },
138
+ },
139
+ },
140
+ },
141
+ "konplit_sample_test.cards": {
142
+ bsonType: "object",
143
+ properties: {
144
+ expiryYear: {
145
+ encrypt: {
146
+ bsonType: "string",
147
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
148
+ keyId: [_key],
149
+ },
150
+ },
151
+ expiryMonth: {
152
+ encrypt: {
153
+ bsonType: "string",
154
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
155
+ keyId: [_key],
156
+ },
157
+ },
158
+ cardPan: {
159
+ encrypt: {
160
+ bsonType: "string",
161
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
162
+ keyId: [_key],
163
+ },
164
+ },
165
+ cardHolder: {
166
+ encrypt: {
167
+ bsonType: "string",
168
+ algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
169
+ keyId: [_key],
170
+ },
171
+ },
172
+ },
140
173
  },
141
174
  };
142
175
  return schema;
@@ -161,6 +161,8 @@ declare class AppConfigs {
161
161
  secretKey: string;
162
162
  masterKey: string;
163
163
  keyID: string;
164
+ rotateKey: string;
165
+ region: string;
164
166
  };
165
167
  getValuePayDetails(): {
166
168
  visa_redirect_url: string;
@@ -359,10 +359,18 @@ class AppConfigs {
359
359
  if (!this.env.AWS_KEYID) {
360
360
  throw new Error("AWS_KEYID is required");
361
361
  }
362
+ if (!this.env.AWS_REGION) {
363
+ throw new Error("AWS_REGION is required");
364
+ }
365
+ if (!this.env.AWS_ROTATE_KEY) {
366
+ throw new Error("AWS_ROTATE_KEY is required");
367
+ }
362
368
  return {
363
369
  accessKey: this.env.AWS_ACCESSKEY,
364
370
  secretKey: this.env.AWS_SECRETKEY,
365
371
  masterKey: this.env.AWS_MASTERKEY,
372
+ region: this.env.AWS_REGION,
373
+ rotateKey: this.env.AWS_ROTATE_KEY,
366
374
  keyID: this.env.AWS_KEYID,
367
375
  };
368
376
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konplit-services/common",
3
- "version": "1.0.200",
3
+ "version": "1.0.202",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",