jaypie 1.0.7 → 1.0.8

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/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "jaypie",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "author": "Finlayson Studio",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "src/index.js",
8
8
  "scripts": {
9
- "build": "BABEL_ENV=commonjs babel src --out-dir dist/cjs",
10
9
  "format": "npm run format:package && npm run format:lint",
11
10
  "format:lint": "eslint --fix .",
12
11
  "format:package": "sort-package-json ./package.json",
@@ -22,9 +21,6 @@
22
21
  "@jaypie/core": "^1.0.4"
23
22
  },
24
23
  "devDependencies": {
25
- "@babel/cli": "^7.24.1",
26
- "@babel/core": "^7.24.3",
27
- "@babel/preset-env": "^7.24.3",
28
24
  "@jaypie/testkit": "^1.0.4",
29
25
  "eslint": "^8.57.0",
30
26
  "eslint-config-prettier": "^9.1.0",
@@ -39,7 +35,6 @@
39
35
  },
40
36
  "peerDependencies": {
41
37
  "@jaypie/aws": "^1.0.1",
42
- "@jaypie/cdk": "^1.0.1",
43
38
  "@jaypie/lambda": "^1.0.1",
44
39
  "@jaypie/mongoose": "^1.0.1"
45
40
  },
@@ -47,9 +42,6 @@
47
42
  "@jaypie/aws": {
48
43
  "optional": true
49
44
  },
50
- "@jaypie/cdk": {
51
- "optional": true
52
- },
53
45
  "@jaypie/lambda": {
54
46
  "optional": true
55
47
  },
package/src/index.js CHANGED
@@ -8,6 +8,5 @@ export * from "@jaypie/core";
8
8
 
9
9
  // Optional dependencies are wrapped in a dynamic import
10
10
  export * from "./aws.package.js";
11
- export * from "./cdk.package.js";
12
11
  export * from "./lambda.package.js";
13
12
  export * from "./mongoose.package.js";
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sendMessage = exports.sendBatchMessages = exports.getSecret = exports.getMessages = void 0;
7
- var _core = require("@jaypie/core");
8
- var _dynamicExportFunction = _interopRequireDefault(require("./dynamicExport.function.js"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- //
11
- //
12
- // Export
13
- //
14
-
15
- const {
16
- getMessages,
17
- getSecret,
18
- sendBatchMessages,
19
- sendMessage
20
- } = await (0, _dynamicExportFunction.default)({
21
- functions: ["getMessages", "getSecret", "sendBatchMessages", "sendMessage"],
22
- moduleImport: _core.JAYPIE.LIB.AWS
23
- });
24
- exports.sendMessage = sendMessage;
25
- exports.sendBatchMessages = sendBatchMessages;
26
- exports.getSecret = getSecret;
27
- exports.getMessages = getMessages;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.projectTagger = exports.mergeDomain = exports.isValidSubdomain = exports.isValidHostname = exports.cfnOutput = void 0;
7
- var _core = require("@jaypie/core");
8
- var _dynamicExportFunction = _interopRequireDefault(require("./dynamicExport.function.js"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- //
11
- //
12
- // Export
13
- //
14
-
15
- const {
16
- cfnOutput,
17
- isValidHostname,
18
- isValidSubdomain,
19
- mergeDomain,
20
- projectTagger
21
- } = await (0, _dynamicExportFunction.default)({
22
- functions: ["cfnOutput", "isValidHostname", "isValidSubdomain", "mergeDomain", "projectTagger"],
23
- moduleImport: _core.JAYPIE.LIB.CDK
24
- });
25
- exports.projectTagger = projectTagger;
26
- exports.mergeDomain = mergeDomain;
27
- exports.isValidSubdomain = isValidSubdomain;
28
- exports.isValidHostname = isValidHostname;
29
- exports.cfnOutput = cfnOutput;
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _core = require("@jaypie/core");
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
- //
11
- //
12
- // Helper Functions
13
- //
14
-
15
- let _importedModule;
16
- async function dynamicImport(module) {
17
- if (!_importedModule) {
18
- try {
19
- // eslint-disable-next-line import/no-unresolved
20
- _importedModule = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(module);
21
- } catch (error) {
22
- if (process.env.NODE_ENV === "test") {
23
- if (!_importedModule) {
24
- // eslint-disable-next-line no-console
25
- console.warn(`[jaypie] Caught error importing ${module} -- Is it installed?`);
26
- }
27
- }
28
- throw new _core.ConfigurationError();
29
- }
30
- }
31
- return _importedModule;
32
- }
33
-
34
- //
35
- //
36
- // Main
37
- //
38
- var _default = async ({
39
- functions = ["default"],
40
- moduleImport,
41
- vars = []
42
- } = {}) => {
43
- // Validate
44
- if (!moduleImport || typeof moduleImport !== "string") {
45
- throw new _core.ConfigurationError("`moduleImport` must be a string");
46
- }
47
- if (!Array.isArray(functions)) {
48
- throw new _core.ConfigurationError("`functions` must be an array");
49
- }
50
- if (!Array.isArray(vars)) {
51
- throw new _core.ConfigurationError("`vars` must be an array");
52
- }
53
- if (!functions.length && !vars.length) {
54
- throw new _core.ConfigurationError("Either `functions` or `vars` must be provided");
55
- }
56
- // Process
57
- try {
58
- // Attempt to import the module
59
- return await dynamicImport(moduleImport);
60
- } catch (error) {
61
- _core.log.lib({
62
- lib: _core.JAYPIE.LIB.JAYPIE
63
- }).trace(`[jaypie] ${moduleImport} could not be imported; continuing`);
64
- }
65
- // Return
66
- const result = {};
67
- functions.forEach(func => {
68
- result[func] = () => {
69
- throw new _core.ConfigurationError(`${moduleImport}.${func} is not available`);
70
- };
71
- });
72
- vars.forEach(variable => {
73
- result[variable] = null;
74
- });
75
- return result;
76
- };
77
- exports.default = _default;
package/dist/cjs/index.js DELETED
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _core = require("@jaypie/core");
7
- Object.keys(_core).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _core[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _core[key];
14
- }
15
- });
16
- });
17
- var _awsPackage = require("./aws.package.js");
18
- Object.keys(_awsPackage).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _awsPackage[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _awsPackage[key];
25
- }
26
- });
27
- });
28
- var _cdkPackage = require("./cdk.package.js");
29
- Object.keys(_cdkPackage).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _cdkPackage[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _cdkPackage[key];
36
- }
37
- });
38
- });
39
- var _lambdaPackage = require("./lambda.package.js");
40
- Object.keys(_lambdaPackage).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _lambdaPackage[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _lambdaPackage[key];
47
- }
48
- });
49
- });
50
- var _mongoosePackage = require("./mongoose.package.js");
51
- Object.keys(_mongoosePackage).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _mongoosePackage[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _mongoosePackage[key];
58
- }
59
- });
60
- });
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.lambdaHandler = void 0;
7
- var _core = require("@jaypie/core");
8
- var _dynamicExportFunction = _interopRequireDefault(require("./dynamicExport.function.js"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- //
11
- //
12
- // Export
13
- //
14
-
15
- const {
16
- lambdaHandler
17
- } = await (0, _dynamicExportFunction.default)({
18
- functions: ["lambdaHandler"],
19
- moduleImport: _core.JAYPIE.LIB.LAMBDA
20
- });
21
- exports.lambdaHandler = lambdaHandler;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.disconnect = exports.connectFromSecretEnv = void 0;
7
- var _core = require("@jaypie/core");
8
- var _dynamicExportFunction = _interopRequireDefault(require("./dynamicExport.function.js"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- //
11
- //
12
- // Export
13
- //
14
-
15
- const {
16
- connectFromSecretEnv,
17
- disconnect
18
- } = await (0, _dynamicExportFunction.default)({
19
- functions: ["connectFromSecretEnv", "disconnect"],
20
- moduleImport: _core.JAYPIE.LIB.MONGOOSE
21
- });
22
- exports.disconnect = disconnect;
23
- exports.connectFromSecretEnv = connectFromSecretEnv;
@@ -1,24 +0,0 @@
1
- import { JAYPIE } from "@jaypie/core";
2
- import dynamicExport from "./dynamicExport.function.js";
3
-
4
- //
5
- //
6
- // Export
7
- //
8
-
9
- export const {
10
- cfnOutput,
11
- isValidHostname,
12
- isValidSubdomain,
13
- mergeDomain,
14
- projectTagger,
15
- } = await dynamicExport({
16
- functions: [
17
- "cfnOutput",
18
- "isValidHostname",
19
- "isValidSubdomain",
20
- "mergeDomain",
21
- "projectTagger",
22
- ],
23
- moduleImport: JAYPIE.LIB.CDK,
24
- });