mojulo 0.0.0 → 0.1.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.
Files changed (121) hide show
  1. package/README.md +53 -4
  2. package/lib/audit-logger-new.js +11 -0
  3. package/lib/auth/gate.js +25 -0
  4. package/lib/auth/service.js +17 -0
  5. package/lib/auth/session.js +63 -0
  6. package/lib/builder/chat-processor.js +607 -0
  7. package/lib/builder/composer-bridge.js +82 -0
  8. package/lib/builder/evaluator.js +159 -0
  9. package/lib/builder/executor.js +252 -0
  10. package/lib/builder/index.js +48 -0
  11. package/lib/builder/session.js +248 -0
  12. package/lib/builder/system-prompt.js +422 -0
  13. package/lib/builder/tone-presets.js +75 -0
  14. package/lib/builder/tool-executors.js +1418 -0
  15. package/lib/builder/tools.js +338 -0
  16. package/lib/builder/validators.js +239 -0
  17. package/lib/composer/composer.js +225 -0
  18. package/lib/composer/index.js +40 -0
  19. package/lib/composer/protocols/00_base.txt +19 -0
  20. package/lib/composer/protocols/01_knowledge.txt +9 -0
  21. package/lib/composer/protocols/02_form-gathering.txt +32 -0
  22. package/lib/composer/protocols/03_appointments.txt +16 -0
  23. package/lib/composer/protocols/04_triage.txt +15 -0
  24. package/lib/composer/protocols/05_optical-read.txt +22 -0
  25. package/lib/composer/response-builder.js +98 -0
  26. package/lib/config-builder.js +650 -0
  27. package/lib/db/ids.js +10 -0
  28. package/lib/db/index.js +179 -0
  29. package/lib/db/repositories/apiKeys.js +72 -0
  30. package/lib/db/repositories/auditLogs.js +12 -0
  31. package/lib/db/repositories/botSpaces.js +12 -0
  32. package/lib/db/repositories/builderSessions.js +312 -0
  33. package/lib/db/repositories/deploymentEvents.js +12 -0
  34. package/lib/db/repositories/deployments.js +385 -0
  35. package/lib/db/repositories/documents.js +68 -0
  36. package/lib/db/repositories/mcpJobs.js +84 -0
  37. package/lib/deployers/bot-fleet.js +110 -0
  38. package/lib/deployers/bot-proxy.js +72 -0
  39. package/lib/deployers/build.js +89 -0
  40. package/lib/deployers/cloud-deploy.js +310 -0
  41. package/lib/deployers/docker.js +439 -0
  42. package/lib/deployers/fly.js +432 -0
  43. package/lib/deployers/index.js +38 -0
  44. package/lib/deployment-auth.js +36 -0
  45. package/lib/document-parser.js +171 -0
  46. package/lib/embedder/chunker.js +93 -0
  47. package/lib/embedder/local.js +101 -0
  48. package/lib/embedder/preview-rag.js +93 -0
  49. package/lib/envelope-schema.js +54 -0
  50. package/lib/fleet/scoped-sql.js +342 -0
  51. package/lib/form-schema-config/base.js +135 -0
  52. package/lib/form-schema-config/index.js +286 -0
  53. package/lib/form-schema-config/locales/af-ZA.js +153 -0
  54. package/lib/form-schema-config/locales/ar-AE.js +142 -0
  55. package/lib/form-schema-config/locales/ar-SA.js +164 -0
  56. package/lib/form-schema-config/locales/de-DE.js +152 -0
  57. package/lib/form-schema-config/locales/en-AU.js +161 -0
  58. package/lib/form-schema-config/locales/en-CA.js +115 -0
  59. package/lib/form-schema-config/locales/en-GB.js +132 -0
  60. package/lib/form-schema-config/locales/en-IN.js +219 -0
  61. package/lib/form-schema-config/locales/en-MY.js +171 -0
  62. package/lib/form-schema-config/locales/en-NG.js +198 -0
  63. package/lib/form-schema-config/locales/en-PH.js +186 -0
  64. package/lib/form-schema-config/locales/en-SG.js +153 -0
  65. package/lib/form-schema-config/locales/en-US.js +138 -0
  66. package/lib/form-schema-config/locales/es-ES.js +171 -0
  67. package/lib/form-schema-config/locales/es-MX.js +193 -0
  68. package/lib/form-schema-config/locales/fr-CA.js +138 -0
  69. package/lib/form-schema-config/locales/fr-FR.js +155 -0
  70. package/lib/form-schema-config/locales/hi-IN.js +219 -0
  71. package/lib/form-schema-config/locales/it-IT.js +157 -0
  72. package/lib/form-schema-config/locales/ja-JP.js +169 -0
  73. package/lib/form-schema-config/locales/ko-KR.js +140 -0
  74. package/lib/form-schema-config/locales/nl-NL.js +149 -0
  75. package/lib/form-schema-config/locales/pt-BR.js +168 -0
  76. package/lib/form-schema-config/locales/zh-CN.js +172 -0
  77. package/lib/form-schema-config/locales/zh-HK.js +142 -0
  78. package/lib/form-structure-schema.js +191 -0
  79. package/lib/llm-providers.js +828 -0
  80. package/lib/markdown.js +197 -0
  81. package/lib/mcp/catalysts/appointment-to-calendar.md +84 -0
  82. package/lib/mcp/catalysts/conversations-to-channel-digest.md +104 -0
  83. package/lib/mcp/catalysts/document-extract-to-store.md +92 -0
  84. package/lib/mcp/catalysts/knowledge-gap-miner.md +96 -0
  85. package/lib/mcp/catalysts/loader.js +144 -0
  86. package/lib/mcp/catalysts/qualify-lead-to-crm.md +83 -0
  87. package/lib/mcp/catalysts/scan-conversations-for-signal.md +92 -0
  88. package/lib/mcp/catalysts/submission-to-ticket.md +83 -0
  89. package/lib/mcp/catalysts/submissions-to-warehouse.md +103 -0
  90. package/lib/mcp/catalysts/weekly-submissions-digest.md +82 -0
  91. package/lib/mcp/jobs.js +64 -0
  92. package/lib/mcp/server.js +184 -0
  93. package/lib/mcp/session-binding.js +130 -0
  94. package/lib/mcp/tools/build.js +123 -0
  95. package/lib/mcp/tools/catalysts.js +477 -0
  96. package/lib/mcp/tools/context.js +325 -0
  97. package/lib/mcp/tools/fleet.js +391 -0
  98. package/lib/mcp/tools/jobs-tools.js +240 -0
  99. package/lib/mcp/tools/operate.js +314 -0
  100. package/lib/preview/build-preview-config.js +136 -0
  101. package/lib/rate-limiter.js +11 -0
  102. package/lib/resolve-api-key.js +142 -0
  103. package/lib/storage/index.js +40 -0
  104. package/messages/de.json +2136 -0
  105. package/messages/en.json +2136 -0
  106. package/messages/es.json +2136 -0
  107. package/messages/fr.json +2136 -0
  108. package/messages/it.json +2136 -0
  109. package/messages/ja.json +2136 -0
  110. package/messages/ko.json +2136 -0
  111. package/messages/nl.json +2136 -0
  112. package/messages/pl.json +2136 -0
  113. package/messages/pt.json +2136 -0
  114. package/messages/ru.json +2136 -0
  115. package/messages/uk.json +2136 -0
  116. package/messages/zh.json +2136 -0
  117. package/package.json +61 -5
  118. package/scripts/mcp-config.mjs +162 -0
  119. package/scripts/mcp-stdio-loader.mjs +42 -0
  120. package/scripts/mcp-stdio.mjs +108 -0
  121. package/scripts/mojulo-paths.mjs +48 -0
@@ -0,0 +1,198 @@
1
+ /**
2
+ * English - Nigeria (en-NG) Locale Configuration
3
+ */
4
+
5
+ export const LOCALE_INFO = {
6
+ code: 'en-NG',
7
+ name: 'Nigeria',
8
+ region: 'Africa',
9
+ currency: 'NGN',
10
+ dateFormat: 'DD/MM/YYYY'
11
+ };
12
+
13
+ export const PATTERNS = {
14
+ phone: {
15
+ pattern: '^(\\+234|0)[789]\\d{9}$',
16
+ error: 'Enter a valid Nigerian phone number',
17
+ description: 'Nigerian phone number'
18
+ },
19
+ mobile: {
20
+ pattern: '^(\\+234|0)[789]0\\d{8}$',
21
+ error: 'Enter a valid Nigerian mobile number',
22
+ description: 'Nigerian mobile number'
23
+ },
24
+ postalCode: {
25
+ pattern: '^\\d{6}$',
26
+ error: 'Enter a valid postal code (6 digits)',
27
+ description: 'Nigerian postal code'
28
+ },
29
+ nin: {
30
+ pattern: '^\\d{11}$',
31
+ error: 'Enter a valid NIN (11 digits)',
32
+ description: 'National Identification Number'
33
+ },
34
+ bvn: {
35
+ pattern: '^\\d{11}$',
36
+ error: 'Enter a valid BVN (11 digits)',
37
+ description: 'Bank Verification Number'
38
+ },
39
+ tin: {
40
+ pattern: '^\\d{8}-?\\d{4}$',
41
+ error: 'Enter a valid TIN',
42
+ description: 'Tax Identification Number'
43
+ },
44
+ cac: {
45
+ pattern: '^RC\\d{4,7}$',
46
+ error: 'Enter a valid CAC number (e.g., RC123456)',
47
+ description: 'Corporate Affairs Commission number'
48
+ },
49
+ bankAccount: {
50
+ pattern: '^\\d{10}$',
51
+ error: 'Enter a valid NUBAN account number (10 digits)',
52
+ description: 'NUBAN bank account'
53
+ },
54
+ currency: {
55
+ pattern: '^(₦|NGN)?\\s?[\\d,]+(\\.\\d{2})?$',
56
+ error: 'Enter a valid amount',
57
+ description: 'Nigerian Naira amount'
58
+ }
59
+ };
60
+
61
+ export const ARCHETYPES = {
62
+ phone: {
63
+ type: 'tel',
64
+ autocomplete: 'tel',
65
+ inputMode: 'tel',
66
+ placeholder: '0801 234 5678',
67
+ pattern: PATTERNS.mobile.pattern,
68
+ patternError: PATTERNS.mobile.error,
69
+ pii: true
70
+ },
71
+ postalCode: {
72
+ type: 'text',
73
+ autocomplete: 'postal-code',
74
+ inputMode: 'numeric',
75
+ placeholder: '100001',
76
+ pattern: PATTERNS.postalCode.pattern,
77
+ patternError: PATTERNS.postalCode.error,
78
+ maxLength: 6
79
+ },
80
+ nationalId: {
81
+ type: 'text',
82
+ inputMode: 'numeric',
83
+ placeholder: '12345678901',
84
+ pattern: PATTERNS.nin.pattern,
85
+ patternError: PATTERNS.nin.error,
86
+ pii: true,
87
+ sensitive: true,
88
+ helpText: 'Your NIN will be stored securely'
89
+ },
90
+ bvn: {
91
+ type: 'text',
92
+ inputMode: 'numeric',
93
+ placeholder: '12345678901',
94
+ pattern: PATTERNS.bvn.pattern,
95
+ patternError: PATTERNS.bvn.error,
96
+ pii: true,
97
+ sensitive: true,
98
+ helpText: 'Your BVN will be stored securely'
99
+ },
100
+ tin: {
101
+ type: 'text',
102
+ inputMode: 'numeric',
103
+ placeholder: '12345678-0001',
104
+ pattern: PATTERNS.tin.pattern,
105
+ patternError: PATTERNS.tin.error,
106
+ pii: true
107
+ },
108
+ bankAccount: {
109
+ type: 'text',
110
+ inputMode: 'numeric',
111
+ placeholder: '0123456789',
112
+ pattern: PATTERNS.bankAccount.pattern,
113
+ patternError: PATTERNS.bankAccount.error,
114
+ pii: true,
115
+ maxLength: 10
116
+ },
117
+ state: {
118
+ type: 'dropdown',
119
+ autocomplete: 'address-level1',
120
+ options: [
121
+ { value: 'AB', label: 'Abia' },
122
+ { value: 'AD', label: 'Adamawa' },
123
+ { value: 'AK', label: 'Akwa Ibom' },
124
+ { value: 'AN', label: 'Anambra' },
125
+ { value: 'BA', label: 'Bauchi' },
126
+ { value: 'BY', label: 'Bayelsa' },
127
+ { value: 'BE', label: 'Benue' },
128
+ { value: 'BO', label: 'Borno' },
129
+ { value: 'CR', label: 'Cross River' },
130
+ { value: 'DE', label: 'Delta' },
131
+ { value: 'EB', label: 'Ebonyi' },
132
+ { value: 'ED', label: 'Edo' },
133
+ { value: 'EK', label: 'Ekiti' },
134
+ { value: 'EN', label: 'Enugu' },
135
+ { value: 'FC', label: 'FCT - Abuja' },
136
+ { value: 'GO', label: 'Gombe' },
137
+ { value: 'IM', label: 'Imo' },
138
+ { value: 'JI', label: 'Jigawa' },
139
+ { value: 'KD', label: 'Kaduna' },
140
+ { value: 'KN', label: 'Kano' },
141
+ { value: 'KT', label: 'Katsina' },
142
+ { value: 'KE', label: 'Kebbi' },
143
+ { value: 'KO', label: 'Kogi' },
144
+ { value: 'KW', label: 'Kwara' },
145
+ { value: 'LA', label: 'Lagos' },
146
+ { value: 'NA', label: 'Nasarawa' },
147
+ { value: 'NI', label: 'Niger' },
148
+ { value: 'OG', label: 'Ogun' },
149
+ { value: 'ON', label: 'Ondo' },
150
+ { value: 'OS', label: 'Osun' },
151
+ { value: 'OY', label: 'Oyo' },
152
+ { value: 'PL', label: 'Plateau' },
153
+ { value: 'RI', label: 'Rivers' },
154
+ { value: 'SO', label: 'Sokoto' },
155
+ { value: 'TA', label: 'Taraba' },
156
+ { value: 'YO', label: 'Yobe' },
157
+ { value: 'ZA', label: 'Zamfara' }
158
+ ]
159
+ },
160
+ currency: {
161
+ type: 'text',
162
+ inputMode: 'numeric',
163
+ placeholder: '₦100,000.00',
164
+ pattern: PATTERNS.currency.pattern,
165
+ patternError: PATTERNS.currency.error
166
+ }
167
+ };
168
+
169
+ /**
170
+ * Nigerian English field name mappings
171
+ */
172
+ export const FIELD_LABELS = {
173
+ postalCode: 'Postal Code',
174
+ state: 'State',
175
+ lga: 'Local Government Area',
176
+ nationalId: 'NIN',
177
+ phone: 'Phone Number',
178
+ mobile: 'Mobile Number',
179
+ firstName: 'First Name',
180
+ middleName: 'Middle Name',
181
+ lastName: 'Surname',
182
+ fullName: 'Full Name',
183
+ streetAddress: 'Address',
184
+ city: 'City/Town',
185
+ email: 'Email Address',
186
+ dateOfBirth: 'Date of Birth',
187
+ company: 'Company Name'
188
+ };
189
+
190
+ /**
191
+ * NDPR (Nigeria Data Protection Regulation) compliance hints
192
+ */
193
+ export const GDPR_HINTS = {
194
+ consentRequired: true,
195
+ dataRetentionNotice: true,
196
+ rightToErasure: true,
197
+ explicitConsentLanguage: 'I consent to the collection, processing, and storage of my personal data in accordance with the Privacy Policy and the Nigeria Data Protection Regulation (NDPR).'
198
+ };
@@ -0,0 +1,186 @@
1
+ /**
2
+ * English - Philippines (en-PH) Locale Configuration
3
+ */
4
+
5
+ export const LOCALE_INFO = {
6
+ code: 'en-PH',
7
+ name: 'Philippines',
8
+ region: 'Asia',
9
+ currency: 'PHP',
10
+ dateFormat: 'MM/DD/YYYY'
11
+ };
12
+
13
+ export const PATTERNS = {
14
+ phone: {
15
+ pattern: '^(\\+63|0)\\d{10}$',
16
+ error: 'Enter a valid Philippine phone number',
17
+ description: 'Philippine phone number'
18
+ },
19
+ mobile: {
20
+ pattern: '^(\\+63|0)9\\d{9}$',
21
+ error: 'Enter a valid Philippine mobile number',
22
+ description: 'Philippine mobile number'
23
+ },
24
+ postalCode: {
25
+ pattern: '^\\d{4}$',
26
+ error: 'Enter a valid ZIP code (4 digits)',
27
+ description: 'Philippine ZIP code'
28
+ },
29
+ tin: {
30
+ pattern: '^\\d{3}-?\\d{3}-?\\d{3}-?\\d{3,5}$',
31
+ error: 'Enter a valid TIN',
32
+ description: 'Tax Identification Number'
33
+ },
34
+ sss: {
35
+ pattern: '^\\d{2}-?\\d{7}-?\\d{1}$',
36
+ error: 'Enter a valid SSS number',
37
+ description: 'Social Security System number'
38
+ },
39
+ philhealth: {
40
+ pattern: '^\\d{2}-?\\d{9}-?\\d{1}$',
41
+ error: 'Enter a valid PhilHealth number',
42
+ description: 'PhilHealth ID number'
43
+ },
44
+ pagibig: {
45
+ pattern: '^\\d{4}-?\\d{4}-?\\d{4}$',
46
+ error: 'Enter a valid Pag-IBIG number',
47
+ description: 'Pag-IBIG MID number'
48
+ },
49
+ umid: {
50
+ pattern: '^\\d{4}-?\\d{7}-?\\d{1}$',
51
+ error: 'Enter a valid UMID number',
52
+ description: 'Unified Multi-Purpose ID'
53
+ },
54
+ bankAccount: {
55
+ pattern: '^\\d{10,16}$',
56
+ error: 'Enter a valid bank account number',
57
+ description: 'Philippine bank account'
58
+ },
59
+ gcash: {
60
+ pattern: '^(\\+63|0)9\\d{9}$',
61
+ error: 'Enter a valid GCash number',
62
+ description: 'GCash mobile number'
63
+ },
64
+ currency: {
65
+ pattern: '^(₱|PHP)?\\s?[\\d,]+(\\.\\d{2})?$',
66
+ error: 'Enter a valid amount',
67
+ description: 'Philippine Peso amount'
68
+ }
69
+ };
70
+
71
+ export const ARCHETYPES = {
72
+ phone: {
73
+ type: 'tel',
74
+ autocomplete: 'tel',
75
+ inputMode: 'tel',
76
+ placeholder: '0917 123 4567',
77
+ pattern: PATTERNS.mobile.pattern,
78
+ patternError: PATTERNS.mobile.error,
79
+ pii: true
80
+ },
81
+ postalCode: {
82
+ type: 'text',
83
+ autocomplete: 'postal-code',
84
+ inputMode: 'numeric',
85
+ placeholder: '1234',
86
+ pattern: PATTERNS.postalCode.pattern,
87
+ patternError: PATTERNS.postalCode.error,
88
+ maxLength: 4
89
+ },
90
+ nationalId: {
91
+ type: 'text',
92
+ inputMode: 'numeric',
93
+ placeholder: '1234-5678901-2',
94
+ pattern: PATTERNS.umid.pattern,
95
+ patternError: PATTERNS.umid.error,
96
+ pii: true,
97
+ sensitive: true,
98
+ helpText: 'Your ID number will be stored securely'
99
+ },
100
+ tin: {
101
+ type: 'text',
102
+ inputMode: 'numeric',
103
+ placeholder: '123-456-789-000',
104
+ pattern: PATTERNS.tin.pattern,
105
+ patternError: PATTERNS.tin.error,
106
+ pii: true
107
+ },
108
+ sss: {
109
+ type: 'text',
110
+ inputMode: 'numeric',
111
+ placeholder: '12-3456789-0',
112
+ pattern: PATTERNS.sss.pattern,
113
+ patternError: PATTERNS.sss.error,
114
+ pii: true
115
+ },
116
+ gcash: {
117
+ type: 'tel',
118
+ inputMode: 'tel',
119
+ placeholder: '0917 123 4567',
120
+ pattern: PATTERNS.gcash.pattern,
121
+ patternError: PATTERNS.gcash.error,
122
+ pii: true
123
+ },
124
+ region: {
125
+ type: 'dropdown',
126
+ autocomplete: 'address-level1',
127
+ options: [
128
+ { value: 'NCR', label: 'NCR - National Capital Region' },
129
+ { value: 'CAR', label: 'CAR - Cordillera Administrative Region' },
130
+ { value: 'I', label: 'Region I - Ilocos Region' },
131
+ { value: 'II', label: 'Region II - Cagayan Valley' },
132
+ { value: 'III', label: 'Region III - Central Luzon' },
133
+ { value: 'IV-A', label: 'Region IV-A - CALABARZON' },
134
+ { value: 'IV-B', label: 'Region IV-B - MIMAROPA' },
135
+ { value: 'V', label: 'Region V - Bicol Region' },
136
+ { value: 'VI', label: 'Region VI - Western Visayas' },
137
+ { value: 'VII', label: 'Region VII - Central Visayas' },
138
+ { value: 'VIII', label: 'Region VIII - Eastern Visayas' },
139
+ { value: 'IX', label: 'Region IX - Zamboanga Peninsula' },
140
+ { value: 'X', label: 'Region X - Northern Mindanao' },
141
+ { value: 'XI', label: 'Region XI - Davao Region' },
142
+ { value: 'XII', label: 'Region XII - SOCCSKSARGEN' },
143
+ { value: 'XIII', label: 'Region XIII - Caraga' },
144
+ { value: 'BARMM', label: 'BARMM - Bangsamoro' }
145
+ ]
146
+ },
147
+ currency: {
148
+ type: 'text',
149
+ inputMode: 'decimal',
150
+ placeholder: '₱1,000.00',
151
+ pattern: PATTERNS.currency.pattern,
152
+ patternError: PATTERNS.currency.error
153
+ }
154
+ };
155
+
156
+ /**
157
+ * Philippine English field name mappings
158
+ */
159
+ export const FIELD_LABELS = {
160
+ postalCode: 'ZIP Code',
161
+ state: 'Region',
162
+ province: 'Province',
163
+ nationalId: 'UMID/National ID',
164
+ phone: 'Phone Number',
165
+ mobile: 'Mobile Number',
166
+ firstName: 'First Name',
167
+ middleName: 'Middle Name',
168
+ lastName: 'Last Name',
169
+ fullName: 'Full Name',
170
+ streetAddress: 'Street Address',
171
+ city: 'City/Municipality',
172
+ barangay: 'Barangay',
173
+ email: 'Email Address',
174
+ dateOfBirth: 'Date of Birth',
175
+ company: 'Company Name'
176
+ };
177
+
178
+ /**
179
+ * DPA (Data Privacy Act of 2012) compliance hints
180
+ */
181
+ export const GDPR_HINTS = {
182
+ consentRequired: true,
183
+ dataRetentionNotice: true,
184
+ rightToErasure: true,
185
+ explicitConsentLanguage: 'I consent to the collection, processing, and storage of my personal data in accordance with the Privacy Policy and the Data Privacy Act of 2012.'
186
+ };
@@ -0,0 +1,153 @@
1
+ /**
2
+ * English - Singapore (en-SG) Locale Configuration
3
+ */
4
+
5
+ export const LOCALE_INFO = {
6
+ code: 'en-SG',
7
+ name: 'Singapore',
8
+ region: 'Asia',
9
+ currency: 'SGD',
10
+ dateFormat: 'DD/MM/YYYY'
11
+ };
12
+
13
+ export const PATTERNS = {
14
+ phone: {
15
+ pattern: '^(\\+65[\\s-]?)?[689]\\d{7}$',
16
+ error: 'Enter a valid Singapore phone number',
17
+ description: 'Singapore phone number'
18
+ },
19
+ mobile: {
20
+ pattern: '^(\\+65[\\s-]?)?[89]\\d{7}$',
21
+ error: 'Enter a valid Singapore mobile number',
22
+ description: 'Singapore mobile number'
23
+ },
24
+ postalCode: {
25
+ pattern: '^\\d{6}$',
26
+ error: 'Enter a valid postal code (6 digits)',
27
+ description: 'Singapore postal code'
28
+ },
29
+ nric: {
30
+ pattern: '^[STFGM]\\d{7}[A-Z]$',
31
+ error: 'Enter a valid NRIC/FIN',
32
+ description: 'National Registration Identity Card / Foreign Identification Number'
33
+ },
34
+ uen: {
35
+ pattern: '^(\\d{8}[A-Z]|\\d{9}[A-Z]|[TS]\\d{2}[A-Z]{2}\\d{4}[A-Z])$',
36
+ error: 'Enter a valid UEN',
37
+ description: 'Unique Entity Number'
38
+ },
39
+ bankAccount: {
40
+ pattern: '^\\d{9,12}$',
41
+ error: 'Enter a valid bank account number',
42
+ description: 'Singapore bank account'
43
+ },
44
+ paynow: {
45
+ pattern: '^([89]\\d{7}|[STFGM]\\d{7}[A-Z]|\\d{9,12})$',
46
+ error: 'Enter a valid PayNow ID',
47
+ description: 'PayNow mobile/NRIC/UEN'
48
+ },
49
+ currency: {
50
+ pattern: '^(S\\$|\\$)?[\\d,]+(\\.\\d{2})?$',
51
+ error: 'Enter a valid amount',
52
+ description: 'Singapore Dollar amount'
53
+ }
54
+ };
55
+
56
+ export const ARCHETYPES = {
57
+ phone: {
58
+ type: 'tel',
59
+ autocomplete: 'tel',
60
+ inputMode: 'tel',
61
+ placeholder: '9123 4567',
62
+ pattern: PATTERNS.mobile.pattern,
63
+ patternError: PATTERNS.mobile.error,
64
+ pii: true
65
+ },
66
+ postalCode: {
67
+ type: 'text',
68
+ autocomplete: 'postal-code',
69
+ inputMode: 'numeric',
70
+ placeholder: '123456',
71
+ pattern: PATTERNS.postalCode.pattern,
72
+ patternError: PATTERNS.postalCode.error,
73
+ maxLength: 6
74
+ },
75
+ nationalId: {
76
+ type: 'text',
77
+ inputMode: 'text',
78
+ placeholder: 'S1234567A',
79
+ pattern: PATTERNS.nric.pattern,
80
+ patternError: PATTERNS.nric.error,
81
+ pii: true,
82
+ sensitive: true,
83
+ helpText: 'Your NRIC/FIN will be stored securely',
84
+ maxLength: 9
85
+ },
86
+ uen: {
87
+ type: 'text',
88
+ inputMode: 'text',
89
+ placeholder: '201812345A',
90
+ pattern: PATTERNS.uen.pattern,
91
+ patternError: PATTERNS.uen.error,
92
+ pii: true
93
+ },
94
+ paynow: {
95
+ type: 'text',
96
+ inputMode: 'text',
97
+ placeholder: 'Mobile/NRIC/UEN',
98
+ pattern: PATTERNS.paynow.pattern,
99
+ patternError: PATTERNS.paynow.error,
100
+ pii: true
101
+ },
102
+ region: {
103
+ type: 'dropdown',
104
+ autocomplete: 'address-level1',
105
+ options: [
106
+ { value: 'central', label: 'Central Region' },
107
+ { value: 'east', label: 'East Region' },
108
+ { value: 'north', label: 'North Region' },
109
+ { value: 'north-east', label: 'North-East Region' },
110
+ { value: 'west', label: 'West Region' }
111
+ ]
112
+ },
113
+ currency: {
114
+ type: 'text',
115
+ inputMode: 'decimal',
116
+ placeholder: 'S$1,000.00',
117
+ pattern: PATTERNS.currency.pattern,
118
+ patternError: PATTERNS.currency.error
119
+ }
120
+ };
121
+
122
+ /**
123
+ * Singapore English field name mappings
124
+ */
125
+ export const FIELD_LABELS = {
126
+ postalCode: 'Postal Code',
127
+ state: 'Region',
128
+ nationalId: 'NRIC/FIN',
129
+ phone: 'Phone Number',
130
+ mobile: 'Mobile Number',
131
+ firstName: 'Given Name',
132
+ lastName: 'Family Name',
133
+ fullName: 'Full Name (as in NRIC)',
134
+ streetAddress: 'Street Address',
135
+ city: 'City',
136
+ block: 'Block/House No.',
137
+ floor: 'Floor',
138
+ unit: 'Unit',
139
+ building: 'Building Name',
140
+ email: 'Email Address',
141
+ dateOfBirth: 'Date of Birth',
142
+ company: 'Company Name'
143
+ };
144
+
145
+ /**
146
+ * PDPA (Personal Data Protection Act) compliance hints
147
+ */
148
+ export const GDPR_HINTS = {
149
+ consentRequired: true,
150
+ dataRetentionNotice: true,
151
+ rightToErasure: true,
152
+ explicitConsentLanguage: 'I consent to the collection, use, and disclosure of my personal data in accordance with the Privacy Policy.'
153
+ };
@@ -0,0 +1,138 @@
1
+ /**
2
+ * US English (en-US) Locale Configuration
3
+ */
4
+
5
+ export const LOCALE_INFO = {
6
+ code: 'en-US',
7
+ name: 'United States',
8
+ region: 'NA',
9
+ currency: 'USD',
10
+ dateFormat: 'MM/DD/YYYY'
11
+ };
12
+
13
+ export const PATTERNS = {
14
+ phone: {
15
+ pattern: '^(\\+1)?[-.\\s]?\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}$',
16
+ error: 'Enter a valid US phone number',
17
+ description: 'US phone number'
18
+ },
19
+ postalCode: {
20
+ pattern: '^\\d{5}(-\\d{4})?$',
21
+ error: 'Enter a valid ZIP code (e.g., 12345 or 12345-6789)',
22
+ description: 'US ZIP code'
23
+ },
24
+ ssn: {
25
+ pattern: '^\\d{3}-?\\d{2}-?\\d{4}$',
26
+ error: 'Enter a valid SSN (XXX-XX-XXXX)',
27
+ description: 'Social Security Number'
28
+ },
29
+ stateCode: {
30
+ pattern: '^[A-Z]{2}$',
31
+ error: 'Enter a 2-letter state code',
32
+ description: 'US state code'
33
+ },
34
+ currency: {
35
+ pattern: '^\\$?\\d{1,3}(,\\d{3})*(\\.\\d{2})?$',
36
+ error: 'Enter a valid dollar amount',
37
+ description: 'US currency'
38
+ },
39
+ routingNumber: {
40
+ pattern: '^\\d{9}$',
41
+ error: 'Enter a 9-digit routing number',
42
+ description: 'Bank routing number'
43
+ },
44
+ accountNumber: {
45
+ pattern: '^\\d{4,17}$',
46
+ error: 'Enter a valid account number',
47
+ description: 'Bank account number'
48
+ },
49
+ driversLicense: {
50
+ pattern: '^[A-Z0-9]{4,16}$',
51
+ error: 'Enter a valid driver\'s license number',
52
+ description: 'US driver\'s license (varies by state)'
53
+ },
54
+ ein: {
55
+ pattern: '^\\d{2}-?\\d{7}$',
56
+ error: 'Enter a valid EIN (XX-XXXXXXX)',
57
+ description: 'Employer Identification Number'
58
+ }
59
+ };
60
+
61
+ export const ARCHETYPES = {
62
+ phone: {
63
+ type: 'tel',
64
+ autocomplete: 'tel',
65
+ inputMode: 'tel',
66
+ placeholder: '(555) 555-5555',
67
+ pattern: PATTERNS.phone.pattern,
68
+ patternError: PATTERNS.phone.error,
69
+ pii: true
70
+ },
71
+ postalCode: {
72
+ type: 'text',
73
+ autocomplete: 'postal-code',
74
+ inputMode: 'numeric',
75
+ placeholder: '12345',
76
+ pattern: PATTERNS.postalCode.pattern,
77
+ patternError: PATTERNS.postalCode.error,
78
+ maxLength: 10
79
+ },
80
+ ssn: {
81
+ type: 'text',
82
+ inputMode: 'numeric',
83
+ placeholder: 'XXX-XX-XXXX',
84
+ pattern: PATTERNS.ssn.pattern,
85
+ patternError: PATTERNS.ssn.error,
86
+ pii: true,
87
+ sensitive: true,
88
+ helpText: 'Your Social Security Number will be kept secure'
89
+ },
90
+ state: {
91
+ type: 'dropdown',
92
+ autocomplete: 'address-level1',
93
+ options: [
94
+ { value: 'AL', label: 'Alabama' }, { value: 'AK', label: 'Alaska' },
95
+ { value: 'AZ', label: 'Arizona' }, { value: 'AR', label: 'Arkansas' },
96
+ { value: 'CA', label: 'California' }, { value: 'CO', label: 'Colorado' },
97
+ { value: 'CT', label: 'Connecticut' }, { value: 'DE', label: 'Delaware' },
98
+ { value: 'FL', label: 'Florida' }, { value: 'GA', label: 'Georgia' },
99
+ { value: 'HI', label: 'Hawaii' }, { value: 'ID', label: 'Idaho' },
100
+ { value: 'IL', label: 'Illinois' }, { value: 'IN', label: 'Indiana' },
101
+ { value: 'IA', label: 'Iowa' }, { value: 'KS', label: 'Kansas' },
102
+ { value: 'KY', label: 'Kentucky' }, { value: 'LA', label: 'Louisiana' },
103
+ { value: 'ME', label: 'Maine' }, { value: 'MD', label: 'Maryland' },
104
+ { value: 'MA', label: 'Massachusetts' }, { value: 'MI', label: 'Michigan' },
105
+ { value: 'MN', label: 'Minnesota' }, { value: 'MS', label: 'Mississippi' },
106
+ { value: 'MO', label: 'Missouri' }, { value: 'MT', label: 'Montana' },
107
+ { value: 'NE', label: 'Nebraska' }, { value: 'NV', label: 'Nevada' },
108
+ { value: 'NH', label: 'New Hampshire' }, { value: 'NJ', label: 'New Jersey' },
109
+ { value: 'NM', label: 'New Mexico' }, { value: 'NY', label: 'New York' },
110
+ { value: 'NC', label: 'North Carolina' }, { value: 'ND', label: 'North Dakota' },
111
+ { value: 'OH', label: 'Ohio' }, { value: 'OK', label: 'Oklahoma' },
112
+ { value: 'OR', label: 'Oregon' }, { value: 'PA', label: 'Pennsylvania' },
113
+ { value: 'RI', label: 'Rhode Island' }, { value: 'SC', label: 'South Carolina' },
114
+ { value: 'SD', label: 'South Dakota' }, { value: 'TN', label: 'Tennessee' },
115
+ { value: 'TX', label: 'Texas' }, { value: 'UT', label: 'Utah' },
116
+ { value: 'VT', label: 'Vermont' }, { value: 'VA', label: 'Virginia' },
117
+ { value: 'WA', label: 'Washington' }, { value: 'WV', label: 'West Virginia' },
118
+ { value: 'WI', label: 'Wisconsin' }, { value: 'WY', label: 'Wyoming' },
119
+ { value: 'DC', label: 'District of Columbia' }
120
+ ]
121
+ },
122
+ currency: {
123
+ type: 'text',
124
+ inputMode: 'decimal',
125
+ placeholder: '$0.00',
126
+ pattern: PATTERNS.currency.pattern,
127
+ patternError: PATTERNS.currency.error
128
+ }
129
+ };
130
+
131
+ /**
132
+ * US-specific field name mappings
133
+ */
134
+ export const FIELD_LABELS = {
135
+ postalCode: 'ZIP Code',
136
+ state: 'State',
137
+ nationalId: 'Social Security Number (SSN)'
138
+ };