@lokalise/node-api
Version:
Official Lokalise API 2.0 Node.js client
41 lines (35 loc) • 990 B
text/typescript
import { OtaBundleArchive } from "../models/ota/ota_bundle_archive.js";
import type {
OtaProjectFramework,
OtaRequestBundleParams,
} from "../types/ota.js";
import { OtaCollection } from "./ota_collection.js";
export class OtaBundles extends OtaCollection<OtaBundleArchive> {
protected static rootElementNameSingular = "data";
protected static override prefixURI =
"lokalise/projects/{!:lokaliseProjectId}/frameworks/{!:framework}";
protected static elementClass = OtaBundleArchive;
protected get elementClass(): new (
json: Record<string, unknown>,
) => OtaBundleArchive {
return OtaBundleArchive;
}
protected override get rootElementNameSingular(): string {
return "data";
}
get(
bundle_params: OtaRequestBundleParams,
request_params: OtaProjectFramework,
): Promise<OtaBundleArchive> {
const params = {
...request_params,
...bundle_params,
};
return this.createPromise(
"GET",
params,
this.populateObjectFromJsonRoot,
null,
);
}
}