@paralect/hive 0.1.50-alpha.2 → 0.1.50
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/.claude/settings.local.json +13 -0
- package/cli/helpers/execCommand.js +10 -10
- package/cli/helpers/isProjectInit.js +3 -3
- package/cli/helpers/mergeDirs.js +1 -1
- package/cli/hive.js +105 -105
- package/{test-app → framework}/.cursor/commands/add-service.md +6 -6
- package/{test-app → framework}/.cursor/skills/hive-overview/SKILL.md +1 -1
- package/{test-app → framework}/.cursor/skills/hive-service/SKILL.md +2 -2
- package/framework/bin/start.sh +2 -0
- package/{.hive/bootstrap-hive.js → framework/bootstrap-hive.ts} +4 -4
- package/{.hive → framework}/package-lock.json +212 -156
- package/framework/package.json +42 -0
- package/{.hive/src/app.js → framework/src/app.ts} +1 -1
- package/{.hive/src/bullMqBus.js → framework/src/bullMqBus.ts} +1 -1
- package/{.hive/src/bullMqWrapper.js → framework/src/bullMqWrapper.ts} +1 -1
- package/{.hive/src/app-config/index.js → framework/src/config/index.ts} +7 -7
- package/{.hive/src/db.js → framework/src/db.ts} +21 -6
- package/framework/src/endpoint.ts +132 -0
- package/framework/src/helpers/generateDbTypes.ts +47 -0
- package/{.hive/src/helpers/getMiddlewares.js → framework/src/helpers/getMiddlewares.ts} +1 -1
- package/{.hive/src/helpers/getResourceEndpoints.js → framework/src/helpers/getResourceEndpoints.ts} +8 -8
- package/{.hive/src/helpers/getResources.js → framework/src/helpers/getResources.ts} +1 -1
- package/{.hive/src/helpers/getSchemas.js → framework/src/helpers/getSchemas.ts} +13 -13
- package/framework/src/index.ts +3 -0
- package/{.hive/src/ioEmitter.js → framework/src/ioEmitter.ts} +1 -1
- package/{.hive/src/lib/node-mongo/src/mongo-query-service.js → framework/src/lib/node-mongo/src/mongo-query-service.ts} +18 -7
- package/{.hive/src/lib/node-mongo/src/mongo-service.js → framework/src/lib/node-mongo/src/mongo-service.ts} +17 -9
- package/{starter/src/logger.js → framework/src/logger.ts} +4 -3
- package/{.hive/src/migrations/migrations-log/migration-log.schema.js → framework/src/migrations/migrations-log/migration-log.schema.ts} +1 -1
- package/{.hive/src/migrations/migrations-log/migration-log.service.js → framework/src/migrations/migrations-log/migration-log.service.ts} +1 -1
- package/{.hive/src/migrations/migrations.schema.js → framework/src/migrations/migrations.schema.ts} +1 -1
- package/{.hive/src/resources/_dev/endpoints/triggerSchedulerHandler.js → framework/src/resources/_dev/endpoints/triggerSchedulerHandler.ts} +2 -1
- package/framework/src/resources/health/endpoints/get.ts +14 -0
- package/{.hive/src/resources/schemaMappings/schemaMappings.schema.js → framework/src/resources/schemaMappings/schemaMappings.schema.ts} +1 -1
- package/{.hive/src/routes/index.js → framework/src/routes/index.ts} +23 -27
- package/framework/src/schema.ts +3 -0
- package/{.hive/src/services/emailService.js → framework/src/services/emailService.ts} +1 -1
- package/{.hive/src/socketIo.js → framework/src/socketIo.ts} +1 -1
- package/{.hive → framework}/tsconfig.json +17 -13
- package/package.json +43 -51
- package/starter/hive/autoMap/schemaMappings.json +1 -0
- package/starter/hive/config/.env.example +11 -0
- package/starter/hive/config/app.ts +19 -0
- package/{.hive/src/services/setCookie.js → starter/hive/helpers/setCookie.ts} +1 -2
- package/starter/hive/middlewares/_global.ts +9 -0
- package/{.hive/src/middlewares/attachUser.js → starter/hive/middlewares/attachUser.ts} +2 -2
- package/{.hive/src/middlewares/shouldExist.js → starter/hive/middlewares/shouldExist.ts} +1 -1
- package/{.hive/src/middlewares/shouldNotExist.js → starter/hive/middlewares/shouldNotExist.ts} +1 -1
- package/starter/hive/resources/files/endpoints/upload.ts +25 -0
- package/starter/hive/resources/files/files.schema.ts +20 -0
- package/{.hive/src/resources/tokens/methods/storeToken.js → starter/hive/resources/tokens/methods/storeToken.ts} +3 -3
- package/{.hive/src/resources/tokens/tokens.schema.js → starter/hive/resources/tokens/tokens.schema.ts} +1 -2
- package/starter/hive/resources/users/endpoints/getCurrentUser.ts +12 -0
- package/starter/hive/resources/users/endpoints/getUserProfile.ts +17 -0
- package/{.hive/src/resources/users/users.schema.js → starter/hive/resources/users/users.schema.ts} +1 -2
- package/starter/hive/services/cloudStorage.ts +102 -0
- package/starter/package.json +9 -97
- package/starter/tsconfig.json +16 -20
- package/.cursor/commands/deslop.md +0 -12
- package/.hive/.cursor/commands/add-service.md +0 -188
- package/.hive/.cursor/skills/hive-overview/SKILL.md +0 -50
- package/.hive/.cursor/skills/hive-service/SKILL.md +0 -90
- package/.hive/bin/start.sh +0 -2
- package/.hive/package.json +0 -98
- package/.hive/src/logger.js +0 -43
- package/.hive/src/middlewares/global/tryToAttachUser.js +0 -33
- package/.hive/src/resources/health/endpoints/get.js +0 -19
- package/.hive/src/resources/tokens/methods/setToken.js +0 -8
- package/.hive/src/resources/users/endpoints/getCurrentUser.js +0 -14
- package/.hive/src/resources/users/endpoints/getUserProfile.js +0 -19
- package/.hive/src/resources/users/methods/ensureUserCreated.js +0 -68
- package/.hive/src/security.util.js +0 -38
- package/.hive/src/services/globalTest.js +0 -0
- package/cli/helpers/docker.js +0 -59
- package/cli/helpers/envCheck.js +0 -127
- package/cli/helpers/findPort.js +0 -32
- package/starter/.babelrc +0 -3
- package/starter/.cursor/commands/add-endpoint.md +0 -262
- package/starter/.cursor/commands/add-handler.md +0 -137
- package/starter/.cursor/commands/add-middleware.md +0 -95
- package/starter/.cursor/commands/add-resource.md +0 -71
- package/starter/.cursor/commands/add-scheduler.md +0 -138
- package/starter/.cursor/commands/add-service.md +0 -188
- package/starter/.cursor/skills/hive-auth/SKILL.md +0 -134
- package/starter/.cursor/skills/hive-database/SKILL.md +0 -103
- package/starter/.cursor/skills/hive-endpoint/SKILL.md +0 -103
- package/starter/.cursor/skills/hive-handler/SKILL.md +0 -88
- package/starter/.cursor/skills/hive-mapping/SKILL.md +0 -85
- package/starter/.cursor/skills/hive-middleware/SKILL.md +0 -104
- package/starter/.cursor/skills/hive-overview/SKILL.md +0 -50
- package/starter/.cursor/skills/hive-scheduler/SKILL.md +0 -94
- package/starter/.cursor/skills/hive-schema/SKILL.md +0 -73
- package/starter/.cursor/skills/hive-service/SKILL.md +0 -90
- package/starter/.dockerignore +0 -1
- package/starter/Dockerfile +0 -22
- package/starter/Dockerfile.dev +0 -33
- package/starter/Dockerfile.prod +0 -29
- package/starter/README.md +0 -11
- package/starter/bin/deploy.sh +0 -5
- package/starter/bin/start.sh +0 -2
- package/starter/bootstrap-hive.js +0 -118
- package/starter/deploy/api/Chart.yaml +0 -6
- package/starter/deploy/api/staging.yaml +0 -3
- package/starter/deploy/api/templates/deployment.yaml +0 -44
- package/starter/deploy/api/templates/ingress.yaml +0 -26
- package/starter/deploy/api/templates/service.yaml +0 -14
- package/starter/deploy/script/Dockerfile +0 -39
- package/starter/deploy/script/package-lock.json +0 -1499
- package/starter/deploy/script/package.json +0 -12
- package/starter/deploy/script/src/config.js +0 -48
- package/starter/deploy/script/src/index.js +0 -108
- package/starter/deploy/script/src/util.js +0 -19
- package/starter/initial-data.json +0 -176
- package/starter/loader.mjs +0 -40
- package/starter/package-lock.json +0 -13492
- package/starter/register.mjs +0 -6
- package/starter/ship_logo.png +0 -0
- package/starter/src/app-config/app.js +0 -3
- package/starter/src/app-config/assertEnv.js +0 -15
- package/starter/src/app-config/index.js +0 -65
- package/starter/src/app.js +0 -65
- package/starter/src/assets/emails/components/header.mjml +0 -13
- package/starter/src/assets/emails/dist/.gitkeep +0 -0
- package/starter/src/assets/emails/signup-welcome.mjml +0 -34
- package/starter/src/assets/emails/styles/index.mjml +0 -77
- package/starter/src/autoMap/addHandlers.js +0 -142
- package/starter/src/autoMap/getDependentFields.js +0 -37
- package/starter/src/autoMap/mapSchema.js +0 -99
- package/starter/src/autoMap/schemaMappings.js +0 -13
- package/starter/src/autoMap/schemaMappings.json +0 -3
- package/starter/src/bullMqBus.js +0 -21
- package/starter/src/bullMqWrapper.js +0 -23
- package/starter/src/db.js +0 -53
- package/starter/src/emails/MyEmailComponent.jsx +0 -14
- package/starter/src/emails/compiled/MyEmailComponent.js +0 -18
- package/starter/src/emails/compiled/compiled/MyEmailComponent.js +0 -18
- package/starter/src/helpers/db/ifUpdated.js +0 -22
- package/starter/src/helpers/esm.js +0 -56
- package/starter/src/helpers/getMiddlewares.js +0 -41
- package/starter/src/helpers/getResourceEndpoints.js +0 -31
- package/starter/src/helpers/getResources.js +0 -35
- package/starter/src/helpers/getSchemas.js +0 -53
- package/starter/src/helpers/importHandlers.js +0 -20
- package/starter/src/helpers/isZodArray.js +0 -13
- package/starter/src/helpers/prettierFormat.js +0 -8
- package/starter/src/helpers/schema/db.schema.js +0 -9
- package/starter/src/helpers/schema/pagination.schema.js +0 -14
- package/starter/src/ioEmitter.js +0 -9
- package/starter/src/jsconfig.json +0 -5
- package/starter/src/lib/node-mongo/.github/workflows/npm-publish.yml +0 -32
- package/starter/src/lib/node-mongo/API.md +0 -654
- package/starter/src/lib/node-mongo/CHANGELOG.md +0 -98
- package/starter/src/lib/node-mongo/README.md +0 -97
- package/starter/src/lib/node-mongo/package-lock.json +0 -3682
- package/starter/src/lib/node-mongo/package.json +0 -74
- package/starter/src/lib/node-mongo/src/index.js +0 -64
- package/starter/src/lib/node-mongo/src/mongo-query-service.js +0 -78
- package/starter/src/lib/node-mongo/src/mongo-service-error.js +0 -15
- package/starter/src/lib/node-mongo/src/mongo-service.js +0 -303
- package/starter/src/middlewares/attachUser.js +0 -41
- package/starter/src/middlewares/global/extractUserTokens.js +0 -15
- package/starter/src/middlewares/global/tryToAttachUser.js +0 -33
- package/starter/src/middlewares/isAuthorized.js +0 -18
- package/starter/src/middlewares/shouldExist.js +0 -37
- package/starter/src/middlewares/shouldNotExist.js +0 -19
- package/starter/src/middlewares/uploadFile.js +0 -5
- package/starter/src/middlewares/validate.js +0 -32
- package/starter/src/migrations/migration.js +0 -8
- package/starter/src/migrations/migration.service.js +0 -76
- package/starter/src/migrations/migrations/1.js +0 -22
- package/starter/src/migrations/migrations-log/migration-log.schema.js +0 -13
- package/starter/src/migrations/migrations-log/migration-log.service.js +0 -50
- package/starter/src/migrations/migrations.schema.js +0 -6
- package/starter/src/migrations/migrator.js +0 -75
- package/starter/src/migrator.js +0 -3
- package/starter/src/resources/_dev/endpoints/triggerSchedulerHandler.js +0 -32
- package/starter/src/resources/health/endpoints/get.js +0 -19
- package/starter/src/resources/schemaMappings/schemaMappings.schema.js +0 -6
- package/starter/src/resources/tokens/methods/generateSecureToken.js +0 -9
- package/starter/src/resources/tokens/methods/setToken.js +0 -8
- package/starter/src/resources/tokens/methods/storeToken.js +0 -35
- package/starter/src/resources/tokens/tokens.schema.js +0 -11
- package/starter/src/resources/users/endpoints/getCurrentUser.js +0 -14
- package/starter/src/resources/users/endpoints/getUserProfile.js +0 -19
- package/starter/src/resources/users/handlers/test.js +0 -1
- package/starter/src/resources/users/methods/ensureUserCreated.js +0 -68
- package/starter/src/resources/users/users.schema.js +0 -16
- package/starter/src/routes/index.js +0 -172
- package/starter/src/routes/middlewares/attachCustomErrors.js +0 -28
- package/starter/src/routes/middlewares/routeErrorHandler.js +0 -27
- package/starter/src/scheduler.js +0 -35
- package/starter/src/security.util.js +0 -38
- package/starter/src/services/emailService.js +0 -15
- package/starter/src/services/globalTest.js +0 -0
- package/starter/src/services/setCookie.js +0 -21
- package/starter/src/socketIo.js +0 -99
- package/test-app/.cursor/commands/add-endpoint.md +0 -262
- package/test-app/.cursor/commands/add-handler.md +0 -137
- package/test-app/.cursor/commands/add-middleware.md +0 -95
- package/test-app/.cursor/commands/add-resource.md +0 -71
- package/test-app/.cursor/commands/add-scheduler.md +0 -138
- package/test-app/.cursor/skills/hive-auth/SKILL.md +0 -134
- package/test-app/.cursor/skills/hive-database/SKILL.md +0 -103
- package/test-app/.cursor/skills/hive-endpoint/SKILL.md +0 -103
- package/test-app/.cursor/skills/hive-handler/SKILL.md +0 -88
- package/test-app/.cursor/skills/hive-mapping/SKILL.md +0 -85
- package/test-app/.cursor/skills/hive-middleware/SKILL.md +0 -104
- package/test-app/.cursor/skills/hive-scheduler/SKILL.md +0 -94
- package/test-app/.cursor/skills/hive-schema/SKILL.md +0 -73
- package/test-app/package-lock.json +0 -462
- package/test-app/package.json +0 -21
- /package/{.hive → framework}/.babelrc +0 -0
- /package/{.hive → framework}/.cursor/commands/add-endpoint.md +0 -0
- /package/{.hive → framework}/.cursor/commands/add-handler.md +0 -0
- /package/{.hive → framework}/.cursor/commands/add-middleware.md +0 -0
- /package/{.hive → framework}/.cursor/commands/add-resource.md +0 -0
- /package/{.hive → framework}/.cursor/commands/add-scheduler.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-auth/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-database/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-endpoint/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-handler/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-mapping/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-middleware/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-scheduler/SKILL.md +0 -0
- /package/{.hive → framework}/.cursor/skills/hive-schema/SKILL.md +0 -0
- /package/{.hive → framework}/.dockerignore +0 -0
- /package/{.hive → framework}/Dockerfile +0 -0
- /package/{.hive → framework}/Dockerfile.dev +0 -0
- /package/{.hive → framework}/Dockerfile.prod +0 -0
- /package/{.hive → framework}/README.md +0 -0
- /package/{.hive → framework}/bin/deploy.sh +0 -0
- /package/{.hive → framework}/deploy/api/Chart.yaml +0 -0
- /package/{.hive → framework}/deploy/api/staging.yaml +0 -0
- /package/{.hive → framework}/deploy/api/templates/deployment.yaml +0 -0
- /package/{.hive → framework}/deploy/api/templates/ingress.yaml +0 -0
- /package/{.hive → framework}/deploy/api/templates/service.yaml +0 -0
- /package/{.hive → framework}/deploy/script/Dockerfile +0 -0
- /package/{.hive → framework}/deploy/script/package-lock.json +0 -0
- /package/{.hive → framework}/deploy/script/package.json +0 -0
- /package/{.hive/deploy/script/src/config.js → framework/deploy/script/src/config.ts} +0 -0
- /package/{.hive/deploy/script/src/index.js → framework/deploy/script/src/index.ts} +0 -0
- /package/{.hive/deploy/script/src/util.js → framework/deploy/script/src/util.ts} +0 -0
- /package/{.hive → framework}/initial-data.json +0 -0
- /package/{.hive → framework}/ship_logo.png +0 -0
- /package/{.hive → framework}/src/assets/emails/components/header.mjml +0 -0
- /package/{.hive → framework}/src/assets/emails/dist/.gitkeep +0 -0
- /package/{.hive → framework}/src/assets/emails/signup-welcome.mjml +0 -0
- /package/{.hive → framework}/src/assets/emails/styles/index.mjml +0 -0
- /package/{.hive/src/autoMap/addHandlers.js → framework/src/autoMap/addHandlers.ts} +0 -0
- /package/{.hive/src/autoMap/getDependentFields.js → framework/src/autoMap/getDependentFields.ts} +0 -0
- /package/{.hive/src/autoMap/mapSchema.js → framework/src/autoMap/mapSchema.ts} +0 -0
- /package/{.hive → framework}/src/autoMap/schemaMappings.json +0 -0
- /package/{.hive/src/autoMap/schemaMappings.js → framework/src/autoMap/schemaMappings.ts} +0 -0
- /package/{.hive/src/helpers/schema/db.schema.js → framework/src/common/schema/db.schema.ts} +0 -0
- /package/{.hive/src/helpers/schema/pagination.schema.js → framework/src/common/schema/pagination.schema.ts} +0 -0
- /package/{.hive/src/app-config/app.js → framework/src/config/app.ts} +0 -0
- /package/{.hive/src/app-config/assertEnv.js → framework/src/config/assertEnv.ts} +0 -0
- /package/{.hive/src/emails/MyEmailComponent.jsx → framework/src/emails/MyEmailComponent.tsx} +0 -0
- /package/{.hive/src/emails/compiled/MyEmailComponent.js → framework/src/emails/compiled/MyEmailComponent.ts} +0 -0
- /package/{.hive/src/emails/compiled/compiled/MyEmailComponent.js → framework/src/emails/compiled/compiled/MyEmailComponent.ts} +0 -0
- /package/{.hive/src/helpers/db/ifUpdated.js → framework/src/helpers/db/ifUpdated.ts} +0 -0
- /package/{.hive/src/helpers/importHandlers.js → framework/src/helpers/importHandlers.ts} +0 -0
- /package/{.hive/src/helpers/isZodArray.js → framework/src/helpers/isZodArray.ts} +0 -0
- /package/{.hive/src/helpers/prettierFormat.js → framework/src/helpers/prettierFormat.ts} +0 -0
- /package/{.hive → framework}/src/jsconfig.json +0 -0
- /package/{.hive → framework}/src/lib/node-mongo/.github/workflows/npm-publish.yml +0 -0
- /package/{.hive → framework}/src/lib/node-mongo/API.md +0 -0
- /package/{.hive → framework}/src/lib/node-mongo/CHANGELOG.md +0 -0
- /package/{.hive → framework}/src/lib/node-mongo/README.md +0 -0
- /package/{.hive → framework}/src/lib/node-mongo/package-lock.json +0 -0
- /package/{.hive → framework}/src/lib/node-mongo/package.json +0 -0
- /package/{.hive/src/lib/node-mongo/src/index.js → framework/src/lib/node-mongo/src/index.ts} +0 -0
- /package/{.hive/src/lib/node-mongo/src/mongo-service-error.js → framework/src/lib/node-mongo/src/mongo-service-error.ts} +0 -0
- /package/{.hive/src/middlewares/allowNoAuth.js → framework/src/middlewares/allowNoAuth.ts} +0 -0
- /package/{.hive/src/middlewares/global/extractUserTokens.js → framework/src/middlewares/global/extractUserTokens.ts} +0 -0
- /package/{.hive/src/middlewares/validate.js → framework/src/middlewares/validate.ts} +0 -0
- /package/{.hive/src/migrations/migration.service.js → framework/src/migrations/migration.service.ts} +0 -0
- /package/{.hive/src/migrations/migration.js → framework/src/migrations/migration.ts} +0 -0
- /package/{.hive/src/migrations/migrations/1.js → framework/src/migrations/migrations/1.ts} +0 -0
- /package/{.hive/src/migrations/migrator.js → framework/src/migrations/migrator.ts} +0 -0
- /package/{.hive/src/migrator.js → framework/src/migrator.ts} +0 -0
- /package/{.hive/src/routes/middlewares/attachCustomErrors.js → framework/src/routes/middlewares/attachCustomErrors.ts} +0 -0
- /package/{.hive/src/routes/middlewares/routeErrorHandler.js → framework/src/routes/middlewares/routeErrorHandler.ts} +0 -0
- /package/{.hive/src/scheduler/handlers/sendDailyReport.example.js → framework/src/scheduler/handlers/sendDailyReport.example.ts} +0 -0
- /package/{.hive/src/scheduler.js → framework/src/scheduler.ts} +0 -0
- /package/starter/{src/middlewares/allowNoAuth.js → hive/middlewares/allowNoAuth.ts} +0 -0
- /package/{.hive/src/middlewares/isAuthorized.js → starter/hive/middlewares/isAuthorized.ts} +0 -0
- /package/{.hive/src/middlewares/uploadFile.js → starter/hive/middlewares/uploadFile.ts} +0 -0
- /package/{.hive/src/resources/tokens/methods/generateSecureToken.js → starter/hive/resources/tokens/methods/generateSecureToken.ts} +0 -0
- /package/{.hive/src/resources/users/handlers/test.js → starter/hive/resources/users/handlers/test.ts} +0 -0
- /package/starter/{src/scheduler/handlers/sendDailyReport.example.js → hive/scheduler/handlers/dailyExample.ts} +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const React = require('react');
|
|
2
|
-
const { Html, Head, Body, Container, Heading, Text } = require('@react-email/components');
|
|
3
|
-
|
|
4
|
-
export const MyEmailComponent = ({ name }) => (
|
|
5
|
-
<Html>
|
|
6
|
-
<Head />
|
|
7
|
-
<Body>
|
|
8
|
-
<Container>
|
|
9
|
-
<Heading>Hello, {name}!</Heading>
|
|
10
|
-
<Text>This is a test email using @react-email and Express.</Text>
|
|
11
|
-
</Container>
|
|
12
|
-
</Body>
|
|
13
|
-
</Html>
|
|
14
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MyEmailComponent = void 0;
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var _require = require('@react-email/components'),
|
|
9
|
-
Html = _require.Html,
|
|
10
|
-
Head = _require.Head,
|
|
11
|
-
Body = _require.Body,
|
|
12
|
-
Container = _require.Container,
|
|
13
|
-
Heading = _require.Heading,
|
|
14
|
-
Text = _require.Text;
|
|
15
|
-
var MyEmailComponent = exports.MyEmailComponent = function MyEmailComponent(_ref) {
|
|
16
|
-
var name = _ref.name;
|
|
17
|
-
return /*#__PURE__*/React.createElement(Html, null, /*#__PURE__*/React.createElement(Head, null), /*#__PURE__*/React.createElement(Body, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Heading, null, "Hello, ", name, "!"), /*#__PURE__*/React.createElement(Text, null, "This is a test email using @react-email and Express."))));
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MyEmailComponent = void 0;
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var _require = require('@react-email/components'),
|
|
9
|
-
Html = _require.Html,
|
|
10
|
-
Head = _require.Head,
|
|
11
|
-
Body = _require.Body,
|
|
12
|
-
Container = _require.Container,
|
|
13
|
-
Heading = _require.Heading,
|
|
14
|
-
Text = _require.Text;
|
|
15
|
-
var MyEmailComponent = exports.MyEmailComponent = function MyEmailComponent(_ref) {
|
|
16
|
-
var name = _ref.name;
|
|
17
|
-
return /*#__PURE__*/React.createElement(Html, null, /*#__PURE__*/React.createElement(Head, null), /*#__PURE__*/React.createElement(Body, null, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Heading, null, "Hello, ", name, "!"), /*#__PURE__*/React.createElement(Text, null, "This is a test email using @react-email and Express."))));
|
|
18
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
|
|
3
|
-
export default (fieldNames, callback) => {
|
|
4
|
-
return async ({ doc, prevDoc }) => {
|
|
5
|
-
let isFieldChanged = false;
|
|
6
|
-
|
|
7
|
-
_.forEach(fieldNames, (fieldName) => {
|
|
8
|
-
if (!_.isEqual(doc[fieldName], prevDoc[fieldName])) {
|
|
9
|
-
isFieldChanged = true;
|
|
10
|
-
return false; // break loop
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return true;
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
if (isFieldChanged) {
|
|
17
|
-
return callback({ doc, prevDoc });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return () => {};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'url';
|
|
2
|
-
import { dirname, join } from 'path';
|
|
3
|
-
import { readdirSync } from 'fs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Get __dirname equivalent for ESM modules
|
|
7
|
-
* Usage: const __dirname = getDirname(import.meta.url);
|
|
8
|
-
*/
|
|
9
|
-
export const getDirname = (importMetaUrl) => {
|
|
10
|
-
return dirname(fileURLToPath(importMetaUrl));
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Get __filename equivalent for ESM modules
|
|
15
|
-
* Usage: const __filename = getFilename(import.meta.url);
|
|
16
|
-
*/
|
|
17
|
-
export const getFilename = (importMetaUrl) => {
|
|
18
|
-
return fileURLToPath(importMetaUrl);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* ESM replacement for require-dir
|
|
23
|
-
* Imports all JS files from a directory
|
|
24
|
-
*
|
|
25
|
-
* @param {string} dirPath - Directory path to import from
|
|
26
|
-
* @param {object} options - Options
|
|
27
|
-
* @param {function} options.mapValue - Function to call for each imported module (module, name) => any
|
|
28
|
-
* @param {function} options.filter - Function to filter files (filename) => boolean
|
|
29
|
-
* @returns {Promise<object>} - Object with filename (without ext) as key and module as value
|
|
30
|
-
*/
|
|
31
|
-
export const importDir = async (dirPath, options = {}) => {
|
|
32
|
-
const { mapValue, filter = (f) => f.endsWith('.js') } = options;
|
|
33
|
-
|
|
34
|
-
const files = readdirSync(dirPath).filter(filter);
|
|
35
|
-
const modules = {};
|
|
36
|
-
|
|
37
|
-
for (const file of files) {
|
|
38
|
-
const filePath = join(dirPath, file);
|
|
39
|
-
const moduleName = file.replace(/\.[^.]+$/, ''); // Remove extension
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
const module = await import(filePath);
|
|
43
|
-
const value = module.default || module;
|
|
44
|
-
|
|
45
|
-
if (mapValue) {
|
|
46
|
-
modules[moduleName] = mapValue(value, moduleName);
|
|
47
|
-
} else {
|
|
48
|
-
modules[moduleName] = value;
|
|
49
|
-
}
|
|
50
|
-
} catch (err) {
|
|
51
|
-
console.error(`[importDir] Failed to import ${filePath}:`, err.message);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return modules;
|
|
56
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import { getDirname } from '#hive/helpers/esm';
|
|
5
|
-
|
|
6
|
-
const __dirname = getDirname(import.meta.url);
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
promises: { readdir },
|
|
10
|
-
} = fs;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const getFiles = async (source) => {
|
|
14
|
-
return (await readdir(source, { withFileTypes: true }))
|
|
15
|
-
.filter((file) => !file.isDirectory())
|
|
16
|
-
.map((file) => ({ fileName: file.name }));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default async () => {
|
|
20
|
-
let middlewaresDirs = await getFiles(`${__dirname}/../middlewares`);
|
|
21
|
-
|
|
22
|
-
if (process.env.HIVE_SRC) {
|
|
23
|
-
let hiveMiddlewaresDirPath = `${process.env.HIVE_SRC}/middlewares`;
|
|
24
|
-
|
|
25
|
-
if (fs.existsSync(hiveMiddlewaresDirPath)) {
|
|
26
|
-
middlewaresDirs = _.uniqBy([...middlewaresDirs, ...((await getFiles(hiveMiddlewaresDirPath)).map(r => ({ fileName: r.fileName, isHive: true })))], r => r.fileName);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return Promise.all(middlewaresDirs
|
|
31
|
-
.map(({ fileName, isHive }) => ({
|
|
32
|
-
filePath: isHive ? path.resolve(`${process.env.HIVE_SRC}/middlewares/${fileName}`) : path.resolve(`${__dirname}/../middlewares/${fileName}`),
|
|
33
|
-
name: fileName.replace('.js', ''),
|
|
34
|
-
})).map(async ({ filePath, name }) => {
|
|
35
|
-
return {
|
|
36
|
-
name,
|
|
37
|
-
filePath,
|
|
38
|
-
fn: (await import(filePath)).default,
|
|
39
|
-
}
|
|
40
|
-
}));
|
|
41
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import { getDirname } from '#hive/helpers/esm';
|
|
4
|
-
|
|
5
|
-
const __dirname = getDirname(import.meta.url);
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
promises: { readdir },
|
|
9
|
-
} = fs;
|
|
10
|
-
|
|
11
|
-
export default async (resourceName) => {
|
|
12
|
-
let endpointFiles = [];
|
|
13
|
-
|
|
14
|
-
if (fs.existsSync(`${process.env.HIVE_SRC}/resources/${resourceName}/endpoints`)) {
|
|
15
|
-
endpointFiles = [...endpointFiles, ...(await readdir(
|
|
16
|
-
`${process.env.HIVE_SRC}/resources/${resourceName}/endpoints`
|
|
17
|
-
)).map( f => ({ name: f, isHiveEndpoint: true}))];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (fs.existsSync(`${__dirname}/../resources/${resourceName}/endpoints`)) {
|
|
21
|
-
endpointFiles = [...endpointFiles, ...(await readdir(
|
|
22
|
-
`${__dirname}/../resources/${resourceName}/endpoints`
|
|
23
|
-
)).map( f => ({ name: f }))];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return endpointFiles.map(({ name, isHiveEndpoint }) => ({
|
|
27
|
-
file: isHiveEndpoint ? `${process.env.HIVE_SRC}/resources/${resourceName}/endpoints/${name}`: `${__dirname}/../resources/${resourceName}/endpoints/${name}`,
|
|
28
|
-
name: _.last(name.split("/")).replace(".js", ""),
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import { getDirname } from '#hive/helpers/esm';
|
|
5
|
-
|
|
6
|
-
const __dirname = getDirname(import.meta.url);
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
promises: { readdir },
|
|
10
|
-
} = fs;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const getDirectories = async (source) => {
|
|
14
|
-
return (await readdir(source, { withFileTypes: true }))
|
|
15
|
-
.filter((dir) => dir.isDirectory())
|
|
16
|
-
.map((dir) => ({ dirName: dir.name }));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default async () => {
|
|
20
|
-
let resourceDirs = await getDirectories(`${__dirname}/../resources`);
|
|
21
|
-
|
|
22
|
-
if (process.env.HIVE_SRC) {
|
|
23
|
-
let hiveResourcesDirPath = `${process.env.HIVE_SRC}/resources`;
|
|
24
|
-
|
|
25
|
-
if (fs.existsSync(hiveResourcesDirPath)) {
|
|
26
|
-
resourceDirs = _.uniqBy([...resourceDirs, ...((await getDirectories(hiveResourcesDirPath)).map(r => ({ dirName: r.dirName, isHive: true })))], r => r.dirName);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return resourceDirs
|
|
31
|
-
.filter(({ dirName }) => dirName !== "health")
|
|
32
|
-
.map(({ dirName }) => ({
|
|
33
|
-
name: dirName,
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import fs, { promises } from "fs";
|
|
3
|
-
import getResources from "./getResources.js";
|
|
4
|
-
import { getDirname } from '#hive/helpers/esm';
|
|
5
|
-
|
|
6
|
-
const __dirname = getDirname(import.meta.url);
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
promises: { readdir },
|
|
10
|
-
} = { promises };
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const getSchemas = async (resourceDir) => {
|
|
14
|
-
return (await readdir(resourceDir))
|
|
15
|
-
.filter((f) => f.includes("schema.js"))
|
|
16
|
-
.filter((f) => !f.includes("extends.schema"))
|
|
17
|
-
.map((f) => ({
|
|
18
|
-
name: f.replace(".schema.js", ""),
|
|
19
|
-
file: `${resourceDir}/${f}`,
|
|
20
|
-
resourceName: _.last(resourceDir.split('/')),
|
|
21
|
-
isHive: process.env.HIVE_SRC && resourceDir.includes(process.env.HIVE_SRC),
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const getResourceSchemas = async (resourceName) => {
|
|
26
|
-
let schemaFiles = [];
|
|
27
|
-
|
|
28
|
-
if (fs.existsSync(`${process.env.HIVE_SRC}/resources/${resourceName}`)) {
|
|
29
|
-
schemaFiles = (await getSchemas(`${process.env.HIVE_SRC}/resources/${resourceName}`));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (fs.existsSync(`${__dirname}/../resources/${resourceName}`)) {
|
|
33
|
-
schemaFiles = [...schemaFiles, ...(await getSchemas(`${__dirname}/../resources/${resourceName}`)).filter(schema => !schemaFiles.find(s => s.name === schema.name))];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return schemaFiles;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default async () => {
|
|
40
|
-
const resources = await getResources();
|
|
41
|
-
let schemas = [];
|
|
42
|
-
|
|
43
|
-
await Promise.all(
|
|
44
|
-
resources.map(async ({ name: resourceName }) => {
|
|
45
|
-
const resourceSchemas = await getResourceSchemas(resourceName);
|
|
46
|
-
schemas.push(...resourceSchemas);
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
console.log('schemas', schemas);
|
|
51
|
-
|
|
52
|
-
return schemas;
|
|
53
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import { getDirname, importDir } from '#hive/helpers/esm';
|
|
4
|
-
|
|
5
|
-
const __dirname = getDirname(import.meta.url);
|
|
6
|
-
|
|
7
|
-
export default async (resourceName) => {
|
|
8
|
-
const mapValue = (handler, handlerName) => {
|
|
9
|
-
console.log(`[handlers] Registering handler ${handlerName}`);
|
|
10
|
-
return handler;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
if (fs.existsSync(`${process.env.HIVE_SRC}/resources/${resourceName}/handlers`)) {
|
|
14
|
-
await importDir(`${process.env.HIVE_SRC}/resources/${resourceName}/handlers`, { mapValue });
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (fs.existsSync(`${__dirname}/../resources/${resourceName}/handlers`)) {
|
|
18
|
-
await importDir(`${__dirname}/../resources/${resourceName}/handlers`, { mapValue });
|
|
19
|
-
}
|
|
20
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ZodArray } from 'zod';
|
|
2
|
-
|
|
3
|
-
const isZodArray = (schema) => {
|
|
4
|
-
if (schema instanceof ZodArray) return true;
|
|
5
|
-
|
|
6
|
-
if (schema._def?.innerType) {
|
|
7
|
-
return isZodArray(schema._def.innerType);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return false;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default isZodArray;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const paginationSchema = z.object({
|
|
4
|
-
page: z.coerce.number().default(1),
|
|
5
|
-
perPage: z.coerce.number().default(10),
|
|
6
|
-
|
|
7
|
-
searchValue: z.string().optional(),
|
|
8
|
-
|
|
9
|
-
sort: z
|
|
10
|
-
.object({
|
|
11
|
-
createdOn: z.enum(['asc', 'desc']).default('asc'),
|
|
12
|
-
})
|
|
13
|
-
.default({}),
|
|
14
|
-
});
|
package/starter/src/ioEmitter.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import config from '#hive/app-config';
|
|
2
|
-
import { Emitter } from '@socket.io/redis-emitter';
|
|
3
|
-
import { createClient } from 'redis';
|
|
4
|
-
|
|
5
|
-
const redisClient = createClient({ url: config.redis.url });
|
|
6
|
-
|
|
7
|
-
const emitter = new Emitter(redisClient);
|
|
8
|
-
|
|
9
|
-
export default emitter;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
release:
|
|
8
|
-
types: [created]
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v2
|
|
15
|
-
- uses: actions/setup-node@v1
|
|
16
|
-
with:
|
|
17
|
-
node-version: 12
|
|
18
|
-
- run: npm ci
|
|
19
|
-
|
|
20
|
-
publish-npm:
|
|
21
|
-
needs: build
|
|
22
|
-
runs-on: ubuntu-latest
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v2
|
|
25
|
-
- uses: actions/setup-node@v1
|
|
26
|
-
with:
|
|
27
|
-
node-version: 12
|
|
28
|
-
registry-url: https://registry.npmjs.org/
|
|
29
|
-
- run: npm ci
|
|
30
|
-
- run: npm publish
|
|
31
|
-
env:
|
|
32
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|