@creator.co/wapi 1.7.1-alpha1 → 1.7.1-alpha3

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.
Files changed (114) hide show
  1. package/coverage/clover.xml +1088 -0
  2. package/coverage/coverage/coverage.txt +40 -0
  3. package/coverage/coverage-final.json +37 -0
  4. package/coverage/coverage-summary.json +38 -0
  5. package/coverage/coverage.txt +59 -0
  6. package/coverage/lcov-report/base.css +224 -0
  7. package/coverage/lcov-report/block-navigation.js +87 -0
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +371 -0
  10. package/coverage/lcov-report/prettify.css +1 -0
  11. package/coverage/lcov-report/prettify.js +2 -0
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +196 -0
  14. package/coverage/lcov-report/src/API/Request.ts.html +727 -0
  15. package/coverage/lcov-report/src/API/Response.ts.html +1189 -0
  16. package/coverage/lcov-report/src/API/Utils.ts.html +313 -0
  17. package/coverage/lcov-report/src/API/index.html +131 -0
  18. package/coverage/lcov-report/src/BaseEvent/EventProcessor.ts.html +496 -0
  19. package/coverage/lcov-report/src/BaseEvent/Process.ts.html +346 -0
  20. package/coverage/lcov-report/src/BaseEvent/Transaction.ts.html +1015 -0
  21. package/coverage/lcov-report/src/BaseEvent/index.html +146 -0
  22. package/coverage/lcov-report/src/Cache/Redis.ts.html +367 -0
  23. package/coverage/lcov-report/src/Cache/index.html +116 -0
  24. package/coverage/lcov-report/src/Config/Configuration.ts.html +700 -0
  25. package/coverage/lcov-report/src/Config/EnvironmentVar.ts.html +526 -0
  26. package/coverage/lcov-report/src/Config/index.html +131 -0
  27. package/coverage/lcov-report/src/Crypto/Crypto.ts.html +352 -0
  28. package/coverage/lcov-report/src/Crypto/JWT.ts.html +337 -0
  29. package/coverage/lcov-report/src/Crypto/index.html +131 -0
  30. package/coverage/lcov-report/src/Database/Database.ts.html +151 -0
  31. package/coverage/lcov-report/src/Database/DatabaseManager.ts.html +289 -0
  32. package/coverage/lcov-report/src/Database/DatabaseTransaction.ts.html +595 -0
  33. package/coverage/lcov-report/src/Database/index.html +161 -0
  34. package/coverage/lcov-report/src/Database/index.ts.html +169 -0
  35. package/coverage/lcov-report/src/Database/integrations/knex/KnexDatabase.ts.html +283 -0
  36. package/coverage/lcov-report/src/Database/integrations/knex/KnexTransaction.ts.html +337 -0
  37. package/coverage/lcov-report/src/Database/integrations/knex/index.html +131 -0
  38. package/coverage/lcov-report/src/Database/integrations/kysely/KyselyDatabase.ts.html +376 -0
  39. package/coverage/lcov-report/src/Database/integrations/kysely/KyselyTransaction.ts.html +601 -0
  40. package/coverage/lcov-report/src/Database/integrations/kysely/index.html +131 -0
  41. package/coverage/lcov-report/src/Database/integrations/pgsql/PostgresDatabase.ts.html +250 -0
  42. package/coverage/lcov-report/src/Database/integrations/pgsql/PostgresTransaction.ts.html +346 -0
  43. package/coverage/lcov-report/src/Database/integrations/pgsql/index.html +131 -0
  44. package/coverage/lcov-report/src/Database/types.d.ts.html +232 -0
  45. package/coverage/lcov-report/src/Globals.ts.html +394 -0
  46. package/coverage/lcov-report/src/Logger/Logger.ts.html +1138 -0
  47. package/coverage/lcov-report/src/Logger/index.html +116 -0
  48. package/coverage/lcov-report/src/Mailer/Mailer.ts.html +754 -0
  49. package/coverage/lcov-report/src/Mailer/index.html +116 -0
  50. package/coverage/lcov-report/src/Publisher/Publisher.ts.html +460 -0
  51. package/coverage/lcov-report/src/Publisher/index.html +116 -0
  52. package/coverage/lcov-report/src/Server/RouteResolver.ts.html +442 -0
  53. package/coverage/lcov-report/src/Server/Router.ts.html +616 -0
  54. package/coverage/lcov-report/src/Server/index.html +131 -0
  55. package/coverage/lcov-report/src/Server/lib/ContainerServer.ts.html +280 -0
  56. package/coverage/lcov-report/src/Server/lib/Server.ts.html +403 -0
  57. package/coverage/lcov-report/src/Server/lib/container/GenericHandler.ts.html +331 -0
  58. package/coverage/lcov-report/src/Server/lib/container/GenericHandlerEvent.ts.html +547 -0
  59. package/coverage/lcov-report/src/Server/lib/container/HealthHandler.ts.html +118 -0
  60. package/coverage/lcov-report/src/Server/lib/container/Proxy.ts.html +619 -0
  61. package/coverage/lcov-report/src/Server/lib/container/Utils.ts.html +184 -0
  62. package/coverage/lcov-report/src/Server/lib/container/index.html +176 -0
  63. package/coverage/lcov-report/src/Server/lib/index.html +131 -0
  64. package/coverage/lcov-report/src/Util/AsyncSingleton.ts.html +343 -0
  65. package/coverage/lcov-report/src/Util/Utils.ts.html +313 -0
  66. package/coverage/lcov-report/src/Util/index.html +131 -0
  67. package/coverage/lcov-report/src/Validation/Validator.ts.html +217 -0
  68. package/coverage/lcov-report/src/Validation/index.html +116 -0
  69. package/coverage/lcov-report/src/index.html +116 -0
  70. package/coverage/lcov.info +2326 -0
  71. package/dist/package-lock.json +2 -2
  72. package/dist/package.json +1 -1
  73. package/package.json +1 -1
  74. package/.eslintignore +0 -3
  75. package/.eslintrc.cjs +0 -60
  76. package/.github/workflows/npmpublish.yml +0 -11
  77. package/.github/workflows/prs.yml +0 -13
  78. package/jest.config.ts +0 -33
  79. package/jest.smoke.config.ts +0 -35
  80. package/tests/API/Request.test.ts +0 -273
  81. package/tests/API/Response.test.ts +0 -367
  82. package/tests/API/Utils.test.ts +0 -167
  83. package/tests/BaseEvent/EventProcessor.test.ts +0 -261
  84. package/tests/BaseEvent/Process.test.ts +0 -49
  85. package/tests/BaseEvent/Transaction.test.ts +0 -408
  86. package/tests/Cache/Redis-client.test.ts +0 -90
  87. package/tests/Cache/Redis-cluster.test.ts +0 -100
  88. package/tests/Config/Config.test.ts +0 -205
  89. package/tests/Config/EnvironmentVar.test.ts +0 -250
  90. package/tests/Crypto/Crypto.test.ts +0 -88
  91. package/tests/Crypto/JWT.test.ts +0 -92
  92. package/tests/Database/DatabaseManager.test.ts +0 -71
  93. package/tests/Database/integrations/knex/KnexDatabase.test.ts +0 -76
  94. package/tests/Database/integrations/knex/KnexTransaction.test.ts +0 -149
  95. package/tests/Database/integrations/kysely/KyselyDatabase.test.ts +0 -113
  96. package/tests/Database/integrations/kysely/KyselyTransaction.test.ts +0 -119
  97. package/tests/Database/integrations/pg/PostgresDatabase.test.ts +0 -76
  98. package/tests/Database/integrations/pg/PostgresTransaction.test.ts +0 -118
  99. package/tests/Logger/Logger.test.ts +0 -219
  100. package/tests/Mailer/Mailer.test.ts +0 -59
  101. package/tests/Publisher/Publisher.test.ts +0 -94
  102. package/tests/Server/RouteResolver.test.ts +0 -102
  103. package/tests/Server/Router.test.ts +0 -39
  104. package/tests/Server/lib/ContainerServer.test.ts +0 -531
  105. package/tests/Server/lib/Server.test.ts +0 -12
  106. package/tests/Server/lib/container/GenericHandler.test.ts +0 -131
  107. package/tests/Server/lib/container/GenericHandlerEvent.test.ts +0 -103
  108. package/tests/Server/lib/container/HealthHandler.test.ts +0 -30
  109. package/tests/Server/lib/container/Proxy.test.ts +0 -268
  110. package/tests/Server/lib/container/Utils.test.ts +0 -47
  111. package/tests/Test.utils.ts +0 -74
  112. package/tests/Validation/Validator.test.ts +0 -76
  113. package/tsconfig.json +0 -26
  114. package/tsconfig.smoke.json +0 -26
@@ -1,76 +0,0 @@
1
- import { expect } from 'chai'
2
-
3
- import Response from '../../src/API/Response'
4
- import Globals from '../../src/Globals'
5
- import Validator from '../../src/Validation/Validator'
6
- import { ViewSchema } from '../Test.utils'
7
-
8
- function expectFullFailure(validationResult, c = 4) {
9
- expect(validationResult).to.be.an.instanceof(Response)
10
- if (validationResult instanceof Response) {
11
- expect(validationResult.getBody()).is.not.null
12
- expect(validationResult.getBody()).to.have.property('err', Globals.ErrorResponseValidationFail)
13
- expect(validationResult.getBody()).to.have.property('errCode', Globals.ErrorCode_InvalidInput)
14
- expect(validationResult.getBody()).to.have.property('validationFailure')
15
- expect(validationResult.getBody()['validationFailure']).to.have.lengthOf(c)
16
- expect(validationResult.getCode()).is.equals(400)
17
- }
18
- }
19
-
20
- describe('Validates unsuccessfully', () => {
21
- test('Fails to validate async', () => {
22
- const validationResult = Validator.validateSchema(async () => {}, ViewSchema)
23
- expectFullFailure(validationResult, 1)
24
- })
25
-
26
- test('Fails to validate null', () => {
27
- const validationResult = Validator.validateSchema(null, ViewSchema)
28
- expectFullFailure(validationResult, 1)
29
- })
30
-
31
- test('Fails to validate empty string', () => {
32
- const validationResult = Validator.validateSchema('', ViewSchema)
33
- expectFullFailure(validationResult, 1)
34
- })
35
-
36
- test('Fails to validate empty object', () => {
37
- const validationResult = Validator.validateSchema({}, ViewSchema)
38
- expectFullFailure(validationResult)
39
- })
40
-
41
- test('Fails to validate object with wrong keys', () => {
42
- const validationResult = Validator.validateSchema({ name: 'Joe' }, ViewSchema)
43
- expectFullFailure(validationResult)
44
- })
45
-
46
- test('Fails to validate object with wrong key types', () => {
47
- const validationResult = Validator.validateSchema({ id: 123 }, ViewSchema)
48
- expectFullFailure(validationResult)
49
- if (validationResult instanceof Response) {
50
- console.log(validationResult.getBody()['validationFailure'])
51
- expect(
52
- validationResult.getBody()['validationFailure'].filter(f => {
53
- return f.message == 'Expected string, received number'
54
- })
55
- ).to.have.lengthOf(1)
56
- }
57
- })
58
- })
59
-
60
- describe('Validates successfully', () => {
61
- test('Succeeds to validate', () => {
62
- const validationResult = Validator.validateSchema(
63
- {
64
- id: '123',
65
- content: '123',
66
- createdAt: new Date(),
67
- updatedAt: new Date(),
68
- },
69
- ViewSchema
70
- )
71
- expect(validationResult).to.not.be.an.instanceof(Response)
72
- expect(validationResult).to.be.true
73
- })
74
- })
75
-
76
- export {}
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "exclude": ["**/*.test.*", "**/__mocks__/*", "**/__tests__/*", "**/tests/*", "./dist/**/*", "./smoke-tests/**/*", "./jest*", "./node_modules"],
3
- "include": ["./**/*", "./package.json", "./package-lock.json"],
4
- "compilerOptions": {
5
- "lib": [
6
- "es5",
7
- "es6",
8
- "dom"
9
- ],
10
- "module": "esnext",
11
- "target": "es6",
12
- "moduleResolution": "node",
13
- "esModuleInterop": true,
14
- "noImplicitAny": false,
15
- "noEmitOnError": true,
16
- "removeComments": false,
17
- "downlevelIteration": true,
18
- "resolveJsonModule": true,
19
- "sourceMap": true,
20
- "outDir": "dist",
21
- "declaration": true,
22
- "skipLibCheck": true,
23
- "strictNullChecks": true,
24
- "noErrorTruncation": true
25
- }
26
- }
@@ -1,26 +0,0 @@
1
- {
2
- "exclude": ["./dist/**/*", "./smoke-tests/**/*", "./node_modules", "./**/Logger.test.*"],
3
- "include": ["./**/*", "./package.json", "./package-lock.json"],
4
- "compilerOptions": {
5
- "lib": [
6
- "es5",
7
- "es6",
8
- "dom"
9
- ],
10
- "module": "esnext",
11
- "target": "es6",
12
- "moduleResolution": "node",
13
- "noImplicitAny": false,
14
- "noEmitOnError": true,
15
- "removeComments": false,
16
- "downlevelIteration": true,
17
- "resolveJsonModule": true,
18
- "sourceMap": true,
19
- "esModuleInterop": true,
20
- "outDir": "smoke-tests",
21
- "declaration": true,
22
- "skipLibCheck": true,
23
- "strictNullChecks": true,
24
- "noErrorTruncation": true
25
- }
26
- }