import { APIResource } from "../../../core/resource.mjs"; import * as CapabilitiesAPI from "./capabilities.mjs"; import { Capabilities, CapabilityListResponse } from "./capabilities.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { PageCursorURL, PagePromise } from "../../../core/pagination.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; /** * Custom object datarows defined by the company */ export declare class Records extends APIResource { capabilities: CapabilitiesAPI.Capabilities; /** * A list of custom object records. * * - Requires: `API Tier 1` * * @example SDK usage * ```ts * // Automatically fetches more pages as needed. * for await (const customObjectDataRow of client.customObjects.records.list( * 'custom_object_api_name', * )) { * // ... * } * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/records/?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", * "external_id": "string", * "created_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "last_modified_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "owner_role": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "system_updated_at": "string" * } * ], * "next_link": "string" * } * ``` */ list(customObjectAPIName: string, query?: RecordListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Create a new custom object record, or update an existing record by external_id. * Creating requires create access; updating requires update access. A successful * write returns the full record when permitted by read access, or an ID-only * receipt otherwise. * * @example SDK usage * ```ts * const record = await client.customObjects.records.create( * 'custom_object_api_name', * {}, * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * POST /custom-objects/{custom_object_api_name}/records/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 201 Created * Content-Type: application/json * * { * "data": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "external_id": "string", * "created_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "last_modified_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "owner_role": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "system_updated_at": "string" * } * } * ``` */ create(customObjectAPIName: string, body?: RecordCreateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Lists custom object records matching optional name or owner search and RQL * filters. Use this operation to combine search, filtering, and ordering before * pagination. Returns readable records and a cursor for the next page, or null * when traversal is complete. * * @example SDK usage * ```ts * const response = await client.customObjects.records.query( * 'custom_object_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * POST /custom-objects/{custom_object_api_name}/records/query/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "order_by": "name asc", * "search": "laptop" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "external_id": "string", * "created_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "last_modified_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "owner_role": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "system_updated_at": "string" * } * ], * "cursor": "string" * } * ``` */ query(customObjectAPIName: string, body?: RecordQueryParams | null | undefined, options?: RequestOptions): APIPromise; /** * Retrieve a specific custom object record. * * @example SDK usage * ```ts * const customObjectDataRow = * await client.customObjects.records.retrieve( * 'custom_object_api_name', * 'codr_id', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/records/{codr_id}/ 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", * "external_id": "string", * "created_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "last_modified_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "owner_role": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "system_updated_at": "string" * } * ``` */ retrieve(customObjectAPIName: string, codrID: string, options?: RequestOptions): APIPromise; /** * Update a specific custom object record. A successful write returns the full * record when permitted by read access, or an ID-only receipt otherwise. * * @example SDK usage * ```ts * const record = await client.customObjects.records.update( * 'custom_object_api_name', * 'codr_id', * { foo: 'bar' }, * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * PATCH /custom-objects/{custom_object_api_name}/records/{codr_id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "foo": "bar" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "data": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "external_id": "string", * "created_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "last_modified_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "owner_role": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "system_updated_at": "string" * } * } * ``` */ update(customObjectAPIName: string, codrID: string, body?: RecordUpdateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Delete a custom object record. * * @example SDK usage * ```ts * await client.customObjects.records.delete( * 'custom_object_api_name', * 'codr_id', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * DELETE /custom-objects/{custom_object_api_name}/records/{codr_id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 204 No Content * ``` */ delete(customObjectAPIName: string, codrID: string, options?: RequestOptions): APIPromise; /** * Retrieve a specific custom object record by its external_id. * * @example SDK usage * ```ts * const customObjectDataRow = * await client.customObjects.records.retrieveByExternalID( * 'custom_object_api_name', * 'external_id', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/records/external_id/{external_id}/ 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", * "external_id": "string", * "created_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "last_modified_by": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "owner_role": { * "id": "string", * "display_value": "string", * "image": "string" * }, * "system_updated_at": "string" * } * ``` */ retrieveByExternalID(customObjectAPIName: string, externalID: string, options?: RequestOptions): APIPromise; /** * Bulk create new custom object records or update existing records by external_id. * Use stable, source-derived external IDs so retries resolve to the same records. * Creating requires create access and updating requires update access. Successful * writes return full records when permitted by read access, or ID-only receipts * otherwise. * * @example SDK usage * ```ts * const response = * await client.customObjects.records.bulkCreate( * 'custom_object_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * POST /custom-objects/{custom_object_api_name}/records/bulk/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 201 Created * Content-Type: application/json * * { * "data": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "external_id": "string", * "created_by": {}, * "last_modified_by": {}, * "owner_role": {}, * "system_updated_at": "string" * } * ] * } * ``` */ bulkCreate(customObjectAPIName: string, body?: RecordBulkCreateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Bulk update custom object records. Successful writes return full records when * permitted by read access, or ID-only receipts otherwise. * * @example SDK usage * ```ts * const response = * await client.customObjects.records.bulkUpdate( * 'custom_object_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * PATCH /custom-objects/{custom_object_api_name}/records/bulk/ 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 * * { * "data": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "external_id": "string", * "created_by": {}, * "last_modified_by": {}, * "owner_role": {}, * "system_updated_at": "string" * } * ] * } * ``` */ bulkUpdate(customObjectAPIName: string, body?: RecordBulkUpdateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Bulk delete custom object records. Returns an HTTP 200 receipt with * deleted_record_ids for applied deletions; the list may be empty. Validation, * business rules, or approvals can prevent or defer deletion. With all_or_nothing * false, some records may be deleted while others fail or await approval; inspect * the response status, receipt, and any error or approval details, including on * non-success responses. Pending approval actions are not completed deletions. * Before retrying, reconcile applied IDs and outstanding approval actions and * address failures; do not blindly retry the original batch. * * @example SDK usage * ```ts * const response = * await client.customObjects.records.bulkDelete( * 'custom_object_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * POST /custom-objects/{custom_object_api_name}/records/bulk-delete/ 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 * * { * "deleted_record_ids": [ * "string" * ] * } * ``` */ bulkDelete(customObjectAPIName: string, body?: RecordBulkDeleteParams | null | undefined, options?: RequestOptions): APIPromise; } export type CustomObjectDataRowsPageCursorURL = PageCursorURL; export interface CustomObjectDataRow { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The name of the custom object datarow */ name: string; /** * Record update date */ updated_at: string; created_by?: CustomObjectDataRow.CreatedBy; /** * The external id of the custom object datarow */ external_id?: string; last_modified_by?: CustomObjectDataRow.LastModifiedBy; owner_role?: CustomObjectDataRow.OwnerRole; /** * The timestamp when the record was last updated by the system. */ system_updated_at?: string; [k: string]: unknown; } export declare namespace CustomObjectDataRow { interface CreatedBy { /** * The unique identifier of the role. */ id?: string; /** * The display name of the role. */ display_value?: string; /** * The URL of the role's profile image. */ image?: string; } interface LastModifiedBy { /** * The unique identifier of the role. */ id?: string; /** * The display name of the role. */ display_value?: string; /** * The URL of the role's profile image. */ image?: string; } interface OwnerRole { /** * The unique identifier of the role. */ id?: string; /** * The display name of the role. */ display_value?: string; /** * The URL of the role's profile image. */ image?: string; } } export interface RecordCreateResponse { /** * A write receipt returned when the record is not visible to the caller's read * permissions. */ data?: CustomObjectDataRow | RecordCreateResponse.ID; } export declare namespace RecordCreateResponse { /** * A write receipt returned when the record is not visible to the caller's read * permissions. */ interface ID { /** * The identifier of the successfully written record. */ id: string; } } export interface RecordQueryResponse { cursor?: string; results?: Array; } export interface RecordUpdateResponse { /** * A write receipt returned when the record is not visible to the caller's read * permissions. */ data?: CustomObjectDataRow | RecordUpdateResponse.ID; } export declare namespace RecordUpdateResponse { /** * A write receipt returned when the record is not visible to the caller's read * permissions. */ interface ID { /** * The identifier of the successfully written record. */ id: string; } } export interface RecordBulkCreateResponse { data?: Array; } export declare namespace RecordBulkCreateResponse { /** * A write receipt returned when the record is not visible to the caller's read * permissions. */ interface ID { /** * The identifier of the successfully written record. */ id: string; } } export interface RecordBulkUpdateResponse { data?: Array; } export declare namespace RecordBulkUpdateResponse { /** * A write receipt returned when the record is not visible to the caller's read * permissions. */ interface ID { /** * The identifier of the successfully written record. */ id: string; } } export interface RecordBulkDeleteResponse { /** * IDs whose deletions were applied. May be empty; excludes actions awaiting * approval. */ deleted_record_ids: Array; [k: string]: unknown; } export interface RecordListParams { cursor?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; } export type RecordCreateParams = RecordCreateParams.Body; export declare namespace RecordCreateParams { /** * An object containing field values for the custom object record. A new * external_id creates a record; an existing external_id updates that record. Use a * stable, source-derived external_id to make retries resolve to the same record. */ interface Body { /** * A caller-provided identifier that creates a record when new and updates the * existing record when reused. */ external_id?: string; [k: string]: unknown; } } export interface RecordQueryParams { /** * A cursor for pagination to fetch the next page of results. */ cursor?: string; /** * The maximum number of results to return. */ limit?: number; /** * Order results by one readable field API name followed by optional asc * (ascending) or desc (descending). Direction defaults to asc; multiple fields and * nested paths are not supported. For example: name desc. Overrides search * relevance order. Reference fields use the same ordering as the Custom Object * grid. A record ID tie-breaker makes the order deterministic; traversal is not a * snapshot of concurrently changing records. Omit order_by to retain the existing * default order. Reset cursor when criteria change. Explicit null clears saved * sorting only when view_api_name is supplied. */ order_by?: string | null; /** * An optional RQL expression that filters custom object records. For example: * owner_role = "role-id" AND status\_\_c IN ["FINAL", "APPROVED"]. */ query?: string; /** * Search record names or owners. Name search uses token/prefix matching, not * arbitrary substring matching. Native exact record ID and external ID matching is * also retained. ANDed with query before pagination. Whitespace is trimmed; * omitting search or sending a blank string disables it. Some older Custom Objects * do not support search and return HTTP 400; omit search to use filters. Owner * matching uses a bounded worker search, so broad terms may not include every * matching owner. Use an owner_role query filter for an exact owner. Without * order_by, native search order applies. Repeat search, query, and order_by * unchanged when following a cursor. */ search?: string; /** * Apply an accessible saved list view discovered through the list-views API, * including its record scope and saved filter, ANDed with query. Requires * Internal_Testing, matching list-view discovery. Saved sorting applies unless * order_by overrides it; explicit null clears saved sorting. Repeat view_api_name * and criteria on every page. Changed view definitions invalidate continuation * cursors. */ view_api_name?: string; } export type RecordUpdateParams = { [key: string]: unknown; }; export interface RecordBulkCreateParams { /** * If true, the entire operation fails if any record fails. If false, partial * success is allowed. */ all_or_nothing?: boolean; /** * The list of records to create. */ rows_to_write?: Array; } export declare namespace RecordBulkCreateParams { /** * An object containing field values for the custom object record. A new * external_id creates a record; an existing external_id updates that record. */ interface RowsToWrite { /** * A caller-provided identifier that creates a record when new and updates the * existing record when reused. */ external_id?: string; [k: string]: unknown; } } export interface RecordBulkUpdateParams { /** * If true, the entire operation fails if any record fails. If false, partial * success is allowed. */ all_or_nothing?: boolean; /** * The list of records to update. */ rows_to_update?: Array; } export declare namespace RecordBulkUpdateParams { /** * An object containing the ID and field values to update for an existing custom * object record. */ interface RowsToUpdate { /** * The ID of the existing record to update. */ id: string; [k: string]: unknown; } } export interface RecordBulkDeleteParams { /** * If true, the entire operation fails if any record fails. If false, partial * success is allowed. */ all_or_nothing?: boolean; /** * A list of record IDs to delete, e.g. [id_1, id_2]. */ rows_to_delete?: Array; } export declare namespace Records { export { type CustomObjectDataRow as CustomObjectDataRow, type RecordCreateResponse as RecordCreateResponse, type RecordQueryResponse as RecordQueryResponse, type RecordUpdateResponse as RecordUpdateResponse, type RecordBulkCreateResponse as RecordBulkCreateResponse, type RecordBulkUpdateResponse as RecordBulkUpdateResponse, type RecordBulkDeleteResponse as RecordBulkDeleteResponse, type CustomObjectDataRowsPageCursorURL as CustomObjectDataRowsPageCursorURL, type RecordListParams as RecordListParams, type RecordCreateParams as RecordCreateParams, type RecordQueryParams as RecordQueryParams, type RecordUpdateParams as RecordUpdateParams, type RecordBulkCreateParams as RecordBulkCreateParams, type RecordBulkUpdateParams as RecordBulkUpdateParams, type RecordBulkDeleteParams as RecordBulkDeleteParams, }; export { Capabilities as Capabilities, type CapabilityListResponse as CapabilityListResponse }; } //# sourceMappingURL=records.d.mts.map