@cellaware/utils 3.4.34 → 3.4.35

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.
@@ -1,16 +1,86 @@
1
+ /**
2
+ * Returns the current date time
3
+ *
4
+ * NOTE: default time zone is UTC
5
+ */
1
6
  export declare function getCosmosCurrentDateTime(timeZone?: string): string;
7
+ /**
8
+ * Returns the record's date time using the `_ts` field
9
+ *
10
+ * NOTE: default time zone is UTC
11
+ */
2
12
  export declare function getCosmosTimestampDateTime(timeZone?: string): string;
13
+ /**
14
+ * Returns the current year
15
+ *
16
+ * NOTE: default time zone is UTC
17
+ */
3
18
  export declare function getCosmosCurrentYear(timeZone?: string): string;
19
+ /**
20
+ * Returns the record's year using the `_ts` field
21
+ *
22
+ * NOTE: default time zone is UTC
23
+ */
4
24
  export declare function getCosmosTimestampYear(timeZone?: string): string;
25
+ /**
26
+ * Returns the current month
27
+ *
28
+ * NOTE: default time zone is UTC
29
+ */
5
30
  export declare function getCosmosCurrentMonth(timeZone?: string): string;
31
+ /**
32
+ * Returns the record's month using the `_ts` field
33
+ *
34
+ * NOTE: default time zone is UTC
35
+ */
6
36
  export declare function getCosmosTimestampMonth(timeZone?: string): string;
37
+ /**
38
+ * Returns the current day
39
+ *
40
+ * NOTE: default time zone is UTC
41
+ */
7
42
  export declare function getCosmosCurrentDay(timeZone?: string): string;
43
+ /**
44
+ * Returns the record's day using the `_ts` field
45
+ *
46
+ * NOTE: default time zone is UTC
47
+ */
8
48
  export declare function getCosmosTimestampDay(timeZone?: string): string;
49
+ /**
50
+ * Returns the record's hour using the `_ts` field
51
+ *
52
+ * NOTE: default time zone is UTC
53
+ */
9
54
  export declare function getCosmosTimestampHour(timeZone?: string): string;
55
+ /**
56
+ * Returns the record's minute using the `_ts` field
57
+ *
58
+ * NOTE: default time zone is UTC
59
+ */
10
60
  export declare function getCosmosTimestampMinute(timeZone?: string): string;
61
+ /**
62
+ * Returns the record's second using the `_ts` field
63
+ *
64
+ * NOTE: default time zone is UTC
65
+ */
11
66
  export declare function getCosmosTimestampSecond(timeZone?: string): string;
67
+ /**
68
+ * Returns a `WHERE` clause to retrieve records with a `_ts` of today
69
+ *
70
+ * NOTE: default time zone is UTC
71
+ */
12
72
  export declare function getCosmosCurrentDayWhereClause(timeZone?: string): string;
73
+ /**
74
+ * Returns a `WHERE` clause to retrieve records with a `_ts` of this month
75
+ *
76
+ * NOTE: default time zone is UTC
77
+ */
13
78
  export declare function getCosmosCurrentMonthWhereClause(timeZone?: string): string;
79
+ /**
80
+ * Returns a `WHERE` clause to retrieve records with a `_ts` of this year
81
+ *
82
+ * NOTE: default time zone is UTC
83
+ */
14
84
  export declare function getCosmosCurrentYearWhereClause(timeZone?: string): string;
15
85
  export declare function cosmosSelect(databaseId: string, collectionId: string, partitionKey: string, query: string): Promise<any[]>;
16
86
  export declare function cosmosInsert(databaseId: string, collectionId: string, partitionKey: string, data: any): Promise<boolean>;
@@ -28,45 +28,115 @@ function getCosmosTimeZoneHourDiff(timeZone) {
28
28
  }
29
29
  return diff;
30
30
  }
31
+ /**
32
+ * Returns the current date time
33
+ *
34
+ * NOTE: default time zone is UTC
35
+ */
31
36
  export function getCosmosCurrentDateTime(timeZone) {
32
37
  return `DateTimeAdd("hh", ${getCosmosTimeZoneHourDiff(timeZone)}, ${COSMOS_CURRENT_DATETIME})`;
33
38
  }
39
+ /**
40
+ * Returns the record's date time using the `_ts` field
41
+ *
42
+ * NOTE: default time zone is UTC
43
+ */
34
44
  export function getCosmosTimestampDateTime(timeZone) {
35
45
  return `DateTimeAdd("hh", ${getCosmosTimeZoneHourDiff(timeZone)}, ${COSMOS_TIMESTAMP_DATETIME})`;
36
46
  }
47
+ /**
48
+ * Returns the current year
49
+ *
50
+ * NOTE: default time zone is UTC
51
+ */
37
52
  export function getCosmosCurrentYear(timeZone) {
38
53
  return `DateTimePart('yyyy', ${getCosmosCurrentDateTime(timeZone)})`;
39
54
  }
55
+ /**
56
+ * Returns the record's year using the `_ts` field
57
+ *
58
+ * NOTE: default time zone is UTC
59
+ */
40
60
  export function getCosmosTimestampYear(timeZone) {
41
61
  return `DateTimePart('yyyy', ${getCosmosTimestampDateTime(timeZone)})`;
42
62
  }
63
+ /**
64
+ * Returns the current month
65
+ *
66
+ * NOTE: default time zone is UTC
67
+ */
43
68
  export function getCosmosCurrentMonth(timeZone) {
44
69
  return `DateTimePart('mm', ${getCosmosCurrentDateTime(timeZone)})`;
45
70
  }
71
+ /**
72
+ * Returns the record's month using the `_ts` field
73
+ *
74
+ * NOTE: default time zone is UTC
75
+ */
46
76
  export function getCosmosTimestampMonth(timeZone) {
47
77
  return `DateTimePart('mm', ${getCosmosTimestampDateTime(timeZone)})`;
48
78
  }
79
+ /**
80
+ * Returns the current day
81
+ *
82
+ * NOTE: default time zone is UTC
83
+ */
49
84
  export function getCosmosCurrentDay(timeZone) {
50
85
  return `DateTimePart('dd', ${getCosmosCurrentDateTime(timeZone)})`;
51
86
  }
87
+ /**
88
+ * Returns the record's day using the `_ts` field
89
+ *
90
+ * NOTE: default time zone is UTC
91
+ */
52
92
  export function getCosmosTimestampDay(timeZone) {
53
93
  return `DateTimePart('dd', ${getCosmosTimestampDateTime(timeZone)})`;
54
94
  }
95
+ /**
96
+ * Returns the record's hour using the `_ts` field
97
+ *
98
+ * NOTE: default time zone is UTC
99
+ */
55
100
  export function getCosmosTimestampHour(timeZone) {
56
101
  return `DateTimePart('hh', ${getCosmosTimestampDateTime(timeZone)})`;
57
102
  }
103
+ /**
104
+ * Returns the record's minute using the `_ts` field
105
+ *
106
+ * NOTE: default time zone is UTC
107
+ */
58
108
  export function getCosmosTimestampMinute(timeZone) {
59
109
  return `DateTimePart('mi', ${getCosmosTimestampDateTime(timeZone)})`;
60
110
  }
111
+ /**
112
+ * Returns the record's second using the `_ts` field
113
+ *
114
+ * NOTE: default time zone is UTC
115
+ */
61
116
  export function getCosmosTimestampSecond(timeZone) {
62
117
  return `DateTimePart('ss', ${getCosmosTimestampDateTime(timeZone)})`;
63
118
  }
119
+ /**
120
+ * Returns a `WHERE` clause to retrieve records with a `_ts` of today
121
+ *
122
+ * NOTE: default time zone is UTC
123
+ */
64
124
  export function getCosmosCurrentDayWhereClause(timeZone) {
65
125
  return `DateTimeDiff('dd', ${getCosmosTimestampDateTime(timeZone)}, ${getCosmosCurrentDateTime(timeZone)}) = 0`;
66
126
  }
127
+ /**
128
+ * Returns a `WHERE` clause to retrieve records with a `_ts` of this month
129
+ *
130
+ * NOTE: default time zone is UTC
131
+ */
67
132
  export function getCosmosCurrentMonthWhereClause(timeZone) {
68
133
  return `DateTimeDiff('mm', ${getCosmosTimestampDateTime(timeZone)}, ${getCosmosCurrentDateTime(timeZone)}) = 0`;
69
134
  }
135
+ /**
136
+ * Returns a `WHERE` clause to retrieve records with a `_ts` of this year
137
+ *
138
+ * NOTE: default time zone is UTC
139
+ */
70
140
  export function getCosmosCurrentYearWhereClause(timeZone) {
71
141
  return `DateTimeDiff('yyyy', ${getCosmosTimestampDateTime(timeZone)}, ${getCosmosCurrentDateTime(timeZone)}) = 0`;
72
142
  }
package/dist/llm/cost.js CHANGED
@@ -1,4 +1,4 @@
1
- // https://openai.com/pricing
1
+ // https://openai.com/api/pricing/
2
2
  export function getLLMCostPerToken(modelName) {
3
3
  let inputCost = 0.0;
4
4
  let outputCost = 0.0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "3.4.34",
3
+ "version": "3.4.35",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",