@yangsaiyam/helper 1.13.0 → 1.14.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.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/package.json +1 -1
- package/src/contact-form/index.d.ts +29 -0
- package/src/contact-form/index.ts +43 -0
package/dist/index.d.cts
CHANGED
|
@@ -164,6 +164,35 @@ declare const CONTACT_FORM_ENQUIRY_TYPE: readonly [{
|
|
|
164
164
|
readonly value: "MCN Business";
|
|
165
165
|
readonly i18nKey: "contactForm.enquiryType.3";
|
|
166
166
|
}];
|
|
167
|
+
/** Korre Evolution (site 1): every field maps to a standard column. */
|
|
168
|
+
type KorreContactFormData = Record<string, never>;
|
|
169
|
+
/** Korre Labs (site 2): no contact form yet. */
|
|
170
|
+
type KorreLabsContactFormData = Record<string, never>;
|
|
171
|
+
/**
|
|
172
|
+
* MCOM Media (site 3): agency-intake extras beyond the standard columns.
|
|
173
|
+
* `service` is provisional — it may move to `enquiry_type` once the site-3
|
|
174
|
+
* enquiry-type mapping is defined.
|
|
175
|
+
*/
|
|
176
|
+
interface McomMediaContactFormData {
|
|
177
|
+
company_name?: string;
|
|
178
|
+
job_title?: string;
|
|
179
|
+
phone?: string;
|
|
180
|
+
website?: string;
|
|
181
|
+
country?: string;
|
|
182
|
+
budget?: string;
|
|
183
|
+
service?: string;
|
|
184
|
+
timeline?: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* `contact_form.form_data` shape keyed by `site_id`.
|
|
188
|
+
* 1 = KORRE, 2 = KORRE_LABS, 3 = MCOM_MEDIA (see the `Website` enum).
|
|
189
|
+
*/
|
|
190
|
+
interface ContactFormDataBySite {
|
|
191
|
+
1: KorreContactFormData;
|
|
192
|
+
2: KorreLabsContactFormData;
|
|
193
|
+
3: McomMediaContactFormData;
|
|
194
|
+
}
|
|
195
|
+
type ContactFormData = ContactFormDataBySite[keyof ContactFormDataBySite];
|
|
167
196
|
|
|
168
197
|
declare const FILE_STATUS: readonly [{
|
|
169
198
|
readonly key: 1;
|
|
@@ -680,4 +709,4 @@ declare const EMAIL_HISTORY_STATUS: readonly [{
|
|
|
680
709
|
readonly i18nKey: "emailHistory.status.4";
|
|
681
710
|
}];
|
|
682
711
|
|
|
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 };
|
|
712
|
+
export { ASSESSMENT_QUESTION_TYPE, CAREER_CATEGORY, CAREER_JOB_TYPE, CAREER_LOCATION, CAREER_MODE, CONTACT_FORM_ENQUIRY_TYPE, COUNTRY_CODE, type CanonicalRole, type CanonicalTimezone, type ContactFormData, type ContactFormDataBySite, EMAIL_HISTORY_STATUS, EMAIL_TEMPLATE_ROLES, FILE_ORIGIN, FILE_STATUS, JOB_APPLICATION_STATUS, type KorreContactFormData, type KorreLabsContactFormData, LOCALE, MALAYSIA_STATE, type MappingOption, type McomMediaContactFormData, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -164,6 +164,35 @@ declare const CONTACT_FORM_ENQUIRY_TYPE: readonly [{
|
|
|
164
164
|
readonly value: "MCN Business";
|
|
165
165
|
readonly i18nKey: "contactForm.enquiryType.3";
|
|
166
166
|
}];
|
|
167
|
+
/** Korre Evolution (site 1): every field maps to a standard column. */
|
|
168
|
+
type KorreContactFormData = Record<string, never>;
|
|
169
|
+
/** Korre Labs (site 2): no contact form yet. */
|
|
170
|
+
type KorreLabsContactFormData = Record<string, never>;
|
|
171
|
+
/**
|
|
172
|
+
* MCOM Media (site 3): agency-intake extras beyond the standard columns.
|
|
173
|
+
* `service` is provisional — it may move to `enquiry_type` once the site-3
|
|
174
|
+
* enquiry-type mapping is defined.
|
|
175
|
+
*/
|
|
176
|
+
interface McomMediaContactFormData {
|
|
177
|
+
company_name?: string;
|
|
178
|
+
job_title?: string;
|
|
179
|
+
phone?: string;
|
|
180
|
+
website?: string;
|
|
181
|
+
country?: string;
|
|
182
|
+
budget?: string;
|
|
183
|
+
service?: string;
|
|
184
|
+
timeline?: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* `contact_form.form_data` shape keyed by `site_id`.
|
|
188
|
+
* 1 = KORRE, 2 = KORRE_LABS, 3 = MCOM_MEDIA (see the `Website` enum).
|
|
189
|
+
*/
|
|
190
|
+
interface ContactFormDataBySite {
|
|
191
|
+
1: KorreContactFormData;
|
|
192
|
+
2: KorreLabsContactFormData;
|
|
193
|
+
3: McomMediaContactFormData;
|
|
194
|
+
}
|
|
195
|
+
type ContactFormData = ContactFormDataBySite[keyof ContactFormDataBySite];
|
|
167
196
|
|
|
168
197
|
declare const FILE_STATUS: readonly [{
|
|
169
198
|
readonly key: 1;
|
|
@@ -680,4 +709,4 @@ declare const EMAIL_HISTORY_STATUS: readonly [{
|
|
|
680
709
|
readonly i18nKey: "emailHistory.status.4";
|
|
681
710
|
}];
|
|
682
711
|
|
|
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 };
|
|
712
|
+
export { ASSESSMENT_QUESTION_TYPE, CAREER_CATEGORY, CAREER_JOB_TYPE, CAREER_LOCATION, CAREER_MODE, CONTACT_FORM_ENQUIRY_TYPE, COUNTRY_CODE, type CanonicalRole, type CanonicalTimezone, type ContactFormData, type ContactFormDataBySite, EMAIL_HISTORY_STATUS, EMAIL_TEMPLATE_ROLES, FILE_ORIGIN, FILE_STATUS, JOB_APPLICATION_STATUS, type KorreContactFormData, type KorreLabsContactFormData, LOCALE, MALAYSIA_STATE, type MappingOption, type McomMediaContactFormData, 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 };
|
package/package.json
CHANGED
|
@@ -11,3 +11,32 @@ export declare const CONTACT_FORM_ENQUIRY_TYPE: readonly [{
|
|
|
11
11
|
readonly value: "MCN Business";
|
|
12
12
|
readonly i18nKey: "contactForm.enquiryType.3";
|
|
13
13
|
}];
|
|
14
|
+
/** Korre Evolution (site 1): every field maps to a standard column. */
|
|
15
|
+
export type KorreContactFormData = Record<string, never>;
|
|
16
|
+
/** Korre Labs (site 2): no contact form yet. */
|
|
17
|
+
export type KorreLabsContactFormData = Record<string, never>;
|
|
18
|
+
/**
|
|
19
|
+
* MCOM Media (site 3): agency-intake extras beyond the standard columns.
|
|
20
|
+
* `service` is provisional — it may move to `enquiry_type` once the site-3
|
|
21
|
+
* enquiry-type mapping is defined.
|
|
22
|
+
*/
|
|
23
|
+
export interface McomMediaContactFormData {
|
|
24
|
+
company_name?: string;
|
|
25
|
+
job_title?: string;
|
|
26
|
+
phone?: string;
|
|
27
|
+
website?: string;
|
|
28
|
+
country?: string;
|
|
29
|
+
budget?: string;
|
|
30
|
+
service?: string;
|
|
31
|
+
timeline?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `contact_form.form_data` shape keyed by `site_id`.
|
|
35
|
+
* 1 = KORRE, 2 = KORRE_LABS, 3 = MCOM_MEDIA (see the `Website` enum).
|
|
36
|
+
*/
|
|
37
|
+
export interface ContactFormDataBySite {
|
|
38
|
+
1: KorreContactFormData;
|
|
39
|
+
2: KorreLabsContactFormData;
|
|
40
|
+
3: McomMediaContactFormData;
|
|
41
|
+
}
|
|
42
|
+
export type ContactFormData = ContactFormDataBySite[keyof ContactFormDataBySite];
|
|
@@ -13,3 +13,46 @@ export const CONTACT_FORM_ENQUIRY_TYPE = [
|
|
|
13
13
|
},
|
|
14
14
|
{ key: 3, value: "MCN Business", i18nKey: "contactForm.enquiryType.3" },
|
|
15
15
|
] as const satisfies readonly MappingOption[];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Per-site shape of `contact_form.form_data` (jsonb).
|
|
19
|
+
*
|
|
20
|
+
* The standard columns — sender_name, email, enquiry_type, message — live on
|
|
21
|
+
* the row itself. Only the site-specific extra fields are stored in form_data.
|
|
22
|
+
* Keys are snake_case to match the `contact_form` columns.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** Korre Evolution (site 1): every field maps to a standard column. */
|
|
26
|
+
export type KorreContactFormData = Record<string, never>;
|
|
27
|
+
|
|
28
|
+
/** Korre Labs (site 2): no contact form yet. */
|
|
29
|
+
export type KorreLabsContactFormData = Record<string, never>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* MCOM Media (site 3): agency-intake extras beyond the standard columns.
|
|
33
|
+
* `service` is provisional — it may move to `enquiry_type` once the site-3
|
|
34
|
+
* enquiry-type mapping is defined.
|
|
35
|
+
*/
|
|
36
|
+
export interface McomMediaContactFormData {
|
|
37
|
+
company_name?: string;
|
|
38
|
+
job_title?: string;
|
|
39
|
+
phone?: string;
|
|
40
|
+
website?: string;
|
|
41
|
+
country?: string;
|
|
42
|
+
budget?: string;
|
|
43
|
+
service?: string;
|
|
44
|
+
timeline?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* `contact_form.form_data` shape keyed by `site_id`.
|
|
49
|
+
* 1 = KORRE, 2 = KORRE_LABS, 3 = MCOM_MEDIA (see the `Website` enum).
|
|
50
|
+
*/
|
|
51
|
+
export interface ContactFormDataBySite {
|
|
52
|
+
1: KorreContactFormData;
|
|
53
|
+
2: KorreLabsContactFormData;
|
|
54
|
+
3: McomMediaContactFormData;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ContactFormData =
|
|
58
|
+
ContactFormDataBySite[keyof ContactFormDataBySite];
|