How to use the @here/olp-sdk-dataservice-api.MetadataApi.latestVersion function in @here/olp-sdk-dataservice-api

To help you get started, we’ve selected a few @here/olp-sdk-dataservice-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / CatalogClient.ts View on Github external
public async getLatestVersion(
        request: CatalogVersionRequest,
        abortSignal?: AbortSignal
    ): Promise {
        const startVersion = request.getStartVersion() || -1;
        const builder = await this.getRequestBuilder(
            "metadata",
            HRN.fromString(this.hrn),
            abortSignal
        ).catch(error => Promise.reject(error));
        const latestVersion = await MetadataApi.latestVersion(builder, {
            startVersion,
            billingTag: request.getBillingTag()
        });
        return latestVersion.version;
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / VersionedLayerClient.ts View on Github external
private async getLatestVersion(): Promise {
        const builder = await this.getRequestBuilder("metadata").catch(error =>
            Promise.reject(error)
        );
        const latestVersion = await MetadataApi.latestVersion(builder, {
            startVersion: -1
        }).catch(async (error: Response) =>
            Promise.reject(
                new Error(
                    `Metadata Service error: HTTP ${
                        error.status
                    }, ${error.statusText || ""}`
                )
            )
        );
        return latestVersion.version;
    }
github heremaps / here-olp-sdk-typescript / @here / olp-sdk-dataservice-read / lib / client / QueryClient.ts View on Github external
abortSignal?: AbortSignal,
        billingTag?: string
    ): Promise {
        const request = await RequestFactory.create(
            "metadata",
            this.apiVersion,
            this.settings,
            catalogHrn,
            abortSignal
        ).catch(error =>
            Promise.reject(
                `Erorr creating request object for metadata service: ${error}`
            )
        );

        const latestVersion = await MetadataApi.latestVersion(request, {
            startVersion: -1,
            billingTag
        }).catch(error => Promise.reject(error));

        return Promise.resolve(latestVersion.version);
    }
}