@cellaware/utils 5.4.11 → 5.4.13

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.
@@ -6,28 +6,44 @@ const COSMOS_TIMESTAMP_DATETIME = `TimestampToDateTime(c._ts*1000)`;
6
6
  * All Cosmos timestamps are UTC.
7
7
  * https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
8
8
  */
9
+ const TIME_ZONE_OFFSETS = {
10
+ // North America:
11
+ 'America/New_York': -5, 'America/New_York_DST': -4, // Eastern
12
+ 'America/Chicago': -6, 'America/Chicago_DST': -5, // Central
13
+ 'America/Denver': -7, 'America/Denver_DST': -6, // Mountain
14
+ 'America/Phoenix': -7, // Mountain (no DST)
15
+ 'America/Los_Angeles': -8, 'America/Los_Angeles_DST': -7, // Pacific
16
+ 'America/Anchorage': -9, 'America/Anchorage_DST': -8, // Alaska
17
+ 'Pacific/Honolulu': -10, // Hawaii (no DST)
18
+ // South America:
19
+ 'America/Sao_Paulo': -3, // Brazil (DST mostly abolished)
20
+ 'America/Buenos_Aires': -3, // Argentina
21
+ // Europe:
22
+ 'Europe/London': 0, 'Europe/London_DST': 1, // UK
23
+ 'Europe/Berlin': 1, 'Europe/Berlin_DST': 2, // Central Europe
24
+ 'Europe/Moscow': 3, // Russia (no DST)
25
+ // Asia:
26
+ 'Asia/Dubai': 4, // UAE
27
+ 'Asia/Kolkata': 5.5, // India
28
+ 'Asia/Shanghai': 8, // China
29
+ 'Asia/Tokyo': 9, // Japan
30
+ 'Asia/Singapore': 8,
31
+ // Australia:
32
+ 'Australia/Sydney': 10, 'Australia/Sydney_DST': 11,
33
+ 'Australia/Perth': 8,
34
+ // Africa:
35
+ 'Africa/Johannesburg': 2,
36
+ 'Africa/Lagos': 1
37
+ };
9
38
  function getCosmosTimeZoneHourDiff(timeZone) {
10
39
  let diff = 0;
11
40
  if (!!timeZone) {
12
- const dst = isDaylightSavingTime(timeZone);
13
- switch (timeZone) {
14
- case 'America/New_York':
15
- diff = dst ? -4 : -5;
16
- break;
17
- case 'America/Chicago':
18
- diff = dst ? -5 : -6;
19
- break;
20
- case 'America/Denver':
21
- diff = dst ? -6 : -7;
22
- break;
23
- case 'America/Phoenix':
24
- diff = -7;
25
- break;
26
- case 'America/Los_Angeles':
27
- diff = dst ? -7 : -8;
28
- break;
29
- default:
30
- break;
41
+ let lookupTimeZone = timeZone;
42
+ if (isDaylightSavingTime(timeZone)) {
43
+ lookupTimeZone += '_DST';
44
+ }
45
+ if (lookupTimeZone in TIME_ZONE_OFFSETS) {
46
+ diff = TIME_ZONE_OFFSETS[lookupTimeZone];
31
47
  }
32
48
  }
33
49
  return diff;
@@ -23,7 +23,7 @@ export interface ChatWMSProduct extends ChatWMSProductBase {
23
23
  examples: ChatWMSProductExample[];
24
24
  columnDescriptions: ChatWMSProductColumnDescription[];
25
25
  columnComments: ChatWMSProductColumnComment[];
26
- valueDescriptions: ChatWMSProductValueDescription[];
26
+ valueDescriptionQueries: ChatWMSProductValueDescriptionQuery[];
27
27
  tableMappings: ChatWMSProductTableMapping[];
28
28
  columnMappings: ChatWMSProductColumnMapping[];
29
29
  analysis: any[];
@@ -62,7 +62,7 @@ export interface ChatWMSProductColumnComment {
62
62
  tableName?: string;
63
63
  comment: string;
64
64
  }
65
- export interface ChatWMSProductValueDescription {
65
+ export interface ChatWMSProductValueDescriptionQuery {
66
66
  columnName: string;
67
67
  tableName?: string;
68
68
  query: string;
@@ -36,7 +36,7 @@ export function initChatWMSProduct() {
36
36
  examples: [],
37
37
  columnDescriptions: [],
38
38
  columnComments: [],
39
- valueDescriptions: [],
39
+ valueDescriptionQueries: [],
40
40
  tableMappings: [],
41
41
  columnMappings: [],
42
42
  analysis: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "5.4.11",
3
+ "version": "5.4.13",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",