@deepkit/orm-browser 1.0.1-alpha.86 → 1.0.1-alpha.88

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.
@@ -0,0 +1,2 @@
1
+ export * from './src/module.js';
2
+ export * from './src/config.js';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/module.js"), exports);
18
+ __exportStar(require("./src/config.js"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,kDAAgC"}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import 'reflect-metadata';
2
+ export {};
package/dist/cjs/main.js CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- require("reflect-metadata");
5
4
  const framework_1 = require("@deepkit/framework");
6
5
  const app_1 = require("@deepkit/app");
7
6
  const orm_1 = require("@deepkit/orm");
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../main.ts"],"names":[],"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AA8D;AAC9D,sCAA0D;AAC1D,wCAA6D;AAC7D,gDAAoD;AAEpD,cAAQ,CAAC,QAAQ,GAAG,EAAE,CAAC;AACvB,MAAM,gBAAgB,GAAG,IAAI,sBAAgB,CAAC,0BAAe,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;AAChF,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAErD,MAAM,SAAS,GAAG,IAAI,eAAS,CAAC;IAC5B,SAAS,EAAE;QACP,EAAE,OAAO,EAAE,gCAAoB,EAAE,QAAQ,EAAE,IAAI,gCAAoB,CAAC,cAAQ,CAAC,QAAQ,CAAC,EAAE;KAC3F;IACD,WAAW,EAAE;QACT,gCAAoB;KACvB;IACD,OAAO,EAAE;QACL,IAAI,2BAAe,CAAC;YAChB,IAAI,EAAE,IAAI;SACb,CAAC;KACL;CACJ,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;IACxB,MAAM,SAAS,GAAG,IAAA,oBAAc,EAAC,4DAA4D,EAAE,SAAS,CAAC,CAAC;IAC1G,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,GAAG,SAAS,CAAC,CAAC;IACvG,IAAA,mCAA4B,EAAC,MAAM,EAAE,EAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,sBAAsB,EAAC,CAAC,CAAC;AACzG,CAAC,CAAC,CAAC;AAEH,SAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,EAAC,MAAM,EAAE,cAAc,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare class Config {
2
+ path: string;
3
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Config = void 0;
4
+ class Config {
5
+ constructor() {
6
+ this.path = '/data';
7
+ }
8
+ }
9
+ exports.Config = Config;
10
+ Config.__type = ['path', function () { return '/data'; }, '&3!>"5'];
11
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;IAAnB;QACI,SAAI,GAAW,OAAO,CAAC;KAC1B;;AAFD,wBAEC;8CADkB,OAAO"}
@@ -0,0 +1,10 @@
1
+ import { Database } from '@deepkit/orm';
2
+ import { Config } from './config';
3
+ import { ClassType } from '@deepkit/core';
4
+ declare const OrmBrowserModule_base: import("@deepkit/app").AppModuleClass<Config>;
5
+ export declare class OrmBrowserModule extends OrmBrowserModule_base {
6
+ databases: ClassType[];
7
+ forDatabases(databases: ClassType<Database>[]): this;
8
+ process(): void;
9
+ }
10
+ export {};
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.OrmBrowserModule = void 0;
10
+ /*@ts-ignore*/
11
+ const { __ΩClassType } = require('@deepkit/core');
12
+ function __assignType(fn, args) {
13
+ fn.__type = args;
14
+ return fn;
15
+ }
16
+ const app_1 = require("@deepkit/app");
17
+ const framework_1 = require("@deepkit/framework");
18
+ const orm_1 = require("@deepkit/orm");
19
+ const config_1 = require("./config");
20
+ const rpc_1 = require("@deepkit/rpc");
21
+ const core_1 = require("@deepkit/core");
22
+ const injector_1 = require("@deepkit/injector");
23
+ const path_1 = require("path");
24
+ const http_1 = require("@deepkit/http");
25
+ class OrmBrowserModule extends (0, app_1.createModule)({
26
+ config: config_1.Config
27
+ }) {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.databases = [];
31
+ }
32
+ forDatabases(databases) {
33
+ this.databases = databases;
34
+ return this;
35
+ }
36
+ process() {
37
+ const controllerName = '.deepkit/orm-browser/' + this.config.path;
38
+ let ScopedController = class ScopedController extends framework_1.OrmBrowserController {
39
+ };
40
+ ScopedController.__type = [() => framework_1.OrmBrowserController, 'P7!5'];
41
+ ScopedController = __decorate([
42
+ rpc_1.rpc.controller(controllerName)
43
+ ], ScopedController);
44
+ this.addController(ScopedController);
45
+ this.addProvider({
46
+ provide: ScopedController,
47
+ useFactory: __assignType((registry, injectorContext) => {
48
+ return new ScopedController(this.databases.length ? this.databases.map(__assignType(v => injectorContext.get(v), ['v', '', 'P"2!"/"'])) : registry.getDatabases());
49
+ }, [() => orm_1.DatabaseRegistry, 'registry', () => injector_1.InjectorContext, 'injectorContext', '', 'PP7!2"P7#2$"/%'])
50
+ });
51
+ const localPath = (0, app_1.findParentPath)('node_modules/@deepkit/orm-browser-gui/dist/orm-browser-gui', (0, path_1.dirname)((0, core_1.getCurrentFileName)()));
52
+ if (!localPath)
53
+ throw new Error('node_modules/@deepkit/orm-browser-gui not installed in ' + (0, path_1.dirname)((0, core_1.getCurrentFileName)()));
54
+ (0, http_1.registerStaticHttpController)(this, {
55
+ path: this.config.path,
56
+ localPath,
57
+ groups: ['app-static'],
58
+ controllerName: 'ScopedController',
59
+ indexReplace: {
60
+ APP_CONTROLLER_NAME: controllerName
61
+ }
62
+ });
63
+ }
64
+ }
65
+ exports.OrmBrowserModule = OrmBrowserModule;
66
+ OrmBrowserModule.__type = [() => (0, app_1.createModule)({ config: config_1.Config }), () => __ΩClassType, 'databases', function () { return []; }, () => __ΩClassType, () => orm_1.Database, 'forDatabases', 'process', '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