@gusto/embedded-react-sdk 0.56.7 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  4. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  5. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  6. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  7. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  8. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  9. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  10. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  11. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  12. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  13. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
  14. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  15. package/dist/components/Company/Industry/Context.js +8 -7
  16. package/dist/components/Company/Industry/Context.js.map +1 -1
  17. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  18. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  19. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  20. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  21. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  22. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  23. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js +70 -0
  24. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js.map +1 -0
  25. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +30 -32
  26. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -1
  27. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +35 -27
  28. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -1
  29. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +52 -31
  30. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -1
  31. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +106 -66
  32. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -1
  33. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +36 -30
  34. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -1
  35. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js +7 -0
  36. package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js.map +1 -0
  37. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js +81 -0
  38. package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js.map +1 -0
  39. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +46 -18
  40. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -1
  41. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  42. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  43. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  44. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  45. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +5 -4
  46. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  47. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  48. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  49. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js +13 -13
  50. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
  51. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  52. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  53. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js +113 -111
  54. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.js.map +1 -1
  55. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +27 -31
  56. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  57. package/dist/components/Payroll/PayrollList/PayrollList.js +31 -35
  58. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  59. package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +5 -9
  60. package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +1 -1
  61. package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
  62. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  63. package/dist/contexts/ApiProvider/createSdkQueryClient.js +4 -3
  64. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -1
  65. package/dist/contexts/ObservabilityProvider/sanitization.js +98 -47
  66. package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
  67. package/dist/helpers/validations.js +1 -1
  68. package/dist/helpers/validations.js.map +1 -1
  69. package/dist/i18n/en/Company.AssignSignatory.json.js +1 -1
  70. package/dist/i18n/en/Company.Management.PaySchedule.json.js +24 -14
  71. package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -1
  72. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +12 -10
  73. package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js.map +1 -1
  74. package/dist/package.json.js +1 -1
  75. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.d.ts +15 -0
  76. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +3 -3
  77. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +7 -3
  78. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +20 -4
  79. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.d.ts +3 -0
  80. package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +10 -1
  81. package/dist/src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.d.ts +25 -0
  82. package/dist/src/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.test.d.ts +1 -0
  83. package/dist/src/contexts/ApiProvider/createSdkQueryClient.d.ts +2 -0
  84. package/dist/src/contexts/ApiProvider/createSdkQueryClient.test.d.ts +1 -0
  85. package/dist/src/contexts/ObservabilityProvider/sanitization.d.ts +8 -17
  86. package/dist/src/contexts/ObservabilityProvider/useSanitizedObservability.test.d.ts +1 -0
  87. package/dist/src/helpers/validations.test.d.ts +1 -0
  88. package/dist/src/i18n/types.d.ts +38 -2
  89. package/dist/src/models/external.d.ts +7 -6
  90. package/dist/src/types/observability.d.ts +59 -20
  91. package/docs/guides/endpoint-inventory.json +15 -0
  92. package/package.json +12 -12
@@ -1,4 +1,4 @@
1
- const o = [
1
+ const d = [
2
2
  { pattern: /\b\d{3}-\d{2}-\d{4}\b/g, replacement: "[SSN-REDACTED]" },
3
3
  { pattern: /\b\d{9}\b/g, replacement: "[SSN-REDACTED]" },
4
4
  {
@@ -9,7 +9,7 @@ const o = [
9
9
  { pattern: /\(\d{3}\)\s*\d{3}[-.\s]?\d{4}/g, replacement: "[PHONE-REDACTED]" },
10
10
  { pattern: /\b\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b/g, replacement: "[CC-REDACTED]" },
11
11
  { pattern: /\b[A-Za-z0-9_-]{32,}\b/g, replacement: "[TOKEN-REDACTED]" }
12
- ], E = [
12
+ ], _ = [
13
13
  "password",
14
14
  "token",
15
15
  "apiKey",
@@ -26,70 +26,121 @@ const o = [
26
26
  "routingNumber",
27
27
  "routing_number",
28
28
  "accountNumber",
29
- "account_number"
30
- ];
31
- function d(e) {
32
- let t = e;
33
- for (const { pattern: n, replacement: r } of o)
34
- t = t.replace(n, r);
35
- return t;
29
+ "account_number",
30
+ "dateOfBirth",
31
+ "date_of_birth",
32
+ "birthDate",
33
+ "birth_date",
34
+ "birthday",
35
+ "firstName",
36
+ "first_name",
37
+ "lastName",
38
+ "last_name",
39
+ "middleName",
40
+ "middle_name",
41
+ "fullName",
42
+ "full_name",
43
+ "employeeName",
44
+ "employee_name",
45
+ "signatureText",
46
+ "signature_text",
47
+ "retirementLoanIdentifier",
48
+ "retirement_loan_identifier",
49
+ "phone",
50
+ "zipCode",
51
+ "zip_code",
52
+ "postalCode",
53
+ "postal_code",
54
+ "preparerCity",
55
+ "preparer_city",
56
+ "preparerZip",
57
+ "preparer_zip",
58
+ "preparer2City",
59
+ "preparer2_city",
60
+ "preparer2Zip",
61
+ "preparer2_zip",
62
+ "preparer3City",
63
+ "preparer3_city",
64
+ "preparer3Zip",
65
+ "preparer3_zip",
66
+ "preparer4City",
67
+ "preparer4_city",
68
+ "preparer4Zip",
69
+ "preparer4_zip",
70
+ "address",
71
+ "street1",
72
+ "street_1",
73
+ "street2",
74
+ "street_2",
75
+ "caseNumber",
76
+ "case_number",
77
+ "orderNumber",
78
+ "order_number",
79
+ "remittanceNumber",
80
+ "remittance_number",
81
+ "documentNumber",
82
+ "document_number"
83
+ ], E = /* @__PURE__ */ new Set(["ein", "dob", "zip", "city"]);
84
+ function s(e) {
85
+ let r = e;
86
+ for (const { pattern: t, replacement: i } of d)
87
+ r = r.replace(t, i);
88
+ return r;
36
89
  }
37
- function s(e, t = []) {
90
+ function p(e, r = []) {
38
91
  if (e == null)
39
92
  return e;
40
93
  if (typeof e == "string")
41
- return d(e);
94
+ return s(e);
42
95
  if (typeof e == "number" || typeof e == "boolean")
43
96
  return e;
44
97
  if (Array.isArray(e))
45
- return e.map((n) => s(n, t));
98
+ return e.map((t) => p(t, r));
46
99
  if (typeof e == "object") {
47
- const n = {}, r = [...E, ...t];
48
- for (const [a, c] of Object.entries(e)) {
49
- if (r.some((u) => a.toLowerCase().includes(u.toLowerCase()))) {
50
- n[a] = "[REDACTED]";
100
+ const t = {}, i = [..._, ...r];
101
+ for (const [a, n] of Object.entries(e)) {
102
+ const c = a.toLowerCase();
103
+ if (E.has(c) || i.some((o) => c.includes(o.toLowerCase()))) {
104
+ t[a] = "[REDACTED]";
51
105
  continue;
52
106
  }
53
- n[a] = s(c, t);
107
+ t[a] = p(n, r);
54
108
  }
55
- return n;
109
+ return t;
56
110
  }
57
111
  return e;
58
112
  }
59
- function p(e, t = {}) {
60
- const {
61
- enabled: n = !0,
62
- includeRawError: r = !1,
63
- customErrorSanitizer: a,
64
- additionalSensitiveFields: c = []
65
- } = t;
66
- if (a)
67
- return a(e);
68
- if (!n)
69
- return r ? e : { ...e, raw: void 0 };
70
- const u = e.fieldErrors.map((i) => ({
71
- ...i,
72
- message: d(i.message),
73
- metadata: i.metadata ? s(i.metadata, c) : void 0
74
- }));
75
- return {
113
+ function u(e, { enabled: r = !0, includeRawError: t = !1, additionalSensitiveFields: i = [] }) {
114
+ const a = t ? e.raw : void 0;
115
+ return r ? {
76
116
  ...e,
77
- message: d(e.message),
78
- fieldErrors: u,
79
- raw: r ? e.raw : void 0
80
- };
117
+ message: s(e.message),
118
+ fieldErrors: e.fieldErrors.map((n) => ({
119
+ ...n,
120
+ message: s(n.message),
121
+ metadata: n.metadata ? p(n.metadata, i) : void 0
122
+ })),
123
+ raw: a
124
+ } : { ...e, raw: a };
81
125
  }
82
- function l(e, t = {}) {
83
- const { enabled: n = !0, customMetricSanitizer: r, additionalSensitiveFields: a = [] } = t;
84
- return r ? r(e) : n ? {
126
+ function m(e, { enabled: r = !0, additionalSensitiveFields: t = [] }) {
127
+ return r ? {
85
128
  ...e,
86
- tags: e.tags ? s(e.tags, a) : void 0
129
+ tags: e.tags ? p(e.tags, t) : void 0
87
130
  } : e;
88
131
  }
132
+ function l(e, r = {}) {
133
+ const t = u(e, r);
134
+ return r.customErrorSanitizer ? u(r.customErrorSanitizer(t), r) : t;
135
+ }
136
+ function b(e, r = {}) {
137
+ const t = m(e, r);
138
+ return r.customMetricSanitizer ? m(r.customMetricSanitizer(t), r) : t;
139
+ }
89
140
  export {
90
- p as sanitizeError,
91
- l as sanitizeMetric,
92
- s as sanitizeObject,
93
- d as sanitizeString
141
+ l as sanitizeError,
142
+ b as sanitizeMetric,
143
+ p as sanitizeObject,
144
+ s as sanitizeString
94
145
  };
95
146
  //# sourceMappingURL=sanitization.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sanitization.js","sources":["../../../src/contexts/ObservabilityProvider/sanitization.ts"],"sourcesContent":["import type {\n ObservabilityError,\n ObservabilityMetric,\n SanitizationConfig,\n} from '@/types/observability'\n\nconst PII_PATTERNS = [\n { pattern: /\\b\\d{3}-\\d{2}-\\d{4}\\b/g, replacement: '[SSN-REDACTED]' },\n { pattern: /\\b\\d{9}\\b/g, replacement: '[SSN-REDACTED]' },\n {\n pattern: /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b/g,\n replacement: '[EMAIL-REDACTED]',\n },\n { pattern: /\\b\\d{3}[-.\\s]?\\d{3}[-.\\s]?\\d{4}\\b/g, replacement: '[PHONE-REDACTED]' },\n { pattern: /\\(\\d{3}\\)\\s*\\d{3}[-.\\s]?\\d{4}/g, replacement: '[PHONE-REDACTED]' },\n { pattern: /\\b\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}\\b/g, replacement: '[CC-REDACTED]' },\n { pattern: /\\b[A-Za-z0-9_-]{32,}\\b/g, replacement: '[TOKEN-REDACTED]' },\n]\n\nconst SENSITIVE_FIELD_NAMES = [\n 'password',\n 'token',\n 'apiKey',\n 'api_key',\n 'secret',\n 'ssn',\n 'social_security_number',\n 'creditCard',\n 'credit_card',\n 'cvv',\n 'pin',\n 'bankAccount',\n 'bank_account',\n 'routingNumber',\n 'routing_number',\n 'accountNumber',\n 'account_number',\n]\n\n/**\n * Replaces PII patterns (SSN, email, phone, credit card, long tokens) in a string with redacted placeholders.\n *\n * @param value - The string to scan and redact.\n * @returns The input with each matched pattern replaced by a `[TYPE-REDACTED]` placeholder.\n * @internal\n */\nexport function sanitizeString(value: string): string {\n let sanitized = value\n\n for (const { pattern, replacement } of PII_PATTERNS) {\n sanitized = sanitized.replace(pattern, replacement)\n }\n\n return sanitized\n}\n\n/**\n * Recursively walks a value, redacting sensitive object keys and PII patterns in nested strings.\n *\n * @remarks\n * Keys whose names match (case-insensitively contain) any built-in sensitive field name or any\n * entry in `additionalSensitiveFields` have their values replaced with `[REDACTED]`. String\n * values are passed through {@link sanitizeString} so PII patterns inside them are also redacted.\n * Numbers, booleans, `null`, and `undefined` pass through unchanged.\n *\n * @param obj - The value to sanitize. May be any JSON-shaped structure.\n * @param additionalSensitiveFields - Extra field names to treat as sensitive (case-insensitive substring match).\n * @returns A new value of the same shape with sensitive fields and PII patterns redacted.\n * @internal\n */\nexport function sanitizeObject(obj: unknown, additionalSensitiveFields: string[] = []): unknown {\n if (obj === null || obj === undefined) {\n return obj\n }\n\n if (typeof obj === 'string') {\n return sanitizeString(obj)\n }\n\n if (typeof obj === 'number' || typeof obj === 'boolean') {\n return obj\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => sanitizeObject(item, additionalSensitiveFields))\n }\n\n if (typeof obj === 'object') {\n const sanitized: Record<string, unknown> = {}\n\n const allSensitiveFields = [...SENSITIVE_FIELD_NAMES, ...additionalSensitiveFields]\n\n for (const [key, value] of Object.entries(obj)) {\n if (allSensitiveFields.some(field => key.toLowerCase().includes(field.toLowerCase()))) {\n sanitized[key] = '[REDACTED]'\n continue\n }\n\n sanitized[key] = sanitizeObject(value, additionalSensitiveFields)\n }\n\n return sanitized\n }\n\n return obj\n}\n\n/**\n * Returns a copy of an observability error with PII redacted from messages and field-error metadata.\n *\n * @remarks\n * If `config.customErrorSanitizer` is provided, it is invoked and its result returned directly.\n * When sanitization is disabled, the error passes through unchanged except that `raw` is stripped\n * unless `includeRawError` is true. When enabled, `message` and each `fieldErrors[].message` run\n * through {@link sanitizeString}, and each `fieldErrors[].metadata` runs through {@link sanitizeObject}\n * with `additionalSensitiveFields` applied.\n *\n * @param error - The error reported by SDK error boundaries or form submissions.\n * @param config - Optional sanitization configuration; defaults to enabled with `raw` stripped.\n * @returns The sanitized error suitable for forwarding to a partner observability hook.\n * @internal\n */\nexport function sanitizeError(\n error: ObservabilityError,\n config: SanitizationConfig = {},\n): ObservabilityError {\n const {\n enabled = true,\n includeRawError = false,\n customErrorSanitizer,\n additionalSensitiveFields = [],\n } = config\n\n if (customErrorSanitizer) {\n return customErrorSanitizer(error)\n }\n\n if (!enabled) {\n return includeRawError ? error : { ...error, raw: undefined }\n }\n\n const sanitizedFieldErrors = error.fieldErrors.map(fe => ({\n ...fe,\n message: sanitizeString(fe.message),\n metadata: fe.metadata\n ? (sanitizeObject(fe.metadata, additionalSensitiveFields) as Record<string, unknown>)\n : undefined,\n }))\n\n return {\n ...error,\n message: sanitizeString(error.message),\n fieldErrors: sanitizedFieldErrors,\n raw: includeRawError ? error.raw : undefined,\n }\n}\n\n/**\n * Returns a copy of an observability metric with sensitive values redacted from its tags.\n *\n * @remarks\n * If `config.customMetricSanitizer` is provided, it is invoked and its result returned directly.\n * When sanitization is disabled, the metric passes through unchanged. Otherwise the `tags` record\n * is run through {@link sanitizeObject} with `additionalSensitiveFields` applied.\n *\n * @param metric - The metric reported by SDK component instrumentation.\n * @param config - Optional sanitization configuration; defaults to enabled.\n * @returns The sanitized metric suitable for forwarding to a partner observability hook.\n * @internal\n */\nexport function sanitizeMetric(\n metric: ObservabilityMetric,\n config: SanitizationConfig = {},\n): ObservabilityMetric {\n const { enabled = true, customMetricSanitizer, additionalSensitiveFields = [] } = config\n\n if (customMetricSanitizer) {\n return customMetricSanitizer(metric)\n }\n\n if (!enabled) {\n return metric\n }\n\n return {\n ...metric,\n tags: metric.tags\n ? (sanitizeObject(metric.tags, additionalSensitiveFields) as Record<string, string>)\n : undefined,\n }\n}\n"],"names":["PII_PATTERNS","SENSITIVE_FIELD_NAMES","sanitizeString","value","sanitized","pattern","replacement","sanitizeObject","obj","additionalSensitiveFields","item","allSensitiveFields","key","field","sanitizeError","error","config","enabled","includeRawError","customErrorSanitizer","sanitizedFieldErrors","fe","sanitizeMetric","metric","customMetricSanitizer"],"mappings":"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"}
1
+ {"version":3,"file":"sanitization.js","sources":["../../../src/contexts/ObservabilityProvider/sanitization.ts"],"sourcesContent":["import type {\n ObservabilityError,\n ObservabilityMetric,\n SanitizationConfig,\n} from '@/types/observability'\n\nconst PII_PATTERNS = [\n { pattern: /\\b\\d{3}-\\d{2}-\\d{4}\\b/g, replacement: '[SSN-REDACTED]' },\n { pattern: /\\b\\d{9}\\b/g, replacement: '[SSN-REDACTED]' },\n {\n pattern: /\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b/g,\n replacement: '[EMAIL-REDACTED]',\n },\n { pattern: /\\b\\d{3}[-.\\s]?\\d{3}[-.\\s]?\\d{4}\\b/g, replacement: '[PHONE-REDACTED]' },\n { pattern: /\\(\\d{3}\\)\\s*\\d{3}[-.\\s]?\\d{4}/g, replacement: '[PHONE-REDACTED]' },\n { pattern: /\\b\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}[-\\s]?\\d{4}\\b/g, replacement: '[CC-REDACTED]' },\n { pattern: /\\b[A-Za-z0-9_-]{32,}\\b/g, replacement: '[TOKEN-REDACTED]' },\n]\n\nconst SENSITIVE_FIELD_NAMES = [\n 'password',\n 'token',\n 'apiKey',\n 'api_key',\n 'secret',\n 'ssn',\n 'social_security_number',\n 'creditCard',\n 'credit_card',\n 'cvv',\n 'pin',\n 'bankAccount',\n 'bank_account',\n 'routingNumber',\n 'routing_number',\n 'accountNumber',\n 'account_number',\n 'dateOfBirth',\n 'date_of_birth',\n 'birthDate',\n 'birth_date',\n 'birthday',\n 'firstName',\n 'first_name',\n 'lastName',\n 'last_name',\n 'middleName',\n 'middle_name',\n 'fullName',\n 'full_name',\n 'employeeName',\n 'employee_name',\n 'signatureText',\n 'signature_text',\n 'retirementLoanIdentifier',\n 'retirement_loan_identifier',\n 'phone',\n 'zipCode',\n 'zip_code',\n 'postalCode',\n 'postal_code',\n 'preparerCity',\n 'preparer_city',\n 'preparerZip',\n 'preparer_zip',\n 'preparer2City',\n 'preparer2_city',\n 'preparer2Zip',\n 'preparer2_zip',\n 'preparer3City',\n 'preparer3_city',\n 'preparer3Zip',\n 'preparer3_zip',\n 'preparer4City',\n 'preparer4_city',\n 'preparer4Zip',\n 'preparer4_zip',\n 'address',\n 'street1',\n 'street_1',\n 'street2',\n 'street_2',\n 'caseNumber',\n 'case_number',\n 'orderNumber',\n 'order_number',\n 'remittanceNumber',\n 'remittance_number',\n 'documentNumber',\n 'document_number',\n]\n\nconst EXACT_SENSITIVE_FIELD_NAMES = new Set(['ein', 'dob', 'zip', 'city'])\n\n/**\n * Replaces PII patterns (SSN, email, phone, credit card, long tokens) in a string with redacted placeholders.\n *\n * @param value - The string to scan and redact.\n * @returns The input with each matched pattern replaced by a `[TYPE-REDACTED]` placeholder.\n * @internal\n */\nexport function sanitizeString(value: string): string {\n let sanitized = value\n\n for (const { pattern, replacement } of PII_PATTERNS) {\n sanitized = sanitized.replace(pattern, replacement)\n }\n\n return sanitized\n}\n\n/**\n * Recursively walks a value, redacting sensitive object keys and PII patterns in nested strings.\n *\n * @remarks\n * Keys whose names match (case-insensitively contain) any built-in sensitive field name or any\n * entry in `additionalSensitiveFields` have their values replaced with `[REDACTED]`. Short names\n * (`ein`, `dob`, `zip`, `city`) match the whole key, case-insensitively. String\n * values are passed through {@link sanitizeString} so PII patterns inside them are also redacted.\n * Numbers, booleans, `null`, and `undefined` pass through unchanged.\n *\n * @param obj - The value to sanitize. May be any JSON-shaped structure.\n * @param additionalSensitiveFields - Extra field names to treat as sensitive (case-insensitive substring match).\n * @returns A new value of the same shape with sensitive fields and PII patterns redacted.\n * @internal\n */\nexport function sanitizeObject(obj: unknown, additionalSensitiveFields: string[] = []): unknown {\n if (obj === null || obj === undefined) {\n return obj\n }\n\n if (typeof obj === 'string') {\n return sanitizeString(obj)\n }\n\n if (typeof obj === 'number' || typeof obj === 'boolean') {\n return obj\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => sanitizeObject(item, additionalSensitiveFields))\n }\n\n if (typeof obj === 'object') {\n const sanitized: Record<string, unknown> = {}\n\n const allSensitiveFields = [...SENSITIVE_FIELD_NAMES, ...additionalSensitiveFields]\n\n for (const [key, value] of Object.entries(obj)) {\n const lowerKey = key.toLowerCase()\n if (\n EXACT_SENSITIVE_FIELD_NAMES.has(lowerKey) ||\n allSensitiveFields.some(field => lowerKey.includes(field.toLowerCase()))\n ) {\n sanitized[key] = '[REDACTED]'\n continue\n }\n\n sanitized[key] = sanitizeObject(value, additionalSensitiveFields)\n }\n\n return sanitized\n }\n\n return obj\n}\n\nfunction redactError(\n error: ObservabilityError,\n { enabled = true, includeRawError = false, additionalSensitiveFields = [] }: SanitizationConfig,\n): ObservabilityError {\n const raw = includeRawError ? error.raw : undefined\n\n if (!enabled) {\n return { ...error, raw }\n }\n\n return {\n ...error,\n message: sanitizeString(error.message),\n fieldErrors: error.fieldErrors.map(fieldError => ({\n ...fieldError,\n message: sanitizeString(fieldError.message),\n metadata: fieldError.metadata\n ? (sanitizeObject(fieldError.metadata, additionalSensitiveFields) as Record<\n string,\n unknown\n >)\n : undefined,\n })),\n raw,\n }\n}\n\nfunction redactMetric(\n metric: ObservabilityMetric,\n { enabled = true, additionalSensitiveFields = [] }: SanitizationConfig,\n): ObservabilityMetric {\n if (!enabled) {\n return metric\n }\n\n return {\n ...metric,\n tags: metric.tags\n ? (sanitizeObject(metric.tags, additionalSensitiveFields) as Record<string, string>)\n : undefined,\n }\n}\n\n/**\n * Redacts error messages and field-error metadata before and after a custom sanitizer runs.\n *\n * @remarks\n * `enabled: false` skips redaction. Independently, `raw` is excluded before and after the\n * custom sanitizer unless `includeRawError: true`. Opted-in `raw` is passed through unchanged.\n * Other error properties are preserved without redaction.\n *\n * @internal\n */\nexport function sanitizeError(\n error: ObservabilityError,\n config: SanitizationConfig = {},\n): ObservabilityError {\n const sanitized = redactError(error, config)\n return config.customErrorSanitizer\n ? redactError(config.customErrorSanitizer(sanitized), config)\n : sanitized\n}\n\n/**\n * Redacts metric tags before and after a custom sanitizer runs, unless `enabled: false`.\n *\n * @remarks\n * Other metric properties are preserved without redaction.\n *\n * @internal\n */\nexport function sanitizeMetric(\n metric: ObservabilityMetric,\n config: SanitizationConfig = {},\n): ObservabilityMetric {\n const sanitized = redactMetric(metric, config)\n return config.customMetricSanitizer\n ? redactMetric(config.customMetricSanitizer(sanitized), config)\n : sanitized\n}\n"],"names":["PII_PATTERNS","SENSITIVE_FIELD_NAMES","EXACT_SENSITIVE_FIELD_NAMES","sanitizeString","value","sanitized","pattern","replacement","sanitizeObject","obj","additionalSensitiveFields","item","allSensitiveFields","key","lowerKey","field","redactError","error","enabled","includeRawError","raw","fieldError","redactMetric","metric","sanitizeError","config","sanitizeMetric"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import { z as n } from "zod";
2
2
  import { formatWithMask as o, commonMasks as i } from "./mask.js";
3
3
  import { removeNonDigits as r } from "./formattedStrings.js";
4
- const s = /^([a-zA-Z\xC0-\uFFFF]+([ \-']{0,1}[a-zA-Z\xC0-\uFFFF]+)*[.]{0,1}){1,2}$/, g = n.string().min(1).regex(s), N = n.string().refine((t) => /(^\d{5}$)|(^\d{5}-\d{4}$)/.test(t)), F = /^(?!(000|666|9))\d{3}(?!00)\d{2}(?!0000)\d{4}$/, R = /^\d{2}-\d{7}$/, f = n.string().transform((t) => o(t, i.phoneMask)).refine((t) => r(t).length === 10), e = /^[0-9]{9}$/, p = n.string().regex(e), a = /^[0-9]{1,17}$/, u = n.string().regex(a);
4
+ const s = /^([a-zA-Z\xC0-\uFFFF]+([ \-']{0,1}[a-zA-Z\xC0-\uFFFF]+)*[.]{0,1}){1,2}$/, g = n.string().trim().min(1).regex(s), N = n.string().refine((t) => /(^\d{5}$)|(^\d{5}-\d{4}$)/.test(t)), F = /^(?!(000|666|9))\d{3}(?!00)\d{2}(?!0000)\d{4}$/, R = /^\d{2}-\d{7}$/, f = n.string().transform((t) => o(t, i.phoneMask)).refine((t) => r(t).length === 10), e = /^[0-9]{9}$/, p = n.string().regex(e), a = /^[0-9]{1,17}$/, u = n.string().regex(a);
5
5
  export {
6
6
  a as ACCOUNT_NUMBER_REGEX,
7
7
  R as EIN_REGEX,
@@ -1 +1 @@
1
- {"version":3,"file":"validations.js","sources":["../../src/helpers/validations.ts"],"sourcesContent":["import { z } from 'zod'\nimport { commonMasks, formatWithMask } from './mask'\nimport { removeNonDigits } from '@/helpers/formattedStrings'\n\n/**\n * Regex matching personal names: one or two words composed of Latin or extended-Latin letters,\n * with optional internal spaces, hyphens, or apostrophes, and an optional trailing period.\n *\n * @internal\n */\nexport const NAME_REGEX = /^([a-zA-Z\\xC0-\\uFFFF]+([ \\-']{0,1}[a-zA-Z\\xC0-\\uFFFF]+)*[.]{0,1}){1,2}$/\n\n/**\n * Zod schema validating a non-empty personal name against {@link NAME_REGEX}.\n *\n * @internal\n */\nexport const nameValidation = z.string().min(1).regex(NAME_REGEX)\n\n/**\n * Zod schema validating a US ZIP code in either 5-digit (`12345`) or ZIP+4 (`12345-6789`) form.\n *\n * @internal\n */\nexport const zipValidation = z.string().refine(zip => /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(zip))\n\n/**\n * Regex matching a valid US Social Security Number. Rejects reserved area numbers (000, 666, 9xx),\n * a group number of 00, and a serial number of 0000.\n *\n * @internal\n */\nexport const SSN_REGEX = /^(?!(000|666|9))\\d{3}(?!00)\\d{2}(?!0000)\\d{4}$/\n\n/**\n * Regex matching a federal EIN in the canonical display format `NN-NNNNNNN`\n * (two digits, a hyphen, then seven digits). Pair with `normalizeEin` to format\n * raw input before testing.\n *\n * @internal\n */\nexport const EIN_REGEX = /^\\d{2}-\\d{7}$/\n\n/**\n * Zod schema validating a US phone number. Formats the input with the phone mask and accepts it\n * only when the digit-only form is exactly ten digits.\n *\n * @internal\n */\nexport const phoneValidation = z\n .string()\n .transform(value => formatWithMask(value, commonMasks.phoneMask))\n .refine(phone => {\n const digits = removeNonDigits(phone)\n return digits.length === 10\n })\n\n/**\n * Regex matching a bank routing number (exactly nine digits).\n *\n * @internal\n */\nexport const ROUTING_NUMBER_REGEX = /^[0-9]{9}$/\n\n/**\n * Zod schema validating a bank routing number (exactly nine digits).\n *\n * @internal\n */\nexport const routingNumberValidation = z.string().regex(ROUTING_NUMBER_REGEX)\n\n/**\n * Regex matching a bank account number (one to seventeen digits).\n *\n * @internal\n */\nexport const ACCOUNT_NUMBER_REGEX = /^[0-9]{1,17}$/\n\n/**\n * Zod schema validating a bank account number (one to seventeen digits).\n *\n * @internal\n */\nexport const accountNumberValidation = z.string().regex(ACCOUNT_NUMBER_REGEX)\n"],"names":["NAME_REGEX","nameValidation","z","zipValidation","zip","SSN_REGEX","EIN_REGEX","phoneValidation","value","formatWithMask","commonMasks","phone","removeNonDigits","ROUTING_NUMBER_REGEX","routingNumberValidation","ACCOUNT_NUMBER_REGEX","accountNumberValidation"],"mappings":";;;AAUO,MAAMA,IAAa,2EAObC,IAAiBC,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,MAAMF,CAAU,GAOnDG,IAAgBD,EAAE,SAAS,OAAO,CAAAE,MAAO,4BAA4B,KAAKA,CAAG,CAAC,GAQ9EC,IAAY,kDASZC,IAAY,iBAQZC,IAAkBL,EAC5B,OAAA,EACA,UAAU,CAAAM,MAASC,EAAeD,GAAOE,EAAY,SAAS,CAAC,EAC/D,OAAO,CAAAC,MACSC,EAAgBD,CAAK,EACtB,WAAW,EAC1B,GAOUE,IAAuB,cAOvBC,IAA0BZ,EAAE,OAAA,EAAS,MAAMW,CAAoB,GAO/DE,IAAuB,iBAOvBC,IAA0Bd,EAAE,OAAA,EAAS,MAAMa,CAAoB;"}
1
+ {"version":3,"file":"validations.js","sources":["../../src/helpers/validations.ts"],"sourcesContent":["import { z } from 'zod'\nimport { commonMasks, formatWithMask } from './mask'\nimport { removeNonDigits } from '@/helpers/formattedStrings'\n\n/**\n * Regex matching personal names: one or two words composed of Latin or extended-Latin letters,\n * with optional internal spaces, hyphens, or apostrophes, and an optional trailing period.\n *\n * @internal\n */\nexport const NAME_REGEX = /^([a-zA-Z\\xC0-\\uFFFF]+([ \\-']{0,1}[a-zA-Z\\xC0-\\uFFFF]+)*[.]{0,1}){1,2}$/\n\n/**\n * Zod schema validating a non-empty personal name against {@link NAME_REGEX}.\n *\n * @internal\n */\nexport const nameValidation = z.string().trim().min(1).regex(NAME_REGEX)\n\n/**\n * Zod schema validating a US ZIP code in either 5-digit (`12345`) or ZIP+4 (`12345-6789`) form.\n *\n * @internal\n */\nexport const zipValidation = z.string().refine(zip => /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(zip))\n\n/**\n * Regex matching a valid US Social Security Number. Rejects reserved area numbers (000, 666, 9xx),\n * a group number of 00, and a serial number of 0000.\n *\n * @internal\n */\nexport const SSN_REGEX = /^(?!(000|666|9))\\d{3}(?!00)\\d{2}(?!0000)\\d{4}$/\n\n/**\n * Regex matching a federal EIN in the canonical display format `NN-NNNNNNN`\n * (two digits, a hyphen, then seven digits). Pair with `normalizeEin` to format\n * raw input before testing.\n *\n * @internal\n */\nexport const EIN_REGEX = /^\\d{2}-\\d{7}$/\n\n/**\n * Zod schema validating a US phone number. Formats the input with the phone mask and accepts it\n * only when the digit-only form is exactly ten digits.\n *\n * @internal\n */\nexport const phoneValidation = z\n .string()\n .transform(value => formatWithMask(value, commonMasks.phoneMask))\n .refine(phone => {\n const digits = removeNonDigits(phone)\n return digits.length === 10\n })\n\n/**\n * Regex matching a bank routing number (exactly nine digits).\n *\n * @internal\n */\nexport const ROUTING_NUMBER_REGEX = /^[0-9]{9}$/\n\n/**\n * Zod schema validating a bank routing number (exactly nine digits).\n *\n * @internal\n */\nexport const routingNumberValidation = z.string().regex(ROUTING_NUMBER_REGEX)\n\n/**\n * Regex matching a bank account number (one to seventeen digits).\n *\n * @internal\n */\nexport const ACCOUNT_NUMBER_REGEX = /^[0-9]{1,17}$/\n\n/**\n * Zod schema validating a bank account number (one to seventeen digits).\n *\n * @internal\n */\nexport const accountNumberValidation = z.string().regex(ACCOUNT_NUMBER_REGEX)\n"],"names":["NAME_REGEX","nameValidation","z","zipValidation","zip","SSN_REGEX","EIN_REGEX","phoneValidation","value","formatWithMask","commonMasks","phone","removeNonDigits","ROUTING_NUMBER_REGEX","routingNumberValidation","ACCOUNT_NUMBER_REGEX","accountNumberValidation"],"mappings":";;;AAUO,MAAMA,IAAa,2EAObC,IAAiBC,EAAE,SAAS,KAAA,EAAO,IAAI,CAAC,EAAE,MAAMF,CAAU,GAO1DG,IAAgBD,EAAE,SAAS,OAAO,CAAAE,MAAO,4BAA4B,KAAKA,CAAG,CAAC,GAQ9EC,IAAY,kDASZC,IAAY,iBAQZC,IAAkBL,EAC5B,OAAA,EACA,UAAU,CAAAM,MAASC,EAAeD,GAAOE,EAAY,SAAS,CAAC,EAC/D,OAAO,CAAAC,MACSC,EAAgBD,CAAK,EACtB,WAAW,EAC1B,GAOUE,IAAuB,cAOvBC,IAA0BZ,EAAE,OAAA,EAAS,MAAMW,CAAoB,GAO/DE,IAAuB,iBAOvBC,IAA0Bd,EAAE,OAAA,EAAS,MAAMa,CAAoB;"}
@@ -1,4 +1,4 @@
1
- const e = "Assign a company signatory", t = `The company signatory is responsible for electronically signing all government forms Gusto creates and is generally a member of the business or partnership. Each time a signatory is updated, we'll file a new Form 8655 with the IRS to give Gusto the "Reporting Agent Authorization" we need to file and pay your taxes. Your signatory must be authorized by the IRS.`, i = { label: "Signing options", selfSign: "I'm authorized to sign official documents for the company.", appointOther: "I'll appoint another person to sign official documents." }, s = { title: "Signatory person details", description: "Make sure this information is accurate. We'll use it to submit IRS Form 8655 so we can file and pay your federal taxes. If you don't know who your authorized signatory is, please call the IRS at (800) 829-4933.", firstName: "First name", lastName: "Last name", email: "Email address", phone: "Phone number", ssn: "Social security number", birthday: "Date of birth", titleSelect: { label: "Title", placeholder: "Select title..." } }, a = { title: "Signatory home address", description: "To verify your identity, please enter your home address. If you're unsure what address to use, use the one listed on your driver's license.", street1: "Street 1", street2: "Street 2", city: "City", state: "State", statePlaceholder: "Select state...", zip: "Zip" }, o = { title: "Invite a signatory", description: "Make sure this information is accurate. We'll use it to submit IRS Form 8655 so we can file and pay your federal taxes. If you don't know who your authorized signatory is, please call the IRS at (800) 829-4933.", signatoryEmail: "Signatory email", confirmEmail: "Confirm signatory email", firstName: "First name", lastName: "Last name" }, r = { signDocuments: "Sign documents", inviteSignatory: "Invite signatory" }, n = { dob: "Date of birth is required", email: "Email address is required and must be valid", emailMismatch: "Email addresses must match", firstName: "First name is required", lastName: "Last name is required", phone: "Phone number must be 10 digits", title: "Title is required", address: { street1: "Street address is required", city: "City is required", state: "State is required", zip: "ZIP code must be 5 digits" } }, l = {
1
+ const e = "Assign a company signatory", t = `The company signatory is responsible for electronically signing all government forms Gusto creates and is generally a member of the business or partnership. Each time a signatory is updated, we'll file a new Form 8655 with the IRS to give Gusto the "Reporting Agent Authorization" we need to file and pay your taxes. Your signatory must be authorized by the IRS.`, i = { label: "Signing options", selfSign: "I'm authorized to sign official documents for the company.", appointOther: "I'll appoint another person to sign official documents." }, s = { title: "Signatory person details", description: "Make sure this information is accurate. We'll use it to submit IRS Form 8655 so we can file and pay your federal taxes. If you don't know who your authorized signatory is, please call the IRS at (800) 829-4933.", firstName: "First name", lastName: "Last name", email: "Email address", phone: "Phone number", ssn: "Social security number", birthday: "Date of birth", titleSelect: { label: "Title", placeholder: "Select title..." } }, a = { title: "Signatory home address", description: "To verify your identity, please enter your home address. If you're unsure what address to use, use the one listed on your driver's license.", street1: "Street 1", street2: "Street 2", city: "City", state: "State", statePlaceholder: "Select state...", zip: "Zip" }, o = { title: "Invite a signatory", description: "Make sure this information is accurate. We'll use it to submit IRS Form 8655 so we can file and pay your federal taxes. If you don't know who your authorized signatory is, please call the IRS at (800) 829-4933.", signatoryEmail: "Signatory email", confirmEmail: "Confirm signatory email", firstName: "First name", lastName: "Last name" }, r = { signDocuments: "Sign documents", inviteSignatory: "Invite signatory" }, n = { dob: "Date of birth is required", email: "Email address is required and must be valid", emailMismatch: "Email addresses must match", firstName: "Enter a valid first name", lastName: "Enter a valid last name", phone: "Phone number must be 10 digits", title: "Title is required", address: { street1: "Street address is required", city: "City is required", state: "State is required", zip: "ZIP code must be 5 digits" } }, l = {
2
2
  title: e,
3
3
  description: t,
4
4
  signingOptions: i,
@@ -1,24 +1,34 @@
1
- const e = "Pay schedule", t = "You have assigned everyone to be on one pay schedule.", a = "Manage", n = "Edit", o = "Edit pay schedule", s = "Edit AutoPilot", d = { name: "Name", frequency: "Frequency" }, l = { label: "AutoPilot", enabled: "Enabled", disabled: "Disabled" }, i = { assignmentUpdated: "Pay schedule assignment updated." }, c = {
1
+ const e = "Pay schedule", t = "You have assigned everyone to be on one pay schedule.", a = "You have assigned employees to pay schedules by compensation type.", s = "Pay schedules by compensation type", o = "Manage", n = "Edit", c = "Edit schedule", l = "Edit pay schedule", d = "Edit AutoPilot", i = "Pay schedule actions", u = { name: "Name", frequency: "Frequency", schedule: "Schedule" }, y = { hourly: "Hourly", salaried: "Salaried" }, p = { label: "AutoPilot", enabled: "Enabled", disabled: "Disabled" }, h = { assignmentUpdated: "Pay schedule assignment updated." }, r = {
2
2
  title: e,
3
3
  description: t,
4
- manageCta: a,
4
+ compensationDescription: a,
5
+ compensationTableLabel: s,
6
+ manageCta: o,
5
7
  editCta: n,
6
- editScheduleAriaLabel: o,
7
- editAutoPilotAriaLabel: s,
8
- labels: d,
9
- autoPilot: l,
10
- alerts: i
8
+ editScheduleCta: c,
9
+ editScheduleAriaLabel: l,
10
+ editAutoPilotAriaLabel: d,
11
+ rowMenuTriggerLabel: i,
12
+ labels: u,
13
+ compensationTypes: y,
14
+ autoPilot: p,
15
+ alerts: h
11
16
  };
12
17
  export {
13
- i as alerts,
14
- l as autoPilot,
15
- c as default,
18
+ h as alerts,
19
+ p as autoPilot,
20
+ a as compensationDescription,
21
+ s as compensationTableLabel,
22
+ y as compensationTypes,
23
+ r as default,
16
24
  t as description,
17
- s as editAutoPilotAriaLabel,
25
+ d as editAutoPilotAriaLabel,
18
26
  n as editCta,
19
- o as editScheduleAriaLabel,
20
- d as labels,
21
- a as manageCta,
27
+ l as editScheduleAriaLabel,
28
+ c as editScheduleCta,
29
+ u as labels,
30
+ o as manageCta,
31
+ i as rowMenuTriggerLabel,
22
32
  e as title
23
33
  };
24
34
  //# sourceMappingURL=Company.Management.PaySchedule.json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Company.Management.PaySchedule.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"Company.Management.PaySchedule.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -1,18 +1,20 @@
1
- const e = { heading: "Choose schedule type", description: "After you choose, you can create a pay schedule for each group.", options: { single: { label: "Everyone on one schedule", description: "Choose one pay schedule for all your employees" } } }, a = { heading: "Assign employees", payScheduleLabel: "Pay schedule", payScheduleDescription: "The pay schedule to use for all employees.", addPayScheduleCta: "Add pay schedule" }, n = { heading: "Review changes", noChangesHeading: "There are no changes to review.", noChangesDescription: "If you intended to make changes, please go back and make them.", employeeChangesHeading: "Employees affected", nameLabel: "Name", transitionPayPeriodLabel: "Transition pay period", payFrequencyLabel: "New pay frequency", firstPayPeriodLabel: "First pay period", noTransitionNeeded: "No transition needed" }, o = "Back", s = "Continue", t = "Submit", i = {
1
+ const e = { heading: "Choose schedule type", description: "After you choose, you can create a pay schedule for each group.", options: { single: { label: "Everyone on one schedule", description: "Choose one pay schedule for all your employees" }, hourlySalaried: { label: "Separate schedules by compensation type", description: "Choose one pay schedule for hourly employees and another for salaried employees" } } }, a = { heading: "Assign employees", payScheduleLabel: "Pay schedule", payScheduleDescription: "The pay schedule to use for all employees.", addPayScheduleCta: "Add pay schedule" }, o = { heading: "Assign employees", hourlyPayScheduleLabel: "Hourly employees", hourlyPayScheduleDescription: "The pay schedule to use for hourly employees.", salariedPayScheduleLabel: "Salaried employees", salariedPayScheduleDescription: "The pay schedule to use for salaried employees.", addPayScheduleCta: "Add pay schedule" }, s = { heading: "Review changes", noChangesHeading: "There are no changes to review.", noChangesDescription: "If you intended to make changes, please go back and make them.", employeeChangesHeading: "Employees affected", nameLabel: "Name", transitionPayPeriodLabel: "Transition pay period", payFrequencyLabel: "New pay frequency", firstPayPeriodLabel: "First pay period", noTransitionNeeded: "No transition needed" }, n = "Back", l = "Continue", d = "Submit", t = {
2
2
  typeStep: e,
3
3
  scheduleStep: a,
4
- reviewStep: n,
5
- backCta: o,
6
- continueCta: s,
7
- submitCta: t
4
+ compensationStep: o,
5
+ reviewStep: s,
6
+ backCta: n,
7
+ continueCta: l,
8
+ submitCta: d
8
9
  };
9
10
  export {
10
- o as backCta,
11
- s as continueCta,
12
- i as default,
13
- n as reviewStep,
11
+ n as backCta,
12
+ o as compensationStep,
13
+ l as continueCta,
14
+ t as default,
15
+ s as reviewStep,
14
16
  a as scheduleStep,
15
- t as submitCta,
17
+ d as submitCta,
16
18
  e as typeStep
17
19
  };
18
20
  //# sourceMappingURL=Company.Management.PayScheduleAssignment.json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Company.Management.PayScheduleAssignment.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"Company.Management.PayScheduleAssignment.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- const e = "@gusto/embedded-react-sdk", o = "0.56.7";
1
+ const e = "@gusto/embedded-react-sdk", o = "0.57.0";
2
2
  export {
3
3
  e as name,
4
4
  o as version
@@ -0,0 +1,15 @@
1
+ import { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow';
2
+ /** @internal */
3
+ export interface AssignmentCompensationStepPresentationProps {
4
+ schedules: PayScheduleShow[];
5
+ hourlyPayScheduleUuid?: string;
6
+ salariedPayScheduleUuid?: string;
7
+ onBack: () => void;
8
+ onAddPaySchedule: () => void;
9
+ onContinue: (selection: {
10
+ hourlyPayScheduleUuid: string;
11
+ salariedPayScheduleUuid: string;
12
+ }) => void;
13
+ }
14
+ /** @internal */
15
+ export declare function AssignmentCompensationStepPresentation({ schedules, hourlyPayScheduleUuid, salariedPayScheduleUuid, onBack, onAddPaySchedule, onContinue, }: AssignmentCompensationStepPresentationProps): import('react').JSX.Element;
@@ -1,9 +1,9 @@
1
- import { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody';
1
+ import { SupportedAssignmentType } from './usePayScheduleAssignment';
2
2
  /** @internal */
3
3
  export interface AssignmentTypeStepPresentationProps {
4
- defaultType?: typeof PayScheduleAssignmentBodyType.Single;
4
+ defaultType?: SupportedAssignmentType;
5
5
  onBack: () => void;
6
- onContinue: (type: PayScheduleAssignmentBodyType) => void;
6
+ onContinue: (type: SupportedAssignmentType) => void;
7
7
  }
8
8
  /** @internal */
9
9
  export declare function AssignmentTypeStepPresentation({ defaultType, onBack, onContinue, }: AssignmentTypeStepPresentationProps): import('react').JSX.Element;
@@ -13,8 +13,12 @@ export interface PayScheduleAssignmentProps extends BaseComponentInterface<'Comp
13
13
  *
14
14
  * @remarks
15
15
  * Walks through choosing an assignment type, picking (or creating) a pay schedule, and reviewing
16
- * the employees and transition payrolls affected before submitting. Only the single-schedule
17
- * assignment type is currently supported. Can be mounted directly or launched from
16
+ * the employees and transition payrolls affected before submitting. Opens on the company's
17
+ * current assignment, so submitting without changing anything is a no-op rather than a
18
+ * reassignment. Two assignment types are
19
+ * supported: one schedule for everyone (`single`), or separate schedules for hourly and salaried
20
+ * employees (`hourly_salaried`). Picking the same schedule for both compensation types is
21
+ * submitted as `single`. Can be mounted directly or launched from
18
22
  * `CompanyManagement.PaySchedule`'s Manage action.
19
23
  *
20
24
  * The internal step-to-step selection events (assignment type chosen, schedule picked) also
@@ -28,7 +32,7 @@ export interface PayScheduleAssignmentProps extends BaseComponentInterface<'Comp
28
32
  * | `paySchedule/create` | The user chose to add a new pay schedule from the picker step | — |
29
33
  * | `paySchedule/created` | A new pay schedule was created from the picker step | `{ paySchedule: PayScheduleShow }` |
30
34
  * | `paySchedule/management/assignment/cancel` | The user backed out of the flow entirely, from the first step | — |
31
- * | `paySchedule/management/assignment/assigned` | The assignment was submitted successfully | `{ type: PayScheduleAssignmentBodyType; defaultPayScheduleUuid: string; employeeChanges: PayScheduleAssignmentEmployeeChange[] }` |
35
+ * | `paySchedule/management/assignment/assigned` | The assignment was submitted successfully | `{ employeeChanges: PayScheduleAssignmentEmployeeChange[] }` plus either `{ type: 'single'; defaultPayScheduleUuid: string }` or `{ type: 'hourly_salaried'; hourlyPayScheduleUuid: string; salariedPayScheduleUuid: string }` |
32
36
  *
33
37
  * @alpha
34
38
  */
@@ -1,21 +1,37 @@
1
1
  import { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody';
2
2
  import { PayScheduleAssignmentEmployeeChange } from '@gusto/embedded-api/models/components/payscheduleassignmentemployeechange';
3
3
  import { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow';
4
+ import { SupportedAssignmentType } from './usePayScheduleAssignment';
4
5
  import { componentEvents } from '../../../../../shared/constants';
6
+ /**
7
+ * The assignment the user built, already collapsed to the type that actually gets submitted.
8
+ * Doubles as the request body and as the `assigned` event payload.
9
+ *
10
+ * @internal
11
+ */
12
+ export type AssignmentSelection = {
13
+ type: typeof PayScheduleAssignmentBodyType.Single;
14
+ defaultPayScheduleUuid: string;
15
+ } | {
16
+ type: typeof PayScheduleAssignmentBodyType.HourlySalaried;
17
+ hourlyPayScheduleUuid: string;
18
+ salariedPayScheduleUuid: string;
19
+ };
5
20
  /** @internal */
6
21
  export type EventPayloads = {
7
22
  [componentEvents.PAY_SCHEDULE_ASSIGNMENT_TYPE_SELECTED]: {
8
- type: PayScheduleAssignmentBodyType;
23
+ type: SupportedAssignmentType;
9
24
  };
10
25
  [componentEvents.PAY_SCHEDULE_ASSIGNMENT_SCHEDULE_SELECTED]: {
11
26
  defaultPayScheduleUuid: string;
27
+ } | {
28
+ hourlyPayScheduleUuid: string;
29
+ salariedPayScheduleUuid: string;
12
30
  };
13
31
  [componentEvents.PAY_SCHEDULE_CREATED]: {
14
32
  paySchedule: PayScheduleShow;
15
33
  };
16
- [componentEvents.PAY_SCHEDULE_ASSIGNED]: {
17
- type: PayScheduleAssignmentBodyType;
18
- defaultPayScheduleUuid: string;
34
+ [componentEvents.PAY_SCHEDULE_ASSIGNED]: AssignmentSelection & {
19
35
  employeeChanges: PayScheduleAssignmentEmployeeChange[];
20
36
  };
21
37
  };
@@ -0,0 +1,3 @@
1
+ import { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow';
2
+ /** @internal */
3
+ export declare function scheduleLabel(schedule: PayScheduleShow): string;
@@ -1,9 +1,18 @@
1
1
  import { PayScheduleAssignmentBodyType } from '@gusto/embedded-api/models/components/payscheduleassignmentbody';
2
2
  import { FlowContextInterface } from '../../../../Flow/useFlow';
3
+ /**
4
+ * The assignment types this flow supports. `by_employee` and `by_department` exist in the API
5
+ * but have no step implementations, so they're unrepresentable here.
6
+ *
7
+ * @internal
8
+ */
9
+ export type SupportedAssignmentType = Extract<PayScheduleAssignmentBodyType, 'single' | 'hourly_salaried'>;
3
10
  /** @internal */
4
11
  export interface PayScheduleAssignmentContextInterface extends FlowContextInterface {
5
12
  companyId: string;
6
- assignmentType?: PayScheduleAssignmentBodyType;
13
+ assignmentType?: SupportedAssignmentType;
7
14
  defaultPayScheduleUuid?: string;
15
+ hourlyPayScheduleUuid?: string;
16
+ salariedPayScheduleUuid?: string;
8
17
  component: React.ComponentType | null;
9
18
  }
@@ -0,0 +1,25 @@
1
+ import { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow';
2
+ /** @internal */
3
+ export type CompensationType = 'hourly' | 'salaried';
4
+ /** @internal */
5
+ export interface PayScheduleCompensationRow {
6
+ compensationType: CompensationType;
7
+ schedule: PayScheduleShow;
8
+ }
9
+ /** @internal */
10
+ export interface PayScheduleCompensationOverviewPresentationProps {
11
+ /** One row per compensation type, in display order. */
12
+ rows: PayScheduleCompensationRow[];
13
+ /** Shows the AutoPilot column and its row action when `true`. */
14
+ enableAutoPilot?: boolean;
15
+ /** Shows the Manage action when `true`. */
16
+ enableMultipleSchedules?: boolean;
17
+ /** Fired when the user chooses Edit schedule from a row menu. */
18
+ onEditSchedule: (schedule: PayScheduleShow) => void;
19
+ /** Fired when the user clicks Manage. */
20
+ onManageAssignment: () => void;
21
+ /** Fired when the user chooses AutoPilot from a row menu. */
22
+ onEditAutoPilot: (schedule: PayScheduleShow) => void;
23
+ }
24
+ /** @internal */
25
+ export declare function PayScheduleCompensationOverviewPresentation({ rows, enableAutoPilot, enableMultipleSchedules, onEditSchedule, onManageAssignment, onEditAutoPilot, }: PayScheduleCompensationOverviewPresentationProps): import('react').JSX.Element;
@@ -5,6 +5,8 @@ import { QueryClient } from '@tanstack/react-query';
5
5
  * @remarks
6
6
  * Defaults applied:
7
7
  * - `retry: false` on both queries and mutations.
8
+ * - `networkMode: 'always'` on both queries and mutations, so requests made while the browser reports offline fail with an error instead of
9
+ * staying paused (and showing an indefinite loading state) until connectivity returns.
8
10
  * - On any successful mutation, every SDK query under the namespace is invalidated so the next read refetches fresh data.
9
11
  *
10
12
  * {@link ApiProvider} uses this when no `queryClient` prop is supplied, and `GustoTestProvider` uses it so tests faithfully replicate production
@@ -12,7 +12,8 @@ export declare function sanitizeString(value: string): string;
12
12
  *
13
13
  * @remarks
14
14
  * Keys whose names match (case-insensitively contain) any built-in sensitive field name or any
15
- * entry in `additionalSensitiveFields` have their values replaced with `[REDACTED]`. String
15
+ * entry in `additionalSensitiveFields` have their values replaced with `[REDACTED]`. Short names
16
+ * (`ein`, `dob`, `zip`, `city`) match the whole key, case-insensitively. String
16
17
  * values are passed through {@link sanitizeString} so PII patterns inside them are also redacted.
17
18
  * Numbers, booleans, `null`, and `undefined` pass through unchanged.
18
19
  *
@@ -23,32 +24,22 @@ export declare function sanitizeString(value: string): string;
23
24
  */
24
25
  export declare function sanitizeObject(obj: unknown, additionalSensitiveFields?: string[]): unknown;
25
26
  /**
26
- * Returns a copy of an observability error with PII redacted from messages and field-error metadata.
27
+ * Redacts error messages and field-error metadata before and after a custom sanitizer runs.
27
28
  *
28
29
  * @remarks
29
- * If `config.customErrorSanitizer` is provided, it is invoked and its result returned directly.
30
- * When sanitization is disabled, the error passes through unchanged except that `raw` is stripped
31
- * unless `includeRawError` is true. When enabled, `message` and each `fieldErrors[].message` run
32
- * through {@link sanitizeString}, and each `fieldErrors[].metadata` runs through {@link sanitizeObject}
33
- * with `additionalSensitiveFields` applied.
30
+ * `enabled: false` skips redaction. Independently, `raw` is excluded before and after the
31
+ * custom sanitizer unless `includeRawError: true`. Opted-in `raw` is passed through unchanged.
32
+ * Other error properties are preserved without redaction.
34
33
  *
35
- * @param error - The error reported by SDK error boundaries or form submissions.
36
- * @param config - Optional sanitization configuration; defaults to enabled with `raw` stripped.
37
- * @returns The sanitized error suitable for forwarding to a partner observability hook.
38
34
  * @internal
39
35
  */
40
36
  export declare function sanitizeError(error: ObservabilityError, config?: SanitizationConfig): ObservabilityError;
41
37
  /**
42
- * Returns a copy of an observability metric with sensitive values redacted from its tags.
38
+ * Redacts metric tags before and after a custom sanitizer runs, unless `enabled: false`.
43
39
  *
44
40
  * @remarks
45
- * If `config.customMetricSanitizer` is provided, it is invoked and its result returned directly.
46
- * When sanitization is disabled, the metric passes through unchanged. Otherwise the `tags` record
47
- * is run through {@link sanitizeObject} with `additionalSensitiveFields` applied.
41
+ * Other metric properties are preserved without redaction.
48
42
  *
49
- * @param metric - The metric reported by SDK component instrumentation.
50
- * @param config - Optional sanitization configuration; defaults to enabled.
51
- * @returns The sanitized metric suitable for forwarding to a partner observability hook.
52
43
  * @internal
53
44
  */
54
45
  export declare function sanitizeMetric(metric: ObservabilityMetric, config?: SanitizationConfig): ObservabilityMetric;
@@ -0,0 +1 @@
1
+ export {};