UNPKG

@oystehr/sdk

Version:

Oystehr SDK

88 lines (85 loc) 5.02 kB
import { SDKResource } from '../../client/client.js'; import { uploadFile } from './zambda-ext.js'; // AUTOGENERATED -- DO NOT EDIT class Zambda extends SDKResource { constructor(config) { super(config); } #baseUrlThunk() { return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1'; } uploadFile = uploadFile; /** * Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:ListAllFunctions` * Access Policy Resource: `Zambda:Function` */ list(request) { return this.request('/zambda', 'get', this.#baseUrlThunk.bind(this))(request); } /** * Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:CreateFunction` * Access Policy Resource: `Zambda:Function` */ create(params, request) { return this.request('/zambda', 'post', this.#baseUrlThunk.bind(this))(params, request); } /** * Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:GetFunction` * Access Policy Resource: `Zambda:Function` */ get(params, request) { return this.request('/zambda/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request); } /** * Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:UpdateFunction` * Access Policy Resource: `Zambda:Function` */ update(params, request) { return this.request('/zambda/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request); } /** * Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:DeleteFunction` * Access Policy Resource: `Zambda:Function` */ delete(params, request) { return this.request('/zambda/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request); } /** * Execute the [Authenticated Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:InvokeFunction` * Access Policy Resource: `Zambda:Function` */ execute(params, request) { return this.request('/zambda/{id}/execute', 'post', this.#baseUrlThunk.bind(this))(params, request); } /** * Execute the [Public Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements. */ executePublic(params, request) { return this.request('/zambda/{id}/execute-public', 'post', this.#baseUrlThunk.bind(this))(params, request); } /** * Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services. * * Access Policy Action: `Zambda:UpdateFunction` * Access Policy Resource: `Zambda:Function` */ s3Upload(params, request) { return this.request('/zambda/{id}/s3-upload', 'post', this.#baseUrlThunk.bind(this))(params, request); } } export { Zambda }; //# sourceMappingURL=zambda.js.map