Skip to content

Remove deprecated items. #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions @here/olp-sdk-dataservice-api/lib/lookup-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,6 @@ export async function platformAPI(
return builder.request<API[]>(urlBuilder, options);
}

/**
* @deprecated This method is deprecated and is not used. Please used getPlatformAPIList()
* Return the list of the HERE APIs. This response is valid for the time specified by 'Cache-Control' header.
*
* @summary Return the list of the HERE APIs.
*/
export async function platformAPIList(
builder: RequestBuilder
): Promise<API[] | ApiNotFoundError> {
const baseUrl = "/platform/apis";

const urlBuilder = new UrlBuilder(builder.baseUrl + baseUrl);

const headers: { [header: string]: string } = {};
const options: RequestOptions = {
method: "GET",
headers
};

return builder.request<API[]>(urlBuilder, options);
}

/**
* Return the list of the HERE APIs. This response is valid for the time specified by 'Cache-Control' header.
*
Expand Down Expand Up @@ -179,35 +157,6 @@ export async function resourceAPI(
return builder.request<API[]>(urlBuilder, options);
}

/**
* @deprecated This method is deprecated and is not used. Please used getResourceAPIList()
* Return the list of APIs for a given resource identified by hrn. This response is valid for the time specified by 'Cache-Control' header.
*
* @summary Return the list of APIs for a given resource.
* @param hrn The HRN identifying the resource
* @param region If you want to look up a specific region for a given resource.
*/
export async function resourceAPIList(
builder: RequestBuilder,
params: { hrn: string; region?: string }
): Promise<API[] | ApiNotFoundError> {
const baseUrl = "/resources/{hrn}/apis".replace(
"{hrn}",
UrlBuilder.toString(params["hrn"])
);

const urlBuilder = new UrlBuilder(builder.baseUrl + baseUrl);
urlBuilder.appendQuery("region", params["region"]);

const headers: { [header: string]: string } = {};
const options: RequestOptions = {
method: "GET",
headers
};

return builder.request<API[]>(urlBuilder, options);
}

/**
* Return the list of APIs for a given resource identified by hrn. This response is valid for the time specified by 'Cache-Control' header.
*
Expand Down
52 changes: 0 additions & 52 deletions @here/olp-sdk-dataservice-api/lib/stream-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,58 +166,6 @@ export interface StreamOffset {
* StreamApi
*/

/**
* @deprecated This function will be removed by 09.2020. Please use doCommitOffsets.
* After reading data, you should commit the offset of the last message read from each partition so
* that your application can resume reading new messages from the correct partition in the event that there is a
* disruption to the subscription, such as an application crash. An offset can also be useful if you delete a subscription
* then recreate a subscription for the same layer, because the new subscription can start reading data from the offset.
* To read messages already committed, use the /seek endpoint, then use /partitions.
* The base path to use is the value of 'nodeBaseURL' returned from /subscribe POST request.
*
* @summary Commits offsets of the last message read
* @param layerId The ID of the stream layer.
* @param commitOffsets The offsets to commit. It should be same as the offset of the message you wish to commit.
* Do not pass offset + 1 as mentioned in Kafka Consumer documentation. The service adds one to the offset you specify.
* @param subscriptionId The subscriptionId received in the response of the /subscribe request (required if mode&#x3D;parallel).
* @param mode The subscription mode of this subscriptionId (as provided in /subscribe POST API).
* @param xCorrelationId The correlation-id (value of Response Header &#39;X-Correlation-Id&#39;) from prior step in process.
* See the [API Reference](https://developer.here.com/olp/documentation/data-api/api-reference.html) for the &#x60;stream&#x60; API
*/
export async function commitOffsets(
builder: RequestBuilder,
params: {
layerId: string;
commitOffsets: CommitOffsetsRequest;
subscriptionId?: string;
mode?: "serial" | "parallel";
xCorrelationId?: string;
}
): Promise<any> {
const baseUrl = "/layers/{layerId}/offsets".replace(
"{layerId}",
UrlBuilder.toString(params["layerId"])
);

const urlBuilder = new UrlBuilder(builder.baseUrl + baseUrl);
urlBuilder.appendQuery("subscriptionId", params["subscriptionId"]);
urlBuilder.appendQuery("mode", params["mode"]);

const headers: { [header: string]: string } = {};
const options: RequestOptions = {
method: "PUT",
headers
};
headers["Content-Type"] = "application/json";
if (params["commitOffsets"] !== undefined) {
options.body = JSON.stringify(params["commitOffsets"]);
}
if (params["xCorrelationId"] !== undefined) {
headers["X-Correlation-Id"] = params["xCorrelationId"] as string;
}
return builder.request<any>(urlBuilder, options);
}

/**
* After reading data, you should commit the offset of the last message read from each partition so
* that your application can resume reading new messages from the correct partition in the event that there is a
Expand Down
41 changes: 0 additions & 41 deletions @here/olp-sdk-dataservice-api/test/LookupApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,6 @@ describe("lookupAPI", function() {
expect(result).to.be.equal("success");
});

it("platformAPIList", async function() {
const builder = {
baseUrl: "http://mocked.url",
request: async (urlBuilder: UrlBuilder, options: any) => {
expect(urlBuilder.url).to.be.equal(
"http://mocked.url/platform/apis"
);
expect(options.method).to.be.equal("GET");
return Promise.resolve("success");
}
};
const result = await LookupApi.platformAPIList(
(builder as unknown) as RequestBuilder
);

expect(result).to.be.equal("success");
});

it("resourceAPI", async function() {
const params = {
hrn: "mocked-hrn",
Expand All @@ -93,27 +75,4 @@ describe("lookupAPI", function() {

expect(result).to.be.equal("success");
});

it("resourceAPIList", async function() {
const params = {
hrn: "mocked-hrn",
region: "mocked-region"
};
const builder = {
baseUrl: "http://mocked.url",
request: async (urlBuilder: UrlBuilder, options: any) => {
expect(urlBuilder.url).to.be.equal(
"http://mocked.url/resources/mocked-hrn/apis?region=mocked-region"
);
expect(options.method).to.be.equal("GET");
return Promise.resolve("success");
}
};
const result = await LookupApi.resourceAPIList(
(builder as unknown) as RequestBuilder,
params
);

expect(result).to.be.equal("success");
});
});
28 changes: 0 additions & 28 deletions @here/olp-sdk-dataservice-api/test/StreamApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,6 @@ chai.use(sinonChai);
const expect = chai.expect;

describe("StreamApi", function() {
it("Should commitOffsets works as expected", async function() {
const builder = {
baseUrl: "http://mocked.url",
request: async (urlBuilder: UrlBuilder, options: any) => {
expect(urlBuilder.url).to.be.equal(
"http://mocked.url/layers/mocked-id/offsets?subscriptionId=test-subscriptionId&mode=serial"
);
expect(options.method).to.be.equal("PUT");
return Promise.resolve();
}
} as RequestBuilder;

await StreamApi.commitOffsets(builder, {
layerId: "mocked-id",
subscriptionId: "test-subscriptionId",
xCorrelationId: "test-xCorrelationId",
mode: "serial",
commitOffsets: {
offsets: [
{
partition: 25,
offset: 3
}
]
}
});
});

it("Should doCommitOffsets works as expected", async function() {
const builder = {
baseUrl: "http://mocked.url",
Expand Down
26 changes: 0 additions & 26 deletions @here/olp-sdk-dataservice-read/lib/client/DataRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,32 +101,6 @@ export class DataRequest {
return this;
}

/**
* @deprecated This method is deprecated and is not used. If you need to set the version,
* initialize the version client with the new constructor. Otherwise, the latest version will be used.
*
* Gets a catalog version for the request.
*
* @return The catalog version number.
*/
public getVersion(): number | undefined {
return this.version;
}

/**
* @deprecated This method is deprecated and is not used. If you need to set the version,
* initialize the version client with the new constructor. Otherwise, the latest version will be used.
*
* Sets the provided catalog version.
*
* @param version The catalog version number.
* @returns The updated [[DataRequest]] instance that you can use to chain methods.
*/
public withVersion(version: number): DataRequest {
this.version = version;
return this;
}

/**
* An optional free-form tag that is used for grouping billing records together.
*
Expand Down
48 changes: 7 additions & 41 deletions @here/olp-sdk-dataservice-read/lib/client/IndexLayerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,62 +47,28 @@ export class IndexLayerClient {

/**
* HRN of the catalog.
* @deprecated This field will be marked as private by 08.2020.
*/
hrn: string;
private hrn: string;

/**
* The ID of the layer.
* @deprecated This field will be marked as private by 08.2020.
*/
layerId: string;
private layerId: string;

/**
* The [[OlpClientSettings]] instance.
* @deprecated This field will be marked as private by 08.2020.
*/
settings: OlpClientSettings;

/**
* @deprecated Please use the overloaded constructor of IndexLayerClient.
*
* Creates the [[IndexLayerClient]] instance.
*
* @param catalogHrn The HERE Resource Name (HRN) of the catalog from which you want to get partitions metadata and data.
* @param layerId The ID of the layer.
* @param settings The [[OlpClientSettings]] instance.
* @return The [[IndexLayerClient]] instance.
*/
constructor(catalogHrn: HRN, layerId: string, settings: OlpClientSettings);
private settings: OlpClientSettings;

/**
* Creates the [[IndexLayerClient]] instance with IndexLayerClientParams.
*
* @param params parameters for use to initialize IndexLayerClient.
*/
constructor(params: IndexLayerClientParams);

/**
* Implementation for handling both constuctors.
*/
constructor(
paramsOrHrn: IndexLayerClientParams | HRN,
layerId?: string,
settings?: OlpClientSettings
) {
if (paramsOrHrn instanceof HRN) {
this.hrn = paramsOrHrn.toString();
if (layerId && settings instanceof OlpClientSettings) {
this.layerId = layerId;
this.settings = settings;
} else {
throw new Error("Unsupported parameters");
}
} else {
this.hrn = paramsOrHrn.catalogHrn.toString();
this.layerId = paramsOrHrn.layerId;
this.settings = paramsOrHrn.settings;
}
constructor(params: IndexLayerClientParams) {
this.hrn = params.catalogHrn.toString();
this.layerId = params.layerId;
this.settings = params.settings;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ export class QuadKeyPartitionsRequest {
private billingTag?: string;
private additionalFields?: AdditionalFields;

/**
* @deprecated This method is deprecated and is not used. If you need to set the version, then
* initialize the version client with not deprecated constructor, in other case the latest version will be used.
*
* The version of the catalog against which you want to run the query.
* It must be a valid catalog version.
*
* @param version Specify the catalog version or, if you want to use the latest catalog version, set to undefined.
* @returns The updated [[QuadKeyPartitionsRequest]] instance that you can use to chain methods.
*/
public withVersion(version?: number): QuadKeyPartitionsRequest {
this.version = version;
return this;
}

/**
* A geometric area represented as a HERE tile.
*
Expand Down Expand Up @@ -105,18 +90,6 @@ export class QuadKeyPartitionsRequest {
return this;
}

/**
* @deprecated This method is deprecated and is not used. If you need to set the version, then
* initialize the version client with not deprecated constructor, in other case the latest version will be used.
*
* The configured catalog version for the request.
*
* @return The catalog version number.
*/
public getVersion(): number | undefined {
return this.version;
}

/**
* Gets the configured [[QuadKey]] object for the request.
*
Expand Down
10 changes: 2 additions & 8 deletions @here/olp-sdk-dataservice-read/lib/client/StatisticsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,9 @@ export class StatisticsRequest {

/**
* Gets a tile level for the request.
* @deprecated Please use getDataLevel(): number | undefined
* @return The requested tile level string.
*/
public getDataLevel(): string | undefined;
public getDataLevel(): number | string | undefined {
public getDataLevel(): number | undefined {
return this.dataLevel;
}
/**
Expand Down Expand Up @@ -133,14 +131,10 @@ export class StatisticsRequest {
/**
* A setter for the provided `dataLevel` string.
*
* @deprecated Please set dataLevel as a number
* @param dataLevel dataLevel Specify the tile level about which you want to get statistical data.
* @returns The updated [[StatisticsRequest]] instance that you can use to chain methods.
*/
// tslint:disable-next-line: unified-signatures
public withDataLevel(dataLevel: string): StatisticsRequest;

public withDataLevel(dataLevel: string | number) {
public withDataLevel(dataLevel: number) {
this.dataLevel = Number(dataLevel);
return this;
}
Expand Down
Loading