Skip to content

Commit e5eaad3

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 bd3529c commit e5eaad3

30 files changed

+223
-1287
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/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
*

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

+7-41
Original file line numberDiff line numberDiff line change
@@ -47,62 +47,28 @@ export class IndexLayerClient {
4747

4848
/**
4949
* HRN of the catalog.
50-
* @deprecated This field will be marked as private by 08.2020.
5150
*/
52-
hrn: string;
51+
private hrn: string;
5352

5453
/**
5554
* The ID of the layer.
56-
* @deprecated This field will be marked as private by 08.2020.
5755
*/
58-
layerId: string;
56+
private layerId: string;
5957

6058
/**
6159
* The [[OlpClientSettings]] instance.
62-
* @deprecated This field will be marked as private by 08.2020.
6360
*/
64-
settings: OlpClientSettings;
65-
66-
/**
67-
* @deprecated Please use the overloaded constructor of IndexLayerClient.
68-
*
69-
* Creates the [[IndexLayerClient]] instance.
70-
*
71-
* @param catalogHrn The HERE Resource Name (HRN) of the catalog from which you want to get partitions metadata and data.
72-
* @param layerId The ID of the layer.
73-
* @param settings The [[OlpClientSettings]] instance.
74-
* @return The [[IndexLayerClient]] instance.
75-
*/
76-
constructor(catalogHrn: HRN, layerId: string, settings: OlpClientSettings);
61+
private settings: OlpClientSettings;
7762

7863
/**
7964
* Creates the [[IndexLayerClient]] instance with IndexLayerClientParams.
8065
*
8166
* @param params parameters for use to initialize IndexLayerClient.
8267
*/
83-
constructor(params: IndexLayerClientParams);
84-
85-
/**
86-
* Implementation for handling both constuctors.
87-
*/
88-
constructor(
89-
paramsOrHrn: IndexLayerClientParams | HRN,
90-
layerId?: string,
91-
settings?: OlpClientSettings
92-
) {
93-
if (paramsOrHrn instanceof HRN) {
94-
this.hrn = paramsOrHrn.toString();
95-
if (layerId && settings instanceof OlpClientSettings) {
96-
this.layerId = layerId;
97-
this.settings = settings;
98-
} else {
99-
throw new Error("Unsupported parameters");
100-
}
101-
} else {
102-
this.hrn = paramsOrHrn.catalogHrn.toString();
103-
this.layerId = paramsOrHrn.layerId;
104-
this.settings = paramsOrHrn.settings;
105-
}
68+
constructor(params: IndexLayerClientParams) {
69+
this.hrn = params.catalogHrn.toString();
70+
this.layerId = params.layerId;
71+
this.settings = params.settings;
10672
}
10773

10874
/**

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

-27
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,6 @@ export class QuadKeyPartitionsRequest {
3636
private billingTag?: string;
3737
private additionalFields?: AdditionalFields;
3838

39-
/**
40-
* @deprecated This method is deprecated and is not used. If you need to set the version, then
41-
* initialize the version client with not deprecated constructor, in other case the latest version will be used.
42-
*
43-
* The version of the catalog against which you want to run the query.
44-
* It must be a valid catalog version.
45-
*
46-
* @param version Specify the catalog version or, if you want to use the latest catalog version, set to undefined.
47-
* @returns The updated [[QuadKeyPartitionsRequest]] instance that you can use to chain methods.
48-
*/
49-
public withVersion(version?: number): QuadKeyPartitionsRequest {
50-
this.version = version;
51-
return this;
52-
}
53-
5439
/**
5540
* A geometric area represented as a HERE tile.
5641
*
@@ -105,18 +90,6 @@ export class QuadKeyPartitionsRequest {
10590
return this;
10691
}
10792

108-
/**
109-
* @deprecated This method is deprecated and is not used. If you need to set the version, then
110-
* initialize the version client with not deprecated constructor, in other case the latest version will be used.
111-
*
112-
* The configured catalog version for the request.
113-
*
114-
* @return The catalog version number.
115-
*/
116-
public getVersion(): number | undefined {
117-
return this.version;
118-
}
119-
12093
/**
12194
* Gets the configured [[QuadKey]] object for the request.
12295
*

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

+2-8
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ export class StatisticsRequest {
7878

7979
/**
8080
* Gets a tile level for the request.
81-
* @deprecated Please use getDataLevel(): number | undefined
8281
* @return The requested tile level string.
8382
*/
84-
public getDataLevel(): string | undefined;
85-
public getDataLevel(): number | string | undefined {
83+
public getDataLevel(): number | undefined {
8684
return this.dataLevel;
8785
}
8886
/**
@@ -133,14 +131,10 @@ export class StatisticsRequest {
133131
/**
134132
* A setter for the provided `dataLevel` string.
135133
*
136-
* @deprecated Please set dataLevel as a number
137134
* @param dataLevel dataLevel Specify the tile level about which you want to get statistical data.
138135
* @returns The updated [[StatisticsRequest]] instance that you can use to chain methods.
139136
*/
140-
// tslint:disable-next-line: unified-signatures
141-
public withDataLevel(dataLevel: string): StatisticsRequest;
142-
143-
public withDataLevel(dataLevel: string | number) {
137+
public withDataLevel(dataLevel: number) {
144138
this.dataLevel = Number(dataLevel);
145139
return this;
146140
}

0 commit comments

Comments
 (0)