@effect-aws/client-data-pipeline 1.10.6
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.
- package/DataPipelineClientInstance/package.json +6 -0
- package/DataPipelineService/package.json +6 -0
- package/DataPipelineServiceConfig/package.json +6 -0
- package/Errors/package.json +6 -0
- package/LICENSE +19 -0
- package/README.md +58 -0
- package/dist/cjs/DataPipelineClientInstance.d.ts +24 -0
- package/dist/cjs/DataPipelineClientInstance.d.ts.map +1 -0
- package/dist/cjs/DataPipelineClientInstance.js +50 -0
- package/dist/cjs/DataPipelineClientInstance.js.map +1 -0
- package/dist/cjs/DataPipelineService.d.ts +122 -0
- package/dist/cjs/DataPipelineService.d.ts.map +1 -0
- package/dist/cjs/DataPipelineService.js +78 -0
- package/dist/cjs/DataPipelineService.js.map +1 -0
- package/dist/cjs/DataPipelineServiceConfig.d.ts +25 -0
- package/dist/cjs/DataPipelineServiceConfig.d.ts.map +1 -0
- package/dist/cjs/DataPipelineServiceConfig.js +35 -0
- package/dist/cjs/DataPipelineServiceConfig.js.map +1 -0
- package/dist/cjs/Errors.d.ts +12 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +11 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/index.d.ts +44 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/dts/DataPipelineClientInstance.d.ts +24 -0
- package/dist/dts/DataPipelineClientInstance.d.ts.map +1 -0
- package/dist/dts/DataPipelineService.d.ts +122 -0
- package/dist/dts/DataPipelineService.d.ts.map +1 -0
- package/dist/dts/DataPipelineServiceConfig.d.ts +25 -0
- package/dist/dts/DataPipelineServiceConfig.d.ts.map +1 -0
- package/dist/dts/Errors.d.ts +12 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/index.d.ts +44 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/esm/DataPipelineClientInstance.js +23 -0
- package/dist/esm/DataPipelineClientInstance.js.map +1 -0
- package/dist/esm/DataPipelineService.js +51 -0
- package/dist/esm/DataPipelineService.js.map +1 -0
- package/dist/esm/DataPipelineServiceConfig.js +31 -0
- package/dist/esm/DataPipelineServiceConfig.js.map +1 -0
- package/dist/esm/Errors.js +8 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/package.json +71 -0
- package/src/DataPipelineClientInstance.ts +33 -0
- package/src/DataPipelineService.ts +448 -0
- package/src/DataPipelineServiceConfig.ts +52 -0
- package/src/Errors.ts +23 -0
- package/src/index.ts +50 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
ActivatePipelineCommand,
|
|
6
|
+
type ActivatePipelineCommandInput,
|
|
7
|
+
type ActivatePipelineCommandOutput,
|
|
8
|
+
AddTagsCommand,
|
|
9
|
+
type AddTagsCommandInput,
|
|
10
|
+
type AddTagsCommandOutput,
|
|
11
|
+
CreatePipelineCommand,
|
|
12
|
+
type CreatePipelineCommandInput,
|
|
13
|
+
type CreatePipelineCommandOutput,
|
|
14
|
+
type DataPipelineClient,
|
|
15
|
+
type DataPipelineClientConfig,
|
|
16
|
+
DeactivatePipelineCommand,
|
|
17
|
+
type DeactivatePipelineCommandInput,
|
|
18
|
+
type DeactivatePipelineCommandOutput,
|
|
19
|
+
DeletePipelineCommand,
|
|
20
|
+
type DeletePipelineCommandInput,
|
|
21
|
+
type DeletePipelineCommandOutput,
|
|
22
|
+
DescribeObjectsCommand,
|
|
23
|
+
type DescribeObjectsCommandInput,
|
|
24
|
+
type DescribeObjectsCommandOutput,
|
|
25
|
+
DescribePipelinesCommand,
|
|
26
|
+
type DescribePipelinesCommandInput,
|
|
27
|
+
type DescribePipelinesCommandOutput,
|
|
28
|
+
EvaluateExpressionCommand,
|
|
29
|
+
type EvaluateExpressionCommandInput,
|
|
30
|
+
type EvaluateExpressionCommandOutput,
|
|
31
|
+
GetPipelineDefinitionCommand,
|
|
32
|
+
type GetPipelineDefinitionCommandInput,
|
|
33
|
+
type GetPipelineDefinitionCommandOutput,
|
|
34
|
+
ListPipelinesCommand,
|
|
35
|
+
type ListPipelinesCommandInput,
|
|
36
|
+
type ListPipelinesCommandOutput,
|
|
37
|
+
PollForTaskCommand,
|
|
38
|
+
type PollForTaskCommandInput,
|
|
39
|
+
type PollForTaskCommandOutput,
|
|
40
|
+
PutPipelineDefinitionCommand,
|
|
41
|
+
type PutPipelineDefinitionCommandInput,
|
|
42
|
+
type PutPipelineDefinitionCommandOutput,
|
|
43
|
+
QueryObjectsCommand,
|
|
44
|
+
type QueryObjectsCommandInput,
|
|
45
|
+
type QueryObjectsCommandOutput,
|
|
46
|
+
RemoveTagsCommand,
|
|
47
|
+
type RemoveTagsCommandInput,
|
|
48
|
+
type RemoveTagsCommandOutput,
|
|
49
|
+
ReportTaskProgressCommand,
|
|
50
|
+
type ReportTaskProgressCommandInput,
|
|
51
|
+
type ReportTaskProgressCommandOutput,
|
|
52
|
+
ReportTaskRunnerHeartbeatCommand,
|
|
53
|
+
type ReportTaskRunnerHeartbeatCommandInput,
|
|
54
|
+
type ReportTaskRunnerHeartbeatCommandOutput,
|
|
55
|
+
SetStatusCommand,
|
|
56
|
+
type SetStatusCommandInput,
|
|
57
|
+
type SetStatusCommandOutput,
|
|
58
|
+
SetTaskStatusCommand,
|
|
59
|
+
type SetTaskStatusCommandInput,
|
|
60
|
+
type SetTaskStatusCommandOutput,
|
|
61
|
+
ValidatePipelineDefinitionCommand,
|
|
62
|
+
type ValidatePipelineDefinitionCommandInput,
|
|
63
|
+
type ValidatePipelineDefinitionCommandOutput,
|
|
64
|
+
} from "@aws-sdk/client-data-pipeline";
|
|
65
|
+
import type { HttpHandlerOptions, ServiceLogger } from "@effect-aws/commons";
|
|
66
|
+
import { Service } from "@effect-aws/commons";
|
|
67
|
+
import type { Cause } from "effect";
|
|
68
|
+
import { Effect, Layer } from "effect";
|
|
69
|
+
import * as Instance from "./DataPipelineClientInstance.js";
|
|
70
|
+
import * as DataPipelineServiceConfig from "./DataPipelineServiceConfig.js";
|
|
71
|
+
import type {
|
|
72
|
+
InternalServiceError,
|
|
73
|
+
InvalidRequestError,
|
|
74
|
+
PipelineDeletedError,
|
|
75
|
+
PipelineNotFoundError,
|
|
76
|
+
SdkError,
|
|
77
|
+
TaskNotFoundError,
|
|
78
|
+
} from "./Errors.js";
|
|
79
|
+
import { AllServiceErrors } from "./Errors.js";
|
|
80
|
+
|
|
81
|
+
const commands = {
|
|
82
|
+
ActivatePipelineCommand,
|
|
83
|
+
AddTagsCommand,
|
|
84
|
+
CreatePipelineCommand,
|
|
85
|
+
DeactivatePipelineCommand,
|
|
86
|
+
DeletePipelineCommand,
|
|
87
|
+
DescribeObjectsCommand,
|
|
88
|
+
DescribePipelinesCommand,
|
|
89
|
+
EvaluateExpressionCommand,
|
|
90
|
+
GetPipelineDefinitionCommand,
|
|
91
|
+
ListPipelinesCommand,
|
|
92
|
+
PollForTaskCommand,
|
|
93
|
+
PutPipelineDefinitionCommand,
|
|
94
|
+
QueryObjectsCommand,
|
|
95
|
+
RemoveTagsCommand,
|
|
96
|
+
ReportTaskProgressCommand,
|
|
97
|
+
ReportTaskRunnerHeartbeatCommand,
|
|
98
|
+
SetStatusCommand,
|
|
99
|
+
SetTaskStatusCommand,
|
|
100
|
+
ValidatePipelineDefinitionCommand,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
interface DataPipelineService$ {
|
|
104
|
+
readonly _: unique symbol;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @see {@link ActivatePipelineCommand}
|
|
108
|
+
*/
|
|
109
|
+
activatePipeline(
|
|
110
|
+
args: ActivatePipelineCommandInput,
|
|
111
|
+
options?: HttpHandlerOptions,
|
|
112
|
+
): Effect.Effect<
|
|
113
|
+
ActivatePipelineCommandOutput,
|
|
114
|
+
| Cause.TimeoutException
|
|
115
|
+
| SdkError
|
|
116
|
+
| InternalServiceError
|
|
117
|
+
| InvalidRequestError
|
|
118
|
+
| PipelineDeletedError
|
|
119
|
+
| PipelineNotFoundError
|
|
120
|
+
>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @see {@link AddTagsCommand}
|
|
124
|
+
*/
|
|
125
|
+
addTags(
|
|
126
|
+
args: AddTagsCommandInput,
|
|
127
|
+
options?: HttpHandlerOptions,
|
|
128
|
+
): Effect.Effect<
|
|
129
|
+
AddTagsCommandOutput,
|
|
130
|
+
| Cause.TimeoutException
|
|
131
|
+
| SdkError
|
|
132
|
+
| InternalServiceError
|
|
133
|
+
| InvalidRequestError
|
|
134
|
+
| PipelineDeletedError
|
|
135
|
+
| PipelineNotFoundError
|
|
136
|
+
>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @see {@link CreatePipelineCommand}
|
|
140
|
+
*/
|
|
141
|
+
createPipeline(
|
|
142
|
+
args: CreatePipelineCommandInput,
|
|
143
|
+
options?: HttpHandlerOptions,
|
|
144
|
+
): Effect.Effect<
|
|
145
|
+
CreatePipelineCommandOutput,
|
|
146
|
+
Cause.TimeoutException | SdkError | InternalServiceError | InvalidRequestError
|
|
147
|
+
>;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @see {@link DeactivatePipelineCommand}
|
|
151
|
+
*/
|
|
152
|
+
deactivatePipeline(
|
|
153
|
+
args: DeactivatePipelineCommandInput,
|
|
154
|
+
options?: HttpHandlerOptions,
|
|
155
|
+
): Effect.Effect<
|
|
156
|
+
DeactivatePipelineCommandOutput,
|
|
157
|
+
| Cause.TimeoutException
|
|
158
|
+
| SdkError
|
|
159
|
+
| InternalServiceError
|
|
160
|
+
| InvalidRequestError
|
|
161
|
+
| PipelineDeletedError
|
|
162
|
+
| PipelineNotFoundError
|
|
163
|
+
>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @see {@link DeletePipelineCommand}
|
|
167
|
+
*/
|
|
168
|
+
deletePipeline(
|
|
169
|
+
args: DeletePipelineCommandInput,
|
|
170
|
+
options?: HttpHandlerOptions,
|
|
171
|
+
): Effect.Effect<
|
|
172
|
+
DeletePipelineCommandOutput,
|
|
173
|
+
Cause.TimeoutException | SdkError | InternalServiceError | InvalidRequestError | PipelineNotFoundError
|
|
174
|
+
>;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @see {@link DescribeObjectsCommand}
|
|
178
|
+
*/
|
|
179
|
+
describeObjects(
|
|
180
|
+
args: DescribeObjectsCommandInput,
|
|
181
|
+
options?: HttpHandlerOptions,
|
|
182
|
+
): Effect.Effect<
|
|
183
|
+
DescribeObjectsCommandOutput,
|
|
184
|
+
| Cause.TimeoutException
|
|
185
|
+
| SdkError
|
|
186
|
+
| InternalServiceError
|
|
187
|
+
| InvalidRequestError
|
|
188
|
+
| PipelineDeletedError
|
|
189
|
+
| PipelineNotFoundError
|
|
190
|
+
>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @see {@link DescribePipelinesCommand}
|
|
194
|
+
*/
|
|
195
|
+
describePipelines(
|
|
196
|
+
args: DescribePipelinesCommandInput,
|
|
197
|
+
options?: HttpHandlerOptions,
|
|
198
|
+
): Effect.Effect<
|
|
199
|
+
DescribePipelinesCommandOutput,
|
|
200
|
+
| Cause.TimeoutException
|
|
201
|
+
| SdkError
|
|
202
|
+
| InternalServiceError
|
|
203
|
+
| InvalidRequestError
|
|
204
|
+
| PipelineDeletedError
|
|
205
|
+
| PipelineNotFoundError
|
|
206
|
+
>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @see {@link EvaluateExpressionCommand}
|
|
210
|
+
*/
|
|
211
|
+
evaluateExpression(
|
|
212
|
+
args: EvaluateExpressionCommandInput,
|
|
213
|
+
options?: HttpHandlerOptions,
|
|
214
|
+
): Effect.Effect<
|
|
215
|
+
EvaluateExpressionCommandOutput,
|
|
216
|
+
| Cause.TimeoutException
|
|
217
|
+
| SdkError
|
|
218
|
+
| InternalServiceError
|
|
219
|
+
| InvalidRequestError
|
|
220
|
+
| PipelineDeletedError
|
|
221
|
+
| PipelineNotFoundError
|
|
222
|
+
| TaskNotFoundError
|
|
223
|
+
>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @see {@link GetPipelineDefinitionCommand}
|
|
227
|
+
*/
|
|
228
|
+
getPipelineDefinition(
|
|
229
|
+
args: GetPipelineDefinitionCommandInput,
|
|
230
|
+
options?: HttpHandlerOptions,
|
|
231
|
+
): Effect.Effect<
|
|
232
|
+
GetPipelineDefinitionCommandOutput,
|
|
233
|
+
| Cause.TimeoutException
|
|
234
|
+
| SdkError
|
|
235
|
+
| InternalServiceError
|
|
236
|
+
| InvalidRequestError
|
|
237
|
+
| PipelineDeletedError
|
|
238
|
+
| PipelineNotFoundError
|
|
239
|
+
>;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @see {@link ListPipelinesCommand}
|
|
243
|
+
*/
|
|
244
|
+
listPipelines(
|
|
245
|
+
args: ListPipelinesCommandInput,
|
|
246
|
+
options?: HttpHandlerOptions,
|
|
247
|
+
): Effect.Effect<
|
|
248
|
+
ListPipelinesCommandOutput,
|
|
249
|
+
Cause.TimeoutException | SdkError | InternalServiceError | InvalidRequestError
|
|
250
|
+
>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @see {@link PollForTaskCommand}
|
|
254
|
+
*/
|
|
255
|
+
pollForTask(
|
|
256
|
+
args: PollForTaskCommandInput,
|
|
257
|
+
options?: HttpHandlerOptions,
|
|
258
|
+
): Effect.Effect<
|
|
259
|
+
PollForTaskCommandOutput,
|
|
260
|
+
Cause.TimeoutException | SdkError | InternalServiceError | InvalidRequestError | TaskNotFoundError
|
|
261
|
+
>;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @see {@link PutPipelineDefinitionCommand}
|
|
265
|
+
*/
|
|
266
|
+
putPipelineDefinition(
|
|
267
|
+
args: PutPipelineDefinitionCommandInput,
|
|
268
|
+
options?: HttpHandlerOptions,
|
|
269
|
+
): Effect.Effect<
|
|
270
|
+
PutPipelineDefinitionCommandOutput,
|
|
271
|
+
| Cause.TimeoutException
|
|
272
|
+
| SdkError
|
|
273
|
+
| InternalServiceError
|
|
274
|
+
| InvalidRequestError
|
|
275
|
+
| PipelineDeletedError
|
|
276
|
+
| PipelineNotFoundError
|
|
277
|
+
>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @see {@link QueryObjectsCommand}
|
|
281
|
+
*/
|
|
282
|
+
queryObjects(
|
|
283
|
+
args: QueryObjectsCommandInput,
|
|
284
|
+
options?: HttpHandlerOptions,
|
|
285
|
+
): Effect.Effect<
|
|
286
|
+
QueryObjectsCommandOutput,
|
|
287
|
+
| Cause.TimeoutException
|
|
288
|
+
| SdkError
|
|
289
|
+
| InternalServiceError
|
|
290
|
+
| InvalidRequestError
|
|
291
|
+
| PipelineDeletedError
|
|
292
|
+
| PipelineNotFoundError
|
|
293
|
+
>;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @see {@link RemoveTagsCommand}
|
|
297
|
+
*/
|
|
298
|
+
removeTags(
|
|
299
|
+
args: RemoveTagsCommandInput,
|
|
300
|
+
options?: HttpHandlerOptions,
|
|
301
|
+
): Effect.Effect<
|
|
302
|
+
RemoveTagsCommandOutput,
|
|
303
|
+
| Cause.TimeoutException
|
|
304
|
+
| SdkError
|
|
305
|
+
| InternalServiceError
|
|
306
|
+
| InvalidRequestError
|
|
307
|
+
| PipelineDeletedError
|
|
308
|
+
| PipelineNotFoundError
|
|
309
|
+
>;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @see {@link ReportTaskProgressCommand}
|
|
313
|
+
*/
|
|
314
|
+
reportTaskProgress(
|
|
315
|
+
args: ReportTaskProgressCommandInput,
|
|
316
|
+
options?: HttpHandlerOptions,
|
|
317
|
+
): Effect.Effect<
|
|
318
|
+
ReportTaskProgressCommandOutput,
|
|
319
|
+
| Cause.TimeoutException
|
|
320
|
+
| SdkError
|
|
321
|
+
| InternalServiceError
|
|
322
|
+
| InvalidRequestError
|
|
323
|
+
| PipelineDeletedError
|
|
324
|
+
| PipelineNotFoundError
|
|
325
|
+
| TaskNotFoundError
|
|
326
|
+
>;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @see {@link ReportTaskRunnerHeartbeatCommand}
|
|
330
|
+
*/
|
|
331
|
+
reportTaskRunnerHeartbeat(
|
|
332
|
+
args: ReportTaskRunnerHeartbeatCommandInput,
|
|
333
|
+
options?: HttpHandlerOptions,
|
|
334
|
+
): Effect.Effect<
|
|
335
|
+
ReportTaskRunnerHeartbeatCommandOutput,
|
|
336
|
+
Cause.TimeoutException | SdkError | InternalServiceError | InvalidRequestError
|
|
337
|
+
>;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @see {@link SetStatusCommand}
|
|
341
|
+
*/
|
|
342
|
+
setStatus(
|
|
343
|
+
args: SetStatusCommandInput,
|
|
344
|
+
options?: HttpHandlerOptions,
|
|
345
|
+
): Effect.Effect<
|
|
346
|
+
SetStatusCommandOutput,
|
|
347
|
+
| Cause.TimeoutException
|
|
348
|
+
| SdkError
|
|
349
|
+
| InternalServiceError
|
|
350
|
+
| InvalidRequestError
|
|
351
|
+
| PipelineDeletedError
|
|
352
|
+
| PipelineNotFoundError
|
|
353
|
+
>;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* @see {@link SetTaskStatusCommand}
|
|
357
|
+
*/
|
|
358
|
+
setTaskStatus(
|
|
359
|
+
args: SetTaskStatusCommandInput,
|
|
360
|
+
options?: HttpHandlerOptions,
|
|
361
|
+
): Effect.Effect<
|
|
362
|
+
SetTaskStatusCommandOutput,
|
|
363
|
+
| Cause.TimeoutException
|
|
364
|
+
| SdkError
|
|
365
|
+
| InternalServiceError
|
|
366
|
+
| InvalidRequestError
|
|
367
|
+
| PipelineDeletedError
|
|
368
|
+
| PipelineNotFoundError
|
|
369
|
+
| TaskNotFoundError
|
|
370
|
+
>;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @see {@link ValidatePipelineDefinitionCommand}
|
|
374
|
+
*/
|
|
375
|
+
validatePipelineDefinition(
|
|
376
|
+
args: ValidatePipelineDefinitionCommandInput,
|
|
377
|
+
options?: HttpHandlerOptions,
|
|
378
|
+
): Effect.Effect<
|
|
379
|
+
ValidatePipelineDefinitionCommandOutput,
|
|
380
|
+
| Cause.TimeoutException
|
|
381
|
+
| SdkError
|
|
382
|
+
| InternalServiceError
|
|
383
|
+
| InvalidRequestError
|
|
384
|
+
| PipelineDeletedError
|
|
385
|
+
| PipelineNotFoundError
|
|
386
|
+
>;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @since 1.0.0
|
|
391
|
+
* @category constructors
|
|
392
|
+
*/
|
|
393
|
+
export const makeDataPipelineService = Effect.gen(function*() {
|
|
394
|
+
const client = yield* Instance.DataPipelineClientInstance;
|
|
395
|
+
|
|
396
|
+
return yield* Service.fromClientAndCommands<DataPipelineService$>(
|
|
397
|
+
client,
|
|
398
|
+
commands,
|
|
399
|
+
{
|
|
400
|
+
errorTags: AllServiceErrors,
|
|
401
|
+
resolveClientConfig: DataPipelineServiceConfig.toDataPipelineClientConfig,
|
|
402
|
+
},
|
|
403
|
+
);
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @since 1.0.0
|
|
408
|
+
* @category models
|
|
409
|
+
*/
|
|
410
|
+
export class DataPipelineService extends Effect.Tag("@effect-aws/client-data-pipeline/DataPipelineService")<
|
|
411
|
+
DataPipelineService,
|
|
412
|
+
DataPipelineService$
|
|
413
|
+
>() {
|
|
414
|
+
static readonly defaultLayer = Layer.effect(this, makeDataPipelineService).pipe(Layer.provide(Instance.layer));
|
|
415
|
+
static readonly layer = (config: DataPipelineService.Config) =>
|
|
416
|
+
Layer.effect(this, makeDataPipelineService).pipe(
|
|
417
|
+
Layer.provide(Instance.layer),
|
|
418
|
+
Layer.provide(DataPipelineServiceConfig.setDataPipelineServiceConfig(config)),
|
|
419
|
+
);
|
|
420
|
+
static readonly baseLayer = (
|
|
421
|
+
evaluate: (defaultConfig: DataPipelineClientConfig) => DataPipelineClient,
|
|
422
|
+
) =>
|
|
423
|
+
Layer.effect(this, makeDataPipelineService).pipe(
|
|
424
|
+
Layer.provide(
|
|
425
|
+
Layer.effect(
|
|
426
|
+
Instance.DataPipelineClientInstance,
|
|
427
|
+
Effect.map(DataPipelineServiceConfig.toDataPipelineClientConfig, evaluate),
|
|
428
|
+
),
|
|
429
|
+
),
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* @since 1.0.0
|
|
435
|
+
*/
|
|
436
|
+
export declare namespace DataPipelineService {
|
|
437
|
+
/**
|
|
438
|
+
* @since 1.0.0
|
|
439
|
+
*/
|
|
440
|
+
export interface Config extends Omit<DataPipelineClientConfig, "logger"> {
|
|
441
|
+
readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @since 1.0.0
|
|
446
|
+
*/
|
|
447
|
+
export type Type = DataPipelineService$;
|
|
448
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { DataPipelineClientConfig } from "@aws-sdk/client-data-pipeline";
|
|
5
|
+
import { ServiceLogger } from "@effect-aws/commons";
|
|
6
|
+
import { Effect, FiberRef, Layer } from "effect";
|
|
7
|
+
import { dual } from "effect/Function";
|
|
8
|
+
import { globalValue } from "effect/GlobalValue";
|
|
9
|
+
import type { DataPipelineService } from "./DataPipelineService.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category data-pipeline service config
|
|
14
|
+
*/
|
|
15
|
+
const currentDataPipelineServiceConfig = globalValue(
|
|
16
|
+
"@effect-aws/client-data-pipeline/currentDataPipelineServiceConfig",
|
|
17
|
+
() => FiberRef.unsafeMake<DataPipelineService.Config>({}),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category data-pipeline service config
|
|
23
|
+
*/
|
|
24
|
+
export const withDataPipelineServiceConfig: {
|
|
25
|
+
(config: DataPipelineService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
26
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: DataPipelineService.Config): Effect.Effect<A, E, R>;
|
|
27
|
+
} = dual(
|
|
28
|
+
2,
|
|
29
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: DataPipelineService.Config): Effect.Effect<A, E, R> =>
|
|
30
|
+
Effect.locally(effect, currentDataPipelineServiceConfig, config),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category data-pipeline service config
|
|
36
|
+
*/
|
|
37
|
+
export const setDataPipelineServiceConfig = (config: DataPipelineService.Config) =>
|
|
38
|
+
Layer.locallyScoped(currentDataPipelineServiceConfig, config);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category adapters
|
|
43
|
+
*/
|
|
44
|
+
export const toDataPipelineClientConfig: Effect.Effect<DataPipelineClientConfig> = Effect.gen(function*() {
|
|
45
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentDataPipelineServiceConfig);
|
|
46
|
+
|
|
47
|
+
const logger = serviceLogger === true
|
|
48
|
+
? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
|
|
49
|
+
: (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
|
|
50
|
+
|
|
51
|
+
return { logger, ...config };
|
|
52
|
+
});
|
package/src/Errors.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
InternalServiceError as InternalServiceException,
|
|
3
|
+
InvalidRequestException,
|
|
4
|
+
PipelineDeletedException,
|
|
5
|
+
PipelineNotFoundException,
|
|
6
|
+
TaskNotFoundException,
|
|
7
|
+
} from "@aws-sdk/client-data-pipeline";
|
|
8
|
+
import type { TaggedException } from "@effect-aws/commons";
|
|
9
|
+
|
|
10
|
+
export const AllServiceErrors = [
|
|
11
|
+
"InternalServiceError",
|
|
12
|
+
"InvalidRequestException",
|
|
13
|
+
"PipelineDeletedException",
|
|
14
|
+
"PipelineNotFoundException",
|
|
15
|
+
"TaskNotFoundException",
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
export type InternalServiceError = TaggedException<InternalServiceException>;
|
|
19
|
+
export type InvalidRequestError = TaggedException<InvalidRequestException>;
|
|
20
|
+
export type PipelineDeletedError = TaggedException<PipelineDeletedException>;
|
|
21
|
+
export type PipelineNotFoundError = TaggedException<PipelineNotFoundException>;
|
|
22
|
+
export type TaskNotFoundError = TaggedException<TaskNotFoundException>;
|
|
23
|
+
export type SdkError = TaggedException<Error & { name: "SdkError" }>;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { DataPipelineService } from "./DataPipelineService.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export * from "./Errors.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
export * as DataPipelineClientInstance from "./DataPipelineClientInstance.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export * as DataPipelineServiceConfig from "./DataPipelineServiceConfig.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
export * from "./DataPipelineService.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category exports
|
|
29
|
+
* @alias DataPipelineService
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace DataPipeline {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @alias DataPipelineService.Config
|
|
35
|
+
*/
|
|
36
|
+
export type Config = DataPipelineService.Config;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @alias DataPipelineService.Type
|
|
41
|
+
*/
|
|
42
|
+
export type Type = DataPipelineService.Type;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
* @category exports
|
|
48
|
+
* @alias DataPipelineService
|
|
49
|
+
*/
|
|
50
|
+
export const DataPipeline = DataPipelineService;
|