@webda/aws 1.6.0-beta.3 → 2.0.0-beta.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/lib/deployers/cloudformation.d.ts +8 -7
- package/lib/deployers/cloudformation.js +85 -75
- package/lib/deployers/cloudformation.js.map +1 -1
- package/lib/deployers/cloudformation.spec.d.ts +1 -0
- package/lib/deployers/cloudformation.spec.js +547 -0
- package/lib/deployers/cloudformation.spec.js.map +1 -0
- package/lib/deployers/index.d.ts +8 -7
- package/lib/deployers/index.js +99 -94
- package/lib/deployers/index.js.map +1 -1
- package/lib/deployers/index.spec.d.ts +8 -0
- package/lib/deployers/index.spec.js +628 -0
- package/lib/deployers/index.spec.js.map +1 -0
- package/lib/deployers/lambdapackager.d.ts +1 -0
- package/lib/deployers/lambdapackager.js +25 -1
- package/lib/deployers/lambdapackager.js.map +1 -1
- package/lib/deployers/lambdapackager.spec.d.ts +1 -0
- package/lib/deployers/lambdapackager.spec.js +76 -0
- package/lib/deployers/lambdapackager.spec.js.map +1 -0
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/index.spec.d.ts +10 -0
- package/lib/index.spec.js +86 -0
- package/lib/index.spec.js.map +1 -0
- package/lib/services/aws-mixin.d.ts +22 -1
- package/lib/services/aws-mixin.js +18 -20
- package/lib/services/aws-mixin.js.map +1 -1
- package/lib/services/cloudwatchlogger.d.ts +19 -8
- package/lib/services/cloudwatchlogger.js +39 -29
- package/lib/services/cloudwatchlogger.js.map +1 -1
- package/lib/services/cloudwatchlogger.spec.d.ts +1 -0
- package/lib/services/cloudwatchlogger.spec.js +147 -0
- package/lib/services/cloudwatchlogger.spec.js.map +1 -0
- package/lib/services/dynamodb.d.ts +49 -17
- package/lib/services/dynamodb.js +221 -80
- package/lib/services/dynamodb.js.map +1 -1
- package/lib/services/dynamodb.spec.d.ts +23 -0
- package/lib/services/dynamodb.spec.js +410 -0
- package/lib/services/dynamodb.spec.js.map +1 -0
- package/lib/services/index.d.ts +1 -1
- package/lib/services/index.js +6 -2
- package/lib/services/index.js.map +1 -1
- package/lib/services/lambdacaller.d.ts +26 -10
- package/lib/services/lambdacaller.js +10 -18
- package/lib/services/lambdacaller.js.map +1 -1
- package/lib/services/lambdacaller.spec.d.ts +1 -0
- package/lib/services/lambdacaller.spec.js +104 -0
- package/lib/services/lambdacaller.spec.js.map +1 -0
- package/lib/services/lambdaserver.d.ts +11 -4
- package/lib/services/lambdaserver.js +52 -46
- package/lib/services/lambdaserver.js.map +1 -1
- package/lib/services/lambdaserver.spec.d.ts +1 -0
- package/lib/services/lambdaserver.spec.js +449 -0
- package/lib/services/lambdaserver.spec.js.map +1 -0
- package/lib/services/route53.d.ts +4 -4
- package/lib/services/route53.js +34 -44
- package/lib/services/route53.js.map +1 -1
- package/lib/services/route53.spec.d.ts +1 -0
- package/lib/services/route53.spec.js +109 -0
- package/lib/services/route53.spec.js.map +1 -0
- package/lib/services/s3binary.d.ts +33 -53
- package/lib/services/s3binary.js +115 -242
- package/lib/services/s3binary.js.map +1 -1
- package/lib/services/s3binary.spec.d.ts +1 -0
- package/lib/services/s3binary.spec.js +336 -0
- package/lib/services/s3binary.spec.js.map +1 -0
- package/lib/services/secretsmanager.d.ts +23 -10
- package/lib/services/secretsmanager.js +13 -27
- package/lib/services/secretsmanager.js.map +1 -1
- package/lib/services/secretsmanager.spec.d.ts +1 -0
- package/lib/services/secretsmanager.spec.js +109 -0
- package/lib/services/secretsmanager.spec.js.map +1 -0
- package/lib/services/sqsqueue.d.ts +22 -7
- package/lib/services/sqsqueue.js +23 -36
- package/lib/services/sqsqueue.js.map +1 -1
- package/lib/services/sqsqueue.spec.d.ts +1 -0
- package/lib/services/sqsqueue.spec.js +206 -0
- package/lib/services/sqsqueue.spec.js.map +1 -0
- package/lib/shell.d.ts +1 -1
- package/lib/shell.js +4 -1
- package/lib/shell.js.map +1 -1
- package/package.json +27 -14
- package/webda.module.json +285 -12
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
32
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
33
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
34
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
35
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
36
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
const client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
|
|
42
|
+
const mocha_1 = require("@testdeck/mocha");
|
|
43
|
+
const assert = __importStar(require("assert"));
|
|
44
|
+
const index_spec_1 = require("../index.spec");
|
|
45
|
+
let CloudWatchLoggerTest = class CloudWatchLoggerTest extends index_spec_1.WebdaAwsTest {
|
|
46
|
+
getTestConfiguration() {
|
|
47
|
+
return process.cwd() + "/test/config-cloudwatch.json";
|
|
48
|
+
}
|
|
49
|
+
before() {
|
|
50
|
+
const _super = Object.create(null, {
|
|
51
|
+
before: { get: () => super.before }
|
|
52
|
+
});
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
yield (0, index_spec_1.checkLocalStack)();
|
|
55
|
+
let cloudwatch = new client_cloudwatch_logs_1.CloudWatchLogs({
|
|
56
|
+
credentials: index_spec_1.defaultCreds,
|
|
57
|
+
endpoint: "http://localhost:4566",
|
|
58
|
+
region: "us-east-1"
|
|
59
|
+
});
|
|
60
|
+
try {
|
|
61
|
+
yield cloudwatch.deleteLogGroup({
|
|
62
|
+
logGroupName: "webda-test"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
// Skip bad delete
|
|
67
|
+
}
|
|
68
|
+
yield _super.before.call(this);
|
|
69
|
+
this.service = this.getService("CloudWatchLogger");
|
|
70
|
+
assert.notStrictEqual(this.service, undefined);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
basic() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
this.webda.log("INFO", "Plop 0", "Test");
|
|
76
|
+
this.webda.log("DEBUG", "Plop 1", "Test");
|
|
77
|
+
this.webda.log("DEBUG", "Plop 2", "Test");
|
|
78
|
+
this.webda.log("DEBUG", "Plop 3", "Test");
|
|
79
|
+
this.webda.getLogger("whatever").logProgressStart("test", 100, "other");
|
|
80
|
+
this.webda.log("DEBUG", "Plop 4", "Test");
|
|
81
|
+
yield this.webda.emitSync("Webda.Result");
|
|
82
|
+
let res = yield this.service._cloudwatch.describeLogStreams({
|
|
83
|
+
logGroupName: "webda-test"
|
|
84
|
+
});
|
|
85
|
+
assert.strictEqual(res.logStreams.length, 1);
|
|
86
|
+
assert.notStrictEqual(res.logStreams[0].lastEventTimestamp, undefined);
|
|
87
|
+
this.service.getParameters().logGroupName = undefined;
|
|
88
|
+
yield assert.rejects(() => this.service.init(), /Require a log group `logGroupName` parameter/);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
aws() {
|
|
92
|
+
assert.deepStrictEqual(this.service.getARNPolicy("plop"), {
|
|
93
|
+
Action: ["logs:*"],
|
|
94
|
+
Effect: "Allow",
|
|
95
|
+
Resource: [
|
|
96
|
+
"arn:aws:logs:us-east-1:plop:log-group:webda-test",
|
|
97
|
+
"arn:aws:logs:us-east-1:plop:log-group:webda-test:*:*"
|
|
98
|
+
],
|
|
99
|
+
Sid: "CloudWatchLoggerCloudWatchLogger"
|
|
100
|
+
});
|
|
101
|
+
assert.deepStrictEqual(this.service.getCloudFormation(), {
|
|
102
|
+
CloudWatchLoggerLogGroup: {
|
|
103
|
+
Properties: {
|
|
104
|
+
LogGroupName: "webda-test"
|
|
105
|
+
},
|
|
106
|
+
Type: "AWS::Logs::LogGroup"
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
this.service.getParameters().CloudFormationSkip = true;
|
|
110
|
+
assert.deepStrictEqual(this.service.getCloudFormation(), {});
|
|
111
|
+
}
|
|
112
|
+
secondRun() {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
// Update config to use the stepper
|
|
115
|
+
this.service.getParameters().singlePush = true;
|
|
116
|
+
this.webda.log("INFO", "Plop 0", "Test");
|
|
117
|
+
this.webda.log("DEBUG", "Plop 1", "Test");
|
|
118
|
+
yield this.sleep(1000);
|
|
119
|
+
let res = yield this.service._cloudwatch.describeLogStreams({
|
|
120
|
+
logGroupName: "webda-test"
|
|
121
|
+
});
|
|
122
|
+
assert.strictEqual(res.logStreams.length, 1);
|
|
123
|
+
assert.notStrictEqual(res.logStreams[0].lastEventTimestamp, undefined);
|
|
124
|
+
this.webda.log("DEBUG", "Plop 2", "Test");
|
|
125
|
+
this.webda.log("DEBUG", "Plop 3", "Test");
|
|
126
|
+
this.webda.log("DEBUG", "Plop 4", "Test");
|
|
127
|
+
yield this.webda.emitSync("Webda.Result");
|
|
128
|
+
res = yield this.service._cloudwatch.describeLogStreams({
|
|
129
|
+
logGroupName: "webda-test"
|
|
130
|
+
});
|
|
131
|
+
assert.strictEqual(res.logStreams.length, 1);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
__decorate([
|
|
136
|
+
mocha_1.test
|
|
137
|
+
], CloudWatchLoggerTest.prototype, "basic", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
mocha_1.test
|
|
140
|
+
], CloudWatchLoggerTest.prototype, "aws", null);
|
|
141
|
+
__decorate([
|
|
142
|
+
mocha_1.test
|
|
143
|
+
], CloudWatchLoggerTest.prototype, "secondRun", null);
|
|
144
|
+
CloudWatchLoggerTest = __decorate([
|
|
145
|
+
mocha_1.suite
|
|
146
|
+
], CloudWatchLoggerTest);
|
|
147
|
+
//# sourceMappingURL=cloudwatchl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M,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC;gBACtD,YAAY,EAAE,YAAY;aAC3B,CAAC,CAAC;YACH,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAA;AA7DC;IADC,YAAI;iDAgBJ;AAGD;IADC,YAAI;+CAqBJ;AAGD;IADC,YAAI;qDAoBJ;AAvFG,oBAAoB;IADzB,aAAK;GACA,oBAAoB,CAwFzB"}
|
|
@@ -1,15 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import { CoreModel, Store, StoreFindResult, StoreParameters, WebdaQL } from "@webda/core";
|
|
3
|
+
import { WorkerOutput } from "@webda/workout";
|
|
2
4
|
import { CloudFormationContributor } from ".";
|
|
3
5
|
import { CloudFormationDeployer } from "../deployers/cloudformation";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
declare const DynamoStoreParameters_base: {
|
|
7
|
+
new (...args: any[]): {
|
|
8
|
+
endpoint?: string;
|
|
9
|
+
credentials?: {
|
|
10
|
+
accessKeyId: string;
|
|
11
|
+
secretAccessKey: string;
|
|
12
|
+
sessionToken?: string;
|
|
13
|
+
};
|
|
14
|
+
region?: string;
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
} & typeof StoreParameters;
|
|
18
|
+
/**
|
|
19
|
+
* Define DynamoDB parameters
|
|
20
|
+
*/
|
|
21
|
+
export declare class DynamoStoreParameters extends DynamoStoreParameters_base {
|
|
22
|
+
/**
|
|
23
|
+
* Table name
|
|
24
|
+
*/
|
|
7
25
|
table: string;
|
|
8
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Additional global indexes
|
|
28
|
+
*/
|
|
29
|
+
globalIndexes?: {
|
|
30
|
+
[key: string]: {
|
|
31
|
+
key: string;
|
|
32
|
+
sort?: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* CloudFormation customization
|
|
37
|
+
*/
|
|
9
38
|
CloudFormation: any;
|
|
10
39
|
CloudFormationSkip: boolean;
|
|
11
|
-
region: string;
|
|
12
40
|
scanPage: number;
|
|
41
|
+
constructor(params: any, service: DynamoStore);
|
|
13
42
|
}
|
|
14
43
|
/**
|
|
15
44
|
* DynamoStore handles the DynamoDB
|
|
@@ -20,9 +49,10 @@ export declare class DynamoStoreParameters extends StoreParameters {
|
|
|
20
49
|
* table: ''
|
|
21
50
|
* region: ''
|
|
22
51
|
*
|
|
52
|
+
* @WebdaModda
|
|
23
53
|
*/
|
|
24
|
-
export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParameters = DynamoStoreParameters> extends Store<T, K> implements CloudFormationContributor {
|
|
25
|
-
_client:
|
|
54
|
+
export default class DynamoStore<T extends CoreModel = CoreModel, K extends DynamoStoreParameters = DynamoStoreParameters> extends Store<T, K> implements CloudFormationContributor {
|
|
55
|
+
_client: DynamoDBDocument;
|
|
26
56
|
/**
|
|
27
57
|
* Load the parameters
|
|
28
58
|
*
|
|
@@ -32,7 +62,7 @@ export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParam
|
|
|
32
62
|
/**
|
|
33
63
|
* Create the AWS client
|
|
34
64
|
*/
|
|
35
|
-
|
|
65
|
+
resolve(): void;
|
|
36
66
|
/**
|
|
37
67
|
* Copy one DynamoDB table to another
|
|
38
68
|
*
|
|
@@ -49,7 +79,13 @@ export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParam
|
|
|
49
79
|
* @inheritdoc
|
|
50
80
|
*/
|
|
51
81
|
_save(object: any, uid?: string): Promise<any>;
|
|
52
|
-
|
|
82
|
+
/**
|
|
83
|
+
* @override
|
|
84
|
+
*
|
|
85
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html
|
|
86
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html
|
|
87
|
+
*/
|
|
88
|
+
find(query: WebdaQL.Query): Promise<StoreFindResult<T>>;
|
|
53
89
|
/**
|
|
54
90
|
* Serialize a date for DynamoDB
|
|
55
91
|
* @param date
|
|
@@ -74,7 +110,7 @@ export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParam
|
|
|
74
110
|
/**
|
|
75
111
|
* @inheritdoc
|
|
76
112
|
*/
|
|
77
|
-
_upsertItemToCollection(
|
|
113
|
+
_upsertItemToCollection(uuid: string, prop: string, item: any, index: number | undefined, itemWriteCondition: any | undefined, itemWriteConditionField: string | undefined, updateDate: Date): Promise<void>;
|
|
78
114
|
/**
|
|
79
115
|
* REturn the write condition as string
|
|
80
116
|
* @param writeCondition
|
|
@@ -97,7 +133,7 @@ export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParam
|
|
|
97
133
|
/**
|
|
98
134
|
* @inheritdoc
|
|
99
135
|
*/
|
|
100
|
-
_scan(items
|
|
136
|
+
_scan(items?: any[], paging?: any): Promise<T[]>;
|
|
101
137
|
/**
|
|
102
138
|
* @inheritdoc
|
|
103
139
|
*/
|
|
@@ -109,7 +145,7 @@ export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParam
|
|
|
109
145
|
/**
|
|
110
146
|
* @inheritdoc
|
|
111
147
|
*/
|
|
112
|
-
_incrementAttribute(uid: any, prop: any, value: any, updateDate: Date): Promise<import("aws-sdk/lib
|
|
148
|
+
_incrementAttribute(uid: any, prop: any, value: any, updateDate: Date): Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
|
113
149
|
/**
|
|
114
150
|
* @inheritdoc
|
|
115
151
|
*/
|
|
@@ -127,9 +163,5 @@ export default class DynamoStore<T extends CoreModel, K extends DynamoStoreParam
|
|
|
127
163
|
* @inheritdoc
|
|
128
164
|
*/
|
|
129
165
|
getCloudFormation(deployer: CloudFormationDeployer): {};
|
|
130
|
-
/**
|
|
131
|
-
* @inheritdoc
|
|
132
|
-
*/
|
|
133
|
-
static getModda(): ModdaDefinition;
|
|
134
166
|
}
|
|
135
167
|
export { DynamoStore };
|