@datapos/datapos-shared 0.3.302 → 0.3.304

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.
@@ -97,7 +97,8 @@ function k(e) {
97
97
  }
98
98
  return t;
99
99
  }
100
- const f = "en-US", c = {}, B = (e) => {
100
+ const f = "en-US", c = {};
101
+ function B(e) {
101
102
  switch (e) {
102
103
  case "Edm.Binary":
103
104
  return "unknown";
@@ -136,17 +137,20 @@ const f = "en-US", c = {}, B = (e) => {
136
137
  default:
137
138
  return "unknown";
138
139
  }
139
- }, M = (e) => {
140
+ }
141
+ function M(e) {
140
142
  if (e) {
141
143
  const n = e.lastIndexOf("/"), t = e.lastIndexOf(".", n > -1 ? n : e.length);
142
144
  return t > -1 ? e.substring(0, t) : e;
143
145
  }
144
- }, j = (e) => {
146
+ }
147
+ function j(e) {
145
148
  if (e) {
146
149
  const n = e.lastIndexOf(".");
147
150
  if (n > -1) return e.substring(n + 1);
148
151
  }
149
- }, a = (e, n = 2, t = n, r = f) => {
152
+ }
153
+ function a(e, n = 2, t = n, r = f) {
150
154
  if (e == null) return "";
151
155
  const o = `${r}decimal${n}.${t}`;
152
156
  let s = c[o];
@@ -158,7 +162,17 @@ const f = "en-US", c = {}, B = (e) => {
158
162
  style: "decimal",
159
163
  useGrouping: !0
160
164
  }), c[o] = s), s.format(e);
161
- }, U = (e) => e == null ? "" : e < 1e3 ? d(e) : e < 1e6 ? `${a(e / 1e3, 2, 0)}K` : e < 1e9 ? `${a(e / 1e6, 2, 0)}M` : e < 1e12 ? `${a(e / 1e9, 2, 0)}B` : `${a(e / 1e12, 2, 0)}T`, L = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${d(e)} bytes` : e < 1048576 ? `${a(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${a(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${a(e / 1073741824, 2, 0)} GB` : `${a(e / 1099511627776, 2, 0)} TB`, _ = (e) => e == null ? "" : e < 1e3 ? `${d(e)} ms` : e === 1e3 ? `${d(e)} sec` : e < 6e4 ? `${a(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${a(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${a(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${a(e / 864e5, 2, 0)} days`, d = (e, n = f) => {
165
+ }
166
+ function U(e) {
167
+ return e == null ? "" : e < 1e3 ? d(e) : e < 1e6 ? `${a(e / 1e3, 2, 0)}K` : e < 1e9 ? `${a(e / 1e6, 2, 0)}M` : e < 1e12 ? `${a(e / 1e9, 2, 0)}B` : `${a(e / 1e12, 2, 0)}T`;
168
+ }
169
+ function L(e) {
170
+ return e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${d(e)} bytes` : e < 1048576 ? `${a(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${a(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${a(e / 1073741824, 2, 0)} GB` : `${a(e / 1099511627776, 2, 0)} TB`;
171
+ }
172
+ function _(e) {
173
+ return e == null ? "" : e < 1e3 ? `${d(e)} ms` : e === 1e3 ? `${d(e)} sec` : e < 6e4 ? `${a(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${a(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${a(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${a(e / 864e5, 2, 0)} days`;
174
+ }
175
+ function d(e, n = f) {
162
176
  if (e == null) return "";
163
177
  const t = `${n}decimal0.0`;
164
178
  let r = c[t];
@@ -170,7 +184,8 @@ const f = "en-US", c = {}, B = (e) => {
170
184
  style: "decimal",
171
185
  useGrouping: !0
172
186
  }), c[t] = r), r.format(e);
173
- }, W = (e) => {
187
+ }
188
+ function W(e) {
174
189
  switch (e) {
175
190
  case "csv":
176
191
  return "text/csv";
@@ -184,7 +199,8 @@ const f = "en-US", c = {}, B = (e) => {
184
199
  default:
185
200
  return "application/octet-stream";
186
201
  }
187
- }, b = [
202
+ }
203
+ const b = [
188
204
  { id: "dtv", label: { "en-gb": "Delimited Text" } },
189
205
  { id: "e/e", label: { "en-gb": "Entity/Event" } },
190
206
  { id: "jsonArray", label: { "en-gb": "JSON Array" } },
@@ -31,7 +31,7 @@ export interface Connector extends Component {
31
31
  upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
32
32
  }
33
33
  export interface ConnectorConfig extends ModuleConfig {
34
- category?: ConnectorCategory;
34
+ category: ConnectorCategory | null;
35
35
  categoryId: ConnectorModuleCategoryId;
36
36
  implementations: Record<string, ConnectorImplementation>;
37
37
  operations: ConnectorOperation[];
@@ -1,4 +1,3 @@
1
- import { Timestamp } from '../timestamp';
2
1
  import { LocaleCode, LocalisedString, StatusColorId } from '../index';
3
2
  export interface Component {
4
3
  readonly config: ComponentConfig;
@@ -7,11 +6,11 @@ export interface ComponentConfig {
7
6
  id: string;
8
7
  label: Partial<LocalisedString>;
9
8
  description: Partial<LocalisedString>;
10
- firstCreatedAt?: Timestamp;
11
- icon?: string;
12
- iconDark?: string;
13
- lastUpdatedAt?: Timestamp;
14
- status?: ComponentStatus;
9
+ firstCreatedAt?: number;
10
+ icon: string | null;
11
+ iconDark: string | null;
12
+ lastUpdatedAt: number | null;
13
+ status: ComponentStatus | null;
15
14
  statusId: ComponentStatusId;
16
15
  typeId: ComponentTypeId;
17
16
  }
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Application utilities.
3
3
  */
4
- export declare const convertODataTypeIdToUsageTypeId: (oDataTypeId: string) => string;
5
- export declare const extractNameFromPath: (itemPath: string) => string | undefined;
6
- export declare const extractExtensionFromPath: (itemPath: string) => string | undefined;
7
- export declare const formatNumberAsDecimalNumber: (number?: number, decimalPlaces?: number, minimumFractionDigits?: number, locale?: string) => string;
8
- export declare const formatNumberAsSize: (number?: number) => string;
9
- export declare const formatNumberAsStorageSize: (number?: number) => string;
10
- export declare const formatNumberAsDuration: (number?: number) => string;
11
- export declare const formatNumberAsWholeNumber: (number?: number, locale?: string) => string;
12
- export declare const lookupMimeTypeForExtension: (extension: string) => string;
4
+ export declare function convertODataTypeIdToUsageTypeId(oDataTypeId: string): string;
5
+ export declare function extractNameFromPath(itemPath: string): string | undefined;
6
+ export declare function extractExtensionFromPath(itemPath: string): string | undefined;
7
+ export declare function formatNumberAsDecimalNumber(number?: number, decimalPlaces?: number, minimumFractionDigits?: number, locale?: string): string;
8
+ export declare function formatNumberAsSize(number?: number): string;
9
+ export declare function formatNumberAsStorageSize(number?: number): string;
10
+ export declare function formatNumberAsDuration(number?: number): string;
11
+ export declare function formatNumberAsWholeNumber(number?: number, locale?: string): string;
12
+ export declare function lookupMimeTypeForExtension(extension?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.302",
3
+ "version": "0.3.304",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",