@yangsaiyam/helper 1.12.6 → 1.13.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.cjs +68 -30
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +683 -17
- package/dist/index.js +741 -17
- package/package.json +1 -1
- package/{dist → src}/email-history/index.d.ts +4 -0
- package/{dist → src}/email-history/index.js +1 -0
- package/src/website/index.d.ts +7 -1
- package/src/website/index.js +6 -0
- package/src/website/index.ts +6 -0
- package/dist/addressess/index.d.ts +0 -137
- package/dist/addressess/index.js +0 -24
- package/dist/addressess/index.test.d.ts +0 -1
- package/dist/addressess/index.test.js +0 -16
- package/dist/assessment-question/index.d.ts +0 -19
- package/dist/assessment-question/index.js +0 -22
- package/dist/assessment-question/index.test.d.ts +0 -1
- package/dist/assessment-question/index.test.js +0 -27
- package/dist/career/index.d.ts +0 -132
- package/dist/career/index.js +0 -40
- package/dist/contact-form/index.d.ts +0 -13
- package/dist/contact-form/index.js +0 -13
- package/dist/email-template/index.d.ts +0 -13
- package/dist/email-template/index.js +0 -5
- package/dist/files/index.d.ts +0 -18
- package/dist/files/index.js +0 -8
- package/dist/job-applications/index.d.ts +0 -33
- package/dist/job-applications/index.js +0 -10
- package/dist/locale/index.d.ts +0 -9
- package/dist/locale/index.js +0 -4
- package/dist/roles/index.d.ts +0 -61
- package/dist/roles/index.js +0 -170
- package/dist/roles/index.test.d.ts +0 -1
- package/dist/roles/index.test.js +0 -80
- package/dist/routes/index.d.ts +0 -80
- package/dist/routes/index.js +0 -106
- package/dist/routes/index.test.d.ts +0 -1
- package/dist/routes/index.test.js +0 -92
- package/dist/shared/helpers.d.ts +0 -5
- package/dist/shared/helpers.js +0 -15
- package/dist/shared/types.d.ts +0 -5
- package/dist/shared/types.js +0 -1
- package/dist/time/index.d.ts +0 -73
- package/dist/time/index.js +0 -161
- package/dist/time/index.test.d.ts +0 -1
- package/dist/time/index.test.js +0 -35
- package/dist/track/index.d.ts +0 -17
- package/dist/track/index.js +0 -14
- package/dist/track/index.test.d.ts +0 -1
- package/dist/track/index.test.js +0 -7
- package/dist/tsconfig.json +0 -6
- package/dist/url-prefix/index.d.ts +0 -8
- package/dist/url-prefix/index.js +0 -9
- package/dist/website/index.d.ts +0 -16
- package/dist/website/index.js +0 -17
package/dist/index.cjs
CHANGED
|
@@ -58,7 +58,7 @@ __export(index_exports, {
|
|
|
58
58
|
TIMEZONE_CURRENT_UTC_OFFSET: () => TIMEZONE_CURRENT_UTC_OFFSET,
|
|
59
59
|
TIMEZONE_TO_UTC: () => TIMEZONE_TO_UTC,
|
|
60
60
|
URL_PREFIXES: () => URL_PREFIXES,
|
|
61
|
-
WEBSITES: () =>
|
|
61
|
+
WEBSITES: () => WEBSITES2,
|
|
62
62
|
Website: () => Website2,
|
|
63
63
|
buildLocalizedRoute: () => buildLocalizedRoute,
|
|
64
64
|
buildRoutePathName: () => buildRoutePathName,
|
|
@@ -80,7 +80,7 @@ __export(index_exports, {
|
|
|
80
80
|
});
|
|
81
81
|
module.exports = __toCommonJS(index_exports);
|
|
82
82
|
|
|
83
|
-
// src/assessment-question/index.
|
|
83
|
+
// src/assessment-question/index.ts
|
|
84
84
|
var QuestionType = {
|
|
85
85
|
Subjective: 1,
|
|
86
86
|
Objective: 2,
|
|
@@ -104,7 +104,7 @@ var ASSESSMENT_QUESTION_TYPE = [
|
|
|
104
104
|
}
|
|
105
105
|
];
|
|
106
106
|
|
|
107
|
-
// src/career/index.
|
|
107
|
+
// src/career/index.ts
|
|
108
108
|
var CAREER_JOB_TYPE = [
|
|
109
109
|
{ key: 1, value: "Full-time", i18nKey: "career.jobType.1" },
|
|
110
110
|
{ key: 2, value: "Part-time", i18nKey: "career.jobType.2" },
|
|
@@ -146,7 +146,7 @@ var CAREER_LOCATION = [
|
|
|
146
146
|
{ key: 15, value: "Labuan", i18nKey: "career.location.15" }
|
|
147
147
|
];
|
|
148
148
|
|
|
149
|
-
// src/contact-form/index.
|
|
149
|
+
// src/contact-form/index.ts
|
|
150
150
|
var CONTACT_FORM_ENQUIRY_TYPE = [
|
|
151
151
|
{
|
|
152
152
|
key: 1,
|
|
@@ -161,7 +161,7 @@ var CONTACT_FORM_ENQUIRY_TYPE = [
|
|
|
161
161
|
{ key: 3, value: "MCN Business", i18nKey: "contactForm.enquiryType.3" }
|
|
162
162
|
];
|
|
163
163
|
|
|
164
|
-
// src/files/index.
|
|
164
|
+
// src/files/index.ts
|
|
165
165
|
var FILE_STATUS = [
|
|
166
166
|
{ key: 1, value: "pending", i18nKey: "files.status.1" },
|
|
167
167
|
{ key: 2, value: "submitted", i18nKey: "files.status.2" }
|
|
@@ -171,13 +171,13 @@ var FILE_ORIGIN = [
|
|
|
171
171
|
{ key: 2, value: "submitted", i18nKey: "files.origin.2" }
|
|
172
172
|
];
|
|
173
173
|
|
|
174
|
-
// src/locale/index.
|
|
174
|
+
// src/locale/index.ts
|
|
175
175
|
var LOCALE = [
|
|
176
176
|
{ key: 1, value: "en", i18nKey: "locale.en" },
|
|
177
177
|
{ key: 2, value: "zh", i18nKey: "locale.zh" }
|
|
178
178
|
];
|
|
179
179
|
|
|
180
|
-
// src/roles/index.
|
|
180
|
+
// src/roles/index.ts
|
|
181
181
|
var ROLE_MAP = {
|
|
182
182
|
0: "super-admin",
|
|
183
183
|
1: "admin",
|
|
@@ -349,7 +349,7 @@ function permissionLabelKey(permission) {
|
|
|
349
349
|
return PERMISSION_I18N_KEY[permission];
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
// src/routes/index.
|
|
352
|
+
// src/routes/index.ts
|
|
353
353
|
var ROUTES = [
|
|
354
354
|
{
|
|
355
355
|
key: "home",
|
|
@@ -429,7 +429,9 @@ var ROUTES = [
|
|
|
429
429
|
i18nKey: "routes.servicesSoftwareDevelopment"
|
|
430
430
|
}
|
|
431
431
|
];
|
|
432
|
-
var ROUTE = Object.fromEntries(
|
|
432
|
+
var ROUTE = Object.fromEntries(
|
|
433
|
+
ROUTES.map((route) => [route.key, route.path])
|
|
434
|
+
);
|
|
433
435
|
function routeLabelKey(route) {
|
|
434
436
|
return ROUTES.find((item) => item.key === route)?.i18nKey ?? "routes.home";
|
|
435
437
|
}
|
|
@@ -457,7 +459,7 @@ function buildLocalizedRoute(route, locale, params = {}) {
|
|
|
457
459
|
return path;
|
|
458
460
|
}
|
|
459
461
|
|
|
460
|
-
// src/shared/helpers.
|
|
462
|
+
// src/shared/helpers.ts
|
|
461
463
|
function getOptionByKey(options, key) {
|
|
462
464
|
if (key === null || key === void 0) {
|
|
463
465
|
return void 0;
|
|
@@ -474,7 +476,7 @@ function toRecord(options) {
|
|
|
474
476
|
return Object.fromEntries(options.map((option) => [option.key, option.value]));
|
|
475
477
|
}
|
|
476
478
|
|
|
477
|
-
// src/time/index.
|
|
479
|
+
// src/time/index.ts
|
|
478
480
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
479
481
|
var import_timezone = __toESM(require("dayjs/plugin/timezone.js"), 1);
|
|
480
482
|
var import_utc = __toESM(require("dayjs/plugin/utc.js"), 1);
|
|
@@ -600,7 +602,9 @@ var TIMEZONE_ALIAS_TO_CANONICAL = {
|
|
|
600
602
|
"los_angeles": "America/Los_Angeles",
|
|
601
603
|
"los angeles": "America/Los_Angeles"
|
|
602
604
|
};
|
|
603
|
-
var TIMEZONE_I18N_KEY = Object.fromEntries(
|
|
605
|
+
var TIMEZONE_I18N_KEY = Object.fromEntries(
|
|
606
|
+
TIMEZONE.map(({ value, i18nKey }) => [value, i18nKey])
|
|
607
|
+
);
|
|
604
608
|
function toTimezoneAlias(timezone2) {
|
|
605
609
|
return timezone2.trim().toLowerCase().replace(/-/g, "_");
|
|
606
610
|
}
|
|
@@ -617,7 +621,9 @@ function timezoneToUtc(timezone2, timestamp = Date.now()) {
|
|
|
617
621
|
}
|
|
618
622
|
return `UTC${(0, import_dayjs.default)(timestamp).tz(normalizedTimezone).format("Z")}`;
|
|
619
623
|
}
|
|
620
|
-
var TIMEZONE_CURRENT_UTC_OFFSET = Object.fromEntries(
|
|
624
|
+
var TIMEZONE_CURRENT_UTC_OFFSET = Object.fromEntries(
|
|
625
|
+
TIMEZONE.map(({ value }) => [value, timezoneToUtc(value)])
|
|
626
|
+
);
|
|
621
627
|
var TIMEZONE_TO_UTC = TIMEZONE_CURRENT_UTC_OFFSET;
|
|
622
628
|
function timezoneLabelKey(timezone2) {
|
|
623
629
|
const normalizedTimezone = normalizeTimezone(timezone2);
|
|
@@ -637,7 +643,7 @@ function convertTimestampToTimezone(timestamp, sourceTimezone, targetTimezone) {
|
|
|
637
643
|
return import_dayjs.default.tz(preservedWallClock, normalizedTargetTimezone).valueOf();
|
|
638
644
|
}
|
|
639
645
|
|
|
640
|
-
// src/track/index.
|
|
646
|
+
// src/track/index.ts
|
|
641
647
|
var ORIGIN = [
|
|
642
648
|
{
|
|
643
649
|
key: 0,
|
|
@@ -653,36 +659,67 @@ var ORIGIN = [
|
|
|
653
659
|
{ key: 3, value: "Maukerja", i18nKey: "track.origin.3" }
|
|
654
660
|
];
|
|
655
661
|
|
|
656
|
-
// src/
|
|
662
|
+
// src/website/index.js
|
|
663
|
+
var Website;
|
|
664
|
+
(function(Website3) {
|
|
665
|
+
Website3[Website3["KORRE"] = 1] = "KORRE";
|
|
666
|
+
Website3[Website3["KORRE_LABS"] = 2] = "KORRE_LABS";
|
|
667
|
+
Website3[Website3["MCOM_MEDIA"] = 3] = "MCOM_MEDIA";
|
|
668
|
+
})(Website || (Website = {}));
|
|
669
|
+
var WEBSITES = {
|
|
670
|
+
[Website.KORRE]: {
|
|
671
|
+
id: Website.KORRE,
|
|
672
|
+
name: "Korre Evolution",
|
|
673
|
+
url: "https://public.korre.site/images/korre-evo.png"
|
|
674
|
+
},
|
|
675
|
+
[Website.KORRE_LABS]: {
|
|
676
|
+
id: Website.KORRE_LABS,
|
|
677
|
+
name: "Korre Labs",
|
|
678
|
+
url: "https://public.korre.site/images/korre-labs.png"
|
|
679
|
+
},
|
|
680
|
+
[Website.MCOM_MEDIA]: {
|
|
681
|
+
id: Website.MCOM_MEDIA,
|
|
682
|
+
name: "MCOM Media",
|
|
683
|
+
url: "https://public.korre.site/images/mcom-media.png"
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
// src/url-prefix/index.ts
|
|
657
688
|
var URL_PREFIXES = {
|
|
658
|
-
[
|
|
689
|
+
[Website.KORRE]: {
|
|
659
690
|
contact: "https://www.korre.site/contact",
|
|
660
691
|
careerDetail: "https://www.korre.site/career/[id]",
|
|
661
692
|
careerApply: "https://www.korre.site/career/[id]/apply"
|
|
662
693
|
},
|
|
663
|
-
[
|
|
694
|
+
[Website.KORRE_LABS]: {}
|
|
664
695
|
};
|
|
665
696
|
|
|
666
|
-
// src/website/index.
|
|
667
|
-
var Website2
|
|
668
|
-
(function(Website3) {
|
|
697
|
+
// src/website/index.ts
|
|
698
|
+
var Website2 = /* @__PURE__ */ ((Website3) => {
|
|
669
699
|
Website3[Website3["KORRE"] = 1] = "KORRE";
|
|
670
700
|
Website3[Website3["KORRE_LABS"] = 2] = "KORRE_LABS";
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
701
|
+
Website3[Website3["MCOM_MEDIA"] = 3] = "MCOM_MEDIA";
|
|
702
|
+
return Website3;
|
|
703
|
+
})(Website2 || {});
|
|
704
|
+
var WEBSITES2 = {
|
|
705
|
+
[1 /* KORRE */]: {
|
|
706
|
+
id: 1 /* KORRE */,
|
|
675
707
|
name: "Korre Evolution",
|
|
676
708
|
url: "https://public.korre.site/images/korre-evo.png"
|
|
677
709
|
},
|
|
678
|
-
[
|
|
679
|
-
id:
|
|
710
|
+
[2 /* KORRE_LABS */]: {
|
|
711
|
+
id: 2 /* KORRE_LABS */,
|
|
680
712
|
name: "Korre Labs",
|
|
681
713
|
url: "https://public.korre.site/images/korre-labs.png"
|
|
714
|
+
},
|
|
715
|
+
[3 /* MCOM_MEDIA */]: {
|
|
716
|
+
id: 3 /* MCOM_MEDIA */,
|
|
717
|
+
name: "MCOM Media",
|
|
718
|
+
url: "https://public.korre.site/images/mcom-media.png"
|
|
682
719
|
}
|
|
683
720
|
};
|
|
684
721
|
|
|
685
|
-
// src/addressess/index.
|
|
722
|
+
// src/addressess/index.ts
|
|
686
723
|
var COUNTRY_CODE = [
|
|
687
724
|
{ key: 1, value: "MY", i18nKey: "country.code.1" }
|
|
688
725
|
];
|
|
@@ -708,7 +745,7 @@ var STATES = {
|
|
|
708
745
|
};
|
|
709
746
|
var MALAYSIA_STATE = STATES.MY;
|
|
710
747
|
|
|
711
|
-
// src/job-applications/index.
|
|
748
|
+
// src/job-applications/index.ts
|
|
712
749
|
var JOB_APPLICATION_STATUS = [
|
|
713
750
|
{ key: 0, value: "Pending Review", i18nKey: "jobApplication.status.0" },
|
|
714
751
|
{ key: 1, value: "Shortlisted", i18nKey: "jobApplication.status.1" },
|
|
@@ -720,7 +757,7 @@ var JOB_APPLICATION_STATUS = [
|
|
|
720
757
|
{ key: 7, value: "Ghosted", i18nKey: "jobApplication.status.7" }
|
|
721
758
|
];
|
|
722
759
|
|
|
723
|
-
// src/email-template/index.
|
|
760
|
+
// src/email-template/index.ts
|
|
724
761
|
var EMAIL_TEMPLATE_ROLES = [
|
|
725
762
|
{ key: 0, value: "Creator", i18nKey: "emailTemplate.role.0" },
|
|
726
763
|
{ key: 1, value: "Editor", i18nKey: "emailTemplate.role.1" },
|
|
@@ -732,7 +769,8 @@ var EMAIL_HISTORY_STATUS = [
|
|
|
732
769
|
{ key: 0, value: "Scheduled", i18nKey: "emailHistory.status.0" },
|
|
733
770
|
{ key: 1, value: "Delivering", i18nKey: "emailHistory.status.1" },
|
|
734
771
|
{ key: 2, value: "Delivered", i18nKey: "emailHistory.status.2" },
|
|
735
|
-
{ key: 3, value: "Failed", i18nKey: "emailHistory.status.3" }
|
|
772
|
+
{ key: 3, value: "Failed", i18nKey: "emailHistory.status.3" },
|
|
773
|
+
{ key: 4, value: "Canceled", i18nKey: "emailHistory.status.4" }
|
|
736
774
|
];
|
|
737
775
|
// Annotate the CommonJS export names for ESM import in node:
|
|
738
776
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -451,7 +451,8 @@ declare const URL_PREFIXES: {
|
|
|
451
451
|
|
|
452
452
|
declare enum Website {
|
|
453
453
|
KORRE = 1,
|
|
454
|
-
KORRE_LABS = 2
|
|
454
|
+
KORRE_LABS = 2,
|
|
455
|
+
MCOM_MEDIA = 3
|
|
455
456
|
}
|
|
456
457
|
declare const WEBSITES: {
|
|
457
458
|
1: {
|
|
@@ -464,6 +465,11 @@ declare const WEBSITES: {
|
|
|
464
465
|
name: string;
|
|
465
466
|
url: string;
|
|
466
467
|
};
|
|
468
|
+
3: {
|
|
469
|
+
id: Website;
|
|
470
|
+
name: string;
|
|
471
|
+
url: string;
|
|
472
|
+
};
|
|
467
473
|
};
|
|
468
474
|
|
|
469
475
|
declare const COUNTRY_CODE: readonly [{
|
|
@@ -652,4 +658,26 @@ declare const EMAIL_TEMPLATE_ROLES: readonly [{
|
|
|
652
658
|
readonly i18nKey: "emailTemplate.role.2";
|
|
653
659
|
}];
|
|
654
660
|
|
|
655
|
-
|
|
661
|
+
declare const EMAIL_HISTORY_STATUS: readonly [{
|
|
662
|
+
readonly key: 0;
|
|
663
|
+
readonly value: "Scheduled";
|
|
664
|
+
readonly i18nKey: "emailHistory.status.0";
|
|
665
|
+
}, {
|
|
666
|
+
readonly key: 1;
|
|
667
|
+
readonly value: "Delivering";
|
|
668
|
+
readonly i18nKey: "emailHistory.status.1";
|
|
669
|
+
}, {
|
|
670
|
+
readonly key: 2;
|
|
671
|
+
readonly value: "Delivered";
|
|
672
|
+
readonly i18nKey: "emailHistory.status.2";
|
|
673
|
+
}, {
|
|
674
|
+
readonly key: 3;
|
|
675
|
+
readonly value: "Failed";
|
|
676
|
+
readonly i18nKey: "emailHistory.status.3";
|
|
677
|
+
}, {
|
|
678
|
+
readonly key: 4;
|
|
679
|
+
readonly value: "Canceled";
|
|
680
|
+
readonly i18nKey: "emailHistory.status.4";
|
|
681
|
+
}];
|
|
682
|
+
|
|
683
|
+
export { ASSESSMENT_QUESTION_TYPE, CAREER_CATEGORY, CAREER_JOB_TYPE, CAREER_LOCATION, CAREER_MODE, CONTACT_FORM_ENQUIRY_TYPE, COUNTRY_CODE, type CanonicalRole, type CanonicalTimezone, EMAIL_HISTORY_STATUS, EMAIL_TEMPLATE_ROLES, FILE_ORIGIN, FILE_STATUS, JOB_APPLICATION_STATUS, LOCALE, MALAYSIA_STATE, type MappingOption, ORIGIN, PERMISSION_I18N_KEY, Permission, QuestionType, ROLE, ROLE_MAP, ROLE_PERMISSIONS, ROUTE, ROUTES, type RoleInput, type RoleValue, type RouteKey, type RouteMapping, STATES, TIMEZONE, TIMEZONE_CURRENT_UTC_OFFSET, TIMEZONE_TO_UTC, type TimezoneInput, URL_PREFIXES, WEBSITES, Website, buildLocalizedRoute, buildRoutePathName, convertTimestampToTimezone, getI18nKeyByKey, getLabelByKey, getOptionByKey, hasPermission, normalizeRole, normalizeTimezone, permissionLabelKey, roleLabelKey, roleToId, routeLabelKey, routePathKey, timezoneLabelKey, timezoneToUtc, toRecord };
|