@yangsaiyam/helper 1.11.4 → 1.12.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.
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { COUNTRY_CODE, MALAYSIA_STATE } from "./index";
2
+ import { COUNTRY_CODE, MALAYSIA_STATE } from "./index.js";
3
3
  assert.deepEqual(COUNTRY_CODE, [
4
4
  { key: 1, value: "MY", i18nKey: "country.code.1" },
5
5
  ]);
@@ -1,6 +1,6 @@
1
1
  import assert from "node:assert/strict";
2
- import { ASSESSMENT_QUESTION_TYPE, QuestionType, } from "./index";
3
- import { getI18nKeyByKey, getLabelByKey, getOptionByKey } from "../shared/helpers";
2
+ import { ASSESSMENT_QUESTION_TYPE, QuestionType, } from "./index.js";
3
+ import { getI18nKeyByKey, getLabelByKey, getOptionByKey } from "../shared/helpers.js";
4
4
  assert.deepEqual(ASSESSMENT_QUESTION_TYPE, [
5
5
  {
6
6
  key: QuestionType.Subjective,
@@ -0,0 +1,17 @@
1
+ export declare const EMAIL_HISTORY_STATUS: readonly [{
2
+ readonly key: 0;
3
+ readonly value: "Scheduled";
4
+ readonly i18nKey: "emailHistory.status.0";
5
+ }, {
6
+ readonly key: 1;
7
+ readonly value: "Delivering";
8
+ readonly i18nKey: "emailHistory.status.1";
9
+ }, {
10
+ readonly key: 2;
11
+ readonly value: "Sent";
12
+ readonly i18nKey: "emailHistory.status.2";
13
+ }, {
14
+ readonly key: 3;
15
+ readonly value: "Failed";
16
+ readonly i18nKey: "emailHistory.status.3";
17
+ }];
@@ -0,0 +1,6 @@
1
+ export const EMAIL_HISTORY_STATUS = [
2
+ { key: 0, value: "Scheduled", i18nKey: "emailHistory.status.0" },
3
+ { key: 1, value: "Delivering", i18nKey: "emailHistory.status.1" },
4
+ { key: 2, value: "Sent", i18nKey: "emailHistory.status.2" },
5
+ { key: 3, value: "Failed", i18nKey: "emailHistory.status.3" },
6
+ ];
package/dist/index.d.ts CHANGED
@@ -1,16 +1,17 @@
1
- export * from "./assessment-question/index";
2
- export * from "./career/index";
3
- export * from "./contact-form/index";
4
- export * from "./files/index";
5
- export * from "./locale/index";
6
- export * from "./roles/index";
7
- export * from "./routes/index";
8
- export * from "./shared/helpers";
9
- export * from "./shared/types";
10
- export * from "./time/index";
11
- export * from "./track/index";
12
- export * from "./url-prefix/index";
13
- export * from "./website/index";
14
- export * from "./addressess/index";
15
- export * from "./job-applications/index";
16
- export * from "./email-template/index";
1
+ export * from "./assessment-question/index.js";
2
+ export * from "./career/index.js";
3
+ export * from "./contact-form/index.js";
4
+ export * from "./files/index.js";
5
+ export * from "./locale/index.js";
6
+ export * from "./roles/index.js";
7
+ export * from "./routes/index.js";
8
+ export * from "./shared/helpers.js";
9
+ export * from "./shared/types.js";
10
+ export * from "./time/index.js";
11
+ export * from "./track/index.js";
12
+ export * from "./url-prefix/index.js";
13
+ export * from "./website/index.js";
14
+ export * from "./addressess/index.js";
15
+ export * from "./job-applications/index.js";
16
+ export * from "./email-template/index.js";
17
+ export * from "./email-history/index.js";
package/dist/index.js CHANGED
@@ -1,16 +1,17 @@
1
- export * from "./assessment-question/index";
2
- export * from "./career/index";
3
- export * from "./contact-form/index";
4
- export * from "./files/index";
5
- export * from "./locale/index";
6
- export * from "./roles/index";
7
- export * from "./routes/index";
8
- export * from "./shared/helpers";
9
- export * from "./shared/types";
10
- export * from "./time/index";
11
- export * from "./track/index";
12
- export * from "./url-prefix/index";
13
- export * from "./website/index";
14
- export * from "./addressess/index";
15
- export * from "./job-applications/index";
16
- export * from "./email-template/index";
1
+ export * from "./assessment-question/index.js";
2
+ export * from "./career/index.js";
3
+ export * from "./contact-form/index.js";
4
+ export * from "./files/index.js";
5
+ export * from "./locale/index.js";
6
+ export * from "./roles/index.js";
7
+ export * from "./routes/index.js";
8
+ export * from "./shared/helpers.js";
9
+ export * from "./shared/types.js";
10
+ export * from "./time/index.js";
11
+ export * from "./track/index.js";
12
+ export * from "./url-prefix/index.js";
13
+ export * from "./website/index.js";
14
+ export * from "./addressess/index.js";
15
+ export * from "./job-applications/index.js";
16
+ export * from "./email-template/index.js";
17
+ export * from "./email-history/index.js";
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { PERMISSION_I18N_KEY, Permission, ROLE, ROLE_PERMISSIONS, hasPermission, normalizeRole, permissionLabelKey, roleLabelKey, roleToId, } from "./index";
2
+ import { PERMISSION_I18N_KEY, Permission, ROLE, ROLE_PERMISSIONS, hasPermission, normalizeRole, permissionLabelKey, roleLabelKey, roleToId, } from "./index.js";
3
3
  assert.equal(normalizeRole(0), "super-admin");
4
4
  assert.equal(normalizeRole("admin"), "admin");
5
5
  assert.equal(normalizeRole(2), "staff");
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { ROUTE, ROUTES, buildRoutePathName, buildLocalizedRoute, routeLabelKey, routePathKey, } from "./index";
2
+ import { ROUTE, ROUTES, buildRoutePathName, buildLocalizedRoute, routeLabelKey, routePathKey, } from "./index.js";
3
3
  assert.deepEqual(ROUTES, [
4
4
  {
5
5
  key: "home",
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "./types";
1
+ import type { MappingOption } from "./types.js";
2
2
  export declare function getOptionByKey<T extends MappingOption>(options: readonly T[], key?: number | null): T | undefined;
3
3
  export declare function getLabelByKey<T extends MappingOption>(options: readonly T[], key?: number | null, fallback?: string): string;
4
4
  export declare function getI18nKeyByKey<T extends MappingOption>(options: readonly T[], key?: number | null, fallback?: string): string;
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { convertTimestampToTimezone, TIMEZONE, TIMEZONE_CURRENT_UTC_OFFSET, TIMEZONE_TO_UTC, normalizeTimezone, timezoneLabelKey, timezoneToUtc, } from "./index";
2
+ import { convertTimestampToTimezone, TIMEZONE, TIMEZONE_CURRENT_UTC_OFFSET, TIMEZONE_TO_UTC, normalizeTimezone, timezoneLabelKey, timezoneToUtc, } from "./index.js";
3
3
  assert.equal(normalizeTimezone("UTC"), "UTC");
4
4
  assert.equal(normalizeTimezone("utc"), "UTC");
5
5
  assert.equal(normalizeTimezone("Etc/UTC"), "UTC");
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { ORIGIN } from "./index";
2
+ import { ORIGIN } from "./index.js";
3
3
  assert.deepEqual(ORIGIN[0], {
4
4
  key: 0,
5
5
  value: "Website",
@@ -1,4 +1,4 @@
1
- import { Website } from "../website";
1
+ import { Website } from "../website/index.js";
2
2
  export const URL_PREFIXES = {
3
3
  [Website.KORRE]: {
4
4
  contact: "https://www.korre.site/contact",
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@yangsaiyam/helper",
3
- "version": "1.11.4",
3
+ "version": "1.12.0",
4
+ "type": "module",
4
5
  "main": "./dist/index.js",
5
6
  "types": "./dist/index.d.ts",
6
7
  "exports": {
@@ -1,6 +1,6 @@
1
1
  import assert from "node:assert/strict";
2
2
 
3
- import { COUNTRY_CODE, MALAYSIA_STATE } from "./index";
3
+ import { COUNTRY_CODE, MALAYSIA_STATE } from "./index.js";
4
4
 
5
5
  assert.deepEqual(COUNTRY_CODE, [
6
6
  { key: 1, value: "MY", i18nKey: "country.code.1" },
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "../shared/types";
1
+ import type { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const COUNTRY_CODE = [
4
4
  { key: 1, value: "MY", i18nKey: "country.code.1" },
@@ -3,8 +3,8 @@ import assert from "node:assert/strict";
3
3
  import {
4
4
  ASSESSMENT_QUESTION_TYPE,
5
5
  QuestionType,
6
- } from "./index";
7
- import { getI18nKeyByKey, getLabelByKey, getOptionByKey } from "../shared/helpers";
6
+ } from "./index.js";
7
+ import { getI18nKeyByKey, getLabelByKey, getOptionByKey } from "../shared/helpers.js";
8
8
 
9
9
  assert.deepEqual(ASSESSMENT_QUESTION_TYPE, [
10
10
  {
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "../shared/types";
1
+ import type { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const QuestionType = {
4
4
  Subjective: 1,
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "../shared/types";
1
+ import type { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const CAREER_JOB_TYPE = [
4
4
  { key: 1, value: "Full-time", i18nKey: "career.jobType.1" },
@@ -42,4 +42,4 @@ export const CAREER_LOCATION = [
42
42
  { key: 13, value: "Melaka", i18nKey: "career.location.13" },
43
43
  { key: 14, value: "Putrajaya", i18nKey: "career.location.14" },
44
44
  { key: 15, value: "Labuan", i18nKey: "career.location.15" },
45
- ] as const satisfies readonly MappingOption[];
45
+ ] as const satisfies readonly MappingOption[];
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "../shared/types";
1
+ import type { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const CONTACT_FORM_ENQUIRY_TYPE = [
4
4
  {
@@ -0,0 +1,6 @@
1
+ export const EMAIL_HISTORY_STATUS = [
2
+ { key: 0, value: "Scheduled", i18nKey: "emailHistory.status.0" },
3
+ { key: 1, value: "Delivering", i18nKey: "emailHistory.status.1" },
4
+ { key: 2, value: "Sent", i18nKey: "emailHistory.status.2" },
5
+ { key: 3, value: "Failed", i18nKey: "emailHistory.status.3" },
6
+ ] as const satisfies readonly { key: number; value: string; i18nKey: string }[];
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "../shared/types";
1
+ import type { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const FILE_STATUS = [
4
4
  { key: 1, value: "pending", i18nKey: "files.status.1" },
package/src/index.ts CHANGED
@@ -1,17 +1,17 @@
1
- export * from "./assessment-question/index";
2
- export * from "./career/index";
3
- export * from "./contact-form/index";
4
- export * from "./files/index";
5
- export * from "./locale/index";
6
- export * from "./roles/index";
7
- export * from "./routes/index";
8
- export * from "./shared/helpers";
9
- export * from "./shared/types";
10
- export * from "./time/index";
11
- export * from "./track/index";
12
- export * from "./url-prefix/index";
13
- export * from "./website/index";
14
- export * from "./addressess/index";
15
- export * from "./job-applications/index";
16
- export * from "./email-template/index";
17
-
1
+ export * from "./assessment-question/index.js";
2
+ export * from "./career/index.js";
3
+ export * from "./contact-form/index.js";
4
+ export * from "./files/index.js";
5
+ export * from "./locale/index.js";
6
+ export * from "./roles/index.js";
7
+ export * from "./routes/index.js";
8
+ export * from "./shared/helpers.js";
9
+ export * from "./shared/types.js";
10
+ export * from "./time/index.js";
11
+ export * from "./track/index.js";
12
+ export * from "./url-prefix/index.js";
13
+ export * from "./website/index.js";
14
+ export * from "./addressess/index.js";
15
+ export * from "./job-applications/index.js";
16
+ export * from "./email-template/index.js";
17
+ export * from "./email-history/index.js";
@@ -1,4 +1,4 @@
1
- import { MappingOption } from "../shared/types";
1
+ import { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const LOCALE = [
4
4
  { key: 1, value: "en", i18nKey: "locale.en" },
@@ -10,7 +10,7 @@ import {
10
10
  permissionLabelKey,
11
11
  roleLabelKey,
12
12
  roleToId,
13
- } from "./index";
13
+ } from "./index.js";
14
14
 
15
15
  assert.equal(normalizeRole(0), "super-admin");
16
16
  assert.equal(normalizeRole("admin"), "admin");
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "../shared/types";
1
+ import type { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export type CanonicalRole =
4
4
  | "super-admin"
@@ -7,7 +7,7 @@ import {
7
7
  buildLocalizedRoute,
8
8
  routeLabelKey,
9
9
  routePathKey,
10
- } from "./index";
10
+ } from "./index.js";
11
11
 
12
12
  assert.deepEqual(ROUTES, [
13
13
  {
@@ -1,4 +1,4 @@
1
- import type { MappingOption } from "./types";
1
+ import type { MappingOption } from "./types.js";
2
2
 
3
3
  export function getOptionByKey<T extends MappingOption>(
4
4
  options: readonly T[],
@@ -8,7 +8,7 @@ import {
8
8
  normalizeTimezone,
9
9
  timezoneLabelKey,
10
10
  timezoneToUtc,
11
- } from "./index";
11
+ } from "./index.js";
12
12
 
13
13
  assert.equal(normalizeTimezone("UTC"), "UTC");
14
14
  assert.equal(normalizeTimezone("utc"), "UTC");
package/src/time/index.ts CHANGED
@@ -2,7 +2,7 @@ import dayjs from "dayjs";
2
2
  import timezone from "dayjs/plugin/timezone.js";
3
3
  import utc from "dayjs/plugin/utc.js";
4
4
 
5
- import type { MappingOption } from "../shared/types";
5
+ import type { MappingOption } from "../shared/types.js";
6
6
 
7
7
  dayjs.extend(utc);
8
8
  dayjs.extend(timezone);
@@ -1,6 +1,6 @@
1
1
  import assert from "node:assert/strict";
2
2
 
3
- import { ORIGIN } from "./index";
3
+ import { ORIGIN } from "./index.js";
4
4
 
5
5
  assert.deepEqual(ORIGIN[0], {
6
6
  key: 0,
@@ -1,4 +1,4 @@
1
- import { MappingOption } from "../shared/types";
1
+ import { MappingOption } from "../shared/types.js";
2
2
 
3
3
  export const ORIGIN = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { Website } from "../website";
1
+ import { Website } from "../website/index.js";
2
2
 
3
3
  export const URL_PREFIXES = {
4
4
  [Website.KORRE]: {