Skip to content

Commit 858c1d7

Browse files
committed
Remove deprecated items.
This CR removes all deprecated items with the deprecated time more than 6 months. Resolves: OLPEDGE-2351 Signed-off-by: Oleksii Zubko <[email protected]>
1 parent 77929cc commit 858c1d7

32 files changed

+305
-1292
lines changed

@here/olp-sdk-dataservice-api/lib/lookup-api.ts

-51
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,6 @@ export async function platformAPI(
101101
return builder.request<API[]>(urlBuilder, options);
102102
}
103103

104-
/**
105-
* @deprecated This method is deprecated and is not used. Please used getPlatformAPIList()
106-
* Return the list of the HERE APIs. This response is valid for the time specified by 'Cache-Control' header.
107-
*
108-
* @summary Return the list of the HERE APIs.
109-
*/
110-
export async function platformAPIList(
111-
builder: RequestBuilder
112-
): Promise<API[] | ApiNotFoundError> {
113-
const baseUrl = "/platform/apis";
114-
115-
const urlBuilder = new UrlBuilder(builder.baseUrl + baseUrl);
116-
117-
const headers: { [header: string]: string } = {};
118-
const options: RequestOptions = {
119-
method: "GET",
120-
headers
121-
};
122-
123-
return builder.request<API[]>(urlBuilder, options);
124-
}
125-
126104
/**
127105
* Return the list of the HERE APIs. This response is valid for the time specified by 'Cache-Control' header.
128106
*
@@ -179,35 +157,6 @@ export async function resourceAPI(
179157
return builder.request<API[]>(urlBuilder, options);
180158
}
181159

182-
/**
183-
* @deprecated This method is deprecated and is not used. Please used getResourceAPIList()
184-
* Return the list of APIs for a given resource identified by hrn. This response is valid for the time specified by 'Cache-Control' header.
185-
*
186-
* @summary Return the list of APIs for a given resource.
187-
* @param hrn The HRN identifying the resource
188-
* @param region If you want to look up a specific region for a given resource.
189-
*/
190-
export async function resourceAPIList(
191-
builder: RequestBuilder,
192-
params: { hrn: string; region?: string }
193-
): Promise<API[] | ApiNotFoundError> {
194-
const baseUrl = "/resources/{hrn}/apis".replace(
195-
"{hrn}",
196-
UrlBuilder.toString(params["hrn"])
197-
);
198-
199-
const urlBuilder = new UrlBuilder(builder.baseUrl + baseUrl);
200-
urlBuilder.appendQuery("region", params["region"]);
201-
202-
const headers: { [header: string]: string } = {};
203-
const options: RequestOptions = {
204-
method: "GET",
205-
headers
206-
};
207-
208-
return builder.request<API[]>(urlBuilder, options);
209-
}
210-
211160
/**
212161
* Return the list of APIs for a given resource identified by hrn. This response is valid for the time specified by 'Cache-Control' header.
213162
*

@here/olp-sdk-dataservice-api/lib/stream-api.ts

-52
Original file line numberDiff line numberDiff line change
@@ -166,58 +166,6 @@ export interface StreamOffset {
166166
* StreamApi
167167
*/
168168

169-
/**
170-
* @deprecated This function will be removed by 09.2020. Please use doCommitOffsets.
171-
* After reading data, you should commit the offset of the last message read from each partition so
172-
* that your application can resume reading new messages from the correct partition in the event that there is a
173-
* disruption to the subscription, such as an application crash. An offset can also be useful if you delete a subscription
174-
* then recreate a subscription for the same layer, because the new subscription can start reading data from the offset.
175-
* To read messages already committed, use the /seek endpoint, then use /partitions.
176-
* The base path to use is the value of 'nodeBaseURL' returned from /subscribe POST request.
177-
*
178-
* @summary Commits offsets of the last message read
179-
* @param layerId The ID of the stream layer.
180-
* @param commitOffsets The offsets to commit. It should be same as the offset of the message you wish to commit.
181-
* Do not pass offset + 1 as mentioned in Kafka Consumer documentation. The service adds one to the offset you specify.
182-
* @param subscriptionId The subscriptionId received in the response of the /subscribe request (required if mode&#x3D;parallel).
183-
* @param mode The subscription mode of this subscriptionId (as provided in /subscribe POST API).
184-
* @param xCorrelationId The correlation-id (value of Response Header &#39;X-Correlation-Id&#39;) from prior step in process.
185-
* See the [API Reference](https://developer.here.com/olp/documentation/data-api/api-reference.html) for the &#x60;stream&#x60; API
186-
*/
187-
export async function commitOffsets(
188-
builder: RequestBuilder,
189-
params: {
190-
layerId: string;
191-
commitOffsets: CommitOffsetsRequest;
192-
subscriptionId?: string;
193-
mode?: "serial" | "parallel";
194-
xCorrelationId?: string;
195-
}
196-
): Promise<any> {
197-
const baseUrl = "/layers/{layerId}/offsets".replace(
198-
"{layerId}",
199-
UrlBuilder.toString(params["layerId"])
200-
);
201-
202-
const urlBuilder = new UrlBuilder(builder.baseUrl + baseUrl);
203-
urlBuilder.appendQuery("subscriptionId", params["subscriptionId"]);
204-
urlBuilder.appendQuery("mode", params["mode"]);
205-
206-
const headers: { [header: string]: string } = {};
207-
const options: RequestOptions = {
208-
method: "PUT",
209-
headers
210-
};
211-
headers["Content-Type"] = "application/json";
212-
if (params["commitOffsets"] !== undefined) {
213-
options.body = JSON.stringify(params["commitOffsets"]);
214-
}
215-
if (params["xCorrelationId"] !== undefined) {
216-
headers["X-Correlation-Id"] = params["xCorrelationId"] as string;
217-
}
218-
return builder.request<any>(urlBuilder, options);
219-
}
220-
221169
/**
222170
* After reading data, you should commit the offset of the last message read from each partition so
223171
* that your application can resume reading new messages from the correct partition in the event that there is a

@here/olp-sdk-dataservice-api/test/LookupApi.test.ts

-41
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,6 @@ describe("lookupAPI", function() {
5151
expect(result).to.be.equal("success");
5252
});
5353

54-
it("platformAPIList", async function() {
55-
const builder = {
56-
baseUrl: "http://mocked.url",
57-
request: async (urlBuilder: UrlBuilder, options: any) => {
58-
expect(urlBuilder.url).to.be.equal(
59-
"http://mocked.url/platform/apis"
60-
);
61-
expect(options.method).to.be.equal("GET");
62-
return Promise.resolve("success");
63-
}
64-
};
65-
const result = await LookupApi.platformAPIList(
66-
(builder as unknown) as RequestBuilder
67-
);
68-
69-
expect(result).to.be.equal("success");
70-
});
71-
7254
it("resourceAPI", async function() {
7355
const params = {
7456
hrn: "mocked-hrn",
@@ -93,27 +75,4 @@ describe("lookupAPI", function() {
9375

9476
expect(result).to.be.equal("success");
9577
});
96-
97-
it("resourceAPIList", async function() {
98-
const params = {
99-
hrn: "mocked-hrn",
100-
region: "mocked-region"
101-
};
102-
const builder = {
103-
baseUrl: "http://mocked.url",
104-
request: async (urlBuilder: UrlBuilder, options: any) => {
105-
expect(urlBuilder.url).to.be.equal(
106-
"http://mocked.url/resources/mocked-hrn/apis?region=mocked-region"
107-
);
108-
expect(options.method).to.be.equal("GET");
109-
return Promise.resolve("success");
110-
}
111-
};
112-
const result = await LookupApi.resourceAPIList(
113-
(builder as unknown) as RequestBuilder,
114-
params
115-
);
116-
117-
expect(result).to.be.equal("success");
118-
});
11978
});

@here/olp-sdk-dataservice-api/test/StreamApi.test.ts

-28
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,6 @@ chai.use(sinonChai);
2828
const expect = chai.expect;
2929

3030
describe("StreamApi", function() {
31-
it("Should commitOffsets works as expected", async function() {
32-
const builder = {
33-
baseUrl: "http://mocked.url",
34-
request: async (urlBuilder: UrlBuilder, options: any) => {
35-
expect(urlBuilder.url).to.be.equal(
36-
"http://mocked.url/layers/mocked-id/offsets?subscriptionId=test-subscriptionId&mode=serial"
37-
);
38-
expect(options.method).to.be.equal("PUT");
39-
return Promise.resolve();
40-
}
41-
} as RequestBuilder;
42-
43-
await StreamApi.commitOffsets(builder, {
44-
layerId: "mocked-id",
45-
subscriptionId: "test-subscriptionId",
46-
xCorrelationId: "test-xCorrelationId",
47-
mode: "serial",
48-
commitOffsets: {
49-
offsets: [
50-
{
51-
partition: 25,
52-
offset: 3
53-
}
54-
]
55-
}
56-
});
57-
});
58-
5931
it("Should doCommitOffsets works as expected", async function() {
6032
const builder = {
6133
baseUrl: "http://mocked.url",

@here/olp-sdk-dataservice-read/lib/cache/MetadataCacheRepository.ts

+48-4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class MetadataCacheRepository {
3434
constructor(private readonly cache: KeyValueCache) {}
3535

3636
/**
37+
* @deprecated This signature will be removed by 04.2021. Please set the version as the last argument.
3738
* Stores a key-value pair in the cache.
3839
*
3940
* @return True if the operation is successful, false otherwise.
@@ -43,6 +44,27 @@ export class MetadataCacheRepository {
4344
hrn: string,
4445
layerId: string,
4546
partitions: MetadataApi.Partition[]
47+
): boolean;
48+
49+
/**
50+
* Stores a key-value pair in the cache.
51+
*
52+
* @return True if the operation is successful, false otherwise.
53+
*/
54+
public put(
55+
rq: PartitionsRequest,
56+
hrn: string,
57+
layerId: string,
58+
partitions: MetadataApi.Partition[],
59+
// tslint:disable-next-line: unified-signatures
60+
version?: number
61+
): boolean;
62+
public put(
63+
rq: PartitionsRequest,
64+
hrn: string,
65+
layerId: string,
66+
partitions: MetadataApi.Partition[],
67+
version?: number
4668
): boolean {
4769
const partitionsIds = rq.getPartitionIds();
4870
let key: string;
@@ -51,7 +73,7 @@ export class MetadataCacheRepository {
5173
key = this.createKey({
5274
hrn,
5375
layerId,
54-
version: rq.getVersion(),
76+
version: version !== undefined ? version : rq.getVersion(),
5577
partitionId: metadata.partition
5678
});
5779
this.cache.put(key, JSON.stringify(metadata));
@@ -63,12 +85,13 @@ export class MetadataCacheRepository {
6385
key = this.createKey({
6486
hrn,
6587
layerId,
66-
version: rq.getVersion()
88+
version: version !== undefined ? version : rq.getVersion()
6789
});
6890
return this.cache.put(key, JSON.stringify(partitions));
6991
}
7092

7193
/**
94+
* @deprecated This signature will be removed by 04.2021. Please set the version as the last argument.
7295
* Gets a metadata from the cache.
7396
*
7497
* @param service The name of the API service for which you want to get the base URL.
@@ -79,6 +102,27 @@ export class MetadataCacheRepository {
79102
rq: PartitionsRequest,
80103
hrn: string,
81104
layerId: string
105+
): MetadataApi.Partition[] | undefined;
106+
107+
/**
108+
* Gets a metadata from the cache.
109+
*
110+
* @param service The name of the API service for which you want to get the base URL.
111+
* @param serviceVersion The service version.
112+
* @return The base URL of the service, or undefined if the base URL does not exist.
113+
*/
114+
public get(
115+
rq: PartitionsRequest,
116+
hrn: string,
117+
layerId: string,
118+
// tslint:disable-next-line: unified-signatures
119+
version?: number
120+
): MetadataApi.Partition[] | undefined;
121+
public get(
122+
rq: PartitionsRequest,
123+
hrn: string,
124+
layerId: string,
125+
version?: number
82126
): MetadataApi.Partition[] | undefined {
83127
const partitionsIds = rq.getPartitionIds();
84128
let key: string;
@@ -88,7 +132,7 @@ export class MetadataCacheRepository {
88132
key = this.createKey({
89133
hrn,
90134
layerId,
91-
version: rq.getVersion(),
135+
version: version !== undefined ? version : rq.getVersion(),
92136
partitionId
93137
});
94138

@@ -119,7 +163,7 @@ export class MetadataCacheRepository {
119163
key = this.createKey({
120164
hrn,
121165
layerId,
122-
version: rq.getVersion()
166+
version: version !== undefined ? version : rq.getVersion()
123167
});
124168

125169
const serializedPartitions = this.cache.get(key);

@here/olp-sdk-dataservice-read/lib/client/DataRequest.ts

-26
Original file line numberDiff line numberDiff line change
@@ -101,32 +101,6 @@ export class DataRequest {
101101
return this;
102102
}
103103

104-
/**
105-
* @deprecated This method is deprecated and is not used. If you need to set the version,
106-
* initialize the version client with the new constructor. Otherwise, the latest version will be used.
107-
*
108-
* Gets a catalog version for the request.
109-
*
110-
* @return The catalog version number.
111-
*/
112-
public getVersion(): number | undefined {
113-
return this.version;
114-
}
115-
116-
/**
117-
* @deprecated This method is deprecated and is not used. If you need to set the version,
118-
* initialize the version client with the new constructor. Otherwise, the latest version will be used.
119-
*
120-
* Sets the provided catalog version.
121-
*
122-
* @param version The catalog version number.
123-
* @returns The updated [[DataRequest]] instance that you can use to chain methods.
124-
*/
125-
public withVersion(version: number): DataRequest {
126-
this.version = version;
127-
return this;
128-
}
129-
130104
/**
131105
* An optional free-form tag that is used for grouping billing records together.
132106
*

0 commit comments

Comments
 (0)