@datapos/datapos-shared 0.1.878 → 0.3.4

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/LICENSE.md CHANGED
@@ -1,7 +1,21 @@
1
- ISC License (ISC)
1
+ MIT License
2
2
 
3
- Copyright 2013 Jonathan Terrell
3
+ Copyright (c) 2015 DataPos Pty Ltd
4
4
 
5
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
6
11
 
7
- THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,99 +1,13 @@
1
- # Datapos - Shared Library
1
+ # DataPos Shared Library
2
2
 
3
- A TypeScript library of declarations and utilities shared between Datapos applications and plugin components.
3
+ A TypeScript library containing common declarations and utilities used across DataPos repositories.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```
8
- npm install --save-dev @datapos-shared
8
+ npm install -D @datapos/datapos-shared
9
9
  ```
10
10
 
11
- ## Component Configuration Declarations
12
-
13
- The following diagram illustrates the component configuration class hierarchy, showcasing the relationships and inheritance structure between different **Component Configuration** classes.
14
-
15
- ## Component Instance Declarations
16
-
17
- The following diagram illustrates the component class hierarchy, showcasing the relationships and inheritance structure between different **Component** classes.
18
-
19
- ## Connector Configuration Declarations
20
-
21
- The following diagram illustrates the connector class hierarchies, showcasing the relationships and inheritance structure between different **Connector Configuration** classes and detailing referenced enumeration types.
22
-
23
- ## Data Connector Instance Declarations
24
-
25
- The following diagram illustrates the connector class hierarchies, showcasing the relationships and inheritance structure between different **Data Connector** classes and detailing referenced enumeration types.
26
-
27
- ## Node Connector Instance Declarations
28
-
29
- The following diagram illustrates the connector class hierarchies, showcasing the relationships and inheritance structure between different **Node Connector** classes and detailing referenced enumeration types.
30
-
31
- ## Connection Declarations
32
-
33
- The following diagram illustrates the connection class hierarchy, showcasing the relationships and inheritance structure between different **Connection** classes and detailing referenced enumeration types.
34
-
35
- ## Connection Entry Declarations
36
-
37
- The following diagram illustrates the connection entry class hierarchy, showcasing the relationships and inheritance structure between different **Connection Entry** classes and detailing referenced enumeration types.
38
-
39
- ## Context Model Declarations
40
-
41
- ...
42
-
43
- ## Data View Declarations
44
-
45
- ...
46
-
47
- ## Dimension Declarations
48
-
49
- ...
50
-
51
- ## Entity Declarations
52
-
53
- ...
54
-
55
- ## Event Query Declarations
56
-
57
- ...
58
-
59
- ## Usage Kit Declarations
60
-
61
- ...
62
-
63
- ## View Template Declarations
64
-
65
- ...
66
-
67
- ## Other Declarations
68
-
69
- ...
70
-
71
- ## Utilities
72
-
73
- ### Conversion
74
-
75
- - convertODataTypeToDataType
76
-
77
- ### Extraction
78
-
79
- - extractDirectoryPathFromEntryPath
80
- - extractExtensionFromEntryPath
81
- - extractLastFolderNameFromFolderPath
82
-
83
- ### Formatting
84
-
85
- - formatNumberAsDecimalNumber
86
- - formatNumberAsStorageSize
87
- - formatNumberAsWholeNumber
88
-
89
- ### Lookup
90
-
91
- - lookupMimeTypeForFileExtension
92
-
93
- ### Security
94
-
95
- - establishVendorAccessToken
96
-
97
11
  ## Repository Management Commands
98
12
 
99
13
  The following list details the repository management commands implementation by this project. For more details, please refer to the scripts section of the 'package.json' file in this project.
@@ -29,8 +29,8 @@ class u extends i {
29
29
  class f extends i {
30
30
  componentName;
31
31
  info;
32
- constructor(t, n, r, a, s) {
33
- super(t, n, s), this.name = "VueHandledError", this.info = r, this.componentName = a;
32
+ constructor(t, n, r, a, o) {
33
+ super(t, n, o), this.name = "VueHandledError", this.info = r, this.componentName = a;
34
34
  }
35
35
  }
36
36
  class y extends i {
@@ -77,8 +77,8 @@ function F(e) {
77
77
  else if (r instanceof d)
78
78
  a = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
79
79
  else if (r instanceof Error) {
80
- const s = r;
81
- a = { locator: "", message: s.message, name: s.name, stack: s.stack }, r = s.cause;
80
+ const o = r;
81
+ a = { locator: "", message: o.message, name: o.name, stack: o.stack }, r = o.cause;
82
82
  } else r ? (a = { locator: "", message: String(r), name: "Error" }, r = void 0) : (a = { locator: "", message: "Unknown error.", name: "Error" }, r = void 0);
83
83
  /(?:\.{3}|[.!?])$/.test(a.message) || (a.message += "."), n.push(a);
84
84
  }
@@ -133,19 +133,19 @@ const m = "en-US", l = {}, k = (e) => {
133
133
  const t = e.lastIndexOf(".");
134
134
  if (t > -1) return e.substring(t + 1);
135
135
  }
136
- }, o = (e, t = 2, n = t, r = m) => {
136
+ }, s = (e, t = 2, n = t, r = m) => {
137
137
  if (e == null) return "";
138
138
  const a = `${r}decimal${t}.${n}`;
139
- let s = l[a];
140
- return s || (s = new Intl.NumberFormat(r, {
139
+ let o = l[a];
140
+ return o || (o = new Intl.NumberFormat(r, {
141
141
  localeMatcher: "best fit",
142
142
  maximumFractionDigits: t,
143
143
  minimumFractionDigits: n,
144
144
  minimumIntegerDigits: 1,
145
145
  style: "decimal",
146
146
  useGrouping: !0
147
- }), l[a] = s), s.format(e);
148
- }, M = (e) => e == null ? "" : e < 1e3 ? c(e) : e < 1e6 ? `${o(e / 1e3, 2, 0)}K` : e < 1e9 ? `${o(e / 1e6, 2, 0)}M` : e < 1e12 ? `${o(e / 1e9, 2, 0)}B` : `${o(e / 1e12, 2, 0)}T`, R = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${c(e)} bytes` : e < 1048576 ? `${o(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${o(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${o(e / 1073741824, 2, 0)} GB` : `${o(e / 1099511627776, 2, 0)} TB`, O = (e) => e == null ? "" : e < 1e3 ? `${c(e)} ms` : e === 1e3 ? `${c(e)} sec` : e < 6e4 ? `${o(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${o(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${o(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${o(e / 864e5, 2, 0)} days`, c = (e, t = m) => {
147
+ }), l[a] = o), o.format(e);
148
+ }, M = (e) => e == null ? "" : e < 1e3 ? c(e) : e < 1e6 ? `${s(e / 1e3, 2, 0)}K` : e < 1e9 ? `${s(e / 1e6, 2, 0)}M` : e < 1e12 ? `${s(e / 1e9, 2, 0)}B` : `${s(e / 1e12, 2, 0)}T`, R = (e) => e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${c(e)} bytes` : e < 1048576 ? `${s(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${s(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${s(e / 1073741824, 2, 0)} GB` : `${s(e / 1099511627776, 2, 0)} TB`, O = (e) => e == null ? "" : e < 1e3 ? `${c(e)} ms` : e === 1e3 ? `${c(e)} sec` : e < 6e4 ? `${s(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${s(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${s(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${s(e / 864e5, 2, 0)} days`, c = (e, t = m) => {
149
149
  if (e == null) return "";
150
150
  const n = `${t}decimal0.0`;
151
151
  let r = l[n];
@@ -193,7 +193,7 @@ const m = "en-US", l = {}, k = (e) => {
193
193
  const t = [];
194
194
  for (const n of E) t.push({ ...n, label: n.label[e] || n.label.en || n.id });
195
195
  return t;
196
- }, b = [
196
+ }, g = [
197
197
  { id: ":", label: { en: "Colon" } },
198
198
  { id: ",", label: { en: "Comma" } },
199
199
  { id: "!", label: { en: "Exclamation Mark" } },
@@ -207,20 +207,20 @@ const m = "en-US", l = {}, k = (e) => {
207
207
  { id: "|", label: { en: "Vertical Bar" } }
208
208
  ], j = (e = "en") => {
209
209
  const t = [];
210
- for (const n of b) t.push({ ...n, label: n.label[e] || n.label.en || n.id });
210
+ for (const n of g) t.push({ ...n, label: n.label[e] || n.label.en || n.id });
211
211
  return t;
212
- }, g = [
213
- { id: "alpha", color: "#d62728", label: { en: "alpha" } },
214
- { id: "beta", color: "#8c564b", label: { en: "beta" } },
212
+ }, b = [
213
+ { id: "alpha", color: "warning", label: { en: "alpha" } },
214
+ { id: "beta", color: "success", label: { en: "beta" } },
215
215
  { id: "generalAvailability", label: { en: "" } },
216
216
  { id: "notApplicable", label: { en: "not-applicable" } },
217
- { id: "preAlpha", color: "#d62728", label: { en: "pre-alpha" } },
218
- { id: "proposed", color: "#666666", label: { en: "proposed" } },
219
- { id: "releaseCandidate", color: "#ff7f0e", label: { en: "release-candidate" } },
220
- { id: "unavailable", color: "#d62728", label: { en: "unavailable" } },
221
- { id: "underReview", color: "#666666", label: { en: "under-review" } }
217
+ { id: "preAlpha", color: "warning", label: { en: "pre-alpha" } },
218
+ { id: "proposed", color: "neutral", label: { en: "proposed" } },
219
+ { id: "releaseCandidate", label: { en: "release-candidate" } },
220
+ { id: "unavailable", color: "neutral", label: { en: "unavailable" } },
221
+ { id: "underReview", color: "neutral", label: { en: "under-review" } }
222
222
  ], G = (e, t = "en") => {
223
- const n = g.find((r) => r.id === e);
223
+ const n = b.find((r) => r.id === e);
224
224
  return n ? { ...n, label: n.label[t] || n.label.en || e } : { id: e, color: "#d62728", label: e };
225
225
  };
226
226
  export {
@@ -239,7 +239,7 @@ export {
239
239
  k as convertODataTypeIdToUsageTypeId,
240
240
  B as extractExtensionFromPath,
241
241
  A as extractNameFromPath,
242
- o as formatNumberAsDecimalNumber,
242
+ s as formatNumberAsDecimalNumber,
243
243
  O as formatNumberAsDuration,
244
244
  M as formatNumberAsSize,
245
245
  R as formatNumberAsStorageSize,
@@ -1,6 +1,6 @@
1
1
  import { Timestamp } from './timestamp';
2
2
  export interface ComponentConfig {
3
- description?: Record<string, unknown>[];
3
+ description?: Record<string, unknown>;
4
4
  firstCreatedAt?: Timestamp;
5
5
  id: string;
6
6
  label: Record<string, string>;
@@ -12,25 +12,25 @@ export interface ModelConfig extends ComponentConfig {
12
12
  export interface DimensionGroupConfig {
13
13
  id: string;
14
14
  label: Record<string, string>;
15
- description?: Record<string, unknown>[];
15
+ description?: Record<string, unknown>;
16
16
  dimensionRefs: ComponentRef[];
17
17
  }
18
18
  export interface EntityGroupConfig {
19
19
  id: string;
20
20
  label: Record<string, string>;
21
- description?: Record<string, unknown>[];
21
+ description?: Record<string, unknown>;
22
22
  entityRefs: ComponentRef[];
23
23
  }
24
24
  export interface SecondaryMeasureGroupConfig {
25
25
  id: string;
26
26
  label: Record<string, string>;
27
- description?: Record<string, unknown>[];
27
+ description?: Record<string, unknown>;
28
28
  secondaryMeasureRefs: ComponentRef[];
29
29
  }
30
30
  export interface ViewGroupConfig {
31
31
  id: string;
32
32
  label: Record<string, string>;
33
- description?: Record<string, unknown>[];
33
+ description?: Record<string, unknown>;
34
34
  viewRefs: ComponentRef[];
35
35
  }
36
36
  export interface DimensionConfig {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "license": "ISC",
3
+ "license": "MIT",
4
4
  "private": false,
5
- "version": "0.1.878",
5
+ "version": "0.3.4",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"
@@ -16,30 +16,30 @@
16
16
  },
17
17
  "types": "./dist/types/src/index.d.ts",
18
18
  "devDependencies": {
19
- "@datapos/datapos-dev-operations": "^0.2.25",
20
- "@typescript-eslint/eslint-plugin": "^8.32.0",
21
- "@typescript-eslint/parser": "^8.32.0",
19
+ "@datapos/datapos-development": "^0.3.2",
20
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
21
+ "@typescript-eslint/parser": "^8.33.1",
22
22
  "csv-parse": "^5.6.0",
23
- "eslint": "^9.26.0",
23
+ "eslint": "^9.28.0",
24
24
  "eslint-plugin-import": "^2.31.0",
25
25
  "prettier": "^3.5.3",
26
26
  "typescript": "^5.8.3",
27
27
  "vite": "^6.3.5",
28
- "vite-plugin-dts": "^4.5.3"
28
+ "vite-plugin-dts": "^4.5.4"
29
29
  },
30
30
  "scripts": {
31
31
  "audit": "npm audit",
32
32
  "build": "npx vite build",
33
- "bumpVersion": "node -e \"require('@datapos/datapos-dev-operations/scriptHelpers').bumpVersion()\"",
33
+ "bumpVersion": "node -e \"require('@datapos/datapos-development').bumpVersion()\"",
34
34
  "check": "npx npm-check-updates && npm outdated",
35
35
  "document": "npx npm-license-crawler --onlyDirectDependencies --production --relativeLicensePath --json LICENSES.json",
36
36
  "format": "prettier --write *.ts",
37
37
  "lint": "npx eslint **/*.ts",
38
- "publishToNPM": "npm publish",
38
+ "publishToNPM": "npm publish --access public",
39
39
  "release": "npm run syncWithGitHub && npm run build && npm run publishToNPM",
40
- "syncWithGitHub": "npm run bumpVersion && node -e \"require('@datapos/datapos-dev-operations/scriptHelpers').syncWithGitHub()\"",
40
+ "syncWithGitHub": "npm run bumpVersion && node -e \"require('@datapos/datapos-development').syncWithGitHub()\"",
41
41
  "test": "echo \"***** TEST SCRIPT NOT IMPLEMENTED. *****\"",
42
42
  "updateDependencies": "npm run updateOperations",
43
- "updateOperations": "npm install --save-dev @datapos/datapos-dev-operations@latest"
43
+ "updateOperations": "npm install -D @datapos/datapos-development@latest"
44
44
  }
45
45
  }