import { APIResource } from "../../core/resource.mjs"; import * as DeploymentsAPI from "./deployments.mjs"; import { DeploymentCreateParams, DeploymentListLogsParams, DeploymentListLogsResponse, DeploymentListResponse, DeploymentRetrieveParams, Deployments, FunctionDeployment } from "./deployments.mjs"; import * as ExecutionsAPI from "./executions.mjs"; import { ExecutionCreateParams, ExecutionListLogsParams, ExecutionListLogsResponse, ExecutionListParams, ExecutionRetrieveParams, Executions, FunctionExecution, FunctionExecutionsPageCursorURL } from "./executions.mjs"; import { APIPromise } from "../../core/api-promise.mjs"; import { PageCursorURL, PagePromise } from "../../core/pagination.mjs"; import { RequestOptions } from "../../internal/request-options.mjs"; /** * Functions defined by the company */ export declare class Functions extends APIResource { deployments: DeploymentsAPI.Deployments; executions: ExecutionsAPI.Executions; /** * A list of functions. * * - Requires: `API Tier 1` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /functions/?order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "api_name": "string", * "description": "string", * "code_draft": "string", * "dependencies": {}, * "is_async": false, * "listed_in_custom_apps": false, * "source_upload_instructions": { * "url": "string", * "method": "POST", * "fields": {}, * "expires_at": "string", * "archive": {} * } * } * ], * "next_link": "string" * } * ``` */ list(query?: FunctionListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Create a new function. * * @example HTTP * Representative request and response shapes. * ``` * POST /functions/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "api_name": "string", * "description": "string", * "code_draft": "string", * "dependencies": {}, * "is_async": false, * "listed_in_custom_apps": false, * "source_upload_instructions": { * "url": "string", * "method": "POST", * "fields": {}, * "expires_at": "string", * "archive": { * "object_key": "string", * "sha256": "string", * "size_bytes": 0 * } * } * } * ``` */ create(body?: FunctionCreateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Retrieve a specific function. * * @example HTTP * Representative request and response shapes. * ``` * GET /functions/{function_api_name}/ HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "api_name": "string", * "description": "string", * "code_draft": "string", * "dependencies": {}, * "is_async": false, * "listed_in_custom_apps": false, * "source_upload_instructions": { * "url": "string", * "method": "POST", * "fields": {}, * "expires_at": "string", * "archive": { * "object_key": "string", * "sha256": "string", * "size_bytes": 0 * } * } * } * ``` */ retrieve(functionAPIName: string, options?: RequestOptions): APIPromise; /** * Update a function * * @example HTTP * Representative request and response shapes. * ``` * PATCH /functions/{function_api_name}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "api_name": "string", * "description": "string", * "code_draft": "string", * "dependencies": {}, * "is_async": false, * "listed_in_custom_apps": false, * "source_upload_instructions": { * "url": "string", * "method": "POST", * "fields": {}, * "expires_at": "string", * "archive": { * "object_key": "string", * "sha256": "string", * "size_bytes": 0 * } * } * } * ``` */ update(functionAPIName: string, body?: FunctionUpdateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Permanently delete a function. A successful 204 response has no body. Functions * with dependencies cannot be deleted; resolve the dependencies identified in the * 409 response and submit a new request. Do not automatically retry this request * after an unknown outcome: after a successful deletion, subsequent requests * return 404. * * @example HTTP * Representative request and response shapes. * ``` * DELETE /functions/{function_api_name}/ HTTP/1.1 * Host: rest.ripplingapis.com * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 204 No Content * ``` */ delete(functionAPIName: string, options?: RequestOptions): APIPromise; /** * Create a new function dev bundle. * * @example HTTP * Representative request and response shapes. * ``` * POST /functions/{function_api_name}/dev_bundles/ HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "contents": "string" * } * ``` */ createDevBundle(functionAPIName: string, body?: FunctionCreateDevBundleParams | null | undefined, options?: RequestOptions): APIPromise; } export type FunctionsPageCursorURL = PageCursorURL; export interface Function { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The API name of the function */ api_name?: string; /** * The current draft of code for the function */ code_draft?: string; /** * The dependencies of the function */ dependencies?: unknown; /** * The function description */ description?: string; /** * Whether this function runs asynchronously */ is_async?: boolean; /** * Whether this request-function is listed in the Custom Apps grid and navigation. * Defaults to false on creation; omitted updates preserve the current value. * Listing does not grant access or change deployment behavior. Only supported for * request functions. Setting this field on an event function returns a validation * error. */ listed_in_custom_apps?: boolean; /** * The function name */ name?: string; /** * Upload instructions returned only when source_upload was requested on create or * update. */ source_upload_instructions?: Function.SourceUploadInstructions; } export declare namespace Function { /** * Upload instructions returned only when source_upload was requested on create or * update. */ interface SourceUploadInstructions { /** * Archive reference for a subsequent deployment after the upload succeeds. */ archive: SourceUploadInstructions.Archive; /** * UTC expiration of the upload instructions, in RFC3339/ISO8601 format. */ expires_at: string; /** * Include every opaque signed field unchanged in the multipart/form-data POST, * plus the ZIP file. */ fields: { [key: string]: string; }; /** * HTTP method for the client-direct upload. */ method: 'POST'; /** * Upload the ZIP directly to this URL, not through the Functions API. */ url: string; } namespace SourceUploadInstructions { /** * Archive reference for a subsequent deployment after the upload succeeds. */ interface Archive { /** * Tenant-scoped object key to use as the archive reference in the explicit * deployment JSON. */ object_key: string; /** * SHA-256 of the ZIP bytes. */ sha256: string; /** * Exact ZIP size in bytes, returned as a JSON integer. */ size_bytes: number; } } } export interface FunctionCreateDevBundleResponse { /** * The bundle contents as a base64 encoded zip */ contents?: string; } export interface FunctionListParams { cursor?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export interface FunctionCreateParams { /** * The API name of the function */ api_name?: string; /** * The current draft of code for the function */ code_draft?: string; /** * The dependencies of the function */ dependencies?: unknown; /** * The function description */ description?: string; /** * Whether this function runs asynchronously */ is_async?: boolean; /** * Whether this request-function is listed in the Custom Apps grid and navigation. * Defaults to false on creation; omitted updates preserve the current value. * Listing does not grant access or change deployment behavior. Only supported for * request functions. Setting this field on an event function returns a validation * error. */ listed_in_custom_apps?: boolean; /** * The function name */ name?: string; /** * Optional source ZIP checksum and size for request functions only. Create or * update returns ephemeral source_upload_instructions; this input is not returned. */ source_upload?: FunctionCreateParams.SourceUpload; /** * Function type at creation. Defaults to event and cannot be changed afterward. */ type?: 'event' | 'request'; } export declare namespace FunctionCreateParams { /** * Optional source ZIP checksum and size for request functions only. Create or * update returns ephemeral source_upload_instructions; this input is not returned. */ interface SourceUpload { /** * SHA-256 of the exact ZIP bytes, written as 64 lowercase hexadecimal characters. */ sha256: string; /** * Exact ZIP size in bytes, from 1 through 67108864 (64 MiB). */ size_bytes: number; } } export interface FunctionUpdateParams { /** * The current draft of code for the function */ code_draft?: string; /** * The dependencies of the function */ dependencies?: unknown; /** * The function description */ description?: string; /** * Whether this request-function is listed in the Custom Apps grid and navigation. * Defaults to false on creation; omitted updates preserve the current value. * Listing does not grant access or change deployment behavior. Only supported for * request functions. Setting this field on an event function returns a validation * error. */ listed_in_custom_apps?: boolean; /** * The function name */ name?: string; /** * Optional source ZIP checksum and size for request functions only. Create or * update returns ephemeral source_upload_instructions; this input is not returned. */ source_upload?: FunctionUpdateParams.SourceUpload; } export declare namespace FunctionUpdateParams { /** * Optional source ZIP checksum and size for request functions only. Create or * update returns ephemeral source_upload_instructions; this input is not returned. */ interface SourceUpload { /** * SHA-256 of the exact ZIP bytes, written as 64 lowercase hexadecimal characters. */ sha256: string; /** * Exact ZIP size in bytes, from 1 through 67108864 (64 MiB). */ size_bytes: number; } } export interface FunctionCreateDevBundleParams { } export declare namespace Functions { export { type Function as Function, type FunctionCreateDevBundleResponse as FunctionCreateDevBundleResponse, type FunctionsPageCursorURL as FunctionsPageCursorURL, type FunctionListParams as FunctionListParams, type FunctionCreateParams as FunctionCreateParams, type FunctionUpdateParams as FunctionUpdateParams, type FunctionCreateDevBundleParams as FunctionCreateDevBundleParams, }; export { Deployments as Deployments, type FunctionDeployment as FunctionDeployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentListLogsResponse as DeploymentListLogsResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentRetrieveParams as DeploymentRetrieveParams, type DeploymentListLogsParams as DeploymentListLogsParams, }; export { Executions as Executions, type FunctionExecution as FunctionExecution, type ExecutionListLogsResponse as ExecutionListLogsResponse, type FunctionExecutionsPageCursorURL as FunctionExecutionsPageCursorURL, type ExecutionListParams as ExecutionListParams, type ExecutionCreateParams as ExecutionCreateParams, type ExecutionRetrieveParams as ExecutionRetrieveParams, type ExecutionListLogsParams as ExecutionListLogsParams, }; } //# sourceMappingURL=functions.d.mts.map