sodas-sdk 1.1.1 → 1.1.12

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.
@@ -46,6 +46,8 @@ declare class Dataset extends DCAT_RESOURCE {
46
46
  toDTO(): DatasetDTO;
47
47
  populateFromDTO(dto: DCAT_MODEL_DTO): Promise<void>;
48
48
  populateDistributionFromDTO(dto: DatasetDTO): Promise<void>;
49
+ static syncToCurrentHub(dataset: Dataset): Promise<void>;
50
+ populateToSync(source: Dataset): void;
49
51
  createDBRecord(): Promise<void>;
50
52
  private deleteNotMaintainedDistributions;
51
53
  updateDBRecord(): Promise<void>;
@@ -27,6 +27,19 @@ declare class DatasetSeries extends DCAT_RESOURCE {
27
27
  private WasGeneratedBy;
28
28
  private SeriesMembers;
29
29
  private SeriesMemberIDs;
30
+ static syncToCurrentHub(datasetSeries: DatasetSeries): Promise<void>;
31
+ /**
32
+ * Populates this instance with values from the given DatasetSeries, except for:
33
+ * - DB identity / temporal fields (ID, IRI, Issued, Modified, CreatedAt, UpdatedAt)
34
+ * - Version/lineage fields (IsVersionOf, PreviousVersionID, NextVersionID, VersionInfos)
35
+ * - Series identity fields (DatasetSeriesID, InSeriesID)
36
+ * - Fields explicitly set to `undefined` on the source instance
37
+ *
38
+ * Additionally, when SeriesMembers are present on the source, this method
39
+ * resolves each member via Dataset.getDBRecordByAssetID (by AssetID) and
40
+ * replaces this.SeriesMemberIDs with the resolved IDs.
41
+ */
42
+ populateToSync(source: DatasetSeries): Promise<void>;
30
43
  /**
31
44
  * Initializes or updates the API_URL and LIST_URL for Dataset.
32
45
  *
@@ -38,10 +51,17 @@ declare class DatasetSeries extends DCAT_RESOURCE {
38
51
  populateFromDTO(dto: DCAT_MODEL_DTO): Promise<void>;
39
52
  populateSeriesMembersFromDTO(dto: DatasetSeriesDTO): Promise<void>;
40
53
  deleteDBRecord(): Promise<void>;
54
+ /**
55
+ * Creates a dataset series DB record in an interoperated context
56
+ * (e.g. together with related Dataset instances or other resources).
57
+ *
58
+ * The implementation will be added later.
59
+ */
60
+ createInteroperatedDBRecord(): Promise<void>;
41
61
  appendSeriesMember(dataset: Dataset): void;
42
62
  switchSeriesMembers(index1: number, index2: number): void;
43
63
  get datasetSeriesID(): IDType;
44
- get seriesMembereIDs(): IDType[];
64
+ get seriesMemberIDs(): IDType[];
45
65
  get seriesMembers(): Dataset[];
46
66
  get frequency(): string;
47
67
  set frequency(value: string);
@@ -44,6 +44,12 @@ declare class Distribution extends DCAT_MODEL {
44
44
  private TitleML;
45
45
  private HasPolicy;
46
46
  private Checksum;
47
+ /**
48
+ * Populates this instance with values from the given Distribution, except for:
49
+ * - DB identity / temporal fields (ID, IRI, Issued, Modified, CreatedAt, UpdatedAt)
50
+ * - Fields that are explicitly set to `undefined` on the source instance
51
+ */
52
+ populateToSync(source: Distribution): void;
47
53
  toDTO(): DistributionDTO;
48
54
  populateFromDTO(dto: DCAT_MODEL_DTO): Promise<void>;
49
55
  /**
@@ -23,6 +23,13 @@ declare abstract class DCAT_MODEL extends SODAS_SDK_CLASS {
23
23
  createDBRecord(): Promise<void>;
24
24
  static getDBRecord<GENERIC_DCAT_MODEL extends DCAT_MODEL>(this: DCAT_MODEL_STATIC<GENERIC_DCAT_MODEL>, ID: IDType): Promise<GENERIC_DCAT_MODEL>;
25
25
  static getDBRecordByAssetID<GENERIC_DCAT_MODEL extends DCAT_MODEL>(this: DCAT_MODEL_STATIC<GENERIC_DCAT_MODEL>, assetID: IDType): Promise<GENERIC_DCAT_MODEL>;
26
+ /**
27
+ * Checks whether a DB record exists for the given AssetID and returns its ID.
28
+ *
29
+ * This method wraps getDBRecordByAssetID and converts a 404 response to `null`,
30
+ * while rethrowing any other kind of error.
31
+ */
32
+ static checkDBRecordOfAssetID(assetID: IDType): Promise<IDType | null>;
26
33
  updateDBRecord(): Promise<void>;
27
34
  deleteDBRecord(): Promise<void>;
28
35
  get createdAt(): Date;
@@ -1,5 +1,4 @@
1
- export declare const TEST_DATAHUB_API_URL: string;
1
+ export declare const TEST_SODAS_PROFILE_API_URL: string;
2
2
  export declare const TEST_GOVERNANCE_API_URL: string;
3
- export declare const TEST_SODAS_SDK_API_URL: string;
4
- export declare function getAccessToken(): Promise<string>;
3
+ export declare const TEST_LEGACY_DATAHUB_API_URL: string;
5
4
  export declare function setBearerTokenForTest(): Promise<void>;
@@ -1,15 +1,16 @@
1
1
  declare class Config {
2
2
  private static instance;
3
3
  private governanceToken;
4
- private datahubToken;
4
+ private legacyDatahubToken;
5
5
  private governanceBaseUrl;
6
- private datahubBaseUrl;
6
+ private sodasProfileBaseUrl;
7
+ private legacyDatahubBaseUrl;
7
8
  private constructor();
8
9
  /**
9
10
  * Explicitly configure the SDK with the given API URLs.
10
11
  * This is the preferred way to set API URLs instead of using configureAPIURL.
11
12
  */
12
- static configure(datahubApiUrl: string, governanceApiUrl: string): Config;
13
+ static configure(datahubApiUrl: string, governanceApiUrl: string, legacyDatahubApiUrl: string): Config;
13
14
  /**
14
15
  * Get the singleton instance of Config, using environment variables.
15
16
  */
@@ -25,7 +26,7 @@ declare class Config {
25
26
  /**
26
27
  * Login to the Datahub portal and store the access token.
27
28
  */
28
- loginDatahub(id: string, password: string): Promise<void>;
29
+ loginLegacyDatahub(id: string, password: string): Promise<void>;
29
30
  /**
30
31
  * Logout from the Governance portal and clear the stored token.
31
32
  */
@@ -33,7 +34,7 @@ declare class Config {
33
34
  /**
34
35
  * Logout from the Datahub portal and clear the stored token.
35
36
  */
36
- logoutDatahub(): Promise<void>;
37
+ logoutLegacyDatahub(): Promise<void>;
37
38
  /**
38
39
  * Get the current Governance access token.
39
40
  */
@@ -41,6 +42,6 @@ declare class Config {
41
42
  /**
42
43
  * Get the current Datahub access token.
43
44
  */
44
- getDatahubToken(): string | null;
45
+ getLegacyDatahubToken(): string | null;
45
46
  }
46
47
  export default Config;
@@ -4,4 +4,5 @@
4
4
  * @param {string} token - The Bearer token used for API authentication.
5
5
  * @returns {void}
6
6
  */
7
- export declare function setBearerToken(token: string): void;
7
+ export declare function setGovernanceBearerToken(token: string): void;
8
+ export declare function setLegacyDatahubBearerToken(token: string): void;