@salesforce/lds-runtime-mobile 1.259.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.
- package/dist/main.js +204 -3
- package/package.json +18 -18
- package/sfdc/main.js +204 -3
package/dist/main.js
CHANGED
|
@@ -19,6 +19,7 @@ import { parseAndVisit, Kind, buildSchema, isObjectType, defaultFieldResolver, v
|
|
|
19
19
|
import { RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION, isStoreKeyRecordViewEntity, getRecordId18, RECORD_REPRESENTATION_NAME, extractRecordIdFromStoreKey, keyBuilderQuickActionExecutionRepresentation, ingestQuickActionExecutionRepresentation, keyBuilderContentDocumentCompositeRepresentation, getResponseCacheKeysContentDocumentCompositeRepresentation, keyBuilderFromTypeContentDocumentCompositeRepresentation, ingestContentDocumentCompositeRepresentation, keyBuilderRecord, RECORD_VIEW_ENTITY_ID_PREFIX, getTypeCacheKeysRecord, keyBuilderFromTypeRecordRepresentation, ingestRecord, RecordRepresentationRepresentationType, ObjectInfoRepresentationType, getRecordAdapterFactory, getObjectInfoAdapterFactory, getObjectInfosAdapterFactory, getObjectInfoDirectoryAdapterFactory, UiApiNamespace, RecordRepresentationType, RecordRepresentationTTL, RecordRepresentationVersion, getRecordsAdapterFactory } from '@salesforce/lds-adapters-uiapi';
|
|
20
20
|
import ldsIdempotencyWriteDisabled from '@salesforce/gate/lds.idempotencyWriteDisabled';
|
|
21
21
|
import ldsBackdatingEnabled from '@salesforce/gate/lds.backdatingEnabled';
|
|
22
|
+
import FIRST_DAY_OF_WEEK from '@salesforce/i18n/firstDayOfWeek';
|
|
22
23
|
import caseSensitiveUserId from '@salesforce/user/Id';
|
|
23
24
|
import { idleDetector, getInstrumentation } from 'o11y/client';
|
|
24
25
|
import ldsUseShortUrlGate from '@salesforce/gate/lds.useShortUrl';
|
|
@@ -7453,16 +7454,21 @@ var DateRange;
|
|
|
7453
7454
|
(function (DateRange) {
|
|
7454
7455
|
DateRange["last_n_days"] = "last_n_days";
|
|
7455
7456
|
DateRange["next_n_days"] = "next_n_days";
|
|
7457
|
+
DateRange["n_days_ago"] = "n_days_ago";
|
|
7456
7458
|
DateRange["last_n_weeks"] = "last_n_weeks";
|
|
7457
7459
|
DateRange["next_n_weeks"] = "next_n_weeks";
|
|
7460
|
+
DateRange["n_weeks_ago"] = "n_weeks_ago";
|
|
7458
7461
|
DateRange["last_n_months"] = "last_n_months";
|
|
7459
7462
|
DateRange["next_n_months"] = "next_n_months";
|
|
7463
|
+
DateRange["n_months_ago"] = "n_months_ago";
|
|
7460
7464
|
DateRange["last_n_quarters"] = "last_n_quarters";
|
|
7461
7465
|
DateRange["next_n_quarters"] = "next_n_quarters";
|
|
7466
|
+
DateRange["n_quarters_ago"] = "n_quarters_ago";
|
|
7462
7467
|
DateRange["last_n_fiscal_quarters"] = "last_n_fiscal_quarters";
|
|
7463
7468
|
DateRange["next_n_fiscal_quarters"] = "next_n_fiscal_quarters";
|
|
7464
7469
|
DateRange["last_n_years"] = "last_n_years";
|
|
7465
7470
|
DateRange["next_n_years"] = "next_n_years";
|
|
7471
|
+
DateRange["n_years_ago"] = "n_years_ago";
|
|
7466
7472
|
DateRange["last_n_fiscal_years"] = "last_n_fiscal_years";
|
|
7467
7473
|
DateRange["next_n_fiscal_years"] = "next_n_fiscal_years";
|
|
7468
7474
|
})(DateRange || (DateRange = {}));
|
|
@@ -7533,6 +7539,7 @@ function dateTimeRange(input, op, field, alias) {
|
|
|
7533
7539
|
dataType: field.dataType,
|
|
7534
7540
|
};
|
|
7535
7541
|
}
|
|
7542
|
+
// relative date ranges defined at https://help.salesforce.com/s/articleView?id=sf.filter_dates_relative.htm&type=5
|
|
7536
7543
|
function dateRangesFrom(dateRange, input, dateFunction) {
|
|
7537
7544
|
// use 'start of day' to ensure the timestamp is 00:00:00 for date time values
|
|
7538
7545
|
switch (dateRange) {
|
|
@@ -7562,7 +7569,86 @@ function dateRangesFrom(dateRange, input, dateFunction) {
|
|
|
7562
7569
|
},
|
|
7563
7570
|
};
|
|
7564
7571
|
}
|
|
7565
|
-
//
|
|
7572
|
+
// n_days_ago
|
|
7573
|
+
// starts 12:00:00 am -(n) days from today
|
|
7574
|
+
// ends 11:59:99 pm -(n) days from today
|
|
7575
|
+
case DateRange.n_days_ago: {
|
|
7576
|
+
return {
|
|
7577
|
+
binding: {
|
|
7578
|
+
upper: `${-input + 1} days`,
|
|
7579
|
+
lower: `-${input} days`,
|
|
7580
|
+
},
|
|
7581
|
+
range: {
|
|
7582
|
+
upper: `${dateFunction}('now', 'start of day', ?, '-1 seconds')`,
|
|
7583
|
+
lower: `${dateFunction}('now', 'start of day', ?)`,
|
|
7584
|
+
},
|
|
7585
|
+
};
|
|
7586
|
+
}
|
|
7587
|
+
// next_n_weeks
|
|
7588
|
+
// starts at 00:00:00 the first day of the week n weeks after the current week
|
|
7589
|
+
// ends 23:59:59 of the last day of week before the current
|
|
7590
|
+
case DateRange.next_n_weeks: {
|
|
7591
|
+
const isStartOfWeek = isTodayStartOfWeek();
|
|
7592
|
+
return {
|
|
7593
|
+
binding: {
|
|
7594
|
+
// weekday FIRST_DAY_OF_WEEK goes to the next weekday of FIRST_DAY_OF_WEEK if not that current day
|
|
7595
|
+
// if that current day then it will be that day
|
|
7596
|
+
// 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
|
|
7597
|
+
upper: `${input * 7 + (isStartOfWeek ? 7 : 0)} days`,
|
|
7598
|
+
//lower bound starts out 00:00:00 of next week
|
|
7599
|
+
lower: `${isStartOfWeek ? 7 : 0} days`,
|
|
7600
|
+
},
|
|
7601
|
+
range: {
|
|
7602
|
+
upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
|
|
7603
|
+
lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
|
|
7604
|
+
},
|
|
7605
|
+
};
|
|
7606
|
+
}
|
|
7607
|
+
// last_n_weeks
|
|
7608
|
+
// starts at 00:00:00 of day 0 n weeks before the current week
|
|
7609
|
+
// ends 23:59:59 at last day of the week before the current week
|
|
7610
|
+
case DateRange.last_n_weeks: {
|
|
7611
|
+
const isStartOfWeek = isTodayStartOfWeek();
|
|
7612
|
+
return {
|
|
7613
|
+
binding: {
|
|
7614
|
+
// ending on at 23:59:59 of the week before the current week
|
|
7615
|
+
// -7 more days if today not start of week
|
|
7616
|
+
upper: `${-(isStartOfWeek ? 0 : 7)} days`,
|
|
7617
|
+
// starting on 00:00:00 of n * weeks before current week
|
|
7618
|
+
// -7 more days if today not the start of the week because weekday FIRST_DAY_OF_WEEK puts us next week day 0
|
|
7619
|
+
lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
|
|
7620
|
+
},
|
|
7621
|
+
range: {
|
|
7622
|
+
upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
|
|
7623
|
+
lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
|
|
7624
|
+
},
|
|
7625
|
+
};
|
|
7626
|
+
}
|
|
7627
|
+
// n_weeks_ago
|
|
7628
|
+
// starts 00:00:00 on day 0 of n weeks before the current week
|
|
7629
|
+
// ends 7 days after the start
|
|
7630
|
+
case DateRange.n_weeks_ago: {
|
|
7631
|
+
const isStartOfWeek = isTodayStartOfWeek();
|
|
7632
|
+
return {
|
|
7633
|
+
binding: {
|
|
7634
|
+
// end of week n weeks before current week
|
|
7635
|
+
// if today is start of the week then we need to -7 from the days given by n
|
|
7636
|
+
// so add 7 to remove a week from -(n)
|
|
7637
|
+
upper: `${-input * 7 + (isStartOfWeek ? 7 : 0)} days`,
|
|
7638
|
+
// start of the week n weeks from the current week
|
|
7639
|
+
// if today is the start of the week then -(n) will do to be the previous week, but
|
|
7640
|
+
// 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
|
|
7641
|
+
lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
|
|
7642
|
+
},
|
|
7643
|
+
range: {
|
|
7644
|
+
upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
|
|
7645
|
+
lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
|
|
7646
|
+
},
|
|
7647
|
+
};
|
|
7648
|
+
}
|
|
7649
|
+
// next_n_months
|
|
7650
|
+
// starts the first day of the next month at 00:00:00 and
|
|
7651
|
+
// ends end of the nth month 23:59:59
|
|
7566
7652
|
case DateRange.next_n_months: {
|
|
7567
7653
|
return {
|
|
7568
7654
|
binding: {
|
|
@@ -7575,7 +7661,8 @@ function dateRangesFrom(dateRange, input, dateFunction) {
|
|
|
7575
7661
|
},
|
|
7576
7662
|
};
|
|
7577
7663
|
}
|
|
7578
|
-
// last_n_months
|
|
7664
|
+
// last_n_months
|
|
7665
|
+
// starts at 00:00:00 first day of n months before the current month and
|
|
7579
7666
|
// ends at 23:59:59 the last day of the month before the current month
|
|
7580
7667
|
case DateRange.last_n_months: {
|
|
7581
7668
|
return {
|
|
@@ -7589,11 +7676,125 @@ function dateRangesFrom(dateRange, input, dateFunction) {
|
|
|
7589
7676
|
},
|
|
7590
7677
|
};
|
|
7591
7678
|
}
|
|
7679
|
+
// n_months_ago
|
|
7680
|
+
// starts at the first day of the month 00:00:00 n months ago from now
|
|
7681
|
+
// ends at 23:59:59 of n months ago
|
|
7682
|
+
case DateRange.n_months_ago: {
|
|
7683
|
+
return {
|
|
7684
|
+
binding: {
|
|
7685
|
+
// need to go 1 less month back then -1 seconds to get the end of it
|
|
7686
|
+
upper: `${-input + 1} months`,
|
|
7687
|
+
lower: `-${input} months`,
|
|
7688
|
+
},
|
|
7689
|
+
range: {
|
|
7690
|
+
upper: `${dateFunction}('now', 'start of month', ?, '-1 seconds')`,
|
|
7691
|
+
lower: `${dateFunction}('now', 'start of month', ?)`,
|
|
7692
|
+
},
|
|
7693
|
+
};
|
|
7694
|
+
}
|
|
7695
|
+
// next_n_years
|
|
7696
|
+
// starts 00:00:00 Jan 1st the year after the current year
|
|
7697
|
+
// ends Dec 31 23:59:59 of the nth year
|
|
7698
|
+
case DateRange.next_n_years: {
|
|
7699
|
+
return {
|
|
7700
|
+
binding: {
|
|
7701
|
+
upper: `+${input + 1} years`,
|
|
7702
|
+
lower: `+1 year`,
|
|
7703
|
+
},
|
|
7704
|
+
range: {
|
|
7705
|
+
upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
|
|
7706
|
+
lower: `${dateFunction}('now', 'start of year', ?)`,
|
|
7707
|
+
},
|
|
7708
|
+
};
|
|
7709
|
+
}
|
|
7710
|
+
// last_n_years starts
|
|
7711
|
+
// starts 00:00:00 Jan 1 n+1 year ago and
|
|
7712
|
+
// ends dec 31 23:59:59 of the year before the current
|
|
7713
|
+
case DateRange.last_n_years: {
|
|
7714
|
+
return {
|
|
7715
|
+
binding: {
|
|
7716
|
+
upper: `-1 seconds`,
|
|
7717
|
+
lower: `-${input + 1} years`,
|
|
7718
|
+
},
|
|
7719
|
+
range: {
|
|
7720
|
+
upper: `${dateFunction}('now', 'start of year', ?)`,
|
|
7721
|
+
lower: `${dateFunction}('now', 'start of year', ?)`,
|
|
7722
|
+
},
|
|
7723
|
+
};
|
|
7724
|
+
}
|
|
7725
|
+
// n_years_ago
|
|
7726
|
+
// starts 00:00:00 Jan 1 of n years before the current year and
|
|
7727
|
+
// ends Dec 31 23:59:59 of that year
|
|
7728
|
+
case DateRange.n_years_ago: {
|
|
7729
|
+
return {
|
|
7730
|
+
binding: {
|
|
7731
|
+
upper: `-${input - 1} years`,
|
|
7732
|
+
lower: `-${input} years`,
|
|
7733
|
+
},
|
|
7734
|
+
range: {
|
|
7735
|
+
upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
|
|
7736
|
+
lower: `${dateFunction}('now', 'start of year', ?)`,
|
|
7737
|
+
},
|
|
7738
|
+
};
|
|
7739
|
+
}
|
|
7740
|
+
// next_n_quarters
|
|
7741
|
+
// starts 00:00:00 first day of the quarter after the current quarter
|
|
7742
|
+
// ends 23:59:59 of the last day of n quarters in the future
|
|
7743
|
+
case DateRange.next_n_quarters: {
|
|
7744
|
+
const currentQuarterString = quarterStart(new Date());
|
|
7745
|
+
return {
|
|
7746
|
+
binding: {
|
|
7747
|
+
// add another quarter input to -1 seconds to get the end of the last day of the quarter
|
|
7748
|
+
upper: `${(input + 1) * 3} months`,
|
|
7749
|
+
lower: `3 months`,
|
|
7750
|
+
},
|
|
7751
|
+
range: {
|
|
7752
|
+
upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
|
|
7753
|
+
lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7754
|
+
},
|
|
7755
|
+
};
|
|
7756
|
+
}
|
|
7757
|
+
// last_n_quarters
|
|
7758
|
+
// starts 00:00:00 the first day of n quarters ago
|
|
7759
|
+
// end 23:59:59 the last day of the quarter before the current quarter
|
|
7760
|
+
case DateRange.last_n_quarters: {
|
|
7761
|
+
const currentQuarterString = quarterStart(new Date());
|
|
7762
|
+
return {
|
|
7763
|
+
binding: {
|
|
7764
|
+
upper: `-1 seconds`,
|
|
7765
|
+
lower: `-${input * 3} months`,
|
|
7766
|
+
},
|
|
7767
|
+
range: {
|
|
7768
|
+
upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7769
|
+
lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7770
|
+
},
|
|
7771
|
+
};
|
|
7772
|
+
}
|
|
7773
|
+
// n_quarters_ago
|
|
7774
|
+
// starts 00:00:00 first day of the quarter n quarters before the current
|
|
7775
|
+
// ends 23:59:59 last day of the same quarter
|
|
7776
|
+
case DateRange.n_quarters_ago: {
|
|
7777
|
+
const currentQuarterString = quarterStart(new Date());
|
|
7778
|
+
return {
|
|
7779
|
+
binding: {
|
|
7780
|
+
// minus 1 quarter to be able to -1 seconds to get the end of the nth quarter
|
|
7781
|
+
upper: `-${(input - 1) * 3} months`,
|
|
7782
|
+
lower: `-${input * 3} months`,
|
|
7783
|
+
},
|
|
7784
|
+
range: {
|
|
7785
|
+
upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
|
|
7786
|
+
lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7787
|
+
},
|
|
7788
|
+
};
|
|
7789
|
+
}
|
|
7592
7790
|
default:
|
|
7593
7791
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
7594
7792
|
throw new Error(`DateRangeInput ${dateRange} is not supported in local evalutation`);
|
|
7595
7793
|
}
|
|
7596
7794
|
}
|
|
7795
|
+
function isTodayStartOfWeek() {
|
|
7796
|
+
return new Date().getDay() === FIRST_DAY_OF_WEEK;
|
|
7797
|
+
}
|
|
7597
7798
|
|
|
7598
7799
|
const JSON_EXTRACT_PATH_INGESTION_TIMESTAMP = '$.ingestionTimestamp';
|
|
7599
7800
|
const JSON_EXTRACT_PATH_INGESTION_APINAME = '$.apiName';
|
|
@@ -17690,4 +17891,4 @@ register({
|
|
|
17690
17891
|
});
|
|
17691
17892
|
|
|
17692
17893
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
17693
|
-
// version: 1.
|
|
17894
|
+
// version: 1.260.0-95d02abca
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-mobile",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.260.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for mobile/hybrid environments.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,25 +32,25 @@
|
|
|
32
32
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
36
|
-
"@salesforce/lds-bindings": "^1.
|
|
37
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
38
|
-
"@salesforce/lds-priming": "^1.
|
|
35
|
+
"@salesforce/lds-adapters-uiapi": "^1.260.0",
|
|
36
|
+
"@salesforce/lds-bindings": "^1.260.0",
|
|
37
|
+
"@salesforce/lds-instrumentation": "^1.260.0",
|
|
38
|
+
"@salesforce/lds-priming": "^1.260.0",
|
|
39
39
|
"@salesforce/user": "0.0.21",
|
|
40
40
|
"o11y": "244.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-adapters-graphql": "^1.
|
|
44
|
-
"@salesforce/lds-drafts": "^1.
|
|
45
|
-
"@salesforce/lds-drafts-adapters-uiapi": "^1.
|
|
46
|
-
"@salesforce/lds-graphql-eval": "^1.
|
|
47
|
-
"@salesforce/lds-network-adapter": "^1.
|
|
48
|
-
"@salesforce/lds-network-nimbus": "^1.
|
|
49
|
-
"@salesforce/lds-store-binary": "^1.
|
|
50
|
-
"@salesforce/lds-store-nimbus": "^1.
|
|
51
|
-
"@salesforce/lds-store-sql": "^1.
|
|
52
|
-
"@salesforce/lds-utils-adapters": "^1.
|
|
53
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
43
|
+
"@salesforce/lds-adapters-graphql": "^1.260.0",
|
|
44
|
+
"@salesforce/lds-drafts": "^1.260.0",
|
|
45
|
+
"@salesforce/lds-drafts-adapters-uiapi": "^1.260.0",
|
|
46
|
+
"@salesforce/lds-graphql-eval": "^1.260.0",
|
|
47
|
+
"@salesforce/lds-network-adapter": "^1.260.0",
|
|
48
|
+
"@salesforce/lds-network-nimbus": "^1.260.0",
|
|
49
|
+
"@salesforce/lds-store-binary": "^1.260.0",
|
|
50
|
+
"@salesforce/lds-store-nimbus": "^1.260.0",
|
|
51
|
+
"@salesforce/lds-store-sql": "^1.260.0",
|
|
52
|
+
"@salesforce/lds-utils-adapters": "^1.260.0",
|
|
53
|
+
"@salesforce/nimbus-plugin-lds": "^1.260.0",
|
|
54
54
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
55
55
|
"wait-for-expect": "^3.0.2"
|
|
56
56
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"path": "./dist/main.js",
|
|
60
60
|
"maxSize": {
|
|
61
61
|
"none": "800 kB",
|
|
62
|
-
"min": "
|
|
62
|
+
"min": "315 kB",
|
|
63
63
|
"compressed": "150 kB"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"path": "./sfdc/main.js",
|
|
68
68
|
"maxSize": {
|
|
69
69
|
"none": "800 kB",
|
|
70
|
-
"min": "
|
|
70
|
+
"min": "315 kB",
|
|
71
71
|
"compressed": "150 kB"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/sfdc/main.js
CHANGED
|
@@ -19,6 +19,7 @@ import { parseAndVisit, Kind, buildSchema, isObjectType, defaultFieldResolver, v
|
|
|
19
19
|
import { RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION, isStoreKeyRecordViewEntity, getRecordId18, RECORD_REPRESENTATION_NAME, extractRecordIdFromStoreKey, keyBuilderQuickActionExecutionRepresentation, ingestQuickActionExecutionRepresentation, keyBuilderContentDocumentCompositeRepresentation, getResponseCacheKeysContentDocumentCompositeRepresentation, keyBuilderFromTypeContentDocumentCompositeRepresentation, ingestContentDocumentCompositeRepresentation, keyBuilderRecord, RECORD_VIEW_ENTITY_ID_PREFIX, getTypeCacheKeysRecord, keyBuilderFromTypeRecordRepresentation, ingestRecord, RecordRepresentationRepresentationType, ObjectInfoRepresentationType, getRecordAdapterFactory, getObjectInfoAdapterFactory, getObjectInfosAdapterFactory, getObjectInfoDirectoryAdapterFactory, UiApiNamespace, RecordRepresentationType, RecordRepresentationTTL, RecordRepresentationVersion, getRecordsAdapterFactory } from 'force/ldsAdaptersUiapi';
|
|
20
20
|
import ldsIdempotencyWriteDisabled from '@salesforce/gate/lds.idempotencyWriteDisabled';
|
|
21
21
|
import ldsBackdatingEnabled from '@salesforce/gate/lds.backdatingEnabled';
|
|
22
|
+
import FIRST_DAY_OF_WEEK from '@salesforce/i18n/firstDayOfWeek';
|
|
22
23
|
import caseSensitiveUserId from '@salesforce/user/Id';
|
|
23
24
|
import { idleDetector, getInstrumentation } from 'o11y/client';
|
|
24
25
|
import ldsUseShortUrlGate from '@salesforce/gate/lds.useShortUrl';
|
|
@@ -7453,16 +7454,21 @@ var DateRange;
|
|
|
7453
7454
|
(function (DateRange) {
|
|
7454
7455
|
DateRange["last_n_days"] = "last_n_days";
|
|
7455
7456
|
DateRange["next_n_days"] = "next_n_days";
|
|
7457
|
+
DateRange["n_days_ago"] = "n_days_ago";
|
|
7456
7458
|
DateRange["last_n_weeks"] = "last_n_weeks";
|
|
7457
7459
|
DateRange["next_n_weeks"] = "next_n_weeks";
|
|
7460
|
+
DateRange["n_weeks_ago"] = "n_weeks_ago";
|
|
7458
7461
|
DateRange["last_n_months"] = "last_n_months";
|
|
7459
7462
|
DateRange["next_n_months"] = "next_n_months";
|
|
7463
|
+
DateRange["n_months_ago"] = "n_months_ago";
|
|
7460
7464
|
DateRange["last_n_quarters"] = "last_n_quarters";
|
|
7461
7465
|
DateRange["next_n_quarters"] = "next_n_quarters";
|
|
7466
|
+
DateRange["n_quarters_ago"] = "n_quarters_ago";
|
|
7462
7467
|
DateRange["last_n_fiscal_quarters"] = "last_n_fiscal_quarters";
|
|
7463
7468
|
DateRange["next_n_fiscal_quarters"] = "next_n_fiscal_quarters";
|
|
7464
7469
|
DateRange["last_n_years"] = "last_n_years";
|
|
7465
7470
|
DateRange["next_n_years"] = "next_n_years";
|
|
7471
|
+
DateRange["n_years_ago"] = "n_years_ago";
|
|
7466
7472
|
DateRange["last_n_fiscal_years"] = "last_n_fiscal_years";
|
|
7467
7473
|
DateRange["next_n_fiscal_years"] = "next_n_fiscal_years";
|
|
7468
7474
|
})(DateRange || (DateRange = {}));
|
|
@@ -7533,6 +7539,7 @@ function dateTimeRange(input, op, field, alias) {
|
|
|
7533
7539
|
dataType: field.dataType,
|
|
7534
7540
|
};
|
|
7535
7541
|
}
|
|
7542
|
+
// relative date ranges defined at https://help.salesforce.com/s/articleView?id=sf.filter_dates_relative.htm&type=5
|
|
7536
7543
|
function dateRangesFrom(dateRange, input, dateFunction) {
|
|
7537
7544
|
// use 'start of day' to ensure the timestamp is 00:00:00 for date time values
|
|
7538
7545
|
switch (dateRange) {
|
|
@@ -7562,7 +7569,86 @@ function dateRangesFrom(dateRange, input, dateFunction) {
|
|
|
7562
7569
|
},
|
|
7563
7570
|
};
|
|
7564
7571
|
}
|
|
7565
|
-
//
|
|
7572
|
+
// n_days_ago
|
|
7573
|
+
// starts 12:00:00 am -(n) days from today
|
|
7574
|
+
// ends 11:59:99 pm -(n) days from today
|
|
7575
|
+
case DateRange.n_days_ago: {
|
|
7576
|
+
return {
|
|
7577
|
+
binding: {
|
|
7578
|
+
upper: `${-input + 1} days`,
|
|
7579
|
+
lower: `-${input} days`,
|
|
7580
|
+
},
|
|
7581
|
+
range: {
|
|
7582
|
+
upper: `${dateFunction}('now', 'start of day', ?, '-1 seconds')`,
|
|
7583
|
+
lower: `${dateFunction}('now', 'start of day', ?)`,
|
|
7584
|
+
},
|
|
7585
|
+
};
|
|
7586
|
+
}
|
|
7587
|
+
// next_n_weeks
|
|
7588
|
+
// starts at 00:00:00 the first day of the week n weeks after the current week
|
|
7589
|
+
// ends 23:59:59 of the last day of week before the current
|
|
7590
|
+
case DateRange.next_n_weeks: {
|
|
7591
|
+
const isStartOfWeek = isTodayStartOfWeek();
|
|
7592
|
+
return {
|
|
7593
|
+
binding: {
|
|
7594
|
+
// weekday FIRST_DAY_OF_WEEK goes to the next weekday of FIRST_DAY_OF_WEEK if not that current day
|
|
7595
|
+
// if that current day then it will be that day
|
|
7596
|
+
// 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
|
|
7597
|
+
upper: `${input * 7 + (isStartOfWeek ? 7 : 0)} days`,
|
|
7598
|
+
//lower bound starts out 00:00:00 of next week
|
|
7599
|
+
lower: `${isStartOfWeek ? 7 : 0} days`,
|
|
7600
|
+
},
|
|
7601
|
+
range: {
|
|
7602
|
+
upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
|
|
7603
|
+
lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
|
|
7604
|
+
},
|
|
7605
|
+
};
|
|
7606
|
+
}
|
|
7607
|
+
// last_n_weeks
|
|
7608
|
+
// starts at 00:00:00 of day 0 n weeks before the current week
|
|
7609
|
+
// ends 23:59:59 at last day of the week before the current week
|
|
7610
|
+
case DateRange.last_n_weeks: {
|
|
7611
|
+
const isStartOfWeek = isTodayStartOfWeek();
|
|
7612
|
+
return {
|
|
7613
|
+
binding: {
|
|
7614
|
+
// ending on at 23:59:59 of the week before the current week
|
|
7615
|
+
// -7 more days if today not start of week
|
|
7616
|
+
upper: `${-(isStartOfWeek ? 0 : 7)} days`,
|
|
7617
|
+
// starting on 00:00:00 of n * weeks before current week
|
|
7618
|
+
// -7 more days if today not the start of the week because weekday FIRST_DAY_OF_WEEK puts us next week day 0
|
|
7619
|
+
lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
|
|
7620
|
+
},
|
|
7621
|
+
range: {
|
|
7622
|
+
upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
|
|
7623
|
+
lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
|
|
7624
|
+
},
|
|
7625
|
+
};
|
|
7626
|
+
}
|
|
7627
|
+
// n_weeks_ago
|
|
7628
|
+
// starts 00:00:00 on day 0 of n weeks before the current week
|
|
7629
|
+
// ends 7 days after the start
|
|
7630
|
+
case DateRange.n_weeks_ago: {
|
|
7631
|
+
const isStartOfWeek = isTodayStartOfWeek();
|
|
7632
|
+
return {
|
|
7633
|
+
binding: {
|
|
7634
|
+
// end of week n weeks before current week
|
|
7635
|
+
// if today is start of the week then we need to -7 from the days given by n
|
|
7636
|
+
// so add 7 to remove a week from -(n)
|
|
7637
|
+
upper: `${-input * 7 + (isStartOfWeek ? 7 : 0)} days`,
|
|
7638
|
+
// start of the week n weeks from the current week
|
|
7639
|
+
// if today is the start of the week then -(n) will do to be the previous week, but
|
|
7640
|
+
// 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
|
|
7641
|
+
lower: `${-input * 7 - (isStartOfWeek ? 0 : 7)} days`,
|
|
7642
|
+
},
|
|
7643
|
+
range: {
|
|
7644
|
+
upper: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?, '-1 seconds')`,
|
|
7645
|
+
lower: `${dateFunction}('now', 'weekday ${FIRST_DAY_OF_WEEK}', 'start of day', ?)`,
|
|
7646
|
+
},
|
|
7647
|
+
};
|
|
7648
|
+
}
|
|
7649
|
+
// next_n_months
|
|
7650
|
+
// starts the first day of the next month at 00:00:00 and
|
|
7651
|
+
// ends end of the nth month 23:59:59
|
|
7566
7652
|
case DateRange.next_n_months: {
|
|
7567
7653
|
return {
|
|
7568
7654
|
binding: {
|
|
@@ -7575,7 +7661,8 @@ function dateRangesFrom(dateRange, input, dateFunction) {
|
|
|
7575
7661
|
},
|
|
7576
7662
|
};
|
|
7577
7663
|
}
|
|
7578
|
-
// last_n_months
|
|
7664
|
+
// last_n_months
|
|
7665
|
+
// starts at 00:00:00 first day of n months before the current month and
|
|
7579
7666
|
// ends at 23:59:59 the last day of the month before the current month
|
|
7580
7667
|
case DateRange.last_n_months: {
|
|
7581
7668
|
return {
|
|
@@ -7589,11 +7676,125 @@ function dateRangesFrom(dateRange, input, dateFunction) {
|
|
|
7589
7676
|
},
|
|
7590
7677
|
};
|
|
7591
7678
|
}
|
|
7679
|
+
// n_months_ago
|
|
7680
|
+
// starts at the first day of the month 00:00:00 n months ago from now
|
|
7681
|
+
// ends at 23:59:59 of n months ago
|
|
7682
|
+
case DateRange.n_months_ago: {
|
|
7683
|
+
return {
|
|
7684
|
+
binding: {
|
|
7685
|
+
// need to go 1 less month back then -1 seconds to get the end of it
|
|
7686
|
+
upper: `${-input + 1} months`,
|
|
7687
|
+
lower: `-${input} months`,
|
|
7688
|
+
},
|
|
7689
|
+
range: {
|
|
7690
|
+
upper: `${dateFunction}('now', 'start of month', ?, '-1 seconds')`,
|
|
7691
|
+
lower: `${dateFunction}('now', 'start of month', ?)`,
|
|
7692
|
+
},
|
|
7693
|
+
};
|
|
7694
|
+
}
|
|
7695
|
+
// next_n_years
|
|
7696
|
+
// starts 00:00:00 Jan 1st the year after the current year
|
|
7697
|
+
// ends Dec 31 23:59:59 of the nth year
|
|
7698
|
+
case DateRange.next_n_years: {
|
|
7699
|
+
return {
|
|
7700
|
+
binding: {
|
|
7701
|
+
upper: `+${input + 1} years`,
|
|
7702
|
+
lower: `+1 year`,
|
|
7703
|
+
},
|
|
7704
|
+
range: {
|
|
7705
|
+
upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
|
|
7706
|
+
lower: `${dateFunction}('now', 'start of year', ?)`,
|
|
7707
|
+
},
|
|
7708
|
+
};
|
|
7709
|
+
}
|
|
7710
|
+
// last_n_years starts
|
|
7711
|
+
// starts 00:00:00 Jan 1 n+1 year ago and
|
|
7712
|
+
// ends dec 31 23:59:59 of the year before the current
|
|
7713
|
+
case DateRange.last_n_years: {
|
|
7714
|
+
return {
|
|
7715
|
+
binding: {
|
|
7716
|
+
upper: `-1 seconds`,
|
|
7717
|
+
lower: `-${input + 1} years`,
|
|
7718
|
+
},
|
|
7719
|
+
range: {
|
|
7720
|
+
upper: `${dateFunction}('now', 'start of year', ?)`,
|
|
7721
|
+
lower: `${dateFunction}('now', 'start of year', ?)`,
|
|
7722
|
+
},
|
|
7723
|
+
};
|
|
7724
|
+
}
|
|
7725
|
+
// n_years_ago
|
|
7726
|
+
// starts 00:00:00 Jan 1 of n years before the current year and
|
|
7727
|
+
// ends Dec 31 23:59:59 of that year
|
|
7728
|
+
case DateRange.n_years_ago: {
|
|
7729
|
+
return {
|
|
7730
|
+
binding: {
|
|
7731
|
+
upper: `-${input - 1} years`,
|
|
7732
|
+
lower: `-${input} years`,
|
|
7733
|
+
},
|
|
7734
|
+
range: {
|
|
7735
|
+
upper: `${dateFunction}('now', 'start of year', ?, '-1 seconds')`,
|
|
7736
|
+
lower: `${dateFunction}('now', 'start of year', ?)`,
|
|
7737
|
+
},
|
|
7738
|
+
};
|
|
7739
|
+
}
|
|
7740
|
+
// next_n_quarters
|
|
7741
|
+
// starts 00:00:00 first day of the quarter after the current quarter
|
|
7742
|
+
// ends 23:59:59 of the last day of n quarters in the future
|
|
7743
|
+
case DateRange.next_n_quarters: {
|
|
7744
|
+
const currentQuarterString = quarterStart(new Date());
|
|
7745
|
+
return {
|
|
7746
|
+
binding: {
|
|
7747
|
+
// add another quarter input to -1 seconds to get the end of the last day of the quarter
|
|
7748
|
+
upper: `${(input + 1) * 3} months`,
|
|
7749
|
+
lower: `3 months`,
|
|
7750
|
+
},
|
|
7751
|
+
range: {
|
|
7752
|
+
upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
|
|
7753
|
+
lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7754
|
+
},
|
|
7755
|
+
};
|
|
7756
|
+
}
|
|
7757
|
+
// last_n_quarters
|
|
7758
|
+
// starts 00:00:00 the first day of n quarters ago
|
|
7759
|
+
// end 23:59:59 the last day of the quarter before the current quarter
|
|
7760
|
+
case DateRange.last_n_quarters: {
|
|
7761
|
+
const currentQuarterString = quarterStart(new Date());
|
|
7762
|
+
return {
|
|
7763
|
+
binding: {
|
|
7764
|
+
upper: `-1 seconds`,
|
|
7765
|
+
lower: `-${input * 3} months`,
|
|
7766
|
+
},
|
|
7767
|
+
range: {
|
|
7768
|
+
upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7769
|
+
lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7770
|
+
},
|
|
7771
|
+
};
|
|
7772
|
+
}
|
|
7773
|
+
// n_quarters_ago
|
|
7774
|
+
// starts 00:00:00 first day of the quarter n quarters before the current
|
|
7775
|
+
// ends 23:59:59 last day of the same quarter
|
|
7776
|
+
case DateRange.n_quarters_ago: {
|
|
7777
|
+
const currentQuarterString = quarterStart(new Date());
|
|
7778
|
+
return {
|
|
7779
|
+
binding: {
|
|
7780
|
+
// minus 1 quarter to be able to -1 seconds to get the end of the nth quarter
|
|
7781
|
+
upper: `-${(input - 1) * 3} months`,
|
|
7782
|
+
lower: `-${input * 3} months`,
|
|
7783
|
+
},
|
|
7784
|
+
range: {
|
|
7785
|
+
upper: `${dateFunction}('${currentQuarterString}', 'start of day', ?, '-1 seconds')`,
|
|
7786
|
+
lower: `${dateFunction}('${currentQuarterString}', 'start of day', ?)`,
|
|
7787
|
+
},
|
|
7788
|
+
};
|
|
7789
|
+
}
|
|
7592
7790
|
default:
|
|
7593
7791
|
// eslint-disable-next-line @salesforce/lds/no-error-in-production
|
|
7594
7792
|
throw new Error(`DateRangeInput ${dateRange} is not supported in local evalutation`);
|
|
7595
7793
|
}
|
|
7596
7794
|
}
|
|
7795
|
+
function isTodayStartOfWeek() {
|
|
7796
|
+
return new Date().getDay() === FIRST_DAY_OF_WEEK;
|
|
7797
|
+
}
|
|
7597
7798
|
|
|
7598
7799
|
const JSON_EXTRACT_PATH_INGESTION_TIMESTAMP = '$.ingestionTimestamp';
|
|
7599
7800
|
const JSON_EXTRACT_PATH_INGESTION_APINAME = '$.apiName';
|
|
@@ -17690,4 +17891,4 @@ register({
|
|
|
17690
17891
|
});
|
|
17691
17892
|
|
|
17692
17893
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
17693
|
-
// version: 1.
|
|
17894
|
+
// version: 1.260.0-95d02abca
|