@salesforce/lds-worker-api 1.258.0 → 1.260.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.
@@ -1034,4 +1034,4 @@ if (process.env.NODE_ENV !== 'production') {
1034
1034
  }
1035
1035
 
1036
1036
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1037
- // version: 1.258.0-69570a3e6
1037
+ // version: 1.260.0-95d02abca
@@ -4129,7 +4129,7 @@ function withDefaultLuvio(callback) {
4129
4129
  }
4130
4130
  callbacks.push(callback);
4131
4131
  }
4132
- // version: 1.258.0-69570a3e6
4132
+ // version: 1.260.0-95d02abca
4133
4133
 
4134
4134
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4135
4135
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15637,7 +15637,7 @@ function gql(literals, ...subs) {
15637
15637
  }
15638
15638
  return superResult;
15639
15639
  }
15640
- // version: 1.258.0-69570a3e6
15640
+ // version: 1.260.0-95d02abca
15641
15641
 
15642
15642
  function unwrap(data) {
15643
15643
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16562,7 +16562,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16562
16562
  const { apiFamily, name } = metadata;
16563
16563
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16564
16564
  }
16565
- // version: 1.258.0-69570a3e6
16565
+ // version: 1.260.0-95d02abca
16566
16566
 
16567
16567
  /**
16568
16568
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -42975,7 +42975,7 @@ withDefaultLuvio((luvio) => {
42975
42975
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
42976
42976
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
42977
42977
  });
42978
- // version: 1.258.0-c09652442
42978
+ // version: 1.260.0-7a5d1675a
42979
42979
 
42980
42980
  var ldsIdempotencyWriteDisabled = {
42981
42981
  isOpen: function (e) {
@@ -42995,6 +42995,8 @@ var ldsBackdatingEnabled = {
42995
42995
  },
42996
42996
  };
42997
42997
 
42998
+ var FIRST_DAY_OF_WEEK = 0;
42999
+
42998
43000
  var caseSensitiveUserId = '005B0000000GR4OIAW';
42999
43001
 
43000
43002
  function requestIdleDetectedCallback(_callback) { }
@@ -45989,6 +45991,7 @@ function isScalarDataType(type) {
45989
45991
  'Email',
45990
45992
  'TextArea',
45991
45993
  'Percent',
45994
+ 'EncryptedString',
45992
45995
  ].includes(type);
45993
45996
  }
45994
45997
 
@@ -50535,16 +50538,21 @@ var DateRange;
50535
50538
  (function (DateRange) {
50536
50539
  DateRange["last_n_days"] = "last_n_days";
50537
50540
  DateRange["next_n_days"] = "next_n_days";
50541
+ DateRange["n_days_ago"] = "n_days_ago";
50538
50542
  DateRange["last_n_weeks"] = "last_n_weeks";
50539
50543
  DateRange["next_n_weeks"] = "next_n_weeks";
50544
+ DateRange["n_weeks_ago"] = "n_weeks_ago";
50540
50545
  DateRange["last_n_months"] = "last_n_months";
50541
50546
  DateRange["next_n_months"] = "next_n_months";
50547
+ DateRange["n_months_ago"] = "n_months_ago";
50542
50548
  DateRange["last_n_quarters"] = "last_n_quarters";
50543
50549
  DateRange["next_n_quarters"] = "next_n_quarters";
50550
+ DateRange["n_quarters_ago"] = "n_quarters_ago";
50544
50551
  DateRange["last_n_fiscal_quarters"] = "last_n_fiscal_quarters";
50545
50552
  DateRange["next_n_fiscal_quarters"] = "next_n_fiscal_quarters";
50546
50553
  DateRange["last_n_years"] = "last_n_years";
50547
50554
  DateRange["next_n_years"] = "next_n_years";
50555
+ DateRange["n_years_ago"] = "n_years_ago";
50548
50556
  DateRange["last_n_fiscal_years"] = "last_n_fiscal_years";
50549
50557
  DateRange["next_n_fiscal_years"] = "next_n_fiscal_years";
50550
50558
  })(DateRange || (DateRange = {}));
@@ -50615,6 +50623,7 @@ function dateTimeRange(input, op, field, alias) {
50615
50623
  dataType: field.dataType,
50616
50624
  };
50617
50625
  }
50626
+ // relative date ranges defined at https://help.salesforce.com/s/articleView?id=sf.filter_dates_relative.htm&type=5
50618
50627
  function dateRangesFrom(dateRange, input, dateFunction) {
50619
50628
  // use 'start of day' to ensure the timestamp is 00:00:00 for date time values
50620
50629
  switch (dateRange) {
@@ -50644,7 +50653,86 @@ function dateRangesFrom(dateRange, input, dateFunction) {
50644
50653
  },
50645
50654
  };
50646
50655
  }
50647
- // next_n_months range starts the first day of the next month at 00:00:00 and ends end of the nth month 23:59:59
50656
+ // n_days_ago
50657
+ // starts 12:00:00 am -(n) days from today
50658
+ // ends 11:59:99 pm -(n) days from today
50659
+ case DateRange.n_days_ago: {
50660
+ return {
50661
+ binding: {
50662
+ upper: `${-input + 1} days`,
50663
+ lower: `-${input} days`,
50664
+ },
50665
+ range: {
50666
+ upper: `${dateFunction}('now', 'start of day', ?, '-1 seconds')`,
50667
+ lower: `${dateFunction}('now', 'start of day', ?)`,
50668
+ },
50669
+ };
50670
+ }
50671
+ // next_n_weeks
50672
+ // starts at 00:00:00 the first day of the week n weeks after the current week
50673
+ // ends 23:59:59 of the last day of week before the current
50674
+ case DateRange.next_n_weeks: {
50675
+ const isStartOfWeek = isTodayStartOfWeek();
50676
+ return {
50677
+ binding: {
50678
+ // weekday FIRST_DAY_OF_WEEK goes to the next weekday of FIRST_DAY_OF_WEEK if not that current day
50679
+ // if that current day then it will be that day
50680
+ // so for the upper bound if today is the start of the week we need to add 7 more days to the value to get next week as the start
50681
+ upper: `${input * 7 + (isStartOfWeek ? 7 : 0)} days`,
50682
+ //lower bound starts out 00:00:00 of next week
50683
+ lower: `${isStartOfWeek ? 7 : 0} days`,
50684
+ },
50685
+ range: {
50686
+ upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
50687
+ lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
50688
+ },
50689
+ };
50690
+ }
50691
+ // last_n_weeks
50692
+ // starts at 00:00:00 of day 0 n weeks before the current week
50693
+ // ends 23:59:59 at last day of the week before the current week
50694
+ case DateRange.last_n_weeks: {
50695
+ const isStartOfWeek = isTodayStartOfWeek();
50696
+ return {
50697
+ binding: {
50698
+ // ending on at 23:59:59 of the week before the current week
50699
+ // -7 more days if today not start of week
50700
+ upper: `${-(isStartOfWeek ? 0 : 7)} days`,
50701
+ // starting on 00:00:00 of n * weeks before current week
50702
+ // -7 more days if today not the start of the week because weekday FIRST_DAY_OF_WEEK puts us next week day 0
50703
+ lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
50704
+ },
50705
+ range: {
50706
+ upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
50707
+ lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
50708
+ },
50709
+ };
50710
+ }
50711
+ // n_weeks_ago
50712
+ // starts 00:00:00 on day 0 of n weeks before the current week
50713
+ // ends 7 days after the start
50714
+ case DateRange.n_weeks_ago: {
50715
+ const isStartOfWeek = isTodayStartOfWeek();
50716
+ return {
50717
+ binding: {
50718
+ // end of week n weeks before current week
50719
+ // if today is start of the week then we need to -7 from the days given by n
50720
+ // so add 7 to remove a week from -(n)
50721
+ upper: `${-input * 7 + (isStartOfWeek ? 7 : 0)} days`,
50722
+ // start of the week n weeks from the current week
50723
+ // if today is the start of the week then -(n) will do to be the previous week, but
50724
+ // if today is not the start of the week we need to go back 1 more week since weekday FIRST_DAY_OF_WEEK will put us next week
50725
+ lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
50726
+ },
50727
+ range: {
50728
+ upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
50729
+ lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
50730
+ },
50731
+ };
50732
+ }
50733
+ // next_n_months
50734
+ // starts the first day of the next month at 00:00:00 and
50735
+ // ends end of the nth month 23:59:59
50648
50736
  case DateRange.next_n_months: {
50649
50737
  return {
50650
50738
  binding: {
@@ -50657,7 +50745,8 @@ function dateRangesFrom(dateRange, input, dateFunction) {
50657
50745
  },
50658
50746
  };
50659
50747
  }
50660
- // last_n_months range starts at 00:00:00 first day of n months before the current month and
50748
+ // last_n_months
50749
+ // starts at 00:00:00 first day of n months before the current month and
50661
50750
  // ends at 23:59:59 the last day of the month before the current month
50662
50751
  case DateRange.last_n_months: {
50663
50752
  return {
@@ -50671,11 +50760,125 @@ function dateRangesFrom(dateRange, input, dateFunction) {
50671
50760
  },
50672
50761
  };
50673
50762
  }
50763
+ // n_months_ago
50764
+ // starts at the first day of the month 00:00:00 n months ago from now
50765
+ // ends at 23:59:59 of n months ago
50766
+ case DateRange.n_months_ago: {
50767
+ return {
50768
+ binding: {
50769
+ // need to go 1 less month back then -1 seconds to get the end of it
50770
+ upper: `${-input + 1} months`,
50771
+ lower: `-${input} months`,
50772
+ },
50773
+ range: {
50774
+ upper: `${dateFunction}('now', 'start of month', ?, '-1 seconds')`,
50775
+ lower: `${dateFunction}('now', 'start of month', ?)`,
50776
+ },
50777
+ };
50778
+ }
50779
+ // next_n_years
50780
+ // starts 00:00:00 Jan 1st the year after the current year
50781
+ // ends Dec 31 23:59:59 of the nth year
50782
+ case DateRange.next_n_years: {
50783
+ return {
50784
+ binding: {
50785
+ upper: `+${input + 1} years`,
50786
+ lower: `+1 year`,
50787
+ },
50788
+ range: {
50789
+ upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
50790
+ lower: `${dateFunction}('now', 'start of year', ?)`,
50791
+ },
50792
+ };
50793
+ }
50794
+ // last_n_years starts
50795
+ // starts 00:00:00 Jan 1 n+1 year ago and
50796
+ // ends dec 31 23:59:59 of the year before the current
50797
+ case DateRange.last_n_years: {
50798
+ return {
50799
+ binding: {
50800
+ upper: `-1 seconds`,
50801
+ lower: `-${input + 1} years`,
50802
+ },
50803
+ range: {
50804
+ upper: `${dateFunction}('now', 'start of year', ?)`,
50805
+ lower: `${dateFunction}('now', 'start of year', ?)`,
50806
+ },
50807
+ };
50808
+ }
50809
+ // n_years_ago
50810
+ // starts 00:00:00 Jan 1 of n years before the current year and
50811
+ // ends Dec 31 23:59:59 of that year
50812
+ case DateRange.n_years_ago: {
50813
+ return {
50814
+ binding: {
50815
+ upper: `-${input - 1} years`,
50816
+ lower: `-${input} years`,
50817
+ },
50818
+ range: {
50819
+ upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
50820
+ lower: `${dateFunction}('now', 'start of year', ?)`,
50821
+ },
50822
+ };
50823
+ }
50824
+ // next_n_quarters
50825
+ // starts 00:00:00 first day of the quarter after the current quarter
50826
+ // ends 23:59:59 of the last day of n quarters in the future
50827
+ case DateRange.next_n_quarters: {
50828
+ const currentQuarterString = quarterStart(new Date());
50829
+ return {
50830
+ binding: {
50831
+ // add another quarter input to -1 seconds to get the end of the last day of the quarter
50832
+ upper: `${(input + 1) * 3} months`,
50833
+ lower: `3 months`,
50834
+ },
50835
+ range: {
50836
+ upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
50837
+ lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50838
+ },
50839
+ };
50840
+ }
50841
+ // last_n_quarters
50842
+ // starts 00:00:00 the first day of n quarters ago
50843
+ // end 23:59:59 the last day of the quarter before the current quarter
50844
+ case DateRange.last_n_quarters: {
50845
+ const currentQuarterString = quarterStart(new Date());
50846
+ return {
50847
+ binding: {
50848
+ upper: `-1 seconds`,
50849
+ lower: `-${input * 3} months`,
50850
+ },
50851
+ range: {
50852
+ upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50853
+ lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50854
+ },
50855
+ };
50856
+ }
50857
+ // n_quarters_ago
50858
+ // starts 00:00:00 first day of the quarter n quarters before the current
50859
+ // ends 23:59:59 last day of the same quarter
50860
+ case DateRange.n_quarters_ago: {
50861
+ const currentQuarterString = quarterStart(new Date());
50862
+ return {
50863
+ binding: {
50864
+ // minus 1 quarter to be able to -1 seconds to get the end of the nth quarter
50865
+ upper: `-${(input - 1) * 3} months`,
50866
+ lower: `-${input * 3} months`,
50867
+ },
50868
+ range: {
50869
+ upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
50870
+ lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50871
+ },
50872
+ };
50873
+ }
50674
50874
  default:
50675
50875
  // eslint-disable-next-line @salesforce/lds/no-error-in-production
50676
50876
  throw new Error(`DateRangeInput ${dateRange} is not supported in local evalutation`);
50677
50877
  }
50678
50878
  }
50879
+ function isTodayStartOfWeek() {
50880
+ return new Date().getDay() === FIRST_DAY_OF_WEEK;
50881
+ }
50679
50882
 
50680
50883
  const JSON_EXTRACT_PATH_INGESTION_TIMESTAMP = '$.ingestionTimestamp';
50681
50884
  const JSON_EXTRACT_PATH_INGESTION_APINAME = '$.apiName';
@@ -52854,6 +53057,8 @@ function dataTypeToType(objectInfoDataType, apiName) {
52854
53057
  return 'PercentValue';
52855
53058
  case 'Int':
52856
53059
  return 'IntValue';
53060
+ case 'EncryptedString':
53061
+ return 'EncryptedStringValue';
52857
53062
  // ! do the rest of the custom types
52858
53063
  default:
52859
53064
  return 'String';
@@ -60624,7 +60829,7 @@ register$1({
60624
60829
  id: '@salesforce/lds-network-adapter',
60625
60830
  instrument: instrument$2,
60626
60831
  });
60627
- // version: 1.258.0-69570a3e6
60832
+ // version: 1.260.0-95d02abca
60628
60833
 
60629
60834
  const { create: create$3, keys: keys$3 } = Object;
60630
60835
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -78953,7 +79158,7 @@ register$1({
78953
79158
  configuration: { ...configurationForGraphQLAdapters$1 },
78954
79159
  instrument: instrument$1,
78955
79160
  });
78956
- // version: 1.258.0-c09652442
79161
+ // version: 1.260.0-7a5d1675a
78957
79162
 
78958
79163
  // On core the unstable adapters are re-exported with different names,
78959
79164
  // we want to match them here.
@@ -81204,7 +81409,7 @@ withDefaultLuvio((luvio) => {
81204
81409
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
81205
81410
  graphQLImperative = ldsAdapter;
81206
81411
  });
81207
- // version: 1.258.0-c09652442
81412
+ // version: 1.260.0-7a5d1675a
81208
81413
 
81209
81414
  var gqlApi = /*#__PURE__*/Object.freeze({
81210
81415
  __proto__: null,
@@ -81902,7 +82107,7 @@ const callbacks$1 = [];
81902
82107
  function register(r) {
81903
82108
  callbacks$1.forEach((callback) => callback(r));
81904
82109
  }
81905
- // version: 1.258.0-69570a3e6
82110
+ // version: 1.260.0-95d02abca
81906
82111
 
81907
82112
  /**
81908
82113
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -86807,4 +87012,4 @@ const { luvio } = getRuntime();
86807
87012
  setDefaultLuvio({ luvio });
86808
87013
 
86809
87014
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
86810
- // version: 1.258.0-69570a3e6
87015
+ // version: 1.260.0-95d02abca
@@ -4135,7 +4135,7 @@
4135
4135
  }
4136
4136
  callbacks.push(callback);
4137
4137
  }
4138
- // version: 1.258.0-69570a3e6
4138
+ // version: 1.260.0-95d02abca
4139
4139
 
4140
4140
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4141
4141
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15643,7 +15643,7 @@
15643
15643
  }
15644
15644
  return superResult;
15645
15645
  }
15646
- // version: 1.258.0-69570a3e6
15646
+ // version: 1.260.0-95d02abca
15647
15647
 
15648
15648
  function unwrap(data) {
15649
15649
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16568,7 +16568,7 @@
16568
16568
  const { apiFamily, name } = metadata;
16569
16569
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16570
16570
  }
16571
- // version: 1.258.0-69570a3e6
16571
+ // version: 1.260.0-95d02abca
16572
16572
 
16573
16573
  /**
16574
16574
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -42981,7 +42981,7 @@
42981
42981
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
42982
42982
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
42983
42983
  });
42984
- // version: 1.258.0-c09652442
42984
+ // version: 1.260.0-7a5d1675a
42985
42985
 
42986
42986
  var ldsIdempotencyWriteDisabled = {
42987
42987
  isOpen: function (e) {
@@ -43001,6 +43001,8 @@
43001
43001
  },
43002
43002
  };
43003
43003
 
43004
+ var FIRST_DAY_OF_WEEK = 0;
43005
+
43004
43006
  var caseSensitiveUserId = '005B0000000GR4OIAW';
43005
43007
 
43006
43008
  function requestIdleDetectedCallback(_callback) { }
@@ -45995,6 +45997,7 @@
45995
45997
  'Email',
45996
45998
  'TextArea',
45997
45999
  'Percent',
46000
+ 'EncryptedString',
45998
46001
  ].includes(type);
45999
46002
  }
46000
46003
 
@@ -50541,16 +50544,21 @@
50541
50544
  (function (DateRange) {
50542
50545
  DateRange["last_n_days"] = "last_n_days";
50543
50546
  DateRange["next_n_days"] = "next_n_days";
50547
+ DateRange["n_days_ago"] = "n_days_ago";
50544
50548
  DateRange["last_n_weeks"] = "last_n_weeks";
50545
50549
  DateRange["next_n_weeks"] = "next_n_weeks";
50550
+ DateRange["n_weeks_ago"] = "n_weeks_ago";
50546
50551
  DateRange["last_n_months"] = "last_n_months";
50547
50552
  DateRange["next_n_months"] = "next_n_months";
50553
+ DateRange["n_months_ago"] = "n_months_ago";
50548
50554
  DateRange["last_n_quarters"] = "last_n_quarters";
50549
50555
  DateRange["next_n_quarters"] = "next_n_quarters";
50556
+ DateRange["n_quarters_ago"] = "n_quarters_ago";
50550
50557
  DateRange["last_n_fiscal_quarters"] = "last_n_fiscal_quarters";
50551
50558
  DateRange["next_n_fiscal_quarters"] = "next_n_fiscal_quarters";
50552
50559
  DateRange["last_n_years"] = "last_n_years";
50553
50560
  DateRange["next_n_years"] = "next_n_years";
50561
+ DateRange["n_years_ago"] = "n_years_ago";
50554
50562
  DateRange["last_n_fiscal_years"] = "last_n_fiscal_years";
50555
50563
  DateRange["next_n_fiscal_years"] = "next_n_fiscal_years";
50556
50564
  })(DateRange || (DateRange = {}));
@@ -50621,6 +50629,7 @@
50621
50629
  dataType: field.dataType,
50622
50630
  };
50623
50631
  }
50632
+ // relative date ranges defined at https://help.salesforce.com/s/articleView?id=sf.filter_dates_relative.htm&type=5
50624
50633
  function dateRangesFrom(dateRange, input, dateFunction) {
50625
50634
  // use 'start of day' to ensure the timestamp is 00:00:00 for date time values
50626
50635
  switch (dateRange) {
@@ -50650,7 +50659,86 @@
50650
50659
  },
50651
50660
  };
50652
50661
  }
50653
- // next_n_months range starts the first day of the next month at 00:00:00 and ends end of the nth month 23:59:59
50662
+ // n_days_ago
50663
+ // starts 12:00:00 am -(n) days from today
50664
+ // ends 11:59:99 pm -(n) days from today
50665
+ case DateRange.n_days_ago: {
50666
+ return {
50667
+ binding: {
50668
+ upper: `${-input + 1} days`,
50669
+ lower: `-${input} days`,
50670
+ },
50671
+ range: {
50672
+ upper: `${dateFunction}('now', 'start of day', ?, '-1 seconds')`,
50673
+ lower: `${dateFunction}('now', 'start of day', ?)`,
50674
+ },
50675
+ };
50676
+ }
50677
+ // next_n_weeks
50678
+ // starts at 00:00:00 the first day of the week n weeks after the current week
50679
+ // ends 23:59:59 of the last day of week before the current
50680
+ case DateRange.next_n_weeks: {
50681
+ const isStartOfWeek = isTodayStartOfWeek();
50682
+ return {
50683
+ binding: {
50684
+ // weekday FIRST_DAY_OF_WEEK goes to the next weekday of FIRST_DAY_OF_WEEK if not that current day
50685
+ // if that current day then it will be that day
50686
+ // so for the upper bound if today is the start of the week we need to add 7 more days to the value to get next week as the start
50687
+ upper: `${input * 7 + (isStartOfWeek ? 7 : 0)} days`,
50688
+ //lower bound starts out 00:00:00 of next week
50689
+ lower: `${isStartOfWeek ? 7 : 0} days`,
50690
+ },
50691
+ range: {
50692
+ upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
50693
+ lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
50694
+ },
50695
+ };
50696
+ }
50697
+ // last_n_weeks
50698
+ // starts at 00:00:00 of day 0 n weeks before the current week
50699
+ // ends 23:59:59 at last day of the week before the current week
50700
+ case DateRange.last_n_weeks: {
50701
+ const isStartOfWeek = isTodayStartOfWeek();
50702
+ return {
50703
+ binding: {
50704
+ // ending on at 23:59:59 of the week before the current week
50705
+ // -7 more days if today not start of week
50706
+ upper: `${-(isStartOfWeek ? 0 : 7)} days`,
50707
+ // starting on 00:00:00 of n * weeks before current week
50708
+ // -7 more days if today not the start of the week because weekday FIRST_DAY_OF_WEEK puts us next week day 0
50709
+ lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
50710
+ },
50711
+ range: {
50712
+ upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
50713
+ lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
50714
+ },
50715
+ };
50716
+ }
50717
+ // n_weeks_ago
50718
+ // starts 00:00:00 on day 0 of n weeks before the current week
50719
+ // ends 7 days after the start
50720
+ case DateRange.n_weeks_ago: {
50721
+ const isStartOfWeek = isTodayStartOfWeek();
50722
+ return {
50723
+ binding: {
50724
+ // end of week n weeks before current week
50725
+ // if today is start of the week then we need to -7 from the days given by n
50726
+ // so add 7 to remove a week from -(n)
50727
+ upper: `${-input * 7 + (isStartOfWeek ? 7 : 0)} days`,
50728
+ // start of the week n weeks from the current week
50729
+ // if today is the start of the week then -(n) will do to be the previous week, but
50730
+ // if today is not the start of the week we need to go back 1 more week since weekday FIRST_DAY_OF_WEEK will put us next week
50731
+ lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
50732
+ },
50733
+ range: {
50734
+ upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
50735
+ lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
50736
+ },
50737
+ };
50738
+ }
50739
+ // next_n_months
50740
+ // starts the first day of the next month at 00:00:00 and
50741
+ // ends end of the nth month 23:59:59
50654
50742
  case DateRange.next_n_months: {
50655
50743
  return {
50656
50744
  binding: {
@@ -50663,7 +50751,8 @@
50663
50751
  },
50664
50752
  };
50665
50753
  }
50666
- // last_n_months range starts at 00:00:00 first day of n months before the current month and
50754
+ // last_n_months
50755
+ // starts at 00:00:00 first day of n months before the current month and
50667
50756
  // ends at 23:59:59 the last day of the month before the current month
50668
50757
  case DateRange.last_n_months: {
50669
50758
  return {
@@ -50677,11 +50766,125 @@
50677
50766
  },
50678
50767
  };
50679
50768
  }
50769
+ // n_months_ago
50770
+ // starts at the first day of the month 00:00:00 n months ago from now
50771
+ // ends at 23:59:59 of n months ago
50772
+ case DateRange.n_months_ago: {
50773
+ return {
50774
+ binding: {
50775
+ // need to go 1 less month back then -1 seconds to get the end of it
50776
+ upper: `${-input + 1} months`,
50777
+ lower: `-${input} months`,
50778
+ },
50779
+ range: {
50780
+ upper: `${dateFunction}('now', 'start of month', ?, '-1 seconds')`,
50781
+ lower: `${dateFunction}('now', 'start of month', ?)`,
50782
+ },
50783
+ };
50784
+ }
50785
+ // next_n_years
50786
+ // starts 00:00:00 Jan 1st the year after the current year
50787
+ // ends Dec 31 23:59:59 of the nth year
50788
+ case DateRange.next_n_years: {
50789
+ return {
50790
+ binding: {
50791
+ upper: `+${input + 1} years`,
50792
+ lower: `+1 year`,
50793
+ },
50794
+ range: {
50795
+ upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
50796
+ lower: `${dateFunction}('now', 'start of year', ?)`,
50797
+ },
50798
+ };
50799
+ }
50800
+ // last_n_years starts
50801
+ // starts 00:00:00 Jan 1 n+1 year ago and
50802
+ // ends dec 31 23:59:59 of the year before the current
50803
+ case DateRange.last_n_years: {
50804
+ return {
50805
+ binding: {
50806
+ upper: `-1 seconds`,
50807
+ lower: `-${input + 1} years`,
50808
+ },
50809
+ range: {
50810
+ upper: `${dateFunction}('now', 'start of year', ?)`,
50811
+ lower: `${dateFunction}('now', 'start of year', ?)`,
50812
+ },
50813
+ };
50814
+ }
50815
+ // n_years_ago
50816
+ // starts 00:00:00 Jan 1 of n years before the current year and
50817
+ // ends Dec 31 23:59:59 of that year
50818
+ case DateRange.n_years_ago: {
50819
+ return {
50820
+ binding: {
50821
+ upper: `-${input - 1} years`,
50822
+ lower: `-${input} years`,
50823
+ },
50824
+ range: {
50825
+ upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
50826
+ lower: `${dateFunction}('now', 'start of year', ?)`,
50827
+ },
50828
+ };
50829
+ }
50830
+ // next_n_quarters
50831
+ // starts 00:00:00 first day of the quarter after the current quarter
50832
+ // ends 23:59:59 of the last day of n quarters in the future
50833
+ case DateRange.next_n_quarters: {
50834
+ const currentQuarterString = quarterStart(new Date());
50835
+ return {
50836
+ binding: {
50837
+ // add another quarter input to -1 seconds to get the end of the last day of the quarter
50838
+ upper: `${(input + 1) * 3} months`,
50839
+ lower: `3 months`,
50840
+ },
50841
+ range: {
50842
+ upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
50843
+ lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50844
+ },
50845
+ };
50846
+ }
50847
+ // last_n_quarters
50848
+ // starts 00:00:00 the first day of n quarters ago
50849
+ // end 23:59:59 the last day of the quarter before the current quarter
50850
+ case DateRange.last_n_quarters: {
50851
+ const currentQuarterString = quarterStart(new Date());
50852
+ return {
50853
+ binding: {
50854
+ upper: `-1 seconds`,
50855
+ lower: `-${input * 3} months`,
50856
+ },
50857
+ range: {
50858
+ upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50859
+ lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50860
+ },
50861
+ };
50862
+ }
50863
+ // n_quarters_ago
50864
+ // starts 00:00:00 first day of the quarter n quarters before the current
50865
+ // ends 23:59:59 last day of the same quarter
50866
+ case DateRange.n_quarters_ago: {
50867
+ const currentQuarterString = quarterStart(new Date());
50868
+ return {
50869
+ binding: {
50870
+ // minus 1 quarter to be able to -1 seconds to get the end of the nth quarter
50871
+ upper: `-${(input - 1) * 3} months`,
50872
+ lower: `-${input * 3} months`,
50873
+ },
50874
+ range: {
50875
+ upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
50876
+ lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
50877
+ },
50878
+ };
50879
+ }
50680
50880
  default:
50681
50881
  // eslint-disable-next-line @salesforce/lds/no-error-in-production
50682
50882
  throw new Error(`DateRangeInput ${dateRange} is not supported in local evalutation`);
50683
50883
  }
50684
50884
  }
50885
+ function isTodayStartOfWeek() {
50886
+ return new Date().getDay() === FIRST_DAY_OF_WEEK;
50887
+ }
50685
50888
 
50686
50889
  const JSON_EXTRACT_PATH_INGESTION_TIMESTAMP = '$.ingestionTimestamp';
50687
50890
  const JSON_EXTRACT_PATH_INGESTION_APINAME = '$.apiName';
@@ -52860,6 +53063,8 @@
52860
53063
  return 'PercentValue';
52861
53064
  case 'Int':
52862
53065
  return 'IntValue';
53066
+ case 'EncryptedString':
53067
+ return 'EncryptedStringValue';
52863
53068
  // ! do the rest of the custom types
52864
53069
  default:
52865
53070
  return 'String';
@@ -60630,7 +60835,7 @@
60630
60835
  id: '@salesforce/lds-network-adapter',
60631
60836
  instrument: instrument$2,
60632
60837
  });
60633
- // version: 1.258.0-69570a3e6
60838
+ // version: 1.260.0-95d02abca
60634
60839
 
60635
60840
  const { create: create$3, keys: keys$3 } = Object;
60636
60841
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -78959,7 +79164,7 @@
78959
79164
  configuration: { ...configurationForGraphQLAdapters$1 },
78960
79165
  instrument: instrument$1,
78961
79166
  });
78962
- // version: 1.258.0-c09652442
79167
+ // version: 1.260.0-7a5d1675a
78963
79168
 
78964
79169
  // On core the unstable adapters are re-exported with different names,
78965
79170
  // we want to match them here.
@@ -81210,7 +81415,7 @@
81210
81415
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
81211
81416
  graphQLImperative = ldsAdapter;
81212
81417
  });
81213
- // version: 1.258.0-c09652442
81418
+ // version: 1.260.0-7a5d1675a
81214
81419
 
81215
81420
  var gqlApi = /*#__PURE__*/Object.freeze({
81216
81421
  __proto__: null,
@@ -81908,7 +82113,7 @@
81908
82113
  function register(r) {
81909
82114
  callbacks$1.forEach((callback) => callback(r));
81910
82115
  }
81911
- // version: 1.258.0-69570a3e6
82116
+ // version: 1.260.0-95d02abca
81912
82117
 
81913
82118
  /**
81914
82119
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -86831,4 +87036,4 @@
86831
87036
  exports.subscribeToAdapter = subscribeToAdapter;
86832
87037
 
86833
87038
  }));
86834
- // version: 1.258.0-69570a3e6
87039
+ // version: 1.260.0-95d02abca
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.258.0",
3
+ "version": "1.260.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.258.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.258.0",
40
- "@salesforce/lds-default-luvio": "^1.258.0",
41
- "@salesforce/lds-drafts": "^1.258.0",
42
- "@salesforce/lds-graphql-parser": "^1.258.0",
43
- "@salesforce/lds-luvio-engine": "^1.258.0",
44
- "@salesforce/lds-priming": "^1.258.0",
45
- "@salesforce/lds-runtime-mobile": "^1.258.0",
46
- "@salesforce/nimbus-plugin-lds": "^1.258.0",
38
+ "@salesforce/lds-adapters-graphql": "^1.260.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.260.0",
40
+ "@salesforce/lds-default-luvio": "^1.260.0",
41
+ "@salesforce/lds-drafts": "^1.260.0",
42
+ "@salesforce/lds-graphql-parser": "^1.260.0",
43
+ "@salesforce/lds-luvio-engine": "^1.260.0",
44
+ "@salesforce/lds-priming": "^1.260.0",
45
+ "@salesforce/lds-runtime-mobile": "^1.260.0",
46
+ "@salesforce/nimbus-plugin-lds": "^1.260.0",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",