@allthings/cloud-toolkit 1.3.0-dev.2 → 1.4.0

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.
@@ -0,0 +1,47 @@
1
+ import { DynamoDBClientConfig, PutRequest, QueryOutput, ScanOutput } from '@aws-sdk/client-dynamodb';
2
+ import { DeleteCommandInput, DeleteCommandOutput, DynamoDBDocumentClient, GetCommandInput, GetCommandOutput, PutCommandInput, QueryCommandInput, ScanCommandInput, UpdateCommandInput, UpdateCommandOutput } from '@aws-sdk/lib-dynamodb';
3
+ import { TAWSLogger } from './types';
4
+ export interface IDynamoDBConfig {
5
+ batchWriteMaxRetries?: number;
6
+ clientConfig?: DynamoDBClientConfig;
7
+ dockerConfig?: {
8
+ endpoint: string;
9
+ };
10
+ logger?: TAWSLogger;
11
+ queueConfig?: {
12
+ queueConcurrency?: number | undefined;
13
+ queueDelay?: number | undefined;
14
+ };
15
+ tableNamePrefix: string;
16
+ }
17
+ export interface IUnprocessedItems {
18
+ UnprocessedItems: {
19
+ [key: string]: {
20
+ PutRequest: PutRequest;
21
+ }[];
22
+ };
23
+ }
24
+ export type TBatchWriteItems = (table: string, items: PutRequest['Item'][]) => Promise<readonly PutRequest['Item'][] | undefined>;
25
+ export type TDeleteItem = (table: string, key: string | object, options?: Partial<DeleteCommandInput>) => Promise<DeleteCommandOutput['Attributes'] | undefined>;
26
+ export type TGetItem = (table: string, key: string | object, options?: Partial<GetCommandInput>) => Promise<GetCommandOutput['Item'] | undefined>;
27
+ export type TPutItem = (table: string, item: PutCommandInput['Item']) => Promise<PutCommandInput['Item'] | undefined>;
28
+ export type TQueryTable = (table: string, options?: Partial<QueryCommandInput>) => Promise<QueryOutput | undefined>;
29
+ export type TScanTable = (table: string, options?: Partial<ScanCommandInput>) => Promise<ScanOutput | undefined>;
30
+ export type TUpdateItem = (table: string, key: string | object, options?: Partial<UpdateCommandInput>) => Promise<UpdateCommandOutput['Attributes'] | undefined>;
31
+ declare const deleteItem: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, key: string | object, options?: Partial<DeleteCommandInput>) => Promise<DeleteCommandOutput['Attributes'] | undefined>;
32
+ declare const getItem: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, key: string | object, options?: Partial<GetCommandInput>) => Promise<GetCommandOutput['Item'] | undefined>;
33
+ declare const putItem: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, Item: PutCommandInput['Item']) => Promise<PutCommandInput['Item'] | undefined>;
34
+ declare const updateItem: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, key: string | object, options?: Partial<UpdateCommandInput>) => Promise<UpdateCommandOutput['Attributes'] | undefined>;
35
+ declare const batchWriteItems: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, items: PutRequest['Item'][]) => Promise<readonly PutRequest['Item'][] | undefined>;
36
+ declare const scanTable: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, options?: Partial<ScanCommandInput>) => Promise<ScanOutput | undefined>;
37
+ declare const queryTable: (config: IDynamoDBConfig, documentClient: DynamoDBDocumentClient, table: string, options?: Partial<QueryCommandInput>) => Promise<QueryOutput | undefined>;
38
+ declare const dynamodb: (userConfig: IDynamoDBConfig) => {
39
+ batchWriteItems: TBatchWriteItems;
40
+ deleteItem: TDeleteItem;
41
+ getItem: TGetItem;
42
+ putItem: TPutItem;
43
+ queryTable: TQueryTable;
44
+ scanTable: TScanTable;
45
+ updateItem: TUpdateItem;
46
+ };
47
+ export default dynamodb;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ export { default as dynamodb, IDynamoDBConfig, IUnprocessedItems, TBatchWriteItems, TDeleteItem, TGetItem, TPutItem, TQueryTable, TScanTable, TUpdateItem, } from './dynamodb';
1
2
  export { ILambda, default as lambda, TInvokeLambda } from './lambda';
2
3
  export { DEFAULT_CLIENT_CONFIG as DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, IParameterStore, default as parameterStore, TGetSecret, TGetSecrets, } from './parameterStore';
3
4
  export { DEFAULT_CLIENT_CONFIG as DEFAULT_SES_CLIENT_CONFIG, IEmailAttachment, IEmailOptions, ISES, default as ses, TSendMail, } from './ses';
@@ -7,10 +7,14 @@ export interface IParameterStore {
7
7
  onlyDefault?: boolean;
8
8
  prefix?: string;
9
9
  }
10
+ interface IParameter {
11
+ name: string;
12
+ value: string;
13
+ }
10
14
  export type TGetSecret = (parameter: string, defaultValue?: string) => Promise<string>;
11
- export type TGetSecrets = (parameters: string[], defaultValue?: string) => Promise<string[]>;
15
+ export type TGetSecrets = (parameters: string[], defaultValues?: IParameter[]) => Promise<IParameter[]>;
12
16
  export declare const DEFAULT_CLIENT_CONFIG: IParameterStore;
13
- declare const getSecrets: (ssm: SSMClient, config: IParameterStore, parameters_: string[], defaultValue: string) => Promise<string[]>;
17
+ declare const getSecrets: (ssm: SSMClient, config: IParameterStore, parameters_: string[], defaultValues: IParameter[]) => Promise<IParameter[]>;
14
18
  declare const getSecret: (ssm: SSMClient, config: IParameterStore, parameter_: string, defaultValue: string) => Promise<string>;
15
19
  declare const parameterStore: (userConfig: IParameterStore) => {
16
20
  getSecret: TGetSecret;
@@ -1,2 +1,2 @@
1
- export { DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, DEFAULT_SES_CLIENT_CONFIG, IEmailAttachment, IEmailOptions, ILambda, IParameterStore, ISES, lambda, parameterStore, ses, TGetSecret, TGetSecrets, TInvokeLambda, TSendMail, } from './aws';
1
+ export { DEFAULT_PARAMETER_STORE_CLIENT_CONFIG, DEFAULT_SES_CLIENT_CONFIG, dynamodb, IDynamoDBConfig, IEmailAttachment, IEmailOptions, ILambda, IParameterStore, ISES, IUnprocessedItems, lambda, parameterStore, ses, TBatchWriteItems, TDeleteItem, TGetItem, TGetSecret, TGetSecrets, TInvokeLambda, TPutItem, TQueryTable, TScanTable, TSendMail, TUpdateItem, } from './aws';
2
2
  export { default as logger } from './logger/logger';
@@ -1,8 +1,9 @@
1
+ import { Logger } from 'winston';
1
2
  interface ILoggerConfig {
2
3
  datadogApiKey?: string;
3
4
  defaultLogInformation?: object;
4
5
  deploymentStage: string;
5
6
  service: string;
6
7
  }
7
- declare const logger: (config: ILoggerConfig) => import("winston").Logger;
8
+ declare const logger: (config: ILoggerConfig) => Logger;
8
9
  export default logger;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const splitEvery: <T>(every: number, list: readonly T[]) => T[][];
2
+ export declare const until: <A, B>(predicate: (value: B, iteration: number) => boolean | Promise<boolean>, transformer: (value: A | B | undefined, iteration: number) => B | Promise<B>, initialValue?: A | B | undefined, iterationCount?: number) => Promise<B>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/cloud-toolkit",
3
- "version": "1.3.0-dev.2",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [
@@ -50,14 +50,15 @@
50
50
  "serve": "npx serve -l 3333"
51
51
  },
52
52
  "dependencies": {
53
- "@aws-sdk/client-lambda": "3.688.0",
54
- "@aws-sdk/client-ses": "3.687.0",
55
- "@aws-sdk/client-ssm": "3.682.0",
56
- "@aws-sdk/types": "3.686.0",
53
+ "@aws-sdk/client-dynamodb": "3.696.0",
54
+ "@aws-sdk/lib-dynamodb": "3.696.0",
55
+ "@aws-sdk/client-lambda": "3.693.0",
56
+ "@aws-sdk/client-ses": "3.693.0",
57
+ "@aws-sdk/client-ssm": "3.693.0",
57
58
  "bottleneck": "2.19.5",
58
59
  "cross-fetch": "4.0.0",
59
60
  "nodemailer": "6.9.16",
60
- "query-string": "7.1.3",
61
+ "query-string": "9.1.1",
61
62
  "winston": "3.17.0"
62
63
  },
63
64
  "devDependencies": {