@yopdev/dev-server 3.0.1 → 3.0.2-RC1
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/.github/workflows/npm-publish.yml +33 -0
- package/__tests__/bootstrap.test.ts +89 -0
- package/__tests__/deferred.test.ts +86 -0
- package/__tests__/event-proxy.test.ts +42 -0
- package/__tests__/lambda-http-proxy.test.ts +179 -0
- package/jest.config.js +7 -0
- package/package.json +2 -5
- package/src/assert.ts +4 -0
- package/src/cloudformation-dynamodb-table.ts +97 -0
- package/src/cloudformation-event-proxy.ts +61 -0
- package/src/cloudformation-lambda-http-proxy.ts +125 -0
- package/src/cloudformation.ts +95 -0
- package/src/config.ts +34 -0
- package/src/container.ts +82 -0
- package/src/deferred.ts +60 -0
- package/src/dev-server.ts +78 -0
- package/src/dynamodb.ts +62 -0
- package/src/event-proxy.ts +101 -0
- package/src/factories.ts +19 -0
- package/src/http-server.ts +59 -0
- package/src/index.ts +32 -0
- package/src/internal-queue.ts +89 -0
- package/src/lambda-http-proxy.ts +111 -0
- package/src/localstack.ts +74 -0
- package/src/mappers.ts +231 -0
- package/src/pre-traffic-hooks.ts +24 -0
- package/src/responses.ts +28 -0
- package/src/s3.ts +24 -0
- package/src/scheduled-tasks.ts +31 -0
- package/src/services.ts +46 -0
- package/src/sns-http-proxy.ts +109 -0
- package/src/sns.ts +49 -0
- package/src/sqs.ts +46 -0
- package/src/stoppable.ts +10 -0
- package/src/tunnel.ts +32 -0
- package/tsconfig.json +9 -0
- package/dist/src/assert.d.ts +0 -1
- package/dist/src/assert.js +0 -9
- package/dist/src/cloudformation-dynamodb-table.d.ts +0 -13
- package/dist/src/cloudformation-dynamodb-table.js +0 -45
- package/dist/src/cloudformation-event-proxy.d.ts +0 -13
- package/dist/src/cloudformation-event-proxy.js +0 -25
- package/dist/src/cloudformation-lambda-http-proxy.d.ts +0 -14
- package/dist/src/cloudformation-lambda-http-proxy.js +0 -62
- package/dist/src/cloudformation.d.ts +0 -28
- package/dist/src/cloudformation.js +0 -50
- package/dist/src/config.d.ts +0 -31
- package/dist/src/config.js +0 -2
- package/dist/src/container.d.ts +0 -18
- package/dist/src/container.js +0 -33
- package/dist/src/deferred.d.ts +0 -4
- package/dist/src/deferred.js +0 -45
- package/dist/src/dev-server.d.ts +0 -19
- package/dist/src/dev-server.js +0 -63
- package/dist/src/dynamodb.d.ts +0 -16
- package/dist/src/dynamodb.js +0 -48
- package/dist/src/event-proxy.d.ts +0 -13
- package/dist/src/event-proxy.js +0 -68
- package/dist/src/factories.d.ts +0 -3
- package/dist/src/factories.js +0 -16
- package/dist/src/http-server.d.ts +0 -25
- package/dist/src/http-server.js +0 -37
- package/dist/src/index.d.ts +0 -24
- package/dist/src/index.js +0 -46
- package/dist/src/internal-queue.d.ts +0 -11
- package/dist/src/internal-queue.js +0 -53
- package/dist/src/lambda-http-proxy.d.ts +0 -27
- package/dist/src/lambda-http-proxy.js +0 -49
- package/dist/src/localstack.d.ts +0 -11
- package/dist/src/localstack.js +0 -62
- package/dist/src/mappers.d.ts +0 -25
- package/dist/src/mappers.js +0 -158
- package/dist/src/pre-traffic-hooks.d.ts +0 -2
- package/dist/src/pre-traffic-hooks.js +0 -19
- package/dist/src/responses.d.ts +0 -5
- package/dist/src/responses.js +0 -22
- package/dist/src/s3.d.ts +0 -7
- package/dist/src/s3.js +0 -20
- package/dist/src/scheduled-tasks.d.ts +0 -6
- package/dist/src/scheduled-tasks.js +0 -20
- package/dist/src/services.d.ts +0 -22
- package/dist/src/services.js +0 -26
- package/dist/src/sns-http-proxy.d.ts +0 -28
- package/dist/src/sns-http-proxy.js +0 -66
- package/dist/src/sns.d.ts +0 -15
- package/dist/src/sns.js +0 -35
- package/dist/src/sqs.d.ts +0 -13
- package/dist/src/sqs.js +0 -33
- package/dist/src/stoppable.d.ts +0 -2
- package/dist/src/stoppable.js +0 -15
- package/dist/src/tunnel.d.ts +0 -10
- package/dist/src/tunnel.js +0 -52
package/dist/src/tunnel.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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 __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.newTunnel = exports.terminate = void 0;
|
|
27
|
-
const services_1 = require("./services");
|
|
28
|
-
const logging_1 = require("@yopdev/logging");
|
|
29
|
-
const ngrok = __importStar(require("@ngrok/ngrok"));
|
|
30
|
-
const assert_1 = require("./assert");
|
|
31
|
-
const terminate = async () => ngrok.kill();
|
|
32
|
-
exports.terminate = terminate;
|
|
33
|
-
const newTunnel = (config) => new services_1.Service(new Tunnel(config.name, config.port, config.fixed));
|
|
34
|
-
exports.newTunnel = newTunnel;
|
|
35
|
-
class Tunnel {
|
|
36
|
-
constructor(name, port, domain) {
|
|
37
|
-
this.name = name;
|
|
38
|
-
this.port = port;
|
|
39
|
-
this.domain = domain;
|
|
40
|
-
this.start = async () => ngrok
|
|
41
|
-
.forward({
|
|
42
|
-
proto: 'http',
|
|
43
|
-
domain: this.domain?.name,
|
|
44
|
-
addr: this.port,
|
|
45
|
-
authtoken: this.domain?.token,
|
|
46
|
-
})
|
|
47
|
-
.then((listener) => (0, assert_1.assertNotUndefined)(listener.url()))
|
|
48
|
-
.tap((url) => this.logger.debug(url));
|
|
49
|
-
this.stop = async () => ngrok.disconnect();
|
|
50
|
-
this.logger = logging_1.LoggerFactory.create(`TUNNEL[${name}]`);
|
|
51
|
-
}
|
|
52
|
-
}
|