@creator.co/wapi 1.7.1-alpha4 → 1.7.2-alpha1
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/.eslintignore +3 -0
- package/.eslintrc.cjs +62 -0
- package/.github/workflows/npmpublish.yml +11 -0
- package/.github/workflows/prs.yml +13 -0
- package/dist/index.d.ts +14 -14
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/package-lock.json +2676 -454
- package/dist/package.json +2 -1
- package/dist/src/API/Request.d.ts +1 -1
- package/dist/src/API/Request.js +1 -1
- package/dist/src/API/Request.js.map +1 -1
- package/dist/src/API/Response.d.ts +1 -1
- package/dist/src/API/Response.js +1 -1
- package/dist/src/API/Response.js.map +1 -1
- package/dist/src/BaseEvent/EventProcessor.d.ts +2 -2
- package/dist/src/BaseEvent/EventProcessor.js +3 -3
- package/dist/src/BaseEvent/EventProcessor.js.map +1 -1
- package/dist/src/BaseEvent/Process.d.ts +3 -3
- package/dist/src/BaseEvent/Process.js +2 -2
- package/dist/src/BaseEvent/Process.js.map +1 -1
- package/dist/src/BaseEvent/Transaction.d.ts +5 -5
- package/dist/src/BaseEvent/Transaction.js +6 -6
- package/dist/src/BaseEvent/Transaction.js.map +1 -1
- package/dist/src/Cache/Redis.d.ts +1 -1
- package/dist/src/Cache/Redis.js +1 -1
- package/dist/src/Cache/Redis.js.map +1 -1
- package/dist/src/Cache/types.d.ts +1 -1
- package/dist/src/Config/Configuration.js +1 -1
- package/dist/src/Config/Configuration.js.map +1 -1
- package/dist/src/Database/Database.d.ts +2 -2
- package/dist/src/Database/DatabaseManager.d.ts +4 -4
- package/dist/src/Database/DatabaseManager.js +3 -3
- package/dist/src/Database/DatabaseManager.js.map +1 -1
- package/dist/src/Database/DatabaseTransaction.d.ts +1 -1
- package/dist/src/Database/index.d.ts +10 -10
- package/dist/src/Database/index.js +6 -6
- package/dist/src/Database/index.js.map +1 -1
- package/dist/src/Database/integrations/knex/KnexDatabase.d.ts +3 -3
- package/dist/src/Database/integrations/knex/KnexDatabase.js +2 -2
- package/dist/src/Database/integrations/knex/KnexDatabase.js.map +1 -1
- package/dist/src/Database/integrations/knex/KnexTransaction.d.ts +3 -3
- package/dist/src/Database/integrations/knex/KnexTransaction.js +1 -1
- package/dist/src/Database/integrations/knex/KnexTransaction.js.map +1 -1
- package/dist/src/Database/integrations/kysely/KyselyDatabase.d.ts +3 -3
- package/dist/src/Database/integrations/kysely/KyselyDatabase.js +2 -2
- package/dist/src/Database/integrations/kysely/KyselyDatabase.js.map +1 -1
- package/dist/src/Database/integrations/kysely/KyselyTransaction.d.ts +3 -3
- package/dist/src/Database/integrations/kysely/KyselyTransaction.js +1 -1
- package/dist/src/Database/integrations/kysely/KyselyTransaction.js.map +1 -1
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.d.ts +3 -3
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.js +2 -2
- package/dist/src/Database/integrations/pgsql/PostgresDatabase.js.map +1 -1
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.d.ts +3 -3
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.js +1 -1
- package/dist/src/Database/integrations/pgsql/PostgresTransaction.js.map +1 -1
- package/dist/src/Database/types.d.ts +5 -5
- package/dist/src/Globals.js +1 -1
- package/dist/src/Globals.js.map +1 -1
- package/dist/src/Logger/Logger.js +1 -1
- package/dist/src/Logger/Logger.js.map +1 -1
- package/dist/src/Server/RouteResolver.d.ts +2 -2
- package/dist/src/Server/Router.d.ts +3 -3
- package/dist/src/Server/Router.js +3 -3
- package/dist/src/Server/Router.js.map +1 -1
- package/dist/src/Server/lib/ContainerServer.d.ts +3 -3
- package/dist/src/Server/lib/ContainerServer.js +2 -2
- package/dist/src/Server/lib/ContainerServer.js.map +1 -1
- package/dist/src/Server/lib/Server.d.ts +2 -2
- package/dist/src/Server/lib/Server.js +4 -4
- package/dist/src/Server/lib/Server.js.map +1 -1
- package/dist/src/Server/lib/container/GenericHandler.d.ts +1 -1
- package/dist/src/Server/lib/container/GenericHandler.js +3 -3
- package/dist/src/Server/lib/container/GenericHandler.js.map +1 -1
- package/dist/src/Server/lib/container/GenericHandlerEvent.d.ts +1 -1
- package/dist/src/Server/lib/container/GenericHandlerEvent.js +2 -2
- package/dist/src/Server/lib/container/GenericHandlerEvent.js.map +1 -1
- package/dist/src/Server/lib/container/Proxy.d.ts +2 -2
- package/dist/src/Server/lib/container/Proxy.js +4 -4
- package/dist/src/Server/lib/container/Proxy.js.map +1 -1
- package/dist/src/Validation/Validator.d.ts +1 -1
- package/dist/src/Validation/Validator.js +2 -2
- package/dist/src/Validation/Validator.js.map +1 -1
- package/index.ts +14 -14
- package/jest.config.ts +37 -0
- package/jest.smoke.config.ts +34 -0
- package/package.json +2 -1
- package/src/API/Request.ts +2 -2
- package/src/API/Response.ts +2 -2
- package/src/BaseEvent/EventProcessor.ts +3 -3
- package/src/BaseEvent/Process.ts +3 -3
- package/src/BaseEvent/Transaction.ts +8 -8
- package/src/Cache/Redis.ts +2 -2
- package/src/Cache/types.ts +1 -1
- package/src/Config/Configuration.ts +1 -1
- package/src/Database/Database.ts +2 -2
- package/src/Database/DatabaseManager.ts +4 -4
- package/src/Database/DatabaseTransaction.ts +1 -1
- package/src/Database/index.ts +10 -10
- package/src/Database/integrations/knex/KnexDatabase.ts +3 -3
- package/src/Database/integrations/knex/KnexTransaction.ts +3 -3
- package/src/Database/integrations/kysely/KyselyDatabase.ts +3 -3
- package/src/Database/integrations/kysely/KyselyTransaction.ts +3 -3
- package/src/Database/integrations/pgsql/PostgresDatabase.ts +3 -3
- package/src/Database/integrations/pgsql/PostgresTransaction.ts +3 -3
- package/src/Database/types.ts +5 -5
- package/src/Globals.ts +1 -1
- package/src/Logger/Logger.ts +1 -1
- package/src/Server/RouteResolver.ts +2 -2
- package/src/Server/Router.ts +6 -6
- package/src/Server/lib/ContainerServer.ts +3 -3
- package/src/Server/lib/Server.ts +6 -6
- package/src/Server/lib/container/GenericHandler.ts +4 -4
- package/src/Server/lib/container/GenericHandlerEvent.ts +3 -3
- package/src/Server/lib/container/Proxy.ts +6 -6
- package/src/Validation/Validator.ts +2 -2
- package/tests/API/Request.test.ts +273 -0
- package/tests/API/Response.test.ts +367 -0
- package/tests/API/Utils.test.ts +167 -0
- package/tests/BaseEvent/EventProcessor.test.ts +261 -0
- package/tests/BaseEvent/Process.test.ts +49 -0
- package/tests/BaseEvent/Transaction.test.ts +408 -0
- package/tests/Cache/Redis-client.test.ts +90 -0
- package/tests/Cache/Redis-cluster.test.ts +100 -0
- package/tests/Config/Config.test.ts +205 -0
- package/tests/Config/EnvironmentVar.test.ts +250 -0
- package/tests/Crypto/Crypto.test.ts +88 -0
- package/tests/Crypto/JWT.test.ts +92 -0
- package/tests/Database/DatabaseManager.test.ts +71 -0
- package/tests/Database/integrations/knex/KnexDatabase.test.ts +76 -0
- package/tests/Database/integrations/knex/KnexTransaction.test.ts +149 -0
- package/tests/Database/integrations/kysely/KyselyDatabase.test.ts +113 -0
- package/tests/Database/integrations/kysely/KyselyTransaction.test.ts +119 -0
- package/tests/Database/integrations/pg/PostgresDatabase.test.ts +76 -0
- package/tests/Database/integrations/pg/PostgresTransaction.test.ts +118 -0
- package/tests/Logger/Logger.test.ts +219 -0
- package/tests/Mailer/Mailer.test.ts +59 -0
- package/tests/Publisher/Publisher.test.ts +94 -0
- package/tests/Server/RouteResolver.test.ts +102 -0
- package/tests/Server/Router.test.ts +39 -0
- package/tests/Server/lib/ContainerServer.test.ts +531 -0
- package/tests/Server/lib/Server.test.ts +12 -0
- package/tests/Server/lib/container/GenericHandler.test.ts +131 -0
- package/tests/Server/lib/container/GenericHandlerEvent.test.ts +103 -0
- package/tests/Server/lib/container/HealthHandler.test.ts +30 -0
- package/tests/Server/lib/container/Proxy.test.ts +268 -0
- package/tests/Server/lib/container/Utils.test.ts +47 -0
- package/tests/Test.utils.ts +74 -0
- package/tests/Validation/Validator.test.ts +76 -0
- package/tsconfig.json +26 -0
- package/tsconfig.smoke.json +26 -0
package/.eslintignore
ADDED
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [
|
|
4
|
+
'eslint:recommended',
|
|
5
|
+
'plugin:@typescript-eslint/recommended',
|
|
6
|
+
'plugin:prettier/recommended',
|
|
7
|
+
'plugin:import/recommended',
|
|
8
|
+
'plugin:import/typescript',
|
|
9
|
+
'plugin:require-extensions/recommended',
|
|
10
|
+
],
|
|
11
|
+
parser: '@typescript-eslint/parser',
|
|
12
|
+
plugins: ['@typescript-eslint', 'prettier', 'require-extensions'],
|
|
13
|
+
root: true,
|
|
14
|
+
rules: {
|
|
15
|
+
'import/extensions': ['error', 'always'],
|
|
16
|
+
'prettier/prettier': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
tabWidth: 2,
|
|
20
|
+
useTabs: false,
|
|
21
|
+
bracketSameLine: false,
|
|
22
|
+
semi: false,
|
|
23
|
+
arrowParens: 'avoid',
|
|
24
|
+
jsxSingleQuote: true,
|
|
25
|
+
printWidth: 100,
|
|
26
|
+
singleQuote: true,
|
|
27
|
+
quoteProps: 'as-needed',
|
|
28
|
+
htmlWhitespaceSensitivity: 'css',
|
|
29
|
+
proseWrap: 'preserve',
|
|
30
|
+
bracketSpacing: true,
|
|
31
|
+
embeddedLanguageFormatting: 'auto',
|
|
32
|
+
endOfLine: 'lf',
|
|
33
|
+
trailingComma: 'es5',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
'@typescript-eslint/ban-ts-comment': 0,
|
|
37
|
+
'@typescript-eslint/no-explicit-any': 0,
|
|
38
|
+
// turn on errors for missing imports
|
|
39
|
+
'import/no-unresolved': ['error', { ignore: ['\\.js$'] }],
|
|
40
|
+
// 'import/no-named-as-default-member': 'off',
|
|
41
|
+
'import/order': [
|
|
42
|
+
'error',
|
|
43
|
+
{
|
|
44
|
+
groups: [
|
|
45
|
+
'builtin', // Built-in imports (come from NodeJS native) go first
|
|
46
|
+
'external', // <- External imports
|
|
47
|
+
'internal', // <- Absolute imports
|
|
48
|
+
['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
|
|
49
|
+
'index', // <- index imports
|
|
50
|
+
'unknown', // <- unknown
|
|
51
|
+
],
|
|
52
|
+
'newlines-between': 'always',
|
|
53
|
+
alphabetize: {
|
|
54
|
+
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
|
|
55
|
+
order: 'asc',
|
|
56
|
+
/* ignore case. Options: [true, false] */
|
|
57
|
+
caseInsensitive: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { HttpMethod } from './src/API/Request';
|
|
2
|
-
import Response, { ResponseErrorType } from './src/API/Response';
|
|
3
|
-
import EventProcessor from './src/BaseEvent/EventProcessor';
|
|
4
|
-
import Process from './src/BaseEvent/Process';
|
|
5
|
-
import Transaction from './src/BaseEvent/Transaction';
|
|
6
|
-
import Redis from './src/Cache/Redis';
|
|
7
|
-
import Configuration from './src/Config/Configuration';
|
|
8
|
-
import Crypto from './src/Crypto/Crypto';
|
|
9
|
-
import JWT from './src/Crypto/JWT';
|
|
10
|
-
import * as Database from './src/Database';
|
|
11
|
-
import Mailer from './src/Mailer/Mailer';
|
|
12
|
-
import Router, { Route } from './src/Server/Router';
|
|
13
|
-
import AsyncSingleton from './src/Util/AsyncSingleton';
|
|
14
|
-
import Utils from './src/Util/Utils';
|
|
1
|
+
import { HttpMethod } from './src/API/Request.js';
|
|
2
|
+
import Response, { ResponseErrorType } from './src/API/Response.js';
|
|
3
|
+
import EventProcessor from './src/BaseEvent/EventProcessor.js';
|
|
4
|
+
import Process from './src/BaseEvent/Process.js';
|
|
5
|
+
import Transaction from './src/BaseEvent/Transaction.js';
|
|
6
|
+
import Redis from './src/Cache/Redis.js';
|
|
7
|
+
import Configuration from './src/Config/Configuration.js';
|
|
8
|
+
import Crypto from './src/Crypto/Crypto.js';
|
|
9
|
+
import JWT from './src/Crypto/JWT.js';
|
|
10
|
+
import * as Database from './src/Database/index.js';
|
|
11
|
+
import Mailer from './src/Mailer/Mailer.js';
|
|
12
|
+
import Router, { Route } from './src/Server/Router.js';
|
|
13
|
+
import AsyncSingleton from './src/Util/AsyncSingleton.js';
|
|
14
|
+
import Utils from './src/Util/Utils.js';
|
|
15
15
|
/**
|
|
16
16
|
* This module exports various classes and utilities for handling transactions, processes, events, routing,
|
|
17
17
|
* mailing, cryptography, JWT, configuration, Redis, responses, utilities, routes, response error types,
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { HttpMethod } from './src/API/Request';
|
|
2
|
-
import Response from './src/API/Response';
|
|
3
|
-
import EventProcessor from './src/BaseEvent/EventProcessor';
|
|
4
|
-
import Process from './src/BaseEvent/Process';
|
|
5
|
-
import Transaction from './src/BaseEvent/Transaction';
|
|
6
|
-
import Redis from './src/Cache/Redis';
|
|
7
|
-
import Configuration from './src/Config/Configuration';
|
|
8
|
-
import Crypto from './src/Crypto/Crypto';
|
|
9
|
-
import JWT from './src/Crypto/JWT';
|
|
10
|
-
import * as Database from './src/Database';
|
|
11
|
-
import Mailer from './src/Mailer/Mailer';
|
|
12
|
-
import Router from './src/Server/Router';
|
|
13
|
-
import AsyncSingleton from './src/Util/AsyncSingleton';
|
|
14
|
-
import Utils from './src/Util/Utils';
|
|
1
|
+
import { HttpMethod } from './src/API/Request.js';
|
|
2
|
+
import Response from './src/API/Response.js';
|
|
3
|
+
import EventProcessor from './src/BaseEvent/EventProcessor.js';
|
|
4
|
+
import Process from './src/BaseEvent/Process.js';
|
|
5
|
+
import Transaction from './src/BaseEvent/Transaction.js';
|
|
6
|
+
import Redis from './src/Cache/Redis.js';
|
|
7
|
+
import Configuration from './src/Config/Configuration.js';
|
|
8
|
+
import Crypto from './src/Crypto/Crypto.js';
|
|
9
|
+
import JWT from './src/Crypto/JWT.js';
|
|
10
|
+
import * as Database from './src/Database/index.js';
|
|
11
|
+
import Mailer from './src/Mailer/Mailer.js';
|
|
12
|
+
import Router from './src/Server/Router.js';
|
|
13
|
+
import AsyncSingleton from './src/Util/AsyncSingleton.js';
|
|
14
|
+
import Utils from './src/Util/Utils.js';
|
|
15
15
|
/**
|
|
16
16
|
* This module exports various classes and utilities for handling transactions, processes, events, routing,
|
|
17
17
|
* mailing, cryptography, JWT, configuration, Redis, responses, utilities, routes, response error types,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,QAA+B,MAAM,uBAAuB,CAAA;AACnE,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAC9D,OAAO,OAAO,MAAM,4BAA4B,CAAA;AAChD,OAAO,WAAW,MAAM,gCAAgC,CAAA;AACxD,OAAO,KAAK,MAAM,sBAAsB,CAAA;AACxC,OAAO,aAAa,MAAM,+BAA+B,CAAA;AACzD,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,GAAG,MAAM,qBAAqB,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,MAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,MAAM,qBAAqB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO;AACL,cAAc;AACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,MAAM;AACN,iCAAiC;AACjC,MAAM,EACN,MAAM,EACN,GAAG,EACH,aAAa,EACb,KAAK;AACL,MAAM;AACN,QAAQ;AACR,UAAU;AACV,KAAK,EACL,cAAc,EAId,UAAU,EACV,QAAQ,GACT,CAAA"}
|