plac-micro-common 1.2.84 → 1.3.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.
@@ -2,3 +2,4 @@ export * from "../components";
2
2
  export * from "../types";
3
3
  export * from "../utils/frontend";
4
4
  export * from "../constants";
5
+ export * from "../libs/frontend";
@@ -18,3 +18,4 @@ __exportStar(require("../components"), exports);
18
18
  __exportStar(require("../types"), exports);
19
19
  __exportStar(require("../utils/frontend"), exports);
20
20
  __exportStar(require("../constants"), exports);
21
+ __exportStar(require("../libs/frontend"), exports);
@@ -0,0 +1 @@
1
+ export * from "./pdf-form.lib";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./pdf-form.lib"), exports);
@@ -0,0 +1,2 @@
1
+ import { ISIOFormData } from "../../types";
2
+ export declare function generateFormSIO(data: ISIOFormData, lang: "en" | "km"): Promise<string>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateFormSIO = generateFormSIO;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const ejs = __importStar(require("ejs"));
40
+ async function generateFormSIO(data, lang) {
41
+ const template_path = lang === "en"
42
+ ? path.join(__dirname, "templates", "sio-form-en.ejs")
43
+ : path.join(__dirname, "templates", "sio-form-kh.ejs");
44
+ const font_path = path.join(__dirname, "fonts", "KhmerOS.ttf");
45
+ const template = fs.readFileSync(template_path, "utf8");
46
+ const view_data = {
47
+ ...data,
48
+ font_url: `file://${font_path}`,
49
+ };
50
+ return ejs.render(template, view_data);
51
+ }
@@ -0,0 +1,11 @@
1
+ export interface ICoverNoteFormData {
2
+ cover_note_no: string;
3
+ application_no: string;
4
+ ph_full_name: string;
5
+ la_full_name: string;
6
+ initial_premium_amount: string;
7
+ commencement_date: string;
8
+ authorized_officer_name: string;
9
+ date_of_issue: string;
10
+ covered_amount?: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,3 @@
1
+ export * from "./cover-note-form.type";
2
+ export * from "./official-receipt-form.type";
1
3
  export * from "./sio-pdf-form.type";
@@ -14,4 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./cover-note-form.type"), exports);
18
+ __exportStar(require("./official-receipt-form.type"), exports);
17
19
  __exportStar(require("./sio-pdf-form.type"), exports);
@@ -0,0 +1,2 @@
1
+ export interface IOfficialReceiptFormData {
2
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -73,7 +73,7 @@ export interface ISIOFormData {
73
73
  applicant_info: ISIOApplicantInfo;
74
74
  fatca_info: ISIOFatcaInfo;
75
75
  product_payment_info: ISIOProductPaymentInfo;
76
- beneficiary_info: ISIOBeneficiaryInfo;
76
+ beneficiary_info: ISIOBeneficiaryInfo[];
77
77
  health_info: ISIOHealthInfo;
78
78
  signature_info: ISIOSignatureInfo;
79
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.2.84",
3
+ "version": "1.3.0",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -16,12 +16,14 @@
16
16
  "license": "ISC",
17
17
  "description": "",
18
18
  "devDependencies": {
19
+ "@types/ejs": "^3.1.5",
19
20
  "ts-node": "^10.9.2",
20
21
  "typescript": "^5.9.3"
21
22
  },
22
23
  "dependencies": {
23
24
  "class-transformer": "^0.5.1",
24
25
  "class-validator": "^0.14.2",
26
+ "ejs": "^5.0.1",
25
27
  "rxjs": "^7.8.2"
26
28
  },
27
29
  "peerDependencies": {