import { APIResource } from "../../../core/resource.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; /** * Author, publish, and install Unity Packages V2 packages */ export declare class Versions extends APIResource { /** * Create a draft version of an existing package from a complete manifest snapshot. * The manifest does not deploy components into the source company. version_number * is unique per package. Retrying with the same version_number after a successful * creation returns 400 rather than the existing version. After an uncertain * result, list package versions and retrieve the matching version to reconcile * before retrying. * * @example HTTP * Representative request and response shapes. * ``` * POST /package-manifests/packages/{package_key}/versions/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "manifest": { * "components": [ * {} * ], * "metadata": {} * }, * "version_number": "x" * } * * HTTP/1.1 201 Created * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "package_id": "string", * "package_key": "string", * "package_display_name": "string", * "version_number": "string", * "description": "string", * "is_published": false, * "components": [ * { * "identifier": { * "type": "string", * "api_name": "string" * } * } * ], * "post_install_function": "string" * } * ``` */ create(packageKey: string, body: VersionCreateParams, options?: RequestOptions): APIPromise; } export interface VersionCreateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The semantic version number for this package version */ version_number: string; /** * Components included in this version. Function identifiers provide valid * post_install_function values. */ components?: Array; /** * The description of the package version */ description?: string; /** * Whether this package version has been published */ is_published?: boolean; /** * The display name of the parent package */ package_display_name?: string; /** * The ID of the parent package */ package_id?: string; /** * The package key of the parent package */ package_key?: string; /** * The portable API name of a Function component included in this version. Find * valid values in components entries with identifier.type equal to FUNCTION, using * identifier.api_name. Set through PATCH on an unpublished version after adding * the Function. Creation rejects this field. Null clears the hook and omission * preserves it. Removing the Function clears the setting when the version is * refreshed or copied. */ post_install_function?: string | null; } export declare namespace VersionCreateResponse { interface Component { identifier: Component.Identifier; [k: string]: unknown; } namespace Component { interface Identifier { /** * The component kind. FUNCTION identifies a packaged Function. */ type: string; /** * The portable API name. Present on FUNCTION identifiers; other component kinds * may use different identity fields. */ api_name?: string; [k: string]: unknown; } } } export interface VersionCreateParams { /** * Complete desired package component snapshot from the SDK manifest. */ manifest: VersionCreateParams.Manifest; /** * The semantic version number for the new draft version, for example 1.0.0. */ version_number: string; /** * Optional package version description, independent of manifest metadata. */ description?: string | null; } export declare namespace VersionCreateParams { /** * Complete desired package component snapshot from the SDK manifest. */ interface Manifest { /** * Complete desired component snapshot compiled from the Metadata SDK's * defineManifest. Each entry requires its component type and full configuration * for that type. An empty array creates an empty draft version; it cannot be * published until components are added. */ components: Array; /** * Source metadata from the SDK's defineManifest, retained with the snapshot. Use * an empty object when no metadata is needed; package identity is supplied * separately. */ metadata: Manifest.Metadata; /** * Must be omitted or an empty array. Versions are complete snapshots, so deletion * instructions are rejected. */ components_to_delete?: Array; } namespace Manifest { /** * Source metadata from the SDK's defineManifest, retained with the snapshot. Use * an empty object when no metadata is needed; package identity is supplied * separately. */ interface Metadata { /** * Optional description of the source manifest, independent of the version * description. */ description?: string; /** * Optional source-manifest identifier, retained on download; not the package key. */ key?: string; /** * Optional source-manifest label, retained on download; does not rename the * package. */ name?: string; } } } export declare namespace Versions { export { type VersionCreateResponse as VersionCreateResponse, type VersionCreateParams as VersionCreateParams, }; } //# sourceMappingURL=versions.d.mts.map