@oneuptime/common 14.0.98 → 14.0.100

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 (1042) hide show
  1. package/Models/AnalyticsModels/ExceptionInstance.d.mts +2 -0
  2. package/Models/AnalyticsModels/ExceptionInstance.d.ts +2 -0
  3. package/Models/AnalyticsModels/ExceptionInstance.js +31 -0
  4. package/Models/AnalyticsModels/LogCountBaseline.d.mts +6 -0
  5. package/Models/AnalyticsModels/LogCountBaseline.d.ts +6 -0
  6. package/Models/AnalyticsModels/LogCountBaseline.js +7 -1
  7. package/Models/AnalyticsModels/MetricBaselineHourly.d.mts +11 -6
  8. package/Models/AnalyticsModels/MetricBaselineHourly.d.ts +11 -6
  9. package/Models/AnalyticsModels/MetricBaselineHourly.js +12 -7
  10. package/Models/AnalyticsModels/RumSessionChunk.js +1 -1
  11. package/Models/AnalyticsModels/SpanCountBaseline.d.mts +17 -9
  12. package/Models/AnalyticsModels/SpanCountBaseline.d.ts +17 -9
  13. package/Models/AnalyticsModels/SpanCountBaseline.js +18 -10
  14. package/Models/DatabaseModels/CloudAccount.d.mts +8 -0
  15. package/Models/DatabaseModels/CloudAccount.d.ts +8 -0
  16. package/Models/DatabaseModels/CloudAccount.js +167 -0
  17. package/Models/DatabaseModels/CloudAccountFeed.d.mts +27 -0
  18. package/Models/DatabaseModels/CloudAccountFeed.d.ts +27 -0
  19. package/Models/DatabaseModels/CloudAccountFeed.js +557 -0
  20. package/Models/DatabaseModels/CloudAccountFeed.mjs +3 -0
  21. package/Models/DatabaseModels/CloudApp.d.mts +27 -0
  22. package/Models/DatabaseModels/CloudApp.d.ts +27 -0
  23. package/Models/DatabaseModels/CloudApp.js +414 -0
  24. package/Models/DatabaseModels/CloudApp.mjs +2 -0
  25. package/Models/DatabaseModels/CloudAppRevision.d.mts +23 -0
  26. package/Models/DatabaseModels/CloudAppRevision.d.ts +23 -0
  27. package/Models/DatabaseModels/CloudAppRevision.js +351 -0
  28. package/Models/DatabaseModels/CloudAppRevision.mjs +2 -0
  29. package/Models/DatabaseModels/CloudResourceFeed.d.mts +4 -1
  30. package/Models/DatabaseModels/CloudResourceFeed.d.ts +4 -1
  31. package/Models/DatabaseModels/CloudResourceFeed.js +17 -1
  32. package/Models/DatabaseModels/CloudResourceFeed.mjs +1 -0
  33. package/Models/DatabaseModels/CloudResourceInstance.d.mts +4 -0
  34. package/Models/DatabaseModels/CloudResourceInstance.d.ts +4 -0
  35. package/Models/DatabaseModels/CloudResourceInstance.js +60 -1
  36. package/Models/DatabaseModels/CloudResourceLabelRule.d.mts +2 -0
  37. package/Models/DatabaseModels/CloudResourceLabelRule.d.ts +2 -0
  38. package/Models/DatabaseModels/CloudResourceLabelRule.js +44 -1
  39. package/Models/DatabaseModels/CloudResourceOwnerRule.d.mts +2 -0
  40. package/Models/DatabaseModels/CloudResourceOwnerRule.d.ts +2 -0
  41. package/Models/DatabaseModels/CloudResourceOwnerRule.js +44 -1
  42. package/Models/DatabaseModels/Dashboard.d.mts +2 -0
  43. package/Models/DatabaseModels/Dashboard.d.ts +2 -0
  44. package/Models/DatabaseModels/Dashboard.js +88 -0
  45. package/Models/DatabaseModels/DataSecurityCheckSetting.d.mts +17 -0
  46. package/Models/DatabaseModels/DataSecurityCheckSetting.d.ts +17 -0
  47. package/Models/DatabaseModels/DataSecurityCheckSetting.js +304 -0
  48. package/Models/DatabaseModels/DataSecurityCheckSetting.mjs +2 -0
  49. package/Models/DatabaseModels/DataSecurityCustomDataType.d.mts +25 -0
  50. package/Models/DatabaseModels/DataSecurityCustomDataType.d.ts +25 -0
  51. package/Models/DatabaseModels/DataSecurityCustomDataType.js +431 -0
  52. package/Models/DatabaseModels/DataSecurityCustomDataType.mjs +2 -0
  53. package/Models/DatabaseModels/DataSecurityFlow.d.mts +26 -0
  54. package/Models/DatabaseModels/DataSecurityFlow.d.ts +26 -0
  55. package/Models/DatabaseModels/DataSecurityFlow.js +456 -0
  56. package/Models/DatabaseModels/DataSecurityFlow.mjs +2 -0
  57. package/Models/DatabaseModels/DataSecurityIdentity.d.mts +29 -0
  58. package/Models/DatabaseModels/DataSecurityIdentity.d.ts +29 -0
  59. package/Models/DatabaseModels/DataSecurityIdentity.js +535 -0
  60. package/Models/DatabaseModels/DataSecurityIdentity.mjs +2 -0
  61. package/Models/DatabaseModels/DataSecurityIssue.d.mts +49 -0
  62. package/Models/DatabaseModels/DataSecurityIssue.d.ts +49 -0
  63. package/Models/DatabaseModels/DataSecurityIssue.js +797 -0
  64. package/Models/DatabaseModels/DataSecurityIssue.mjs +2 -0
  65. package/Models/DatabaseModels/DataSecurityIssueFeed.d.mts +43 -0
  66. package/Models/DatabaseModels/DataSecurityIssueFeed.d.ts +43 -0
  67. package/Models/DatabaseModels/DataSecurityIssueFeed.js +382 -0
  68. package/Models/DatabaseModels/DataSecurityIssueFeed.mjs +3 -0
  69. package/Models/DatabaseModels/DataSecurityResidencyRule.d.mts +18 -0
  70. package/Models/DatabaseModels/DataSecurityResidencyRule.d.ts +18 -0
  71. package/Models/DatabaseModels/DataSecurityResidencyRule.js +331 -0
  72. package/Models/DatabaseModels/DataSecurityResidencyRule.mjs +2 -0
  73. package/Models/DatabaseModels/DataSecurityScan.d.mts +29 -0
  74. package/Models/DatabaseModels/DataSecurityScan.d.ts +29 -0
  75. package/Models/DatabaseModels/DataSecurityScan.js +520 -0
  76. package/Models/DatabaseModels/DataSecurityScan.mjs +2 -0
  77. package/Models/DatabaseModels/DataSecuritySetting.d.mts +35 -0
  78. package/Models/DatabaseModels/DataSecuritySetting.d.ts +35 -0
  79. package/Models/DatabaseModels/DataSecuritySetting.js +631 -0
  80. package/Models/DatabaseModels/DataSecuritySetting.mjs +2 -0
  81. package/Models/DatabaseModels/DataStore.d.mts +84 -0
  82. package/Models/DatabaseModels/DataStore.d.ts +84 -0
  83. package/Models/DatabaseModels/DataStore.js +1359 -0
  84. package/Models/DatabaseModels/DataStore.mjs +2 -0
  85. package/Models/DatabaseModels/DataStoreAccess.d.mts +23 -0
  86. package/Models/DatabaseModels/DataStoreAccess.d.ts +23 -0
  87. package/Models/DatabaseModels/DataStoreAccess.js +427 -0
  88. package/Models/DatabaseModels/DataStoreAccess.mjs +2 -0
  89. package/Models/DatabaseModels/DataStoreFeed.d.mts +36 -0
  90. package/Models/DatabaseModels/DataStoreFeed.d.ts +36 -0
  91. package/Models/DatabaseModels/DataStoreFeed.js +613 -0
  92. package/Models/DatabaseModels/DataStoreFeed.mjs +3 -0
  93. package/Models/DatabaseModels/DataStoreFinding.d.mts +41 -0
  94. package/Models/DatabaseModels/DataStoreFinding.d.ts +41 -0
  95. package/Models/DatabaseModels/DataStoreFinding.js +745 -0
  96. package/Models/DatabaseModels/DataStoreFinding.mjs +2 -0
  97. package/Models/DatabaseModels/DataStoreLabelRule.d.mts +21 -0
  98. package/Models/DatabaseModels/DataStoreLabelRule.d.ts +21 -0
  99. package/Models/DatabaseModels/DataStoreLabelRule.js +623 -0
  100. package/Models/DatabaseModels/DataStoreLabelRule.mjs +2 -0
  101. package/Models/DatabaseModels/DataStoreOwnerRule.d.mts +24 -0
  102. package/Models/DatabaseModels/DataStoreOwnerRule.d.ts +24 -0
  103. package/Models/DatabaseModels/DataStoreOwnerRule.js +714 -0
  104. package/Models/DatabaseModels/DataStoreOwnerRule.mjs +2 -0
  105. package/Models/DatabaseModels/DataStoreOwnerTeam.d.mts +19 -0
  106. package/Models/DatabaseModels/DataStoreOwnerTeam.d.ts +19 -0
  107. package/Models/DatabaseModels/DataStoreOwnerTeam.js +477 -0
  108. package/Models/DatabaseModels/DataStoreOwnerTeam.mjs +2 -0
  109. package/Models/DatabaseModels/DataStoreOwnerUser.d.mts +18 -0
  110. package/Models/DatabaseModels/DataStoreOwnerUser.d.ts +18 -0
  111. package/Models/DatabaseModels/DataStoreOwnerUser.js +476 -0
  112. package/Models/DatabaseModels/DataStoreOwnerUser.mjs +2 -0
  113. package/Models/DatabaseModels/DetectionRule.d.mts +1 -0
  114. package/Models/DatabaseModels/DetectionRule.d.ts +1 -0
  115. package/Models/DatabaseModels/DetectionRule.js +31 -0
  116. package/Models/DatabaseModels/ExceptionSavedView.d.mts +16 -0
  117. package/Models/DatabaseModels/ExceptionSavedView.d.ts +16 -0
  118. package/Models/DatabaseModels/ExceptionSavedView.js +413 -0
  119. package/Models/DatabaseModels/ExceptionSavedView.mjs +2 -0
  120. package/Models/DatabaseModels/FormDomain.d.mts +28 -0
  121. package/Models/DatabaseModels/FormDomain.d.ts +28 -0
  122. package/Models/DatabaseModels/FormDomain.js +598 -0
  123. package/Models/DatabaseModels/FormDomain.mjs +2 -0
  124. package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
  125. package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
  126. package/Models/DatabaseModels/GlobalConfig.js +110 -0
  127. package/Models/DatabaseModels/IncidentEpisodeRoleMember.js +10 -1
  128. package/Models/DatabaseModels/Index.js +47 -0
  129. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.d.mts +2 -1
  130. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.d.ts +2 -1
  131. package/Models/DatabaseModels/NetworkEndpoint.d.mts +2 -0
  132. package/Models/DatabaseModels/NetworkEndpoint.d.ts +2 -0
  133. package/Models/DatabaseModels/NetworkEndpoint.js +62 -1
  134. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +1 -0
  135. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +1 -0
  136. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +43 -0
  137. package/Models/DatabaseModels/ProxmoxCluster.d.mts +2 -0
  138. package/Models/DatabaseModels/ProxmoxCluster.d.ts +2 -0
  139. package/Models/DatabaseModels/ProxmoxCluster.js +66 -0
  140. package/Models/DatabaseModels/ProxmoxResource.d.mts +13 -0
  141. package/Models/DatabaseModels/ProxmoxResource.d.ts +13 -0
  142. package/Models/DatabaseModels/ProxmoxResource.js +292 -0
  143. package/Models/DatabaseModels/ResourceAiAgent.js +3 -1
  144. package/Models/DatabaseModels/SecurityEntityCriticality.js +7 -6
  145. package/Models/DatabaseModels/SecurityEntityRisk.js +2 -2
  146. package/Models/DatabaseModels/StatusPageSubscriber.d.mts +1 -0
  147. package/Models/DatabaseModels/StatusPageSubscriber.d.ts +1 -0
  148. package/Models/DatabaseModels/StatusPageSubscriber.js +52 -0
  149. package/Models/DatabaseModels/TelemetryException.d.mts +10 -0
  150. package/Models/DatabaseModels/TelemetryException.d.ts +10 -0
  151. package/Models/DatabaseModels/TelemetryException.js +353 -8
  152. package/Models/DatabaseModels/TelemetryExceptionActivity.d.mts +42 -0
  153. package/Models/DatabaseModels/TelemetryExceptionActivity.d.ts +42 -0
  154. package/Models/DatabaseModels/TelemetryExceptionActivity.js +527 -0
  155. package/Models/DatabaseModels/TelemetryExceptionActivity.mjs +3 -0
  156. package/Server/Services/DatabaseService.d.mts +10 -0
  157. package/Server/Services/DatabaseService.d.ts +10 -0
  158. package/Types/AI/AIChatPageContext.d.mts +4 -1
  159. package/Types/AI/AIChatPageContext.d.ts +4 -1
  160. package/Types/AI/AIChatPageContext.js +7 -0
  161. package/Types/AI/AIChatTypes.d.mts +6 -1
  162. package/Types/AI/AIChatTypes.d.ts +6 -1
  163. package/Types/AI/AIChatTypes.js +9 -0
  164. package/Types/AI/AIResourceContext.d.mts +2 -0
  165. package/Types/AI/AIResourceContext.d.ts +2 -0
  166. package/Types/AI/AIResourceContext.js +5 -0
  167. package/Types/AI/AiAffectedResources.js +5 -3
  168. package/Types/AI/CodeFixTaskContext.d.mts +21 -0
  169. package/Types/AI/CodeFixTaskContext.d.ts +21 -0
  170. package/Types/AI/CodeFixTaskContext.js +61 -4
  171. package/Types/AI/CodeFixTaskContext.mjs +2 -0
  172. package/Types/AI/CodeTask.d.mts +2 -0
  173. package/Types/AI/CodeTask.d.ts +2 -0
  174. package/Types/AI/CodeTask.js +4 -0
  175. package/Types/AI/ResourceAiAccessApi.d.mts +1 -0
  176. package/Types/AI/ResourceAiAccessApi.d.ts +1 -0
  177. package/Types/AI/ResourceAiAccessPermissions.js +6 -0
  178. package/Types/Analytics/CookieConsent.d.mts +1 -0
  179. package/Types/Analytics/CookieConsent.d.ts +1 -0
  180. package/Types/Analytics/CookieConsent.js +10 -0
  181. package/Types/Analytics/CookieConsent.mjs +2 -0
  182. package/Types/AutoRemediation/AiRemediationCommandPlan.d.mts +19 -0
  183. package/Types/AutoRemediation/AiRemediationCommandPlan.d.ts +19 -0
  184. package/Types/AutoRemediation/AiRemediationCommandPlan.js +85 -10
  185. package/Types/AutoRemediation/AiRemediationCommandPlan.mjs +4 -0
  186. package/Types/AutoRemediation/RemediationTryAgain.d.mts +17 -0
  187. package/Types/AutoRemediation/RemediationTryAgain.d.ts +17 -0
  188. package/Types/AutoRemediation/RemediationTryAgain.js +104 -0
  189. package/Types/AutoRemediation/RemediationTryAgain.mjs +6 -0
  190. package/Types/BaseDatabase/AggregateBy.d.mts +13 -0
  191. package/Types/BaseDatabase/AggregateBy.d.ts +13 -0
  192. package/Types/Billing/SubscriptionPlanPricing.d.mts +2 -0
  193. package/Types/Billing/SubscriptionPlanPricing.d.ts +2 -0
  194. package/Types/Billing/SubscriptionPlanPricing.js +30 -0
  195. package/Types/Billing/SubscriptionPlanPricing.mjs +2 -0
  196. package/Types/Cloud/CloudPlatform.d.mts +3 -0
  197. package/Types/Cloud/CloudPlatform.d.ts +3 -0
  198. package/Types/Cloud/CloudPlatform.js +50 -0
  199. package/Types/Cloud/CloudResourceKind.d.mts +11 -0
  200. package/Types/Cloud/CloudResourceKind.d.ts +11 -0
  201. package/Types/Cloud/CloudResourceKind.js +78 -9
  202. package/Types/Cloud/CloudResourceKind.mjs +5 -0
  203. package/Types/CloudConnection/CloudAiAgentCost.d.mts +19 -0
  204. package/Types/CloudConnection/CloudAiAgentCost.d.ts +19 -0
  205. package/Types/CloudConnection/CloudAiAgentCost.js +95 -0
  206. package/Types/CloudConnection/CloudAiAgentCost.mjs +15 -0
  207. package/Types/CloudConnection/CloudAiAgentSetupCommands.d.mts +70 -0
  208. package/Types/CloudConnection/CloudAiAgentSetupCommands.d.ts +70 -0
  209. package/Types/CloudConnection/CloudAiAgentSetupCommands.js +1107 -0
  210. package/Types/CloudConnection/CloudAiAgentSetupCommands.mjs +37 -0
  211. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +8 -0
  212. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +8 -0
  213. package/Types/CloudConnection/CloudConnectionCatalog.js +77 -1
  214. package/Types/CloudConnection/CloudConnectionCatalog.mjs +6 -0
  215. package/Types/CloudConnection/CloudConnectionSetupCommands.d.mts +48 -4
  216. package/Types/CloudConnection/CloudConnectionSetupCommands.d.ts +48 -4
  217. package/Types/CloudConnection/CloudConnectionSetupCommands.js +432 -16
  218. package/Types/CloudConnection/CloudConnectionSetupCommands.mjs +21 -0
  219. package/Types/CodeRepository/CodeHost.d.mts +2 -1
  220. package/Types/CodeRepository/CodeHost.d.ts +2 -1
  221. package/Types/CodeRepository/CodeHost.js +12 -5
  222. package/Types/CodeRepository/ProductionReview.d.mts +7 -0
  223. package/Types/CodeRepository/ProductionReview.d.ts +7 -0
  224. package/Types/CodeRepository/ProductionReview.js +67 -1
  225. package/Types/CodeRepository/ProductionReview.mjs +1 -0
  226. package/Types/CustomField/CustomFieldFile.d.mts +69 -0
  227. package/Types/CustomField/CustomFieldFile.d.ts +69 -0
  228. package/Types/CustomField/CustomFieldFile.js +235 -0
  229. package/Types/CustomField/CustomFieldFile.mjs +16 -0
  230. package/Types/CustomField/CustomFieldRecordKinds.d.mts +25 -0
  231. package/Types/CustomField/CustomFieldRecordKinds.d.ts +25 -0
  232. package/Types/CustomField/CustomFieldRecordKinds.js +111 -0
  233. package/Types/CustomField/CustomFieldRecordKinds.mjs +6 -0
  234. package/Types/CustomField/CustomFieldType.d.mts +15 -1
  235. package/Types/CustomField/CustomFieldType.d.ts +15 -1
  236. package/Types/CustomField/CustomFieldType.js +14 -0
  237. package/Types/CustomField/CustomFieldValueFormat.d.mts +3 -2
  238. package/Types/CustomField/CustomFieldValueFormat.d.ts +3 -2
  239. package/Types/CustomField/CustomFieldValueFormat.js +8 -2
  240. package/Types/CustomField/CustomFieldValueMapping.js +31 -2
  241. package/Types/CustomField/CustomFieldValueValidator.js +41 -1
  242. package/Types/Dashboard/DashboardLanguage.d.mts +1 -0
  243. package/Types/Dashboard/DashboardLanguage.d.ts +1 -0
  244. package/Types/Dashboard/DashboardLanguage.js +7 -1
  245. package/Types/Dashboard/DashboardLanguage.mjs +1 -0
  246. package/Types/Dashboard/DashboardTemplateFallbackHints.d.mts +4 -0
  247. package/Types/Dashboard/DashboardTemplateFallbackHints.d.ts +4 -0
  248. package/Types/Dashboard/DashboardTemplateFallbackHints.js +42 -0
  249. package/Types/Dashboard/DashboardTemplateFallbackHints.mjs +4 -0
  250. package/Types/Dashboard/DashboardTemplates.js +34 -11
  251. package/Types/DataSecurity/ComplianceFramework.d.mts +21 -0
  252. package/Types/DataSecurity/ComplianceFramework.d.ts +21 -0
  253. package/Types/DataSecurity/ComplianceFramework.js +97 -0
  254. package/Types/DataSecurity/ComplianceFramework.mjs +5 -0
  255. package/Types/DataSecurity/ComplianceRequirementCatalog.d.mts +41 -0
  256. package/Types/DataSecurity/ComplianceRequirementCatalog.d.ts +41 -0
  257. package/Types/DataSecurity/ComplianceRequirementCatalog.js +203 -0
  258. package/Types/DataSecurity/ComplianceRequirementCatalog.mjs +7 -0
  259. package/Types/DataSecurity/DataCategory.d.mts +15 -0
  260. package/Types/DataSecurity/DataCategory.d.ts +15 -0
  261. package/Types/DataSecurity/DataCategory.js +61 -0
  262. package/Types/DataSecurity/DataCategory.mjs +7 -0
  263. package/Types/DataSecurity/DataConfidence.d.mts +11 -0
  264. package/Types/DataSecurity/DataConfidence.d.ts +11 -0
  265. package/Types/DataSecurity/DataConfidence.js +49 -0
  266. package/Types/DataSecurity/DataConfidence.mjs +7 -0
  267. package/Types/DataSecurity/DataSecurityApiTypes.d.mts +106 -0
  268. package/Types/DataSecurity/DataSecurityApiTypes.d.ts +106 -0
  269. package/Types/DataSecurity/DataSecurityApiTypes.js +53 -0
  270. package/Types/DataSecurity/DataSecurityApiTypes.mjs +3 -0
  271. package/Types/DataSecurity/DataSecurityCheckCatalog.d.mts +94 -0
  272. package/Types/DataSecurity/DataSecurityCheckCatalog.d.ts +94 -0
  273. package/Types/DataSecurity/DataSecurityCheckCatalog.js +1236 -0
  274. package/Types/DataSecurity/DataSecurityCheckCatalog.mjs +10 -0
  275. package/Types/DataSecurity/DataSecurityIdentity.d.mts +27 -0
  276. package/Types/DataSecurity/DataSecurityIdentity.d.ts +27 -0
  277. package/Types/DataSecurity/DataSecurityIdentity.js +160 -0
  278. package/Types/DataSecurity/DataSecurityIdentity.mjs +14 -0
  279. package/Types/DataSecurity/DataSecurityIssueStatus.d.mts +10 -0
  280. package/Types/DataSecurity/DataSecurityIssueStatus.d.ts +10 -0
  281. package/Types/DataSecurity/DataSecurityIssueStatus.js +38 -0
  282. package/Types/DataSecurity/DataSecurityIssueStatus.mjs +5 -0
  283. package/Types/DataSecurity/DataSecurityResidency.d.mts +21 -0
  284. package/Types/DataSecurity/DataSecurityResidency.d.ts +21 -0
  285. package/Types/DataSecurity/DataSecurityResidency.js +92 -0
  286. package/Types/DataSecurity/DataSecurityResidency.mjs +5 -0
  287. package/Types/DataSecurity/DataSecurityResponseAction.d.mts +22 -0
  288. package/Types/DataSecurity/DataSecurityResponseAction.d.ts +22 -0
  289. package/Types/DataSecurity/DataSecurityResponseAction.js +202 -0
  290. package/Types/DataSecurity/DataSecurityResponseAction.mjs +13 -0
  291. package/Types/DataSecurity/DataSecurityRisk.d.mts +38 -0
  292. package/Types/DataSecurity/DataSecurityRisk.d.ts +38 -0
  293. package/Types/DataSecurity/DataSecurityRisk.js +138 -0
  294. package/Types/DataSecurity/DataSecurityRisk.mjs +7 -0
  295. package/Types/DataSecurity/DataSensitivity.d.mts +13 -0
  296. package/Types/DataSecurity/DataSensitivity.d.ts +13 -0
  297. package/Types/DataSecurity/DataSensitivity.js +68 -0
  298. package/Types/DataSecurity/DataSensitivity.mjs +8 -0
  299. package/Types/DataSecurity/DataStoreAccess.d.mts +34 -0
  300. package/Types/DataSecurity/DataStoreAccess.d.ts +34 -0
  301. package/Types/DataSecurity/DataStoreAccess.js +57 -0
  302. package/Types/DataSecurity/DataStoreAccess.mjs +6 -0
  303. package/Types/DataSecurity/DataStoreEnvironment.d.mts +11 -0
  304. package/Types/DataSecurity/DataStoreEnvironment.d.ts +11 -0
  305. package/Types/DataSecurity/DataStoreEnvironment.js +80 -0
  306. package/Types/DataSecurity/DataStoreEnvironment.mjs +5 -0
  307. package/Types/DataSecurity/DataStoreKey.d.mts +18 -0
  308. package/Types/DataSecurity/DataStoreKey.d.ts +18 -0
  309. package/Types/DataSecurity/DataStoreKey.js +49 -0
  310. package/Types/DataSecurity/DataStoreKey.mjs +7 -0
  311. package/Types/DataSecurity/DataStoreKind.d.mts +67 -0
  312. package/Types/DataSecurity/DataStoreKind.d.ts +67 -0
  313. package/Types/DataSecurity/DataStoreKind.js +230 -0
  314. package/Types/DataSecurity/DataStoreKind.mjs +10 -0
  315. package/Types/DataSecurity/DataStorePosture.d.mts +40 -0
  316. package/Types/DataSecurity/DataStorePosture.d.ts +40 -0
  317. package/Types/DataSecurity/DataStorePosture.js +100 -0
  318. package/Types/DataSecurity/DataStorePosture.mjs +7 -0
  319. package/Types/DataSecurity/DataTypeCatalog.d.mts +17 -0
  320. package/Types/DataSecurity/DataTypeCatalog.d.ts +17 -0
  321. package/Types/DataSecurity/DataTypeCatalog.js +434 -0
  322. package/Types/DataSecurity/DataTypeCatalog.mjs +4 -0
  323. package/Types/Date.d.mts +30 -1
  324. package/Types/Date.d.ts +30 -1
  325. package/Types/Date.js +173 -5
  326. package/Types/Email/EmailMessage.d.mts +1 -0
  327. package/Types/Email/EmailMessage.d.ts +1 -0
  328. package/Types/Email/EmailTemplateType.d.mts +1 -0
  329. package/Types/Email/EmailTemplateType.d.ts +1 -0
  330. package/Types/Email/EmailTemplateType.js +6 -0
  331. package/Types/Episode/EpisodeMembersAdd.d.mts +2 -0
  332. package/Types/Episode/EpisodeMembersAdd.d.ts +2 -0
  333. package/Types/Episode/EpisodeMembersAdd.js +9 -1
  334. package/Types/Episode/EpisodeMembersAdd.mjs +2 -0
  335. package/Types/File/FileContentCheck.d.mts +13 -0
  336. package/Types/File/FileContentCheck.d.ts +13 -0
  337. package/Types/File/FileContentCheck.js +301 -0
  338. package/Types/File/FileContentCheck.mjs +4 -0
  339. package/Types/File/FileSize.d.mts +3 -0
  340. package/Types/File/FileSize.d.ts +3 -0
  341. package/Types/File/FileSize.js +30 -0
  342. package/Types/File/FileSize.mjs +3 -0
  343. package/Types/File/FileTypeIcon.d.mts +4 -0
  344. package/Types/File/FileTypeIcon.d.ts +4 -0
  345. package/Types/File/FileTypeIcon.js +26 -0
  346. package/Types/File/FileTypeIcon.mjs +3 -0
  347. package/Types/File/MimeTypeLabel.d.mts +3 -0
  348. package/Types/File/MimeTypeLabel.d.ts +3 -0
  349. package/Types/File/MimeTypeLabel.js +39 -0
  350. package/Types/File/MimeTypeLabel.mjs +3 -0
  351. package/Types/Form/FormCustomDomain.d.mts +19 -0
  352. package/Types/Form/FormCustomDomain.d.ts +19 -0
  353. package/Types/Form/FormCustomDomain.js +86 -0
  354. package/Types/Form/FormCustomDomain.mjs +13 -0
  355. package/Types/Form/FormField.js +6 -0
  356. package/Types/Form/FormFileAnswer.d.mts +34 -0
  357. package/Types/Form/FormFileAnswer.d.ts +34 -0
  358. package/Types/Form/FormFileAnswer.js +203 -0
  359. package/Types/Form/FormFileAnswer.mjs +10 -0
  360. package/Types/Form/FormPublic.d.mts +16 -1
  361. package/Types/Form/FormPublic.d.ts +16 -1
  362. package/Types/Form/FormPublic.js +184 -2
  363. package/Types/Form/FormPublic.mjs +5 -0
  364. package/Types/Form/FormSubmissionAnswer.js +29 -0
  365. package/Types/InstallScripts/InstallScripts.d.mts +28 -0
  366. package/Types/InstallScripts/InstallScripts.d.ts +28 -0
  367. package/Types/InstallScripts/InstallScripts.js +225 -0
  368. package/Types/InstallScripts/InstallScripts.mjs +11 -0
  369. package/Types/Kubernetes/KubernetesClusterProvider.d.mts +10 -0
  370. package/Types/Kubernetes/KubernetesClusterProvider.d.ts +10 -0
  371. package/Types/Kubernetes/KubernetesClusterProvider.js +95 -0
  372. package/Types/Kubernetes/KubernetesClusterProvider.mjs +8 -0
  373. package/Types/Kubernetes/KubernetesInventoryExtractor.js +23 -16
  374. package/Types/Kubernetes/KubernetesObjectParser.d.mts +24 -0
  375. package/Types/Kubernetes/KubernetesObjectParser.d.ts +24 -0
  376. package/Types/Kubernetes/KubernetesObjectParser.js +64 -0
  377. package/Types/Kubernetes/KubernetesObjectParser.mjs +3 -0
  378. package/Types/Kubernetes/OpenShiftObjectAttributes.d.mts +20 -0
  379. package/Types/Kubernetes/OpenShiftObjectAttributes.d.ts +20 -0
  380. package/Types/Kubernetes/OpenShiftObjectAttributes.js +124 -0
  381. package/Types/Kubernetes/OpenShiftObjectAttributes.mjs +5 -0
  382. package/Types/Kubernetes/OpenShiftObjectParser.d.mts +140 -0
  383. package/Types/Kubernetes/OpenShiftObjectParser.d.ts +140 -0
  384. package/Types/Kubernetes/OpenShiftObjectParser.js +436 -0
  385. package/Types/Kubernetes/OpenShiftObjectParser.mjs +22 -0
  386. package/Types/Metrics/MetricQueryConfigData.d.mts +2 -0
  387. package/Types/Metrics/MetricQueryConfigData.d.ts +2 -0
  388. package/Types/Metrics/MetricQueryFallback.d.mts +10 -0
  389. package/Types/Metrics/MetricQueryFallback.d.ts +10 -0
  390. package/Types/Metrics/MetricQueryFallback.js +2 -0
  391. package/Types/Metrics/MetricQueryFallback.mjs +1 -0
  392. package/Types/Monitor/CephAlertTemplates.d.mts +4 -3
  393. package/Types/Monitor/CephAlertTemplates.d.ts +4 -3
  394. package/Types/Monitor/CephAlertTemplates.js +63 -11
  395. package/Types/Monitor/CephAlertTemplates.mjs +1 -0
  396. package/Types/Monitor/CephMetricCatalog.d.mts +2 -0
  397. package/Types/Monitor/CephMetricCatalog.d.ts +2 -0
  398. package/Types/Monitor/CephMetricCatalog.js +72 -29
  399. package/Types/Monitor/CephMetricCatalog.mjs +2 -0
  400. package/Types/Monitor/CriteriaFilter.d.mts +17 -0
  401. package/Types/Monitor/CriteriaFilter.d.ts +17 -0
  402. package/Types/Monitor/CriteriaFilter.js +23 -1
  403. package/Types/Monitor/CriteriaFilter.mjs +3 -0
  404. package/Types/Monitor/DockerAlertTemplates.d.mts +3 -1
  405. package/Types/Monitor/DockerAlertTemplates.d.ts +3 -1
  406. package/Types/Monitor/DockerAlertTemplates.js +159 -76
  407. package/Types/Monitor/DockerAlertTemplates.mjs +1 -0
  408. package/Types/Monitor/DockerMetricCatalog.d.mts +1 -0
  409. package/Types/Monitor/DockerMetricCatalog.d.ts +1 -0
  410. package/Types/Monitor/DockerMetricCatalog.js +42 -52
  411. package/Types/Monitor/DockerSwarmAlertTemplates.d.mts +2 -0
  412. package/Types/Monitor/DockerSwarmAlertTemplates.d.ts +2 -0
  413. package/Types/Monitor/DockerSwarmAlertTemplates.js +78 -10
  414. package/Types/Monitor/DockerSwarmAlertTemplates.mjs +1 -0
  415. package/Types/Monitor/DockerSwarmMetricCatalog.js +7 -4
  416. package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.d.mts +34 -0
  417. package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.d.ts +34 -0
  418. package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.js +170 -0
  419. package/Types/Monitor/ExceptionMonitor/ExceptionMonitorEvaluation.mjs +12 -0
  420. package/Types/Monitor/ExceptionMonitor/ExceptionMonitorResponse.d.mts +17 -0
  421. package/Types/Monitor/ExceptionMonitor/ExceptionMonitorResponse.d.ts +17 -0
  422. package/Types/Monitor/HostAlertTemplates.d.mts +2 -1
  423. package/Types/Monitor/HostAlertTemplates.d.ts +2 -1
  424. package/Types/Monitor/HostAlertTemplates.js +48 -0
  425. package/Types/Monitor/HostAlertTemplates.mjs +1 -0
  426. package/Types/Monitor/HostMetricCatalog.d.mts +2 -0
  427. package/Types/Monitor/HostMetricCatalog.d.ts +2 -0
  428. package/Types/Monitor/HostMetricCatalog.js +20 -11
  429. package/Types/Monitor/IotAlertTemplates.d.mts +2 -0
  430. package/Types/Monitor/IotAlertTemplates.d.ts +2 -0
  431. package/Types/Monitor/IotAlertTemplates.js +22 -7
  432. package/Types/Monitor/IotAlertTemplates.mjs +1 -0
  433. package/Types/Monitor/KubernetesAlertTemplates.d.mts +53 -2
  434. package/Types/Monitor/KubernetesAlertTemplates.d.ts +53 -2
  435. package/Types/Monitor/KubernetesAlertTemplates.js +475 -76
  436. package/Types/Monitor/KubernetesAlertTemplates.mjs +2 -0
  437. package/Types/Monitor/KubernetesMetricCatalog.d.mts +2 -1
  438. package/Types/Monitor/KubernetesMetricCatalog.d.ts +2 -1
  439. package/Types/Monitor/KubernetesMetricCatalog.js +74 -3
  440. package/Types/Monitor/LogMonitor/LogMonitorResponse.d.mts +1 -0
  441. package/Types/Monitor/LogMonitor/LogMonitorResponse.d.ts +1 -0
  442. package/Types/Monitor/MetricMonitor/MetricCriteriaContext.d.mts +24 -1
  443. package/Types/Monitor/MetricMonitor/MetricCriteriaContext.d.ts +24 -1
  444. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.d.mts +4 -4
  445. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.d.ts +4 -4
  446. package/Types/Monitor/MonitorCriteriaInstance.js +107 -10
  447. package/Types/Monitor/MonitorStep.js +50 -3
  448. package/Types/Monitor/MonitorStepCephMonitor.d.mts +1 -0
  449. package/Types/Monitor/MonitorStepCephMonitor.d.ts +1 -0
  450. package/Types/Monitor/MonitorStepDockerMonitor.d.mts +1 -0
  451. package/Types/Monitor/MonitorStepDockerMonitor.d.ts +1 -0
  452. package/Types/Monitor/MonitorStepDockerSwarmMonitor.d.mts +43 -11
  453. package/Types/Monitor/MonitorStepDockerSwarmMonitor.d.ts +43 -11
  454. package/Types/Monitor/MonitorStepDockerSwarmMonitor.js +68 -1
  455. package/Types/Monitor/MonitorStepDockerSwarmMonitor.mjs +1 -0
  456. package/Types/Monitor/MonitorStepExceptionMonitor.d.mts +1 -0
  457. package/Types/Monitor/MonitorStepExceptionMonitor.d.ts +1 -0
  458. package/Types/Monitor/MonitorStepExceptionMonitor.js +13 -2
  459. package/Types/Monitor/MonitorStepHostMonitor.d.mts +1 -0
  460. package/Types/Monitor/MonitorStepHostMonitor.d.ts +1 -0
  461. package/Types/Monitor/MonitorStepIoTMonitor.d.mts +9 -0
  462. package/Types/Monitor/MonitorStepIoTMonitor.d.ts +9 -0
  463. package/Types/Monitor/MonitorStepIoTMonitor.js +21 -0
  464. package/Types/Monitor/MonitorStepKubernetesMonitor.d.mts +16 -0
  465. package/Types/Monitor/MonitorStepKubernetesMonitor.d.ts +16 -0
  466. package/Types/Monitor/MonitorStepKubernetesMonitor.js +49 -1
  467. package/Types/Monitor/MonitorStepKubernetesMonitor.mjs +4 -0
  468. package/Types/Monitor/MonitorStepPodmanMonitor.d.mts +1 -0
  469. package/Types/Monitor/MonitorStepPodmanMonitor.d.ts +1 -0
  470. package/Types/Monitor/MonitorStepProxmoxMonitor.d.mts +5 -3
  471. package/Types/Monitor/MonitorStepProxmoxMonitor.d.ts +5 -3
  472. package/Types/Monitor/MonitorStepProxmoxMonitor.js +1 -1
  473. package/Types/Monitor/MonitorStepStorageArrayMonitor.d.mts +1 -0
  474. package/Types/Monitor/MonitorStepStorageArrayMonitor.d.ts +1 -0
  475. package/Types/Monitor/MonitorStepVMwareMonitor.d.mts +1 -0
  476. package/Types/Monitor/MonitorStepVMwareMonitor.d.ts +1 -0
  477. package/Types/Monitor/MonitorType.d.mts +1 -0
  478. package/Types/Monitor/MonitorType.d.ts +1 -0
  479. package/Types/Monitor/MonitorType.js +18 -0
  480. package/Types/Monitor/OpenShiftAlertTemplates.d.mts +29 -0
  481. package/Types/Monitor/OpenShiftAlertTemplates.d.ts +29 -0
  482. package/Types/Monitor/OpenShiftAlertTemplates.js +220 -0
  483. package/Types/Monitor/OpenShiftAlertTemplates.mjs +9 -0
  484. package/Types/Monitor/PodmanAlertTemplates.d.mts +3 -1
  485. package/Types/Monitor/PodmanAlertTemplates.d.ts +3 -1
  486. package/Types/Monitor/PodmanAlertTemplates.js +119 -36
  487. package/Types/Monitor/PodmanAlertTemplates.mjs +1 -0
  488. package/Types/Monitor/PodmanMetricCatalog.d.mts +1 -0
  489. package/Types/Monitor/PodmanMetricCatalog.d.ts +1 -0
  490. package/Types/Monitor/PodmanMetricCatalog.js +42 -52
  491. package/Types/Monitor/ProxmoxAlertTemplates.d.mts +2 -0
  492. package/Types/Monitor/ProxmoxAlertTemplates.d.ts +2 -0
  493. package/Types/Monitor/ProxmoxAlertTemplates.js +239 -4
  494. package/Types/Monitor/ProxmoxAlertTemplates.mjs +2 -0
  495. package/Types/Monitor/ProxmoxMetricCatalog.js +43 -22
  496. package/Types/Monitor/ProxmoxNotificationAlertTemplates.d.mts +24 -0
  497. package/Types/Monitor/ProxmoxNotificationAlertTemplates.d.ts +24 -0
  498. package/Types/Monitor/ProxmoxNotificationAlertTemplates.js +251 -0
  499. package/Types/Monitor/ProxmoxNotificationAlertTemplates.mjs +12 -0
  500. package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +71 -3
  501. package/Types/Monitor/Recommendation/MonitorRecommendationTypes.d.mts +1 -0
  502. package/Types/Monitor/Recommendation/MonitorRecommendationTypes.d.ts +1 -0
  503. package/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +23 -7
  504. package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.d.mts +19 -0
  505. package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.d.ts +19 -0
  506. package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js +50 -2
  507. package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.mjs +2 -0
  508. package/Types/Monitor/ServiceAlertTemplates.js +111 -3
  509. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.mts +2 -0
  510. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.d.ts +2 -0
  511. package/Types/Monitor/SnmpMonitor/NetworkDeviceAlertPack.js +31 -2
  512. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.mts +9 -0
  513. package/Types/Monitor/SnmpMonitor/NetworkTopology.d.ts +9 -0
  514. package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.d.mts +5 -0
  515. package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.d.ts +5 -0
  516. package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.js +2 -0
  517. package/Types/Monitor/SnmpMonitor/SnmpHardwareIdentity.mjs +1 -0
  518. package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.d.mts +27 -0
  519. package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.d.ts +27 -0
  520. package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.js +97 -0
  521. package/Types/Monitor/SnmpMonitor/SnmpVendorIdentity.mjs +4 -0
  522. package/Types/Monitor/StorageArrayAlertTemplates.d.mts +3 -1
  523. package/Types/Monitor/StorageArrayAlertTemplates.d.ts +3 -1
  524. package/Types/Monitor/StorageArrayAlertTemplates.js +77 -1
  525. package/Types/Monitor/StorageArrayAlertTemplates.mjs +1 -0
  526. package/Types/Monitor/StorageArrayMetricCatalog.js +10 -1
  527. package/Types/Monitor/TelemetryAlertRule.d.mts +8 -1
  528. package/Types/Monitor/TelemetryAlertRule.d.ts +8 -1
  529. package/Types/Monitor/TelemetryAlertRule.js +62 -35
  530. package/Types/Monitor/TraceMonitor/TraceMonitorResponse.d.mts +1 -0
  531. package/Types/Monitor/TraceMonitor/TraceMonitorResponse.d.ts +1 -0
  532. package/Types/Monitor/VMwareAlertTemplates.d.mts +3 -1
  533. package/Types/Monitor/VMwareAlertTemplates.d.ts +3 -1
  534. package/Types/Monitor/VMwareAlertTemplates.js +91 -19
  535. package/Types/Monitor/VMwareAlertTemplates.mjs +1 -0
  536. package/Types/NetworkController/NetworkControllerProvider.d.mts +1 -0
  537. package/Types/NetworkController/NetworkControllerProvider.d.ts +1 -0
  538. package/Types/NetworkController/NetworkControllerProvider.js +8 -0
  539. package/Types/NetworkController/NetworkControllerProvider.mjs +1 -0
  540. package/Types/NetworkController/NetworkControllerReadSummary.d.mts +3 -0
  541. package/Types/NetworkController/NetworkControllerReadSummary.d.ts +3 -0
  542. package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
  543. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +49 -2
  544. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +49 -2
  545. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +252 -17
  546. package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
  547. package/Types/NotificationSetting/NotificationEmailRollupCategory.d.mts +1 -0
  548. package/Types/NotificationSetting/NotificationEmailRollupCategory.d.ts +1 -0
  549. package/Types/NotificationSetting/NotificationEmailRollupCategory.js +9 -0
  550. package/Types/NotificationSetting/NotificationSettingEventType.d.mts +1 -0
  551. package/Types/NotificationSetting/NotificationSettingEventType.d.ts +1 -0
  552. package/Types/NotificationSetting/NotificationSettingEventType.js +8 -0
  553. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +44 -0
  554. package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +44 -0
  555. package/Types/OnCallDutyPolicy/OnCallPersonPage.js +171 -0
  556. package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +14 -0
  557. package/Types/Permission.d.mts +56 -0
  558. package/Types/Permission.d.ts +56 -0
  559. package/Types/Permission.js +601 -1
  560. package/Types/PrivateRecord/PrivateRecordHeld.d.mts +18 -0
  561. package/Types/PrivateRecord/PrivateRecordHeld.d.ts +18 -0
  562. package/Types/PrivateRecord/PrivateRecordHeld.js +101 -0
  563. package/Types/PrivateRecord/PrivateRecordHeld.mjs +2 -0
  564. package/Types/PrivateRecord/PrivateRecordParts.d.mts +14 -0
  565. package/Types/PrivateRecord/PrivateRecordParts.d.ts +14 -0
  566. package/Types/PrivateRecord/PrivateRecordParts.js +95 -0
  567. package/Types/PrivateRecord/PrivateRecordParts.mjs +4 -0
  568. package/Types/Probe/ProbeCapability.d.mts +2 -1
  569. package/Types/Probe/ProbeCapability.d.ts +2 -1
  570. package/Types/Probe/ProbeCapability.js +8 -0
  571. package/Types/ProviderLogo/ProviderLogo.d.mts +2 -0
  572. package/Types/ProviderLogo/ProviderLogo.d.ts +2 -0
  573. package/Types/ProviderLogo/ProviderLogo.js +4 -0
  574. package/Types/ReaderLanguage.d.mts +11 -0
  575. package/Types/ReaderLanguage.d.ts +11 -0
  576. package/Types/ReaderLanguage.js +173 -0
  577. package/Types/ReaderLanguage.mjs +12 -0
  578. package/Types/ReadingDirection.d.mts +4 -0
  579. package/Types/ReadingDirection.d.ts +4 -0
  580. package/Types/ReadingDirection.js +52 -1
  581. package/Types/ReadingDirection.mjs +4 -0
  582. package/Types/ResourceAiAgent/AiResourceType.d.mts +7 -1
  583. package/Types/ResourceAiAgent/AiResourceType.d.ts +7 -1
  584. package/Types/ResourceAiAgent/AiResourceType.js +76 -2
  585. package/Types/ResourceAiAgent/AiResourceType.mjs +3 -0
  586. package/Types/ResourceAiAgent/CloudAiAgentNames.d.mts +19 -0
  587. package/Types/ResourceAiAgent/CloudAiAgentNames.d.ts +19 -0
  588. package/Types/ResourceAiAgent/CloudAiAgentNames.js +75 -0
  589. package/Types/ResourceAiAgent/CloudAiAgentNames.mjs +16 -0
  590. package/Types/ResourceAiAgent/ResourceAiAccess.d.mts +12 -1
  591. package/Types/ResourceAiAgent/ResourceAiAccess.d.ts +12 -1
  592. package/Types/ResourceAiAgent/ResourceAiAccess.js +28 -1
  593. package/Types/ResourceAiAgent/ResourceAiAccess.mjs +6 -0
  594. package/Types/Rules/RuleCriteriaFieldRegistry.js +13 -0
  595. package/Types/Rules/RuleCriteriaSubject.d.mts +4 -1
  596. package/Types/Rules/RuleCriteriaSubject.d.ts +4 -1
  597. package/Types/Rules/RuleCriteriaSubject.js +19 -1
  598. package/Types/Rules/RuleCriteriaSubject.mjs +1 -0
  599. package/Types/Rules/RuleRun.d.mts +7 -1
  600. package/Types/Rules/RuleRun.d.ts +7 -1
  601. package/Types/Rules/RuleRun.js +14 -2
  602. package/Types/Rum/SessionReplay.d.mts +1 -0
  603. package/Types/Rum/SessionReplay.d.ts +1 -0
  604. package/Types/Rum/SessionReplay.js +4 -2
  605. package/Types/Rum/SessionReplay.mjs +1 -0
  606. package/Types/Rum/UserFlow.d.mts +11 -0
  607. package/Types/Rum/UserFlow.d.ts +11 -0
  608. package/Types/Rum/UserFlow.js +27 -12
  609. package/Types/SecurityCase/SecurityCaseContext.d.mts +33 -1
  610. package/Types/SecurityCase/SecurityCaseContext.d.ts +33 -1
  611. package/Types/SecurityCase/SecurityCaseContext.js +6 -1
  612. package/Types/SecurityCase/SecurityCaseContext.mjs +2 -0
  613. package/Types/SecurityCase/SecurityDetectionSource.d.mts +2 -1
  614. package/Types/SecurityCase/SecurityDetectionSource.d.ts +2 -1
  615. package/Types/SecurityCase/SecurityDetectionSource.js +5 -2
  616. package/Types/SecurityCase/SecurityEntity.d.mts +5 -0
  617. package/Types/SecurityCase/SecurityEntity.d.ts +5 -0
  618. package/Types/SecurityCase/SecurityEntity.js +39 -1
  619. package/Types/SecurityCase/SecurityEntity.mjs +4 -0
  620. package/Types/SecurityCase/SecurityEntityRisk.js +14 -6
  621. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.mts +2 -0
  622. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.ts +2 -0
  623. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +124 -1
  624. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.mjs +2 -0
  625. package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.d.mts +3 -1
  626. package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.d.ts +3 -1
  627. package/Types/SecurityEvent/Connectors/SecurityEventConnectorProvider.js +4 -0
  628. package/Types/SecurityEvent/DataSecuritySignal.d.mts +33 -0
  629. package/Types/SecurityEvent/DataSecuritySignal.d.ts +33 -0
  630. package/Types/SecurityEvent/DataSecuritySignal.js +114 -0
  631. package/Types/SecurityEvent/DataSecuritySignal.mjs +14 -0
  632. package/Types/SecurityEvent/DetectionRuleDataKind.d.mts +7 -1
  633. package/Types/SecurityEvent/DetectionRuleDataKind.d.ts +7 -1
  634. package/Types/SecurityEvent/DetectionRuleDataKind.js +74 -0
  635. package/Types/SecurityEvent/DetectionRuleLibrary.d.mts +2 -1
  636. package/Types/SecurityEvent/DetectionRuleLibrary.d.ts +2 -1
  637. package/Types/SecurityEvent/DetectionRuleLibrary.js +730 -0
  638. package/Types/SecurityEvent/OcsfEventClass.js +31 -2
  639. package/Types/SecurityEvent/RealTimeDetection.d.mts +13 -0
  640. package/Types/SecurityEvent/RealTimeDetection.d.ts +13 -0
  641. package/Types/SecurityEvent/RealTimeDetection.js +60 -0
  642. package/Types/SecurityEvent/RealTimeDetection.mjs +8 -0
  643. package/Types/SecurityEvent/SecurityLogFormat.d.mts +15 -0
  644. package/Types/SecurityEvent/SecurityLogFormat.d.ts +15 -0
  645. package/Types/SecurityEvent/SecurityLogFormat.js +123 -10
  646. package/Types/SecurityEvent/SecurityLogFormat.mjs +4 -0
  647. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +10 -0
  648. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +10 -0
  649. package/Types/SecurityPlaybook/SecurityPlaybookAction.js +117 -3
  650. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +18 -1
  651. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +18 -1
  652. package/Types/SecurityPlaybook/SecurityPlaybookStep.js +121 -3
  653. package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +5 -0
  654. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.mts +44 -0
  655. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.ts +44 -0
  656. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.js +188 -0
  657. package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.mjs +9 -0
  658. package/Types/SecurityPlaybook/SecurityPlaybookStepResult.d.mts +1 -0
  659. package/Types/SecurityPlaybook/SecurityPlaybookStepResult.d.ts +1 -0
  660. package/Types/SecurityPlaybook/SecurityPlaybookStepResult.js +1 -0
  661. package/Types/SecurityPlaybook/SecurityPlaybookTemplates.d.mts +2 -0
  662. package/Types/SecurityPlaybook/SecurityPlaybookTemplates.d.ts +2 -0
  663. package/Types/SecurityPlaybook/SecurityPlaybookTemplates.js +67 -16
  664. package/Types/SecurityPlaybook/SecurityPlaybookTemplates.mjs +2 -0
  665. package/Types/SecurityPlaybook/SecurityProtectedEntity.js +8 -1
  666. package/Types/StatusPage/DefaultStatusNames.d.mts +4 -0
  667. package/Types/StatusPage/DefaultStatusNames.d.ts +4 -0
  668. package/Types/StatusPage/DefaultStatusNames.js +50 -0
  669. package/Types/StatusPage/DefaultStatusNames.mjs +4 -0
  670. package/Types/StatusPage/StateChangeNoteMessage.d.mts +18 -1
  671. package/Types/StatusPage/StateChangeNoteMessage.d.ts +18 -1
  672. package/Types/StatusPage/StateChangeNoteMessage.js +60 -9
  673. package/Types/StatusPage/StateChangeNoteMessage.mjs +1 -0
  674. package/Types/StatusPage/StatusPageLanguage.d.mts +2 -0
  675. package/Types/StatusPage/StatusPageLanguage.d.ts +2 -0
  676. package/Types/StatusPage/StatusPageLanguage.js +10 -1
  677. package/Types/StatusPage/StatusPageLanguage.mjs +2 -0
  678. package/Types/Telemetry/ExceptionAIDigest.d.mts +31 -0
  679. package/Types/Telemetry/ExceptionAIDigest.d.ts +31 -0
  680. package/Types/Telemetry/ExceptionAIDigest.js +131 -0
  681. package/Types/Telemetry/ExceptionAIDigest.mjs +13 -0
  682. package/Types/Telemetry/ExceptionAIExplanation.d.mts +37 -0
  683. package/Types/Telemetry/ExceptionAIExplanation.d.ts +37 -0
  684. package/Types/Telemetry/ExceptionAIExplanation.js +110 -0
  685. package/Types/Telemetry/ExceptionAIExplanation.mjs +12 -0
  686. package/Types/Telemetry/ExceptionFingerprintLookup.d.mts +9 -0
  687. package/Types/Telemetry/ExceptionFingerprintLookup.d.ts +9 -0
  688. package/Types/Telemetry/ExceptionFingerprintLookup.js +55 -0
  689. package/Types/Telemetry/ExceptionFingerprintLookup.mjs +4 -0
  690. package/Types/Telemetry/ExceptionGroupFingerprints.d.mts +10 -0
  691. package/Types/Telemetry/ExceptionGroupFingerprints.d.ts +10 -0
  692. package/Types/Telemetry/ExceptionGroupFingerprints.js +114 -0
  693. package/Types/Telemetry/ExceptionGroupFingerprints.mjs +6 -0
  694. package/Types/Telemetry/ExceptionListStats.d.mts +19 -0
  695. package/Types/Telemetry/ExceptionListStats.d.ts +19 -0
  696. package/Types/Telemetry/ExceptionListStats.js +122 -0
  697. package/Types/Telemetry/ExceptionListStats.mjs +9 -0
  698. package/Types/Telemetry/ExceptionSpanScope.d.mts +3 -0
  699. package/Types/Telemetry/ExceptionSpanScope.d.ts +3 -0
  700. package/Types/Telemetry/ExceptionSpanScope.js +39 -3
  701. package/Types/Telemetry/ExceptionSpanScope.mjs +2 -0
  702. package/Types/Telemetry/SimilarExceptions.d.mts +33 -0
  703. package/Types/Telemetry/SimilarExceptions.d.ts +33 -0
  704. package/Types/Telemetry/SimilarExceptions.js +109 -0
  705. package/Types/Telemetry/SimilarExceptions.mjs +10 -0
  706. package/Types/Telemetry/TelemetrySavedViewState.d.mts +4 -0
  707. package/Types/Telemetry/TelemetrySavedViewState.d.ts +4 -0
  708. package/Types/Telemetry/TraceSpanType.d.mts +2 -1
  709. package/Types/Telemetry/TraceSpanType.d.ts +2 -1
  710. package/Types/Telemetry/TraceSpanType.js +50 -11
  711. package/Types/Telemetry/TraceSpanType.mjs +2 -1
  712. package/Types/Theme/ThemePreference.js +2 -1
  713. package/Types/Translator.d.mts +77 -0
  714. package/Types/Translator.d.ts +77 -0
  715. package/Types/Translator.js +582 -0
  716. package/Types/Translator.mjs +18 -0
  717. package/Types/UpdateCheck/SecurityAdvisory.d.mts +39 -0
  718. package/Types/UpdateCheck/SecurityAdvisory.d.ts +39 -0
  719. package/Types/UpdateCheck/SecurityAdvisory.js +221 -0
  720. package/Types/UpdateCheck/SecurityAdvisory.mjs +7 -0
  721. package/Types/UpdateCheck/UpdateCheckFailure.d.mts +9 -0
  722. package/Types/UpdateCheck/UpdateCheckFailure.d.ts +9 -0
  723. package/Types/UpdateCheck/UpdateCheckFailure.js +32 -0
  724. package/Types/UpdateCheck/UpdateCheckFailure.mjs +3 -0
  725. package/Types/UpdateCheck/UpdateStatus.d.mts +44 -0
  726. package/Types/UpdateCheck/UpdateStatus.d.ts +44 -0
  727. package/Types/UpdateCheck/UpdateStatus.js +195 -0
  728. package/Types/UpdateCheck/UpdateStatus.mjs +3 -0
  729. package/Types/VideoCall/VideoCallProvider.js +6 -3
  730. package/Types/Workflow/ComponentID.d.mts +5 -0
  731. package/Types/Workflow/ComponentID.d.ts +5 -0
  732. package/Types/Workflow/ComponentID.js +12 -0
  733. package/Types/Workflow/Components/API.js +91 -0
  734. package/Types/Workflow/Components/ApiGetById.d.mts +16 -0
  735. package/Types/Workflow/Components/ApiGetById.d.ts +16 -0
  736. package/Types/Workflow/Components/ApiGetById.js +69 -0
  737. package/Types/Workflow/Components/ApiGetById.mjs +4 -0
  738. package/Types/Workflow/Components/FromAnotherTool.d.mts +94 -0
  739. package/Types/Workflow/Components/FromAnotherTool.d.ts +94 -0
  740. package/Types/Workflow/Components/FromAnotherTool.js +541 -0
  741. package/Types/Workflow/Components/FromAnotherTool.mjs +23 -0
  742. package/Types/Workflow/Components/JavaScriptCheck.d.mts +16 -0
  743. package/Types/Workflow/Components/JavaScriptCheck.d.ts +16 -0
  744. package/Types/Workflow/Components/JavaScriptCheck.js +145 -0
  745. package/Types/Workflow/Components/JavaScriptCheck.mjs +5 -0
  746. package/Types/Workflow/Components/Zabbix.d.mts +62 -0
  747. package/Types/Workflow/Components/Zabbix.d.ts +62 -0
  748. package/Types/Workflow/Components/Zabbix.js +343 -0
  749. package/Types/Workflow/Components/Zabbix.mjs +17 -0
  750. package/Types/Workflow/Components.js +21 -0
  751. package/Types/Workflow/Documentation/APIDocumentation.d.mts +1 -0
  752. package/Types/Workflow/Documentation/APIDocumentation.d.ts +1 -0
  753. package/Types/Workflow/Documentation/APIDocumentation.js +48 -1
  754. package/Types/Workflow/Documentation/APIDocumentation.mjs +1 -0
  755. package/Types/Workflow/Documentation/DocumentationContext.js +2 -0
  756. package/Types/Workflow/Documentation/DocumentationLinks.d.mts +3 -0
  757. package/Types/Workflow/Documentation/DocumentationLinks.d.ts +3 -0
  758. package/Types/Workflow/Documentation/DocumentationLinks.js +3 -0
  759. package/Types/Workflow/Documentation/FromAnotherToolDocumentation.d.mts +5 -0
  760. package/Types/Workflow/Documentation/FromAnotherToolDocumentation.d.ts +5 -0
  761. package/Types/Workflow/Documentation/FromAnotherToolDocumentation.js +89 -0
  762. package/Types/Workflow/Documentation/FromAnotherToolDocumentation.mjs +3 -0
  763. package/Types/Workflow/Documentation/Index.js +7 -0
  764. package/Types/Workflow/Documentation/UtilityDocumentation.d.mts +1 -0
  765. package/Types/Workflow/Documentation/UtilityDocumentation.d.ts +1 -0
  766. package/Types/Workflow/Documentation/UtilityDocumentation.js +40 -1
  767. package/Types/Workflow/Documentation/UtilityDocumentation.mjs +1 -0
  768. package/Types/Workflow/Documentation/ZabbixDocumentation.d.mts +4 -0
  769. package/Types/Workflow/Documentation/ZabbixDocumentation.d.ts +4 -0
  770. package/Types/Workflow/Documentation/ZabbixDocumentation.js +67 -0
  771. package/Types/Workflow/Documentation/ZabbixDocumentation.mjs +2 -0
  772. package/Types/Workflow/TemplateLayout.d.mts +44 -0
  773. package/Types/Workflow/TemplateLayout.d.ts +44 -0
  774. package/Types/Workflow/TemplateLayout.js +125 -0
  775. package/Types/Workflow/TemplateLayout.mjs +7 -0
  776. package/Types/Workflow/Templates.d.mts +42 -12
  777. package/Types/Workflow/Templates.d.ts +42 -12
  778. package/Types/Workflow/Templates.js +2046 -6220
  779. package/Types/Workflow/Templates.mjs +1 -0
  780. package/Types/Workflow/UnhandledStepFailure.d.mts +15 -0
  781. package/Types/Workflow/UnhandledStepFailure.d.ts +15 -0
  782. package/Types/Workflow/UnhandledStepFailure.js +68 -0
  783. package/Types/Workflow/UnhandledStepFailure.mjs +5 -0
  784. package/Types/Workspace/MicrosoftTeamsCloud.d.mts +26 -0
  785. package/Types/Workspace/MicrosoftTeamsCloud.d.ts +26 -0
  786. package/Types/Workspace/MicrosoftTeamsCloud.js +214 -0
  787. package/Types/Workspace/MicrosoftTeamsCloud.mjs +4 -0
  788. package/Types/Workspace/WorkspaceChannelLink.d.mts +1 -0
  789. package/Types/Workspace/WorkspaceChannelLink.d.ts +1 -0
  790. package/Types/Workspace/WorkspaceChannelLink.js +45 -6
  791. package/Types/Workspace/WorkspaceMessagePayload.d.mts +1 -0
  792. package/Types/Workspace/WorkspaceMessagePayload.d.ts +1 -0
  793. package/UI/Utils/TranslateTemplate.d.mts +3 -68
  794. package/UI/Utils/TranslateTemplate.d.ts +3 -68
  795. package/Utils/AiRemediation/CloudChangeDryRunPlan.d.mts +17 -0
  796. package/Utils/AiRemediation/CloudChangeDryRunPlan.d.ts +17 -0
  797. package/Utils/AiRemediation/CloudChangeDryRunPlan.js +122 -0
  798. package/Utils/AiRemediation/CloudChangeDryRunPlan.mjs +7 -0
  799. package/Utils/AiRemediation/Resource/CloudCommandPolicy.d.mts +4 -0
  800. package/Utils/AiRemediation/Resource/CloudCommandPolicy.d.ts +4 -0
  801. package/Utils/AiRemediation/Resource/CloudCommandPolicy.js +177 -0
  802. package/Utils/AiRemediation/Resource/CloudCommandPolicy.mjs +4 -0
  803. package/Utils/AiRemediation/Resource/CloudOperationCatalog.d.mts +144 -0
  804. package/Utils/AiRemediation/Resource/CloudOperationCatalog.d.ts +144 -0
  805. package/Utils/AiRemediation/Resource/CloudOperationCatalog.js +1964 -0
  806. package/Utils/AiRemediation/Resource/CloudOperationCatalog.mjs +48 -0
  807. package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +4 -0
  808. package/Utils/Dashboard/DashboardBoardLayout.d.mts +46 -0
  809. package/Utils/Dashboard/DashboardBoardLayout.d.ts +46 -0
  810. package/Utils/Dashboard/DashboardBoardLayout.js +238 -0
  811. package/Utils/Dashboard/DashboardBoardLayout.mjs +11 -0
  812. package/Utils/Dashboard/ValueWidgetLayout.js +9 -1
  813. package/Utils/Dashboard/VariableInterpolation.d.mts +1 -0
  814. package/Utils/Dashboard/VariableInterpolation.d.ts +1 -0
  815. package/Utils/Dashboard/VariableInterpolation.js +19 -0
  816. package/Utils/DataSecurity/CustomDataTypeDetector.d.mts +23 -0
  817. package/Utils/DataSecurity/CustomDataTypeDetector.d.ts +23 -0
  818. package/Utils/DataSecurity/CustomDataTypeDetector.js +130 -0
  819. package/Utils/DataSecurity/CustomDataTypeDetector.mjs +8 -0
  820. package/Utils/DataSecurity/Detector.d.mts +26 -0
  821. package/Utils/DataSecurity/Detector.d.ts +26 -0
  822. package/Utils/DataSecurity/Detector.js +83 -0
  823. package/Utils/DataSecurity/Detector.mjs +8 -0
  824. package/Utils/DataSecurity/Detectors/ContactDetectors.d.mts +12 -0
  825. package/Utils/DataSecurity/Detectors/ContactDetectors.d.ts +12 -0
  826. package/Utils/DataSecurity/Detectors/ContactDetectors.js +915 -0
  827. package/Utils/DataSecurity/Detectors/ContactDetectors.mjs +12 -0
  828. package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.d.mts +3 -0
  829. package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.d.ts +3 -0
  830. package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.js +52 -0
  831. package/Utils/DataSecurity/Detectors/DocumentMarkingDetectors.mjs +3 -0
  832. package/Utils/DataSecurity/Detectors/FinancialDetectors.d.mts +8 -0
  833. package/Utils/DataSecurity/Detectors/FinancialDetectors.d.ts +8 -0
  834. package/Utils/DataSecurity/Detectors/FinancialDetectors.js +566 -0
  835. package/Utils/DataSecurity/Detectors/FinancialDetectors.mjs +8 -0
  836. package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.d.mts +3 -0
  837. package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.d.ts +3 -0
  838. package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.js +2415 -0
  839. package/Utils/DataSecurity/Detectors/GovernmentIdDetectors.mjs +3 -0
  840. package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.d.mts +3 -0
  841. package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.d.ts +3 -0
  842. package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.js +258 -0
  843. package/Utils/DataSecurity/Detectors/HealthIdentifierDetectors.mjs +3 -0
  844. package/Utils/DataSecurity/Detectors/HealthRecordDetectors.d.mts +3 -0
  845. package/Utils/DataSecurity/Detectors/HealthRecordDetectors.d.ts +3 -0
  846. package/Utils/DataSecurity/Detectors/HealthRecordDetectors.js +115 -0
  847. package/Utils/DataSecurity/Detectors/HealthRecordDetectors.mjs +3 -0
  848. package/Utils/DataSecurity/Detectors/Index.d.mts +4 -0
  849. package/Utils/DataSecurity/Detectors/Index.d.ts +4 -0
  850. package/Utils/DataSecurity/Detectors/Index.js +47 -0
  851. package/Utils/DataSecurity/Detectors/Index.mjs +4 -0
  852. package/Utils/DataSecurity/Detectors/SecretDetectors.d.mts +11 -0
  853. package/Utils/DataSecurity/Detectors/SecretDetectors.d.ts +11 -0
  854. package/Utils/DataSecurity/Detectors/SecretDetectors.js +1733 -0
  855. package/Utils/DataSecurity/Detectors/SecretDetectors.mjs +11 -0
  856. package/Utils/DataSecurity/FieldClassifier.d.mts +22 -0
  857. package/Utils/DataSecurity/FieldClassifier.d.ts +22 -0
  858. package/Utils/DataSecurity/FieldClassifier.js +247 -0
  859. package/Utils/DataSecurity/FieldClassifier.mjs +5 -0
  860. package/Utils/DataSecurity/FieldCollector.d.mts +23 -0
  861. package/Utils/DataSecurity/FieldCollector.d.ts +23 -0
  862. package/Utils/DataSecurity/FieldCollector.js +81 -0
  863. package/Utils/DataSecurity/FieldCollector.mjs +3 -0
  864. package/Utils/DataSecurity/FieldNameHints.d.mts +9 -0
  865. package/Utils/DataSecurity/FieldNameHints.d.ts +9 -0
  866. package/Utils/DataSecurity/FieldNameHints.js +184 -0
  867. package/Utils/DataSecurity/FieldNameHints.mjs +6 -0
  868. package/Utils/DataSecurity/FindingTally.d.mts +44 -0
  869. package/Utils/DataSecurity/FindingTally.d.ts +44 -0
  870. package/Utils/DataSecurity/FindingTally.js +138 -0
  871. package/Utils/DataSecurity/FindingTally.mjs +6 -0
  872. package/Utils/DataSecurity/Masking.d.mts +6 -0
  873. package/Utils/DataSecurity/Masking.d.ts +6 -0
  874. package/Utils/DataSecurity/Masking.js +159 -0
  875. package/Utils/DataSecurity/Masking.mjs +7 -0
  876. package/Utils/DataSecurity/PathPattern.d.mts +3 -0
  877. package/Utils/DataSecurity/PathPattern.d.ts +3 -0
  878. package/Utils/DataSecurity/PathPattern.js +55 -0
  879. package/Utils/DataSecurity/PathPattern.mjs +4 -0
  880. package/Utils/DataSecurity/Sha256.d.mts +1 -0
  881. package/Utils/DataSecurity/Sha256.d.ts +1 -0
  882. package/Utils/DataSecurity/Sha256.js +94 -0
  883. package/Utils/DataSecurity/Sha256.mjs +2 -0
  884. package/Utils/DataSecurity/TextScanner.d.mts +35 -0
  885. package/Utils/DataSecurity/TextScanner.d.ts +35 -0
  886. package/Utils/DataSecurity/TextScanner.js +303 -0
  887. package/Utils/DataSecurity/TextScanner.mjs +8 -0
  888. package/Utils/DataSecurity/UnplacedFields.d.mts +35 -0
  889. package/Utils/DataSecurity/UnplacedFields.d.ts +35 -0
  890. package/Utils/DataSecurity/UnplacedFields.js +407 -0
  891. package/Utils/DataSecurity/UnplacedFields.mjs +19 -0
  892. package/Utils/DataSecurity/Validators.d.mts +16 -0
  893. package/Utils/DataSecurity/Validators.d.ts +16 -0
  894. package/Utils/DataSecurity/Validators.js +339 -0
  895. package/Utils/DataSecurity/Validators.mjs +17 -0
  896. package/Utils/Exceptions/ExceptionActivity.d.mts +22 -0
  897. package/Utils/Exceptions/ExceptionActivity.d.ts +22 -0
  898. package/Utils/Exceptions/ExceptionActivity.js +141 -0
  899. package/Utils/Exceptions/ExceptionActivity.mjs +6 -0
  900. package/Utils/Exceptions/ExceptionIssueState.d.mts +18 -0
  901. package/Utils/Exceptions/ExceptionIssueState.d.ts +18 -0
  902. package/Utils/Exceptions/ExceptionIssueState.js +131 -0
  903. package/Utils/Exceptions/ExceptionIssueState.mjs +8 -0
  904. package/Utils/Exceptions/ExceptionUserId.d.mts +8 -0
  905. package/Utils/Exceptions/ExceptionUserId.d.ts +8 -0
  906. package/Utils/Exceptions/ExceptionUserId.js +79 -0
  907. package/Utils/Exceptions/ExceptionUserId.mjs +6 -0
  908. package/Utils/HostCollector/HostCollectorDefaultConfig.d.mts +2 -0
  909. package/Utils/HostCollector/HostCollectorDefaultConfig.d.ts +2 -0
  910. package/Utils/HostCollector/HostCollectorDefaultConfig.js +39 -1
  911. package/Utils/HostCollector/HostCollectorDefaultConfig.mjs +2 -0
  912. package/Utils/Inventory/InventoryAssetDetails.d.mts +7 -0
  913. package/Utils/Inventory/InventoryAssetDetails.d.ts +7 -0
  914. package/Utils/Inventory/InventoryAssetDetails.js +70 -1
  915. package/Utils/Inventory/InventoryAssetDetails.mjs +1 -0
  916. package/Utils/LabelRuleImportExport.js +17 -3
  917. package/Utils/Metrics/MetricQueryFallback.d.mts +24 -0
  918. package/Utils/Metrics/MetricQueryFallback.d.ts +24 -0
  919. package/Utils/Metrics/MetricQueryFallback.js +208 -0
  920. package/Utils/Metrics/MetricQueryFallback.mjs +2 -0
  921. package/Utils/Monitor/EndpointAttachmentUtil.d.mts +15 -2
  922. package/Utils/Monitor/EndpointAttachmentUtil.d.ts +15 -2
  923. package/Utils/Monitor/EndpointAttachmentUtil.js +83 -1
  924. package/Utils/Monitor/EndpointAttachmentUtil.mjs +1 -0
  925. package/Utils/Monitor/NeighborIdentityUtil.d.mts +15 -0
  926. package/Utils/Monitor/NeighborIdentityUtil.d.ts +15 -0
  927. package/Utils/Monitor/NeighborIdentityUtil.js +58 -0
  928. package/Utils/Monitor/NeighborIdentityUtil.mjs +3 -0
  929. package/Utils/Monitor/NetworkTopologyUtil.d.mts +13 -0
  930. package/Utils/Monitor/NetworkTopologyUtil.d.ts +13 -0
  931. package/Utils/Monitor/NetworkTopologyUtil.js +293 -70
  932. package/Utils/Monitor/PlatformResourceIdentity.js +7 -4
  933. package/Utils/NetworkDevice/DeviceOwnMacUtil.d.mts +20 -0
  934. package/Utils/NetworkDevice/DeviceOwnMacUtil.d.ts +20 -0
  935. package/Utils/NetworkDevice/DeviceOwnMacUtil.js +81 -0
  936. package/Utils/NetworkDevice/DeviceOwnMacUtil.mjs +4 -0
  937. package/Utils/NetworkDevice/DeviceWebUiUtil.d.mts +20 -0
  938. package/Utils/NetworkDevice/DeviceWebUiUtil.d.ts +20 -0
  939. package/Utils/NetworkDevice/DeviceWebUiUtil.js +139 -0
  940. package/Utils/NetworkDevice/DeviceWebUiUtil.mjs +4 -0
  941. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +1 -0
  942. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +1 -0
  943. package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +64 -6
  944. package/Utils/NetworkDevice/SystemDescriptionUtil.d.mts +10 -0
  945. package/Utils/NetworkDevice/SystemDescriptionUtil.d.ts +10 -0
  946. package/Utils/NetworkDevice/SystemDescriptionUtil.js +69 -5
  947. package/Utils/NetworkDevice/SystemDescriptionUtil.mjs +2 -0
  948. package/Utils/NetworkDiscovery/DiscoveredDetailsPlan.d.mts +1 -0
  949. package/Utils/NetworkDiscovery/DiscoveredDetailsPlan.d.ts +1 -0
  950. package/Utils/NetworkDiscovery/DiscoveredDetailsPlan.js +19 -6
  951. package/Utils/NetworkDiscovery/DiscoveredHostUtil.d.mts +1 -1
  952. package/Utils/NetworkDiscovery/DiscoveredHostUtil.d.ts +1 -1
  953. package/Utils/NetworkDiscovery/DiscoveredHostUtil.js +18 -1
  954. package/Utils/Proxmox/ProxmoxNotifications.d.mts +62 -0
  955. package/Utils/Proxmox/ProxmoxNotifications.d.ts +62 -0
  956. package/Utils/Proxmox/ProxmoxNotifications.js +458 -0
  957. package/Utils/Proxmox/ProxmoxNotifications.mjs +20 -0
  958. package/Utils/Rules/RuleRunSummary.d.mts +6 -3
  959. package/Utils/Rules/RuleRunSummary.d.ts +6 -3
  960. package/Utils/Rules/RuleRunSummary.js +11 -7
  961. package/Utils/Rum/UserFlow.d.mts +20 -0
  962. package/Utils/Rum/UserFlow.d.ts +20 -0
  963. package/Utils/Rum/UserFlow.js +41 -3
  964. package/Utils/Rum/UserFlow.mjs +1 -0
  965. package/Utils/Schema/MonitorSchemas.js +2 -0
  966. package/Utils/SecurityAdvisoryMatcher.d.mts +33 -0
  967. package/Utils/SecurityAdvisoryMatcher.d.ts +33 -0
  968. package/Utils/SecurityAdvisoryMatcher.js +291 -0
  969. package/Utils/SecurityAdvisoryMatcher.mjs +2 -0
  970. package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.d.mts +24 -0
  971. package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.d.ts +24 -0
  972. package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.js +380 -0
  973. package/Utils/SecurityEvent/Connectors/EntraIdNormalizer.mjs +15 -0
  974. package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.d.mts +29 -0
  975. package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.d.ts +29 -0
  976. package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.js +527 -0
  977. package/Utils/SecurityEvent/Connectors/GoogleWorkspaceNormalizer.mjs +13 -0
  978. package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.d.mts +21 -0
  979. package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.d.ts +21 -0
  980. package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.js +365 -0
  981. package/Utils/SecurityEvent/Connectors/Microsoft365AuditNormalizer.mjs +11 -0
  982. package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.d.mts +17 -0
  983. package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.d.ts +17 -0
  984. package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.js +344 -0
  985. package/Utils/SecurityEvent/LogParsers/AzureActivityLogParser.mjs +12 -0
  986. package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.d.mts +27 -0
  987. package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.d.ts +27 -0
  988. package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.js +326 -0
  989. package/Utils/SecurityEvent/LogParsers/GoogleCloudAuditLogParser.mjs +10 -0
  990. package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.d.mts +38 -0
  991. package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.d.ts +38 -0
  992. package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.js +629 -0
  993. package/Utils/SecurityEvent/LogParsers/SecurityDeviceLogParser.mjs +13 -0
  994. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.mts +9 -0
  995. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.ts +9 -0
  996. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.js +63 -3
  997. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.mjs +4 -0
  998. package/Utils/SecurityEvent/LogParsers/SecurityLogParser.js +54 -0
  999. package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.d.mts +26 -0
  1000. package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.d.ts +26 -0
  1001. package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.js +1046 -0
  1002. package/Utils/SecurityEvent/LogParsers/WindowsEventLogParser.mjs +11 -0
  1003. package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.d.mts +19 -0
  1004. package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.d.ts +19 -0
  1005. package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.js +724 -0
  1006. package/Utils/SecurityEvent/LogParsers/WindowsEventRecord.mjs +7 -0
  1007. package/Utils/SecurityEvent/SecurityRecordReading.d.mts +32 -0
  1008. package/Utils/SecurityEvent/SecurityRecordReading.d.ts +32 -0
  1009. package/Utils/SecurityEvent/SecurityRecordReading.js +78 -0
  1010. package/Utils/SecurityEvent/SecurityRecordReading.mjs +2 -0
  1011. package/Utils/Sms/Gsm7Text.d.mts +3 -0
  1012. package/Utils/Sms/Gsm7Text.d.ts +3 -0
  1013. package/Utils/Sms/Gsm7Text.js +109 -8
  1014. package/Utils/Sms/Gsm7Text.mjs +3 -0
  1015. package/Utils/Sms/OnCallPageSms.d.mts +1 -0
  1016. package/Utils/Sms/OnCallPageSms.d.ts +1 -0
  1017. package/Utils/Sms/OnCallPageSms.js +16 -2
  1018. package/Utils/Sms/SubscriberSms.js +9 -1
  1019. package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.mts +44 -0
  1020. package/Utils/Suggestions/InvestigationCodeFixSuggestion.d.ts +44 -0
  1021. package/Utils/Suggestions/InvestigationCodeFixSuggestion.js +223 -0
  1022. package/Utils/Suggestions/InvestigationCodeFixSuggestion.mjs +8 -0
  1023. package/Utils/Syslog/LeefParser.d.mts +28 -0
  1024. package/Utils/Syslog/LeefParser.d.ts +28 -0
  1025. package/Utils/Syslog/LeefParser.js +326 -0
  1026. package/Utils/Syslog/LeefParser.mjs +10 -0
  1027. package/Utils/Telemetry/ChangeEventFields.d.mts +11 -0
  1028. package/Utils/Telemetry/ChangeEventFields.d.ts +11 -0
  1029. package/Utils/Telemetry/ChangeEventFields.js +33 -3
  1030. package/Utils/Telemetry/CloudAppRevisionName.d.mts +4 -0
  1031. package/Utils/Telemetry/CloudAppRevisionName.d.ts +4 -0
  1032. package/Utils/Telemetry/CloudAppRevisionName.js +27 -0
  1033. package/Utils/Telemetry/CloudAppRevisionName.mjs +2 -0
  1034. package/Utils/Telemetry/CloudInstanceIdentity.d.mts +1 -0
  1035. package/Utils/Telemetry/CloudInstanceIdentity.d.ts +1 -0
  1036. package/Utils/Telemetry/CloudInstanceIdentity.js +10 -0
  1037. package/Utils/Telemetry/CloudInstanceIdentity.mjs +1 -0
  1038. package/Utils/VersionRange.d.mts +34 -0
  1039. package/Utils/VersionRange.d.ts +34 -0
  1040. package/Utils/VersionRange.js +422 -0
  1041. package/Utils/VersionRange.mjs +5 -0
  1042. package/package.json +1 -1
@@ -0,0 +1,2415 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.GOVERNMENT_ID_DETECTORS = void 0;
7
+ const DataConfidence_1 = __importDefault(require("../../../Types/DataSecurity/DataConfidence"));
8
+ const Detector_1 = require("../Detector");
9
+ const Validators_1 = require("../Validators");
10
+ /*
11
+ * GOVERNMENT IDS: HOW EACH COUNTRY'S NUMBER IS TOLD FROM ANY OTHER RUN OF
12
+ * DIGITS.
13
+ *
14
+ * Most national IDs carry their own proof - a check digit worked out from
15
+ * the rest (Luhn, a mod 11 or mod 97 sum, ISO 7064, Verhoeff, a letter
16
+ * table), and often the holder's birth date, sex or region written in. A
17
+ * candidate is a finding only when that arithmetic and those dates hold, so
18
+ * twelve digits are not an Aadhaar number unless Verhoeff says so. Each
19
+ * detector's comment says what proves it.
20
+ *
21
+ * How sure a value is on its own follows from what proves it:
22
+ *
23
+ * - High: a check digit on a shape no other number shares - letters or a
24
+ * fixed prefix (a CURP, a codice fiscale, 756 for a Swiss AHV number).
25
+ * - Medium: a check digit on a shape other numbers share - eleven digits,
26
+ * even with a birth date in them.
27
+ * - Low: the format alone (an SSN's ranges, a passport number). Nothing in
28
+ * the value proves what it is.
29
+ *
30
+ * Some count only beside a word that names them (`requiresContext`): a
31
+ * number with no check and a common shape (a passport, a driver's license,
32
+ * an EIN), and a plain run of nine to thirteen digits that a single check
33
+ * digit proves - one random number in ten or eleven passes, and Unix
34
+ * timestamps and phone numbers have those lengths. Where the grouped form
35
+ * is distinctive and the bare one is not (an SSN as 123-45-6789 or as
36
+ * 123456789), the type has a detector for each. Every detector refuses
37
+ * placeholders (000000000, 123456789), and the samples that agencies and
38
+ * documentation publish are counted apart as test values.
39
+ *
40
+ * Patterns keep Detector.ts's rules: global, every quantifier bounded, never
41
+ * inside a longer token. A number typed in groups is also not taken from a
42
+ * longer chain of groups: 123-45-6789-01 holds no SSN.
43
+ */
44
+ /*
45
+ * The value upper-cased without the spaces, dashes, dots and slashes people
46
+ * group it with - keeping the Ñ and & of a Mexican RFC, which
47
+ * alphanumericUpper would drop.
48
+ */
49
+ function withoutSeparators(value) {
50
+ let kept = "";
51
+ for (let index = 0; index < value.length; index++) {
52
+ const character = value[index];
53
+ if (character !== " " &&
54
+ character !== "-" &&
55
+ character !== "." &&
56
+ character !== "/") {
57
+ kept += character;
58
+ }
59
+ }
60
+ return kept.toUpperCase();
61
+ }
62
+ // An isTestValue check: whether a normalized value is one of these samples.
63
+ function sampleValues(values) {
64
+ const samples = new Set(values);
65
+ return (normalized) => {
66
+ return samples.has(normalized);
67
+ };
68
+ }
69
+ /*
70
+ * The check digit most mod 11 schemes share: 11 less the remainder of the
71
+ * weighted sum, where a remainder of 0 or 1 gives 0 (Brazil's CPF and CNPJ,
72
+ * Portugal's NIF, Japan's My Number).
73
+ */
74
+ function mod11CheckDigit(sum) {
75
+ const remainder = sum % 11;
76
+ return remainder < 2 ? 0 : 11 - remainder;
77
+ }
78
+ // A value with no placeholder digits: neither 000000000 nor 123456789.
79
+ function isNotPlaceholder(value) {
80
+ return !(0, Detector_1.isPlaceholderDigits)((0, Detector_1.digitsOnly)(value));
81
+ }
82
+ // NORTH AMERICA.
83
+ /*
84
+ * The SSA's rules for an SSN, which has no check digit: no area 000, 666
85
+ * or 900-999 (never issued - 9xx is the ITIN's), no group 00, no serial
86
+ * 0000.
87
+ */
88
+ function isUsSsn(digits) {
89
+ if (digits.length !== 9 || (0, Detector_1.isPlaceholderDigits)(digits)) {
90
+ return false;
91
+ }
92
+ const area = Number(digits.slice(0, 3));
93
+ return (area !== 0 &&
94
+ area !== 666 &&
95
+ area < 900 &&
96
+ digits.slice(3, 5) !== "00" &&
97
+ digits.slice(5) !== "0000");
98
+ }
99
+ /*
100
+ * SSNs printed where everyone could copy them: the Woolworth wallet card
101
+ * (078-05-1120), a 1940 Social Security pamphlet (219-09-9999) and
102
+ * LifeLock's advertisements (457-55-5462). The advertising range
103
+ * 987-65-4320 to 4329 is 9xx, which no SSN has.
104
+ */
105
+ const US_SSN_SAMPLES = sampleValues([
106
+ "078051120",
107
+ "219099999",
108
+ "457555462",
109
+ ]);
110
+ // An SSN in its groups, AAA-GG-SSSS, with dashes, dots or spaces.
111
+ const US_SSN_GROUPED_PATTERN = /(?<![A-Za-z0-9]|[0-9][-. ])[0-9]{3}(?:-[0-9]{2}-|\.[0-9]{2}\.| [0-9]{2} )[0-9]{4}(?![A-Za-z0-9]|[-. ][0-9])/g;
112
+ // An SSN as nine digits in a row.
113
+ const US_SSN_BARE_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{9}(?![A-Za-z0-9]|[-.][0-9])/g;
114
+ const US_SSN_KEYWORDS = [
115
+ "ssn",
116
+ "social security",
117
+ "social security number",
118
+ "ss number",
119
+ "ss no",
120
+ "soc sec",
121
+ ];
122
+ // The groups the IRS issues ITINs in, after the leading 9xx.
123
+ function isItinGroup(group) {
124
+ return ((group >= 50 && group <= 65) ||
125
+ (group >= 70 && group <= 88) ||
126
+ (group >= 90 && group <= 92) ||
127
+ (group >= 94 && group <= 99));
128
+ }
129
+ function isUsItin(digits) {
130
+ return (digits.length === 9 &&
131
+ digits[0] === "9" &&
132
+ isItinGroup((0, Validators_1.twoDigits)(digits, 3)) &&
133
+ !(0, Detector_1.isPlaceholderDigits)(digits));
134
+ }
135
+ /*
136
+ * The range advertisements print for a made-up SSN, 987-65-4320 to 4329:
137
+ * its group, 65, is one ITINs are issued in.
138
+ */
139
+ function isAdvertisingNumber(digits) {
140
+ return digits.startsWith("98765432");
141
+ }
142
+ const US_ITIN_GROUPED_PATTERN = /(?<![A-Za-z0-9]|[0-9][-. ])9[0-9]{2}(?:-[0-9]{2}-|\.[0-9]{2}\.| [0-9]{2} )[0-9]{4}(?![A-Za-z0-9]|[-. ][0-9])/g;
143
+ const US_ITIN_BARE_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])9[0-9]{8}(?![A-Za-z0-9]|[-.][0-9])/g;
144
+ const US_ITIN_KEYWORDS = [
145
+ "itin",
146
+ "taxpayer id",
147
+ "taxpayer identification number",
148
+ "individual taxpayer",
149
+ ];
150
+ // EIN prefixes the IRS never gave a campus, so no EIN starts with them.
151
+ const US_EIN_UNUSED_PREFIXES = new Set([
152
+ "00",
153
+ "07",
154
+ "08",
155
+ "09",
156
+ "17",
157
+ "18",
158
+ "19",
159
+ "28",
160
+ "29",
161
+ "49",
162
+ "69",
163
+ "70",
164
+ "78",
165
+ "79",
166
+ "89",
167
+ "96",
168
+ "97",
169
+ ]);
170
+ const US_EIN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}-?[0-9]{7}(?![A-Za-z0-9]|[-.][0-9])/g;
171
+ function isUsEin(digits) {
172
+ return (digits.length === 9 &&
173
+ !US_EIN_UNUSED_PREFIXES.has(digits.slice(0, 2)) &&
174
+ !(0, Detector_1.isPlaceholderDigits)(digits));
175
+ }
176
+ // Nine digits, or since 2021 a letter and eight digits.
177
+ const US_PASSPORT_PATTERN = /(?<![A-Za-z0-9])(?:[A-Za-z][0-9]{8}|[0-9]{9})(?![A-Za-z0-9])/g;
178
+ /*
179
+ * The shapes the states use: one or two letters and digits (California's
180
+ * A1234567, New York's 9 digits, Illinois' letter and 11), a plain run of
181
+ * digits, and Florida's and Wisconsin's grouped letter-and-digits forms.
182
+ */
183
+ const US_DRIVERS_LICENSE_PATTERN = /(?<![A-Za-z0-9])(?:[A-Za-z]{1,2}[0-9]{5,14}|[0-9]{7,12}|[A-Za-z][0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{3}-[0-9]|[A-Za-z][0-9]{3}-[0-9]{4}-[0-9]{4}-[0-9]{2})(?![A-Za-z0-9]|-[0-9])/g;
184
+ // Canada's SIN, in groups of three or as nine digits.
185
+ const CA_SIN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{3}(?:-[0-9]{3}-| [0-9]{3} |\.[0-9]{3}\.|[0-9]{3})[0-9]{3}(?![A-Za-z0-9]|[-.][0-9])/g;
186
+ /*
187
+ * The first digit says who holds a SIN: 1-7 a province, 9 a temporary
188
+ * resident. 0 and 8 are never a person's (8 is a business number).
189
+ */
190
+ function isCaSin(digits) {
191
+ const first = (0, Validators_1.digitAt)(digits, 0);
192
+ return (digits.length === 9 &&
193
+ first !== 0 &&
194
+ first !== 8 &&
195
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
196
+ (0, Validators_1.luhn)(digits));
197
+ }
198
+ const NORTH_AMERICA = [
199
+ /*
200
+ * US Social Security number as AAA-GG-SSSS: the SSA's area, group and
201
+ * serial rules, and nothing else - no check digit. The groups make it
202
+ * worth showing (Low) even with no word around it.
203
+ */
204
+ {
205
+ dataTypeId: "us-ssn",
206
+ quickCheck: Detector_1.hasDigit,
207
+ pattern: US_SSN_GROUPED_PATTERN,
208
+ normalize: Detector_1.digitsOnly,
209
+ validate: isUsSsn,
210
+ keywords: US_SSN_KEYWORDS,
211
+ confidenceWithoutContext: DataConfidence_1.default.Low,
212
+ specificity: 1,
213
+ isTestValue: US_SSN_SAMPLES,
214
+ },
215
+ /*
216
+ * An SSN as nine bare digits: the same rules, but nine digits are
217
+ * everywhere, so only beside a word that says SSN.
218
+ */
219
+ {
220
+ dataTypeId: "us-ssn",
221
+ quickCheck: Detector_1.hasDigit,
222
+ pattern: US_SSN_BARE_PATTERN,
223
+ normalize: Detector_1.digitsOnly,
224
+ validate: isUsSsn,
225
+ keywords: US_SSN_KEYWORDS,
226
+ requiresContext: true,
227
+ confidenceWithoutContext: DataConfidence_1.default.Low,
228
+ specificity: 1,
229
+ isTestValue: US_SSN_SAMPLES,
230
+ },
231
+ /*
232
+ * US ITIN, 9XX-GG-SSSS: always a 9 first, and a group the IRS issues in
233
+ * (50-65, 70-88, 90-92, 94-99). No check digit.
234
+ */
235
+ {
236
+ dataTypeId: "us-itin",
237
+ quickCheck: Detector_1.hasDigit,
238
+ pattern: US_ITIN_GROUPED_PATTERN,
239
+ normalize: Detector_1.digitsOnly,
240
+ validate: isUsItin,
241
+ keywords: US_ITIN_KEYWORDS,
242
+ confidenceWithoutContext: DataConfidence_1.default.Low,
243
+ specificity: 1,
244
+ isTestValue: isAdvertisingNumber,
245
+ },
246
+ // An ITIN as nine bare digits, only beside a word that says so.
247
+ {
248
+ dataTypeId: "us-itin",
249
+ quickCheck: Detector_1.hasDigit,
250
+ pattern: US_ITIN_BARE_PATTERN,
251
+ normalize: Detector_1.digitsOnly,
252
+ validate: isUsItin,
253
+ keywords: US_ITIN_KEYWORDS,
254
+ requiresContext: true,
255
+ confidenceWithoutContext: DataConfidence_1.default.Low,
256
+ specificity: 1,
257
+ isTestValue: isAdvertisingNumber,
258
+ },
259
+ /*
260
+ * US EIN, XX-XXXXXXX: a prefix some IRS campus was given, no check digit.
261
+ * Nine digits with a dash after two are common enough that only a word
262
+ * beside it makes it one.
263
+ */
264
+ {
265
+ dataTypeId: "us-ein",
266
+ quickCheck: Detector_1.hasDigit,
267
+ pattern: US_EIN_PATTERN,
268
+ normalize: Detector_1.digitsOnly,
269
+ validate: isUsEin,
270
+ keywords: [
271
+ "ein",
272
+ "employer id",
273
+ "employer identification number",
274
+ "fein",
275
+ "tax id",
276
+ "federal tax id",
277
+ "tax identification number",
278
+ ],
279
+ requiresContext: true,
280
+ confidenceWithoutContext: DataConfidence_1.default.Low,
281
+ specificity: 1,
282
+ },
283
+ /*
284
+ * US passport number: nine digits, or a letter and eight. Nothing in it
285
+ * is checked, and a UK number has the same shape, so it counts only
286
+ * beside words that name a US passport; beside "passport" alone it is a
287
+ * passport number of no country (passport-number).
288
+ */
289
+ {
290
+ dataTypeId: "us-passport",
291
+ quickCheck: Detector_1.hasDigit,
292
+ pattern: US_PASSPORT_PATTERN,
293
+ normalize: Detector_1.alphanumericUpper,
294
+ validate: isNotPlaceholder,
295
+ keywords: [
296
+ "us passport",
297
+ "u.s. passport",
298
+ "usa passport",
299
+ "united states passport",
300
+ ],
301
+ requiresContext: true,
302
+ confidenceWithoutContext: DataConfidence_1.default.Low,
303
+ // Named for its country, it is a surer claim than a passport of none.
304
+ specificity: 2,
305
+ },
306
+ /*
307
+ * US driver's license number: every state has its own format and none a
308
+ * public check digit, so any of their shapes, beside words that say so.
309
+ */
310
+ {
311
+ dataTypeId: "us-drivers-license",
312
+ quickCheck: Detector_1.hasDigit,
313
+ pattern: US_DRIVERS_LICENSE_PATTERN,
314
+ normalize: Detector_1.alphanumericUpper,
315
+ validate: isNotPlaceholder,
316
+ keywords: [
317
+ "drivers license",
318
+ "driver license",
319
+ "driver's license",
320
+ "drivers licence",
321
+ "driving license",
322
+ "dl number",
323
+ "dl no",
324
+ "dl#",
325
+ "license number",
326
+ "licence number",
327
+ "license no",
328
+ "dln",
329
+ ],
330
+ requiresContext: true,
331
+ confidenceWithoutContext: DataConfidence_1.default.Low,
332
+ specificity: 1,
333
+ },
334
+ /*
335
+ * Canada Social Insurance Number: nine digits that pass Luhn, first digit
336
+ * 1-7 or 9. One nine-digit number in ten passes Luhn, so beside a word.
337
+ */
338
+ {
339
+ dataTypeId: "ca-sin",
340
+ quickCheck: Detector_1.hasDigit,
341
+ pattern: CA_SIN_PATTERN,
342
+ normalize: Detector_1.digitsOnly,
343
+ validate: isCaSin,
344
+ keywords: [
345
+ "sin",
346
+ "social insurance",
347
+ "social insurance number",
348
+ "numero d'assurance sociale",
349
+ "numéro d'assurance sociale",
350
+ "nas",
351
+ ],
352
+ requiresContext: true,
353
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
354
+ specificity: 2,
355
+ },
356
+ ];
357
+ // UNITED KINGDOM.
358
+ /*
359
+ * A NINO: two prefix letters (never D, F, I, Q, U or V first; never D, F,
360
+ * I, O, Q, U or V second), six digits and a suffix A-D, often typed in
361
+ * pairs: AB 12 34 56 C.
362
+ */
363
+ const UK_NINO_PATTERN = /(?<![A-Za-z0-9])[A-CEGHJ-PR-TW-Za-ceghj-pr-tw-z][A-CEGHJ-NPR-TW-Za-ceghj-npr-tw-z] ?[0-9]{2} ?[0-9]{2} ?[0-9]{2} ?[A-Da-d](?![A-Za-z0-9])/g;
364
+ // Prefixes HMRC never allocates.
365
+ const UK_NINO_UNUSED_PREFIXES = new Set([
366
+ "BG",
367
+ "GB",
368
+ "KN",
369
+ "NK",
370
+ "NT",
371
+ "TN",
372
+ "ZZ",
373
+ ]);
374
+ function isUkNino(value) {
375
+ return (value.length === 9 &&
376
+ !UK_NINO_UNUSED_PREFIXES.has(value.slice(0, 2)) &&
377
+ !(0, Detector_1.isPlaceholderDigits)(value.slice(2, 8)));
378
+ }
379
+ // Nine digits, or newer books' letters and digits.
380
+ const UK_PASSPORT_PATTERN = /(?<![A-Za-z0-9])(?:[A-Za-z]{1,2}[0-9]{7,8}|[0-9]{9})(?![A-Za-z0-9])/g;
381
+ /*
382
+ * A DVLA licence number: five letters of the surname (padded with 9s), the
383
+ * birth date as decade, month (plus 50 for women), day and year, two
384
+ * initials (or one and a 9), a digit and two check characters, sometimes
385
+ * typed in its groups: MORGA 657054 SM9 IJ.
386
+ */
387
+ const UK_DRIVING_LICENCE_PATTERN = /(?<![A-Za-z0-9])[A-Za-z][A-Za-z9]{4} ?[0-9][0156][0-9][0-3][0-9]{2} ?[A-Za-z][A-Za-z9][0-9] ?[A-Za-z0-9]{2}(?![A-Za-z0-9])/g;
388
+ function isUkDrivingLicence(value) {
389
+ if (value.length !== 16) {
390
+ return false;
391
+ }
392
+ // A short surname is padded with 9s, and nothing follows the padding.
393
+ let padded = false;
394
+ for (let index = 1; index < 5; index++) {
395
+ if (value[index] === "9") {
396
+ padded = true;
397
+ }
398
+ else if (padded) {
399
+ return false;
400
+ }
401
+ }
402
+ let month = (0, Validators_1.twoDigits)(value, 6);
403
+ if (month > 50) {
404
+ month -= 50;
405
+ }
406
+ const year = (0, Validators_1.digitAt)(value, 5) * 10 + (0, Validators_1.digitAt)(value, 10);
407
+ return (0, Validators_1.isRealTwoDigitYearDate)(year, month, (0, Validators_1.twoDigits)(value, 8));
408
+ }
409
+ const UNITED_KINGDOM = [
410
+ /*
411
+ * UK National Insurance number: HMRC's prefix and suffix rules. It has no
412
+ * check digit, but the shape is its own, so it shows (Low) on its own.
413
+ */
414
+ {
415
+ dataTypeId: "uk-nino",
416
+ quickCheck: Detector_1.hasDigit,
417
+ pattern: UK_NINO_PATTERN,
418
+ normalize: Detector_1.alphanumericUpper,
419
+ validate: isUkNino,
420
+ keywords: [
421
+ "nino",
422
+ "national insurance",
423
+ "ni number",
424
+ "ni no",
425
+ "national insurance number",
426
+ "nat ins",
427
+ ],
428
+ confidenceWithoutContext: DataConfidence_1.default.Low,
429
+ specificity: 1,
430
+ },
431
+ /*
432
+ * UK passport number: nine digits (newer books may start with letters),
433
+ * with nothing to check and a US number's shape, so only beside words
434
+ * that name a UK passport; beside "passport" alone it is a passport
435
+ * number of no country (passport-number).
436
+ */
437
+ {
438
+ dataTypeId: "uk-passport",
439
+ quickCheck: Detector_1.hasDigit,
440
+ pattern: UK_PASSPORT_PATTERN,
441
+ normalize: Detector_1.alphanumericUpper,
442
+ validate: isNotPlaceholder,
443
+ keywords: [
444
+ "uk passport",
445
+ "british passport",
446
+ "hm passport",
447
+ "hmpo",
448
+ "gb passport",
449
+ ],
450
+ requiresContext: true,
451
+ confidenceWithoutContext: DataConfidence_1.default.Low,
452
+ // Named for its country, it is a surer claim than a passport of none.
453
+ specificity: 2,
454
+ },
455
+ /*
456
+ * UK driving licence number: its sixteen characters must hold a real
457
+ * birth date and a properly padded surname. The two check characters'
458
+ * algorithm is the DVLA's own, so the format is all there is (Low).
459
+ */
460
+ {
461
+ dataTypeId: "uk-driving-licence",
462
+ quickCheck: Detector_1.hasDigit,
463
+ pattern: UK_DRIVING_LICENCE_PATTERN,
464
+ normalize: Detector_1.alphanumericUpper,
465
+ validate: isUkDrivingLicence,
466
+ keywords: [
467
+ "driving licence",
468
+ "driving license",
469
+ "licence number",
470
+ "licence no",
471
+ "dvla",
472
+ "driver number",
473
+ ],
474
+ confidenceWithoutContext: DataConfidence_1.default.Low,
475
+ specificity: 1,
476
+ // The licence on the DVLA's specimen photocard.
477
+ isTestValue: sampleValues(["MORGA657054SM9IJ"]),
478
+ },
479
+ ];
480
+ // LATIN AMERICA.
481
+ /*
482
+ * A CURP: four letters of the names (the second a vowel), the birth date,
483
+ * H, M or X, the state of birth (NE born abroad), three consonants, a
484
+ * homoclave (a digit before 2000, a letter after) and the check digit.
485
+ */
486
+ const MX_CURP_PATTERN = /(?<![A-Za-z0-9])[A-Z][AEIOUX][A-Z]{2}[0-9]{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])[HMX](?:AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|NE)[B-DF-HJ-NP-TV-Z]{3}[0-9A-Z][0-9](?![A-Za-z0-9])/g;
487
+ // The CURP check alphabet: digits, then letters with Ñ (written &) after N.
488
+ const MX_CURP_ALPHABET = "0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ";
489
+ function isMxCurp(value) {
490
+ if (value.length !== 18) {
491
+ return false;
492
+ }
493
+ const century = (0, Validators_1.digitAt)(value, 16) >= 0 ? 1900 : 2000;
494
+ if (!(0, Validators_1.isRealDate)(century + (0, Validators_1.twoDigits)(value, 4), (0, Validators_1.twoDigits)(value, 6), (0, Validators_1.twoDigits)(value, 8))) {
495
+ return false;
496
+ }
497
+ let sum = 0;
498
+ for (let index = 0; index < 17; index++) {
499
+ sum += MX_CURP_ALPHABET.indexOf(value[index]) * (18 - index);
500
+ }
501
+ return (10 - (sum % 10)) % 10 === (0, Validators_1.digitAt)(value, 17);
502
+ }
503
+ /*
504
+ * An RFC: three letters (a company) or four (a person, Ñ and & included),
505
+ * the date of birth or founding, and a three-character homoclave whose last
506
+ * character is 0-9 or A.
507
+ */
508
+ const MX_RFC_PATTERN = /(?<![A-Za-z0-9&Ñ])[A-Z&Ñ]{3,4}[- ]?[0-9]{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])[- ]?[A-Z0-9]{2}[0-9A](?![A-Za-z0-9])/g;
509
+ function isMxRfc(value) {
510
+ if (value.length !== 12 && value.length !== 13) {
511
+ return false;
512
+ }
513
+ const date = value.length - 9;
514
+ return (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(value, date), (0, Validators_1.twoDigits)(value, date + 2), (0, Validators_1.twoDigits)(value, date + 4));
515
+ }
516
+ const BR_CPF_PATTERN = /(?<![A-Za-z0-9]|[0-9][-./])[0-9]{3}\.?[0-9]{3}\.?[0-9]{3}-?[0-9]{2}(?![A-Za-z0-9]|[-./][0-9])/g;
517
+ const BR_CPF_FIRST_WEIGHTS = [
518
+ 10, 9, 8, 7, 6, 5, 4, 3, 2,
519
+ ];
520
+ const BR_CPF_SECOND_WEIGHTS = [
521
+ 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
522
+ ];
523
+ function isBrCpf(digits) {
524
+ return (digits.length === 11 &&
525
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
526
+ mod11CheckDigit((0, Validators_1.weightedDigitSum)(digits, BR_CPF_FIRST_WEIGHTS)) ===
527
+ (0, Validators_1.digitAt)(digits, 9) &&
528
+ mod11CheckDigit((0, Validators_1.weightedDigitSum)(digits, BR_CPF_SECOND_WEIGHTS)) ===
529
+ (0, Validators_1.digitAt)(digits, 10));
530
+ }
531
+ /*
532
+ * A CNPJ: digits with their usual dots, slash and dash optional - or, since
533
+ * July 2026, letters among the first twelve, which the Receita Federal
534
+ * only ever writes grouped (12.ABC.345/01DE-35).
535
+ */
536
+ const BR_CNPJ_PATTERN = /(?<![A-Za-z0-9]|[0-9][-./])(?:[0-9]{2}\.?[0-9]{3}\.?[0-9]{3}\/?[0-9]{4}-?[0-9]{2}|[0-9A-Z]{2}\.[0-9A-Z]{3}\.[0-9A-Z]{3}\/[0-9A-Z]{4}-[0-9]{2})(?![A-Za-z0-9]|[-./][0-9])/g;
537
+ const BR_CNPJ_FIRST_WEIGHTS = [
538
+ 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2,
539
+ ];
540
+ const BR_CNPJ_SECOND_WEIGHTS = [
541
+ 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2,
542
+ ];
543
+ /*
544
+ * A CNPJ check digit. Each character counts as its character code less 48:
545
+ * a digit as itself and a letter of the new CNPJ from 17 (A) up, as the
546
+ * Receita Federal defines it.
547
+ */
548
+ function brCnpjCheckDigit(value, weights) {
549
+ let sum = 0;
550
+ for (let index = 0; index < weights.length; index++) {
551
+ sum += (value.charCodeAt(index) - 48) * weights[index];
552
+ }
553
+ return mod11CheckDigit(sum);
554
+ }
555
+ function isBrCnpj(value) {
556
+ return (value.length === 14 &&
557
+ !(0, Detector_1.isPlaceholderDigits)(value) &&
558
+ brCnpjCheckDigit(value, BR_CNPJ_FIRST_WEIGHTS) === (0, Validators_1.digitAt)(value, 12) &&
559
+ brCnpjCheckDigit(value, BR_CNPJ_SECOND_WEIGHTS) === (0, Validators_1.digitAt)(value, 13));
560
+ }
561
+ /*
562
+ * A CUIT or CUIL: the kind of holder (20, 23, 24, 27 people; 30, 33, 34
563
+ * companies; 50, 51, 55 international), the DNI and the check digit.
564
+ */
565
+ const AR_CUIT_PATTERN = /(?<![A-Za-z0-9]|[0-9][-./])(?:20|23|24|27|30|33|34|50|51|55)[- ]?[0-9]{8}[- ]?[0-9](?![A-Za-z0-9]|[-./][0-9])/g;
566
+ const AR_CUIT_WEIGHTS = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2];
567
+ // 11 less the remainder, where 11 gives 0 and 10 gives 9.
568
+ function arCuitCheckDigit(digits) {
569
+ const remainder = (0, Validators_1.weightedDigitSum)(digits, AR_CUIT_WEIGHTS) % 11;
570
+ if (remainder === 0) {
571
+ return 0;
572
+ }
573
+ return remainder === 1 ? 9 : 11 - remainder;
574
+ }
575
+ function isArCuit(digits) {
576
+ if (digits.length !== 11 || (0, Detector_1.isPlaceholderDigits)(digits.slice(2, 10))) {
577
+ return false;
578
+ }
579
+ if (arCuitCheckDigit(digits) === (0, Validators_1.digitAt)(digits, 10)) {
580
+ return true;
581
+ }
582
+ /*
583
+ * Where a woman's number (27) would need the check digit 10, AFIP issues
584
+ * it with the prefix 23 and the check digit 4 instead.
585
+ */
586
+ return (digits.startsWith("23") &&
587
+ (0, Validators_1.digitAt)(digits, 10) === 4 &&
588
+ (0, Validators_1.weightedDigitSum)("27" + digits.slice(2), AR_CUIT_WEIGHTS) % 11 === 1);
589
+ }
590
+ // A RUT: 12.345.678-5, 12345678-5 or 123456785, the check digit 0-9 or K.
591
+ const CL_RUT_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])(?:[0-9]{1,2}\.[0-9]{3}\.[0-9]{3}|[0-9]{7,8})-?[0-9Kk](?![A-Za-z0-9]|[-.][0-9])/g;
592
+ /*
593
+ * The RUT check: the body's digits from the right times 2, 3, 4, 5, 6, 7,
594
+ * 2, 3 ...; 11 less the remainder, where 11 is 0 and 10 is K.
595
+ */
596
+ function isClRut(value) {
597
+ const body = value.slice(0, -1);
598
+ if (body.length < 7 || body.length > 8 || (0, Detector_1.isPlaceholderDigits)(body)) {
599
+ return false;
600
+ }
601
+ let sum = 0;
602
+ let weight = 2;
603
+ for (let index = body.length - 1; index >= 0; index--) {
604
+ sum += (0, Validators_1.digitAt)(body, index) * weight;
605
+ weight = weight === 7 ? 2 : weight + 1;
606
+ }
607
+ const check = 11 - (sum % 11);
608
+ let expected = String(check);
609
+ if (check === 11) {
610
+ expected = "0";
611
+ }
612
+ else if (check === 10) {
613
+ expected = "K";
614
+ }
615
+ return value.endsWith(expected);
616
+ }
617
+ const LATIN_AMERICA = [
618
+ /*
619
+ * Mexico CURP: its eighteen characters' layout, a real birth date and
620
+ * the mod 10 check digit over the other seventeen.
621
+ */
622
+ {
623
+ dataTypeId: "mx-curp",
624
+ quickCheck: Detector_1.hasDigit,
625
+ pattern: MX_CURP_PATTERN,
626
+ normalize: Detector_1.alphanumericUpper,
627
+ validate: isMxCurp,
628
+ keywords: [
629
+ "curp",
630
+ "clave unica de registro de poblacion",
631
+ "clave única de registro de población",
632
+ ],
633
+ confidenceWithoutContext: DataConfidence_1.default.High,
634
+ specificity: 3,
635
+ // RENAPO's and python-stdnum's published examples.
636
+ isTestValue: sampleValues(["HEGG560427MVZRRL04", "BOXW310820HNERXN09"]),
637
+ },
638
+ /*
639
+ * Mexico RFC: its layout and a real date. The SAT issued numbers whose
640
+ * last character fails its own check, so the check is not held against
641
+ * one, and the format alone needs a word beside it.
642
+ */
643
+ {
644
+ dataTypeId: "mx-rfc",
645
+ quickCheck: Detector_1.hasDigit,
646
+ pattern: MX_RFC_PATTERN,
647
+ normalize: withoutSeparators,
648
+ validate: isMxRfc,
649
+ keywords: ["rfc", "registro federal de contribuyentes", "r.f.c."],
650
+ requiresContext: true,
651
+ confidenceWithoutContext: DataConfidence_1.default.Low,
652
+ specificity: 1,
653
+ // The SAT's generic RFCs for the general public and for foreigners.
654
+ isTestValue: sampleValues(["XAXX010101000", "XEXX010101000"]),
655
+ },
656
+ /*
657
+ * Brazil CPF: two mod 11 check digits, and never one digit repeated
658
+ * (111.111.111-11 passes the arithmetic).
659
+ */
660
+ {
661
+ dataTypeId: "br-cpf",
662
+ quickCheck: Detector_1.hasDigit,
663
+ pattern: BR_CPF_PATTERN,
664
+ normalize: Detector_1.digitsOnly,
665
+ validate: isBrCpf,
666
+ keywords: [
667
+ "cpf",
668
+ "cadastro de pessoas fisicas",
669
+ "cadastro de pessoas físicas",
670
+ "cpf/mf",
671
+ "rg",
672
+ ],
673
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
674
+ specificity: 2,
675
+ // The examples every CPF validator's documentation uses.
676
+ isTestValue: sampleValues(["12345678909", "11144477735", "52998224725"]),
677
+ },
678
+ /*
679
+ * Brazil CNPJ: two mod 11 check digits over fourteen characters, letters
680
+ * of the alphanumeric CNPJ included.
681
+ */
682
+ {
683
+ dataTypeId: "br-cnpj",
684
+ quickCheck: Detector_1.hasDigit,
685
+ pattern: BR_CNPJ_PATTERN,
686
+ normalize: Detector_1.alphanumericUpper,
687
+ validate: isBrCnpj,
688
+ keywords: [
689
+ "cnpj",
690
+ "cnpj/mf",
691
+ "cadastro nacional da pessoa juridica",
692
+ "cadastro nacional da pessoa jurídica",
693
+ ],
694
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
695
+ specificity: 2,
696
+ /*
697
+ * The textbook example, Banco do Brasil's head office (used in samples
698
+ * everywhere) and the Receita Federal's alphanumeric example.
699
+ */
700
+ isTestValue: sampleValues([
701
+ "11222333000181",
702
+ "00000000000191",
703
+ "12ABC34501DE35",
704
+ ]),
705
+ },
706
+ /*
707
+ * Argentina CUIT / CUIL: the holder-kind prefix and the mod 11 check
708
+ * digit, with AFIP's 23-and-4 exception.
709
+ */
710
+ {
711
+ dataTypeId: "ar-cuit",
712
+ quickCheck: Detector_1.hasDigit,
713
+ pattern: AR_CUIT_PATTERN,
714
+ normalize: Detector_1.digitsOnly,
715
+ validate: isArCuit,
716
+ keywords: [
717
+ "cuit",
718
+ "cuil",
719
+ "cdi",
720
+ "clave unica de identificacion tributaria",
721
+ "clave única de identificación tributaria",
722
+ ],
723
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
724
+ specificity: 3,
725
+ },
726
+ /*
727
+ * Chile RUT / RUN: the mod 11 check digit (K for 10). Seven or eight
728
+ * digits and one check pass for one number in eleven, so beside a word.
729
+ */
730
+ {
731
+ dataTypeId: "cl-rut",
732
+ quickCheck: Detector_1.hasDigit,
733
+ pattern: CL_RUT_PATTERN,
734
+ normalize: Detector_1.alphanumericUpper,
735
+ validate: isClRut,
736
+ keywords: [
737
+ "rut",
738
+ "run",
739
+ "rol unico tributario",
740
+ "rol único tributario",
741
+ "rol unico nacional",
742
+ "rol único nacional",
743
+ "cedula de identidad",
744
+ "cédula de identidad",
745
+ ],
746
+ requiresContext: true,
747
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
748
+ specificity: 2,
749
+ },
750
+ ];
751
+ // WESTERN AND CENTRAL EUROPE.
752
+ // The DNI and NIE check letters, by the number's remainder modulo 23.
753
+ const ES_ID_LETTERS = "TRWAGMYFPDXBNJZSQVHLCKE";
754
+ // Eight digits (12.345.678 too) and the check letter, which is never I, O or U.
755
+ const ES_DNI_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])(?:[0-9]{8}|[0-9]{2}\.[0-9]{3}\.[0-9]{3})[- ]?[A-HJ-NP-TV-Z](?![A-Za-z0-9])/g;
756
+ function isEsDni(value) {
757
+ const digits = value.slice(0, 8);
758
+ return (value.length === 9 &&
759
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
760
+ ES_ID_LETTERS[Number(digits) % 23] === value[8]);
761
+ }
762
+ const ES_NIE_PATTERN = /(?<![A-Za-z0-9])[XYZxyz][- ]?[0-9]{7}[- ]?[A-HJ-NP-TV-Z](?![A-Za-z0-9])/g;
763
+ // X, Y and Z stand for 0, 1 and 2 in front of the seven digits.
764
+ function isEsNie(value) {
765
+ if (value.length !== 9 || (0, Detector_1.isPlaceholderDigits)(value.slice(1, 8))) {
766
+ return false;
767
+ }
768
+ const number = Number(String("XYZ".indexOf(value[0])) + value.slice(1, 8));
769
+ return ES_ID_LETTERS[number % 23] === value[8];
770
+ }
771
+ /*
772
+ * A NIF: nine digits whose first says who holds it - 1-3 people, 45
773
+ * non-resident people, 5 companies, 6 the state, 7-9 other bodies.
774
+ */
775
+ const PT_NIF_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])(?:[1-35-9][0-9]|45)[0-9] ?[0-9]{3} ?[0-9]{3}(?![A-Za-z0-9]|[-.][0-9])/g;
776
+ const PT_NIF_WEIGHTS = [9, 8, 7, 6, 5, 4, 3, 2];
777
+ function isPtNif(digits) {
778
+ return (digits.length === 9 &&
779
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
780
+ mod11CheckDigit((0, Validators_1.weightedDigitSum)(digits, PT_NIF_WEIGHTS)) ===
781
+ (0, Validators_1.digitAt)(digits, 8));
782
+ }
783
+ /*
784
+ * A NIR: sex (1 or 2; 3, 4, 7 and 8 for numbers given before a birth is
785
+ * registered), year, month, department (2A and 2B for Corsica), commune,
786
+ * order number and the two-digit key, often typed in its groups:
787
+ * 1 85 05 78 006 084 36.
788
+ */
789
+ const FR_NIR_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[1-478] ?[0-9]{2} ?[0-9]{2} ?(?:[0-9]{2}|2[ABab]) ?[0-9]{3} ?[0-9]{3} ?[0-9]{2}(?![A-Za-z0-9]|[-.][0-9])/g;
790
+ function isFrNir(value) {
791
+ if (value.length !== 15) {
792
+ return false;
793
+ }
794
+ // A month 01-12, or one of the codes INSEE uses when it is not known.
795
+ const month = (0, Validators_1.twoDigits)(value, 3);
796
+ if (!((month >= 1 && month <= 12) ||
797
+ (month >= 20 && month <= 42) ||
798
+ month >= 50)) {
799
+ return false;
800
+ }
801
+ // In the key Corsica's 2A counts as 19 and 2B as 18.
802
+ const department = value.slice(5, 7);
803
+ let number = value.slice(0, 13);
804
+ if (department === "2A") {
805
+ number = value.slice(0, 5) + "19" + value.slice(7, 13);
806
+ }
807
+ else if (department === "2B") {
808
+ number = value.slice(0, 5) + "18" + value.slice(7, 13);
809
+ }
810
+ return (!(0, Detector_1.isPlaceholderDigits)(number) &&
811
+ 97 - (0, Validators_1.decimalStringMod)(number, 97) === (0, Validators_1.twoDigits)(value, 13));
812
+ }
813
+ const DE_TAX_ID_PATTERN = /(?<![A-Za-z0-9]|[0-9][-./])[1-9][0-9] ?[0-9]{3} ?[0-9]{3} ?[0-9]{3}(?![A-Za-z0-9]|[-./][0-9])/g;
814
+ /*
815
+ * The Bundeszentralamt für Steuern's rule for the first ten digits: exactly
816
+ * one digit appears twice or three times and every other at most once, and
817
+ * a digit that appears three times never three in a row.
818
+ */
819
+ function hasDeTaxIdDigits(digits) {
820
+ const counts = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
821
+ for (let index = 0; index < 10; index++) {
822
+ const digit = (0, Validators_1.digitAt)(digits, index);
823
+ counts[digit] = (counts[digit] || 0) + 1;
824
+ }
825
+ let repeated = -1;
826
+ for (let digit = 0; digit < 10; digit++) {
827
+ const count = counts[digit];
828
+ if (count > 3 || (count > 1 && repeated >= 0)) {
829
+ return false;
830
+ }
831
+ if (count > 1) {
832
+ repeated = digit;
833
+ }
834
+ }
835
+ if (repeated < 0) {
836
+ return false;
837
+ }
838
+ for (let index = 0; index + 2 < 10; index++) {
839
+ if ((0, Validators_1.digitAt)(digits, index) === repeated &&
840
+ (0, Validators_1.digitAt)(digits, index + 1) === repeated &&
841
+ (0, Validators_1.digitAt)(digits, index + 2) === repeated) {
842
+ return false;
843
+ }
844
+ }
845
+ return true;
846
+ }
847
+ function isDeTaxId(digits) {
848
+ return (digits.length === 11 &&
849
+ digits[0] !== "0" &&
850
+ hasDeTaxIdDigits(digits) &&
851
+ (0, Validators_1.iso7064Mod11Mod10)(digits));
852
+ }
853
+ /*
854
+ * A codice fiscale: three letters of the surname and three of the name,
855
+ * the birth year, a month letter, the day (plus 40 for women), the
856
+ * Belfiore code of the place of birth and the check letter. Where two
857
+ * people's codes would be the same, digits are swapped for the letters
858
+ * LMNPQRSTUV (omocodia).
859
+ */
860
+ const IT_CODICE_FISCALE_PATTERN = /(?<![A-Za-z0-9])[A-Za-z]{6}[0-9LMNP-Vlmnp-v]{2}[A-EHLMPR-Ta-ehlmpr-t][0-9LMNP-Vlmnp-v]{2}[A-Za-z][0-9LMNP-Vlmnp-v]{3}[A-Za-z](?![A-Za-z0-9])/g;
861
+ const IT_MONTH_LETTERS = "ABCDEHLMPRST";
862
+ const IT_DIGIT_LETTERS = "LMNPQRSTUV";
863
+ /*
864
+ * What a character in an odd place (the first, third ...) adds to the
865
+ * check: a digit counts as the letter in its place, 0 as A.
866
+ */
867
+ const IT_ODD_PLACE_VALUES = [
868
+ 1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20, 11, 3, 6, 8, 12, 14, 16, 10,
869
+ 22, 25, 24, 23,
870
+ ];
871
+ // Two digits of a codice fiscale, either of which may be an omocodia letter.
872
+ function itTwoDigits(value, index) {
873
+ let number = 0;
874
+ for (let place = index; place < index + 2; place++) {
875
+ let digit = (0, Validators_1.digitAt)(value, place);
876
+ if (digit < 0) {
877
+ digit = IT_DIGIT_LETTERS.indexOf(value[place]);
878
+ }
879
+ if (digit < 0) {
880
+ return -1;
881
+ }
882
+ number = number * 10 + digit;
883
+ }
884
+ return number;
885
+ }
886
+ function isItCodiceFiscale(value) {
887
+ if (value.length !== 16) {
888
+ return false;
889
+ }
890
+ const year = itTwoDigits(value, 6);
891
+ let day = itTwoDigits(value, 9);
892
+ if (day > 40) {
893
+ day -= 40;
894
+ }
895
+ if (year < 0 ||
896
+ !(0, Validators_1.isRealTwoDigitYearDate)(year, IT_MONTH_LETTERS.indexOf(value[8]) + 1, day)) {
897
+ return false;
898
+ }
899
+ let sum = 0;
900
+ for (let index = 0; index < 15; index++) {
901
+ const code = value.charCodeAt(index);
902
+ const place = code <= 57 ? code - 48 : code - 65;
903
+ sum += index % 2 === 0 ? IT_ODD_PLACE_VALUES[place] : place;
904
+ }
905
+ return value.charCodeAt(15) === 65 + (sum % 26);
906
+ }
907
+ // A BSN: nine digits, or in the dotted form 1234.56.782.
908
+ const NL_BSN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])(?:[0-9]{4}\.[0-9]{2}\.[0-9]{3}|[0-9]{3}[ .]?[0-9]{3}[ .]?[0-9]{3})(?![A-Za-z0-9]|[-.][0-9])/g;
909
+ const NL_BSN_WEIGHTS = [9, 8, 7, 6, 5, 4, 3, 2];
910
+ // The eleven test: 9, 8 ... 2 times the first eight, less the ninth.
911
+ function isNlBsn(digits) {
912
+ return (digits.length === 9 &&
913
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
914
+ ((0, Validators_1.weightedDigitSum)(digits, NL_BSN_WEIGHTS) - (0, Validators_1.digitAt)(digits, 8)) % 11 === 0);
915
+ }
916
+ // A national number: YY.MM.DD-SSS.CC, or eleven digits.
917
+ const BE_NATIONAL_NUMBER_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}\.?[0-9]{2}\.?[0-9]{2}[- ]?[0-9]{3}\.?[0-9]{2}(?![A-Za-z0-9]|[-.][0-9])/g;
918
+ function isBeNationalNumber(digits) {
919
+ if (digits.length !== 11 || (0, Detector_1.isPlaceholderDigits)(digits)) {
920
+ return false;
921
+ }
922
+ /*
923
+ * The key is 97 less the first nine digits modulo 97 - with a 2 in front
924
+ * of them for people born from 2000.
925
+ */
926
+ const base = digits.slice(0, 9);
927
+ const key = (0, Validators_1.twoDigits)(digits, 9);
928
+ const before2000 = 97 - (0, Validators_1.decimalStringMod)(base, 97) === key;
929
+ const from2000 = 97 - (0, Validators_1.decimalStringMod)("2" + base, 97) === key;
930
+ const sequence = Number(digits.slice(6, 9));
931
+ if ((!before2000 && !from2000) || sequence === 0 || sequence === 999) {
932
+ return false;
933
+ }
934
+ // A BIS number adds 20 or 40 to the month.
935
+ let month = (0, Validators_1.twoDigits)(digits, 2);
936
+ const day = (0, Validators_1.twoDigits)(digits, 4);
937
+ if (month >= 40) {
938
+ month -= 40;
939
+ }
940
+ else if (month >= 20) {
941
+ month -= 20;
942
+ }
943
+ if (month > 12 || day > 31) {
944
+ return false;
945
+ }
946
+ // A birth date that is not known is written with a month or day of 00.
947
+ if (month === 0 || day === 0) {
948
+ return true;
949
+ }
950
+ const year = (0, Validators_1.twoDigits)(digits, 0);
951
+ return ((before2000 && (0, Validators_1.isRealDate)(1900 + year, month, day)) ||
952
+ (from2000 && (0, Validators_1.isRealDate)(2000 + year, month, day)));
953
+ }
954
+ const PL_PESEL_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}[0-9][0-9][0-3][0-9][0-9]{5}(?![A-Za-z0-9]|[-.][0-9])/g;
955
+ const PL_PESEL_WEIGHTS = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3];
956
+ // The century a PESEL's month carries: 01-12, 21-32, 41-52, 61-72, 81-92.
957
+ const PL_PESEL_CENTURIES = [
958
+ 1900, 2000, 2100, 2200, 1800,
959
+ ];
960
+ function isPlPesel(digits) {
961
+ if (digits.length !== 11 || (0, Detector_1.isPlaceholderDigits)(digits)) {
962
+ return false;
963
+ }
964
+ const month = (0, Validators_1.twoDigits)(digits, 2);
965
+ const century = PL_PESEL_CENTURIES[Math.floor(month / 20)];
966
+ return ((0, Validators_1.isRealDate)(century + (0, Validators_1.twoDigits)(digits, 0), month % 20, (0, Validators_1.twoDigits)(digits, 4)) &&
967
+ (10 - ((0, Validators_1.weightedDigitSum)(digits, PL_PESEL_WEIGHTS) % 10)) % 10 ===
968
+ (0, Validators_1.digitAt)(digits, 10));
969
+ }
970
+ const WESTERN_EUROPE = [
971
+ /*
972
+ * Spain DNI: eight digits and the letter their remainder modulo 23 names.
973
+ * The letter makes the shape unusual, though one in 23 values passes.
974
+ */
975
+ {
976
+ dataTypeId: "es-dni",
977
+ quickCheck: Detector_1.hasDigit,
978
+ pattern: ES_DNI_PATTERN,
979
+ normalize: Detector_1.alphanumericUpper,
980
+ validate: isEsDni,
981
+ keywords: [
982
+ "dni",
983
+ "documento nacional",
984
+ "documento nacional de identidad",
985
+ "nif",
986
+ ],
987
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
988
+ specificity: 2,
989
+ },
990
+ /*
991
+ * Spain NIE: X, Y or Z, seven digits and the DNI check letter of the
992
+ * whole. The fixed first letter makes it distinctive.
993
+ */
994
+ {
995
+ dataTypeId: "es-nie",
996
+ quickCheck: Detector_1.hasDigit,
997
+ pattern: ES_NIE_PATTERN,
998
+ normalize: Detector_1.alphanumericUpper,
999
+ validate: isEsNie,
1000
+ keywords: [
1001
+ "nie",
1002
+ "numero de identidad de extranjero",
1003
+ "número de identidad de extranjero",
1004
+ "nif",
1005
+ ],
1006
+ confidenceWithoutContext: DataConfidence_1.default.High,
1007
+ specificity: 3,
1008
+ },
1009
+ /*
1010
+ * Portugal NIF: a holder-kind first digit and a mod 11 check digit - one
1011
+ * nine-digit number in eleven, so beside a word.
1012
+ */
1013
+ {
1014
+ dataTypeId: "pt-nif",
1015
+ quickCheck: Detector_1.hasDigit,
1016
+ pattern: PT_NIF_PATTERN,
1017
+ normalize: Detector_1.digitsOnly,
1018
+ validate: isPtNif,
1019
+ keywords: [
1020
+ "nif",
1021
+ "contribuinte",
1022
+ "numero de contribuinte",
1023
+ "número de contribuinte",
1024
+ "nipc",
1025
+ "numero fiscal",
1026
+ "número fiscal",
1027
+ ],
1028
+ requiresContext: true,
1029
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1030
+ specificity: 2,
1031
+ },
1032
+ /*
1033
+ * France NIR: its sex, month and department, and the key - 97 less the
1034
+ * thirteen digits modulo 97, Corsica's 2A and 2B as 19 and 18.
1035
+ */
1036
+ {
1037
+ dataTypeId: "fr-nir",
1038
+ quickCheck: Detector_1.hasDigit,
1039
+ pattern: FR_NIR_PATTERN,
1040
+ normalize: Detector_1.alphanumericUpper,
1041
+ validate: isFrNir,
1042
+ keywords: [
1043
+ "nir",
1044
+ "insee",
1045
+ "numero de securite sociale",
1046
+ "numéro de sécurité sociale",
1047
+ "securite sociale",
1048
+ "sécurité sociale",
1049
+ "secu",
1050
+ "sécu",
1051
+ "carte vitale",
1052
+ ],
1053
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1054
+ specificity: 2,
1055
+ // The example in the French Wikipedia's and INSEE's explanations.
1056
+ isTestValue: sampleValues(["255081416802538"]),
1057
+ },
1058
+ /*
1059
+ * Germany Steuer-ID: the digit-frequency rule (one digit twice or three
1060
+ * times) and the ISO 7064 MOD 11,10 check digit.
1061
+ */
1062
+ {
1063
+ dataTypeId: "de-tax-id",
1064
+ quickCheck: Detector_1.hasDigit,
1065
+ pattern: DE_TAX_ID_PATTERN,
1066
+ normalize: Detector_1.digitsOnly,
1067
+ validate: isDeTaxId,
1068
+ keywords: [
1069
+ "steuer id",
1070
+ "steuer-id",
1071
+ "steuerid",
1072
+ "steuernummer",
1073
+ "steueridentifikationsnummer",
1074
+ "identifikationsnummer",
1075
+ "idnr",
1076
+ "tax id",
1077
+ ],
1078
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1079
+ specificity: 2,
1080
+ // The examples in the BZSt's and python-stdnum's documentation.
1081
+ isTestValue: sampleValues(["86095742719", "36574261809", "65929970489"]),
1082
+ },
1083
+ /*
1084
+ * Italy codice fiscale: a real birth date (omocodia letters decoded) and
1085
+ * the check letter from the odd- and even-place tables.
1086
+ */
1087
+ {
1088
+ dataTypeId: "it-codice-fiscale",
1089
+ quickCheck: Detector_1.hasDigit,
1090
+ pattern: IT_CODICE_FISCALE_PATTERN,
1091
+ normalize: Detector_1.alphanumericUpper,
1092
+ validate: isItCodiceFiscale,
1093
+ keywords: [
1094
+ "codice fiscale",
1095
+ "cf",
1096
+ "c.f.",
1097
+ "cod. fisc.",
1098
+ "tessera sanitaria",
1099
+ ],
1100
+ confidenceWithoutContext: DataConfidence_1.default.High,
1101
+ specificity: 3,
1102
+ // Mario Rossi, born in Rome on 1 January 1980: the textbook example.
1103
+ isTestValue: sampleValues(["RSSMRA80A01H501U"]),
1104
+ },
1105
+ /*
1106
+ * Netherlands BSN: the eleven test - one nine-digit number in eleven
1107
+ * passes it, so beside a word.
1108
+ */
1109
+ {
1110
+ dataTypeId: "nl-bsn",
1111
+ quickCheck: Detector_1.hasDigit,
1112
+ pattern: NL_BSN_PATTERN,
1113
+ normalize: Detector_1.digitsOnly,
1114
+ validate: isNlBsn,
1115
+ keywords: [
1116
+ "bsn",
1117
+ "burgerservicenummer",
1118
+ "sofinummer",
1119
+ "sofi nummer",
1120
+ "persoonsnummer",
1121
+ ],
1122
+ requiresContext: true,
1123
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1124
+ specificity: 2,
1125
+ // The examples the government's own documentation uses.
1126
+ isTestValue: sampleValues(["123456782", "111222333"]),
1127
+ },
1128
+ /*
1129
+ * Belgium national number: the mod 97 key (with the 2 in front from
1130
+ * 2000) and a birth date in the century the key says.
1131
+ */
1132
+ {
1133
+ dataTypeId: "be-national-number",
1134
+ quickCheck: Detector_1.hasDigit,
1135
+ pattern: BE_NATIONAL_NUMBER_PATTERN,
1136
+ normalize: Detector_1.digitsOnly,
1137
+ validate: isBeNationalNumber,
1138
+ keywords: [
1139
+ "rijksregisternummer",
1140
+ "rijksregister",
1141
+ "numero national",
1142
+ "numéro national",
1143
+ "national number",
1144
+ "registre national",
1145
+ "insz",
1146
+ "niss",
1147
+ ],
1148
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1149
+ specificity: 2,
1150
+ // The example the national register's documentation uses.
1151
+ isTestValue: sampleValues(["85073003328"]),
1152
+ },
1153
+ /*
1154
+ * Poland PESEL: a birth date whose month carries the century, and the
1155
+ * check digit weighted 1, 3, 7, 9.
1156
+ */
1157
+ {
1158
+ dataTypeId: "pl-pesel",
1159
+ quickCheck: Detector_1.hasDigit,
1160
+ pattern: PL_PESEL_PATTERN,
1161
+ normalize: Detector_1.digitsOnly,
1162
+ validate: isPlPesel,
1163
+ keywords: ["pesel", "numer pesel"],
1164
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1165
+ specificity: 2,
1166
+ // The example in the PESEL article every reference repeats.
1167
+ isTestValue: sampleValues(["44051401359"]),
1168
+ },
1169
+ ];
1170
+ // NORTHERN EUROPE.
1171
+ /*
1172
+ * A personnummer: YYMMDD-NNNC (+ for those over 100), or with the century
1173
+ * as YYYYMMDD-NNNC. A coordination number adds 60 to the day.
1174
+ */
1175
+ const SE_PERSONNUMMER_PATTERN = /(?<![A-Za-z0-9]|[0-9][-+.])(?:19|20)?[0-9]{2}[01][0-9][0-9]{2}[-+]?[0-9]{4}(?![A-Za-z0-9]|[-.][0-9])/g;
1176
+ function isSePersonnummer(digits) {
1177
+ if (digits.length !== 10 && digits.length !== 12) {
1178
+ return false;
1179
+ }
1180
+ // Luhn and the date are read from the ten digits without the century.
1181
+ const ten = digits.slice(digits.length - 10);
1182
+ const month = (0, Validators_1.twoDigits)(ten, 2);
1183
+ let day = (0, Validators_1.twoDigits)(ten, 4);
1184
+ if (day > 60) {
1185
+ day -= 60;
1186
+ }
1187
+ const realDate = digits.length === 12
1188
+ ? (0, Validators_1.isRealDate)(Number(digits.slice(0, 4)), month, day)
1189
+ : (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(ten, 0), month, day);
1190
+ return realDate && !(0, Detector_1.isPlaceholderDigits)(ten) && (0, Validators_1.luhn)(ten);
1191
+ }
1192
+ const NO_FODSELSNUMMER_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-7][0-9]{5} ?[0-9]{5}(?![A-Za-z0-9]|[-.][0-9])/g;
1193
+ const NO_FIRST_WEIGHTS = [3, 7, 6, 1, 8, 9, 4, 5, 2];
1194
+ const NO_SECOND_WEIGHTS = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2];
1195
+ // 11 less the remainder, 11 giving 0. A 10 means no number has these digits.
1196
+ function noCheckDigit(sum) {
1197
+ const check = 11 - (sum % 11);
1198
+ return check === 11 ? 0 : check;
1199
+ }
1200
+ function isNoFodselsnummer(digits) {
1201
+ if (digits.length !== 11 || (0, Detector_1.isPlaceholderDigits)(digits)) {
1202
+ return false;
1203
+ }
1204
+ /*
1205
+ * A D-number adds 40 to the day, an H-number 40 to the month, and the
1206
+ * Tax Administration's synthetic test people 80 to the month.
1207
+ */
1208
+ let day = (0, Validators_1.twoDigits)(digits, 0);
1209
+ let month = (0, Validators_1.twoDigits)(digits, 2);
1210
+ if (day > 40) {
1211
+ day -= 40;
1212
+ }
1213
+ if (month > 80) {
1214
+ month -= 80;
1215
+ }
1216
+ else if (month > 40) {
1217
+ month -= 40;
1218
+ }
1219
+ return ((0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(digits, 4), month, day) &&
1220
+ noCheckDigit((0, Validators_1.weightedDigitSum)(digits, NO_FIRST_WEIGHTS)) ===
1221
+ (0, Validators_1.digitAt)(digits, 9) &&
1222
+ noCheckDigit((0, Validators_1.weightedDigitSum)(digits, NO_SECOND_WEIGHTS)) ===
1223
+ (0, Validators_1.digitAt)(digits, 10));
1224
+ }
1225
+ // A Tenor synthetic test person: their birth month has 80 added.
1226
+ function isNoSyntheticPerson(digits) {
1227
+ return (0, Validators_1.twoDigits)(digits, 2) > 80;
1228
+ }
1229
+ const DK_CPR_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-3][0-9][01][0-9]{3}-?[0-9]{4}(?![A-Za-z0-9]|[-.][0-9])/g;
1230
+ function isDkCpr(digits) {
1231
+ return (digits.length === 10 &&
1232
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1233
+ (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(digits, 4), (0, Validators_1.twoDigits)(digits, 2), (0, Validators_1.twoDigits)(digits, 0)));
1234
+ }
1235
+ /*
1236
+ * A HETU: DDMMYY, the century sign (+ for the 1800s; -, U-Y for the 1900s;
1237
+ * A-F for the 2000s), the individual number and the check character.
1238
+ */
1239
+ const FI_HETU_PATTERN = /(?<![A-Za-z0-9])[0-3][0-9][01][0-9]{3}[-+A-FU-Y][0-9]{3}[0-9A-FHJ-NPR-Y](?![A-Za-z0-9])/g;
1240
+ // The check characters, by DDMMYYNNN modulo 31.
1241
+ const FI_HETU_CHECK_CHARACTERS = "0123456789ABCDEFHJKLMNPRSTUVWXY";
1242
+ function fiHetuCentury(sign) {
1243
+ if (sign === "+") {
1244
+ return 1800;
1245
+ }
1246
+ if (sign === "-" || (sign >= "U" && sign <= "Y")) {
1247
+ return 1900;
1248
+ }
1249
+ return sign >= "A" && sign <= "F" ? 2000 : -1;
1250
+ }
1251
+ function isFiHetu(value) {
1252
+ if (value.length !== 11) {
1253
+ return false;
1254
+ }
1255
+ const century = fiHetuCentury(value[6]);
1256
+ return (century > 0 &&
1257
+ Number(value.slice(7, 10)) >= 2 &&
1258
+ (0, Validators_1.isRealDate)(century + (0, Validators_1.twoDigits)(value, 4), (0, Validators_1.twoDigits)(value, 2), (0, Validators_1.twoDigits)(value, 0)) &&
1259
+ FI_HETU_CHECK_CHARACTERS[Number(value.slice(0, 6) + value.slice(7, 10)) % 31] === value[10]);
1260
+ }
1261
+ /*
1262
+ * The Digital and Population Data Services Agency's test codes, whose
1263
+ * individual number is 900-999, and the example every reference uses.
1264
+ */
1265
+ function isFiTestHetu(value) {
1266
+ return Number(value.slice(7, 10)) >= 900 || value === "131052-308T";
1267
+ }
1268
+ /*
1269
+ * A PPS number: seven digits, the check letter and, since 2013, a second
1270
+ * letter A or B (W, T, X, E or H on older numbers).
1271
+ */
1272
+ const IE_PPSN_PATTERN = /(?<![A-Za-z0-9])[0-9]{7}[A-Wa-w][ABEHTWXabehtwx]?(?![A-Za-z0-9])/g;
1273
+ const IE_PPSN_LETTERS = "WABCDEFGHIJKLMNOPQRSTUV";
1274
+ const IE_PPSN_WEIGHTS = [8, 7, 6, 5, 4, 3, 2];
1275
+ function isIePpsn(value) {
1276
+ if ((value.length !== 8 && value.length !== 9) ||
1277
+ (0, Detector_1.isPlaceholderDigits)(value.slice(0, 7))) {
1278
+ return false;
1279
+ }
1280
+ // A second letter A or B counts in the check, at weight 9.
1281
+ let sum = (0, Validators_1.weightedDigitSum)(value, IE_PPSN_WEIGHTS);
1282
+ const second = value.slice(8);
1283
+ if (second === "A" || second === "B") {
1284
+ sum += 9 * IE_PPSN_LETTERS.indexOf(second);
1285
+ }
1286
+ return IE_PPSN_LETTERS[sum % 23] === value[7];
1287
+ }
1288
+ const CH_AHV_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])756[. ]?[0-9]{4}[. ]?[0-9]{4}[. ]?[0-9]{2}(?![A-Za-z0-9]|[-.][0-9])/g;
1289
+ function isChAhv(digits) {
1290
+ return (digits.length === 13 &&
1291
+ digits.startsWith("756") &&
1292
+ !(0, Detector_1.isPlaceholderDigits)(digits.slice(3, 12)) &&
1293
+ (0, Validators_1.ean13)(digits));
1294
+ }
1295
+ const NORTHERN_EUROPE = [
1296
+ /*
1297
+ * Sweden personnummer: a real birth date (coordination numbers too) and
1298
+ * Luhn over the ten digits, in its 10- and 12-digit forms.
1299
+ */
1300
+ {
1301
+ dataTypeId: "se-personnummer",
1302
+ quickCheck: Detector_1.hasDigit,
1303
+ pattern: SE_PERSONNUMMER_PATTERN,
1304
+ normalize: Detector_1.digitsOnly,
1305
+ validate: isSePersonnummer,
1306
+ keywords: [
1307
+ "personnummer",
1308
+ "personnr",
1309
+ "person nummer",
1310
+ "samordningsnummer",
1311
+ ],
1312
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1313
+ specificity: 2,
1314
+ // Skatteverket's example, 19121212-1212.
1315
+ isTestValue: (digits) => {
1316
+ return digits.endsWith("1212121212");
1317
+ },
1318
+ },
1319
+ /*
1320
+ * Norway fødselsnummer: a real birth date (D- and H-numbers too) and
1321
+ * both mod 11 check digits.
1322
+ */
1323
+ {
1324
+ dataTypeId: "no-fodselsnummer",
1325
+ quickCheck: Detector_1.hasDigit,
1326
+ pattern: NO_FODSELSNUMMER_PATTERN,
1327
+ normalize: Detector_1.digitsOnly,
1328
+ validate: isNoFodselsnummer,
1329
+ keywords: [
1330
+ "fodselsnummer",
1331
+ "fødselsnummer",
1332
+ "personnummer",
1333
+ "fnr",
1334
+ "d-nummer",
1335
+ "d nummer",
1336
+ ],
1337
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1338
+ specificity: 2,
1339
+ isTestValue: isNoSyntheticPerson,
1340
+ },
1341
+ /*
1342
+ * Denmark CPR number: a real birth date. Numbers issued since 2007 need
1343
+ * not pass the old mod 11 check, so the date is all there is, and the
1344
+ * number counts only beside a word.
1345
+ */
1346
+ {
1347
+ dataTypeId: "dk-cpr",
1348
+ quickCheck: Detector_1.hasDigit,
1349
+ pattern: DK_CPR_PATTERN,
1350
+ normalize: Detector_1.digitsOnly,
1351
+ validate: isDkCpr,
1352
+ keywords: [
1353
+ "cpr",
1354
+ "cpr nummer",
1355
+ "cpr-nummer",
1356
+ "cpr nr",
1357
+ "cprnr",
1358
+ "personnummer",
1359
+ ],
1360
+ requiresContext: true,
1361
+ confidenceWithoutContext: DataConfidence_1.default.Low,
1362
+ specificity: 1,
1363
+ },
1364
+ /*
1365
+ * Finland HETU: a real birth date in the century its sign says and the
1366
+ * mod 31 check character. The sign makes the shape its own.
1367
+ */
1368
+ {
1369
+ dataTypeId: "fi-hetu",
1370
+ quickCheck: Detector_1.hasDigit,
1371
+ pattern: FI_HETU_PATTERN,
1372
+ validate: isFiHetu,
1373
+ keywords: [
1374
+ "hetu",
1375
+ "henkilotunnus",
1376
+ "henkilötunnus",
1377
+ "personbeteckning",
1378
+ "sotu",
1379
+ "sosiaaliturvatunnus",
1380
+ ],
1381
+ confidenceWithoutContext: DataConfidence_1.default.High,
1382
+ specificity: 3,
1383
+ isTestValue: isFiTestHetu,
1384
+ },
1385
+ /*
1386
+ * Ireland PPS number: the mod 23 check letter, counting the 2013 second
1387
+ * letter where there is one.
1388
+ */
1389
+ {
1390
+ dataTypeId: "ie-ppsn",
1391
+ quickCheck: Detector_1.hasDigit,
1392
+ pattern: IE_PPSN_PATTERN,
1393
+ normalize: Detector_1.alphanumericUpper,
1394
+ validate: isIePpsn,
1395
+ keywords: [
1396
+ "ppsn",
1397
+ "pps number",
1398
+ "pps no",
1399
+ "pps",
1400
+ "personal public service",
1401
+ ],
1402
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1403
+ specificity: 2,
1404
+ },
1405
+ /*
1406
+ * Switzerland AHV / AVS number: 756, Switzerland's EAN prefix, and the
1407
+ * EAN-13 check digit.
1408
+ */
1409
+ {
1410
+ dataTypeId: "ch-ahv",
1411
+ quickCheck: (0, Detector_1.containsAny)(["756"]),
1412
+ pattern: CH_AHV_PATTERN,
1413
+ normalize: Detector_1.digitsOnly,
1414
+ validate: isChAhv,
1415
+ keywords: [
1416
+ "ahv",
1417
+ "avs",
1418
+ "ahv number",
1419
+ "ahv-nr",
1420
+ "ahv nr",
1421
+ "avs no",
1422
+ "sozialversicherungsnummer",
1423
+ "numero avs",
1424
+ "numéro avs",
1425
+ ],
1426
+ confidenceWithoutContext: DataConfidence_1.default.High,
1427
+ specificity: 3,
1428
+ },
1429
+ ];
1430
+ // SOUTH-EAST EUROPE AND THE MIDDLE EAST.
1431
+ // A CNP: sex and century, YYMMDD, the county, a serial and the check digit.
1432
+ const RO_CNP_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[1-9][0-9]{2}[01][0-9][0-3][0-9]{7}(?![A-Za-z0-9]|[-.][0-9])/g;
1433
+ const RO_CNP_WEIGHTS = [
1434
+ 2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9,
1435
+ ];
1436
+ /*
1437
+ * The century a CNP's first digit carries: 1-2 the 1900s, 3-4 the 1800s,
1438
+ * 5-6 the 2000s. 7-9 (residents and foreigners) do not say, so -1.
1439
+ */
1440
+ function roCnpCentury(sex) {
1441
+ if (sex === 1 || sex === 2) {
1442
+ return 1900;
1443
+ }
1444
+ if (sex === 3 || sex === 4) {
1445
+ return 1800;
1446
+ }
1447
+ return sex === 5 || sex === 6 ? 2000 : -1;
1448
+ }
1449
+ function isRoCnp(digits) {
1450
+ if (digits.length !== 13 || (0, Detector_1.isPlaceholderDigits)(digits)) {
1451
+ return false;
1452
+ }
1453
+ const century = roCnpCentury((0, Validators_1.digitAt)(digits, 0));
1454
+ const year = (0, Validators_1.twoDigits)(digits, 1);
1455
+ const month = (0, Validators_1.twoDigits)(digits, 3);
1456
+ const day = (0, Validators_1.twoDigits)(digits, 5);
1457
+ const realDate = century > 0
1458
+ ? (0, Validators_1.isRealDate)(century + year, month, day)
1459
+ : (0, Validators_1.isRealTwoDigitYearDate)(year, month, day);
1460
+ // Counties 01-52, and 70 and up for registrations made elsewhere.
1461
+ const county = (0, Validators_1.twoDigits)(digits, 7);
1462
+ if (!realDate ||
1463
+ county === 0 ||
1464
+ (county > 52 && county < 70) ||
1465
+ digits.slice(9, 12) === "000") {
1466
+ return false;
1467
+ }
1468
+ const remainder = (0, Validators_1.weightedDigitSum)(digits, RO_CNP_WEIGHTS) % 11;
1469
+ return (remainder === 10 ? 1 : remainder) === (0, Validators_1.digitAt)(digits, 12);
1470
+ }
1471
+ const BG_EGN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}[0-5][0-9][0-3][0-9]{5}(?![A-Za-z0-9]|[-.][0-9])/g;
1472
+ const BG_EGN_WEIGHTS = [2, 4, 8, 5, 10, 9, 7, 3, 6];
1473
+ function isBgEgn(digits) {
1474
+ if (digits.length !== 10 || (0, Detector_1.isPlaceholderDigits)(digits)) {
1475
+ return false;
1476
+ }
1477
+ // The month has 20 added for the 1800s and 40 for the 2000s.
1478
+ let month = (0, Validators_1.twoDigits)(digits, 2);
1479
+ let century = 1900;
1480
+ if (month > 40) {
1481
+ month -= 40;
1482
+ century = 2000;
1483
+ }
1484
+ else if (month > 20) {
1485
+ month -= 20;
1486
+ century = 1800;
1487
+ }
1488
+ const remainder = (0, Validators_1.weightedDigitSum)(digits, BG_EGN_WEIGHTS) % 11;
1489
+ return ((0, Validators_1.isRealDate)(century + (0, Validators_1.twoDigits)(digits, 0), month, (0, Validators_1.twoDigits)(digits, 4)) &&
1490
+ (remainder === 10 ? 0 : remainder) === (0, Validators_1.digitAt)(digits, 9));
1491
+ }
1492
+ // Eleven digits in a row, for Croatia's OIB and Greece's AMKA.
1493
+ const ELEVEN_DIGITS_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{11}(?![A-Za-z0-9]|[-.][0-9])/g;
1494
+ function isHrOib(digits) {
1495
+ return (digits.length === 11 &&
1496
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1497
+ (0, Validators_1.iso7064Mod11Mod10)(digits));
1498
+ }
1499
+ function isGrAmka(digits) {
1500
+ return (digits.length === 11 &&
1501
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1502
+ (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(digits, 4), (0, Validators_1.twoDigits)(digits, 2), (0, Validators_1.twoDigits)(digits, 0)) &&
1503
+ (0, Validators_1.luhn)(digits));
1504
+ }
1505
+ const TR_TCKN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[1-9][0-9]{10}(?![A-Za-z0-9]|[-.][0-9])/g;
1506
+ /*
1507
+ * The two T.C. Kimlik checks: the tenth digit is seven times the sum of
1508
+ * the odd places less the sum of the even ones, modulo 10; the eleventh is
1509
+ * the sum of the first ten, modulo 10.
1510
+ */
1511
+ function isTrTckn(digits) {
1512
+ if (digits.length !== 11 || (0, Detector_1.isPlaceholderDigits)(digits)) {
1513
+ return false;
1514
+ }
1515
+ let odd = 0;
1516
+ let even = 0;
1517
+ for (let index = 0; index < 9; index++) {
1518
+ if (index % 2 === 0) {
1519
+ odd += (0, Validators_1.digitAt)(digits, index);
1520
+ }
1521
+ else {
1522
+ even += (0, Validators_1.digitAt)(digits, index);
1523
+ }
1524
+ }
1525
+ const tenth = (0, Validators_1.digitAt)(digits, 9);
1526
+ return ((((odd * 7 - even) % 10) + 10) % 10 === tenth &&
1527
+ (odd + even + tenth) % 10 === (0, Validators_1.digitAt)(digits, 10));
1528
+ }
1529
+ const IL_TEUDAT_ZEHUT_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{8}-?[0-9](?![A-Za-z0-9]|[-.][0-9])/g;
1530
+ function isIlTeudatZehut(digits) {
1531
+ return digits.length === 9 && !(0, Detector_1.isPlaceholderDigits)(digits) && (0, Validators_1.luhn)(digits);
1532
+ }
1533
+ /*
1534
+ * A South African ID: YYMMDD, four digits for sex, citizenship (0 citizen,
1535
+ * 1 permanent resident, 2 refugee), a digit once used for race, and Luhn.
1536
+ */
1537
+ const ZA_ID_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}[01][0-9][0-3][0-9] ?[0-9]{4} ?[012][0-9]{2}(?![A-Za-z0-9]|[-.][0-9])/g;
1538
+ function isZaId(digits) {
1539
+ return (digits.length === 13 &&
1540
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1541
+ (0, Validators_1.digitAt)(digits, 10) <= 2 &&
1542
+ (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(digits, 0), (0, Validators_1.twoDigits)(digits, 2), (0, Validators_1.twoDigits)(digits, 4)) &&
1543
+ (0, Validators_1.luhn)(digits));
1544
+ }
1545
+ const SOUTH_EAST_EUROPE_AND_MIDDLE_EAST = [
1546
+ /*
1547
+ * Romania CNP: a real birth date in the century the first digit says, a
1548
+ * county code and the check digit weighted 279146358279.
1549
+ */
1550
+ {
1551
+ dataTypeId: "ro-cnp",
1552
+ quickCheck: Detector_1.hasDigit,
1553
+ pattern: RO_CNP_PATTERN,
1554
+ normalize: Detector_1.digitsOnly,
1555
+ validate: isRoCnp,
1556
+ keywords: ["cnp", "cod numeric personal"],
1557
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1558
+ specificity: 2,
1559
+ },
1560
+ /*
1561
+ * Bulgaria EGN: a real birth date in the century the month carries, and
1562
+ * the mod 11 check digit.
1563
+ */
1564
+ {
1565
+ dataTypeId: "bg-egn",
1566
+ quickCheck: Detector_1.hasDigit,
1567
+ pattern: BG_EGN_PATTERN,
1568
+ normalize: Detector_1.digitsOnly,
1569
+ validate: isBgEgn,
1570
+ keywords: ["egn", "егн", "единен граждански номер"],
1571
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1572
+ specificity: 2,
1573
+ // The examples of the EGN's Wikipedia article.
1574
+ isTestValue: sampleValues(["7523169263", "7552010005"]),
1575
+ },
1576
+ /*
1577
+ * Croatia OIB: the ISO 7064 MOD 11,10 check digit and nothing else in
1578
+ * eleven digits, so beside a word.
1579
+ */
1580
+ {
1581
+ dataTypeId: "hr-oib",
1582
+ quickCheck: Detector_1.hasDigit,
1583
+ pattern: ELEVEN_DIGITS_PATTERN,
1584
+ normalize: Detector_1.digitsOnly,
1585
+ validate: isHrOib,
1586
+ keywords: ["oib", "osobni identifikacijski broj"],
1587
+ requiresContext: true,
1588
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1589
+ specificity: 2,
1590
+ },
1591
+ // Greece AMKA: a real DDMMYY birth date and Luhn over the eleven digits.
1592
+ {
1593
+ dataTypeId: "gr-amka",
1594
+ quickCheck: Detector_1.hasDigit,
1595
+ pattern: ELEVEN_DIGITS_PATTERN,
1596
+ normalize: Detector_1.digitsOnly,
1597
+ validate: isGrAmka,
1598
+ keywords: ["amka", "αμκα"],
1599
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1600
+ specificity: 2,
1601
+ },
1602
+ // Turkey T.C. Kimlik number: no leading 0, and both of its check digits.
1603
+ {
1604
+ dataTypeId: "tr-tckn",
1605
+ quickCheck: Detector_1.hasDigit,
1606
+ pattern: TR_TCKN_PATTERN,
1607
+ normalize: Detector_1.digitsOnly,
1608
+ validate: isTrTckn,
1609
+ keywords: [
1610
+ "tc kimlik",
1611
+ "t.c. kimlik",
1612
+ "tckn",
1613
+ "kimlik no",
1614
+ "kimlik numarasi",
1615
+ "kimlik numarası",
1616
+ "tc no",
1617
+ ],
1618
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1619
+ specificity: 2,
1620
+ // The values every T.C. Kimlik validator's documentation tries.
1621
+ isTestValue: sampleValues(["10000000146", "11111111110", "12345678950"]),
1622
+ },
1623
+ /*
1624
+ * Israel Teudat Zehut: Luhn over nine digits (shorter numbers padded with
1625
+ * zeros), which one number in ten passes, so beside a word.
1626
+ */
1627
+ {
1628
+ dataTypeId: "il-teudat-zehut",
1629
+ quickCheck: Detector_1.hasDigit,
1630
+ pattern: IL_TEUDAT_ZEHUT_PATTERN,
1631
+ normalize: Detector_1.digitsOnly,
1632
+ validate: isIlTeudatZehut,
1633
+ keywords: [
1634
+ "teudat zehut",
1635
+ "israeli id",
1636
+ "zehut",
1637
+ "mispar zehut",
1638
+ "תעודת זהות",
1639
+ "ת.ז",
1640
+ ],
1641
+ requiresContext: true,
1642
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1643
+ specificity: 2,
1644
+ },
1645
+ /*
1646
+ * South Africa ID number: a real birth date, a citizenship digit of 0-2
1647
+ * and Luhn over the thirteen digits.
1648
+ */
1649
+ {
1650
+ dataTypeId: "za-id",
1651
+ quickCheck: Detector_1.hasDigit,
1652
+ pattern: ZA_ID_PATTERN,
1653
+ normalize: Detector_1.digitsOnly,
1654
+ validate: isZaId,
1655
+ keywords: [
1656
+ "sa id",
1657
+ "rsa id",
1658
+ "id number",
1659
+ "identity number",
1660
+ "south african id",
1661
+ ],
1662
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1663
+ specificity: 2,
1664
+ // The number in the Department of Home Affairs' explanation of the ID.
1665
+ isTestValue: sampleValues(["8001015009087"]),
1666
+ },
1667
+ ];
1668
+ // ASIA.
1669
+ // An Emirates ID: 784, the year of birth, a serial and a Luhn digit.
1670
+ const AE_EMIRATES_ID_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])784[- ]?(?:19|20)[0-9]{2}[- ]?[0-9]{7}[- ]?[0-9](?![A-Za-z0-9]|[-.][0-9])/g;
1671
+ function isAeEmiratesId(digits) {
1672
+ return (digits.length === 15 &&
1673
+ digits.startsWith("784") &&
1674
+ Number(digits.slice(3, 7)) <= new Date().getFullYear() &&
1675
+ !(0, Detector_1.isPlaceholderDigits)(digits.slice(7, 14)) &&
1676
+ (0, Validators_1.luhn)(digits));
1677
+ }
1678
+ // A Saudi ID: 1 for a citizen, 2 for a resident's iqama, then nine digits.
1679
+ const SA_NATIONAL_ID_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[12][0-9]{9}(?![A-Za-z0-9]|[-.][0-9])/g;
1680
+ function isSaNationalId(digits) {
1681
+ return (digits.length === 10 &&
1682
+ (digits[0] === "1" || digits[0] === "2") &&
1683
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1684
+ (0, Validators_1.luhn)(digits));
1685
+ }
1686
+ // An Aadhaar number as it is printed, in three groups of four.
1687
+ const IN_AADHAAR_GROUPED_PATTERN = /(?<![A-Za-z0-9]|[0-9][-. ])[2-9][0-9]{3}(?: [0-9]{4} |-[0-9]{4}-)[0-9]{4}(?![A-Za-z0-9]|[-. ][0-9])/g;
1688
+ const IN_AADHAAR_BARE_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[2-9][0-9]{11}(?![A-Za-z0-9]|[-.][0-9])/g;
1689
+ const IN_AADHAAR_KEYWORDS = [
1690
+ "aadhaar",
1691
+ "aadhar",
1692
+ "uid number",
1693
+ "uidai",
1694
+ "आधार",
1695
+ ];
1696
+ // UIDAI never issues 0 or 1 first, and the last digit is a Verhoeff check.
1697
+ function isInAadhaar(digits) {
1698
+ return (digits.length === 12 &&
1699
+ (0, Validators_1.digitAt)(digits, 0) >= 2 &&
1700
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1701
+ (0, Validators_1.verhoeff)(digits));
1702
+ }
1703
+ // The residents of UIDAI's authentication sandbox: 9999 9999 00xx.
1704
+ function isAadhaarSandboxNumber(digits) {
1705
+ return digits.startsWith("99999999");
1706
+ }
1707
+ /*
1708
+ * A PAN: five letters, four digits and a letter. The fourth letter is the
1709
+ * kind of holder - P a person, C a company, H a Hindu undivided family, F a
1710
+ * firm, A, B, G, J, K, L, T and E the other kinds the Income Tax
1711
+ * Department lists.
1712
+ */
1713
+ const IN_PAN_PATTERN = /(?<![A-Za-z0-9])[A-Z]{3}[ABCEFGHJKLPT][A-Z][0-9]{4}[A-Z](?![A-Za-z0-9])/g;
1714
+ function isInPan(value) {
1715
+ return value.length === 10 && value.slice(5, 9) !== "0000";
1716
+ }
1717
+ /*
1718
+ * A resident identity number: the six-digit region code, the birth date
1719
+ * as YYYYMMDD, a sequence number and the check character (0-9 or X).
1720
+ */
1721
+ const CN_RESIDENT_ID_PATTERN = /(?<![A-Za-z0-9])[1-8][0-9]{5}(?:19|20)[0-9]{2}[01][0-9][0-3][0-9]{4}[0-9Xx](?![A-Za-z0-9])/g;
1722
+ // The provinces a region code starts with (71 Taiwan, 81-83 HK, Macau, Taiwan residents).
1723
+ const CN_PROVINCES = new Set([
1724
+ "11",
1725
+ "12",
1726
+ "13",
1727
+ "14",
1728
+ "15",
1729
+ "21",
1730
+ "22",
1731
+ "23",
1732
+ "31",
1733
+ "32",
1734
+ "33",
1735
+ "34",
1736
+ "35",
1737
+ "36",
1738
+ "37",
1739
+ "41",
1740
+ "42",
1741
+ "43",
1742
+ "44",
1743
+ "45",
1744
+ "46",
1745
+ "50",
1746
+ "51",
1747
+ "52",
1748
+ "53",
1749
+ "54",
1750
+ "61",
1751
+ "62",
1752
+ "63",
1753
+ "64",
1754
+ "65",
1755
+ "71",
1756
+ "81",
1757
+ "82",
1758
+ "83",
1759
+ ]);
1760
+ // ISO 7064 MOD 11-2, as GB 11643 writes it: the weights and check characters.
1761
+ const CN_RESIDENT_ID_WEIGHTS = [
1762
+ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2,
1763
+ ];
1764
+ const CN_CHECK_CHARACTERS = "10X98765432";
1765
+ function isCnResidentId(value) {
1766
+ if (value.length !== 18 || !CN_PROVINCES.has(value.slice(0, 2))) {
1767
+ return false;
1768
+ }
1769
+ const year = Number(value.slice(6, 10));
1770
+ return (year <= new Date().getFullYear() &&
1771
+ (0, Validators_1.isRealDate)(year, (0, Validators_1.twoDigits)(value, 10), (0, Validators_1.twoDigits)(value, 12)) &&
1772
+ CN_CHECK_CHARACTERS[(0, Validators_1.weightedDigitSum)(value, CN_RESIDENT_ID_WEIGHTS) % 11] === value[17]);
1773
+ }
1774
+ // Twelve digits, often in groups of four, for Japan's My Number.
1775
+ const JP_MY_NUMBER_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{4}[ -]?[0-9]{4}[ -]?[0-9]{4}(?![A-Za-z0-9]|[-.][0-9])/g;
1776
+ const JP_MY_NUMBER_WEIGHTS = [
1777
+ 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2,
1778
+ ];
1779
+ function isJpMyNumber(digits) {
1780
+ return (digits.length === 12 &&
1781
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1782
+ mod11CheckDigit((0, Validators_1.weightedDigitSum)(digits, JP_MY_NUMBER_WEIGHTS)) ===
1783
+ (0, Validators_1.digitAt)(digits, 11));
1784
+ }
1785
+ // YYMMDD-SNNNNNN: the seventh digit carries sex and century.
1786
+ const KR_RRN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}[01][0-9][0-3][0-9]-?[1-8][0-9]{6}(?![A-Za-z0-9]|[-.][0-9])/g;
1787
+ function isKrRrn(digits) {
1788
+ if (digits.length !== 13 || (0, Detector_1.isPlaceholderDigits)(digits)) {
1789
+ return false;
1790
+ }
1791
+ // 1, 2, 5 and 6 were born in the 1900s; 3, 4, 7 and 8 from 2000.
1792
+ const marker = (0, Validators_1.digitAt)(digits, 6);
1793
+ const century = marker === 3 || marker === 4 || marker === 7 || marker === 8 ? 2000 : 1900;
1794
+ return (0, Validators_1.isRealDate)(century + (0, Validators_1.twoDigits)(digits, 0), (0, Validators_1.twoDigits)(digits, 2), (0, Validators_1.twoDigits)(digits, 4));
1795
+ }
1796
+ /*
1797
+ * An NRIC or FIN: S or T (citizens and permanent residents, born before or
1798
+ * from 2000), F or G (foreigners, likewise), M (foreigners from 2022), seven
1799
+ * digits and the check letter.
1800
+ */
1801
+ const SG_NRIC_PATTERN = /(?<![A-Za-z0-9])[STFGMstfgm][0-9]{7}[A-Za-z](?![A-Za-z0-9])/g;
1802
+ const SG_NRIC_WEIGHTS = [2, 7, 6, 5, 4, 3, 2];
1803
+ // The check letters by remainder. M's table has J where F and G have M.
1804
+ function sgNricCheckLetters(prefix) {
1805
+ if (prefix === "S" || prefix === "T") {
1806
+ return "JZIHGFEDCBA";
1807
+ }
1808
+ return prefix === "M" ? "XWUTRQPNJLK" : "XWUTRQPNMLK";
1809
+ }
1810
+ // What the series adds to the weighted sum: 4 for T and G, 3 for M.
1811
+ function sgNricOffset(prefix) {
1812
+ if (prefix === "T" || prefix === "G") {
1813
+ return 4;
1814
+ }
1815
+ return prefix === "M" ? 3 : 0;
1816
+ }
1817
+ function isSgNric(value) {
1818
+ if (value.length !== 9 || (0, Detector_1.isPlaceholderDigits)(value.slice(1, 8))) {
1819
+ return false;
1820
+ }
1821
+ const prefix = value[0];
1822
+ const remainder = ((0, Validators_1.weightedDigitSum)(value.slice(1), SG_NRIC_WEIGHTS) + sgNricOffset(prefix)) %
1823
+ 11;
1824
+ return sgNricCheckLetters(prefix)[remainder] === value[8];
1825
+ }
1826
+ // An HKID: one or two letters, six digits and the check digit, as A123456(3).
1827
+ const HK_HKID_PATTERN = /(?<![A-Za-z0-9])[A-Z]{1,2}[0-9]{6} ?(?:\([0-9A]\)|[0-9A])(?![A-Za-z0-9])/g;
1828
+ /*
1829
+ * Letters count from 10 (A) and a single letter has a space (36) before
1830
+ * it; with the check digit (A for 10) the weighted sum is a multiple of 11.
1831
+ */
1832
+ function isHkHkid(value) {
1833
+ const letters = value.length - 7;
1834
+ if ((letters !== 1 && letters !== 2) ||
1835
+ (0, Detector_1.isPlaceholderDigits)(value.slice(letters, letters + 6))) {
1836
+ return false;
1837
+ }
1838
+ let sum = letters === 1 ? 36 * 9 : (value.charCodeAt(0) - 55) * 9;
1839
+ sum += (value.charCodeAt(letters - 1) - 55) * 8;
1840
+ sum += (0, Validators_1.weightedDigitSum)(value.slice(letters), [7, 6, 5, 4, 3, 2]);
1841
+ const remainder = sum % 11;
1842
+ const check = remainder === 0 ? 0 : 11 - remainder;
1843
+ return value.endsWith(check === 10 ? "A" : String(check));
1844
+ }
1845
+ /*
1846
+ * A Taiwanese ID: the letter of the place of registration, 1 or 2 for sex
1847
+ * (8 or 9 on a resident foreigner's new number) and eight digits.
1848
+ */
1849
+ const TW_NATIONAL_ID_PATTERN = /(?<![A-Za-z0-9])[A-Za-z][1289][0-9]{8}(?![A-Za-z0-9])/g;
1850
+ // The first letters in the order of their values, 10 (A) to 35 (O).
1851
+ const TW_LETTERS = "ABCDEFGHJKLMNPQRSTUVXYWZIO";
1852
+ function isTwNationalId(value) {
1853
+ const letter = TW_LETTERS.indexOf(value[0]) + 10;
1854
+ if (value.length !== 10 ||
1855
+ letter < 10 ||
1856
+ (0, Detector_1.isPlaceholderDigits)(value.slice(2, 9))) {
1857
+ return false;
1858
+ }
1859
+ const sum = Math.floor(letter / 10) +
1860
+ (letter % 10) * 9 +
1861
+ (0, Validators_1.weightedDigitSum)(value.slice(1), [8, 7, 6, 5, 4, 3, 2, 1, 1]);
1862
+ return sum % 10 === 0;
1863
+ }
1864
+ // A Thai ID: 1-2345-67890-12-1, the first digit the kind of holder (1-8).
1865
+ const TH_NATIONAL_ID_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[1-8][- ]?[0-9]{4}[- ]?[0-9]{5}[- ]?[0-9]{2}[- ]?[0-9](?![A-Za-z0-9]|[-.][0-9])/g;
1866
+ const TH_NATIONAL_ID_WEIGHTS = [
1867
+ 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2,
1868
+ ];
1869
+ function isThNationalId(digits) {
1870
+ return (digits.length === 13 &&
1871
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1872
+ (11 - ((0, Validators_1.weightedDigitSum)(digits, TH_NATIONAL_ID_WEIGHTS) % 11)) % 10 ===
1873
+ (0, Validators_1.digitAt)(digits, 12));
1874
+ }
1875
+ // A MyKad number: YYMMDD-PB-NNNN, PB the place of birth.
1876
+ const MY_MYKAD_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2}[01][0-9][0-3][0-9]-?[0-9]{2}-?[0-9]{4}(?![A-Za-z0-9]|[-.][0-9])/g;
1877
+ /*
1878
+ * Place-of-birth codes the National Registration Department uses: 01-16
1879
+ * and 21-59 the states, 60-68, 71-72, 74-79 and 82-93 other places, 98
1880
+ * and 99 the stateless and unknown.
1881
+ */
1882
+ function isMyBirthPlace(code) {
1883
+ return ((code >= 1 && code <= 16) ||
1884
+ (code >= 21 && code <= 68) ||
1885
+ code === 71 ||
1886
+ code === 72 ||
1887
+ (code >= 74 && code <= 79) ||
1888
+ (code >= 82 && code <= 93) ||
1889
+ code >= 98);
1890
+ }
1891
+ function isMyMykad(digits) {
1892
+ return (digits.length === 12 &&
1893
+ !(0, Detector_1.isPlaceholderDigits)(digits) &&
1894
+ (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(digits, 0), (0, Validators_1.twoDigits)(digits, 2), (0, Validators_1.twoDigits)(digits, 4)) &&
1895
+ isMyBirthPlace((0, Validators_1.twoDigits)(digits, 6)) &&
1896
+ digits.slice(8) !== "0000");
1897
+ }
1898
+ /*
1899
+ * A NIK: province, regency and district codes, the birth date as DDMMYY
1900
+ * (40 added to a woman's day) and a serial.
1901
+ */
1902
+ const ID_NIK_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[1-9][0-9]{5}[0-7][0-9][01][0-9]{3}[0-9]{4}(?![A-Za-z0-9]|[-.][0-9])/g;
1903
+ const ID_PROVINCES = new Set([
1904
+ "11",
1905
+ "12",
1906
+ "13",
1907
+ "14",
1908
+ "15",
1909
+ "16",
1910
+ "17",
1911
+ "18",
1912
+ "19",
1913
+ "21",
1914
+ "31",
1915
+ "32",
1916
+ "33",
1917
+ "34",
1918
+ "35",
1919
+ "36",
1920
+ "51",
1921
+ "52",
1922
+ "53",
1923
+ "61",
1924
+ "62",
1925
+ "63",
1926
+ "64",
1927
+ "65",
1928
+ "71",
1929
+ "72",
1930
+ "73",
1931
+ "74",
1932
+ "75",
1933
+ "76",
1934
+ "81",
1935
+ "82",
1936
+ "91",
1937
+ "92",
1938
+ "93",
1939
+ "94",
1940
+ "95",
1941
+ "96",
1942
+ ]);
1943
+ function isIdNik(digits) {
1944
+ if (digits.length !== 16 ||
1945
+ !ID_PROVINCES.has(digits.slice(0, 2)) ||
1946
+ digits.slice(2, 4) === "00" ||
1947
+ digits.slice(4, 6) === "00" ||
1948
+ digits.slice(12) === "0000") {
1949
+ return false;
1950
+ }
1951
+ let day = (0, Validators_1.twoDigits)(digits, 6);
1952
+ if (day > 40) {
1953
+ day -= 40;
1954
+ }
1955
+ return (0, Validators_1.isRealTwoDigitYearDate)((0, Validators_1.twoDigits)(digits, 10), (0, Validators_1.twoDigits)(digits, 8), day);
1956
+ }
1957
+ const ASIA = [
1958
+ /*
1959
+ * UAE Emirates ID: 784 (the UAE's ISO code), a year of birth that has
1960
+ * passed, and Luhn over the fifteen digits.
1961
+ */
1962
+ {
1963
+ dataTypeId: "ae-emirates-id",
1964
+ quickCheck: (0, Detector_1.containsAny)(["784"]),
1965
+ pattern: AE_EMIRATES_ID_PATTERN,
1966
+ normalize: Detector_1.digitsOnly,
1967
+ validate: isAeEmiratesId,
1968
+ keywords: ["emirates id", "eid", "emirates identity", "uae id"],
1969
+ confidenceWithoutContext: DataConfidence_1.default.High,
1970
+ specificity: 3,
1971
+ },
1972
+ /*
1973
+ * Saudi national ID or iqama: a 1 or a 2 and Luhn. Ten digits starting
1974
+ * with 1 are what a Unix timestamp is, so beside a word.
1975
+ */
1976
+ {
1977
+ dataTypeId: "sa-national-id",
1978
+ quickCheck: Detector_1.hasDigit,
1979
+ pattern: SA_NATIONAL_ID_PATTERN,
1980
+ normalize: Detector_1.digitsOnly,
1981
+ validate: isSaNationalId,
1982
+ keywords: ["iqama", "saudi id", "national id", "muqeem", "هوية", "إقامة"],
1983
+ requiresContext: true,
1984
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1985
+ specificity: 3,
1986
+ },
1987
+ /*
1988
+ * India Aadhaar number, printed in groups of four: a first digit of 2-9
1989
+ * and the Verhoeff check digit.
1990
+ */
1991
+ {
1992
+ dataTypeId: "in-aadhaar",
1993
+ quickCheck: Detector_1.hasDigit,
1994
+ pattern: IN_AADHAAR_GROUPED_PATTERN,
1995
+ normalize: Detector_1.digitsOnly,
1996
+ validate: isInAadhaar,
1997
+ keywords: IN_AADHAAR_KEYWORDS,
1998
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
1999
+ specificity: 2,
2000
+ isTestValue: isAadhaarSandboxNumber,
2001
+ },
2002
+ // An Aadhaar number as twelve bare digits, only beside a word.
2003
+ {
2004
+ dataTypeId: "in-aadhaar",
2005
+ quickCheck: Detector_1.hasDigit,
2006
+ pattern: IN_AADHAAR_BARE_PATTERN,
2007
+ normalize: Detector_1.digitsOnly,
2008
+ validate: isInAadhaar,
2009
+ keywords: IN_AADHAAR_KEYWORDS,
2010
+ requiresContext: true,
2011
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2012
+ specificity: 2,
2013
+ isTestValue: isAadhaarSandboxNumber,
2014
+ },
2015
+ /*
2016
+ * India PAN: its layout and a holder kind the Income Tax Department
2017
+ * uses. The last letter is a check character whose algorithm is not
2018
+ * published, so the format is all there is (Low) - but it is its own.
2019
+ */
2020
+ {
2021
+ dataTypeId: "in-pan",
2022
+ quickCheck: Detector_1.hasDigit,
2023
+ pattern: IN_PAN_PATTERN,
2024
+ validate: isInPan,
2025
+ keywords: [
2026
+ "pan",
2027
+ "pan number",
2028
+ "pan no",
2029
+ "pan card",
2030
+ "permanent account number",
2031
+ ],
2032
+ confidenceWithoutContext: DataConfidence_1.default.Low,
2033
+ specificity: 1,
2034
+ // The examples on the Income Tax Department's and NSDL's forms.
2035
+ isTestValue: sampleValues(["AAAPL1234C", "AAAPZ1234C"]),
2036
+ },
2037
+ /*
2038
+ * China resident identity number: a province code, a real birth date
2039
+ * that has passed and the ISO 7064 MOD 11-2 check character.
2040
+ */
2041
+ {
2042
+ dataTypeId: "cn-resident-id",
2043
+ quickCheck: Detector_1.hasDigit,
2044
+ pattern: CN_RESIDENT_ID_PATTERN,
2045
+ normalize: Detector_1.alphanumericUpper,
2046
+ validate: isCnResidentId,
2047
+ keywords: [
2048
+ "resident id",
2049
+ "shenfenzheng",
2050
+ "id card",
2051
+ "身份证",
2052
+ "身份证号",
2053
+ "公民身份号码",
2054
+ ],
2055
+ confidenceWithoutContext: DataConfidence_1.default.High,
2056
+ specificity: 3,
2057
+ // The example of GB 11643's Wikipedia article.
2058
+ isTestValue: sampleValues(["11010519491231002X"]),
2059
+ },
2060
+ /*
2061
+ * Japan My Number: the mod 11 check digit over twelve digits - one in
2062
+ * eleven passes, so beside a word.
2063
+ */
2064
+ {
2065
+ dataTypeId: "jp-my-number",
2066
+ quickCheck: Detector_1.hasDigit,
2067
+ pattern: JP_MY_NUMBER_PATTERN,
2068
+ normalize: Detector_1.digitsOnly,
2069
+ validate: isJpMyNumber,
2070
+ keywords: [
2071
+ "my number",
2072
+ "mynumber",
2073
+ "kojin bango",
2074
+ "個人番号",
2075
+ "マイナンバー",
2076
+ ],
2077
+ requiresContext: true,
2078
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2079
+ specificity: 2,
2080
+ // The example the Digital Agency's and validators' documentation uses.
2081
+ isTestValue: sampleValues(["123456789018"]),
2082
+ },
2083
+ /*
2084
+ * South Korea RRN: a real birth date in the century the seventh digit
2085
+ * says. Numbers issued since October 2020 have no check digit, so the
2086
+ * date is all there is, and the number counts only beside a word.
2087
+ */
2088
+ {
2089
+ dataTypeId: "kr-rrn",
2090
+ quickCheck: Detector_1.hasDigit,
2091
+ pattern: KR_RRN_PATTERN,
2092
+ normalize: Detector_1.digitsOnly,
2093
+ validate: isKrRrn,
2094
+ keywords: [
2095
+ "rrn",
2096
+ "resident registration",
2097
+ "resident registration number",
2098
+ "jumin",
2099
+ "주민등록번호",
2100
+ "주민번호",
2101
+ ],
2102
+ requiresContext: true,
2103
+ confidenceWithoutContext: DataConfidence_1.default.Low,
2104
+ specificity: 1,
2105
+ },
2106
+ /*
2107
+ * Singapore NRIC / FIN: the series letter and the check letter its
2108
+ * weighted sum gives, in each series' own table.
2109
+ */
2110
+ {
2111
+ dataTypeId: "sg-nric",
2112
+ quickCheck: Detector_1.hasDigit,
2113
+ pattern: SG_NRIC_PATTERN,
2114
+ normalize: Detector_1.alphanumericUpper,
2115
+ validate: isSgNric,
2116
+ keywords: ["nric", "fin", "ic number", "identity card"],
2117
+ confidenceWithoutContext: DataConfidence_1.default.High,
2118
+ specificity: 3,
2119
+ },
2120
+ // Hong Kong ID: its letters and the mod 11 check digit (A for 10).
2121
+ {
2122
+ dataTypeId: "hk-hkid",
2123
+ quickCheck: Detector_1.hasDigit,
2124
+ pattern: HK_HKID_PATTERN,
2125
+ normalize: Detector_1.alphanumericUpper,
2126
+ validate: isHkHkid,
2127
+ keywords: ["hkid", "hong kong id", "hong kong identity", "身份證"],
2128
+ confidenceWithoutContext: DataConfidence_1.default.High,
2129
+ specificity: 3,
2130
+ },
2131
+ /*
2132
+ * Taiwan national ID: the place letter's value, the sex digit and the
2133
+ * mod 10 check over the weighted digits.
2134
+ */
2135
+ {
2136
+ dataTypeId: "tw-national-id",
2137
+ quickCheck: Detector_1.hasDigit,
2138
+ pattern: TW_NATIONAL_ID_PATTERN,
2139
+ normalize: Detector_1.alphanumericUpper,
2140
+ validate: isTwNationalId,
2141
+ keywords: ["taiwan id", "national id", "身分證", "身分證字號", "統一證號"],
2142
+ confidenceWithoutContext: DataConfidence_1.default.High,
2143
+ specificity: 3,
2144
+ },
2145
+ /*
2146
+ * Thailand national ID: the mod 11 check digit over thirteen digits. One
2147
+ * in eleven passes and millisecond timestamps are thirteen digits too, so
2148
+ * beside a word.
2149
+ */
2150
+ {
2151
+ dataTypeId: "th-national-id",
2152
+ quickCheck: Detector_1.hasDigit,
2153
+ pattern: TH_NATIONAL_ID_PATTERN,
2154
+ normalize: Detector_1.digitsOnly,
2155
+ validate: isThNationalId,
2156
+ keywords: [
2157
+ "thai id",
2158
+ "citizen id",
2159
+ "national id",
2160
+ "เลขประจำตัวประชาชน",
2161
+ "บัตรประชาชน",
2162
+ ],
2163
+ requiresContext: true,
2164
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2165
+ specificity: 2,
2166
+ },
2167
+ /*
2168
+ * Malaysia MyKad number: a real birth date and a place-of-birth code. No
2169
+ * check digit, so beside a word.
2170
+ */
2171
+ {
2172
+ dataTypeId: "my-mykad",
2173
+ quickCheck: Detector_1.hasDigit,
2174
+ pattern: MY_MYKAD_PATTERN,
2175
+ normalize: Detector_1.digitsOnly,
2176
+ validate: isMyMykad,
2177
+ keywords: [
2178
+ "mykad",
2179
+ "nric",
2180
+ "ic number",
2181
+ "ic no",
2182
+ "kad pengenalan",
2183
+ "no kp",
2184
+ "mykid",
2185
+ ],
2186
+ requiresContext: true,
2187
+ confidenceWithoutContext: DataConfidence_1.default.Low,
2188
+ specificity: 1,
2189
+ },
2190
+ /*
2191
+ * Indonesia NIK: a province code and a real birth date. No check digit,
2192
+ * and sixteen digits is a card number's length, so beside a word.
2193
+ */
2194
+ {
2195
+ dataTypeId: "id-nik",
2196
+ quickCheck: Detector_1.hasDigit,
2197
+ pattern: ID_NIK_PATTERN,
2198
+ normalize: Detector_1.digitsOnly,
2199
+ validate: isIdNik,
2200
+ keywords: [
2201
+ "nik",
2202
+ "nomor induk kependudukan",
2203
+ "ktp",
2204
+ "e-ktp",
2205
+ "no ktp",
2206
+ "nomor ktp",
2207
+ ],
2208
+ requiresContext: true,
2209
+ confidenceWithoutContext: DataConfidence_1.default.Low,
2210
+ specificity: 1,
2211
+ },
2212
+ ];
2213
+ // OCEANIA AND RUSSIA.
2214
+ // A TFN: nine digits in threes, or an older eight-digit one.
2215
+ const AU_TFN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])(?:[0-9]{3}[ -]?[0-9]{3}[ -]?[0-9]{3}|[0-9]{2}[ -]?[0-9]{3}[ -]?[0-9]{3})(?![A-Za-z0-9]|[-.][0-9])/g;
2216
+ const AU_TFN_WEIGHTS = [1, 4, 3, 7, 5, 8, 6, 9, 10];
2217
+ const AU_TFN_EIGHT_DIGIT_WEIGHTS = [
2218
+ 10, 7, 8, 4, 6, 3, 5, 1,
2219
+ ];
2220
+ function isAuTfn(digits) {
2221
+ if ((digits.length !== 8 && digits.length !== 9) ||
2222
+ (0, Detector_1.isPlaceholderDigits)(digits)) {
2223
+ return false;
2224
+ }
2225
+ const weights = digits.length === 9 ? AU_TFN_WEIGHTS : AU_TFN_EIGHT_DIGIT_WEIGHTS;
2226
+ return (0, Validators_1.weightedDigitSum)(digits, weights) % 11 === 0;
2227
+ }
2228
+ // An IRD number: eight or nine digits, typed 123-456-789 or 12-345-678.
2229
+ const NZ_IRD_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{2,3}-?[0-9]{3}-?[0-9]{3}(?![A-Za-z0-9]|[-.][0-9])/g;
2230
+ const NZ_IRD_PRIMARY_WEIGHTS = [3, 2, 7, 6, 5, 4, 3, 2];
2231
+ const NZ_IRD_SECONDARY_WEIGHTS = [
2232
+ 7, 4, 3, 2, 5, 2, 7, 6,
2233
+ ];
2234
+ function nzIrdCheckDigit(digits, weights) {
2235
+ const remainder = (0, Validators_1.weightedDigitSum)(digits, weights) % 11;
2236
+ return remainder === 0 ? 0 : 11 - remainder;
2237
+ }
2238
+ /*
2239
+ * Inland Revenue's check: numbers 10-000-000 to 150-000-000, the base
2240
+ * eight digits (an eight-digit number with a 0 in front) weighted
2241
+ * 3, 2, 7, 6, 5, 4, 3, 2; where that gives 10, the secondary weights
2242
+ * 7, 4, 3, 2, 5, 2, 7, 6 decide, and a 10 again is no number.
2243
+ */
2244
+ function isNzIrd(digits) {
2245
+ if (digits.length !== 8 && digits.length !== 9) {
2246
+ return false;
2247
+ }
2248
+ const padded = digits.length === 8 ? "0" + digits : digits;
2249
+ const number = Number(padded);
2250
+ if (number < 10000000 || number > 150000000 || (0, Detector_1.isPlaceholderDigits)(digits)) {
2251
+ return false;
2252
+ }
2253
+ let check = nzIrdCheckDigit(padded, NZ_IRD_PRIMARY_WEIGHTS);
2254
+ if (check === 10) {
2255
+ check = nzIrdCheckDigit(padded, NZ_IRD_SECONDARY_WEIGHTS);
2256
+ }
2257
+ return check === (0, Validators_1.digitAt)(padded, 8);
2258
+ }
2259
+ // A SNILS: XXX-XXX-XXX YY.
2260
+ const RU_SNILS_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])[0-9]{3}-?[0-9]{3}-?[0-9]{3}[- ]?[0-9]{2}(?![A-Za-z0-9]|[-.][0-9])/g;
2261
+ const RU_SNILS_WEIGHTS = [9, 8, 7, 6, 5, 4, 3, 2, 1];
2262
+ /*
2263
+ * The check number is the weighted sum modulo 101, where 100 is written 00.
2264
+ * Numbers up to 001-001-998 were issued before there was a check number.
2265
+ */
2266
+ function isRuSnils(digits) {
2267
+ if (digits.length !== 11 ||
2268
+ (0, Detector_1.isPlaceholderDigits)(digits) ||
2269
+ Number(digits.slice(0, 9)) <= 1001998) {
2270
+ return false;
2271
+ }
2272
+ const check = (0, Validators_1.weightedDigitSum)(digits, RU_SNILS_WEIGHTS) % 101;
2273
+ return (check === 100 ? 0 : check) === (0, Validators_1.twoDigits)(digits, 9);
2274
+ }
2275
+ // An INN: ten digits for an organisation, twelve for a person.
2276
+ const RU_INN_PATTERN = /(?<![A-Za-z0-9]|[0-9][-.])(?:[0-9]{12}|[0-9]{10})(?![A-Za-z0-9]|[-.][0-9])/g;
2277
+ const RU_INN_TEN_WEIGHTS = [2, 4, 10, 3, 5, 9, 4, 6, 8];
2278
+ const RU_INN_ELEVEN_WEIGHTS = [
2279
+ 7, 2, 4, 10, 3, 5, 9, 4, 6, 8,
2280
+ ];
2281
+ const RU_INN_TWELVE_WEIGHTS = [
2282
+ 3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8,
2283
+ ];
2284
+ // The weighted sum modulo 11, then modulo 10.
2285
+ function ruInnCheckDigit(digits, weights) {
2286
+ return ((0, Validators_1.weightedDigitSum)(digits, weights) % 11) % 10;
2287
+ }
2288
+ function isRuInn(digits) {
2289
+ // The first two digits are a region code, never 00.
2290
+ if ((0, Detector_1.isPlaceholderDigits)(digits) || digits.startsWith("00")) {
2291
+ return false;
2292
+ }
2293
+ if (digits.length === 10) {
2294
+ return ruInnCheckDigit(digits, RU_INN_TEN_WEIGHTS) === (0, Validators_1.digitAt)(digits, 9);
2295
+ }
2296
+ return (digits.length === 12 &&
2297
+ ruInnCheckDigit(digits, RU_INN_ELEVEN_WEIGHTS) === (0, Validators_1.digitAt)(digits, 10) &&
2298
+ ruInnCheckDigit(digits, RU_INN_TWELVE_WEIGHTS) === (0, Validators_1.digitAt)(digits, 11));
2299
+ }
2300
+ const OCEANIA_AND_RUSSIA = [
2301
+ /*
2302
+ * Australia TFN: the ATO's weighted sum is a multiple of 11, for nine
2303
+ * digits and for the older eight. Nothing else is in it, so beside a word.
2304
+ */
2305
+ {
2306
+ dataTypeId: "au-tfn",
2307
+ quickCheck: Detector_1.hasDigit,
2308
+ pattern: AU_TFN_PATTERN,
2309
+ normalize: Detector_1.digitsOnly,
2310
+ validate: isAuTfn,
2311
+ keywords: ["tfn", "tax file number", "tax file no"],
2312
+ requiresContext: true,
2313
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2314
+ specificity: 2,
2315
+ // The example in the ATO's own guidance.
2316
+ isTestValue: sampleValues(["123456782"]),
2317
+ },
2318
+ /*
2319
+ * New Zealand IRD number: its range and the check digit from the primary
2320
+ * or the secondary weights, beside a word.
2321
+ */
2322
+ {
2323
+ dataTypeId: "nz-ird",
2324
+ quickCheck: Detector_1.hasDigit,
2325
+ pattern: NZ_IRD_PATTERN,
2326
+ normalize: Detector_1.digitsOnly,
2327
+ validate: isNzIrd,
2328
+ keywords: ["ird", "ird number", "ird no", "inland revenue"],
2329
+ requiresContext: true,
2330
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2331
+ specificity: 2,
2332
+ // The examples in Inland Revenue's specification of the check.
2333
+ isTestValue: sampleValues(["49091850", "136410132"]),
2334
+ },
2335
+ // Russia SNILS: the two-digit check number modulo 101.
2336
+ {
2337
+ dataTypeId: "ru-snils",
2338
+ quickCheck: Detector_1.hasDigit,
2339
+ pattern: RU_SNILS_PATTERN,
2340
+ normalize: Detector_1.digitsOnly,
2341
+ validate: isRuSnils,
2342
+ keywords: ["snils", "снилс", "страховой номер"],
2343
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2344
+ specificity: 2,
2345
+ },
2346
+ /*
2347
+ * Russia INN: one check digit for ten digits, two for twelve, each the
2348
+ * weighted sum modulo 11 and 10. Beside a word.
2349
+ */
2350
+ {
2351
+ dataTypeId: "ru-inn",
2352
+ quickCheck: Detector_1.hasDigit,
2353
+ pattern: RU_INN_PATTERN,
2354
+ normalize: Detector_1.digitsOnly,
2355
+ validate: isRuInn,
2356
+ keywords: ["inn", "инн", "taxpayer number"],
2357
+ requiresContext: true,
2358
+ confidenceWithoutContext: DataConfidence_1.default.Medium,
2359
+ specificity: 2,
2360
+ // Sberbank's INN, the example every INN validator uses.
2361
+ isTestValue: sampleValues(["7707083893"]),
2362
+ },
2363
+ ];
2364
+ // ANY COUNTRY.
2365
+ // Six to nine letters and digits, the length of every country's passport numbers.
2366
+ const PASSPORT_NUMBER_PATTERN = /(?<![A-Za-z0-9])[A-Za-z0-9]{6,9}(?![A-Za-z0-9])/g;
2367
+ // At least five digits and at most three letters, and no placeholder.
2368
+ function isPassportNumber(value) {
2369
+ const digits = (0, Detector_1.digitsOnly)(value);
2370
+ return (value.length >= 6 &&
2371
+ value.length <= 9 &&
2372
+ digits.length >= 5 &&
2373
+ value.length - digits.length <= 3 &&
2374
+ !(0, Detector_1.isPlaceholderDigits)(digits));
2375
+ }
2376
+ /*
2377
+ * A passport number from anywhere: a country's numbers have no check
2378
+ * digit of their own (only the machine-readable zone carries one), so it
2379
+ * counts only beside "passport" in some language.
2380
+ */
2381
+ const PASSPORT_NUMBER_DETECTOR = {
2382
+ dataTypeId: "passport-number",
2383
+ quickCheck: Detector_1.hasDigit,
2384
+ pattern: PASSPORT_NUMBER_PATTERN,
2385
+ normalize: Detector_1.alphanumericUpper,
2386
+ validate: isPassportNumber,
2387
+ keywords: [
2388
+ "passport",
2389
+ "passport number",
2390
+ "passport no",
2391
+ "passeport",
2392
+ "reisepass",
2393
+ "pasaporte",
2394
+ "passaporto",
2395
+ "paspoort",
2396
+ "travel document",
2397
+ ],
2398
+ requiresContext: true,
2399
+ confidenceWithoutContext: DataConfidence_1.default.Low,
2400
+ specificity: 1,
2401
+ // The number on Germany's specimen passport.
2402
+ isTestValue: sampleValues(["C01X00T47"]),
2403
+ };
2404
+ exports.GOVERNMENT_ID_DETECTORS = [
2405
+ ...NORTH_AMERICA,
2406
+ ...UNITED_KINGDOM,
2407
+ ...LATIN_AMERICA,
2408
+ ...WESTERN_EUROPE,
2409
+ ...NORTHERN_EUROPE,
2410
+ ...SOUTH_EAST_EUROPE_AND_MIDDLE_EAST,
2411
+ ...ASIA,
2412
+ ...OCEANIA_AND_RUSSIA,
2413
+ PASSPORT_NUMBER_DETECTOR,
2414
+ ];
2415
+ exports.default = exports.GOVERNMENT_ID_DETECTORS;