@yangsaiyam/helper 1.12.5 → 1.12.7
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 +56 -30
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +677 -17
- package/dist/index.js +729 -17
- package/package.json +1 -1
- package/src/index.d.ts +2 -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-history/index.d.ts +0 -17
- package/dist/email-history/index.js +0 -6
- 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,55 @@ 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
|
+
})(Website || (Website = {}));
|
|
668
|
+
var WEBSITES = {
|
|
669
|
+
[Website.KORRE]: {
|
|
670
|
+
id: Website.KORRE,
|
|
671
|
+
name: "Korre Evolution",
|
|
672
|
+
url: "https://public.korre.site/images/korre-evo.png"
|
|
673
|
+
},
|
|
674
|
+
[Website.KORRE_LABS]: {
|
|
675
|
+
id: Website.KORRE_LABS,
|
|
676
|
+
name: "Korre Labs",
|
|
677
|
+
url: "https://public.korre.site/images/korre-labs.png"
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
// src/url-prefix/index.ts
|
|
657
682
|
var URL_PREFIXES = {
|
|
658
|
-
[
|
|
683
|
+
[Website.KORRE]: {
|
|
659
684
|
contact: "https://www.korre.site/contact",
|
|
660
685
|
careerDetail: "https://www.korre.site/career/[id]",
|
|
661
686
|
careerApply: "https://www.korre.site/career/[id]/apply"
|
|
662
687
|
},
|
|
663
|
-
[
|
|
688
|
+
[Website.KORRE_LABS]: {}
|
|
664
689
|
};
|
|
665
690
|
|
|
666
|
-
// src/website/index.
|
|
667
|
-
var Website2
|
|
668
|
-
(function(Website3) {
|
|
691
|
+
// src/website/index.ts
|
|
692
|
+
var Website2 = /* @__PURE__ */ ((Website3) => {
|
|
669
693
|
Website3[Website3["KORRE"] = 1] = "KORRE";
|
|
670
694
|
Website3[Website3["KORRE_LABS"] = 2] = "KORRE_LABS";
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
695
|
+
return Website3;
|
|
696
|
+
})(Website2 || {});
|
|
697
|
+
var WEBSITES2 = {
|
|
698
|
+
[1 /* KORRE */]: {
|
|
699
|
+
id: 1 /* KORRE */,
|
|
675
700
|
name: "Korre Evolution",
|
|
676
701
|
url: "https://public.korre.site/images/korre-evo.png"
|
|
677
702
|
},
|
|
678
|
-
[
|
|
679
|
-
id:
|
|
703
|
+
[2 /* KORRE_LABS */]: {
|
|
704
|
+
id: 2 /* KORRE_LABS */,
|
|
680
705
|
name: "Korre Labs",
|
|
681
706
|
url: "https://public.korre.site/images/korre-labs.png"
|
|
682
707
|
}
|
|
683
708
|
};
|
|
684
709
|
|
|
685
|
-
// src/addressess/index.
|
|
710
|
+
// src/addressess/index.ts
|
|
686
711
|
var COUNTRY_CODE = [
|
|
687
712
|
{ key: 1, value: "MY", i18nKey: "country.code.1" }
|
|
688
713
|
];
|
|
@@ -708,7 +733,7 @@ var STATES = {
|
|
|
708
733
|
};
|
|
709
734
|
var MALAYSIA_STATE = STATES.MY;
|
|
710
735
|
|
|
711
|
-
// src/job-applications/index.
|
|
736
|
+
// src/job-applications/index.ts
|
|
712
737
|
var JOB_APPLICATION_STATUS = [
|
|
713
738
|
{ key: 0, value: "Pending Review", i18nKey: "jobApplication.status.0" },
|
|
714
739
|
{ key: 1, value: "Shortlisted", i18nKey: "jobApplication.status.1" },
|
|
@@ -720,7 +745,7 @@ var JOB_APPLICATION_STATUS = [
|
|
|
720
745
|
{ key: 7, value: "Ghosted", i18nKey: "jobApplication.status.7" }
|
|
721
746
|
];
|
|
722
747
|
|
|
723
|
-
// src/email-template/index.
|
|
748
|
+
// src/email-template/index.ts
|
|
724
749
|
var EMAIL_TEMPLATE_ROLES = [
|
|
725
750
|
{ key: 0, value: "Creator", i18nKey: "emailTemplate.role.0" },
|
|
726
751
|
{ key: 1, value: "Editor", i18nKey: "emailTemplate.role.1" },
|
|
@@ -732,7 +757,8 @@ var EMAIL_HISTORY_STATUS = [
|
|
|
732
757
|
{ key: 0, value: "Scheduled", i18nKey: "emailHistory.status.0" },
|
|
733
758
|
{ key: 1, value: "Delivering", i18nKey: "emailHistory.status.1" },
|
|
734
759
|
{ key: 2, value: "Delivered", i18nKey: "emailHistory.status.2" },
|
|
735
|
-
{ key: 3, value: "Failed", i18nKey: "emailHistory.status.3" }
|
|
760
|
+
{ key: 3, value: "Failed", i18nKey: "emailHistory.status.3" },
|
|
761
|
+
{ key: 4, value: "Canceled", i18nKey: "emailHistory.status.4" }
|
|
736
762
|
];
|
|
737
763
|
// Annotate the CommonJS export names for ESM import in node:
|
|
738
764
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -652,4 +652,26 @@ declare const EMAIL_TEMPLATE_ROLES: readonly [{
|
|
|
652
652
|
readonly i18nKey: "emailTemplate.role.2";
|
|
653
653
|
}];
|
|
654
654
|
|
|
655
|
-
|
|
655
|
+
declare const EMAIL_HISTORY_STATUS: readonly [{
|
|
656
|
+
readonly key: 0;
|
|
657
|
+
readonly value: "Scheduled";
|
|
658
|
+
readonly i18nKey: "emailHistory.status.0";
|
|
659
|
+
}, {
|
|
660
|
+
readonly key: 1;
|
|
661
|
+
readonly value: "Delivering";
|
|
662
|
+
readonly i18nKey: "emailHistory.status.1";
|
|
663
|
+
}, {
|
|
664
|
+
readonly key: 2;
|
|
665
|
+
readonly value: "Delivered";
|
|
666
|
+
readonly i18nKey: "emailHistory.status.2";
|
|
667
|
+
}, {
|
|
668
|
+
readonly key: 3;
|
|
669
|
+
readonly value: "Failed";
|
|
670
|
+
readonly i18nKey: "emailHistory.status.3";
|
|
671
|
+
}, {
|
|
672
|
+
readonly key: 4;
|
|
673
|
+
readonly value: "Canceled";
|
|
674
|
+
readonly i18nKey: "emailHistory.status.4";
|
|
675
|
+
}];
|
|
676
|
+
|
|
677
|
+
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 };
|