import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; /** * Author, publish, and install Unity Packages V2 packages */ export declare class PackageManagedInstalls extends APIResource { /** * Start installing a published managed package version asynchronously. Unmanaged * packages must use POST /package-installs/ instead. Poll GET * /package-managed-installs/{install_id}/ for completion. A post-install function * failure sets ManagedPackageInstallation.status to ACTIVE_WITH_WARNINGS with * details in warning_message. Installed components and data written by the * function are retained. Read post_install_function_error_code to classify hook * failures. When a run was created, post_install_function_api_name and * post_install_function_run_id identify its Function execution. The activity is * not automatically retried. Duplicate managed installs with the same install_key * are rejected. Managed upgrades do not rerun the hook and preserve its recorded * outcome. Versions with a post-install function run it automatically after * installation. The function runs with the installer's permissions and a token * valid for 16 minutes with scope `read write`; product permissions still apply. * * @example HTTP * Representative request and response shapes. * ``` * POST /package-managed-installs/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "install_key": "install_key", * "package_key": "package_key", * "version_id": "version_id" * } * * HTTP/1.1 202 Accepted * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "package_key": "string", * "install_key": "string", * "installed_version_id": "string", * "status": "ACTIVE", * "warning_message": "string", * "post_install_function_api_name": "string", * "post_install_function_run_id": "string", * "post_install_function_error_code": "POST_INSTALL_FUNCTION_MAPPING_MISSING", * "progress": [ * null * ], * "post_install_landing_component": {} * } * ``` */ create(body: PackageManagedInstallCreateParams, options?: RequestOptions): APIPromise; /** * Retrieve the status of a managed package install. * * @example HTTP * Representative request and response shapes. * ``` * GET /package-managed-installs/{install_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", * "package_key": "string", * "install_key": "string", * "installed_version_id": "string", * "status": "ACTIVE", * "warning_message": "string", * "post_install_function_api_name": "string", * "post_install_function_run_id": "string", * "post_install_function_error_code": "POST_INSTALL_FUNCTION_MAPPING_MISSING", * "progress": [ * null * ], * "post_install_landing_component": {} * } * ``` */ retrieve(installID: string, options?: RequestOptions): APIPromise; } /** * Living managed package install in a subscriber company. */ export interface PackageManagedInstallCreateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The install key of the managed package install */ install_key?: string; /** * The published package version currently installed or being installed */ installed_version_id?: string; /** * The package key of the managed package */ package_key?: string; /** * The installed Function's API name for retrieving its execution. Null if no hook * was attempted or for older installations. Managed names include the package and * install namespace. */ post_install_function_api_name?: string | null; /** * The last installation hook failure. Wire values start with * POST*INSTALL_FUNCTION*: MAPPING_MISSING means the installed Function mapping is * absent; DEPLOYMENT_NOT_FOUND means no deployment exists; DEPLOYMENT_FAILED means * deployment failed; DEPLOYMENT_TIMEOUT means deployment readiness timed out; * PERMISSION_DENIED means installer authorization failed; EXECUTION_FAILED means * execution failed; EXECUTION_TIMEOUT means the hook activity timed out. Null on * success, when no hook was attempted, or for older installations. Managed * upgrades do not rerun the hook and preserve this outcome. */ post_install_function_error_code?: 'POST_INSTALL_FUNCTION_MAPPING_MISSING' | 'POST_INSTALL_FUNCTION_DEPLOYMENT_NOT_FOUND' | 'POST_INSTALL_FUNCTION_DEPLOYMENT_FAILED' | 'POST_INSTALL_FUNCTION_DEPLOYMENT_TIMEOUT' | 'POST_INSTALL_FUNCTION_PERMISSION_DENIED' | 'POST_INSTALL_FUNCTION_EXECUTION_FAILED' | 'POST_INSTALL_FUNCTION_EXECUTION_TIMEOUT' | null; /** * The Function execution ID, recorded on success and failure when a run was * created. Use with post_install_function_api_name at GET * /functions/{function_api_name}/executions/{execution_id}/. Function execution * permissions still apply. Null if no run was created or for older installations. */ post_install_function_run_id?: string | null; /** * Component to open after installation completes */ post_install_landing_component?: unknown; /** * Installation progress entries */ progress?: Array; /** * Managed install status (INSTALLING, UPDATING, UNINSTALLING, ACTIVE, * ACTIVE_WITH_WARNINGS, UNINSTALLED, FAILED, or UNINSTALL_FAILED). * ACTIVE_WITH_WARNINGS means components were installed but post-processing or the * post-install function failed. Read warning_message for details. Installed * components and data written by the function are retained. */ status?: 'ACTIVE' | 'ACTIVE_WITH_WARNINGS' | 'INSTALLING' | 'UPDATING' | 'UNINSTALLING' | 'UNINSTALL_FAILED' | 'UNINSTALLED' | 'FAILED'; /** * Non-fatal warning details when status is ACTIVE_WITH_WARNINGS. Null when there * are no warnings or details were not recorded for an older installation. */ warning_message?: string | null; } /** * Living managed package install in a subscriber company. */ export interface PackageManagedInstallRetrieveResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The install key of the managed package install */ install_key?: string; /** * The published package version currently installed or being installed */ installed_version_id?: string; /** * The package key of the managed package */ package_key?: string; /** * The installed Function's API name for retrieving its execution. Null if no hook * was attempted or for older installations. Managed names include the package and * install namespace. */ post_install_function_api_name?: string | null; /** * The last installation hook failure. Wire values start with * POST*INSTALL_FUNCTION*: MAPPING_MISSING means the installed Function mapping is * absent; DEPLOYMENT_NOT_FOUND means no deployment exists; DEPLOYMENT_FAILED means * deployment failed; DEPLOYMENT_TIMEOUT means deployment readiness timed out; * PERMISSION_DENIED means installer authorization failed; EXECUTION_FAILED means * execution failed; EXECUTION_TIMEOUT means the hook activity timed out. Null on * success, when no hook was attempted, or for older installations. Managed * upgrades do not rerun the hook and preserve this outcome. */ post_install_function_error_code?: 'POST_INSTALL_FUNCTION_MAPPING_MISSING' | 'POST_INSTALL_FUNCTION_DEPLOYMENT_NOT_FOUND' | 'POST_INSTALL_FUNCTION_DEPLOYMENT_FAILED' | 'POST_INSTALL_FUNCTION_DEPLOYMENT_TIMEOUT' | 'POST_INSTALL_FUNCTION_PERMISSION_DENIED' | 'POST_INSTALL_FUNCTION_EXECUTION_FAILED' | 'POST_INSTALL_FUNCTION_EXECUTION_TIMEOUT' | null; /** * The Function execution ID, recorded on success and failure when a run was * created. Use with post_install_function_api_name at GET * /functions/{function_api_name}/executions/{execution_id}/. Function execution * permissions still apply. Null if no run was created or for older installations. */ post_install_function_run_id?: string | null; /** * Component to open after installation completes */ post_install_landing_component?: unknown; /** * Installation progress entries */ progress?: Array; /** * Managed install status (INSTALLING, UPDATING, UNINSTALLING, ACTIVE, * ACTIVE_WITH_WARNINGS, UNINSTALLED, FAILED, or UNINSTALL_FAILED). * ACTIVE_WITH_WARNINGS means components were installed but post-processing or the * post-install function failed. Read warning_message for details. Installed * components and data written by the function are retained. */ status?: 'ACTIVE' | 'ACTIVE_WITH_WARNINGS' | 'INSTALLING' | 'UPDATING' | 'UNINSTALLING' | 'UNINSTALL_FAILED' | 'UNINSTALLED' | 'FAILED'; /** * Non-fatal warning details when status is ACTIVE_WITH_WARNINGS. Null when there * are no warnings or details were not recorded for an older installation. */ warning_message?: string | null; } export interface PackageManagedInstallCreateParams { /** * The install key for this managed package install. */ install_key: string; /** * The package key of the managed package to install. */ package_key: string; /** * The published package version to install. */ version_id: string; /** * @deprecated Accepted for backward compatibility and ignored. Configured * post-install functions always run after installation. */ allow_post_install_function?: boolean; /** * Optional service-account role id. Omit it to install as the authenticated * caller. When set, the role must be a service account in the caller's company * that the caller is allowed to assume. A missing role, a role in another company, * a role that is not a service account, or a service account the caller cannot * assume returns HTTP 400. Use a service-account role id this caller is allowed to * assume. There is no public list endpoint for these ids. */ service_account_role_id?: string; } export declare namespace PackageManagedInstalls { export { type PackageManagedInstallCreateResponse as PackageManagedInstallCreateResponse, type PackageManagedInstallRetrieveResponse as PackageManagedInstallRetrieveResponse, type PackageManagedInstallCreateParams as PackageManagedInstallCreateParams, }; } //# sourceMappingURL=package-managed-installs.d.ts.map