@allthings/cloud-toolkit 2.3.0-dev.9 → 2.3.1
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/dist/lib.cjs.js +17 -9
- package/dist/lib.esm.js +17 -9
- package/dist/lib.umd.min.js +1 -1
- package/dist/src/alagarr/index.d.ts +2 -2
- package/dist/src/alagarr/request/index.d.ts +2 -2
- package/dist/src/alagarr/request/middleware/cookies.d.ts +1 -3
- package/dist/src/alagarr/request/middleware/normalizeHeaders.d.ts +2 -2
- package/dist/src/alagarr/request/middleware/normalizeProgrammingModel.d.ts +2 -2
- package/dist/src/alagarr/response/index.d.ts +1 -0
- package/dist/src/alagarr/types.d.ts +20 -17
- package/dist/src/aws/dynamodb.d.ts +3 -5
- package/package.json +28 -27
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ClientError from './errors/clientError';
|
|
2
2
|
import ServerError from './errors/serverError';
|
|
3
|
-
import { Alagarr, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceResponse } from './types';
|
|
4
|
-
export { Alagarr, ClientError, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceResponse, ServerError, };
|
|
3
|
+
import { Alagarr, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceRequestV2, IInterfaceResponse } from './types';
|
|
4
|
+
export { Alagarr, ClientError, HandlerFunction, IInterfaceAlagarrOptions, IInterfaceHeaders, IInterfaceQueryParameters, IInterfaceRequest, IInterfaceRequestV2, IInterfaceResponse, ServerError, };
|
|
5
5
|
declare const alagarr: (handler?: HandlerFunction, options?: IInterfaceAlagarrOptions) => Alagarr;
|
|
6
6
|
export default alagarr;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { APIGatewayProxyEvent, APIGatewayProxyEventV2, Context } from 'aws-lambda';
|
|
2
2
|
import { IInterfaceAlagarrOptions, IInterfaceRequest } from '../types';
|
|
3
|
-
declare const _default: (event:
|
|
3
|
+
declare const _default: (event: APIGatewayProxyEvent | APIGatewayProxyEventV2, context: Context, options?: IInterfaceAlagarrOptions) => Promise<IInterfaceRequest>;
|
|
4
4
|
export default _default;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { IInterfaceRequest } from '../../types';
|
|
2
|
-
export
|
|
3
|
-
readonly [key: string]: string;
|
|
4
|
-
}
|
|
2
|
+
export type IInterfaceCookie = Readonly<Record<string, string>>;
|
|
5
3
|
declare const cookies: (request: IInterfaceRequest) => IInterfaceRequest;
|
|
6
4
|
export default cookies;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IInterfaceRequest } from '../../types';
|
|
2
|
-
declare const normalizeHeaders: ({ headers, ...request }: IInterfaceRequest) => IInterfaceRequest;
|
|
1
|
+
import { IInterfaceRequest, IInterfaceRequestV2 } from '../../types';
|
|
2
|
+
declare const normalizeHeaders: ({ headers, ...request }: IInterfaceRequest | IInterfaceRequestV2) => IInterfaceRequest | IInterfaceRequestV2;
|
|
3
3
|
export default normalizeHeaders;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IInterfaceRequest } from '../../types';
|
|
2
|
-
declare const normalizeProgrammingModel: (request: IInterfaceRequest) => IInterfaceRequest;
|
|
1
|
+
import { IInterfaceRequest, IInterfaceRequestV2 } from '../../types';
|
|
2
|
+
declare const normalizeProgrammingModel: (request: IInterfaceRequest | IInterfaceRequestV2) => IInterfaceRequest | IInterfaceRequestV2;
|
|
3
3
|
export default normalizeProgrammingModel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import AWSLambda from 'aws-lambda';
|
|
1
2
|
import { IInterfaceAlagarrOptions, IInterfaceRequest, IInterfaceResponse } from '../types';
|
|
2
3
|
declare const _default: (request: IInterfaceRequest, callback: AWSLambda.Callback, options: IInterfaceAlagarrOptions) => Promise<IInterfaceResponse>;
|
|
3
4
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { APIGatewayEvent, Callback, Context } from 'aws-lambda';
|
|
2
|
-
export type Alagarr = (event: APIGatewayEvent, context: Context, callback: Callback) => void;
|
|
1
|
+
import { APIGatewayEvent, APIGatewayProxyEventV2, Callback, Context } from 'aws-lambda';
|
|
2
|
+
export type Alagarr = (event: APIGatewayEvent | APIGatewayProxyEventV2, context: Context, callback: Callback) => void;
|
|
3
3
|
export type HandlerFunction = (request: any, response: any, context?: Context) => string | object | void | Promise<string | object | void>;
|
|
4
4
|
export type Logger = (request: any, response: any) => boolean;
|
|
5
5
|
export type ErrorHandler = (request: IInterfaceRequest, response: IInterfaceResponse, error: any) => void;
|
|
@@ -18,18 +18,10 @@ export interface IInterfaceAlagarrOptions {
|
|
|
18
18
|
readonly requestMiddleware?: any;
|
|
19
19
|
readonly responseMiddleware?: any;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
readonly [name: string]: string;
|
|
26
|
-
}
|
|
27
|
-
export interface IInterfaceHeaders {
|
|
28
|
-
readonly [name: string]: string;
|
|
29
|
-
}
|
|
30
|
-
export interface IInterfaceQueryParameters {
|
|
31
|
-
readonly [name: string]: string;
|
|
32
|
-
}
|
|
21
|
+
export type IIndexSignature = Readonly<Record<string, any>>;
|
|
22
|
+
export type IInterfaceCookie = Readonly<Record<string, string>>;
|
|
23
|
+
export type IInterfaceHeaders = Readonly<Record<string, string>>;
|
|
24
|
+
export type IInterfaceQueryParameters = Readonly<Record<string, string>>;
|
|
33
25
|
export interface IInterfaceRequest extends APIGatewayEvent {
|
|
34
26
|
readonly body: any;
|
|
35
27
|
readonly context: Context;
|
|
@@ -44,6 +36,19 @@ export interface IInterfaceRequest extends APIGatewayEvent {
|
|
|
44
36
|
readonly source: string;
|
|
45
37
|
readonly timestamp: number;
|
|
46
38
|
}
|
|
39
|
+
export interface IInterfaceRequestV2 extends APIGatewayProxyEventV2 {
|
|
40
|
+
readonly body: any;
|
|
41
|
+
readonly context: Context;
|
|
42
|
+
readonly headers: IInterfaceHeaders;
|
|
43
|
+
readonly hostname?: string;
|
|
44
|
+
readonly isBase64Encoded: boolean;
|
|
45
|
+
readonly meta: IIndexSignature;
|
|
46
|
+
readonly method: string;
|
|
47
|
+
readonly provider: string;
|
|
48
|
+
readonly query: IInterfaceQueryParameters;
|
|
49
|
+
readonly source: string;
|
|
50
|
+
readonly timestamp: number;
|
|
51
|
+
}
|
|
47
52
|
export type RequestMiddleware = (request: IInterfaceRequest) => IInterfaceRequest;
|
|
48
53
|
export interface IInterfaceResponseData {
|
|
49
54
|
readonly body: string;
|
|
@@ -61,9 +66,7 @@ export interface IInterfaceRespondToFormat {
|
|
|
61
66
|
readonly json?: any;
|
|
62
67
|
}
|
|
63
68
|
export interface IInterfaceResponseOptions {
|
|
64
|
-
readonly headers?:
|
|
65
|
-
readonly [header: string]: boolean | number | string;
|
|
66
|
-
};
|
|
69
|
+
readonly headers?: Readonly<Record<string, boolean | number | string>>;
|
|
67
70
|
readonly isBase64Encoded?: boolean;
|
|
68
71
|
}
|
|
69
72
|
export interface IInterfaceResponse {
|
|
@@ -15,11 +15,9 @@ export interface IDynamoDBConfig {
|
|
|
15
15
|
tableNamePrefix: string;
|
|
16
16
|
}
|
|
17
17
|
export interface IUnprocessedItems {
|
|
18
|
-
UnprocessedItems: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}[];
|
|
22
|
-
};
|
|
18
|
+
UnprocessedItems: Record<string, {
|
|
19
|
+
PutRequest: PutRequest;
|
|
20
|
+
}[]>;
|
|
23
21
|
}
|
|
24
22
|
export type TBatchWriteItems = (table: string, items: PutRequest['Item'][]) => Promise<readonly PutRequest['Item'][] | undefined>;
|
|
25
23
|
export type TDeleteItem = (table: string, key: string | object, options?: Partial<DeleteCommandInput>) => Promise<DeleteCommandOutput['Attributes'] | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allthings/cloud-toolkit",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Allthings GmbH",
|
|
6
6
|
"keywords": [
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=18.16"
|
|
18
18
|
},
|
|
19
|
+
"packageManager": "yarn@1.22.22",
|
|
19
20
|
"main": "dist/lib.cjs.js",
|
|
20
21
|
"module": "dist/lib.esm.js",
|
|
21
22
|
"browser": "dist/lib.umd.min.js",
|
|
@@ -50,43 +51,43 @@
|
|
|
50
51
|
"serve": "npx serve -l 3333"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@aws-sdk/client-dynamodb": "3.
|
|
54
|
-
"@aws-sdk/client-lambda": "3.
|
|
55
|
-
"@aws-sdk/client-ses": "3.
|
|
56
|
-
"@aws-sdk/client-sqs": "3.
|
|
57
|
-
"@aws-sdk/client-ssm": "3.
|
|
58
|
-
"@aws-sdk/lib-dynamodb": "3.
|
|
59
|
-
"bottleneck": "2.19.5",
|
|
60
|
-
"cross-fetch": "4.1.0",
|
|
61
|
-
"nodemailer": "6.10.1",
|
|
62
|
-
"query-string": "9.
|
|
63
|
-
"winston": "3.17.0"
|
|
54
|
+
"@aws-sdk/client-dynamodb": "^3.891.0",
|
|
55
|
+
"@aws-sdk/client-lambda": "^3.891.0",
|
|
56
|
+
"@aws-sdk/client-ses": "^3.891.0",
|
|
57
|
+
"@aws-sdk/client-sqs": "^3.891.0",
|
|
58
|
+
"@aws-sdk/client-ssm": "^3.891.0",
|
|
59
|
+
"@aws-sdk/lib-dynamodb": "^3.891.0",
|
|
60
|
+
"bottleneck": "^2.19.5",
|
|
61
|
+
"cross-fetch": "^4.1.0",
|
|
62
|
+
"nodemailer": "^6.10.1",
|
|
63
|
+
"query-string": "^9.2.2",
|
|
64
|
+
"winston": "^3.17.0"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@allthings/eslint-config": "2.
|
|
67
|
-
"@commitlint/cli": "19.8.
|
|
68
|
-
"@commitlint/config-conventional": "19.8.
|
|
69
|
-
"@rollup/plugin-commonjs": "28.0.
|
|
67
|
+
"@allthings/eslint-config": "2.2.2",
|
|
68
|
+
"@commitlint/cli": "19.8.1",
|
|
69
|
+
"@commitlint/config-conventional": "19.8.1",
|
|
70
|
+
"@rollup/plugin-commonjs": "28.0.6",
|
|
70
71
|
"@rollup/plugin-json": "6.1.0",
|
|
71
72
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
72
73
|
"@rollup/plugin-replace": "6.0.2",
|
|
73
74
|
"@rollup/plugin-terser": "0.4.4",
|
|
74
|
-
"@types/aws-lambda": "8.10.
|
|
75
|
-
"@types/jest": "
|
|
76
|
-
"@types/node": "22.
|
|
77
|
-
"@types/nodemailer": "6.4.
|
|
75
|
+
"@types/aws-lambda": "8.10.152",
|
|
76
|
+
"@types/jest": "30.0.0",
|
|
77
|
+
"@types/node": "22.18.1",
|
|
78
|
+
"@types/nodemailer": "6.4.19",
|
|
78
79
|
"@types/query-string": "6.3.0",
|
|
79
80
|
"aws-sdk-client-mock": "4.1.0",
|
|
80
81
|
"eslint": "8.57.1",
|
|
81
82
|
"husky": "9.1.7",
|
|
82
|
-
"jest": "
|
|
83
|
-
"lint-staged": "
|
|
84
|
-
"prettier": "3.
|
|
85
|
-
"rimraf": "
|
|
86
|
-
"rollup": "4.
|
|
83
|
+
"jest": "30.1.3",
|
|
84
|
+
"lint-staged": "16.1.6",
|
|
85
|
+
"prettier": "3.6.2",
|
|
86
|
+
"rimraf": "6.0.1",
|
|
87
|
+
"rollup": "4.50.0",
|
|
87
88
|
"semantic-release": "19.0.5",
|
|
88
|
-
"ts-jest": "29.
|
|
89
|
-
"typescript": "5.
|
|
89
|
+
"ts-jest": "29.4.1",
|
|
90
|
+
"typescript": "5.9.2"
|
|
90
91
|
},
|
|
91
92
|
"prettier": {
|
|
92
93
|
"printWidth": 80,
|