@effect-aws/client-timestream-influxdb 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.
Files changed (53) hide show
  1. package/Errors/package.json +6 -0
  2. package/LICENSE +19 -0
  3. package/README.md +58 -0
  4. package/TimestreamInfluxDBClientInstance/package.json +6 -0
  5. package/TimestreamInfluxDBService/package.json +6 -0
  6. package/TimestreamInfluxDBServiceConfig/package.json +6 -0
  7. package/dist/cjs/Errors.d.ts +14 -0
  8. package/dist/cjs/Errors.d.ts.map +1 -0
  9. package/dist/cjs/Errors.js +15 -0
  10. package/dist/cjs/Errors.js.map +1 -0
  11. package/dist/cjs/TimestreamInfluxDBClientInstance.d.ts +24 -0
  12. package/dist/cjs/TimestreamInfluxDBClientInstance.d.ts.map +1 -0
  13. package/dist/cjs/TimestreamInfluxDBClientInstance.js +50 -0
  14. package/dist/cjs/TimestreamInfluxDBClientInstance.js.map +1 -0
  15. package/dist/cjs/TimestreamInfluxDBService.d.ts +109 -0
  16. package/dist/cjs/TimestreamInfluxDBService.d.ts.map +1 -0
  17. package/dist/cjs/TimestreamInfluxDBService.js +76 -0
  18. package/dist/cjs/TimestreamInfluxDBService.js.map +1 -0
  19. package/dist/cjs/TimestreamInfluxDBServiceConfig.d.ts +25 -0
  20. package/dist/cjs/TimestreamInfluxDBServiceConfig.d.ts.map +1 -0
  21. package/dist/cjs/TimestreamInfluxDBServiceConfig.js +35 -0
  22. package/dist/cjs/TimestreamInfluxDBServiceConfig.js.map +1 -0
  23. package/dist/cjs/index.d.ts +39 -0
  24. package/dist/cjs/index.d.ts.map +1 -0
  25. package/dist/cjs/index.js +56 -0
  26. package/dist/cjs/index.js.map +1 -0
  27. package/dist/dts/Errors.d.ts +14 -0
  28. package/dist/dts/Errors.d.ts.map +1 -0
  29. package/dist/dts/TimestreamInfluxDBClientInstance.d.ts +24 -0
  30. package/dist/dts/TimestreamInfluxDBClientInstance.d.ts.map +1 -0
  31. package/dist/dts/TimestreamInfluxDBService.d.ts +109 -0
  32. package/dist/dts/TimestreamInfluxDBService.d.ts.map +1 -0
  33. package/dist/dts/TimestreamInfluxDBServiceConfig.d.ts +25 -0
  34. package/dist/dts/TimestreamInfluxDBServiceConfig.d.ts.map +1 -0
  35. package/dist/dts/index.d.ts +39 -0
  36. package/dist/dts/index.d.ts.map +1 -0
  37. package/dist/esm/Errors.js +12 -0
  38. package/dist/esm/Errors.js.map +1 -0
  39. package/dist/esm/TimestreamInfluxDBClientInstance.js +23 -0
  40. package/dist/esm/TimestreamInfluxDBClientInstance.js.map +1 -0
  41. package/dist/esm/TimestreamInfluxDBService.js +49 -0
  42. package/dist/esm/TimestreamInfluxDBService.js.map +1 -0
  43. package/dist/esm/TimestreamInfluxDBServiceConfig.js +31 -0
  44. package/dist/esm/TimestreamInfluxDBServiceConfig.js.map +1 -0
  45. package/dist/esm/index.js +27 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/package.json +4 -0
  48. package/package.json +71 -0
  49. package/src/Errors.ts +32 -0
  50. package/src/TimestreamInfluxDBClientInstance.ts +33 -0
  51. package/src/TimestreamInfluxDBService.ts +387 -0
  52. package/src/TimestreamInfluxDBServiceConfig.ts +52 -0
  53. package/src/index.ts +44 -0
@@ -0,0 +1,387 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import {
5
+ CreateDbClusterCommand,
6
+ type CreateDbClusterCommandInput,
7
+ type CreateDbClusterCommandOutput,
8
+ CreateDbInstanceCommand,
9
+ type CreateDbInstanceCommandInput,
10
+ type CreateDbInstanceCommandOutput,
11
+ CreateDbParameterGroupCommand,
12
+ type CreateDbParameterGroupCommandInput,
13
+ type CreateDbParameterGroupCommandOutput,
14
+ DeleteDbClusterCommand,
15
+ type DeleteDbClusterCommandInput,
16
+ type DeleteDbClusterCommandOutput,
17
+ DeleteDbInstanceCommand,
18
+ type DeleteDbInstanceCommandInput,
19
+ type DeleteDbInstanceCommandOutput,
20
+ GetDbClusterCommand,
21
+ type GetDbClusterCommandInput,
22
+ type GetDbClusterCommandOutput,
23
+ GetDbInstanceCommand,
24
+ type GetDbInstanceCommandInput,
25
+ type GetDbInstanceCommandOutput,
26
+ GetDbParameterGroupCommand,
27
+ type GetDbParameterGroupCommandInput,
28
+ type GetDbParameterGroupCommandOutput,
29
+ ListDbClustersCommand,
30
+ type ListDbClustersCommandInput,
31
+ type ListDbClustersCommandOutput,
32
+ ListDbInstancesCommand,
33
+ type ListDbInstancesCommandInput,
34
+ type ListDbInstancesCommandOutput,
35
+ ListDbInstancesForClusterCommand,
36
+ type ListDbInstancesForClusterCommandInput,
37
+ type ListDbInstancesForClusterCommandOutput,
38
+ ListDbParameterGroupsCommand,
39
+ type ListDbParameterGroupsCommandInput,
40
+ type ListDbParameterGroupsCommandOutput,
41
+ ListTagsForResourceCommand,
42
+ type ListTagsForResourceCommandInput,
43
+ type ListTagsForResourceCommandOutput,
44
+ TagResourceCommand,
45
+ type TagResourceCommandInput,
46
+ type TagResourceCommandOutput,
47
+ type TimestreamInfluxDBClient,
48
+ type TimestreamInfluxDBClientConfig,
49
+ UntagResourceCommand,
50
+ type UntagResourceCommandInput,
51
+ type UntagResourceCommandOutput,
52
+ UpdateDbClusterCommand,
53
+ type UpdateDbClusterCommandInput,
54
+ type UpdateDbClusterCommandOutput,
55
+ UpdateDbInstanceCommand,
56
+ type UpdateDbInstanceCommandInput,
57
+ type UpdateDbInstanceCommandOutput,
58
+ } from "@aws-sdk/client-timestream-influxdb";
59
+ import type { HttpHandlerOptions, SdkError, ServiceLogger } from "@effect-aws/commons";
60
+ import { Service } from "@effect-aws/commons";
61
+ import { Effect, Layer } from "effect";
62
+ import type {
63
+ AccessDeniedError,
64
+ ConflictError,
65
+ InternalServerError,
66
+ ResourceNotFoundError,
67
+ ServiceQuotaExceededError,
68
+ ThrottlingError,
69
+ ValidationError,
70
+ } from "./Errors.js";
71
+ import { AllServiceErrors } from "./Errors.js";
72
+ import * as Instance from "./TimestreamInfluxDBClientInstance.js";
73
+ import * as TimestreamInfluxDBServiceConfig from "./TimestreamInfluxDBServiceConfig.js";
74
+
75
+ const commands = {
76
+ CreateDbClusterCommand,
77
+ CreateDbInstanceCommand,
78
+ CreateDbParameterGroupCommand,
79
+ DeleteDbClusterCommand,
80
+ DeleteDbInstanceCommand,
81
+ GetDbClusterCommand,
82
+ GetDbInstanceCommand,
83
+ GetDbParameterGroupCommand,
84
+ ListDbClustersCommand,
85
+ ListDbInstancesCommand,
86
+ ListDbInstancesForClusterCommand,
87
+ ListDbParameterGroupsCommand,
88
+ ListTagsForResourceCommand,
89
+ TagResourceCommand,
90
+ UntagResourceCommand,
91
+ UpdateDbClusterCommand,
92
+ UpdateDbInstanceCommand,
93
+ };
94
+
95
+ interface TimestreamInfluxDBService$ {
96
+ readonly _: unique symbol;
97
+
98
+ /**
99
+ * @see {@link CreateDbClusterCommand}
100
+ */
101
+ createDbCluster(
102
+ args: CreateDbClusterCommandInput,
103
+ options?: HttpHandlerOptions,
104
+ ): Effect.Effect<
105
+ CreateDbClusterCommandOutput,
106
+ | SdkError
107
+ | AccessDeniedError
108
+ | ConflictError
109
+ | InternalServerError
110
+ | ResourceNotFoundError
111
+ | ServiceQuotaExceededError
112
+ | ThrottlingError
113
+ | ValidationError
114
+ >;
115
+
116
+ /**
117
+ * @see {@link CreateDbInstanceCommand}
118
+ */
119
+ createDbInstance(
120
+ args: CreateDbInstanceCommandInput,
121
+ options?: HttpHandlerOptions,
122
+ ): Effect.Effect<
123
+ CreateDbInstanceCommandOutput,
124
+ | SdkError
125
+ | AccessDeniedError
126
+ | ConflictError
127
+ | InternalServerError
128
+ | ResourceNotFoundError
129
+ | ServiceQuotaExceededError
130
+ | ThrottlingError
131
+ | ValidationError
132
+ >;
133
+
134
+ /**
135
+ * @see {@link CreateDbParameterGroupCommand}
136
+ */
137
+ createDbParameterGroup(
138
+ args: CreateDbParameterGroupCommandInput,
139
+ options?: HttpHandlerOptions,
140
+ ): Effect.Effect<
141
+ CreateDbParameterGroupCommandOutput,
142
+ | SdkError
143
+ | AccessDeniedError
144
+ | ConflictError
145
+ | InternalServerError
146
+ | ResourceNotFoundError
147
+ | ServiceQuotaExceededError
148
+ | ThrottlingError
149
+ | ValidationError
150
+ >;
151
+
152
+ /**
153
+ * @see {@link DeleteDbClusterCommand}
154
+ */
155
+ deleteDbCluster(
156
+ args: DeleteDbClusterCommandInput,
157
+ options?: HttpHandlerOptions,
158
+ ): Effect.Effect<
159
+ DeleteDbClusterCommandOutput,
160
+ | SdkError
161
+ | AccessDeniedError
162
+ | ConflictError
163
+ | InternalServerError
164
+ | ResourceNotFoundError
165
+ | ThrottlingError
166
+ | ValidationError
167
+ >;
168
+
169
+ /**
170
+ * @see {@link DeleteDbInstanceCommand}
171
+ */
172
+ deleteDbInstance(
173
+ args: DeleteDbInstanceCommandInput,
174
+ options?: HttpHandlerOptions,
175
+ ): Effect.Effect<
176
+ DeleteDbInstanceCommandOutput,
177
+ | SdkError
178
+ | AccessDeniedError
179
+ | ConflictError
180
+ | InternalServerError
181
+ | ResourceNotFoundError
182
+ | ThrottlingError
183
+ | ValidationError
184
+ >;
185
+
186
+ /**
187
+ * @see {@link GetDbClusterCommand}
188
+ */
189
+ getDbCluster(
190
+ args: GetDbClusterCommandInput,
191
+ options?: HttpHandlerOptions,
192
+ ): Effect.Effect<
193
+ GetDbClusterCommandOutput,
194
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
195
+ >;
196
+
197
+ /**
198
+ * @see {@link GetDbInstanceCommand}
199
+ */
200
+ getDbInstance(
201
+ args: GetDbInstanceCommandInput,
202
+ options?: HttpHandlerOptions,
203
+ ): Effect.Effect<
204
+ GetDbInstanceCommandOutput,
205
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
206
+ >;
207
+
208
+ /**
209
+ * @see {@link GetDbParameterGroupCommand}
210
+ */
211
+ getDbParameterGroup(
212
+ args: GetDbParameterGroupCommandInput,
213
+ options?: HttpHandlerOptions,
214
+ ): Effect.Effect<
215
+ GetDbParameterGroupCommandOutput,
216
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
217
+ >;
218
+
219
+ /**
220
+ * @see {@link ListDbClustersCommand}
221
+ */
222
+ listDbClusters(
223
+ args: ListDbClustersCommandInput,
224
+ options?: HttpHandlerOptions,
225
+ ): Effect.Effect<
226
+ ListDbClustersCommandOutput,
227
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
228
+ >;
229
+
230
+ /**
231
+ * @see {@link ListDbInstancesCommand}
232
+ */
233
+ listDbInstances(
234
+ args: ListDbInstancesCommandInput,
235
+ options?: HttpHandlerOptions,
236
+ ): Effect.Effect<
237
+ ListDbInstancesCommandOutput,
238
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
239
+ >;
240
+
241
+ /**
242
+ * @see {@link ListDbInstancesForClusterCommand}
243
+ */
244
+ listDbInstancesForCluster(
245
+ args: ListDbInstancesForClusterCommandInput,
246
+ options?: HttpHandlerOptions,
247
+ ): Effect.Effect<
248
+ ListDbInstancesForClusterCommandOutput,
249
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
250
+ >;
251
+
252
+ /**
253
+ * @see {@link ListDbParameterGroupsCommand}
254
+ */
255
+ listDbParameterGroups(
256
+ args: ListDbParameterGroupsCommandInput,
257
+ options?: HttpHandlerOptions,
258
+ ): Effect.Effect<
259
+ ListDbParameterGroupsCommandOutput,
260
+ SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ThrottlingError | ValidationError
261
+ >;
262
+
263
+ /**
264
+ * @see {@link ListTagsForResourceCommand}
265
+ */
266
+ listTagsForResource(
267
+ args: ListTagsForResourceCommandInput,
268
+ options?: HttpHandlerOptions,
269
+ ): Effect.Effect<
270
+ ListTagsForResourceCommandOutput,
271
+ SdkError | ResourceNotFoundError
272
+ >;
273
+
274
+ /**
275
+ * @see {@link TagResourceCommand}
276
+ */
277
+ tagResource(
278
+ args: TagResourceCommandInput,
279
+ options?: HttpHandlerOptions,
280
+ ): Effect.Effect<
281
+ TagResourceCommandOutput,
282
+ SdkError | ResourceNotFoundError | ServiceQuotaExceededError
283
+ >;
284
+
285
+ /**
286
+ * @see {@link UntagResourceCommand}
287
+ */
288
+ untagResource(
289
+ args: UntagResourceCommandInput,
290
+ options?: HttpHandlerOptions,
291
+ ): Effect.Effect<
292
+ UntagResourceCommandOutput,
293
+ SdkError | ResourceNotFoundError
294
+ >;
295
+
296
+ /**
297
+ * @see {@link UpdateDbClusterCommand}
298
+ */
299
+ updateDbCluster(
300
+ args: UpdateDbClusterCommandInput,
301
+ options?: HttpHandlerOptions,
302
+ ): Effect.Effect<
303
+ UpdateDbClusterCommandOutput,
304
+ | SdkError
305
+ | AccessDeniedError
306
+ | ConflictError
307
+ | InternalServerError
308
+ | ResourceNotFoundError
309
+ | ThrottlingError
310
+ | ValidationError
311
+ >;
312
+
313
+ /**
314
+ * @see {@link UpdateDbInstanceCommand}
315
+ */
316
+ updateDbInstance(
317
+ args: UpdateDbInstanceCommandInput,
318
+ options?: HttpHandlerOptions,
319
+ ): Effect.Effect<
320
+ UpdateDbInstanceCommandOutput,
321
+ | SdkError
322
+ | AccessDeniedError
323
+ | ConflictError
324
+ | InternalServerError
325
+ | ResourceNotFoundError
326
+ | ThrottlingError
327
+ | ValidationError
328
+ >;
329
+ }
330
+
331
+ /**
332
+ * @since 1.0.0
333
+ * @category constructors
334
+ */
335
+ export const makeTimestreamInfluxDBService = Effect.gen(function*() {
336
+ const client = yield* Instance.TimestreamInfluxDBClientInstance;
337
+
338
+ return Service.fromClientAndCommands<TimestreamInfluxDBService$>(
339
+ client,
340
+ commands,
341
+ {
342
+ errorTags: AllServiceErrors,
343
+ resolveClientConfig: TimestreamInfluxDBServiceConfig.toTimestreamInfluxDBClientConfig,
344
+ },
345
+ );
346
+ });
347
+
348
+ /**
349
+ * @since 1.0.0
350
+ * @category models
351
+ */
352
+ export class TimestreamInfluxDBService
353
+ extends Effect.Tag("@effect-aws/client-timestream-influxdb/TimestreamInfluxDBService")<
354
+ TimestreamInfluxDBService,
355
+ TimestreamInfluxDBService$
356
+ >()
357
+ {
358
+ static readonly defaultLayer = Layer.effect(this, makeTimestreamInfluxDBService).pipe(Layer.provide(Instance.layer));
359
+ static readonly layer = (config: TimestreamInfluxDBService.Config) =>
360
+ Layer.effect(this, makeTimestreamInfluxDBService).pipe(
361
+ Layer.provide(Instance.layer),
362
+ Layer.provide(TimestreamInfluxDBServiceConfig.setTimestreamInfluxDBServiceConfig(config)),
363
+ );
364
+ static readonly baseLayer = (
365
+ evaluate: (defaultConfig: TimestreamInfluxDBClientConfig) => TimestreamInfluxDBClient,
366
+ ) =>
367
+ Layer.effect(this, makeTimestreamInfluxDBService).pipe(
368
+ Layer.provide(
369
+ Layer.effect(
370
+ Instance.TimestreamInfluxDBClientInstance,
371
+ Effect.map(TimestreamInfluxDBServiceConfig.toTimestreamInfluxDBClientConfig, evaluate),
372
+ ),
373
+ ),
374
+ );
375
+ }
376
+
377
+ /**
378
+ * @since 1.0.0
379
+ */
380
+ export declare namespace TimestreamInfluxDBService {
381
+ /**
382
+ * @since 1.0.0
383
+ */
384
+ export interface Config extends Omit<TimestreamInfluxDBClientConfig, "logger"> {
385
+ readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
386
+ }
387
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import type { TimestreamInfluxDBClientConfig } from "@aws-sdk/client-timestream-influxdb";
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 { TimestreamInfluxDBService } from "./TimestreamInfluxDBService.js";
10
+
11
+ /**
12
+ * @since 1.0.0
13
+ * @category timestream-influxdb service config
14
+ */
15
+ const currentTimestreamInfluxDBServiceConfig = globalValue(
16
+ "@effect-aws/client-timestream-influxdb/currentTimestreamInfluxDBServiceConfig",
17
+ () => FiberRef.unsafeMake<TimestreamInfluxDBService.Config>({}),
18
+ );
19
+
20
+ /**
21
+ * @since 1.0.0
22
+ * @category timestream-influxdb service config
23
+ */
24
+ export const withTimestreamInfluxDBServiceConfig: {
25
+ (config: TimestreamInfluxDBService.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: TimestreamInfluxDBService.Config): Effect.Effect<A, E, R>;
27
+ } = dual(
28
+ 2,
29
+ <A, E, R>(effect: Effect.Effect<A, E, R>, config: TimestreamInfluxDBService.Config): Effect.Effect<A, E, R> =>
30
+ Effect.locally(effect, currentTimestreamInfluxDBServiceConfig, config),
31
+ );
32
+
33
+ /**
34
+ * @since 1.0.0
35
+ * @category timestream-influxdb service config
36
+ */
37
+ export const setTimestreamInfluxDBServiceConfig = (config: TimestreamInfluxDBService.Config) =>
38
+ Layer.locallyScoped(currentTimestreamInfluxDBServiceConfig, config);
39
+
40
+ /**
41
+ * @since 1.0.0
42
+ * @category adapters
43
+ */
44
+ export const toTimestreamInfluxDBClientConfig: Effect.Effect<TimestreamInfluxDBClientConfig> = Effect.gen(function*() {
45
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentTimestreamInfluxDBServiceConfig);
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 { TimestreamInfluxDBService } from "./TimestreamInfluxDBService.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 TimestreamInfluxDBClientInstance from "./TimestreamInfluxDBClientInstance.js";
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ */
19
+ export * as TimestreamInfluxDBServiceConfig from "./TimestreamInfluxDBServiceConfig.js";
20
+
21
+ /**
22
+ * @since 1.0.0
23
+ */
24
+ export * from "./TimestreamInfluxDBService.js";
25
+
26
+ /**
27
+ * @since 1.0.0
28
+ * @category exports
29
+ * @alias TimestreamInfluxDBService
30
+ */
31
+ export declare namespace TimestreamInfluxDB {
32
+ /**
33
+ * @since 1.0.0
34
+ * @alias TimestreamInfluxDBService.Config
35
+ */
36
+ export type Config = TimestreamInfluxDBService.Config;
37
+ }
38
+
39
+ /**
40
+ * @since 1.0.0
41
+ * @category exports
42
+ * @alias TimestreamInfluxDBService
43
+ */
44
+ export const TimestreamInfluxDB = TimestreamInfluxDBService;