sodas-sdk 1.4.0 → 1.4.2
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/SODAS_SDK_CLASS/DCAT/dataService.d.ts +1 -0
- package/dist/SODAS_SDK_CLASS/DCAT/datasetSeries.d.ts +1 -0
- package/dist/core/type.d.ts +0 -4
- package/dist/index.browser.js +96 -38
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.legacy.browser.js +94 -36
- package/dist/index.legacy.browser.js.map +1 -1
- package/dist/index.legacy.node.cjs +94 -36
- package/dist/index.legacy.node.cjs.map +1 -1
- package/dist/index.node.js +96 -38
- package/dist/index.node.js.map +1 -1
- package/package.json +1 -1
- /package/dist/__tests__/SODAS_SDK_CLASS/DCAT/datasetSeries/{populateToSync.small.test.d.ts → populateToSync.medium.test.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,26 +2,29 @@ import DataService from "./SODAS_SDK_CLASS/DCAT/dataService";
|
|
|
2
2
|
import Dataset from "./SODAS_SDK_CLASS/DCAT/dataset";
|
|
3
3
|
import DatasetSeries from "./SODAS_SDK_CLASS/DCAT/datasetSeries";
|
|
4
4
|
import Distribution from "./SODAS_SDK_CLASS/DCAT/distribution";
|
|
5
|
+
import ValidationTemplate from "./SODAS_SDK_CLASS/template/validation";
|
|
5
6
|
import Config from "./core/auth";
|
|
6
7
|
import { setGovernanceBearerToken, setLegacyDatahubBearerToken } from "./core/init";
|
|
7
|
-
import { ArtifactType, IDType, IRIType,
|
|
8
|
+
import { ArtifactType, IDType, IRIType, ResourceDescriptorRole, SortOrder, TemplateDetailFunctionality, asID, asIRI } from "./core/type";
|
|
8
9
|
import { BASIC_TYPE_VALUES, CONVERSION_VALUES, MEASURE_VALUES, ORIGIN_VALUES } from "./core/values";
|
|
9
|
-
export { ArtifactType, BASIC_TYPE_VALUES, CONVERSION_VALUES, Config, DataService, Dataset, DatasetSeries, Distribution, IDType, IRIType, MEASURE_VALUES, ORIGIN_VALUES,
|
|
10
|
+
export { ArtifactType, BASIC_TYPE_VALUES, CONVERSION_VALUES, Config, DataService, Dataset, DatasetSeries, Distribution, IDType, IRIType, MEASURE_VALUES, ORIGIN_VALUES, ResourceDescriptorRole, SortOrder, TemplateDetailFunctionality, ValidationTemplate, asID, asIRI, setGovernanceBearerToken, setLegacyDatahubBearerToken, };
|
|
10
11
|
declare const sdk: {
|
|
11
12
|
ArtifactType: typeof ArtifactType;
|
|
12
13
|
BASIC_TYPE_VALUES: typeof BASIC_TYPE_VALUES;
|
|
13
14
|
CONVERSION_VALUES: typeof CONVERSION_VALUES;
|
|
15
|
+
Config: typeof Config;
|
|
14
16
|
DataService: typeof DataService;
|
|
15
17
|
Dataset: typeof Dataset;
|
|
16
18
|
DatasetSeries: typeof DatasetSeries;
|
|
17
19
|
Distribution: typeof Distribution;
|
|
18
20
|
MEASURE_VALUES: typeof MEASURE_VALUES;
|
|
19
21
|
ORIGIN_VALUES: typeof ORIGIN_VALUES;
|
|
20
|
-
ProfileType: typeof ProfileType;
|
|
21
22
|
ResourceDescriptorRole: typeof ResourceDescriptorRole;
|
|
22
23
|
SortOrder: typeof SortOrder;
|
|
23
24
|
TemplateDetailFunctionality: typeof TemplateDetailFunctionality;
|
|
24
|
-
|
|
25
|
+
ValidationTemplate: typeof ValidationTemplate;
|
|
26
|
+
asID: typeof asID;
|
|
27
|
+
asIRI: typeof asIRI;
|
|
25
28
|
setGovernanceBearerToken: typeof setGovernanceBearerToken;
|
|
26
29
|
setLegacyDatahubBearerToken: typeof setLegacyDatahubBearerToken;
|
|
27
30
|
};
|
|
@@ -1859,6 +1859,36 @@ class DataService extends _dcatResource__WEBPACK_IMPORTED_MODULE_4__["default"]
|
|
|
1859
1859
|
throw new _core_error__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseFormatError(response);
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
|
+
static searchDBRecords(searchKeyword_1) {
|
|
1863
|
+
return __awaiter(this, arguments, void 0, function* (searchKeyword, pageNumber = 1, pageSize = 10, sortOrder = _core_type__WEBPACK_IMPORTED_MODULE_1__.SortOrder.DESC) {
|
|
1864
|
+
if (!searchKeyword || !searchKeyword.trim()) {
|
|
1865
|
+
return this.listDBRecords(pageNumber, pageSize, sortOrder);
|
|
1866
|
+
}
|
|
1867
|
+
// @ts-ignore - static helper expects SODAS_SDK_CLASS constructor type
|
|
1868
|
+
(0,_sodasSDKClass__WEBPACK_IMPORTED_MODULE_3__.throwErrorIfAPIURLNotSetForStatic)(this);
|
|
1869
|
+
let response;
|
|
1870
|
+
try {
|
|
1871
|
+
response = yield axios__WEBPACK_IMPORTED_MODULE_5__["default"].get(this.prototype.constructor.LIST_URL, {
|
|
1872
|
+
params: { pageNumber, pageSize, sortOrder, search: searchKeyword },
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
catch (error) {
|
|
1876
|
+
(0,_core_util__WEBPACK_IMPORTED_MODULE_2__.handleAxiosError)(error);
|
|
1877
|
+
}
|
|
1878
|
+
if (response.data.total != null && Array.isArray(response.data.list)) {
|
|
1879
|
+
const list = yield Promise.all(response.data.list.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
1880
|
+
const dataService = new this();
|
|
1881
|
+
yield dataService.populateFromDTO(item);
|
|
1882
|
+
return dataService;
|
|
1883
|
+
})));
|
|
1884
|
+
return {
|
|
1885
|
+
total: response.data.total,
|
|
1886
|
+
list,
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
throw new _core_error__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseFormatError(response);
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1862
1892
|
toDTO() {
|
|
1863
1893
|
return Object.assign(Object.assign(Object.assign({}, super.toDTO()), (this.DataServiceID && { DataServiceID: this.DataServiceID })), { EndpointURL: this.EndpointURL, EndpointDescription: this.EndpointDescription });
|
|
1864
1894
|
}
|
|
@@ -2512,6 +2542,36 @@ class DatasetSeries extends _dcatResource__WEBPACK_IMPORTED_MODULE_5__["default"
|
|
|
2512
2542
|
throw new _core_error__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseFormatError(response);
|
|
2513
2543
|
});
|
|
2514
2544
|
}
|
|
2545
|
+
static searchDBRecords(searchKeyword_1) {
|
|
2546
|
+
return __awaiter(this, arguments, void 0, function* (searchKeyword, pageNumber = 1, pageSize = 10, sortOrder = _core_type__WEBPACK_IMPORTED_MODULE_1__.SortOrder.DESC) {
|
|
2547
|
+
if (!searchKeyword || !searchKeyword.trim()) {
|
|
2548
|
+
return this.listDBRecords(pageNumber, pageSize, sortOrder);
|
|
2549
|
+
}
|
|
2550
|
+
// @ts-ignore - static helper expects SODAS_SDK_CLASS constructor type
|
|
2551
|
+
(0,_sodasSDKClass__WEBPACK_IMPORTED_MODULE_3__.throwErrorIfAPIURLNotSetForStatic)(this);
|
|
2552
|
+
let response;
|
|
2553
|
+
try {
|
|
2554
|
+
response = yield axios__WEBPACK_IMPORTED_MODULE_6__["default"].get(this.prototype.constructor.LIST_URL, {
|
|
2555
|
+
params: { pageNumber, pageSize, sortOrder, search: searchKeyword },
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
catch (error) {
|
|
2559
|
+
(0,_core_util__WEBPACK_IMPORTED_MODULE_2__.handleAxiosError)(error);
|
|
2560
|
+
}
|
|
2561
|
+
if (response.data.total != null && Array.isArray(response.data.list)) {
|
|
2562
|
+
const list = yield Promise.all(response.data.list.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
2563
|
+
const datasetSeries = new this();
|
|
2564
|
+
yield datasetSeries.populateFromDTO(item);
|
|
2565
|
+
return datasetSeries;
|
|
2566
|
+
})));
|
|
2567
|
+
return {
|
|
2568
|
+
total: response.data.total,
|
|
2569
|
+
list,
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
throw new _core_error__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseFormatError(response);
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2515
2575
|
toDTO() {
|
|
2516
2576
|
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, super.toDTO()), (this.DatasetSeriesID && { DatasetSeriesID: this.DatasetSeriesID })), (this.InSeriesID && { InSeriesID: this.InSeriesID })), { Frequency: this.Frequency, SpatialResolutionInMeters: this.SpatialResolutionInMeters, TemporalResolution: this.TemporalResolution, Spatial: this.Spatial, Temporal: this.Temporal, WasGeneratedBy: this.WasGeneratedBy }), (this.SeriesMemberIDs && { SeriesMemberIDs: this.SeriesMemberIDs }));
|
|
2517
2577
|
return result;
|
|
@@ -5329,7 +5389,6 @@ function setLegacyDatahubBearerToken(token) {
|
|
|
5329
5389
|
__webpack_require__.r(__webpack_exports__);
|
|
5330
5390
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5331
5391
|
/* harmony export */ ArtifactType: () => (/* binding */ ArtifactType),
|
|
5332
|
-
/* harmony export */ ProfileType: () => (/* binding */ ProfileType),
|
|
5333
5392
|
/* harmony export */ ResourceDescriptorRole: () => (/* binding */ ResourceDescriptorRole),
|
|
5334
5393
|
/* harmony export */ SortOrder: () => (/* binding */ SortOrder),
|
|
5335
5394
|
/* harmony export */ TemplateDetailFunctionality: () => (/* binding */ TemplateDetailFunctionality),
|
|
@@ -5399,11 +5458,6 @@ var ResourceDescriptorRole;
|
|
|
5399
5458
|
ResourceDescriptorRole["SPECIFICATION"] = "specification";
|
|
5400
5459
|
ResourceDescriptorRole["GUIDANCE"] = "guidance";
|
|
5401
5460
|
})(ResourceDescriptorRole || (ResourceDescriptorRole = {}));
|
|
5402
|
-
var ProfileType;
|
|
5403
|
-
(function (ProfileType) {
|
|
5404
|
-
ProfileType["DCAT"] = "dcat";
|
|
5405
|
-
ProfileType["DATA"] = "data";
|
|
5406
|
-
})(ProfileType || (ProfileType = {}));
|
|
5407
5461
|
var ArtifactType;
|
|
5408
5462
|
(function (ArtifactType) {
|
|
5409
5463
|
ArtifactType["TEMPLATE"] = "template";
|
|
@@ -10565,34 +10619,35 @@ var __webpack_exports__ = {};
|
|
|
10565
10619
|
\**********************/
|
|
10566
10620
|
__webpack_require__.r(__webpack_exports__);
|
|
10567
10621
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10568
|
-
/* harmony export */ ArtifactType: () => (/* reexport safe */
|
|
10569
|
-
/* harmony export */ BASIC_TYPE_VALUES: () => (/* reexport safe */
|
|
10570
|
-
/* harmony export */ CONVERSION_VALUES: () => (/* reexport safe */
|
|
10571
|
-
/* harmony export */ Config: () => (/* reexport safe */
|
|
10622
|
+
/* harmony export */ ArtifactType: () => (/* reexport safe */ _core_type__WEBPACK_IMPORTED_MODULE_7__.ArtifactType),
|
|
10623
|
+
/* harmony export */ BASIC_TYPE_VALUES: () => (/* reexport safe */ _core_values__WEBPACK_IMPORTED_MODULE_8__.BASIC_TYPE_VALUES),
|
|
10624
|
+
/* harmony export */ CONVERSION_VALUES: () => (/* reexport safe */ _core_values__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_VALUES),
|
|
10625
|
+
/* harmony export */ Config: () => (/* reexport safe */ _core_auth__WEBPACK_IMPORTED_MODULE_5__["default"]),
|
|
10572
10626
|
/* harmony export */ DataService: () => (/* reexport safe */ _SODAS_SDK_CLASS_DCAT_dataService__WEBPACK_IMPORTED_MODULE_0__["default"]),
|
|
10573
10627
|
/* harmony export */ Dataset: () => (/* reexport safe */ _SODAS_SDK_CLASS_DCAT_dataset__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
10574
10628
|
/* harmony export */ DatasetSeries: () => (/* reexport safe */ _SODAS_SDK_CLASS_DCAT_datasetSeries__WEBPACK_IMPORTED_MODULE_2__["default"]),
|
|
10575
10629
|
/* harmony export */ Distribution: () => (/* reexport safe */ _SODAS_SDK_CLASS_DCAT_distribution__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
10576
|
-
/* harmony export */ MEASURE_VALUES: () => (/* reexport safe */
|
|
10577
|
-
/* harmony export */ ORIGIN_VALUES: () => (/* reexport safe */
|
|
10578
|
-
/* harmony export */
|
|
10579
|
-
/* harmony export */
|
|
10580
|
-
/* harmony export */
|
|
10581
|
-
/* harmony export */
|
|
10582
|
-
/* harmony export */ asID: () => (/* reexport safe */
|
|
10583
|
-
/* harmony export */ asIRI: () => (/* reexport safe */
|
|
10630
|
+
/* harmony export */ MEASURE_VALUES: () => (/* reexport safe */ _core_values__WEBPACK_IMPORTED_MODULE_8__.MEASURE_VALUES),
|
|
10631
|
+
/* harmony export */ ORIGIN_VALUES: () => (/* reexport safe */ _core_values__WEBPACK_IMPORTED_MODULE_8__.ORIGIN_VALUES),
|
|
10632
|
+
/* harmony export */ ResourceDescriptorRole: () => (/* reexport safe */ _core_type__WEBPACK_IMPORTED_MODULE_7__.ResourceDescriptorRole),
|
|
10633
|
+
/* harmony export */ SortOrder: () => (/* reexport safe */ _core_type__WEBPACK_IMPORTED_MODULE_7__.SortOrder),
|
|
10634
|
+
/* harmony export */ TemplateDetailFunctionality: () => (/* reexport safe */ _core_type__WEBPACK_IMPORTED_MODULE_7__.TemplateDetailFunctionality),
|
|
10635
|
+
/* harmony export */ ValidationTemplate: () => (/* reexport safe */ _SODAS_SDK_CLASS_template_validation__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
10636
|
+
/* harmony export */ asID: () => (/* reexport safe */ _core_type__WEBPACK_IMPORTED_MODULE_7__.asID),
|
|
10637
|
+
/* harmony export */ asIRI: () => (/* reexport safe */ _core_type__WEBPACK_IMPORTED_MODULE_7__.asIRI),
|
|
10584
10638
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
10585
|
-
/* harmony export */ setGovernanceBearerToken: () => (/* reexport safe */
|
|
10586
|
-
/* harmony export */ setLegacyDatahubBearerToken: () => (/* reexport safe */
|
|
10639
|
+
/* harmony export */ setGovernanceBearerToken: () => (/* reexport safe */ _core_init__WEBPACK_IMPORTED_MODULE_6__.setGovernanceBearerToken),
|
|
10640
|
+
/* harmony export */ setLegacyDatahubBearerToken: () => (/* reexport safe */ _core_init__WEBPACK_IMPORTED_MODULE_6__.setLegacyDatahubBearerToken)
|
|
10587
10641
|
/* harmony export */ });
|
|
10588
10642
|
/* harmony import */ var _SODAS_SDK_CLASS_DCAT_dataService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SODAS_SDK_CLASS/DCAT/dataService */ "./lib/SODAS_SDK_CLASS/DCAT/dataService.ts");
|
|
10589
10643
|
/* harmony import */ var _SODAS_SDK_CLASS_DCAT_dataset__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SODAS_SDK_CLASS/DCAT/dataset */ "./lib/SODAS_SDK_CLASS/DCAT/dataset.ts");
|
|
10590
10644
|
/* harmony import */ var _SODAS_SDK_CLASS_DCAT_datasetSeries__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SODAS_SDK_CLASS/DCAT/datasetSeries */ "./lib/SODAS_SDK_CLASS/DCAT/datasetSeries.ts");
|
|
10591
10645
|
/* harmony import */ var _SODAS_SDK_CLASS_DCAT_distribution__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SODAS_SDK_CLASS/DCAT/distribution */ "./lib/SODAS_SDK_CLASS/DCAT/distribution.ts");
|
|
10592
|
-
/* harmony import */ var
|
|
10593
|
-
/* harmony import */ var
|
|
10594
|
-
/* harmony import */ var
|
|
10595
|
-
/* harmony import */ var
|
|
10646
|
+
/* harmony import */ var _SODAS_SDK_CLASS_template_validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SODAS_SDK_CLASS/template/validation */ "./lib/SODAS_SDK_CLASS/template/validation.ts");
|
|
10647
|
+
/* harmony import */ var _core_auth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./core/auth */ "./lib/core/auth.ts");
|
|
10648
|
+
/* harmony import */ var _core_init__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./core/init */ "./lib/core/init.ts");
|
|
10649
|
+
/* harmony import */ var _core_type__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./core/type */ "./lib/core/type.ts");
|
|
10650
|
+
/* harmony import */ var _core_values__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./core/values */ "./lib/core/values.ts");
|
|
10596
10651
|
// Import named functions first
|
|
10597
10652
|
|
|
10598
10653
|
|
|
@@ -10602,26 +10657,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10602
10657
|
|
|
10603
10658
|
|
|
10604
10659
|
|
|
10660
|
+
|
|
10605
10661
|
// ✅ Named exports (For ES module compatibility)
|
|
10606
10662
|
|
|
10607
10663
|
// ✅ Default export (For CommonJS compatibility)
|
|
10608
10664
|
const sdk = {
|
|
10609
|
-
ArtifactType:
|
|
10610
|
-
BASIC_TYPE_VALUES:
|
|
10611
|
-
CONVERSION_VALUES:
|
|
10665
|
+
ArtifactType: _core_type__WEBPACK_IMPORTED_MODULE_7__.ArtifactType,
|
|
10666
|
+
BASIC_TYPE_VALUES: _core_values__WEBPACK_IMPORTED_MODULE_8__.BASIC_TYPE_VALUES,
|
|
10667
|
+
CONVERSION_VALUES: _core_values__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_VALUES,
|
|
10668
|
+
Config: _core_auth__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
10612
10669
|
DataService: _SODAS_SDK_CLASS_DCAT_dataService__WEBPACK_IMPORTED_MODULE_0__["default"],
|
|
10613
10670
|
Dataset: _SODAS_SDK_CLASS_DCAT_dataset__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
10614
10671
|
DatasetSeries: _SODAS_SDK_CLASS_DCAT_datasetSeries__WEBPACK_IMPORTED_MODULE_2__["default"],
|
|
10615
10672
|
Distribution: _SODAS_SDK_CLASS_DCAT_distribution__WEBPACK_IMPORTED_MODULE_3__["default"],
|
|
10616
|
-
MEASURE_VALUES:
|
|
10617
|
-
ORIGIN_VALUES:
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10673
|
+
MEASURE_VALUES: _core_values__WEBPACK_IMPORTED_MODULE_8__.MEASURE_VALUES,
|
|
10674
|
+
ORIGIN_VALUES: _core_values__WEBPACK_IMPORTED_MODULE_8__.ORIGIN_VALUES,
|
|
10675
|
+
ResourceDescriptorRole: _core_type__WEBPACK_IMPORTED_MODULE_7__.ResourceDescriptorRole,
|
|
10676
|
+
SortOrder: _core_type__WEBPACK_IMPORTED_MODULE_7__.SortOrder,
|
|
10677
|
+
TemplateDetailFunctionality: _core_type__WEBPACK_IMPORTED_MODULE_7__.TemplateDetailFunctionality,
|
|
10678
|
+
ValidationTemplate: _SODAS_SDK_CLASS_template_validation__WEBPACK_IMPORTED_MODULE_4__["default"],
|
|
10679
|
+
asID: _core_type__WEBPACK_IMPORTED_MODULE_7__.asID,
|
|
10680
|
+
asIRI: _core_type__WEBPACK_IMPORTED_MODULE_7__.asIRI,
|
|
10681
|
+
setGovernanceBearerToken: _core_init__WEBPACK_IMPORTED_MODULE_6__.setGovernanceBearerToken,
|
|
10682
|
+
setLegacyDatahubBearerToken: _core_init__WEBPACK_IMPORTED_MODULE_6__.setLegacyDatahubBearerToken,
|
|
10625
10683
|
};
|
|
10626
10684
|
// ✅ Ensures `require("sodas-sdk")` works in CommonJS
|
|
10627
10685
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sdk);
|