@effect-aws/client-timestream-write 1.9.2
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/Errors/package.json +6 -0
- package/LICENSE +19 -0
- package/README.md +58 -0
- package/TimestreamWriteClientInstance/package.json +6 -0
- package/TimestreamWriteService/package.json +6 -0
- package/TimestreamWriteServiceConfig/package.json +6 -0
- package/dist/cjs/Errors.d.ts +16 -0
- package/dist/cjs/Errors.d.ts.map +1 -0
- package/dist/cjs/Errors.js +17 -0
- package/dist/cjs/Errors.js.map +1 -0
- package/dist/cjs/TimestreamWriteClientInstance.d.ts +24 -0
- package/dist/cjs/TimestreamWriteClientInstance.d.ts.map +1 -0
- package/dist/cjs/TimestreamWriteClientInstance.js +50 -0
- package/dist/cjs/TimestreamWriteClientInstance.js.map +1 -0
- package/dist/cjs/TimestreamWriteService.d.ts +117 -0
- package/dist/cjs/TimestreamWriteService.d.ts.map +1 -0
- package/dist/cjs/TimestreamWriteService.js +78 -0
- package/dist/cjs/TimestreamWriteService.js.map +1 -0
- package/dist/cjs/TimestreamWriteServiceConfig.d.ts +25 -0
- package/dist/cjs/TimestreamWriteServiceConfig.d.ts.map +1 -0
- package/dist/cjs/TimestreamWriteServiceConfig.js +35 -0
- package/dist/cjs/TimestreamWriteServiceConfig.js.map +1 -0
- package/dist/cjs/index.d.ts +39 -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/Errors.d.ts +16 -0
- package/dist/dts/Errors.d.ts.map +1 -0
- package/dist/dts/TimestreamWriteClientInstance.d.ts +24 -0
- package/dist/dts/TimestreamWriteClientInstance.d.ts.map +1 -0
- package/dist/dts/TimestreamWriteService.d.ts +117 -0
- package/dist/dts/TimestreamWriteService.d.ts.map +1 -0
- package/dist/dts/TimestreamWriteServiceConfig.d.ts +25 -0
- package/dist/dts/TimestreamWriteServiceConfig.d.ts.map +1 -0
- package/dist/dts/index.d.ts +39 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/esm/Errors.js +14 -0
- package/dist/esm/Errors.js.map +1 -0
- package/dist/esm/TimestreamWriteClientInstance.js +23 -0
- package/dist/esm/TimestreamWriteClientInstance.js.map +1 -0
- package/dist/esm/TimestreamWriteService.js +51 -0
- package/dist/esm/TimestreamWriteService.js.map +1 -0
- package/dist/esm/TimestreamWriteServiceConfig.js +31 -0
- package/dist/esm/TimestreamWriteServiceConfig.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/Errors.ts +38 -0
- package/src/TimestreamWriteClientInstance.ts +33 -0
- package/src/TimestreamWriteService.ts +461 -0
- package/src/TimestreamWriteServiceConfig.ts +52 -0
- package/src/index.ts +44 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
CreateBatchLoadTaskCommand,
|
|
6
|
+
type CreateBatchLoadTaskCommandInput,
|
|
7
|
+
type CreateBatchLoadTaskCommandOutput,
|
|
8
|
+
CreateDatabaseCommand,
|
|
9
|
+
type CreateDatabaseCommandInput,
|
|
10
|
+
type CreateDatabaseCommandOutput,
|
|
11
|
+
CreateTableCommand,
|
|
12
|
+
type CreateTableCommandInput,
|
|
13
|
+
type CreateTableCommandOutput,
|
|
14
|
+
DeleteDatabaseCommand,
|
|
15
|
+
type DeleteDatabaseCommandInput,
|
|
16
|
+
type DeleteDatabaseCommandOutput,
|
|
17
|
+
DeleteTableCommand,
|
|
18
|
+
type DeleteTableCommandInput,
|
|
19
|
+
type DeleteTableCommandOutput,
|
|
20
|
+
DescribeBatchLoadTaskCommand,
|
|
21
|
+
type DescribeBatchLoadTaskCommandInput,
|
|
22
|
+
type DescribeBatchLoadTaskCommandOutput,
|
|
23
|
+
DescribeDatabaseCommand,
|
|
24
|
+
type DescribeDatabaseCommandInput,
|
|
25
|
+
type DescribeDatabaseCommandOutput,
|
|
26
|
+
DescribeEndpointsCommand,
|
|
27
|
+
type DescribeEndpointsCommandInput,
|
|
28
|
+
type DescribeEndpointsCommandOutput,
|
|
29
|
+
DescribeTableCommand,
|
|
30
|
+
type DescribeTableCommandInput,
|
|
31
|
+
type DescribeTableCommandOutput,
|
|
32
|
+
ListBatchLoadTasksCommand,
|
|
33
|
+
type ListBatchLoadTasksCommandInput,
|
|
34
|
+
type ListBatchLoadTasksCommandOutput,
|
|
35
|
+
ListDatabasesCommand,
|
|
36
|
+
type ListDatabasesCommandInput,
|
|
37
|
+
type ListDatabasesCommandOutput,
|
|
38
|
+
ListTablesCommand,
|
|
39
|
+
type ListTablesCommandInput,
|
|
40
|
+
type ListTablesCommandOutput,
|
|
41
|
+
ListTagsForResourceCommand,
|
|
42
|
+
type ListTagsForResourceCommandInput,
|
|
43
|
+
type ListTagsForResourceCommandOutput,
|
|
44
|
+
ResumeBatchLoadTaskCommand,
|
|
45
|
+
type ResumeBatchLoadTaskCommandInput,
|
|
46
|
+
type ResumeBatchLoadTaskCommandOutput,
|
|
47
|
+
TagResourceCommand,
|
|
48
|
+
type TagResourceCommandInput,
|
|
49
|
+
type TagResourceCommandOutput,
|
|
50
|
+
type TimestreamWriteClient,
|
|
51
|
+
type TimestreamWriteClientConfig,
|
|
52
|
+
UntagResourceCommand,
|
|
53
|
+
type UntagResourceCommandInput,
|
|
54
|
+
type UntagResourceCommandOutput,
|
|
55
|
+
UpdateDatabaseCommand,
|
|
56
|
+
type UpdateDatabaseCommandInput,
|
|
57
|
+
type UpdateDatabaseCommandOutput,
|
|
58
|
+
UpdateTableCommand,
|
|
59
|
+
type UpdateTableCommandInput,
|
|
60
|
+
type UpdateTableCommandOutput,
|
|
61
|
+
WriteRecordsCommand,
|
|
62
|
+
type WriteRecordsCommandInput,
|
|
63
|
+
type WriteRecordsCommandOutput,
|
|
64
|
+
} from "@aws-sdk/client-timestream-write";
|
|
65
|
+
import type { HttpHandlerOptions, SdkError, ServiceLogger } from "@effect-aws/commons";
|
|
66
|
+
import { Service } from "@effect-aws/commons";
|
|
67
|
+
import { Effect, Layer } from "effect";
|
|
68
|
+
import type {
|
|
69
|
+
AccessDeniedError,
|
|
70
|
+
ConflictError,
|
|
71
|
+
InternalServerError,
|
|
72
|
+
InvalidEndpointError,
|
|
73
|
+
RejectedRecordsError,
|
|
74
|
+
ResourceNotFoundError,
|
|
75
|
+
ServiceQuotaExceededError,
|
|
76
|
+
ThrottlingError,
|
|
77
|
+
ValidationError,
|
|
78
|
+
} from "./Errors.js";
|
|
79
|
+
import { AllServiceErrors } from "./Errors.js";
|
|
80
|
+
import * as Instance from "./TimestreamWriteClientInstance.js";
|
|
81
|
+
import * as TimestreamWriteServiceConfig from "./TimestreamWriteServiceConfig.js";
|
|
82
|
+
|
|
83
|
+
const commands = {
|
|
84
|
+
CreateBatchLoadTaskCommand,
|
|
85
|
+
CreateDatabaseCommand,
|
|
86
|
+
CreateTableCommand,
|
|
87
|
+
DeleteDatabaseCommand,
|
|
88
|
+
DeleteTableCommand,
|
|
89
|
+
DescribeBatchLoadTaskCommand,
|
|
90
|
+
DescribeDatabaseCommand,
|
|
91
|
+
DescribeEndpointsCommand,
|
|
92
|
+
DescribeTableCommand,
|
|
93
|
+
ListBatchLoadTasksCommand,
|
|
94
|
+
ListDatabasesCommand,
|
|
95
|
+
ListTablesCommand,
|
|
96
|
+
ListTagsForResourceCommand,
|
|
97
|
+
ResumeBatchLoadTaskCommand,
|
|
98
|
+
TagResourceCommand,
|
|
99
|
+
UntagResourceCommand,
|
|
100
|
+
UpdateDatabaseCommand,
|
|
101
|
+
UpdateTableCommand,
|
|
102
|
+
WriteRecordsCommand,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
interface TimestreamWriteService$ {
|
|
106
|
+
readonly _: unique symbol;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @see {@link CreateBatchLoadTaskCommand}
|
|
110
|
+
*/
|
|
111
|
+
createBatchLoadTask(
|
|
112
|
+
args: CreateBatchLoadTaskCommandInput,
|
|
113
|
+
options?: HttpHandlerOptions,
|
|
114
|
+
): Effect.Effect<
|
|
115
|
+
CreateBatchLoadTaskCommandOutput,
|
|
116
|
+
| SdkError
|
|
117
|
+
| AccessDeniedError
|
|
118
|
+
| ConflictError
|
|
119
|
+
| InternalServerError
|
|
120
|
+
| InvalidEndpointError
|
|
121
|
+
| ResourceNotFoundError
|
|
122
|
+
| ServiceQuotaExceededError
|
|
123
|
+
| ThrottlingError
|
|
124
|
+
| ValidationError
|
|
125
|
+
>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @see {@link CreateDatabaseCommand}
|
|
129
|
+
*/
|
|
130
|
+
createDatabase(
|
|
131
|
+
args: CreateDatabaseCommandInput,
|
|
132
|
+
options?: HttpHandlerOptions,
|
|
133
|
+
): Effect.Effect<
|
|
134
|
+
CreateDatabaseCommandOutput,
|
|
135
|
+
| SdkError
|
|
136
|
+
| AccessDeniedError
|
|
137
|
+
| ConflictError
|
|
138
|
+
| InternalServerError
|
|
139
|
+
| InvalidEndpointError
|
|
140
|
+
| ServiceQuotaExceededError
|
|
141
|
+
| ThrottlingError
|
|
142
|
+
| ValidationError
|
|
143
|
+
>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @see {@link CreateTableCommand}
|
|
147
|
+
*/
|
|
148
|
+
createTable(
|
|
149
|
+
args: CreateTableCommandInput,
|
|
150
|
+
options?: HttpHandlerOptions,
|
|
151
|
+
): Effect.Effect<
|
|
152
|
+
CreateTableCommandOutput,
|
|
153
|
+
| SdkError
|
|
154
|
+
| AccessDeniedError
|
|
155
|
+
| ConflictError
|
|
156
|
+
| InternalServerError
|
|
157
|
+
| InvalidEndpointError
|
|
158
|
+
| ResourceNotFoundError
|
|
159
|
+
| ServiceQuotaExceededError
|
|
160
|
+
| ThrottlingError
|
|
161
|
+
| ValidationError
|
|
162
|
+
>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @see {@link DeleteDatabaseCommand}
|
|
166
|
+
*/
|
|
167
|
+
deleteDatabase(
|
|
168
|
+
args: DeleteDatabaseCommandInput,
|
|
169
|
+
options?: HttpHandlerOptions,
|
|
170
|
+
): Effect.Effect<
|
|
171
|
+
DeleteDatabaseCommandOutput,
|
|
172
|
+
| SdkError
|
|
173
|
+
| AccessDeniedError
|
|
174
|
+
| InternalServerError
|
|
175
|
+
| InvalidEndpointError
|
|
176
|
+
| ResourceNotFoundError
|
|
177
|
+
| ThrottlingError
|
|
178
|
+
| ValidationError
|
|
179
|
+
>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @see {@link DeleteTableCommand}
|
|
183
|
+
*/
|
|
184
|
+
deleteTable(
|
|
185
|
+
args: DeleteTableCommandInput,
|
|
186
|
+
options?: HttpHandlerOptions,
|
|
187
|
+
): Effect.Effect<
|
|
188
|
+
DeleteTableCommandOutput,
|
|
189
|
+
| SdkError
|
|
190
|
+
| AccessDeniedError
|
|
191
|
+
| InternalServerError
|
|
192
|
+
| InvalidEndpointError
|
|
193
|
+
| ResourceNotFoundError
|
|
194
|
+
| ThrottlingError
|
|
195
|
+
| ValidationError
|
|
196
|
+
>;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @see {@link DescribeBatchLoadTaskCommand}
|
|
200
|
+
*/
|
|
201
|
+
describeBatchLoadTask(
|
|
202
|
+
args: DescribeBatchLoadTaskCommandInput,
|
|
203
|
+
options?: HttpHandlerOptions,
|
|
204
|
+
): Effect.Effect<
|
|
205
|
+
DescribeBatchLoadTaskCommandOutput,
|
|
206
|
+
SdkError | AccessDeniedError | InternalServerError | InvalidEndpointError | ResourceNotFoundError | ThrottlingError
|
|
207
|
+
>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @see {@link DescribeDatabaseCommand}
|
|
211
|
+
*/
|
|
212
|
+
describeDatabase(
|
|
213
|
+
args: DescribeDatabaseCommandInput,
|
|
214
|
+
options?: HttpHandlerOptions,
|
|
215
|
+
): Effect.Effect<
|
|
216
|
+
DescribeDatabaseCommandOutput,
|
|
217
|
+
| SdkError
|
|
218
|
+
| AccessDeniedError
|
|
219
|
+
| InternalServerError
|
|
220
|
+
| InvalidEndpointError
|
|
221
|
+
| ResourceNotFoundError
|
|
222
|
+
| ThrottlingError
|
|
223
|
+
| ValidationError
|
|
224
|
+
>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @see {@link DescribeEndpointsCommand}
|
|
228
|
+
*/
|
|
229
|
+
describeEndpoints(
|
|
230
|
+
args: DescribeEndpointsCommandInput,
|
|
231
|
+
options?: HttpHandlerOptions,
|
|
232
|
+
): Effect.Effect<
|
|
233
|
+
DescribeEndpointsCommandOutput,
|
|
234
|
+
SdkError | InternalServerError | ThrottlingError | ValidationError
|
|
235
|
+
>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @see {@link DescribeTableCommand}
|
|
239
|
+
*/
|
|
240
|
+
describeTable(
|
|
241
|
+
args: DescribeTableCommandInput,
|
|
242
|
+
options?: HttpHandlerOptions,
|
|
243
|
+
): Effect.Effect<
|
|
244
|
+
DescribeTableCommandOutput,
|
|
245
|
+
| SdkError
|
|
246
|
+
| AccessDeniedError
|
|
247
|
+
| InternalServerError
|
|
248
|
+
| InvalidEndpointError
|
|
249
|
+
| ResourceNotFoundError
|
|
250
|
+
| ThrottlingError
|
|
251
|
+
| ValidationError
|
|
252
|
+
>;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @see {@link ListBatchLoadTasksCommand}
|
|
256
|
+
*/
|
|
257
|
+
listBatchLoadTasks(
|
|
258
|
+
args: ListBatchLoadTasksCommandInput,
|
|
259
|
+
options?: HttpHandlerOptions,
|
|
260
|
+
): Effect.Effect<
|
|
261
|
+
ListBatchLoadTasksCommandOutput,
|
|
262
|
+
SdkError | AccessDeniedError | InternalServerError | InvalidEndpointError | ThrottlingError | ValidationError
|
|
263
|
+
>;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @see {@link ListDatabasesCommand}
|
|
267
|
+
*/
|
|
268
|
+
listDatabases(
|
|
269
|
+
args: ListDatabasesCommandInput,
|
|
270
|
+
options?: HttpHandlerOptions,
|
|
271
|
+
): Effect.Effect<
|
|
272
|
+
ListDatabasesCommandOutput,
|
|
273
|
+
SdkError | AccessDeniedError | InternalServerError | InvalidEndpointError | ThrottlingError | ValidationError
|
|
274
|
+
>;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @see {@link ListTablesCommand}
|
|
278
|
+
*/
|
|
279
|
+
listTables(
|
|
280
|
+
args: ListTablesCommandInput,
|
|
281
|
+
options?: HttpHandlerOptions,
|
|
282
|
+
): Effect.Effect<
|
|
283
|
+
ListTablesCommandOutput,
|
|
284
|
+
| SdkError
|
|
285
|
+
| AccessDeniedError
|
|
286
|
+
| InternalServerError
|
|
287
|
+
| InvalidEndpointError
|
|
288
|
+
| ResourceNotFoundError
|
|
289
|
+
| ThrottlingError
|
|
290
|
+
| ValidationError
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* @see {@link ListTagsForResourceCommand}
|
|
295
|
+
*/
|
|
296
|
+
listTagsForResource(
|
|
297
|
+
args: ListTagsForResourceCommandInput,
|
|
298
|
+
options?: HttpHandlerOptions,
|
|
299
|
+
): Effect.Effect<
|
|
300
|
+
ListTagsForResourceCommandOutput,
|
|
301
|
+
SdkError | InvalidEndpointError | ResourceNotFoundError | ThrottlingError | ValidationError
|
|
302
|
+
>;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @see {@link ResumeBatchLoadTaskCommand}
|
|
306
|
+
*/
|
|
307
|
+
resumeBatchLoadTask(
|
|
308
|
+
args: ResumeBatchLoadTaskCommandInput,
|
|
309
|
+
options?: HttpHandlerOptions,
|
|
310
|
+
): Effect.Effect<
|
|
311
|
+
ResumeBatchLoadTaskCommandOutput,
|
|
312
|
+
| SdkError
|
|
313
|
+
| AccessDeniedError
|
|
314
|
+
| InternalServerError
|
|
315
|
+
| InvalidEndpointError
|
|
316
|
+
| ResourceNotFoundError
|
|
317
|
+
| ThrottlingError
|
|
318
|
+
| ValidationError
|
|
319
|
+
>;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @see {@link TagResourceCommand}
|
|
323
|
+
*/
|
|
324
|
+
tagResource(
|
|
325
|
+
args: TagResourceCommandInput,
|
|
326
|
+
options?: HttpHandlerOptions,
|
|
327
|
+
): Effect.Effect<
|
|
328
|
+
TagResourceCommandOutput,
|
|
329
|
+
| SdkError
|
|
330
|
+
| InvalidEndpointError
|
|
331
|
+
| ResourceNotFoundError
|
|
332
|
+
| ServiceQuotaExceededError
|
|
333
|
+
| ThrottlingError
|
|
334
|
+
| ValidationError
|
|
335
|
+
>;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* @see {@link UntagResourceCommand}
|
|
339
|
+
*/
|
|
340
|
+
untagResource(
|
|
341
|
+
args: UntagResourceCommandInput,
|
|
342
|
+
options?: HttpHandlerOptions,
|
|
343
|
+
): Effect.Effect<
|
|
344
|
+
UntagResourceCommandOutput,
|
|
345
|
+
| SdkError
|
|
346
|
+
| InvalidEndpointError
|
|
347
|
+
| ResourceNotFoundError
|
|
348
|
+
| ServiceQuotaExceededError
|
|
349
|
+
| ThrottlingError
|
|
350
|
+
| ValidationError
|
|
351
|
+
>;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @see {@link UpdateDatabaseCommand}
|
|
355
|
+
*/
|
|
356
|
+
updateDatabase(
|
|
357
|
+
args: UpdateDatabaseCommandInput,
|
|
358
|
+
options?: HttpHandlerOptions,
|
|
359
|
+
): Effect.Effect<
|
|
360
|
+
UpdateDatabaseCommandOutput,
|
|
361
|
+
| SdkError
|
|
362
|
+
| AccessDeniedError
|
|
363
|
+
| InternalServerError
|
|
364
|
+
| InvalidEndpointError
|
|
365
|
+
| ResourceNotFoundError
|
|
366
|
+
| ServiceQuotaExceededError
|
|
367
|
+
| ThrottlingError
|
|
368
|
+
| ValidationError
|
|
369
|
+
>;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @see {@link UpdateTableCommand}
|
|
373
|
+
*/
|
|
374
|
+
updateTable(
|
|
375
|
+
args: UpdateTableCommandInput,
|
|
376
|
+
options?: HttpHandlerOptions,
|
|
377
|
+
): Effect.Effect<
|
|
378
|
+
UpdateTableCommandOutput,
|
|
379
|
+
| SdkError
|
|
380
|
+
| AccessDeniedError
|
|
381
|
+
| InternalServerError
|
|
382
|
+
| InvalidEndpointError
|
|
383
|
+
| ResourceNotFoundError
|
|
384
|
+
| ThrottlingError
|
|
385
|
+
| ValidationError
|
|
386
|
+
>;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* @see {@link WriteRecordsCommand}
|
|
390
|
+
*/
|
|
391
|
+
writeRecords(
|
|
392
|
+
args: WriteRecordsCommandInput,
|
|
393
|
+
options?: HttpHandlerOptions,
|
|
394
|
+
): Effect.Effect<
|
|
395
|
+
WriteRecordsCommandOutput,
|
|
396
|
+
| SdkError
|
|
397
|
+
| AccessDeniedError
|
|
398
|
+
| InternalServerError
|
|
399
|
+
| InvalidEndpointError
|
|
400
|
+
| RejectedRecordsError
|
|
401
|
+
| ResourceNotFoundError
|
|
402
|
+
| ThrottlingError
|
|
403
|
+
| ValidationError
|
|
404
|
+
>;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @since 1.0.0
|
|
409
|
+
* @category constructors
|
|
410
|
+
*/
|
|
411
|
+
export const makeTimestreamWriteService = Effect.gen(function*() {
|
|
412
|
+
const client = yield* Instance.TimestreamWriteClientInstance;
|
|
413
|
+
|
|
414
|
+
return Service.fromClientAndCommands<TimestreamWriteService$>(
|
|
415
|
+
client,
|
|
416
|
+
commands,
|
|
417
|
+
{
|
|
418
|
+
errorTags: AllServiceErrors,
|
|
419
|
+
resolveClientConfig: TimestreamWriteServiceConfig.toTimestreamWriteClientConfig,
|
|
420
|
+
},
|
|
421
|
+
);
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* @since 1.0.0
|
|
426
|
+
* @category models
|
|
427
|
+
*/
|
|
428
|
+
export class TimestreamWriteService extends Effect.Tag("@effect-aws/client-timestream-write/TimestreamWriteService")<
|
|
429
|
+
TimestreamWriteService,
|
|
430
|
+
TimestreamWriteService$
|
|
431
|
+
>() {
|
|
432
|
+
static readonly defaultLayer = Layer.effect(this, makeTimestreamWriteService).pipe(Layer.provide(Instance.layer));
|
|
433
|
+
static readonly layer = (config: TimestreamWriteService.Config) =>
|
|
434
|
+
Layer.effect(this, makeTimestreamWriteService).pipe(
|
|
435
|
+
Layer.provide(Instance.layer),
|
|
436
|
+
Layer.provide(TimestreamWriteServiceConfig.setTimestreamWriteServiceConfig(config)),
|
|
437
|
+
);
|
|
438
|
+
static readonly baseLayer = (
|
|
439
|
+
evaluate: (defaultConfig: TimestreamWriteClientConfig) => TimestreamWriteClient,
|
|
440
|
+
) =>
|
|
441
|
+
Layer.effect(this, makeTimestreamWriteService).pipe(
|
|
442
|
+
Layer.provide(
|
|
443
|
+
Layer.effect(
|
|
444
|
+
Instance.TimestreamWriteClientInstance,
|
|
445
|
+
Effect.map(TimestreamWriteServiceConfig.toTimestreamWriteClientConfig, evaluate),
|
|
446
|
+
),
|
|
447
|
+
),
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* @since 1.0.0
|
|
453
|
+
*/
|
|
454
|
+
export declare namespace TimestreamWriteService {
|
|
455
|
+
/**
|
|
456
|
+
* @since 1.0.0
|
|
457
|
+
*/
|
|
458
|
+
export interface Config extends Omit<TimestreamWriteClientConfig, "logger"> {
|
|
459
|
+
readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { TimestreamWriteClientConfig } from "@aws-sdk/client-timestream-write";
|
|
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 { TimestreamWriteService } from "./TimestreamWriteService.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category timestream-write service config
|
|
14
|
+
*/
|
|
15
|
+
const currentTimestreamWriteServiceConfig = globalValue(
|
|
16
|
+
"@effect-aws/client-timestream-write/currentTimestreamWriteServiceConfig",
|
|
17
|
+
() => FiberRef.unsafeMake<TimestreamWriteService.Config>({}),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category timestream-write service config
|
|
23
|
+
*/
|
|
24
|
+
export const withTimestreamWriteServiceConfig: {
|
|
25
|
+
(config: TimestreamWriteService.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: TimestreamWriteService.Config): Effect.Effect<A, E, R>;
|
|
27
|
+
} = dual(
|
|
28
|
+
2,
|
|
29
|
+
<A, E, R>(effect: Effect.Effect<A, E, R>, config: TimestreamWriteService.Config): Effect.Effect<A, E, R> =>
|
|
30
|
+
Effect.locally(effect, currentTimestreamWriteServiceConfig, config),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category timestream-write service config
|
|
36
|
+
*/
|
|
37
|
+
export const setTimestreamWriteServiceConfig = (config: TimestreamWriteService.Config) =>
|
|
38
|
+
Layer.locallyScoped(currentTimestreamWriteServiceConfig, config);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category adapters
|
|
43
|
+
*/
|
|
44
|
+
export const toTimestreamWriteClientConfig: Effect.Effect<TimestreamWriteClientConfig> = Effect.gen(function*() {
|
|
45
|
+
const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentTimestreamWriteServiceConfig);
|
|
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/index.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import { TimestreamWriteService } from "./TimestreamWriteService.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 TimestreamWriteClientInstance from "./TimestreamWriteClientInstance.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
*/
|
|
19
|
+
export * as TimestreamWriteServiceConfig from "./TimestreamWriteServiceConfig.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
export * from "./TimestreamWriteService.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category exports
|
|
29
|
+
* @alias TimestreamWriteService
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace TimestreamWrite {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @alias TimestreamWriteService.Config
|
|
35
|
+
*/
|
|
36
|
+
export type Config = TimestreamWriteService.Config;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @since 1.0.0
|
|
41
|
+
* @category exports
|
|
42
|
+
* @alias TimestreamWriteService
|
|
43
|
+
*/
|
|
44
|
+
export const TimestreamWrite = TimestreamWriteService;
|