@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,115 @@
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: "ApiEndpoints",
23
+ labels: "tinybird",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface CreatePipeNodeEndpointRequest {
28
+ pipe: string;
29
+ node: string;
30
+ }
31
+ export type CreatePipeNodeEndpointResponseBodyMap = { [key: string]: unknown | undefined };
32
+ export type CreatePipeNodeEndpointResponse = CreatePipeNodeEndpointResponseBodyMap;
33
+ export interface DeletePipeNodeEndpointRequest {
34
+ pipe: string;
35
+ node: string;
36
+ }
37
+ export type DeletePipeNodeEndpointResponseBodyMap = { [key: string]: unknown | undefined };
38
+ export type DeletePipeNodeEndpointResponse = DeletePipeNodeEndpointResponseBodyMap;
39
+ export type CreatePipeNodeEndpointError = TinybirdOpError;
40
+ /** Publishes an API endpoint The response will contain a `token` if there's a **unique READ token** for this pipe. You could use this token to share your endpoint. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/api-endpoints */
41
+ export const createPipeNodeEndpoint: API.OperationMethod<
42
+ CreatePipeNodeEndpointRequest,
43
+ CreatePipeNodeEndpointResponse,
44
+ CreatePipeNodeEndpointError,
45
+ TinybirdOpContext
46
+ > = /*@__PURE__*/ API.make(() => ({
47
+ input: __S(0, __c0, 0) as any as S.Schema<CreatePipeNodeEndpointRequest>,
48
+ output: __S(3, __c1, 1) as any as S.Schema<CreatePipeNodeEndpointResponse>,
49
+ errors: [],
50
+ serviceErrors: TinybirdServiceErrors,
51
+ protocol: TinybirdProtocol,
52
+ retry: Retry.Retry,
53
+ telemetry: TELEMETRY,
54
+ span: "CreatePipeNodeEndpoint",
55
+ }));
56
+
57
+ export type DeletePipeNodeEndpointError = TinybirdOpError;
58
+ /** Unpublishes an API endpoint Reference: https://www.tinybird.co/docs/api-reference/pipe-api/api-endpoints */
59
+ export const deletePipeNodeEndpoint: API.OperationMethod<
60
+ DeletePipeNodeEndpointRequest,
61
+ DeletePipeNodeEndpointResponse,
62
+ DeletePipeNodeEndpointError,
63
+ TinybirdOpContext
64
+ > = /*@__PURE__*/ API.make(() => ({
65
+ input: __S(4, __c2, 0) as any as S.Schema<DeletePipeNodeEndpointRequest>,
66
+ output: __S(3, __c1, 1) as any as S.Schema<DeletePipeNodeEndpointResponse>,
67
+ errors: [],
68
+ serviceErrors: TinybirdServiceErrors,
69
+ protocol: TinybirdProtocol,
70
+ retry: Retry.Retry,
71
+ telemetry: TELEMETRY,
72
+ span: "DeletePipeNodeEndpoint",
73
+ }));
74
+
75
+ // Schema builders: each runs one schema initializer, on that schema's first use.
76
+ function __c0(j: number): any {
77
+ switch (j) {
78
+ case 0:
79
+ return S.suspend(() =>
80
+ S.Struct({
81
+ pipe: S.String.pipe(T.Label()),
82
+ node: S.String.pipe(T.Label()),
83
+ }).pipe(
84
+ T.Http({ method: "POST", uri: "/v0/pipes/{pipe}/nodes/{node}/endpoint", code: 200 }),
85
+ ),
86
+ ).annotate({ identifier: "CreatePipeNodeEndpointRequest" });
87
+ }
88
+ }
89
+ function __c1(j: number): any {
90
+ switch (j) {
91
+ case 0:
92
+ return S.Record(S.String, S.Unknown);
93
+ case 1:
94
+ return S.suspend(() => __S(2, __c1, 0).pipe(T.RawResponseRoot())).annotate({
95
+ identifier: "CreatePipeNodeEndpointResponse",
96
+ });
97
+ }
98
+ }
99
+ function __c2(j: number): any {
100
+ switch (j) {
101
+ case 0:
102
+ return S.suspend(() =>
103
+ S.Struct({
104
+ pipe: S.String.pipe(T.Label()),
105
+ node: S.String.pipe(T.Label()),
106
+ }).pipe(
107
+ T.Http({ method: "DELETE", uri: "/v0/pipes/{pipe}/nodes/{node}/endpoint", code: 200 }),
108
+ ),
109
+ ).annotate({ identifier: "DeletePipeNodeEndpointRequest" });
110
+ }
111
+ }
112
+ // Schema table: entry i is schema j of builder f, made on first reach.
113
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
114
+ return (__s[i] ??= __L.at(f, j));
115
+ }
@@ -0,0 +1,315 @@
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 type * as Redacted from "effect/Redacted";
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: "CopyPipes",
24
+ labels: "tinybird",
25
+ propagate: "w3c",
26
+ } as const;
27
+
28
+ export interface CancelPipeCopyRequest {
29
+ pipe: string;
30
+ }
31
+ export type CancelPipeCopyResponseBodyMap = { [key: string]: unknown | undefined };
32
+ export type CancelPipeCopyResponse = CancelPipeCopyResponseBodyMap;
33
+ export interface CreatePipeNodeCopyRequest {
34
+ pipe: string;
35
+ node: string;
36
+ /** Auth token. Ensure it has the `PIPE:CREATE` and `DATASOURCE:APPEND` scopes on it */
37
+ token?: string | Redacted.Redacted<string> | undefined;
38
+ /** Name or the id of the target Data Source. */
39
+ target_datasource?: string | undefined;
40
+ /** Optional. A crontab expression. */
41
+ schedule_cron?: string | undefined;
42
+ /** Optional. If true, scheduled executions use on-demand compute. */
43
+ on_demand_compute?: boolean | undefined;
44
+ }
45
+ export type CreatePipeNodeCopyResponseBodyMap = { [key: string]: unknown | undefined };
46
+ export type CreatePipeNodeCopyResponse = CreatePipeNodeCopyResponseBodyMap;
47
+ export interface DeletePipeNodeCopyRequest {
48
+ pipe: string;
49
+ node: string;
50
+ }
51
+ export type DeletePipeNodeCopyResponseBodyMap = { [key: string]: unknown | undefined };
52
+ export type DeletePipeNodeCopyResponse = DeletePipeNodeCopyResponseBodyMap;
53
+ export interface PausePipeCopyRequest {
54
+ pipe: string;
55
+ }
56
+ export type PausePipeCopyResponseBodyMap = { [key: string]: unknown | undefined };
57
+ export type PausePipeCopyResponse = PausePipeCopyResponseBodyMap;
58
+ export interface ResumePipeCopyRequest {
59
+ pipe: string;
60
+ }
61
+ export type ResumePipeCopyResponseBodyMap = { [key: string]: unknown | undefined };
62
+ export type ResumePipeCopyResponse = ResumePipeCopyResponseBodyMap;
63
+ export interface RunPipeCopyRequest {
64
+ pipe: string;
65
+ /** Auth token. Ensure it has the `PIPE:READ` scope on it */
66
+ token?: string | Redacted.Redacted<string> | undefined;
67
+ /** Optional. The value of the parameters to run the Copy with. They are regular URL query parameters. */
68
+ parameters?: string | undefined;
69
+ /** Optional. One of 'append' or 'replace'. Default is 'append'. */
70
+ _mode?: string | undefined;
71
+ }
72
+ export type RunPipeCopyResponseBodyMap = { [key: string]: unknown | undefined };
73
+ export type RunPipeCopyResponse = RunPipeCopyResponseBodyMap;
74
+ export interface UpdatePipeNodeCopyRequest {
75
+ pipe: string;
76
+ node: string;
77
+ /** Auth token. Ensure it has the `PIPE:CREATE` scope on it */
78
+ token?: string | Redacted.Redacted<string> | undefined;
79
+ /** Optional. Name or the id of the target Data Source. */
80
+ target_datasource?: string | undefined;
81
+ /** Optional. A crontab expression. If schedule_cron='None' the schedule will be removed from the copy pipe, if it was defined */
82
+ schedule_cron?: string | undefined;
83
+ /** Optional. The mode to use for the copy pipe. Can be 'append' or 'replace'. Default is 'append'. */
84
+ mode?: string | undefined;
85
+ /** Optional. If true, scheduled executions use on-demand compute. */
86
+ on_demand_compute?: boolean | undefined;
87
+ }
88
+ export type UpdatePipeNodeCopyResponseBodyMap = { [key: string]: unknown | undefined };
89
+ export type UpdatePipeNodeCopyResponse = UpdatePipeNodeCopyResponseBodyMap;
90
+ export type CancelPipeCopyError = TinybirdOpError;
91
+ /** Cancels jobs that are working or waiting that are tied to the pipe and pauses the scheduling of copy jobs for this pipe. To allow scheduled copy jobs to run for the pipe, the copy pipe must be resumed and the already cancelled jobs will not be resumed. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
92
+ export const cancelPipeCopy: API.OperationMethod<
93
+ CancelPipeCopyRequest,
94
+ CancelPipeCopyResponse,
95
+ CancelPipeCopyError,
96
+ TinybirdOpContext
97
+ > = /*@__PURE__*/ API.make(() => ({
98
+ input: __S(0, __c0, 0) as any as S.Schema<CancelPipeCopyRequest>,
99
+ output: __S(3, __c1, 1) as any as S.Schema<CancelPipeCopyResponse>,
100
+ errors: [],
101
+ serviceErrors: TinybirdServiceErrors,
102
+ protocol: TinybirdProtocol,
103
+ retry: Retry.Retry,
104
+ telemetry: TELEMETRY,
105
+ span: "CancelPipeCopy",
106
+ }));
107
+
108
+ export type CreatePipeNodeCopyError = TinybirdOpError;
109
+ /** Calling this endpoint sets the pipe as a Copy one with the given settings. Scheduling is optional. To run the actual copy after you set the pipe as a Copy one, you must call the POST `/v0/pipes/:pipe/copy` endpoint. If you need to change the target Data Source or the scheduling configuration, you can call PUT endpoint. Restrictions: - You can set only one schedule per Copy pipe. - You can't set a Copy pipe if the pipe is already materializing. You must unlink the Materialization first. - You can't set a Copy pipe if the pipe is already an endpoint. You must unpublish the endpoint first. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
110
+ export const createPipeNodeCopy: API.OperationMethod<
111
+ CreatePipeNodeCopyRequest,
112
+ CreatePipeNodeCopyResponse,
113
+ CreatePipeNodeCopyError,
114
+ TinybirdOpContext
115
+ > = /*@__PURE__*/ API.make(() => ({
116
+ input: __S(4, __c2, 0) as any as S.Schema<CreatePipeNodeCopyRequest>,
117
+ output: __S(3, __c1, 1) as any as S.Schema<CreatePipeNodeCopyResponse>,
118
+ errors: [],
119
+ serviceErrors: TinybirdServiceErrors,
120
+ protocol: TinybirdProtocol,
121
+ retry: Retry.Retry,
122
+ telemetry: TELEMETRY,
123
+ span: "CreatePipeNodeCopy",
124
+ }));
125
+
126
+ export type DeletePipeNodeCopyError = TinybirdOpError;
127
+ /** Removes the Copy type of the pipe. By removing the Copy type, nor the node nor the pipe are deleted. The pipe will still be present, but will stop any scheduled and copy settings. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
128
+ export const deletePipeNodeCopy: API.OperationMethod<
129
+ DeletePipeNodeCopyRequest,
130
+ DeletePipeNodeCopyResponse,
131
+ DeletePipeNodeCopyError,
132
+ TinybirdOpContext
133
+ > = /*@__PURE__*/ API.make(() => ({
134
+ input: __S(6, __c3, 0) as any as S.Schema<DeletePipeNodeCopyRequest>,
135
+ output: __S(3, __c1, 1) as any as S.Schema<DeletePipeNodeCopyResponse>,
136
+ errors: [],
137
+ serviceErrors: TinybirdServiceErrors,
138
+ protocol: TinybirdProtocol,
139
+ retry: Retry.Retry,
140
+ telemetry: TELEMETRY,
141
+ span: "DeletePipeNodeCopy",
142
+ }));
143
+
144
+ export type PausePipeCopyError = TinybirdOpError;
145
+ /** Pauses the scheduling. This affects any future scheduled Copy job. Any copy operation currently copying data will be completed. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
146
+ export const pausePipeCopy: API.OperationMethod<
147
+ PausePipeCopyRequest,
148
+ PausePipeCopyResponse,
149
+ PausePipeCopyError,
150
+ TinybirdOpContext
151
+ > = /*@__PURE__*/ API.make(() => ({
152
+ input: __S(8, __c4, 0) as any as S.Schema<PausePipeCopyRequest>,
153
+ output: __S(3, __c1, 1) as any as S.Schema<PausePipeCopyResponse>,
154
+ errors: [],
155
+ serviceErrors: TinybirdServiceErrors,
156
+ protocol: TinybirdProtocol,
157
+ retry: Retry.Retry,
158
+ telemetry: TELEMETRY,
159
+ span: "PausePipeCopy",
160
+ }));
161
+
162
+ export type ResumePipeCopyError = TinybirdOpError;
163
+ /** Resumes a previously paused scheduled copy. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
164
+ export const resumePipeCopy: API.OperationMethod<
165
+ ResumePipeCopyRequest,
166
+ ResumePipeCopyResponse,
167
+ ResumePipeCopyError,
168
+ TinybirdOpContext
169
+ > = /*@__PURE__*/ API.make(() => ({
170
+ input: __S(10, __c5, 0) as any as S.Schema<ResumePipeCopyRequest>,
171
+ output: __S(3, __c1, 1) as any as S.Schema<ResumePipeCopyResponse>,
172
+ errors: [],
173
+ serviceErrors: TinybirdServiceErrors,
174
+ protocol: TinybirdProtocol,
175
+ retry: Retry.Retry,
176
+ telemetry: TELEMETRY,
177
+ span: "ResumePipeCopy",
178
+ }));
179
+
180
+ export type RunPipeCopyError = TinybirdOpError;
181
+ /** Runs a copy job, using the settings previously set in the pipe. You can use this URL to do an on-demand copy. This URL is also used by the scheduler to make the programmed calls. This URL accepts parameters, just like in a regular endpoint. This operation is asynchronous and will copy the output of the endpoint to an existing datasource. The response will not be the final result of the copy but a Job. You can check the job status and progress using the [Jobs API](/docs/api-reference/jobs-api). Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
182
+ export const runPipeCopy: API.OperationMethod<
183
+ RunPipeCopyRequest,
184
+ RunPipeCopyResponse,
185
+ RunPipeCopyError,
186
+ TinybirdOpContext
187
+ > = /*@__PURE__*/ API.make(() => ({
188
+ input: __S(12, __c6, 0) as any as S.Schema<RunPipeCopyRequest>,
189
+ output: __S(3, __c1, 1) as any as S.Schema<RunPipeCopyResponse>,
190
+ errors: [],
191
+ serviceErrors: TinybirdServiceErrors,
192
+ protocol: TinybirdProtocol,
193
+ retry: Retry.Retry,
194
+ telemetry: TELEMETRY,
195
+ span: "RunPipeCopy",
196
+ }));
197
+
198
+ export type UpdatePipeNodeCopyError = TinybirdOpError;
199
+ /** Calling this endpoint will update a Copy pipe with the given settings: you can change its target Data Source, as well as adding or modifying its schedule. Reference: https://www.tinybird.co/docs/api-reference/pipe-api/copy-pipes-api */
200
+ export const updatePipeNodeCopy: API.OperationMethod<
201
+ UpdatePipeNodeCopyRequest,
202
+ UpdatePipeNodeCopyResponse,
203
+ UpdatePipeNodeCopyError,
204
+ TinybirdOpContext
205
+ > = /*@__PURE__*/ API.make(() => ({
206
+ input: __S(14, __c7, 0) as any as S.Schema<UpdatePipeNodeCopyRequest>,
207
+ output: __S(3, __c1, 1) as any as S.Schema<UpdatePipeNodeCopyResponse>,
208
+ errors: [],
209
+ serviceErrors: TinybirdServiceErrors,
210
+ protocol: TinybirdProtocol,
211
+ retry: Retry.Retry,
212
+ telemetry: TELEMETRY,
213
+ span: "UpdatePipeNodeCopy",
214
+ }));
215
+
216
+ // Schema builders: each runs one schema initializer, on that schema's first use.
217
+ function __c0(j: number): any {
218
+ switch (j) {
219
+ case 0:
220
+ return S.suspend(() =>
221
+ S.Struct({
222
+ pipe: S.String.pipe(T.Label()),
223
+ }).pipe(T.Http({ method: "POST", uri: "/v0/pipes/{pipe}/copy/cancel", code: 200 })),
224
+ ).annotate({ identifier: "CancelPipeCopyRequest" });
225
+ }
226
+ }
227
+ function __c1(j: number): any {
228
+ switch (j) {
229
+ case 0:
230
+ return S.Record(S.String, S.Unknown);
231
+ case 1:
232
+ return S.suspend(() => __S(2, __c1, 0).pipe(T.RawResponseRoot())).annotate({
233
+ identifier: "CancelPipeCopyResponse",
234
+ });
235
+ }
236
+ }
237
+ function __c2(j: number): any {
238
+ switch (j) {
239
+ case 0:
240
+ return S.suspend(() =>
241
+ S.Struct({
242
+ pipe: S.String.pipe(T.Label()),
243
+ node: S.String.pipe(T.Label()),
244
+ token: S.optional(S.String.pipe(T.Query(), T.SensitiveValue({}))),
245
+ target_datasource: S.optional(S.String.pipe(T.Query())),
246
+ schedule_cron: S.optional(S.String.pipe(T.Query())),
247
+ on_demand_compute: S.optional(S.Boolean.pipe(T.Query())),
248
+ }).pipe(T.Http({ method: "POST", uri: "/v0/pipes/{pipe}/nodes/{node}/copy", code: 200 })),
249
+ ).annotate({ identifier: "CreatePipeNodeCopyRequest" });
250
+ }
251
+ }
252
+ function __c3(j: number): any {
253
+ switch (j) {
254
+ case 0:
255
+ return S.suspend(() =>
256
+ S.Struct({
257
+ pipe: S.String.pipe(T.Label()),
258
+ node: S.String.pipe(T.Label()),
259
+ }).pipe(T.Http({ method: "DELETE", uri: "/v0/pipes/{pipe}/nodes/{node}/copy", code: 200 })),
260
+ ).annotate({ identifier: "DeletePipeNodeCopyRequest" });
261
+ }
262
+ }
263
+ function __c4(j: number): any {
264
+ switch (j) {
265
+ case 0:
266
+ return S.suspend(() =>
267
+ S.Struct({
268
+ pipe: S.String.pipe(T.Label()),
269
+ }).pipe(T.Http({ method: "POST", uri: "/v0/pipes/{pipe}/copy/pause", code: 200 })),
270
+ ).annotate({ identifier: "PausePipeCopyRequest" });
271
+ }
272
+ }
273
+ function __c5(j: number): any {
274
+ switch (j) {
275
+ case 0:
276
+ return S.suspend(() =>
277
+ S.Struct({
278
+ pipe: S.String.pipe(T.Label()),
279
+ }).pipe(T.Http({ method: "POST", uri: "/v0/pipes/{pipe}/copy/resume", code: 200 })),
280
+ ).annotate({ identifier: "ResumePipeCopyRequest" });
281
+ }
282
+ }
283
+ function __c6(j: number): any {
284
+ switch (j) {
285
+ case 0:
286
+ return S.suspend(() =>
287
+ S.Struct({
288
+ pipe: S.String.pipe(T.Label()),
289
+ token: S.optional(S.String.pipe(T.Query(), T.SensitiveValue({}))),
290
+ parameters: S.optional(S.String.pipe(T.Query())),
291
+ _mode: S.optional(S.String.pipe(T.Query())),
292
+ }).pipe(T.Http({ method: "POST", uri: "/v0/pipes/{pipe}/copy", code: 200 })),
293
+ ).annotate({ identifier: "RunPipeCopyRequest" });
294
+ }
295
+ }
296
+ function __c7(j: number): any {
297
+ switch (j) {
298
+ case 0:
299
+ return S.suspend(() =>
300
+ S.Struct({
301
+ pipe: S.String.pipe(T.Label()),
302
+ node: S.String.pipe(T.Label()),
303
+ token: S.optional(S.String.pipe(T.Query(), T.SensitiveValue({}))),
304
+ target_datasource: S.optional(S.String.pipe(T.Query())),
305
+ schedule_cron: S.optional(S.String.pipe(T.Query())),
306
+ mode: S.optional(S.String.pipe(T.Query())),
307
+ on_demand_compute: S.optional(S.Boolean.pipe(T.Query())),
308
+ }).pipe(T.Http({ method: "PUT", uri: "/v0/pipes/{pipe}/nodes/{node}/copy", code: 200 })),
309
+ ).annotate({ identifier: "UpdatePipeNodeCopyRequest" });
310
+ }
311
+ }
312
+ // Schema table: entry i is schema j of builder f, made on first reach.
313
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
314
+ return (__s[i] ??= __L.at(f, j));
315
+ }