import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; /** * Proposed changes to existing workers that can be reviewed in Rippling */ export declare class DraftTransitions extends APIResource { /** * Retrieve the current result of an asynchronously processed draft transition * request. Poll while status is ACCEPTED or PROCESSING. Other statuses are * terminal; inspect warning_items and failed_items for details. Completed drafts * still require review and application. * * @example HTTP * Representative request and response shapes. * ``` * GET /draft-transitions/{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 * * { * "request_id": "string", * "status": "ACCEPTED", * "submitted_count": 0, * "completed_count": 0, * "warning_count": 0, * "failed_count": 0, * "warning_items": [ * { * "index": 0, * "worker_id": "string", * "status": "ACCEPTED", * "warnings": [ * {} * ] * } * ], * "failed_items": [ * { * "index": 0, * "worker_id": "string", * "status": "ACCEPTED", * "errors": [ * {} * ] * } * ] * } * ``` */ retrieve(id: string, options?: RequestOptions): APIPromise; /** * Accept a batch of draft employment changes for asynchronous processing. This * creates drafts, not applied employment changes. Poll GET * /draft-transitions/{id}/ using the returned request_id until processing reaches * a terminal status; inspect warning_items and failed_items for item-level * outcomes. Reuse the same Idempotency-Key and payload when retrying. * * @example HTTP * Representative request and response shapes. * ``` * POST /draft-transitions/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * Idempotency-Key: Idempotency-Key * * { * "effective_at": "effective_at", * "items": [ * { * "changes": {}, * "worker_id": "worker_id" * } * ], * "timezone": "timezone" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "request_id": "string", * "status": "ACCEPTED", * "submitted_count": 0, * "created": false * } * ``` */ create(params: DraftTransitionCreateParams, options?: RequestOptions): APIPromise; } export interface DraftTransitionRetrieveResponse { /** * Number of completed items, including items completed with warnings. */ completed_count: number; /** * Number of failed items. */ failed_count: number; /** * Details for failed items; empty when none have failed. */ failed_items: Array; /** * Identifier of the submitted draft transition request. */ request_id: string; /** * Current processing state. Continue polling while ACCEPTED or PROCESSING. * COMPLETED, COMPLETED_WITH_WARNINGS, COMPLETED_WITH_ERRORS, and FAILED are * terminal states. */ status: 'ACCEPTED' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_WARNINGS' | 'COMPLETED_WITH_ERRORS' | 'FAILED'; /** * Total number of items accepted in the original request. */ submitted_count: number; /** * Number of items completed with warnings; these are also included in * completed_count. */ warning_count: number; /** * Details for items completed with warnings; empty when none have warnings. */ warning_items: Array; } export declare namespace DraftTransitionRetrieveResponse { interface FailedItem { /** * Errors explaining why this item failed. */ errors: Array; /** * Zero-based index of this item in the submitted items array. */ index: number; /** * Item processing state; failed items have FAILED status. */ status: 'ACCEPTED' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_WARNINGS' | 'FAILED'; /** * Target worker identifier, matching the id returned by GET /workers/{id}/. */ worker_id: string; } namespace FailedItem { interface Error { /** * Machine-readable warning or error code. */ code: string; /** * Explanation of the issue and, when applicable, how to correct it. */ message: string; /** * Path to the affected request field, when available. */ field_path?: string | null; } } interface WarningItem { /** * Zero-based index of this item in the submitted items array. */ index: number; /** * Item processing state; warning items have COMPLETED_WITH_WARNINGS status. */ status: 'ACCEPTED' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_WARNINGS' | 'FAILED'; /** * Warnings associated with this completed item. Review the draft before applying * it. */ warnings: Array; /** * Target worker identifier, matching the id returned by GET /workers/{id}/. */ worker_id: string; } namespace WarningItem { interface Warning { /** * Machine-readable warning or error code. */ code: string; /** * Explanation of the issue and, when applicable, how to correct it. */ message: string; /** * Path to the affected request field, when available. */ field_path?: string | null; } } } export interface DraftTransitionCreateResponse { /** * True for a newly accepted request; false for an idempotent replay. */ created: boolean; /** * Request identifier to poll with GET /draft-transitions/{id}/. */ request_id: string; /** * Current processing state. ACCEPTED is queued; PROCESSING is in progress. * COMPLETED, COMPLETED_WITH_WARNINGS, COMPLETED_WITH_ERRORS, and FAILED are * terminal states. */ status: 'ACCEPTED' | 'PROCESSING' | 'COMPLETED' | 'COMPLETED_WITH_WARNINGS' | 'COMPLETED_WITH_ERRORS' | 'FAILED'; /** * Number of items accepted in the original request. */ submitted_count: number; } export interface DraftTransitionCreateParams { /** * Body param: Effective timestamp applied to the entire draft transition request. */ effective_at: string; /** * Body param: Draft transition items to accept for asynchronous processing. * Maximum 500 items per request. Split larger batches into separate requests with * distinct Idempotency-Key values. */ items: Array; /** * Body param: IANA timezone used to interpret and display the request's effective * timestamp. */ timezone: string; /** * Header param: Non-empty key identifying this submission. Reuse it with the same * payload to retrieve the existing request instead of creating another. */ 'Idempotency-Key': string; } export declare namespace DraftTransitionCreateParams { interface Item { /** * Requested employment changes for this item. */ changes: Item.Changes; /** * Target worker identifier, matching the id returned by GET /workers/{id}/. */ worker_id: string; /** * Controls whether this item should append to a compatible existing draft or * create a new draft. */ draft_grouping_preference?: 'APPEND_TO_MATCHING_DRAFT' | 'CREATE_NEW_DRAFT'; } namespace Item { /** * Requested employment changes for this item. */ interface Changes { /** * Country-specific field changes supported by current draft transition flows. */ country_specific_info?: unknown; /** * Employment information changes for the target worker. */ employment_info?: Changes.EmploymentInfo; /** * Work location changes for the target worker. */ work_location_info?: Changes.WorkLocationInfo; } namespace Changes { /** * Employment information changes for the target worker. */ interface EmploymentInfo { /** * New annual salary equivalent. */ annual_salary_equivalent?: EmploymentInfo.AnnualSalaryEquivalent; /** * New compensation currency for a currency-only change. When monetary amounts are * also supplied, this must match their currency_type. All monetary fields in one * item must use the same currency. */ currency?: string; /** * New department identifier for the target worker. */ department_id?: string; /** * New company employment type identifier for the target worker. */ employment_type_id?: string; /** * New offer letter equity share count. */ equity_num_shares?: number; /** * New offer letter equity value. */ equity_value?: EmploymentInfo.EquityValue; /** * New equity vesting package identifier. */ equity_vesting_package_id?: string; /** * New job family identifier for the target worker. */ job_family_id?: string; /** * New level identifier for the target worker. */ level_id?: string; /** * New manager worker identifier, matching the id returned by GET /workers/{id}/. */ manager_id?: string; /** * New annual on-target commission amount. */ on_target_commission?: EmploymentInfo.OnTargetCommission; /** * New relocation reimbursement amount. */ relocation_reimbursement?: EmploymentInfo.RelocationReimbursement; /** * New compensation amount per salary unit. */ salary_per_unit?: EmploymentInfo.SalaryPerUnit; /** * New salary unit. */ salary_unit?: string; /** * New start date for the target worker. */ start_date?: string; /** * New target annual bonus amount. */ target_annual_bonus?: EmploymentInfo.TargetAnnualBonus; /** * New target annual bonus payment frequency. */ target_annual_bonus_payment_frequency_unit?: 'MONTH' | 'QUARTER' | 'YEAR' | 'SEMI_ANNUAL'; /** * New target annual bonus percentage. */ target_annual_bonus_percent?: number; /** * New team identifiers for the target worker. */ teams_ids?: Array; /** * New job title for the target worker. */ title?: string; } namespace EmploymentInfo { /** * New annual salary equivalent. */ interface AnnualSalaryEquivalent { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * New offer letter equity value. */ interface EquityValue { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * New annual on-target commission amount. */ interface OnTargetCommission { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * New relocation reimbursement amount. */ interface RelocationReimbursement { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * New compensation amount per salary unit. */ interface SalaryPerUnit { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * New target annual bonus amount. */ interface TargetAnnualBonus { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } } /** * Work location changes for the target worker. */ interface WorkLocationInfo { /** * New work country code for the target worker. */ country_code?: string; /** * New work location identifier for the target worker. */ location_id?: string; } } } } export declare namespace DraftTransitions { export { type DraftTransitionRetrieveResponse as DraftTransitionRetrieveResponse, type DraftTransitionCreateResponse as DraftTransitionCreateResponse, type DraftTransitionCreateParams as DraftTransitionCreateParams, }; } //# sourceMappingURL=draft-transitions.d.ts.map