@companix/xeo-server 0.0.2 → 0.0.4

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 (39) hide show
  1. package/dist/drivers/collection.driver.d.ts +2 -0
  2. package/dist/drivers/collection.driver.js +7 -0
  3. package/dist/drivers/collection.driver.js.map +1 -1
  4. package/dist/utils/flatten.d.ts +1 -0
  5. package/dist/utils/flatten.js +33 -0
  6. package/dist/utils/flatten.js.map +1 -0
  7. package/package.json +6 -2
  8. package/.eslintrc +0 -54
  9. package/jest.cases.config.cjs +0 -14
  10. package/lib/common/decorators.ts +0 -17
  11. package/lib/common/index.ts +0 -3
  12. package/lib/common/tokens.ts +0 -17
  13. package/lib/common/utils.ts +0 -29
  14. package/lib/constants.ts +0 -4
  15. package/lib/driver.module.ts +0 -37
  16. package/lib/drivers/collection.driver.ts +0 -157
  17. package/lib/drivers/table.driver.ts +0 -109
  18. package/lib/factories/definitions.factory.ts +0 -129
  19. package/lib/index.ts +0 -3
  20. package/lib/mongoose-options.interface.ts +0 -19
  21. package/lib/mongoose.module.ts +0 -95
  22. package/lib/storages/data-source.ts +0 -37
  23. package/tests/app/bootstrap.ts +0 -16
  24. package/tests/app/db.ts +0 -22
  25. package/tests/app/filters.ts +0 -25
  26. package/tests/app/helpers/is-one-of.ts +0 -58
  27. package/tests/app/main.ts +0 -3
  28. package/tests/app/module/app.controller.ts +0 -67
  29. package/tests/app/module/app.dto.ts +0 -394
  30. package/tests/app/module/app.module.ts +0 -12
  31. package/tests/app/module/app.service.ts +0 -76
  32. package/tests/app/root.module.ts +0 -12
  33. package/tests/globals.d.ts +0 -6
  34. package/tests/integrations/cases.test.ts +0 -154
  35. package/tests/integrations/custom.test.ts +0 -69
  36. package/tests/unit/definitions.test.ts +0 -31
  37. package/tsconfig.build.json +0 -9
  38. package/tsconfig.json +0 -17
  39. package/tsconfig.test-app.json +0 -10
@@ -1,69 +0,0 @@
1
- import { CoreError, DataSource } from '@companix/xeo-scheme'
2
- import { getDataSourceToken } from '../../lib'
3
-
4
- import { bootstrap } from '../app/bootstrap'
5
- import { MongoCollectionDriver } from '../../lib/drivers/collection.driver'
6
- import { AppScheme, createMockKit, dataScheme } from '@companix/xeo-devkit'
7
-
8
- const runScenario = async (dataSource: DataSource<AppScheme, MongoCollectionDriver<AppScheme>>) => {
9
- // version: 11
10
- // const kit = await createMockKit(dataSource)
11
- // await kit.addDictionary({ dictionary: 'regions' })
12
- // await kit.addOption({
13
- // value: 'option-1',
14
- // dictionary: 'regions' // BelongsTo
15
- // })
16
- // await kit.addRevisorWorker({ workerId: 2 })
17
- // await dataSource.collections.worker.update(2, (w) => {
18
- // if (w.type === 'revisor') {
19
- // w.about.height = 10
20
- // w.password = 'password'
21
- // // w.job_type = 'self_employed'
22
- // }
23
- // })
24
- // await kit.addDictionary({
25
- // dictionary: 'value_type',
26
- // name: 'ТМЦ'
27
- // })
28
- // await kit.addOption({
29
- // dictionary: 'regions',
30
- // value: 'moscow',
31
- // title: 'Москва'
32
- // })
33
- // await kit.addOption({
34
- // dictionary: 'regions',
35
- // value: 'shanghai',
36
- // title: 'Шанхай'
37
- // })
38
- // await dataSource.collections.options.remove('moscow')
39
- // await kit.addRole({
40
- // value: 'director',
41
- // title: 'Директор'
42
- // })
43
- // await kit.addRevisorWorker({
44
- // workerId: 3
45
- // })
46
- // await dataSource.collections.worker.remove(1)
47
- }
48
-
49
- async function bootstrapTest() {
50
- const app = await bootstrap()
51
- const dataSource = app.get<DataSource<AppScheme, MongoCollectionDriver<AppScheme>>>(
52
- getDataSourceToken(dataScheme)
53
- )
54
-
55
- try {
56
- console.log('Run Scenario')
57
- await runScenario(dataSource)
58
- console.log('Scenario Done!')
59
- } catch (error) {
60
- if (error instanceof CoreError) {
61
- console.error('CoreError:', error)
62
- return
63
- }
64
-
65
- throw error
66
- }
67
- }
68
-
69
- bootstrapTest()
@@ -1,31 +0,0 @@
1
- import { dataScheme } from '@companix/xeo-devkit'
2
- import { DefinitionsFactory } from '../../lib/factories/definitions.factory'
3
-
4
- const factory = new DefinitionsFactory(dataScheme)
5
-
6
- const schemas = {
7
- worker: factory.createForCollection('worker'),
8
- bankCard: factory.createForCollection('bankCard'),
9
- bankDetail: factory.createForCollection('bankDetail'),
10
- scan: factory.createForCollection('scan'),
11
- dictionaries: factory.createForCollection('dictionaries'),
12
- options: factory.createForCollection('options')
13
- }
14
-
15
- const workerScheme = dataScheme.models[dataScheme.collections.worker.name].scheme
16
-
17
- console.dir(schemas.worker, {
18
- depth: null,
19
- colors: true
20
- })
21
-
22
- if (workerScheme.type === 'discriminated') {
23
- console.log('\ndiscriminated:\n')
24
-
25
- for (const i of workerScheme.discriminators) {
26
- console.dir(factory.createDefinitionScheme(i), {
27
- depth: null,
28
- colors: true
29
- })
30
- }
31
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./lib"
6
- },
7
- "include": ["lib/**/*"],
8
- "exclude": ["node_modules", "tests", "dist", "**/*spec.ts"]
9
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "noImplicitAny": false,
6
- "removeComments": true,
7
- "noLib": false,
8
- "emitDecoratorMetadata": true,
9
- "experimentalDecorators": true,
10
- "target": "ES2021",
11
- "sourceMap": true,
12
- "esModuleInterop": true,
13
- "skipLibCheck": true,
14
- "strict": true,
15
- "strictPropertyInitialization": false
16
- }
17
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./tests/app/dist",
5
- "rootDir": ".",
6
- "declaration": false
7
- },
8
- "include": ["lib/**/*", "tests/**/*"],
9
- "exclude": ["node_modules", "dist", "**/*spec.ts"]
10
- }