expensify-common 2.0.154 → 2.0.156

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/CONST.d.ts CHANGED
@@ -14,6 +14,11 @@ declare const CONST: {
14
14
  * @type {Number}
15
15
  */
16
16
  readonly ACH_DEFAULT_MAX_AMOUNT_LIMIT: 2000000;
17
+ /**
18
+ * This is set in main.html and is derived from a PHP template variable
19
+ * @type {String}
20
+ */
21
+ readonly URL_TO_SECURE_WEBSITE: "";
17
22
  /**
18
23
  * IRS remimbursement rate for mileage
19
24
  * WARNING ! UPDATE THE PHP CONSTANT VERSION WHEN UPDATING THIS ONE
@@ -29,7 +34,9 @@ declare const CONST: {
29
34
  readonly MAX_TRIAL_BONUS_DAYS: 42;
30
35
  readonly COUNTRY: {
31
36
  readonly US: "US";
37
+ readonly MX: "MX";
32
38
  readonly AU: "AU";
39
+ readonly CA: "CA";
33
40
  readonly UK: "UK";
34
41
  readonly NZ: "NZ";
35
42
  };
@@ -410,6 +417,10 @@ declare const CONST: {
410
417
  */
411
418
  readonly MAX_AGE_SAME_COMMENT: 300;
412
419
  readonly SMARTREPORT_AGENT_EMAIL: "smartreports@expensify.com";
420
+ /**
421
+ * Email to submit smart reports to (alias for consistency)
422
+ */
423
+ readonly SMART_REPORT_AGENT_EMAIL: "smartreports@expensify.com";
413
424
  };
414
425
  /**
415
426
  * Root URLs
@@ -517,6 +528,18 @@ declare const CONST: {
517
528
  readonly BANK_ACCOUNT: {
518
529
  readonly VERIFICATION_MAX_ATTEMPTS: 7;
519
530
  };
531
+ readonly BANK_IMPORT_DAY_LIMITS: {
532
+ readonly 'americanexpress.com': 30;
533
+ readonly 'oauth.bankofamerica.com': 30;
534
+ readonly 'oauth.capitalone.com': 90;
535
+ readonly 'oauth.chase.com': 90;
536
+ readonly 'discover.com': 30;
537
+ readonly 'admin.pexcard.com': 30;
538
+ readonly svbdirect: 75;
539
+ readonly 'oauth.wellsfargo.com': 30;
540
+ };
541
+ readonly DEFAULT_BANK_IMPORT_DAYS: 90;
542
+ readonly PERSONAL_CARD_START_DATE_TOOLTIP: "Expensify will automatically import the earliest available transactions from this card. If a start date is selected, transactions with a posted date prior to this will not be included.";
520
543
  /**
521
544
  * Emails that the user shouldn't be interacting with from the front-end interface
522
545
  * Trying to add these emails as a delegate, onto a policy, or as an approver is considered invalid
package/dist/CONST.js CHANGED
@@ -22,6 +22,11 @@ const CONST = {
22
22
  * @type {Number}
23
23
  */
24
24
  ACH_DEFAULT_MAX_AMOUNT_LIMIT: 2000000,
25
+ /**
26
+ * This is set in main.html and is derived from a PHP template variable
27
+ * @type {String}
28
+ */
29
+ URL_TO_SECURE_WEBSITE: '',
25
30
  /**
26
31
  * IRS remimbursement rate for mileage
27
32
  * WARNING ! UPDATE THE PHP CONSTANT VERSION WHEN UPDATING THIS ONE
@@ -37,7 +42,9 @@ const CONST = {
37
42
  MAX_TRIAL_BONUS_DAYS: 42,
38
43
  COUNTRY: {
39
44
  US: 'US',
45
+ MX: 'MX',
40
46
  AU: 'AU',
47
+ CA: 'CA',
41
48
  UK: 'UK',
42
49
  NZ: 'NZ',
43
50
  },
@@ -418,6 +425,10 @@ const CONST = {
418
425
  */
419
426
  MAX_AGE_SAME_COMMENT: 300,
420
427
  SMARTREPORT_AGENT_EMAIL: 'smartreports@expensify.com',
428
+ /**
429
+ * Email to submit smart reports to (alias for consistency)
430
+ */
431
+ SMART_REPORT_AGENT_EMAIL: 'smartreports@expensify.com',
421
432
  },
422
433
  /**
423
434
  * Root URLs
@@ -525,6 +536,21 @@ const CONST = {
525
536
  BANK_ACCOUNT: {
526
537
  VERIFICATION_MAX_ATTEMPTS: 7,
527
538
  },
539
+ // The number of days that certain banks limit their transaction imports to
540
+ // see https://stackoverflow.com/c/expensify/questions/1289/1290#1290 for more about this.
541
+ // If a bank isn't on this list, we default to 90 days
542
+ BANK_IMPORT_DAY_LIMITS: {
543
+ 'americanexpress.com': 30,
544
+ 'oauth.bankofamerica.com': 30,
545
+ 'oauth.capitalone.com': 90,
546
+ 'oauth.chase.com': 90,
547
+ 'discover.com': 30,
548
+ 'admin.pexcard.com': 30,
549
+ svbdirect: 75,
550
+ 'oauth.wellsfargo.com': 30,
551
+ },
552
+ DEFAULT_BANK_IMPORT_DAYS: 90,
553
+ PERSONAL_CARD_START_DATE_TOOLTIP: 'Expensify will automatically import the earliest available transactions from this card. If a start date is selected, transactions with a posted date prior to this will not be included.',
528
554
  /**
529
555
  * Emails that the user shouldn't be interacting with from the front-end interface
530
556
  * Trying to add these emails as a delegate, onto a policy, or as an approver is considered invalid
@@ -5,5 +5,5 @@
5
5
  * On native, when merging an existing value with new changes, SQLite will use JSON_PATCH, which removes top-level nullish values.
6
6
  * To be consistent with the behaviour for merge, we'll also want to remove null values for "set" operations.
7
7
  */
8
- declare function fastMerge<TObject extends Record<string, unknown>>(target: TObject, source: TObject, shouldRemoveNullObjectValues?: boolean): TObject;
8
+ declare function fastMerge<TObject>(target: TObject, source: TObject, shouldRemoveNullObjectValues?: boolean): TObject;
9
9
  export default fastMerge;
package/dist/fastMerge.js CHANGED
@@ -10,13 +10,6 @@ function isMergeableObject(value) {
10
10
  const nonNullObject = value != null ? typeof value === 'object' : false;
11
11
  return nonNullObject && Object.prototype.toString.call(value) !== '[object RegExp]' && Object.prototype.toString.call(value) !== '[object Date]' && !Array.isArray(value);
12
12
  }
13
- /**
14
- * Merges two objects and removes null values if "shouldRemoveNullObjectValues" is set to true
15
- *
16
- * We generally want to remove null values from objects written to disk and cache, because it decreases the amount of data stored in memory and on disk.
17
- * On native, when merging an existing value with new changes, SQLite will use JSON_PATCH, which removes top-level nullish values.
18
- * To be consistent with the behaviour for merge, we'll also want to remove null values for "set" operations.
19
- */
20
13
  function fastMerge(target, source, shouldRemoveNullObjectValues = true) {
21
14
  // We have to ignore arrays and nullish values here,
22
15
  // otherwise "mergeObject" will throw an error,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expensify-common",
3
- "version": "2.0.154",
3
+ "version": "2.0.156",
4
4
  "author": "Expensify, Inc.",
5
5
  "description": "Expensify libraries and components shared across different repos",
6
6
  "homepage": "https://expensify.com",