import { APIResource } from "../../resource.js"; import * as Core from "../../core.js"; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../pagination.js"; export declare class Sinks extends APIResource { /** * Create a new Sink. * * @example * ```ts * const sink = await client.pipelines.sinks.create({ * account_id: '0123105f4ecef8ad9ca31a8372d0c353', * name: 'my_sink', * type: 'r2', * }); * ``` */ create(params: SinkCreateParams, options?: Core.RequestOptions): Core.APIPromise; /** * List/Filter Sinks in Account. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const sinkListResponse of client.pipelines.sinks.list( * { account_id: '0123105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params: SinkListParams, options?: Core.RequestOptions): Core.PagePromise; /** * Delete Pipeline in Account. * * @example * ```ts * const sink = await client.pipelines.sinks.delete( * '0223105f4ecef8ad9ca31a8372d0c353', * { account_id: '0123105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(sinkId: string, params: SinkDeleteParams, options?: Core.RequestOptions): Core.APIPromise; /** * Get Sink Details. * * @example * ```ts * const sink = await client.pipelines.sinks.get( * '0223105f4ecef8ad9ca31a8372d0c353', * { account_id: '0123105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(sinkId: string, params: SinkGetParams, options?: Core.RequestOptions): Core.APIPromise; } export declare class SinkListResponsesV4PagePaginationArray extends V4PagePaginationArray { } export interface SinkCreateResponse { /** * Indicates a unique identifier for this sink. */ id: string; created_at: string; modified_at: string; /** * Defines the name of the Sink. */ name: string; /** * Specifies the type of sink. */ type: 'r2' | 'r2_data_catalog'; /** * R2 Data Catalog Sink */ config?: SinkCreateResponse.CloudflarePipelinesR2Table | SinkCreateResponse.CloudflarePipelinesR2DataCatalogTable; format?: SinkCreateResponse.Json | SinkCreateResponse.Parquet; schema?: SinkCreateResponse.Schema; } export declare namespace SinkCreateResponse { interface CloudflarePipelinesR2Table { /** * Cloudflare Account ID for the bucket */ account_id: string; /** * R2 Bucket to write to */ bucket: string; credentials: CloudflarePipelinesR2Table.Credentials; /** * Controls filename prefix/suffix and strategy. */ file_naming?: CloudflarePipelinesR2Table.FileNaming; /** * Jurisdiction this bucket is hosted in */ jurisdiction?: string; /** * Data-layout partitioning for sinks. */ partitioning?: CloudflarePipelinesR2Table.Partitioning; /** * Subpath within the bucket to write to */ path?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2Table.RollingPolicy; } namespace CloudflarePipelinesR2Table { interface Credentials { /** * Cloudflare Account ID for the bucket */ access_key_id: string; /** * Cloudflare Account ID for the bucket */ secret_access_key: string; } /** * Controls filename prefix/suffix and strategy. */ interface FileNaming { /** * The prefix to use in file name. i.e prefix-.parquet */ prefix?: string; /** * Filename generation strategy. */ strategy?: 'serial' | 'uuid' | 'uuid_v7' | 'ulid'; /** * This will overwrite the default file suffix. i.e .parquet, use with caution */ suffix?: string; } /** * Data-layout partitioning for sinks. */ interface Partitioning { /** * The pattern of the date string */ time_pattern?: string; } /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } /** * R2 Data Catalog Sink */ interface CloudflarePipelinesR2DataCatalogTable { /** * Authentication token */ token: string; /** * Cloudflare Account ID */ account_id: string; /** * The R2 Bucket that hosts this catalog */ bucket: string; /** * Table name */ table_name: string; /** * Table namespace */ namespace?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2DataCatalogTable.RollingPolicy; } namespace CloudflarePipelinesR2DataCatalogTable { /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } interface Schema { fields?: Array; format?: Schema.Json | Schema.Parquet; inferred?: boolean | null; } namespace Schema { interface Int32 { type: 'int32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Int64 { type: 'int64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float32 { type: 'float32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float64 { type: 'float64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Bool { type: 'bool'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface String { type: 'string'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Binary { type: 'binary'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Timestamp { type: 'timestamp'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; unit?: 'second' | 'millisecond' | 'microsecond' | 'nanosecond'; } interface Json { type: 'json'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Struct { } interface List { } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } } } export interface SinkListResponse { /** * Indicates a unique identifier for this sink. */ id: string; created_at: string; modified_at: string; /** * Defines the name of the Sink. */ name: string; /** * Specifies the type of sink. */ type: 'r2' | 'r2_data_catalog'; /** * Defines the configuration of the R2 Sink. */ config?: SinkListResponse.CloudflarePipelinesR2TablePublic | SinkListResponse.CloudflarePipelinesR2DataCatalogTablePublic; format?: SinkListResponse.Json | SinkListResponse.Parquet; schema?: SinkListResponse.Schema; } export declare namespace SinkListResponse { /** * R2 Sink public configuration. */ interface CloudflarePipelinesR2TablePublic { /** * Cloudflare Account ID for the bucket */ account_id: string; /** * R2 Bucket to write to */ bucket: string; /** * Controls filename prefix/suffix and strategy. */ file_naming?: CloudflarePipelinesR2TablePublic.FileNaming; /** * Jurisdiction this bucket is hosted in */ jurisdiction?: string; /** * Data-layout partitioning for sinks. */ partitioning?: CloudflarePipelinesR2TablePublic.Partitioning; /** * Subpath within the bucket to write to */ path?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2TablePublic.RollingPolicy; } namespace CloudflarePipelinesR2TablePublic { /** * Controls filename prefix/suffix and strategy. */ interface FileNaming { /** * The prefix to use in file name. i.e prefix-.parquet */ prefix?: string; /** * Filename generation strategy. */ strategy?: 'serial' | 'uuid' | 'uuid_v7' | 'ulid'; /** * This will overwrite the default file suffix. i.e .parquet, use with caution */ suffix?: string; } /** * Data-layout partitioning for sinks. */ interface Partitioning { /** * The pattern of the date string */ time_pattern?: string; } /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } /** * R2 Data Catalog Sink public configuration. */ interface CloudflarePipelinesR2DataCatalogTablePublic { /** * Cloudflare Account ID */ account_id: string; /** * The R2 Bucket that hosts this catalog */ bucket: string; /** * Table name */ table_name: string; /** * Table namespace */ namespace?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2DataCatalogTablePublic.RollingPolicy; } namespace CloudflarePipelinesR2DataCatalogTablePublic { /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } interface Schema { fields?: Array; format?: Schema.Json | Schema.Parquet; inferred?: boolean | null; } namespace Schema { interface Int32 { type: 'int32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Int64 { type: 'int64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float32 { type: 'float32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float64 { type: 'float64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Bool { type: 'bool'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface String { type: 'string'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Binary { type: 'binary'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Timestamp { type: 'timestamp'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; unit?: 'second' | 'millisecond' | 'microsecond' | 'nanosecond'; } interface Json { type: 'json'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Struct { } interface List { } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } } } export type SinkDeleteResponse = unknown; export interface SinkGetResponse { /** * Indicates a unique identifier for this sink. */ id: string; created_at: string; modified_at: string; /** * Defines the name of the Sink. */ name: string; /** * Specifies the type of sink. */ type: 'r2' | 'r2_data_catalog'; /** * Defines the configuration of the R2 Sink. */ config?: SinkGetResponse.CloudflarePipelinesR2TablePublic | SinkGetResponse.CloudflarePipelinesR2DataCatalogTablePublic; format?: SinkGetResponse.Json | SinkGetResponse.Parquet; schema?: SinkGetResponse.Schema; } export declare namespace SinkGetResponse { /** * R2 Sink public configuration. */ interface CloudflarePipelinesR2TablePublic { /** * Cloudflare Account ID for the bucket */ account_id: string; /** * R2 Bucket to write to */ bucket: string; /** * Controls filename prefix/suffix and strategy. */ file_naming?: CloudflarePipelinesR2TablePublic.FileNaming; /** * Jurisdiction this bucket is hosted in */ jurisdiction?: string; /** * Data-layout partitioning for sinks. */ partitioning?: CloudflarePipelinesR2TablePublic.Partitioning; /** * Subpath within the bucket to write to */ path?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2TablePublic.RollingPolicy; } namespace CloudflarePipelinesR2TablePublic { /** * Controls filename prefix/suffix and strategy. */ interface FileNaming { /** * The prefix to use in file name. i.e prefix-.parquet */ prefix?: string; /** * Filename generation strategy. */ strategy?: 'serial' | 'uuid' | 'uuid_v7' | 'ulid'; /** * This will overwrite the default file suffix. i.e .parquet, use with caution */ suffix?: string; } /** * Data-layout partitioning for sinks. */ interface Partitioning { /** * The pattern of the date string */ time_pattern?: string; } /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } /** * R2 Data Catalog Sink public configuration. */ interface CloudflarePipelinesR2DataCatalogTablePublic { /** * Cloudflare Account ID */ account_id: string; /** * The R2 Bucket that hosts this catalog */ bucket: string; /** * Table name */ table_name: string; /** * Table namespace */ namespace?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2DataCatalogTablePublic.RollingPolicy; } namespace CloudflarePipelinesR2DataCatalogTablePublic { /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } interface Schema { fields?: Array; format?: Schema.Json | Schema.Parquet; inferred?: boolean | null; } namespace Schema { interface Int32 { type: 'int32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Int64 { type: 'int64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float32 { type: 'float32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float64 { type: 'float64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Bool { type: 'bool'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface String { type: 'string'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Binary { type: 'binary'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Timestamp { type: 'timestamp'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; unit?: 'second' | 'millisecond' | 'microsecond' | 'nanosecond'; } interface Json { type: 'json'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Struct { } interface List { } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } } } export interface SinkCreateParams { /** * Path param: Specifies the public ID of the account. */ account_id: string; /** * Body param: Defines the name of the Sink. */ name: string; /** * Body param: Specifies the type of sink. */ type: 'r2' | 'r2_data_catalog'; /** * Body param: Defines the configuration of the R2 Sink. */ config?: SinkCreateParams.CloudflarePipelinesR2Table | SinkCreateParams.CloudflarePipelinesR2DataCatalogTable; /** * Body param */ format?: SinkCreateParams.Json | SinkCreateParams.Parquet; /** * Body param */ schema?: SinkCreateParams.Schema; } export declare namespace SinkCreateParams { interface CloudflarePipelinesR2Table { /** * Cloudflare Account ID for the bucket */ account_id: string; /** * R2 Bucket to write to */ bucket: string; credentials: CloudflarePipelinesR2Table.Credentials; /** * Controls filename prefix/suffix and strategy. */ file_naming?: CloudflarePipelinesR2Table.FileNaming; /** * Jurisdiction this bucket is hosted in */ jurisdiction?: string; /** * Data-layout partitioning for sinks. */ partitioning?: CloudflarePipelinesR2Table.Partitioning; /** * Subpath within the bucket to write to */ path?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2Table.RollingPolicy; } namespace CloudflarePipelinesR2Table { interface Credentials { /** * Cloudflare Account ID for the bucket */ access_key_id: string; /** * Cloudflare Account ID for the bucket */ secret_access_key: string; } /** * Controls filename prefix/suffix and strategy. */ interface FileNaming { /** * The prefix to use in file name. i.e prefix-.parquet */ prefix?: string; /** * Filename generation strategy. */ strategy?: 'serial' | 'uuid' | 'uuid_v7' | 'ulid'; /** * This will overwrite the default file suffix. i.e .parquet, use with caution */ suffix?: string; } /** * Data-layout partitioning for sinks. */ interface Partitioning { /** * The pattern of the date string */ time_pattern?: string; } /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } /** * R2 Data Catalog Sink */ interface CloudflarePipelinesR2DataCatalogTable { /** * Authentication token */ token: string; /** * Cloudflare Account ID */ account_id: string; /** * The R2 Bucket that hosts this catalog */ bucket: string; /** * Table name */ table_name: string; /** * Table namespace */ namespace?: string; /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ rolling_policy?: CloudflarePipelinesR2DataCatalogTable.RollingPolicy; } namespace CloudflarePipelinesR2DataCatalogTable { /** * Rolling policy for file sinks (when & why to close a file and open a new one). */ interface RollingPolicy { /** * Files will be rolled after reaching this number of bytes */ file_size_bytes?: number; /** * Number of seconds of inactivity to wait before rolling over to a new file */ inactivity_seconds?: number; /** * Number of seconds to wait before rolling over to a new file */ interval_seconds?: number; } } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } interface Schema { fields?: Array; format?: Schema.Json | Schema.Parquet; inferred?: boolean | null; } namespace Schema { interface Int32 { type: 'int32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Int64 { type: 'int64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float32 { type: 'float32'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Float64 { type: 'float64'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Bool { type: 'bool'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface String { type: 'string'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Binary { type: 'binary'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Timestamp { type: 'timestamp'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; unit?: 'second' | 'millisecond' | 'microsecond' | 'nanosecond'; } interface Json { type: 'json'; metadata_key?: string | null; name?: string; required?: boolean; sql_name?: string; } interface Struct { } interface List { } interface Json { type: 'json'; decimal_encoding?: 'number' | 'string' | 'bytes'; timestamp_format?: 'rfc3339' | 'unix_millis'; unstructured?: boolean; } interface Parquet { type: 'parquet'; compression?: 'uncompressed' | 'snappy' | 'gzip' | 'zstd' | 'lz4'; row_group_bytes?: number | null; } } } export interface SinkListParams extends V4PagePaginationArrayParams { /** * Path param: Specifies the public ID of the account. */ account_id: string; /** * Query param */ pipeline_id?: string; } export interface SinkDeleteParams { /** * Path param: Specifies the public ID of the account. */ account_id: string; /** * Query param: Delete sink forcefully, including deleting any dependent pipelines. */ force?: string; } export interface SinkGetParams { /** * Specifies the public ID of the account. */ account_id: string; } export declare namespace Sinks { export { type SinkCreateResponse as SinkCreateResponse, type SinkListResponse as SinkListResponse, type SinkDeleteResponse as SinkDeleteResponse, type SinkGetResponse as SinkGetResponse, SinkListResponsesV4PagePaginationArray as SinkListResponsesV4PagePaginationArray, type SinkCreateParams as SinkCreateParams, type SinkListParams as SinkListParams, type SinkDeleteParams as SinkDeleteParams, type SinkGetParams as SinkGetParams, }; } //# sourceMappingURL=sinks.d.ts.map