@journeyapps-labs/reactor-mod-data-browser 1.0.0

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 (133) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +3 -0
  3. package/dist/@types/DataBrowserModule.d.ts +7 -0
  4. package/dist/@types/actions/connections/AddConnectionAction.d.ts +10 -0
  5. package/dist/@types/actions/connections/RemoveConnectionAction.d.ts +10 -0
  6. package/dist/@types/actions/schema-definitions/CreateModelAction.d.ts +9 -0
  7. package/dist/@types/actions/schema-definitions/QuerySchemaModelAction.d.ts +9 -0
  8. package/dist/@types/actions/schema-model/EditSchemaModelAction.d.ts +9 -0
  9. package/dist/@types/core/AbstractConnection.d.ts +33 -0
  10. package/dist/@types/core/AbstractConnectionFactory.d.ts +11 -0
  11. package/dist/@types/core/SchemaModelDefinition.d.ts +20 -0
  12. package/dist/@types/core/SchemaModelObject.d.ts +12 -0
  13. package/dist/@types/core/query/AbstractQuery.d.ts +22 -0
  14. package/dist/@types/core/query/Page.d.ts +24 -0
  15. package/dist/@types/core/query/SimpleQuery.d.ts +36 -0
  16. package/dist/@types/core/types/ManualConnection.d.ts +14 -0
  17. package/dist/@types/core/types/ManualConnectionFactory.d.ts +9 -0
  18. package/dist/@types/entities/ConnectionEntityDefinition.d.ts +9 -0
  19. package/dist/@types/entities/ConnectionFactoryEntityDefinition.d.ts +9 -0
  20. package/dist/@types/entities/QueryEntityDefinition.d.ts +9 -0
  21. package/dist/@types/entities/SchemaModelDefinitionEntityDefinition.d.ts +13 -0
  22. package/dist/@types/entities/SchemaModelObjectEntityDefinition.d.ts +14 -0
  23. package/dist/@types/entities.d.ts +7 -0
  24. package/dist/@types/forms/APIConnectionForm.d.ts +12 -0
  25. package/dist/@types/forms/SchemaModelForm.d.ts +11 -0
  26. package/dist/@types/index.d.ts +3 -0
  27. package/dist/@types/panels/model/ModelPanelFactory.d.ts +28 -0
  28. package/dist/@types/panels/model/ModelPanelWidget.d.ts +6 -0
  29. package/dist/@types/panels/query/PageResultsWidget.d.ts +8 -0
  30. package/dist/@types/panels/query/QueryPanelFactory.d.ts +33 -0
  31. package/dist/@types/panels/query/QueryPanelWidget.d.ts +6 -0
  32. package/dist/@types/panels/query/TableControlsWidget.d.ts +10 -0
  33. package/dist/@types/stores/ConnectionStore.d.ts +20 -0
  34. package/dist/DataBrowserModule.js +45 -0
  35. package/dist/DataBrowserModule.js.map +1 -0
  36. package/dist/actions/connections/AddConnectionAction.js +48 -0
  37. package/dist/actions/connections/AddConnectionAction.js.map +1 -0
  38. package/dist/actions/connections/RemoveConnectionAction.js +43 -0
  39. package/dist/actions/connections/RemoveConnectionAction.js.map +1 -0
  40. package/dist/actions/schema-definitions/CreateModelAction.js +45 -0
  41. package/dist/actions/schema-definitions/CreateModelAction.js.map +1 -0
  42. package/dist/actions/schema-definitions/QuerySchemaModelAction.js +47 -0
  43. package/dist/actions/schema-definitions/QuerySchemaModelAction.js.map +1 -0
  44. package/dist/actions/schema-model/EditSchemaModelAction.js +46 -0
  45. package/dist/actions/schema-model/EditSchemaModelAction.js.map +1 -0
  46. package/dist/core/AbstractConnection.js +69 -0
  47. package/dist/core/AbstractConnection.js.map +1 -0
  48. package/dist/core/AbstractConnectionFactory.js +6 -0
  49. package/dist/core/AbstractConnectionFactory.js.map +1 -0
  50. package/dist/core/SchemaModelDefinition.js +31 -0
  51. package/dist/core/SchemaModelDefinition.js.map +1 -0
  52. package/dist/core/SchemaModelObject.js +12 -0
  53. package/dist/core/SchemaModelObject.js.map +1 -0
  54. package/dist/core/query/AbstractQuery.js +18 -0
  55. package/dist/core/query/AbstractQuery.js.map +1 -0
  56. package/dist/core/query/Page.js +65 -0
  57. package/dist/core/query/Page.js.map +1 -0
  58. package/dist/core/query/SimpleQuery.js +160 -0
  59. package/dist/core/query/SimpleQuery.js.map +1 -0
  60. package/dist/core/types/ManualConnection.js +21 -0
  61. package/dist/core/types/ManualConnection.js.map +1 -0
  62. package/dist/core/types/ManualConnectionFactory.js +50 -0
  63. package/dist/core/types/ManualConnectionFactory.js.map +1 -0
  64. package/dist/entities/ConnectionEntityDefinition.js +77 -0
  65. package/dist/entities/ConnectionEntityDefinition.js.map +1 -0
  66. package/dist/entities/ConnectionFactoryEntityDefinition.js +60 -0
  67. package/dist/entities/ConnectionFactoryEntityDefinition.js.map +1 -0
  68. package/dist/entities/QueryEntityDefinition.js +60 -0
  69. package/dist/entities/QueryEntityDefinition.js.map +1 -0
  70. package/dist/entities/SchemaModelDefinitionEntityDefinition.js +76 -0
  71. package/dist/entities/SchemaModelDefinitionEntityDefinition.js.map +1 -0
  72. package/dist/entities/SchemaModelObjectEntityDefinition.js +76 -0
  73. package/dist/entities/SchemaModelObjectEntityDefinition.js.map +1 -0
  74. package/dist/entities.js +9 -0
  75. package/dist/entities.js.map +1 -0
  76. package/dist/forms/APIConnectionForm.js +31 -0
  77. package/dist/forms/APIConnectionForm.js.map +1 -0
  78. package/dist/forms/SchemaModelForm.js +72 -0
  79. package/dist/forms/SchemaModelForm.js.map +1 -0
  80. package/dist/index.js +4 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/panels/model/ModelPanelFactory.js +94 -0
  83. package/dist/panels/model/ModelPanelFactory.js.map +1 -0
  84. package/dist/panels/model/ModelPanelWidget.js +28 -0
  85. package/dist/panels/model/ModelPanelWidget.js.map +1 -0
  86. package/dist/panels/query/PageResultsWidget.js +24 -0
  87. package/dist/panels/query/PageResultsWidget.js.map +1 -0
  88. package/dist/panels/query/QueryPanelFactory.js +94 -0
  89. package/dist/panels/query/QueryPanelFactory.js.map +1 -0
  90. package/dist/panels/query/QueryPanelWidget.js +41 -0
  91. package/dist/panels/query/QueryPanelWidget.js.map +1 -0
  92. package/dist/panels/query/TableControlsWidget.js +52 -0
  93. package/dist/panels/query/TableControlsWidget.js.map +1 -0
  94. package/dist/stores/ConnectionStore.js +93 -0
  95. package/dist/stores/ConnectionStore.js.map +1 -0
  96. package/dist/tsconfig.tsbuildinfo +1 -0
  97. package/dist-module/bundle.js +31 -0
  98. package/dist-module/bundle.js.LICENSE.txt +16 -0
  99. package/dist-module/bundle.js.map +1 -0
  100. package/package.json +40 -0
  101. package/reactor.config.json +4 -0
  102. package/src/DataBrowserModule.ts +54 -0
  103. package/src/actions/connections/AddConnectionAction.tsx +33 -0
  104. package/src/actions/connections/RemoveConnectionAction.tsx +28 -0
  105. package/src/actions/schema-definitions/CreateModelAction.ts +32 -0
  106. package/src/actions/schema-definitions/QuerySchemaModelAction.ts +36 -0
  107. package/src/actions/schema-model/EditSchemaModelAction.ts +33 -0
  108. package/src/core/AbstractConnection.ts +101 -0
  109. package/src/core/AbstractConnectionFactory.ts +14 -0
  110. package/src/core/SchemaModelDefinition.ts +44 -0
  111. package/src/core/SchemaModelObject.ts +19 -0
  112. package/src/core/query/AbstractQuery.ts +43 -0
  113. package/src/core/query/Page.ts +59 -0
  114. package/src/core/query/SimpleQuery.tsx +165 -0
  115. package/src/core/types/ManualConnection.ts +32 -0
  116. package/src/core/types/ManualConnectionFactory.tsx +36 -0
  117. package/src/entities/ConnectionEntityDefinition.tsx +81 -0
  118. package/src/entities/ConnectionFactoryEntityDefinition.tsx +54 -0
  119. package/src/entities/QueryEntityDefinition.ts +46 -0
  120. package/src/entities/SchemaModelDefinitionEntityDefinition.ts +82 -0
  121. package/src/entities/SchemaModelObjectEntityDefinition.ts +78 -0
  122. package/src/entities.ts +7 -0
  123. package/src/forms/APIConnectionForm.tsx +48 -0
  124. package/src/forms/SchemaModelForm.tsx +97 -0
  125. package/src/index.ts +5 -0
  126. package/src/panels/model/ModelPanelFactory.tsx +78 -0
  127. package/src/panels/model/ModelPanelWidget.tsx +42 -0
  128. package/src/panels/query/PageResultsWidget.tsx +52 -0
  129. package/src/panels/query/QueryPanelFactory.tsx +76 -0
  130. package/src/panels/query/QueryPanelWidget.tsx +72 -0
  131. package/src/panels/query/TableControlsWidget.tsx +83 -0
  132. package/src/stores/ConnectionStore.ts +87 -0
  133. package/tsconfig.json +14 -0
@@ -0,0 +1,50 @@
1
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "tslib";
2
+ import { AbstractConnectionFactory } from '../AbstractConnectionFactory';
3
+ import { ManualConnection } from './ManualConnection';
4
+ import { DialogStore2, FormDialogDirective, inject } from '@journeyapps-labs/reactor-mod';
5
+ import { APIConnectionForm } from '../../forms/APIConnectionForm';
6
+ let ManualConnectionFactory = (() => {
7
+ var _a, _ManualConnectionFactory_dialogStore_accessor_storage;
8
+ let _classSuper = AbstractConnectionFactory;
9
+ let _dialogStore_decorators;
10
+ let _dialogStore_initializers = [];
11
+ let _dialogStore_extraInitializers = [];
12
+ return _a = class ManualConnectionFactory extends _classSuper {
13
+ get dialogStore() { return __classPrivateFieldGet(this, _ManualConnectionFactory_dialogStore_accessor_storage, "f"); }
14
+ set dialogStore(value) { __classPrivateFieldSet(this, _ManualConnectionFactory_dialogStore_accessor_storage, value, "f"); }
15
+ constructor() {
16
+ super({
17
+ key: 'MANUAL_CONNECTION',
18
+ label: 'API Token Connection'
19
+ });
20
+ _ManualConnectionFactory_dialogStore_accessor_storage.set(this, __runInitializers(this, _dialogStore_initializers, void 0));
21
+ __runInitializers(this, _dialogStore_extraInitializers);
22
+ }
23
+ async generateConnectionFromUI() {
24
+ let result = await this.dialogStore.showDialog(new FormDialogDirective({
25
+ form: new APIConnectionForm(),
26
+ title: 'Create connection',
27
+ // FIXME remove when the fix in Reactor is merged: https://github.com/journeyapps-labs/reactor/pull/32
28
+ handler: async () => { }
29
+ }));
30
+ if (result) {
31
+ return result.form.generateConnection(this);
32
+ }
33
+ return null;
34
+ }
35
+ generateConnection() {
36
+ return new ManualConnection(this);
37
+ }
38
+ },
39
+ _ManualConnectionFactory_dialogStore_accessor_storage = new WeakMap(),
40
+ (() => {
41
+ var _b;
42
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
43
+ _dialogStore_decorators = [inject(DialogStore2)];
44
+ __esDecorate(_a, null, _dialogStore_decorators, { kind: "accessor", name: "dialogStore", static: false, private: false, access: { has: obj => "dialogStore" in obj, get: obj => obj.dialogStore, set: (obj, value) => { obj.dialogStore = value; } }, metadata: _metadata }, _dialogStore_initializers, _dialogStore_extraInitializers);
45
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
46
+ })(),
47
+ _a;
48
+ })();
49
+ export { ManualConnectionFactory };
50
+ //# sourceMappingURL=ManualConnectionFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManualConnectionFactory.js","sourceRoot":"","sources":["../../../src/core/types/ManualConnectionFactory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;IAErD,uBAAuB;;sBAAS,yBAAyB;;;;sBAAzD,uBAAwB,SAAQ,WAA2C;YAEtF,IAAS,WAAW,uGAAe;YAAnC,IAAS,WAAW,4GAAe;YAEnC;gBACE,KAAK,CAAC;oBACJ,GAAG,EAAE,mBAAmB;oBACxB,KAAK,EAAE,sBAAsB;iBAC9B,CAAC,CAAC;gBANI,4HAA0B;;aAOlC;YAED,KAAK,CAAC,wBAAwB;gBAC5B,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAC5C,IAAI,mBAAmB,CAAC;oBACtB,IAAI,EAAE,IAAI,iBAAiB,EAAE;oBAC7B,KAAK,EAAE,mBAAmB;oBAE1B,sGAAsG;oBACtG,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;iBACxB,CAAC,CACH,CAAC;gBACF,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBAC9C,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;YAED,kBAAkB;gBAChB,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;;;;;;uCA5BA,MAAM,CAAC,YAAY,CAAC;YACrB,oLAAS,WAAW,6BAAX,WAAW,iGAAe;;;;;SAFxB,uBAAuB"}
@@ -0,0 +1,77 @@
1
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "tslib";
2
+ import { DescendantEntityProviderComponent, EntityDefinition, EntityDescriberComponent, EntityPanelComponent, inject, InlineTreePresenterComponent, SimpleEntitySearchEngineComponent } from '@journeyapps-labs/reactor-mod';
3
+ import { DataBrowserEntities } from '../entities';
4
+ import { ConnectionStore } from '../stores/ConnectionStore';
5
+ import { AbstractConnection } from '../core/AbstractConnection';
6
+ import { AddConnectionAction } from '../actions/connections/AddConnectionAction';
7
+ let ConnectionEntityDefinition = (() => {
8
+ var _a, _ConnectionEntityDefinition_connectionStore_accessor_storage;
9
+ let _classSuper = EntityDefinition;
10
+ let _connectionStore_decorators;
11
+ let _connectionStore_initializers = [];
12
+ let _connectionStore_extraInitializers = [];
13
+ return _a = class ConnectionEntityDefinition extends _classSuper {
14
+ get connectionStore() { return __classPrivateFieldGet(this, _ConnectionEntityDefinition_connectionStore_accessor_storage, "f"); }
15
+ set connectionStore(value) { __classPrivateFieldSet(this, _ConnectionEntityDefinition_connectionStore_accessor_storage, value, "f"); }
16
+ constructor() {
17
+ super({
18
+ type: DataBrowserEntities.CONNECTION,
19
+ category: 'DataBrowser',
20
+ label: 'Connection',
21
+ icon: 'database',
22
+ iconColor: 'cyan'
23
+ });
24
+ _ConnectionEntityDefinition_connectionStore_accessor_storage.set(this, __runInitializers(this, _connectionStore_initializers, void 0));
25
+ __runInitializers(this, _connectionStore_extraInitializers);
26
+ this.registerComponent(new EntityDescriberComponent({
27
+ label: 'Simple',
28
+ describe: (entity) => {
29
+ return {
30
+ simpleName: entity.name
31
+ };
32
+ }
33
+ }));
34
+ this.registerComponent(new SimpleEntitySearchEngineComponent({
35
+ label: 'Simple',
36
+ getEntities: async () => {
37
+ return this.connectionStore.connections;
38
+ }
39
+ }));
40
+ this.registerComponent(new InlineTreePresenterComponent());
41
+ this.registerComponent(new DescendantEntityProviderComponent({
42
+ descendantType: DataBrowserEntities.SCHEMA_MODEL_DEFINITION,
43
+ generateOptions: (parent) => {
44
+ return {
45
+ descendants: parent.schema_models.items
46
+ };
47
+ }
48
+ }));
49
+ this.registerComponent(new EntityPanelComponent({
50
+ label: 'Connections',
51
+ getEntities: () => {
52
+ return this.connectionStore.connections;
53
+ },
54
+ additionalActions: [AddConnectionAction.ID]
55
+ }));
56
+ }
57
+ matchEntity(t) {
58
+ if (t instanceof AbstractConnection) {
59
+ return true;
60
+ }
61
+ }
62
+ getEntityUID(t) {
63
+ return t.id;
64
+ }
65
+ },
66
+ _ConnectionEntityDefinition_connectionStore_accessor_storage = new WeakMap(),
67
+ (() => {
68
+ var _b;
69
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
70
+ _connectionStore_decorators = [inject(ConnectionStore)];
71
+ __esDecorate(_a, null, _connectionStore_decorators, { kind: "accessor", name: "connectionStore", static: false, private: false, access: { has: obj => "connectionStore" in obj, get: obj => obj.connectionStore, set: (obj, value) => { obj.connectionStore = value; } }, metadata: _metadata }, _connectionStore_initializers, _connectionStore_extraInitializers);
72
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
73
+ })(),
74
+ _a;
75
+ })();
76
+ export { ConnectionEntityDefinition };
77
+ //# sourceMappingURL=ConnectionEntityDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version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B,EAAsB,CAAC,CAAC;gBAE/E,IAAI,CAAC,iBAAiB,CACpB,IAAI,iCAAiC,CAAqB;oBACxD,cAAc,EAAE,mBAAmB,CAAC,uBAAuB;oBAC3D,eAAe,EAAE,CAAC,MAAM,EAAE,EAAE;wBAC1B,OAAO;4BACL,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK;yBACxC,CAAC;oBACJ,CAAC;iBACF,CAAC,CACH,CAAC;gBAEF,IAAI,CAAC,iBAAiB,CACpB,IAAI,oBAAoB,CAAqB;oBAC3C,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,GAAG,EAAE;wBAChB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;oBAC1C,CAAC;oBACD,iBAAiB,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC;iBAC5C,CAAC,CACH,CAAC;aACH;YACD,WAAW,CAAC,CAAM;gBAChB,IAAI,CAAC,YAAY,kBAAkB,EAAE,CAAC;oBACpC,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAED,YAAY,CAAC,CAAqB;gBAChC,OAAO,CAAC,CAAC,EAAE,CAAC;YACd,CAAC;;;;;;2CA/DA,MAAM,CAAC,eAAe,CAAC;YACxB,gMAAS,eAAe,6BAAf,eAAe,yGAAkB;;;;;SAF/B,0BAA0B"}
@@ -0,0 +1,60 @@
1
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "tslib";
2
+ import { EntityDefinition, EntityDescriberComponent, inject, SimpleEntitySearchEngineComponent } from '@journeyapps-labs/reactor-mod';
3
+ import { DataBrowserEntities } from '../entities';
4
+ import { ConnectionStore } from '../stores/ConnectionStore';
5
+ import { AbstractConnectionFactory } from '../core/AbstractConnectionFactory';
6
+ let ConnectionFactoryEntityDefinition = (() => {
7
+ var _a, _ConnectionFactoryEntityDefinition_connectionStore_accessor_storage;
8
+ let _classSuper = EntityDefinition;
9
+ let _connectionStore_decorators;
10
+ let _connectionStore_initializers = [];
11
+ let _connectionStore_extraInitializers = [];
12
+ return _a = class ConnectionFactoryEntityDefinition extends _classSuper {
13
+ get connectionStore() { return __classPrivateFieldGet(this, _ConnectionFactoryEntityDefinition_connectionStore_accessor_storage, "f"); }
14
+ set connectionStore(value) { __classPrivateFieldSet(this, _ConnectionFactoryEntityDefinition_connectionStore_accessor_storage, value, "f"); }
15
+ constructor() {
16
+ super({
17
+ type: DataBrowserEntities.CONNECTION_FACTORY,
18
+ category: 'DataBrowser',
19
+ label: 'Connection type',
20
+ icon: 'database',
21
+ iconColor: 'blue'
22
+ });
23
+ _ConnectionFactoryEntityDefinition_connectionStore_accessor_storage.set(this, __runInitializers(this, _connectionStore_initializers, void 0));
24
+ __runInitializers(this, _connectionStore_extraInitializers);
25
+ this.registerComponent(new EntityDescriberComponent({
26
+ label: 'Simple',
27
+ describe: (entity) => {
28
+ return {
29
+ simpleName: entity.options.label
30
+ };
31
+ }
32
+ }));
33
+ this.registerComponent(new SimpleEntitySearchEngineComponent({
34
+ label: 'Simple',
35
+ getEntities: async () => {
36
+ return this.connectionStore.connectionFactories;
37
+ }
38
+ }));
39
+ }
40
+ matchEntity(t) {
41
+ if (t instanceof AbstractConnectionFactory) {
42
+ return true;
43
+ }
44
+ }
45
+ getEntityUID(t) {
46
+ return t.options.key;
47
+ }
48
+ },
49
+ _ConnectionFactoryEntityDefinition_connectionStore_accessor_storage = new WeakMap(),
50
+ (() => {
51
+ var _b;
52
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
53
+ _connectionStore_decorators = [inject(ConnectionStore)];
54
+ __esDecorate(_a, null, _connectionStore_decorators, { kind: "accessor", name: "connectionStore", static: false, private: false, access: { has: obj => "connectionStore" in obj, get: obj => obj.connectionStore, set: (obj, value) => { obj.connectionStore = value; } }, metadata: _metadata }, _connectionStore_initializers, _connectionStore_extraInitializers);
55
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
56
+ })(),
57
+ _a;
58
+ })();
59
+ export { ConnectionFactoryEntityDefinition };
60
+ //# sourceMappingURL=ConnectionFactoryEntityDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionFactoryEntityDefinition.js","sourceRoot":"","sources":["../../src/entities/ConnectionFactoryEntityDefinition.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,MAAM,EACN,iCAAiC,EAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;IAEjE,iCAAiC;;sBAAS,gBAAgB;;;;sBAA1D,iCAAkC,SAAQ,WAA2C;YAEhG,IAAS,eAAe,qHAAkB;YAA1C,IAAS,eAAe,0HAAkB;YAE1C;gBACE,KAAK,CAAC;oBACJ,IAAI,EAAE,mBAAmB,CAAC,kBAAkB;oBAC5C,QAAQ,EAAE,aAAa;oBACvB,KAAK,EAAE,iBAAiB;oBACxB,IAAI,EAAE,UAAU;oBAChB,SAAS,EAAE,MAAM;iBAClB,CAAC,CAAC;gBATI,8IAAiC;;gBAWxC,IAAI,CAAC,iBAAiB,CACpB,IAAI,wBAAwB,CAA4B;oBACtD,KAAK,EAAE,QAAQ;oBACf,QAAQ,EAAE,CAAC,MAAiC,EAAE,EAAE;wBAC9C,OAAO;4BACL,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;yBACjC,CAAC;oBACJ,CAAC;iBACF,CAAC,CACH,CAAC;gBAEF,IAAI,CAAC,iBAAiB,CACpB,IAAI,iCAAiC,CAA4B;oBAC/D,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,KAAK,IAAI,EAAE;wBACtB,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC;oBAClD,CAAC;iBACF,CAAC,CACH,CAAC;aACH;YAED,WAAW,CAAC,CAAM;gBAChB,IAAI,CAAC,YAAY,yBAAyB,EAAE,CAAC;oBAC3C,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAED,YAAY,CAAC,CAA4B;gBACvC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;YACvB,CAAC;;;;;;2CAzCA,MAAM,CAAC,eAAe,CAAC;YACxB,gMAAS,eAAe,6BAAf,eAAe,yGAAkB;;;;;SAF/B,iCAAiC"}
@@ -0,0 +1,60 @@
1
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "tslib";
2
+ import { EntityDefinition, inject, InlineEntityEncoderComponent } from '@journeyapps-labs/reactor-mod';
3
+ import { DataBrowserEntities } from '../entities';
4
+ import { ConnectionStore } from '../stores/ConnectionStore';
5
+ import { AbstractQuery } from '../core/query/AbstractQuery';
6
+ import { SimpleQuery } from '../core/query/SimpleQuery';
7
+ let QueryEntityDefinition = (() => {
8
+ var _a, _QueryEntityDefinition_connectionStore_accessor_storage;
9
+ let _classSuper = EntityDefinition;
10
+ let _connectionStore_decorators;
11
+ let _connectionStore_initializers = [];
12
+ let _connectionStore_extraInitializers = [];
13
+ return _a = class QueryEntityDefinition extends _classSuper {
14
+ get connectionStore() { return __classPrivateFieldGet(this, _QueryEntityDefinition_connectionStore_accessor_storage, "f"); }
15
+ set connectionStore(value) { __classPrivateFieldSet(this, _QueryEntityDefinition_connectionStore_accessor_storage, value, "f"); }
16
+ constructor() {
17
+ super({
18
+ type: DataBrowserEntities.QUERY,
19
+ category: 'DataBrowser',
20
+ label: 'Query',
21
+ icon: 'search',
22
+ iconColor: 'red'
23
+ });
24
+ _QueryEntityDefinition_connectionStore_accessor_storage.set(this, __runInitializers(this, _connectionStore_initializers, void 0));
25
+ __runInitializers(this, _connectionStore_extraInitializers);
26
+ this.registerComponent(new InlineEntityEncoderComponent({
27
+ version: 1,
28
+ encode: (e) => {
29
+ return e.serialize();
30
+ },
31
+ decode: async (entity) => {
32
+ if (entity.type === 'simple') {
33
+ let query = new SimpleQuery();
34
+ await query.deserialize(this.connectionStore, entity);
35
+ return query;
36
+ }
37
+ }
38
+ }));
39
+ }
40
+ matchEntity(t) {
41
+ if (t instanceof AbstractQuery) {
42
+ return true;
43
+ }
44
+ }
45
+ getEntityUID(t) {
46
+ return t.id;
47
+ }
48
+ },
49
+ _QueryEntityDefinition_connectionStore_accessor_storage = new WeakMap(),
50
+ (() => {
51
+ var _b;
52
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
53
+ _connectionStore_decorators = [inject(ConnectionStore)];
54
+ __esDecorate(_a, null, _connectionStore_decorators, { kind: "accessor", name: "connectionStore", static: false, private: false, access: { has: obj => "connectionStore" in obj, get: obj => obj.connectionStore, set: (obj, value) => { obj.connectionStore = value; } }, metadata: _metadata }, _connectionStore_initializers, _connectionStore_extraInitializers);
55
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
56
+ })(),
57
+ _a;
58
+ })();
59
+ export { QueryEntityDefinition };
60
+ //# sourceMappingURL=QueryEntityDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryEntityDefinition.js","sourceRoot":"","sources":["../../src/entities/QueryEntityDefinition.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAwB,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;IAE3C,qBAAqB;;sBAAS,gBAAgB;;;;sBAA9C,qBAAsB,SAAQ,WAA+B;YAExE,IAAS,eAAe,yGAAkB;YAA1C,IAAS,eAAe,8GAAkB;YAE1C;gBACE,KAAK,CAAC;oBACJ,IAAI,EAAE,mBAAmB,CAAC,KAAK;oBAC/B,QAAQ,EAAE,aAAa;oBACvB,KAAK,EAAE,OAAO;oBACd,IAAI,EAAE,QAAQ;oBACd,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAC;gBATI,kIAAiC;;gBAWxC,IAAI,CAAC,iBAAiB,CACpB,IAAI,4BAA4B,CAAsC;oBACpE,OAAO,EAAE,CAAC;oBACV,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;wBACZ,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;oBACvB,CAAC;oBACD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;wBACvB,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;4BAC7B,IAAI,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;4BAC9B,MAAM,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,MAAa,CAAC,CAAC;4BAC7D,OAAO,KAAK,CAAC;wBACf,CAAC;oBACH,CAAC;iBACF,CAAC,CACH,CAAC;aACH;YAED,WAAW,CAAC,CAAM;gBAChB,IAAI,CAAC,YAAY,aAAa,EAAE,CAAC;oBAC/B,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAED,YAAY,CAAC,CAAgB;gBAC3B,OAAO,CAAC,CAAC,EAAE,CAAC;YACd,CAAC;;;;;;2CArCA,MAAM,CAAC,eAAe,CAAC;YACxB,gMAAS,eAAe,6BAAf,eAAe,yGAAkB;;;;;SAF/B,qBAAqB"}
@@ -0,0 +1,76 @@
1
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "tslib";
2
+ import { EntityDefinition, EntityDescriberComponent, inject, InlineEntityEncoderComponent, InlineTreePresenterComponent, SimpleParentEntitySearchEngine } from '@journeyapps-labs/reactor-mod';
3
+ import { DataBrowserEntities } from '../entities';
4
+ import { ConnectionStore } from '../stores/ConnectionStore';
5
+ import { SchemaModelDefinition } from '../core/SchemaModelDefinition';
6
+ let SchemaModelDefinitionEntityDefinition = (() => {
7
+ var _a, _SchemaModelDefinitionEntityDefinition_connectionStore_accessor_storage;
8
+ let _classSuper = EntityDefinition;
9
+ let _connectionStore_decorators;
10
+ let _connectionStore_initializers = [];
11
+ let _connectionStore_extraInitializers = [];
12
+ return _a = class SchemaModelDefinitionEntityDefinition extends _classSuper {
13
+ get connectionStore() { return __classPrivateFieldGet(this, _SchemaModelDefinitionEntityDefinition_connectionStore_accessor_storage, "f"); }
14
+ set connectionStore(value) { __classPrivateFieldSet(this, _SchemaModelDefinitionEntityDefinition_connectionStore_accessor_storage, value, "f"); }
15
+ constructor() {
16
+ super({
17
+ type: DataBrowserEntities.SCHEMA_MODEL_DEFINITION,
18
+ category: 'DataBrowser',
19
+ label: 'Schema model definition',
20
+ icon: 'cube',
21
+ iconColor: 'mediumpurple'
22
+ });
23
+ _SchemaModelDefinitionEntityDefinition_connectionStore_accessor_storage.set(this, __runInitializers(this, _connectionStore_initializers, void 0));
24
+ __runInitializers(this, _connectionStore_extraInitializers);
25
+ this.registerComponent(new EntityDescriberComponent({
26
+ label: 'Simple',
27
+ describe: (entity) => {
28
+ return {
29
+ simpleName: entity.definition.label,
30
+ complexName: entity.definition.name
31
+ };
32
+ }
33
+ }));
34
+ this.registerComponent(new InlineEntityEncoderComponent({
35
+ version: 1,
36
+ encode: (e) => {
37
+ return {
38
+ connection_id: e.connection.id,
39
+ type: e.definition.name
40
+ };
41
+ },
42
+ decode: async (entity) => {
43
+ let connection = await this.connectionStore.waitForReadyForConnection(entity.connection_id);
44
+ return connection.waitForSchemaModelDefinitionByName(entity.type);
45
+ }
46
+ }));
47
+ this.registerComponent(new InlineTreePresenterComponent());
48
+ this.registerComponent(new SimpleParentEntitySearchEngine({
49
+ label: 'Simple',
50
+ type: DataBrowserEntities.CONNECTION,
51
+ getEntities: async (event) => {
52
+ return event.parameters.parent.schema_models.items;
53
+ }
54
+ }));
55
+ }
56
+ matchEntity(t) {
57
+ if (t instanceof SchemaModelDefinition) {
58
+ return true;
59
+ }
60
+ }
61
+ getEntityUID(t) {
62
+ return t.definition.name;
63
+ }
64
+ },
65
+ _SchemaModelDefinitionEntityDefinition_connectionStore_accessor_storage = new WeakMap(),
66
+ (() => {
67
+ var _b;
68
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
69
+ _connectionStore_decorators = [inject(ConnectionStore)];
70
+ __esDecorate(_a, null, _connectionStore_decorators, { kind: "accessor", name: "connectionStore", static: false, private: false, access: { has: obj => "connectionStore" in obj, get: obj => obj.connectionStore, set: (obj, value) => { obj.connectionStore = value; } }, metadata: _metadata }, _connectionStore_initializers, _connectionStore_extraInitializers);
71
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
72
+ })(),
73
+ _a;
74
+ })();
75
+ export { SchemaModelDefinitionEntityDefinition };
76
+ //# sourceMappingURL=SchemaModelDefinitionEntityDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaModelDefinitionEntityDefinition.js","sourceRoot":"","sources":["../../src/entities/SchemaModelDefinitionEntityDefinition.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,MAAM,EACN,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;IAOzD,qCAAqC;;sBAAS,gBAAg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C5E,KAAK,EAAE,QAAQ;oBACf,IAAI,EAAE,mBAAmB,CAAC,UAAU;oBACpC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;wBAC3B,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;oBACrD,CAAC;iBACF,CAAC,CACH,CAAC;aACH;YAED,WAAW,CAAC,CAAM;gBAChB,IAAI,CAAC,YAAY,qBAAqB,EAAE,CAAC;oBACvC,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAED,YAAY,CAAC,CAAwB;gBACnC,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;YAC3B,CAAC;;;;;;2CA7DA,MAAM,CAAC,eAAe,CAAC;YACxB,gMAAS,eAAe,6BAAf,eAAe,yGAAkB;;;;;SAF/B,qCAAqC"}
@@ -0,0 +1,76 @@
1
+ import { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "tslib";
2
+ import { EntityDefinition, EntityDescriberComponent, inject, InlineEntityEncoderComponent, InlineTreePresenterComponent } from '@journeyapps-labs/reactor-mod';
3
+ import { DataBrowserEntities } from '../entities';
4
+ import { ConnectionStore } from '../stores/ConnectionStore';
5
+ import { SchemaModelObject } from '../core/SchemaModelObject';
6
+ let SchemaModelObjectEntityDefinition = (() => {
7
+ var _a, _SchemaModelObjectEntityDefinition_connectionStore_accessor_storage;
8
+ let _classSuper = EntityDefinition;
9
+ let _connectionStore_decorators;
10
+ let _connectionStore_initializers = [];
11
+ let _connectionStore_extraInitializers = [];
12
+ return _a = class SchemaModelObjectEntityDefinition extends _classSuper {
13
+ get connectionStore() { return __classPrivateFieldGet(this, _SchemaModelObjectEntityDefinition_connectionStore_accessor_storage, "f"); }
14
+ set connectionStore(value) { __classPrivateFieldSet(this, _SchemaModelObjectEntityDefinition_connectionStore_accessor_storage, value, "f"); }
15
+ constructor() {
16
+ super({
17
+ type: DataBrowserEntities.SCHEMA_MODEL_OBJECT,
18
+ category: 'DataBrowser',
19
+ label: 'Schema model',
20
+ icon: 'cube',
21
+ iconColor: 'mediumpurple'
22
+ });
23
+ _SchemaModelObjectEntityDefinition_connectionStore_accessor_storage.set(this, __runInitializers(this, _connectionStore_initializers, void 0));
24
+ __runInitializers(this, _connectionStore_extraInitializers);
25
+ this.registerComponent(new EntityDescriberComponent({
26
+ label: 'Simple',
27
+ describe: (entity) => {
28
+ return {
29
+ simpleName: entity.model.id,
30
+ complexName: entity.definition.definition.label
31
+ };
32
+ }
33
+ }));
34
+ this.registerComponent(new InlineEntityEncoderComponent({
35
+ version: 1,
36
+ encode: (e) => {
37
+ return {
38
+ connection_id: e.definition.connection.id,
39
+ type: e.definition.definition.name,
40
+ id: e.model.id
41
+ };
42
+ },
43
+ decode: async (entity) => {
44
+ let connection = await this.connectionStore.waitForReadyForConnection(entity.connection_id);
45
+ let definition = await connection.waitForSchemaModelDefinitionByName(entity.type);
46
+ let db = await definition.getCollection();
47
+ let model = await db.first(entity.id);
48
+ return new SchemaModelObject({
49
+ model,
50
+ definition
51
+ });
52
+ }
53
+ }));
54
+ this.registerComponent(new InlineTreePresenterComponent());
55
+ }
56
+ matchEntity(t) {
57
+ if (t instanceof SchemaModelObject) {
58
+ return true;
59
+ }
60
+ }
61
+ getEntityUID(t) {
62
+ return t.model.id;
63
+ }
64
+ },
65
+ _SchemaModelObjectEntityDefinition_connectionStore_accessor_storage = new WeakMap(),
66
+ (() => {
67
+ var _b;
68
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
69
+ _connectionStore_decorators = [inject(ConnectionStore)];
70
+ __esDecorate(_a, null, _connectionStore_decorators, { kind: "accessor", name: "connectionStore", static: false, private: false, access: { has: obj => "connectionStore" in obj, get: obj => obj.connectionStore, set: (obj, value) => { obj.connectionStore = value; } }, metadata: _metadata }, _connectionStore_initializers, _connectionStore_extraInitializers);
71
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
72
+ })(),
73
+ _a;
74
+ })();
75
+ export { SchemaModelObjectEntityDefinition };
76
+ //# sourceMappingURL=SchemaModelObjectEntityDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaModelObjectEntityDefinition.js","sourceRoot":"","sources":["../../src/entities/SchemaModelObjectEntityDefinition.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,MAAM,EACN,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;IAQjD,iCAAiC;;sBAAS,gBAAgB;;;;sBAA1D,iCAAkC,SAAQ,WAAmC;YAExF,IAAS,eAAe,qHAAkB;YAA1C,IAAS,eAAe,0HAAkB;YAE1C;gBACE,KAAK,CAAC;oBACJ,IAAI,EAAE,mBAAmB,CAAC,mBAAmB;oBAC7C,QAAQ,EAAE,aAAa;oBACvB,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,MAAM;oBACZ,SAAS,EAAE,cAAc;iBAC1B,CAAC,CAAC;gBATI,8IAAiC;;gBAWxC,IAAI,CAAC,iBAAiB,CACpB,IAAI,wBAAwB,CAAoB;oBAC9C,KAAK,EAAE,QAAQ;oBACf,QAAQ,EAAE,CAAC,MAAyB,EAAE,EAAE;wBACtC,OAAO;4BACL,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;4BAC3B,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK;yBAChD,CAAC;oBACJ,CAAC;iBACF,CAAC,CACH,CAAC;gBAEF,IAAI,CAAC,iBAAiB,CACpB,IAAI,4BAA4B,CAA8D;oBA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CONNECTION"] = "databrowser/connection";
4
+ DataBrowserEntities["CONNECTION_FACTORY"] = "databrowser/connection_factory";
5
+ DataBrowserEntities["SCHEMA_MODEL_DEFINITION"] = "databrowser/schema_model_definition";
6
+ DataBrowserEntities["SCHEMA_MODEL_OBJECT"] = "databrowser/schema_model_object";
7
+ DataBrowserEntities["QUERY"] = "databrowser/query";
8
+ })(DataBrowserEntities || (DataBrowserEntities = {}));
9
+ //# sourceMappingURL=entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.js","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,4DAAqC,CAAA;IACrC,4EAAqD,CAAA;IACrD,sFAA+D,CAAA;IAC/D,8EAAuD,CAAA;IACvD,kDAA2B,CAAA;AAC7B,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B"}
@@ -0,0 +1,31 @@
1
+ import { FormModel, TextInput, TextInputType } from '@journeyapps-labs/reactor-mod';
2
+ import { ManualConnection } from '../core/types/ManualConnection';
3
+ export class APIConnectionForm extends FormModel {
4
+ constructor(value) {
5
+ super();
6
+ this.addInput(new TextInput({
7
+ name: 'name',
8
+ label: 'Connection name',
9
+ value: (value === null || value === void 0 ? void 0 : value.name) || 'Default'
10
+ }));
11
+ this.addInput(new TextInput({
12
+ name: 'base_url',
13
+ label: 'Base URL',
14
+ value: value === null || value === void 0 ? void 0 : value.base_url
15
+ }));
16
+ this.addInput(new TextInput({
17
+ name: 'api_token',
18
+ label: 'API Token',
19
+ inputType: TextInputType.PASSWORD,
20
+ value: value === null || value === void 0 ? void 0 : value.api_token
21
+ }));
22
+ }
23
+ generateConnection(factory) {
24
+ return new ManualConnection(factory, {
25
+ baseUrl: this.value().base_url,
26
+ token: this.value().api_token,
27
+ name: this.value().name
28
+ });
29
+ }
30
+ }
31
+ //# sourceMappingURL=APIConnectionForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"APIConnectionForm.js","sourceRoot":"","sources":["../../src/forms/APIConnectionForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AASlE,MAAM,OAAO,iBAAkB,SAAQ,SAAiC;IACtE,YAAY,KAA8B;QACxC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,CACX,IAAI,SAAS,CAAC;YACZ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,iBAAiB;YACxB,KAAK,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAI,SAAS;SAChC,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,QAAQ,CACX,IAAI,SAAS,CAAC;YACZ,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ;SACvB,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,QAAQ,CACX,IAAI,SAAS,CAAC;YACZ,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,aAAa,CAAC,QAAQ;YACjC,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS;SACxB,CAAC,CACH,CAAC;IACJ,CAAC;IAED,kBAAkB,CAAC,OAAgC;QACjD,OAAO,IAAI,gBAAgB,CAAC,OAAO,EAAE;YACnC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ;YAC9B,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,SAAS;YAC7B,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI;SACxB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,72 @@
1
+ import { BooleanInput, DateInput, DateTimePickerType, FormModel, SelectInput, TextInput } from '@journeyapps-labs/reactor-mod';
2
+ import * as _ from 'lodash';
3
+ import { AttachmentType, BooleanType, DatetimeType, DateType, LocationType, MultipleChoiceType, PhotoType, SignatureType, SingleChoiceIntegerType, SingleChoiceType, TextType } from '@journeyapps/db';
4
+ export class SchemaModelForm extends FormModel {
5
+ constructor(options) {
6
+ super();
7
+ this.options = options;
8
+ _.map(options.definition.definition.attributes, (attribute) => {
9
+ var _a, _b, _c, _d, _e, _f, _g;
10
+ if (attribute.type instanceof DatetimeType) {
11
+ return new DateInput({
12
+ name: attribute.name,
13
+ label: attribute.label,
14
+ value: ((_a = options.object) === null || _a === void 0 ? void 0 : _a.model[attribute.name]) || null,
15
+ type: DateTimePickerType.DATETIME
16
+ });
17
+ }
18
+ if (attribute.type instanceof DateType) {
19
+ return new DateInput({
20
+ name: attribute.name,
21
+ label: attribute.label,
22
+ value: ((_b = options.object) === null || _b === void 0 ? void 0 : _b.model[attribute.name]) || null,
23
+ type: DateTimePickerType.DATE
24
+ });
25
+ }
26
+ if (attribute.type instanceof AttachmentType) {
27
+ }
28
+ if (attribute.type instanceof SignatureType) {
29
+ console.log((_c = options.object) === null || _c === void 0 ? void 0 : _c.model[attribute.name]);
30
+ }
31
+ if (attribute.type instanceof PhotoType) {
32
+ console.log((_d = options.object) === null || _d === void 0 ? void 0 : _d.model[attribute.name]);
33
+ }
34
+ if (attribute.type instanceof BooleanType) {
35
+ return new BooleanInput({
36
+ name: attribute.name,
37
+ label: attribute.label,
38
+ value: (_e = options.object) === null || _e === void 0 ? void 0 : _e.model[attribute.name]
39
+ });
40
+ }
41
+ if (attribute.type instanceof LocationType) {
42
+ }
43
+ if (attribute.type instanceof SingleChoiceIntegerType) {
44
+ }
45
+ if (attribute.type instanceof SingleChoiceType) {
46
+ return new SelectInput({
47
+ name: attribute.name,
48
+ label: attribute.label,
49
+ value: (_f = options.object) === null || _f === void 0 ? void 0 : _f.model[attribute.name],
50
+ options: _.mapValues(attribute.type.options, (option) => {
51
+ return `${option.value}`;
52
+ })
53
+ });
54
+ }
55
+ if (attribute.type instanceof MultipleChoiceType) {
56
+ }
57
+ if (attribute.type instanceof TextType) {
58
+ return new TextInput({
59
+ name: attribute.name,
60
+ label: attribute.label,
61
+ value: (_g = options.object) === null || _g === void 0 ? void 0 : _g.model[attribute.name]
62
+ });
63
+ }
64
+ return null;
65
+ })
66
+ .filter((f) => !!f)
67
+ .forEach((a) => {
68
+ this.addInput(a);
69
+ });
70
+ }
71
+ }
72
+ //# sourceMappingURL=SchemaModelForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaModelForm.js","sourceRoot":"","sources":["../../src/forms/SchemaModelForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACV,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAOzB,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,YAAsB,OAA+B;QACnD,KAAK,EAAE,CAAC;QADY,YAAO,GAAP,OAAO,CAAwB;QAGnD,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE;;YAC5D,IAAI,SAAS,CAAC,IAAI,YAAY,YAAY,EAAE,CAAC;gBAC3C,OAAO,IAAI,SAAS,CAAC;oBACnB,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,KAAK,EAAE,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,KAAK,CAAC,SAAS,CAAC,IA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B,EAAE,CAAC;YACxD,CAAC;YACD,IAAI,SAAS,CAAC,IAAI,YAAY,gBAAgB,EAAE,CAAC;gBAC/C,OAAO,IAAI,WAAW,CAAC;oBACrB,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,KAAK,EAAE,MAAA,OAAO,CAAC,MAAM,0CAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;oBAC5C,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;wBACtD,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;oBAC3B,CAAC,CAAC;iBACH,CAAC,CAAC;YACL,CAAC;YACD,IAAI,SAAS,CAAC,IAAI,YAAY,kBAAkB,EAAE,CAAC;YACnD,CAAC;YACD,IAAI,SAAS,CAAC,IAAI,YAAY,QAAQ,EAAE,CAAC;gBACvC,OAAO,IAAI,SAAS,CAAC;oBACnB,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,KAAK,EAAE,MAAA,OAAO,CAAC,MAAM,0CAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;iBAC7C,CAAC,CAAC;YACL,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAClB,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACb,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;CACF"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { DataBrowserModule } from './DataBrowserModule';
2
+ export * from './entities';
3
+ export default DataBrowserModule;
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,cAAc,YAAY,CAAC;AAE3B,eAAe,iBAAiB,CAAC"}