plac-micro-common 1.3.39 → 1.3.41

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.
@@ -20,6 +20,7 @@ export interface CurrentAppClientInfo {
20
20
  client_id?: string;
21
21
  }
22
22
  export interface RequestContextData {
23
+ auth?: RequestAuthMeta;
23
24
  user?: CurrentUserInfo;
24
25
  app?: CurrentAppInfo;
25
26
  app_client?: CurrentAppClientInfo;
@@ -0,0 +1,5 @@
1
+ import { AddressType, ContactType, Gender, IdentifierType } from "../../types";
2
+ export declare function getGenderDesc(val: Gender): "Male" | "Female";
3
+ export declare function getIdentifierTypeDesc(val: IdentifierType): "National ID" | "Passport" | "Birth Certificate" | "Tax ID" | "Company Registration" | "Other";
4
+ export declare function getContactTypeDesc(val: ContactType): "Other" | "Phone Number" | "Email" | "Website" | "Social Media";
5
+ export declare function getAddressTypeDesc(val: AddressType): "Other" | "Home" | "Work" | "Billing";
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGenderDesc = getGenderDesc;
4
+ exports.getIdentifierTypeDesc = getIdentifierTypeDesc;
5
+ exports.getContactTypeDesc = getContactTypeDesc;
6
+ exports.getAddressTypeDesc = getAddressTypeDesc;
7
+ const types_1 = require("../../types");
8
+ function getGenderDesc(val) {
9
+ switch (val) {
10
+ case types_1.Gender.Male:
11
+ return "Male";
12
+ case types_1.Gender.Female:
13
+ return "Female";
14
+ default:
15
+ return val;
16
+ }
17
+ }
18
+ function getIdentifierTypeDesc(val) {
19
+ switch (val) {
20
+ case types_1.IdentifierType.NationalId:
21
+ return "National ID";
22
+ case types_1.IdentifierType.Passport:
23
+ return "Passport";
24
+ case types_1.IdentifierType.BirthCertificate:
25
+ return "Birth Certificate";
26
+ case types_1.IdentifierType.TaxId:
27
+ return "Tax ID";
28
+ case types_1.IdentifierType.CompanyRegistration:
29
+ return "Company Registration";
30
+ case types_1.IdentifierType.Other:
31
+ return "Other";
32
+ default:
33
+ return val;
34
+ }
35
+ }
36
+ function getContactTypeDesc(val) {
37
+ switch (val) {
38
+ case types_1.ContactType.Phone:
39
+ return "Phone Number";
40
+ case types_1.ContactType.Email:
41
+ return "Email";
42
+ case types_1.ContactType.Website:
43
+ return "Website";
44
+ case types_1.ContactType.Social:
45
+ return "Social Media";
46
+ case types_1.ContactType.Other:
47
+ return "Other";
48
+ default:
49
+ return val;
50
+ }
51
+ }
52
+ function getAddressTypeDesc(val) {
53
+ switch (val) {
54
+ case types_1.AddressType.Home:
55
+ return "Home";
56
+ case types_1.AddressType.Work:
57
+ return "Work";
58
+ case types_1.AddressType.Billing:
59
+ return "Billing";
60
+ case types_1.AddressType.Other:
61
+ return "Other";
62
+ default:
63
+ return val;
64
+ }
65
+ }
@@ -1,3 +1,4 @@
1
1
  import * as AppUtil from "./app.util";
2
+ import * as DataUtil from "./data.util";
2
3
  export * from "./app.util";
3
- export { AppUtil };
4
+ export { AppUtil, DataUtil };
@@ -36,7 +36,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.AppUtil = void 0;
39
+ exports.DataUtil = exports.AppUtil = void 0;
40
40
  const AppUtil = __importStar(require("./app.util"));
41
41
  exports.AppUtil = AppUtil;
42
+ const DataUtil = __importStar(require("./data.util"));
43
+ exports.DataUtil = DataUtil;
42
44
  __exportStar(require("./app.util"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plac-micro-common",
3
- "version": "1.3.39",
3
+ "version": "1.3.41",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {