@distilled.cloud/tinybird 0.0.0 → 1.0.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +128 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/sdk.js +2 -0
  5. package/lib/_bundle/sdk.js.map +1 -0
  6. package/lib/credentials.d.ts +29 -0
  7. package/lib/credentials.d.ts.map +1 -0
  8. package/lib/credentials.js +1 -0
  9. package/lib/errors.d.ts +52 -0
  10. package/lib/errors.d.ts.map +1 -0
  11. package/lib/errors.js +1 -0
  12. package/lib/index.d.ts +48 -0
  13. package/lib/index.d.ts.map +1 -0
  14. package/lib/index.js +5 -0
  15. package/lib/protocol.d.ts +19 -0
  16. package/lib/protocol.d.ts.map +1 -0
  17. package/lib/protocol.js +1 -0
  18. package/lib/retry.d.ts +50 -0
  19. package/lib/retry.d.ts.map +1 -0
  20. package/lib/retry.js +1 -0
  21. package/lib/services/analyze.d.ts +17 -0
  22. package/lib/services/analyze.d.ts.map +1 -0
  23. package/lib/services/analyze.js +2 -0
  24. package/lib/services/analyze.js.map +1 -0
  25. package/lib/services/api_endpoints.d.ts +26 -0
  26. package/lib/services/api_endpoints.d.ts.map +1 -0
  27. package/lib/services/api_endpoints.js +2 -0
  28. package/lib/services/api_endpoints.js.map +1 -0
  29. package/lib/services/copy_pipes.d.ts +102 -0
  30. package/lib/services/copy_pipes.d.ts.map +1 -0
  31. package/lib/services/copy_pipes.js +2 -0
  32. package/lib/services/copy_pipes.js.map +1 -0
  33. package/lib/services/datasource.d.ts +171 -0
  34. package/lib/services/datasource.d.ts.map +1 -0
  35. package/lib/services/datasource.js +2 -0
  36. package/lib/services/datasource.js.map +1 -0
  37. package/lib/services/environment_variables.d.ts +61 -0
  38. package/lib/services/environment_variables.d.ts.map +1 -0
  39. package/lib/services/environment_variables.js +2 -0
  40. package/lib/services/environment_variables.js.map +1 -0
  41. package/lib/services/events.d.ts +21 -0
  42. package/lib/services/events.d.ts.map +1 -0
  43. package/lib/services/events.js +2 -0
  44. package/lib/services/events.js.map +1 -0
  45. package/lib/services/index.d.ts +14 -0
  46. package/lib/services/index.d.ts.map +1 -0
  47. package/lib/services/index.js +13 -0
  48. package/lib/services/jobs.d.ts +45 -0
  49. package/lib/services/jobs.d.ts.map +1 -0
  50. package/lib/services/jobs.js +2 -0
  51. package/lib/services/jobs.js.map +1 -0
  52. package/lib/services/materialized_views.d.ts +64 -0
  53. package/lib/services/materialized_views.d.ts.map +1 -0
  54. package/lib/services/materialized_views.js +2 -0
  55. package/lib/services/materialized_views.js.map +1 -0
  56. package/lib/services/organizations.d.ts +214 -0
  57. package/lib/services/organizations.d.ts.map +1 -0
  58. package/lib/services/organizations.js +2 -0
  59. package/lib/services/organizations.js.map +1 -0
  60. package/lib/services/pipe.d.ts +243 -0
  61. package/lib/services/pipe.d.ts.map +1 -0
  62. package/lib/services/pipe.js +2 -0
  63. package/lib/services/pipe.js.map +1 -0
  64. package/lib/services/query.d.ts +50 -0
  65. package/lib/services/query.d.ts.map +1 -0
  66. package/lib/services/query.js +2 -0
  67. package/lib/services/query.js.map +1 -0
  68. package/lib/services/sink_pipes.d.ts +95 -0
  69. package/lib/services/sink_pipes.d.ts.map +1 -0
  70. package/lib/services/sink_pipes.js +2 -0
  71. package/lib/services/sink_pipes.js.map +1 -0
  72. package/lib/services/token.d.ts +107 -0
  73. package/lib/services/token.d.ts.map +1 -0
  74. package/lib/services/token.js +2 -0
  75. package/lib/services/token.js.map +1 -0
  76. package/lib/services.lazy/analyze.js +1 -0
  77. package/lib/services.lazy/api_endpoints.js +1 -0
  78. package/lib/services.lazy/copy_pipes.js +1 -0
  79. package/lib/services.lazy/datasource.js +1 -0
  80. package/lib/services.lazy/environment_variables.js +1 -0
  81. package/lib/services.lazy/events.js +1 -0
  82. package/lib/services.lazy/index.js +3 -0
  83. package/lib/services.lazy/jobs.js +1 -0
  84. package/lib/services.lazy/materialized_views.js +1 -0
  85. package/lib/services.lazy/organizations.js +1 -0
  86. package/lib/services.lazy/pipe.js +1 -0
  87. package/lib/services.lazy/query.js +1 -0
  88. package/lib/services.lazy/sink_pipes.js +1 -0
  89. package/lib/services.lazy/token.js +1 -0
  90. package/lib/traits.d.ts +10 -0
  91. package/lib/traits.d.ts.map +1 -0
  92. package/lib/traits.js +1 -0
  93. package/package.json +76 -2
  94. package/src/credentials.ts +76 -0
  95. package/src/errors.ts +83 -0
  96. package/src/index.ts +47 -0
  97. package/src/protocol.ts +48 -0
  98. package/src/retry.ts +69 -0
  99. package/src/services/analyze.ts +75 -0
  100. package/src/services/api_endpoints.ts +115 -0
  101. package/src/services/copy_pipes.ts +315 -0
  102. package/src/services/datasource.ts +438 -0
  103. package/src/services/environment_variables.ts +213 -0
  104. package/src/services/events.ts +86 -0
  105. package/src/services/index.ts +14 -0
  106. package/src/services/jobs.ts +156 -0
  107. package/src/services/materialized_views.ts +200 -0
  108. package/src/services/organizations.ts +552 -0
  109. package/src/services/pipe.ts +700 -0
  110. package/src/services/query.ts +150 -0
  111. package/src/services/sink_pipes.ts +295 -0
  112. package/src/services/token.ts +359 -0
  113. package/src/traits.ts +47 -0
@@ -0,0 +1,150 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import { BinaryStream } from "@distilled.cloud/core/protocol-rest";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-tinybird/specs/api-reference). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import { TinybirdServiceErrors } from "../errors.ts";
7
+ import { TinybirdProtocol, type TinybirdOpError, type TinybirdOpContext } from "../protocol.ts";
8
+ import * as Retry from "../retry.ts";
9
+ import * as T from "../traits.ts";
10
+ // Schema table, filled on first reach (see __S at the end).
11
+ const __s: any[] = [];
12
+
13
+ export type { TinybirdOpError, TinybirdOpContext };
14
+
15
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
16
+ const TELEMETRY = {
17
+ system: "tinybird-api",
18
+ responseHeaders: [
19
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
20
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
21
+ ],
22
+ prefix: "Tinybird",
23
+ service: "Query",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface QuerySqlRequest {
28
+ /** The SQL query */
29
+ q: string;
30
+ /** (Optional) The name of the pipe. It allows writing a query like 'SELECT * FROM _' where '_' is a placeholder for the 'pipeline' parameter */
31
+ pipeline?: string | undefined;
32
+ /** (Optional) When set to 'true', returns EXPLAIN output for the query instead of executing it. Default value is 'false' */
33
+ explain?: string | undefined;
34
+ /** (Optional) Comma-separated key=value pairs controlling EXPLAIN output. Allowed keys: actions, column_structure, description, distributed, header, indexes, input_headers, json, projections. Each value is 0 or 1. Example: indexes=1,actions=1. When empty, defaults to indexes=1 */
35
+ explain_settings?: string | undefined;
36
+ /** (Optional) Controls quoting of 64-bit or bigger integers (like UInt64 or Int128) when they are output in a JSON format. Such integers are enclosed in quotes by default. This behavior is compatible with most JavaScript implementations. Possible values: 0 -- Integers are output without quotes. 1 -- Integers are enclosed in quotes. Default value is 0 */
37
+ output_format_json_quote_64bit_integers?: number | undefined;
38
+ /** (Optional) Controls representation of inf and nan on the UI instead of null e.g when dividing by 0 - inf and when there is no representation of a number in Javascript - nan. Possible values: 0 - disabled, 1 - enabled. Default value is 0 */
39
+ output_format_json_quote_denormals?: number | undefined;
40
+ /** (Optional) Use Parquet String type instead of Binary for String columns. Possible values: 0 - disabled, 1 - enabled. Default value is 0 */
41
+ output_format_parquet_string_as_string?: number | undefined;
42
+ }
43
+ export interface QuerySqlResponse {
44
+ body: BinaryStream;
45
+ /** Media type of the body, from the response's `Content-Type` header (e.g. `image/jpeg`). */
46
+ contentType?: string | undefined;
47
+ }
48
+ export interface QuerySqlWithBodyRequest {
49
+ /** (Optional) The name of the pipe. It allows writing a query like 'SELECT * FROM _' where '_' is a placeholder for the 'pipeline' parameter */
50
+ pipeline?: string | undefined;
51
+ /** (Optional) Controls quoting of 64-bit or bigger integers (like UInt64 or Int128) when they are output in a JSON format. Such integers are enclosed in quotes by default. This behavior is compatible with most JavaScript implementations. Possible values: 0 -- Integers are output without quotes. 1 -- Integers are enclosed in quotes. Default value is 0 */
52
+ output_format_json_quote_64bit_integers?: number | undefined;
53
+ /** (Optional) Controls representation of inf and nan on the UI instead of null e.g when dividing by 0 - inf and when there is no representation of a number in Javascript - nan. Possible values: 0 - disabled, 1 - enabled. Default value is 0 */
54
+ output_format_json_quote_denormals?: number | undefined;
55
+ /** (Optional) Use Parquet String type instead of Binary for String columns. Possible values: 0 - disabled, 1 - enabled. Default value is 0 */
56
+ output_format_parquet_string_as_string?: number | undefined;
57
+ /** The SQL query, templated or not. Template parameters go beside it as extra keys. */
58
+ q: string;
59
+ [key: string]: unknown;
60
+ }
61
+ export interface QuerySqlWithBodyResponse {
62
+ body: BinaryStream;
63
+ /** Media type of the body, from the response's `Content-Type` header (e.g. `image/jpeg`). */
64
+ contentType?: string | undefined;
65
+ }
66
+ export type QuerySqlError = TinybirdOpError;
67
+ /** Executes a SQL query using the engine. As a response, it gives you the query metadata, the resulting data and some performance statistics. Data can be fetched in different formats. Just append `FORMAT <format_name>` to your SQL query: As you can see in the example above, timestamps do not include a time zone in their serialization. Let's see how that relates to timestamps ingested from your original data: - If the original timestamp had no time zone associated, you'll read back the same date and time verbatim. If you ingested the timestamp `2022-11-14 11:08:46`, for example, Tinybird sends `"2022-11-14 11:08:46"` back. This is so regardless of the time zone of the column in ClickHouse. - If the original timestamp had a time zone associated, you'll read back the corresponding date and time in the time zone of the destination column in ClickHouse, which is UTC by default. If you ingested `2022-11-14 12:08:46.574295 +0100`, for instance, Tinybird sends `"2022-11-14 11:08:46"` back for a `DateTime`, and `"2022-11-14 06:08:46"` for a `DateTime('America/New_York')`. Reference: https://www.tinybird.co/docs/api-reference/query-api */
68
+ export const querySql: API.OperationMethod<
69
+ QuerySqlRequest,
70
+ QuerySqlResponse,
71
+ QuerySqlError,
72
+ TinybirdOpContext
73
+ > = /*@__PURE__*/ API.make(() => ({
74
+ input: __S(0, __c0, 0) as any as S.Schema<QuerySqlRequest>,
75
+ output: __S(2, __c1, 0) as any as S.Schema<QuerySqlResponse>,
76
+ errors: [],
77
+ serviceErrors: TinybirdServiceErrors,
78
+ protocol: TinybirdProtocol,
79
+ retry: Retry.Retry,
80
+ telemetry: TELEMETRY,
81
+ span: "QuerySql",
82
+ }));
83
+
84
+ export type QuerySqlWithBodyError = TinybirdOpError;
85
+ /** Executes a SQL query using the engine, while providing a templated or non templated query string and the custom parameters that will be translated into the query. The custom parameters provided should not have the same name as the request parameters for this endpoint (outlined below), as they are reserved in order to get accurate results for your query. As a response, it gives you the query metadata, the resulting data and some performance statistics. Data can be fetched in different formats. Just append `FORMAT <format_name>` to your SQL query: As you can see in the example above, timestamps do not include a time zone in their serialization. Let's see how that relates to timestamps ingested from your original data: - If the original timestamp had no time zone associated, you'll read back the same date and time verbatim. If you ingested the timestamp `2022-11-14 11:08:46`, for example, Tinybird sends `"2022-11-14 11:08:46"` back. This is so regardless of the time zone of the column in ClickHouse. - If the original timestamp had a time zone associated, you'll read back the corresponding date and time in the time zone of the destination column in ClickHouse, which is UTC by default. If you ingested `2022-11-14 12:08:46.574295 +0100`, for instance, Tinybird sends `"2022-11-14 11:08:46"` back for a `DateTime`, and `"2022-11-14 06:08:46"` for a `DateTime('America/New_York')`. Reference: https://www.tinybird.co/docs/api-reference/query-api */
86
+ export const querySqlWithBody: API.OperationMethod<
87
+ QuerySqlWithBodyRequest,
88
+ QuerySqlWithBodyResponse,
89
+ QuerySqlWithBodyError,
90
+ TinybirdOpContext
91
+ > = /*@__PURE__*/ API.make(() => ({
92
+ input: __S(4, __c2, 0) as any as S.Schema<QuerySqlWithBodyRequest>,
93
+ output: __S(2, __c1, 0) as any as S.Schema<QuerySqlWithBodyResponse>,
94
+ errors: [],
95
+ serviceErrors: TinybirdServiceErrors,
96
+ protocol: TinybirdProtocol,
97
+ retry: Retry.Retry,
98
+ telemetry: TELEMETRY,
99
+ span: "QuerySqlWithBody",
100
+ }));
101
+
102
+ // Schema builders: each runs one schema initializer, on that schema's first use.
103
+ function __c0(j: number): any {
104
+ switch (j) {
105
+ case 0:
106
+ return S.suspend(() =>
107
+ S.Struct({
108
+ q: S.String.pipe(T.Query()),
109
+ pipeline: S.optional(S.String.pipe(T.Query())),
110
+ explain: S.optional(S.String.pipe(T.Query())),
111
+ explain_settings: S.optional(S.String.pipe(T.Query())),
112
+ output_format_json_quote_64bit_integers: S.optional(S.Number.pipe(T.Query())),
113
+ output_format_json_quote_denormals: S.optional(S.Number.pipe(T.Query())),
114
+ output_format_parquet_string_as_string: S.optional(S.Number.pipe(T.Query())),
115
+ }).pipe(T.Http({ method: "GET", uri: "/v0/sql", code: 200 })),
116
+ ).annotate({ identifier: "QuerySqlRequest" });
117
+ }
118
+ }
119
+ function __c1(j: number): any {
120
+ switch (j) {
121
+ case 0:
122
+ return S.suspend(() =>
123
+ S.Struct({
124
+ body: BinaryStream.pipe(T.RawResponse(), T.BinaryResponse()),
125
+ contentType: S.optional(S.String.pipe(T.Header("Content-Type"))),
126
+ }),
127
+ ).annotate({ identifier: "QuerySqlResponse" });
128
+ }
129
+ }
130
+ function __c2(j: number): any {
131
+ switch (j) {
132
+ case 0:
133
+ return S.suspend(() =>
134
+ S.StructWithRest(
135
+ S.Struct({
136
+ pipeline: S.optional(S.String.pipe(T.Query())),
137
+ output_format_json_quote_64bit_integers: S.optional(S.Number.pipe(T.Query())),
138
+ output_format_json_quote_denormals: S.optional(S.Number.pipe(T.Query())),
139
+ output_format_parquet_string_as_string: S.optional(S.Number.pipe(T.Query())),
140
+ q: S.String,
141
+ }),
142
+ [S.Record(S.String, S.Unknown)],
143
+ ).pipe(T.Http({ method: "POST", uri: "/v0/sql", code: 200 })),
144
+ ).annotate({ identifier: "QuerySqlWithBodyRequest" });
145
+ }
146
+ }
147
+ // Schema table: entry i is schema j of builder f, made on first reach.
148
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
149
+ return (__s[i] ??= __L.at(f, j));
150
+ }
@@ -0,0 +1,295 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-tinybird/specs/api-reference). Do not edit.
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
5
+ import { TinybirdServiceErrors } from "../errors.ts";
6
+ import { TinybirdProtocol, type TinybirdOpError, type TinybirdOpContext } from "../protocol.ts";
7
+ import * as Retry from "../retry.ts";
8
+ import * as T from "../traits.ts";
9
+ // Schema table, filled on first reach (see __S at the end).
10
+ const __s: any[] = [];
11
+
12
+ export type { TinybirdOpError, TinybirdOpContext };
13
+
14
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
15
+ const TELEMETRY = {
16
+ system: "tinybird-api",
17
+ responseHeaders: [
18
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
19
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
20
+ ],
21
+ prefix: "Tinybird",
22
+ service: "SinkPipes",
23
+ labels: "tinybird",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface CreatePipeNodeSinkRequest {
28
+ pipe_id: string;
29
+ node_id: string;
30
+ /** Name of the connection to holding the credentials to run the sink */
31
+ connection?: string | undefined;
32
+ /** Object store prefix into which the sink writes data */
33
+ path?: string | undefined;
34
+ /** File template string. See [file template](/classic/publish-data/sinks/s3-sink#file-template) for more details */
35
+ file_template?: string | undefined;
36
+ /** Optional. Format of the exported files. Default: CSV */
37
+ format?: string | undefined;
38
+ /** Optional. Compression of the output files. Default: None */
39
+ compression?: string | undefined;
40
+ /** Optional. The sink's execution schedule, in crontab format. */
41
+ schedule_cron?: string | undefined;
42
+ /** Optional. Sink service. Set to `kafka` to create a Kafka Sink; otherwise the Sink writes to object storage. */
43
+ service?: string | undefined;
44
+ /** Optional. Kafka topic to write to. Used by Kafka Sinks. */
45
+ topic?: string | undefined;
46
+ /** Optional. Default: `false`. Set to `true` to skip the validation of the Node SQL when creating the Sink. */
47
+ ignore_sql_errors?: boolean | undefined;
48
+ /** Optional. Default: `false`. Set to `true` to validate the request without creating the Sink. Returns `{"dry_run_passed": true}`. */
49
+ dry_run?: boolean | undefined;
50
+ /** Optional. Default: `create_new`. The sink's write strategy for filenames already existing in the bucket. Values: `create_new`, `replace`; `create_new` adds a new file with a suffix, while `replace` replaces the existent file. The legacy values `new` and `truncate` are still accepted. */
51
+ write_strategy?: string | undefined;
52
+ }
53
+ export type CreatePipeNodeSinkResponseBodyMap = { [key: string]: unknown | undefined };
54
+ export type CreatePipeNodeSinkResponse = CreatePipeNodeSinkResponseBodyMap;
55
+ export interface DeletePipeNodeSinkRequest {
56
+ pipe_id: string;
57
+ node_id: string;
58
+ }
59
+ export type DeletePipeNodeSinkResponseBodyMap = { [key: string]: unknown | undefined };
60
+ export type DeletePipeNodeSinkResponse = DeletePipeNodeSinkResponseBodyMap;
61
+ export interface GetS3SettingsRequest {}
62
+ export type GetS3SettingsResponseBodyMap = { [key: string]: unknown | undefined };
63
+ export type GetS3SettingsResponse = GetS3SettingsResponseBodyMap;
64
+ export interface GetS3TrustPolicyRequest {}
65
+ export type GetS3TrustPolicyResponseBodyMap = { [key: string]: unknown | undefined };
66
+ export type GetS3TrustPolicyResponse = GetS3TrustPolicyResponseBodyMap;
67
+ export interface GetS3WriteAccessPolicyRequest {
68
+ /** Bucket to use for rendering the template. If not provided the '<bucket>' placeholder is used */
69
+ bucket?: string | undefined;
70
+ }
71
+ export type GetS3WriteAccessPolicyResponseBodyMap = { [key: string]: unknown | undefined };
72
+ export type GetS3WriteAccessPolicyResponse = GetS3WriteAccessPolicyResponseBodyMap;
73
+ export interface TriggerPipeSinkRequest {
74
+ pipe_id: string;
75
+ /** File template string. See [file template](/classic/publish-data/sinks/s3-sink#file-template) for more details */
76
+ file_template?: string | undefined;
77
+ /** Optional. Format of the exported files. Default: CSV */
78
+ format?: string | undefined;
79
+ /** Optional. Compression of the output files. Default: None */
80
+ compression?: string | undefined;
81
+ /** Optional. The sink's write strategy for filenames already existing in the bucket. Values: `create_new`, `replace`; `create_new` adds a new file with a suffix, while `replace` replaces the existent file. The legacy values `new` and `truncate` are still accepted. */
82
+ write_strategy?: string | undefined;
83
+ }
84
+ export type TriggerPipeSinkResponseBodyMap = { [key: string]: unknown | undefined };
85
+ export type TriggerPipeSinkResponse = TriggerPipeSinkResponseBodyMap;
86
+ export type CreatePipeNodeSinkError = TinybirdOpError;
87
+ /** Set the Pipe as a Sink Pipe, optionally scheduled. Required token permission is `PIPES:CREATE`. - You can set only one schedule per Sink Pipe. - You can't set a Sink Pipe if the Pipe is already materializing. You must unlink the Materialization first. - You can't set a Sink Pipe if the Pipe is already an API Endpoint. You must unpublish the Endpoint first. - You can't set a Sink Pipe if the Pipe is already copying. You must unset the copy first. - Sink Pipes aren't available on the Free plan. The request returns a `400` error. - In Tinybird Forward, this endpoint returns a `403` error. Define Sink Pipes in your datafiles and deploy them. Reference: https://www.tinybird.co/docs/api-reference/sink-pipes-api */
88
+ export const createPipeNodeSink: API.OperationMethod<
89
+ CreatePipeNodeSinkRequest,
90
+ CreatePipeNodeSinkResponse,
91
+ CreatePipeNodeSinkError,
92
+ TinybirdOpContext
93
+ > = /*@__PURE__*/ API.make(() => ({
94
+ input: __S(0, __c0, 0) as any as S.Schema<CreatePipeNodeSinkRequest>,
95
+ output: __S(3, __c1, 1) as any as S.Schema<CreatePipeNodeSinkResponse>,
96
+ errors: [],
97
+ serviceErrors: TinybirdServiceErrors,
98
+ protocol: TinybirdProtocol,
99
+ retry: Retry.Retry,
100
+ telemetry: TELEMETRY,
101
+ span: "CreatePipeNodeSink",
102
+ }));
103
+
104
+ export type DeletePipeNodeSinkError = TinybirdOpError;
105
+ /** Removes the Sink from the Pipe. This doesn't delete the Pipe nor the Node, only the sink configuration and any associated settings. Reference: https://www.tinybird.co/docs/api-reference/sink-pipes-api */
106
+ export const deletePipeNodeSink: API.OperationMethod<
107
+ DeletePipeNodeSinkRequest,
108
+ DeletePipeNodeSinkResponse,
109
+ DeletePipeNodeSinkError,
110
+ TinybirdOpContext
111
+ > = /*@__PURE__*/ API.make(() => ({
112
+ input: __S(4, __c2, 0) as any as S.Schema<DeletePipeNodeSinkRequest>,
113
+ output: __S(3, __c1, 1) as any as S.Schema<DeletePipeNodeSinkResponse>,
114
+ errors: [],
115
+ serviceErrors: TinybirdServiceErrors,
116
+ protocol: TinybirdProtocol,
117
+ retry: Retry.Retry,
118
+ telemetry: TELEMETRY,
119
+ span: "DeletePipeNodeSink",
120
+ }));
121
+
122
+ export type GetS3SettingsError = TinybirdOpError;
123
+ /** Retrieves the settings to attach to the IAM role used for the connection. External IDs differ for each Workspace but are shared between Branches of the same Workspace, so you don't need to generate specific IAM roles for each Branch. Reference: https://www.tinybird.co/docs/api-reference/sink-pipes-api */
124
+ export const getS3Settings: API.OperationMethod<
125
+ GetS3SettingsRequest,
126
+ GetS3SettingsResponse,
127
+ GetS3SettingsError,
128
+ TinybirdOpContext
129
+ > = /*@__PURE__*/ API.make(() => ({
130
+ input: __S(6, __c3, 0) as any as S.Schema<GetS3SettingsRequest>,
131
+ output: __S(3, __c1, 1) as any as S.Schema<GetS3SettingsResponse>,
132
+ errors: [],
133
+ serviceErrors: TinybirdServiceErrors,
134
+ protocol: TinybirdProtocol,
135
+ retry: Retry.Retry,
136
+ telemetry: TELEMETRY,
137
+ span: "GetS3Settings",
138
+ }));
139
+
140
+ export type GetS3TrustPolicyError = TinybirdOpError;
141
+ /** Retrieves the trust policy to attach to the IAM role used for the connection. External IDs differ for each Workspace but are shared between Branches of the same Workspace, so you don't need to change the trust policy for each Branch. Reference: https://www.tinybird.co/docs/api-reference/sink-pipes-api */
142
+ export const getS3TrustPolicy: API.OperationMethod<
143
+ GetS3TrustPolicyRequest,
144
+ GetS3TrustPolicyResponse,
145
+ GetS3TrustPolicyError,
146
+ TinybirdOpContext
147
+ > = /*@__PURE__*/ API.make(() => ({
148
+ input: __S(8, __c4, 0) as any as S.Schema<GetS3TrustPolicyRequest>,
149
+ output: __S(3, __c1, 1) as any as S.Schema<GetS3TrustPolicyResponse>,
150
+ errors: [],
151
+ serviceErrors: TinybirdServiceErrors,
152
+ protocol: TinybirdProtocol,
153
+ retry: Retry.Retry,
154
+ telemetry: TELEMETRY,
155
+ span: "GetS3TrustPolicy",
156
+ }));
157
+
158
+ export type GetS3WriteAccessPolicyError = TinybirdOpError;
159
+ /** Retrieves the trust policy to attach to the IAM role used for the connection. External IDs differ for each Workspace but are shared between Branches of the same Workspace, so you don't need to change the trust policy for each Branch. Reference: https://www.tinybird.co/docs/api-reference/sink-pipes-api */
160
+ export const getS3WriteAccessPolicy: API.OperationMethod<
161
+ GetS3WriteAccessPolicyRequest,
162
+ GetS3WriteAccessPolicyResponse,
163
+ GetS3WriteAccessPolicyError,
164
+ TinybirdOpContext
165
+ > = /*@__PURE__*/ API.make(() => ({
166
+ input: __S(10, __c5, 0) as any as S.Schema<GetS3WriteAccessPolicyRequest>,
167
+ output: __S(3, __c1, 1) as any as S.Schema<GetS3WriteAccessPolicyResponse>,
168
+ errors: [],
169
+ serviceErrors: TinybirdServiceErrors,
170
+ protocol: TinybirdProtocol,
171
+ retry: Retry.Retry,
172
+ telemetry: TELEMETRY,
173
+ span: "GetS3WriteAccessPolicy",
174
+ }));
175
+
176
+ export type TriggerPipeSinkError = TinybirdOpError;
177
+ /** Triggers the Sink Pipe and creates a sink job. You can override some sink settings for this execution. Reference: https://www.tinybird.co/docs/api-reference/sink-pipes-api */
178
+ export const triggerPipeSink: API.OperationMethod<
179
+ TriggerPipeSinkRequest,
180
+ TriggerPipeSinkResponse,
181
+ TriggerPipeSinkError,
182
+ TinybirdOpContext
183
+ > = /*@__PURE__*/ API.make(() => ({
184
+ input: __S(12, __c6, 0) as any as S.Schema<TriggerPipeSinkRequest>,
185
+ output: __S(3, __c1, 1) as any as S.Schema<TriggerPipeSinkResponse>,
186
+ errors: [],
187
+ serviceErrors: TinybirdServiceErrors,
188
+ protocol: TinybirdProtocol,
189
+ retry: Retry.Retry,
190
+ telemetry: TELEMETRY,
191
+ span: "TriggerPipeSink",
192
+ }));
193
+
194
+ // Schema builders: each runs one schema initializer, on that schema's first use.
195
+ function __c0(j: number): any {
196
+ switch (j) {
197
+ case 0:
198
+ return S.suspend(() =>
199
+ S.Struct({
200
+ pipe_id: S.String.pipe(T.Label()),
201
+ node_id: S.String.pipe(T.Label()),
202
+ connection: S.optional(S.String.pipe(T.Query())),
203
+ path: S.optional(S.String.pipe(T.Query())),
204
+ file_template: S.optional(S.String.pipe(T.Query())),
205
+ format: S.optional(S.String.pipe(T.Query())),
206
+ compression: S.optional(S.String.pipe(T.Query())),
207
+ schedule_cron: S.optional(S.String.pipe(T.Query())),
208
+ service: S.optional(S.String.pipe(T.Query())),
209
+ topic: S.optional(S.String.pipe(T.Query())),
210
+ ignore_sql_errors: S.optional(S.Boolean.pipe(T.Query())),
211
+ dry_run: S.optional(S.Boolean.pipe(T.Query())),
212
+ write_strategy: S.optional(S.String.pipe(T.Query())),
213
+ }).pipe(
214
+ T.Http({ method: "POST", uri: "/v0/pipes/{pipe_id}/nodes/{node_id}/sink", code: 200 }),
215
+ ),
216
+ ).annotate({ identifier: "CreatePipeNodeSinkRequest" });
217
+ }
218
+ }
219
+ function __c1(j: number): any {
220
+ switch (j) {
221
+ case 0:
222
+ return S.Record(S.String, S.Unknown);
223
+ case 1:
224
+ return S.suspend(() => __S(2, __c1, 0).pipe(T.RawResponseRoot())).annotate({
225
+ identifier: "CreatePipeNodeSinkResponse",
226
+ });
227
+ }
228
+ }
229
+ function __c2(j: number): any {
230
+ switch (j) {
231
+ case 0:
232
+ return S.suspend(() =>
233
+ S.Struct({
234
+ pipe_id: S.String.pipe(T.Label()),
235
+ node_id: S.String.pipe(T.Label()),
236
+ }).pipe(
237
+ T.Http({ method: "DELETE", uri: "/v0/pipes/{pipe_id}/nodes/{node_id}/sink", code: 200 }),
238
+ ),
239
+ ).annotate({ identifier: "DeletePipeNodeSinkRequest" });
240
+ }
241
+ }
242
+ function __c3(j: number): any {
243
+ switch (j) {
244
+ case 0:
245
+ return S.suspend(() =>
246
+ S.Struct({}).pipe(
247
+ T.Http({ method: "GET", uri: "/v0/integrations/s3/settings", code: 200 }),
248
+ ),
249
+ ).annotate({ identifier: "GetS3SettingsRequest" });
250
+ }
251
+ }
252
+ function __c4(j: number): any {
253
+ switch (j) {
254
+ case 0:
255
+ return S.suspend(() =>
256
+ S.Struct({}).pipe(
257
+ T.Http({ method: "GET", uri: "/v0/integrations/s3/policies/trust-policy", code: 200 }),
258
+ ),
259
+ ).annotate({ identifier: "GetS3TrustPolicyRequest" });
260
+ }
261
+ }
262
+ function __c5(j: number): any {
263
+ switch (j) {
264
+ case 0:
265
+ return S.suspend(() =>
266
+ S.Struct({
267
+ bucket: S.optional(S.String.pipe(T.Query())),
268
+ }).pipe(
269
+ T.Http({
270
+ method: "GET",
271
+ uri: "/v0/integrations/s3/policies/write-access-policy",
272
+ code: 200,
273
+ }),
274
+ ),
275
+ ).annotate({ identifier: "GetS3WriteAccessPolicyRequest" });
276
+ }
277
+ }
278
+ function __c6(j: number): any {
279
+ switch (j) {
280
+ case 0:
281
+ return S.suspend(() =>
282
+ S.Struct({
283
+ pipe_id: S.String.pipe(T.Label()),
284
+ file_template: S.optional(S.String.pipe(T.Query())),
285
+ format: S.optional(S.String.pipe(T.Query())),
286
+ compression: S.optional(S.String.pipe(T.Query())),
287
+ write_strategy: S.optional(S.String.pipe(T.Query())),
288
+ }).pipe(T.Http({ method: "POST", uri: "/v0/pipes/{pipe_id}/sink", code: 200 })),
289
+ ).annotate({ identifier: "TriggerPipeSinkRequest" });
290
+ }
291
+ }
292
+ // Schema table: entry i is schema j of builder f, made on first reach.
293
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
294
+ return (__s[i] ??= __L.at(f, j));
295
+ }