@nest-yalc-2/omnikernel-module 1.1.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.
- package/LICENSE +661 -0
- package/README.md +193 -0
- package/package.json +52 -0
- package/src/__tests__/omni-collection.entity.spec.ts +49 -0
- package/src/__tests__/omni-collection.service.spec.ts +83 -0
- package/src/__tests__/omni-document.entity.spec.ts +55 -0
- package/src/__tests__/omni-document.service.spec.ts +83 -0
- package/src/__tests__/omni-extension-projection-constraints.spec.ts +518 -0
- package/src/__tests__/omni-extension-projection.registration.spec.ts +946 -0
- package/src/__tests__/omni-extension-projection.service.spec.ts +806 -0
- package/src/__tests__/omni-external-ref.entity.spec.ts +36 -0
- package/src/__tests__/omni-external-ref.service.spec.ts +252 -0
- package/src/__tests__/omni-named.entity.spec.ts +33 -0
- package/src/__tests__/omni-record.entity.spec.ts +32 -0
- package/src/__tests__/omni-record.service.spec.ts +107 -0
- package/src/__tests__/omni-relation-semantics.spec.ts +102 -0
- package/src/__tests__/omni-relation.entity.spec.ts +38 -0
- package/src/__tests__/omni-scope-substrate.spec.ts +81 -0
- package/src/__tests__/omni-scoped.backend.spec.ts +115 -0
- package/src/__tests__/omni-scoped.service.spec.ts +354 -0
- package/src/__tests__/omnikernel.diagnostics.spec.ts +94 -0
- package/src/__tests__/omnikernel.module.spec.ts +40 -0
- package/src/__tests__/omnikernel.persistence.spec.ts +154 -0
- package/src/__tests__/omnikernel.public-api.spec.ts +238 -0
- package/src/__tests__/omnikernel.query.service.spec.ts +155 -0
- package/src/__tests__/tsconfig.json +6 -0
- package/src/base/omni-base.entity.d.ts +9 -0
- package/src/base/omni-base.entity.js +53 -0
- package/src/base/omni-base.entity.js.map +1 -0
- package/src/base/omni-base.entity.ts +41 -0
- package/src/base/omni-external-ref.entity.d.ts +13 -0
- package/src/base/omni-external-ref.entity.js +72 -0
- package/src/base/omni-external-ref.entity.js.map +1 -0
- package/src/base/omni-external-ref.entity.ts +53 -0
- package/src/base/omni-named.entity.d.ts +6 -0
- package/src/base/omni-named.entity.js +35 -0
- package/src/base/omni-named.entity.js.map +1 -0
- package/src/base/omni-named.entity.ts +16 -0
- package/src/base/omni-record.entity.d.ts +13 -0
- package/src/base/omni-record.entity.js +71 -0
- package/src/base/omni-record.entity.js.map +1 -0
- package/src/base/omni-record.entity.ts +51 -0
- package/src/base/omni-relation.entity.d.ts +15 -0
- package/src/base/omni-relation.entity.js +91 -0
- package/src/base/omni-relation.entity.js.map +1 -0
- package/src/base/omni-relation.entity.ts +72 -0
- package/src/index.d.ts +49 -0
- package/src/index.js +66 -0
- package/src/index.js.map +1 -0
- package/src/index.ts +49 -0
- package/src/omni-collection-kind.enum.d.ts +4 -0
- package/src/omni-collection-kind.enum.js +13 -0
- package/src/omni-collection-kind.enum.js.map +1 -0
- package/src/omni-collection-kind.enum.ts +10 -0
- package/src/omni-collection.backend.d.ts +2 -0
- package/src/omni-collection.backend.js +15 -0
- package/src/omni-collection.backend.js.map +1 -0
- package/src/omni-collection.backend.ts +16 -0
- package/src/omni-collection.dto.d.ts +32 -0
- package/src/omni-collection.dto.js +184 -0
- package/src/omni-collection.dto.js.map +1 -0
- package/src/omni-collection.dto.ts +170 -0
- package/src/omni-collection.entity.d.ts +7 -0
- package/src/omni-collection.entity.js +41 -0
- package/src/omni-collection.entity.js.map +1 -0
- package/src/omni-collection.entity.ts +21 -0
- package/src/omni-collection.service.d.ts +14 -0
- package/src/omni-collection.service.js +24 -0
- package/src/omni-collection.service.js.map +1 -0
- package/src/omni-collection.service.ts +75 -0
- package/src/omni-document-kind.enum.d.ts +6 -0
- package/src/omni-document-kind.enum.js +15 -0
- package/src/omni-document-kind.enum.js.map +1 -0
- package/src/omni-document-kind.enum.ts +12 -0
- package/src/omni-document.backend.d.ts +2 -0
- package/src/omni-document.backend.js +15 -0
- package/src/omni-document.backend.js.map +1 -0
- package/src/omni-document.backend.ts +16 -0
- package/src/omni-document.dto.d.ts +35 -0
- package/src/omni-document.dto.js +213 -0
- package/src/omni-document.dto.js.map +1 -0
- package/src/omni-document.dto.ts +198 -0
- package/src/omni-document.entity.d.ts +10 -0
- package/src/omni-document.entity.js +53 -0
- package/src/omni-document.entity.js.map +1 -0
- package/src/omni-document.entity.ts +30 -0
- package/src/omni-document.service.d.ts +14 -0
- package/src/omni-document.service.js +24 -0
- package/src/omni-document.service.js.map +1 -0
- package/src/omni-document.service.ts +75 -0
- package/src/omni-dto.helpers.d.ts +1 -0
- package/src/omni-dto.helpers.js +10 -0
- package/src/omni-dto.helpers.js.map +1 -0
- package/src/omni-dto.helpers.ts +21 -0
- package/src/omni-extension-projection.definition.d.ts +17 -0
- package/src/omni-extension-projection.definition.js +160 -0
- package/src/omni-extension-projection.definition.js.map +1 -0
- package/src/omni-extension-projection.definition.ts +294 -0
- package/src/omni-extension-projection.resource.d.ts +42 -0
- package/src/omni-extension-projection.resource.js +127 -0
- package/src/omni-extension-projection.resource.js.map +1 -0
- package/src/omni-extension-projection.resource.ts +274 -0
- package/src/omni-extension-projection.service.d.ts +33 -0
- package/src/omni-extension-projection.service.js +332 -0
- package/src/omni-extension-projection.service.js.map +1 -0
- package/src/omni-extension-projection.service.ts +452 -0
- package/src/omni-external-ref-binding.validator.d.ts +14 -0
- package/src/omni-external-ref-binding.validator.js +34 -0
- package/src/omni-external-ref-binding.validator.js.map +1 -0
- package/src/omni-external-ref-binding.validator.ts +53 -0
- package/src/omni-external-ref-internal-type.enum.d.ts +5 -0
- package/src/omni-external-ref-internal-type.enum.js +14 -0
- package/src/omni-external-ref-internal-type.enum.js.map +1 -0
- package/src/omni-external-ref-internal-type.enum.ts +11 -0
- package/src/omni-external-ref.backend.d.ts +2 -0
- package/src/omni-external-ref.backend.js +19 -0
- package/src/omni-external-ref.backend.js.map +1 -0
- package/src/omni-external-ref.backend.ts +25 -0
- package/src/omni-external-ref.dto.d.ts +26 -0
- package/src/omni-external-ref.dto.js +140 -0
- package/src/omni-external-ref.dto.js.map +1 -0
- package/src/omni-external-ref.dto.ts +128 -0
- package/src/omni-external-ref.service.d.ts +33 -0
- package/src/omni-external-ref.service.js +133 -0
- package/src/omni-external-ref.service.js.map +1 -0
- package/src/omni-external-ref.service.ts +255 -0
- package/src/omni-migration.d.ts +28 -0
- package/src/omni-migration.js +239 -0
- package/src/omni-migration.js.map +1 -0
- package/src/omni-migration.ts +365 -0
- package/src/omni-named.backend.d.ts +2 -0
- package/src/omni-named.backend.js +13 -0
- package/src/omni-named.backend.js.map +1 -0
- package/src/omni-named.backend.ts +11 -0
- package/src/omni-named.dto.d.ts +19 -0
- package/src/omni-named.dto.js +94 -0
- package/src/omni-named.dto.js.map +1 -0
- package/src/omni-named.dto.ts +86 -0
- package/src/omni-projection.catalog.d.ts +49 -0
- package/src/omni-projection.catalog.js +177 -0
- package/src/omni-projection.catalog.js.map +1 -0
- package/src/omni-projection.catalog.ts +345 -0
- package/src/omni-projection.lifecycle.d.ts +20 -0
- package/src/omni-projection.lifecycle.js +3 -0
- package/src/omni-projection.lifecycle.js.map +1 -0
- package/src/omni-projection.lifecycle.ts +53 -0
- package/src/omni-record-status.enum.d.ts +5 -0
- package/src/omni-record-status.enum.js +14 -0
- package/src/omni-record-status.enum.js.map +1 -0
- package/src/omni-record-status.enum.ts +11 -0
- package/src/omni-record.backend.d.ts +2 -0
- package/src/omni-record.backend.js +13 -0
- package/src/omni-record.backend.js.map +1 -0
- package/src/omni-record.backend.ts +19 -0
- package/src/omni-record.dto.d.ts +29 -0
- package/src/omni-record.dto.js +169 -0
- package/src/omni-record.dto.js.map +1 -0
- package/src/omni-record.dto.ts +157 -0
- package/src/omni-record.service.d.ts +18 -0
- package/src/omni-record.service.js +45 -0
- package/src/omni-record.service.js.map +1 -0
- package/src/omni-record.service.ts +113 -0
- package/src/omni-relation-kind.contract.d.ts +9 -0
- package/src/omni-relation-kind.contract.js +33 -0
- package/src/omni-relation-kind.contract.js.map +1 -0
- package/src/omni-relation-kind.contract.ts +49 -0
- package/src/omni-relation-kind.enum.d.ts +6 -0
- package/src/omni-relation-kind.enum.js +15 -0
- package/src/omni-relation-kind.enum.js.map +1 -0
- package/src/omni-relation-kind.enum.ts +12 -0
- package/src/omni-relation-projection.definition.d.ts +25 -0
- package/src/omni-relation-projection.definition.js +83 -0
- package/src/omni-relation-projection.definition.js.map +1 -0
- package/src/omni-relation-projection.definition.ts +166 -0
- package/src/omni-relation-projection.resource.d.ts +51 -0
- package/src/omni-relation-projection.resource.js +203 -0
- package/src/omni-relation-projection.resource.js.map +1 -0
- package/src/omni-relation-projection.resource.ts +360 -0
- package/src/omni-relation-projection.service.d.ts +47 -0
- package/src/omni-relation-projection.service.js +385 -0
- package/src/omni-relation-projection.service.js.map +1 -0
- package/src/omni-relation-projection.service.ts +610 -0
- package/src/omni-relation-semantics.d.ts +11 -0
- package/src/omni-relation-semantics.js +34 -0
- package/src/omni-relation-semantics.js.map +1 -0
- package/src/omni-relation-semantics.ts +52 -0
- package/src/omni-relation-status.enum.d.ts +5 -0
- package/src/omni-relation-status.enum.js +14 -0
- package/src/omni-relation-status.enum.js.map +1 -0
- package/src/omni-relation-status.enum.ts +11 -0
- package/src/omni-relation.backend.d.ts +2 -0
- package/src/omni-relation.backend.js +17 -0
- package/src/omni-relation.backend.js.map +1 -0
- package/src/omni-relation.backend.ts +21 -0
- package/src/omni-relation.dto.d.ts +28 -0
- package/src/omni-relation.dto.js +153 -0
- package/src/omni-relation.dto.js.map +1 -0
- package/src/omni-relation.dto.ts +142 -0
- package/src/omni-relation.service.d.ts +19 -0
- package/src/omni-relation.service.js +76 -0
- package/src/omni-relation.service.js.map +1 -0
- package/src/omni-relation.service.ts +159 -0
- package/src/omni-scope.d.ts +33 -0
- package/src/omni-scope.js +91 -0
- package/src/omni-scope.js.map +1 -0
- package/src/omni-scope.ts +161 -0
- package/src/omni-scoped.backend.d.ts +21 -0
- package/src/omni-scoped.backend.js +47 -0
- package/src/omni-scoped.backend.js.map +1 -0
- package/src/omni-scoped.backend.ts +110 -0
- package/src/omni-scoped.repository.d.ts +10 -0
- package/src/omni-scoped.repository.js +26 -0
- package/src/omni-scoped.repository.js.map +1 -0
- package/src/omni-scoped.repository.ts +34 -0
- package/src/omni-scoped.service.d.ts +36 -0
- package/src/omni-scoped.service.js +171 -0
- package/src/omni-scoped.service.js.map +1 -0
- package/src/omni-scoped.service.ts +338 -0
- package/src/omnikernel.diagnostics.d.ts +16 -0
- package/src/omnikernel.diagnostics.js +50 -0
- package/src/omnikernel.diagnostics.js.map +1 -0
- package/src/omnikernel.diagnostics.ts +83 -0
- package/src/omnikernel.module.d.ts +5 -0
- package/src/omnikernel.module.js +87 -0
- package/src/omnikernel.module.js.map +1 -0
- package/src/omnikernel.module.ts +97 -0
- package/src/omnikernel.query.service.d.ts +17 -0
- package/src/omnikernel.query.service.js +85 -0
- package/src/omnikernel.query.service.js.map +1 -0
- package/src/omnikernel.query.service.ts +108 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export * from './base/omni-base.entity.js';
|
|
2
|
+
export * from './base/omni-named.entity.js';
|
|
3
|
+
export * from './base/omni-record.entity.js';
|
|
4
|
+
export * from './base/omni-relation.entity.js';
|
|
5
|
+
export * from './base/omni-external-ref.entity.js';
|
|
6
|
+
export * from './omni-named.dto.js';
|
|
7
|
+
export * from './omni-dto.helpers.js';
|
|
8
|
+
export * from './omni-named.backend.js';
|
|
9
|
+
export * from './omni-record-status.enum.js';
|
|
10
|
+
export * from './omni-relation-status.enum.js';
|
|
11
|
+
export * from './omni-relation-kind.enum.js';
|
|
12
|
+
export * from './omni-relation-kind.contract.js';
|
|
13
|
+
export * from './omni-relation-semantics.js';
|
|
14
|
+
export * from './omni-record.dto.js';
|
|
15
|
+
export * from './omni-record.backend.js';
|
|
16
|
+
export * from './omni-record.service.js';
|
|
17
|
+
export * from './omni-collection-kind.enum.js';
|
|
18
|
+
export * from './omni-collection.entity.js';
|
|
19
|
+
export * from './omni-collection.dto.js';
|
|
20
|
+
export * from './omni-collection.service.js';
|
|
21
|
+
export * from './omni-collection.backend.js';
|
|
22
|
+
export * from './omni-document-kind.enum.js';
|
|
23
|
+
export * from './omni-document.entity.js';
|
|
24
|
+
export * from './omni-document.dto.js';
|
|
25
|
+
export * from './omni-document.service.js';
|
|
26
|
+
export * from './omni-document.backend.js';
|
|
27
|
+
export * from './omni-relation.dto.js';
|
|
28
|
+
export * from './omni-relation.backend.js';
|
|
29
|
+
export * from './omni-external-ref-internal-type.enum.js';
|
|
30
|
+
export * from './omni-external-ref-binding.validator.js';
|
|
31
|
+
export * from './omni-external-ref.dto.js';
|
|
32
|
+
export * from './omni-external-ref.service.js';
|
|
33
|
+
export * from './omni-external-ref.backend.js';
|
|
34
|
+
export * from './omni-scoped.repository.js';
|
|
35
|
+
export * from './omni-scoped.service.js';
|
|
36
|
+
export * from './omni-scope.js';
|
|
37
|
+
export * from './omni-scoped.backend.js';
|
|
38
|
+
export * from './omni-projection.lifecycle.js';
|
|
39
|
+
export * from './omni-projection.catalog.js';
|
|
40
|
+
export * from './omni-extension-projection.definition.js';
|
|
41
|
+
export * from './omni-extension-projection.resource.js';
|
|
42
|
+
export * from './omni-extension-projection.service.js';
|
|
43
|
+
export * from './omni-migration.js';
|
|
44
|
+
export * from './omni-relation-projection.definition.js';
|
|
45
|
+
export * from './omni-relation-projection.resource.js';
|
|
46
|
+
export * from './omni-relation-projection.service.js';
|
|
47
|
+
export * from './omnikernel.query.service.js';
|
|
48
|
+
export * from './omnikernel.diagnostics.js';
|
|
49
|
+
export * from './omnikernel.module.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OmniCollectionKind = void 0;
|
|
4
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
5
|
+
var OmniCollectionKind;
|
|
6
|
+
(function (OmniCollectionKind) {
|
|
7
|
+
OmniCollectionKind["Collection"] = "collection";
|
|
8
|
+
OmniCollectionKind["Folder"] = "folder";
|
|
9
|
+
})(OmniCollectionKind || (exports.OmniCollectionKind = OmniCollectionKind = {}));
|
|
10
|
+
(0, graphql_1.registerEnumType)(OmniCollectionKind, {
|
|
11
|
+
name: 'OmniCollectionKind',
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=omni-collection-kind.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-collection-kind.enum.js","sourceRoot":"","sources":["omni-collection-kind.enum.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AAEnD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,uCAAiB,CAAA;AACnB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAA,0BAAgB,EAAC,kBAAkB,EAAE;IACnC,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omniCollectionBackendProvidersFactory = void 0;
|
|
4
|
+
const omni_collection_entity_js_1 = require("./omni-collection.entity.js");
|
|
5
|
+
const omni_collection_service_js_1 = require("./omni-collection.service.js");
|
|
6
|
+
const omni_scoped_backend_js_1 = require("./omni-scoped.backend.js");
|
|
7
|
+
const omniCollectionBackendProvidersFactory = (dbConnection) => (0, omni_scoped_backend_js_1.omniScopedBackendProvidersFactory)({
|
|
8
|
+
entityModel: omni_collection_entity_js_1.OmniCollectionEntity,
|
|
9
|
+
dbConnection,
|
|
10
|
+
serviceToken: (0, omni_scoped_backend_js_1.omniBackendServiceToken)(omni_collection_service_js_1.OmniCollectionService),
|
|
11
|
+
serviceProvider: omni_collection_service_js_1.OmniCollectionService,
|
|
12
|
+
createService: (repository, scope, options) => new omni_collection_service_js_1.OmniCollectionService(repository, scope, options.deletion.collection),
|
|
13
|
+
});
|
|
14
|
+
exports.omniCollectionBackendProvidersFactory = omniCollectionBackendProvidersFactory;
|
|
15
|
+
//# sourceMappingURL=omni-collection.backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-collection.backend.js","sourceRoot":"","sources":["omni-collection.backend.ts"],"names":[],"mappings":";;;AAAA,2EAAmE;AACnE,6EAAqE;AACrE,qEAGkC;AAE3B,MAAM,qCAAqC,GAAG,CAAC,YAAoB,EAAE,EAAE,CAC5E,IAAA,0DAAiC,EAAuB;IACtD,WAAW,EAAE,gDAAoB;IACjC,YAAY;IACZ,YAAY,EAAE,IAAA,gDAAuB,EAAC,kDAAqB,CAAC;IAC5D,eAAe,EAAE,kDAAqB;IACtC,aAAa,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAC5C,IAAI,kDAAqB,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;CAC5E,CAAC,CAAC;AARQ,QAAA,qCAAqC,yCAQ7C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OmniCollectionEntity } from './omni-collection.entity.js';
|
|
2
|
+
import { OmniCollectionService } from './omni-collection.service.js';
|
|
3
|
+
import {
|
|
4
|
+
omniBackendServiceToken,
|
|
5
|
+
omniScopedBackendProvidersFactory,
|
|
6
|
+
} from './omni-scoped.backend.js';
|
|
7
|
+
|
|
8
|
+
export const omniCollectionBackendProvidersFactory = (dbConnection: string) =>
|
|
9
|
+
omniScopedBackendProvidersFactory<OmniCollectionEntity>({
|
|
10
|
+
entityModel: OmniCollectionEntity,
|
|
11
|
+
dbConnection,
|
|
12
|
+
serviceToken: omniBackendServiceToken(OmniCollectionService),
|
|
13
|
+
serviceProvider: OmniCollectionService,
|
|
14
|
+
createService: (repository, scope, options) =>
|
|
15
|
+
new OmniCollectionService(repository, scope, options.deletion.collection),
|
|
16
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Relation } from 'typeorm';
|
|
2
|
+
import { OmniCollectionEntity } from './omni-collection.entity.js';
|
|
3
|
+
import { OmniCollectionKind } from './omni-collection-kind.enum.js';
|
|
4
|
+
import { OmniRecordStatus } from './omni-record-status.enum.js';
|
|
5
|
+
import { OmniRelationType } from './omni-relation.dto.js';
|
|
6
|
+
export declare class OmniCollectionType extends OmniCollectionEntity {
|
|
7
|
+
constructor(data?: Partial<OmniCollectionType>);
|
|
8
|
+
guid: string;
|
|
9
|
+
revision: number;
|
|
10
|
+
externalId?: string | null;
|
|
11
|
+
title: string;
|
|
12
|
+
slug?: string | null;
|
|
13
|
+
kind: OmniCollectionKind;
|
|
14
|
+
status: OmniRecordStatus;
|
|
15
|
+
payload?: Record<string, unknown> | null;
|
|
16
|
+
payloadSchemaId?: string | null;
|
|
17
|
+
payloadSchemaVersion?: number | null;
|
|
18
|
+
outgoingRelations?: Relation<OmniRelationType[]>;
|
|
19
|
+
incomingRelations?: Relation<OmniRelationType[]>;
|
|
20
|
+
collectionKind: OmniCollectionKind;
|
|
21
|
+
summary?: string | null;
|
|
22
|
+
}
|
|
23
|
+
declare const OmniCollectionCreateInput_base: import("@nestjs/common").Type<Omit<OmniCollectionType, "revision" | "createdAt" | "updatedAt" | "kind" | "outgoingRelations" | "incomingRelations">>;
|
|
24
|
+
export declare class OmniCollectionCreateInput extends OmniCollectionCreateInput_base {
|
|
25
|
+
}
|
|
26
|
+
declare const OmniCollectionCondition_base: import("@nestjs/common").Type<Partial<OmniCollectionCreateInput>>;
|
|
27
|
+
export declare class OmniCollectionCondition extends OmniCollectionCondition_base {
|
|
28
|
+
}
|
|
29
|
+
declare const OmniCollectionUpdateInput_base: import("@nestjs/common").Type<Partial<OmniCollectionCreateInput>>;
|
|
30
|
+
export declare class OmniCollectionUpdateInput extends OmniCollectionUpdateInput_base {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OmniCollectionUpdateInput = exports.OmniCollectionCondition = exports.OmniCollectionCreateInput = exports.OmniCollectionType = void 0;
|
|
16
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
17
|
+
const object_decorator_js_1 = require("@nest-yalc-2/crud-gen/object.decorator.js");
|
|
18
|
+
const uuid_scalar_js_1 = require("@nest-yalc-2/graphql/scalars/uuid.scalar.js");
|
|
19
|
+
const returnValue_js_1 = __importDefault(require("@nest-yalc-2/utils/returnValue.js"));
|
|
20
|
+
const class_validator_1 = require("class-validator");
|
|
21
|
+
const graphql_type_json_1 = require("graphql-type-json");
|
|
22
|
+
const omni_relation_entity_js_1 = require("./base/omni-relation.entity.js");
|
|
23
|
+
const omni_collection_entity_js_1 = require("./omni-collection.entity.js");
|
|
24
|
+
const omni_collection_kind_enum_js_1 = require("./omni-collection-kind.enum.js");
|
|
25
|
+
const omni_dto_helpers_js_1 = require("./omni-dto.helpers.js");
|
|
26
|
+
const omni_record_status_enum_js_1 = require("./omni-record-status.enum.js");
|
|
27
|
+
const omni_relation_dto_js_1 = require("./omni-relation.dto.js");
|
|
28
|
+
let OmniCollectionType = class OmniCollectionType extends omni_collection_entity_js_1.OmniCollectionEntity {
|
|
29
|
+
constructor(data) {
|
|
30
|
+
super();
|
|
31
|
+
if (data) {
|
|
32
|
+
(0, omni_dto_helpers_js_1.assignOmniPublicDto)(this, data);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.OmniCollectionType = OmniCollectionType;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(uuid_scalar_js_1.UUIDScalar), isRequired: true }),
|
|
39
|
+
(0, class_validator_1.IsUUID)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], OmniCollectionType.prototype, "guid", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(graphql_1.Int) }),
|
|
44
|
+
(0, class_validator_1.IsInt)(),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], OmniCollectionType.prototype, "revision", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, object_decorator_js_1.ModelField)({
|
|
49
|
+
gqlType: (0, returnValue_js_1.default)(String),
|
|
50
|
+
gqlOptions: { nullable: true },
|
|
51
|
+
}),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
(0, class_validator_1.MaxLength)(128),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], OmniCollectionType.prototype, "externalId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(String) }),
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
(0, class_validator_1.MaxLength)(255),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], OmniCollectionType.prototype, "title", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, object_decorator_js_1.ModelField)({
|
|
65
|
+
gqlType: (0, returnValue_js_1.default)(String),
|
|
66
|
+
gqlOptions: { nullable: true },
|
|
67
|
+
}),
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
(0, class_validator_1.IsString)(),
|
|
70
|
+
(0, class_validator_1.MaxLength)(255),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], OmniCollectionType.prototype, "slug", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(omni_collection_kind_enum_js_1.OmniCollectionKind) }),
|
|
75
|
+
(0, class_validator_1.IsEnum)(omni_collection_kind_enum_js_1.OmniCollectionKind),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], OmniCollectionType.prototype, "kind", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(omni_record_status_enum_js_1.OmniRecordStatus) }),
|
|
80
|
+
(0, class_validator_1.IsEnum)(omni_record_status_enum_js_1.OmniRecordStatus),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], OmniCollectionType.prototype, "status", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, object_decorator_js_1.ModelField)({
|
|
85
|
+
gqlType: (0, returnValue_js_1.default)(graphql_type_json_1.GraphQLJSONObject),
|
|
86
|
+
gqlOptions: { nullable: true },
|
|
87
|
+
}),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.IsObject)(),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], OmniCollectionType.prototype, "payload", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, object_decorator_js_1.ModelField)({
|
|
94
|
+
gqlType: (0, returnValue_js_1.default)(String),
|
|
95
|
+
gqlOptions: { nullable: true },
|
|
96
|
+
}),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
(0, class_validator_1.MaxLength)(128),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], OmniCollectionType.prototype, "payloadSchemaId", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, object_decorator_js_1.ModelField)({
|
|
104
|
+
gqlType: (0, returnValue_js_1.default)(graphql_1.Int),
|
|
105
|
+
gqlOptions: { nullable: true },
|
|
106
|
+
}),
|
|
107
|
+
(0, class_validator_1.IsOptional)(),
|
|
108
|
+
(0, class_validator_1.IsInt)(),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], OmniCollectionType.prototype, "payloadSchemaVersion", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, object_decorator_js_1.ModelField)({
|
|
113
|
+
gqlType: () => [omni_relation_dto_js_1.OmniRelationType],
|
|
114
|
+
gqlOptions: { nullable: true },
|
|
115
|
+
relation: {
|
|
116
|
+
relationType: 'one-to-many',
|
|
117
|
+
sourceKey: { dst: 'guid', alias: 'guid' },
|
|
118
|
+
targetKey: { dst: 'sourceRecordId', alias: 'sourceRecordId' },
|
|
119
|
+
type: () => omni_relation_entity_js_1.OmniRelationEntity,
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], OmniCollectionType.prototype, "outgoingRelations", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, object_decorator_js_1.ModelField)({
|
|
126
|
+
gqlType: () => [omni_relation_dto_js_1.OmniRelationType],
|
|
127
|
+
gqlOptions: { nullable: true },
|
|
128
|
+
relation: {
|
|
129
|
+
relationType: 'one-to-many',
|
|
130
|
+
sourceKey: { dst: 'guid', alias: 'guid' },
|
|
131
|
+
targetKey: { dst: 'targetRecordId', alias: 'targetRecordId' },
|
|
132
|
+
type: () => omni_relation_entity_js_1.OmniRelationEntity,
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
__metadata("design:type", Object)
|
|
136
|
+
], OmniCollectionType.prototype, "incomingRelations", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(omni_collection_kind_enum_js_1.OmniCollectionKind) }),
|
|
139
|
+
(0, class_validator_1.IsEnum)(omni_collection_kind_enum_js_1.OmniCollectionKind),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], OmniCollectionType.prototype, "collectionKind", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, object_decorator_js_1.ModelField)({
|
|
144
|
+
gqlType: (0, returnValue_js_1.default)(String),
|
|
145
|
+
gqlOptions: { nullable: true },
|
|
146
|
+
}),
|
|
147
|
+
(0, class_validator_1.IsOptional)(),
|
|
148
|
+
(0, class_validator_1.IsString)(),
|
|
149
|
+
__metadata("design:type", Object)
|
|
150
|
+
], OmniCollectionType.prototype, "summary", void 0);
|
|
151
|
+
exports.OmniCollectionType = OmniCollectionType = __decorate([
|
|
152
|
+
(0, graphql_1.ObjectType)(),
|
|
153
|
+
(0, object_decorator_js_1.ModelObject)(),
|
|
154
|
+
__metadata("design:paramtypes", [Object])
|
|
155
|
+
], OmniCollectionType);
|
|
156
|
+
let OmniCollectionCreateInput = class OmniCollectionCreateInput extends (0, graphql_1.OmitType)(OmniCollectionType, [
|
|
157
|
+
'createdAt',
|
|
158
|
+
'updatedAt',
|
|
159
|
+
'revision',
|
|
160
|
+
'kind',
|
|
161
|
+
'outgoingRelations',
|
|
162
|
+
'incomingRelations',
|
|
163
|
+
], graphql_1.InputType) {
|
|
164
|
+
};
|
|
165
|
+
exports.OmniCollectionCreateInput = OmniCollectionCreateInput;
|
|
166
|
+
exports.OmniCollectionCreateInput = OmniCollectionCreateInput = __decorate([
|
|
167
|
+
(0, graphql_1.InputType)(),
|
|
168
|
+
(0, object_decorator_js_1.ModelObject)()
|
|
169
|
+
], OmniCollectionCreateInput);
|
|
170
|
+
let OmniCollectionCondition = class OmniCollectionCondition extends (0, graphql_1.PartialType)(OmniCollectionCreateInput, graphql_1.InputType) {
|
|
171
|
+
};
|
|
172
|
+
exports.OmniCollectionCondition = OmniCollectionCondition;
|
|
173
|
+
exports.OmniCollectionCondition = OmniCollectionCondition = __decorate([
|
|
174
|
+
(0, graphql_1.InputType)(),
|
|
175
|
+
(0, object_decorator_js_1.ModelObject)({ copyFrom: OmniCollectionType })
|
|
176
|
+
], OmniCollectionCondition);
|
|
177
|
+
let OmniCollectionUpdateInput = class OmniCollectionUpdateInput extends (0, graphql_1.PartialType)(OmniCollectionCreateInput, graphql_1.InputType) {
|
|
178
|
+
};
|
|
179
|
+
exports.OmniCollectionUpdateInput = OmniCollectionUpdateInput;
|
|
180
|
+
exports.OmniCollectionUpdateInput = OmniCollectionUpdateInput = __decorate([
|
|
181
|
+
(0, graphql_1.InputType)(),
|
|
182
|
+
(0, object_decorator_js_1.ModelObject)({ copyFrom: OmniCollectionType })
|
|
183
|
+
], OmniCollectionUpdateInput);
|
|
184
|
+
//# sourceMappingURL=omni-collection.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-collection.dto.js","sourceRoot":"","sources":["omni-collection.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAMyB;AACzB,mFAGmD;AACnD,gFAAyE;AACzE,uFAA4D;AAC5D,qDAQyB;AACzB,yDAAsD;AAEtD,4EAAoE;AACpE,2EAAmE;AACnE,iFAAoE;AACpE,+DAA4D;AAC5D,6EAAgE;AAChE,iEAA0D;AAInD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,gDAAoB;IAC1D,YAAY,IAAkC;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,IAAI,EAAE,CAAC;YACT,IAAA,yCAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CAqGF,CA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Q,IAAA,qBAAW,EACxD,yBAAyB,EACzB,mBAAS,CACV;CAAG,CAAA;AAHS,8DAAyB;oCAAzB,yBAAyB;IAFrC,IAAA,mBAAS,GAAE;IACX,IAAA,iCAAW,EAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;GACjC,yBAAyB,CAGlC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InputType,
|
|
3
|
+
Int,
|
|
4
|
+
ObjectType,
|
|
5
|
+
OmitType,
|
|
6
|
+
PartialType,
|
|
7
|
+
} from '@nestjs/graphql';
|
|
8
|
+
import {
|
|
9
|
+
ModelField,
|
|
10
|
+
ModelObject,
|
|
11
|
+
} from '@nest-yalc-2/crud-gen/object.decorator.js';
|
|
12
|
+
import { UUIDScalar } from '@nest-yalc-2/graphql/scalars/uuid.scalar.js';
|
|
13
|
+
import returnValue from '@nest-yalc-2/utils/returnValue.js';
|
|
14
|
+
import {
|
|
15
|
+
IsEnum,
|
|
16
|
+
IsInt,
|
|
17
|
+
IsObject,
|
|
18
|
+
IsOptional,
|
|
19
|
+
IsString,
|
|
20
|
+
IsUUID,
|
|
21
|
+
MaxLength,
|
|
22
|
+
} from 'class-validator';
|
|
23
|
+
import { GraphQLJSONObject } from 'graphql-type-json';
|
|
24
|
+
import type { Relation } from 'typeorm';
|
|
25
|
+
import { OmniRelationEntity } from './base/omni-relation.entity.js';
|
|
26
|
+
import { OmniCollectionEntity } from './omni-collection.entity.js';
|
|
27
|
+
import { OmniCollectionKind } from './omni-collection-kind.enum.js';
|
|
28
|
+
import { assignOmniPublicDto } from './omni-dto.helpers.js';
|
|
29
|
+
import { OmniRecordStatus } from './omni-record-status.enum.js';
|
|
30
|
+
import { OmniRelationType } from './omni-relation.dto.js';
|
|
31
|
+
|
|
32
|
+
@ObjectType()
|
|
33
|
+
@ModelObject()
|
|
34
|
+
export class OmniCollectionType extends OmniCollectionEntity {
|
|
35
|
+
constructor(data?: Partial<OmniCollectionType>) {
|
|
36
|
+
super();
|
|
37
|
+
if (data) {
|
|
38
|
+
assignOmniPublicDto(this, data);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ModelField({ gqlType: returnValue(UUIDScalar), isRequired: true })
|
|
43
|
+
@IsUUID()
|
|
44
|
+
guid!: string;
|
|
45
|
+
|
|
46
|
+
@ModelField({ gqlType: returnValue(Int) })
|
|
47
|
+
@IsInt()
|
|
48
|
+
revision!: number;
|
|
49
|
+
|
|
50
|
+
@ModelField({
|
|
51
|
+
gqlType: returnValue(String),
|
|
52
|
+
gqlOptions: { nullable: true },
|
|
53
|
+
})
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsString()
|
|
56
|
+
@MaxLength(128)
|
|
57
|
+
externalId?: string | null;
|
|
58
|
+
|
|
59
|
+
@ModelField({ gqlType: returnValue(String) })
|
|
60
|
+
@IsString()
|
|
61
|
+
@MaxLength(255)
|
|
62
|
+
title!: string;
|
|
63
|
+
|
|
64
|
+
@ModelField({
|
|
65
|
+
gqlType: returnValue(String),
|
|
66
|
+
gqlOptions: { nullable: true },
|
|
67
|
+
})
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@IsString()
|
|
70
|
+
@MaxLength(255)
|
|
71
|
+
slug?: string | null;
|
|
72
|
+
|
|
73
|
+
@ModelField({ gqlType: returnValue(OmniCollectionKind) })
|
|
74
|
+
@IsEnum(OmniCollectionKind)
|
|
75
|
+
kind!: OmniCollectionKind;
|
|
76
|
+
|
|
77
|
+
@ModelField({ gqlType: returnValue(OmniRecordStatus) })
|
|
78
|
+
@IsEnum(OmniRecordStatus)
|
|
79
|
+
status!: OmniRecordStatus;
|
|
80
|
+
|
|
81
|
+
@ModelField({
|
|
82
|
+
gqlType: returnValue(GraphQLJSONObject),
|
|
83
|
+
gqlOptions: { nullable: true },
|
|
84
|
+
})
|
|
85
|
+
@IsOptional()
|
|
86
|
+
@IsObject()
|
|
87
|
+
payload?: Record<string, unknown> | null;
|
|
88
|
+
|
|
89
|
+
@ModelField({
|
|
90
|
+
gqlType: returnValue(String),
|
|
91
|
+
gqlOptions: { nullable: true },
|
|
92
|
+
})
|
|
93
|
+
@IsOptional()
|
|
94
|
+
@IsString()
|
|
95
|
+
@MaxLength(128)
|
|
96
|
+
payloadSchemaId?: string | null;
|
|
97
|
+
|
|
98
|
+
@ModelField({
|
|
99
|
+
gqlType: returnValue(Int),
|
|
100
|
+
gqlOptions: { nullable: true },
|
|
101
|
+
})
|
|
102
|
+
@IsOptional()
|
|
103
|
+
@IsInt()
|
|
104
|
+
payloadSchemaVersion?: number | null;
|
|
105
|
+
|
|
106
|
+
@ModelField({
|
|
107
|
+
gqlType: () => [OmniRelationType],
|
|
108
|
+
gqlOptions: { nullable: true },
|
|
109
|
+
relation: {
|
|
110
|
+
relationType: 'one-to-many',
|
|
111
|
+
sourceKey: { dst: 'guid', alias: 'guid' },
|
|
112
|
+
targetKey: { dst: 'sourceRecordId', alias: 'sourceRecordId' },
|
|
113
|
+
type: () => OmniRelationEntity,
|
|
114
|
+
},
|
|
115
|
+
})
|
|
116
|
+
outgoingRelations?: Relation<OmniRelationType[]>;
|
|
117
|
+
|
|
118
|
+
@ModelField({
|
|
119
|
+
gqlType: () => [OmniRelationType],
|
|
120
|
+
gqlOptions: { nullable: true },
|
|
121
|
+
relation: {
|
|
122
|
+
relationType: 'one-to-many',
|
|
123
|
+
sourceKey: { dst: 'guid', alias: 'guid' },
|
|
124
|
+
targetKey: { dst: 'targetRecordId', alias: 'targetRecordId' },
|
|
125
|
+
type: () => OmniRelationEntity,
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
incomingRelations?: Relation<OmniRelationType[]>;
|
|
129
|
+
|
|
130
|
+
@ModelField({ gqlType: returnValue(OmniCollectionKind) })
|
|
131
|
+
@IsEnum(OmniCollectionKind)
|
|
132
|
+
collectionKind!: OmniCollectionKind;
|
|
133
|
+
|
|
134
|
+
@ModelField({
|
|
135
|
+
gqlType: returnValue(String),
|
|
136
|
+
gqlOptions: { nullable: true },
|
|
137
|
+
})
|
|
138
|
+
@IsOptional()
|
|
139
|
+
@IsString()
|
|
140
|
+
summary?: string | null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@InputType()
|
|
144
|
+
@ModelObject()
|
|
145
|
+
export class OmniCollectionCreateInput extends OmitType(
|
|
146
|
+
OmniCollectionType,
|
|
147
|
+
[
|
|
148
|
+
'createdAt',
|
|
149
|
+
'updatedAt',
|
|
150
|
+
'revision',
|
|
151
|
+
'kind',
|
|
152
|
+
'outgoingRelations',
|
|
153
|
+
'incomingRelations',
|
|
154
|
+
] as const,
|
|
155
|
+
InputType,
|
|
156
|
+
) {}
|
|
157
|
+
|
|
158
|
+
@InputType()
|
|
159
|
+
@ModelObject({ copyFrom: OmniCollectionType })
|
|
160
|
+
export class OmniCollectionCondition extends PartialType(
|
|
161
|
+
OmniCollectionCreateInput,
|
|
162
|
+
InputType,
|
|
163
|
+
) {}
|
|
164
|
+
|
|
165
|
+
@InputType()
|
|
166
|
+
@ModelObject({ copyFrom: OmniCollectionType })
|
|
167
|
+
export class OmniCollectionUpdateInput extends PartialType(
|
|
168
|
+
OmniCollectionCreateInput,
|
|
169
|
+
InputType,
|
|
170
|
+
) {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OmniRecordEntity } from './base/omni-record.entity.js';
|
|
2
|
+
import { OmniCollectionKind } from './omni-collection-kind.enum.js';
|
|
3
|
+
export declare class OmniCollectionEntity extends OmniRecordEntity {
|
|
4
|
+
kind: OmniCollectionKind;
|
|
5
|
+
collectionKind: OmniCollectionKind;
|
|
6
|
+
summary?: string | null;
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OmniCollectionEntity = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const omni_record_entity_js_1 = require("./base/omni-record.entity.js");
|
|
16
|
+
const omni_collection_kind_enum_js_1 = require("./omni-collection-kind.enum.js");
|
|
17
|
+
let OmniCollectionEntity = class OmniCollectionEntity extends omni_record_entity_js_1.OmniRecordEntity {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.kind = omni_collection_kind_enum_js_1.OmniCollectionKind.Collection;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.OmniCollectionEntity = OmniCollectionEntity;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({
|
|
26
|
+
type: 'varchar',
|
|
27
|
+
default: omni_collection_kind_enum_js_1.OmniCollectionKind.Collection,
|
|
28
|
+
enum: Object.values(omni_collection_kind_enum_js_1.OmniCollectionKind),
|
|
29
|
+
length: 32,
|
|
30
|
+
}),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], OmniCollectionEntity.prototype, "collectionKind", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], OmniCollectionEntity.prototype, "summary", void 0);
|
|
37
|
+
exports.OmniCollectionEntity = OmniCollectionEntity = __decorate([
|
|
38
|
+
(0, typeorm_1.ChildEntity)(omni_collection_kind_enum_js_1.OmniCollectionKind.Collection),
|
|
39
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
40
|
+
], OmniCollectionEntity);
|
|
41
|
+
//# sourceMappingURL=omni-collection.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-collection.entity.js","sourceRoot":"","sources":["omni-collection.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,qCAA8C;AAC9C,wEAAgE;AAChE,iFAAoE;AAI7D,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,wCAAgB;IAAnD;;QACL,SAAI,GAAuB,iDAAkB,CAAC,UAAU,CAAC;IAY3D,CAAC;CAAA,CAAA;AAbY,oDAAoB;AAS/B;IANC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,iDAAkB,CAAC,UAAU;QACtC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,iDAAkB,CAAC;QACvC,MAAM,EAAE,EAAE;KACX,CAAC;;4DACkC;AAGpC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACjB;+BAZb,oBAAoB;IAFhC,IAAA,qBAAW,EAAC,iDAAkB,CAAC,UAAU,CAAC;IAC1C,IAAA,oBAAU,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACpB,oBAAoB,CAahC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ObjectType } from '@nestjs/graphql';
|
|
2
|
+
import { ChildEntity, Column } from 'typeorm';
|
|
3
|
+
import { OmniRecordEntity } from './base/omni-record.entity.js';
|
|
4
|
+
import { OmniCollectionKind } from './omni-collection-kind.enum.js';
|
|
5
|
+
|
|
6
|
+
@ChildEntity(OmniCollectionKind.Collection)
|
|
7
|
+
@ObjectType({ isAbstract: true })
|
|
8
|
+
export class OmniCollectionEntity extends OmniRecordEntity {
|
|
9
|
+
kind: OmniCollectionKind = OmniCollectionKind.Collection;
|
|
10
|
+
|
|
11
|
+
@Column({
|
|
12
|
+
type: 'varchar',
|
|
13
|
+
default: OmniCollectionKind.Collection,
|
|
14
|
+
enum: Object.values(OmniCollectionKind),
|
|
15
|
+
length: 32,
|
|
16
|
+
})
|
|
17
|
+
collectionKind!: OmniCollectionKind;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'text', nullable: true })
|
|
20
|
+
summary?: string | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CrudGenFindManyOptions } from '@nest-yalc-2/crud-gen/api-graphql/crud-gen-gql.interface.js';
|
|
2
|
+
import type { GenericTypeORMRepository } from '@nest-yalc-2/crud-gen/typeorm/generic.repository.js';
|
|
3
|
+
import type { DeepPartial, FindOptionsWhere } from 'typeorm';
|
|
4
|
+
import { OmniCollectionEntity } from './omni-collection.entity.js';
|
|
5
|
+
import type { OmniDeletePolicy, OmniScope } from './omni-scope.js';
|
|
6
|
+
import { OmniScopedService } from './omni-scoped.service.js';
|
|
7
|
+
export declare class OmniCollectionService extends OmniScopedService<OmniCollectionEntity> {
|
|
8
|
+
constructor(repository: GenericTypeORMRepository<OmniCollectionEntity>, scopeOrRepositoryWrite?: OmniScope | GenericTypeORMRepository<OmniCollectionEntity>, deletion?: OmniDeletePolicy);
|
|
9
|
+
protected normalizeCollectionInput(input: DeepPartial<OmniCollectionEntity>): DeepPartial<OmniCollectionEntity>;
|
|
10
|
+
createEntity(input: DeepPartial<OmniCollectionEntity>, findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>, returnEntity?: true): Promise<OmniCollectionEntity>;
|
|
11
|
+
createEntity(input: DeepPartial<OmniCollectionEntity>, findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>, returnEntity?: boolean): Promise<OmniCollectionEntity | boolean>;
|
|
12
|
+
updateEntity(conditions: FindOptionsWhere<OmniCollectionEntity>, input: DeepPartial<OmniCollectionEntity>, findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>, returnEntity?: true): Promise<OmniCollectionEntity>;
|
|
13
|
+
updateEntity(conditions: FindOptionsWhere<OmniCollectionEntity>, input: DeepPartial<OmniCollectionEntity>, findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>, returnEntity?: boolean): Promise<OmniCollectionEntity | boolean>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OmniCollectionService = void 0;
|
|
4
|
+
const omni_collection_kind_enum_js_1 = require("./omni-collection-kind.enum.js");
|
|
5
|
+
const omni_scoped_service_js_1 = require("./omni-scoped.service.js");
|
|
6
|
+
class OmniCollectionService extends omni_scoped_service_js_1.OmniScopedService {
|
|
7
|
+
constructor(repository, scopeOrRepositoryWrite, deletion = 'tombstone') {
|
|
8
|
+
super(repository, scopeOrRepositoryWrite, deletion);
|
|
9
|
+
}
|
|
10
|
+
normalizeCollectionInput(input) {
|
|
11
|
+
return {
|
|
12
|
+
...input,
|
|
13
|
+
kind: omni_collection_kind_enum_js_1.OmniCollectionKind.Collection,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async createEntity(input, findOptions, returnEntity = true) {
|
|
17
|
+
return super.createEntity(this.normalizeCollectionInput(input), findOptions, returnEntity);
|
|
18
|
+
}
|
|
19
|
+
async updateEntity(conditions, input, findOptions, returnEntity = true) {
|
|
20
|
+
return super.updateEntity(conditions, this.normalizeCollectionInput(input), findOptions, returnEntity);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.OmniCollectionService = OmniCollectionService;
|
|
24
|
+
//# sourceMappingURL=omni-collection.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-collection.service.js","sourceRoot":"","sources":["omni-collection.service.ts"],"names":[],"mappings":";;;AAGA,iFAAoE;AAGpE,qEAA6D;AAE7D,MAAa,qBAAsB,SAAQ,0CAAuC;IAChF,YACE,UAA0D,EAC1D,sBAC4D,EAC5D,WAA6B,WAAW;QAExC,KAAK,CAAC,UAAU,EAAE,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAES,wBAAwB,CAChC,KAAwC;QAExC,OAAO;YACL,GAAG,KAAK;YACR,IAAI,EAAE,iDAAkB,CAAC,UAAU;SACpC,CAAC;IACJ,CAAC;IAYQ,KAAK,CAAC,YAAY,CACzB,KAAwC,EACxC,WAA0D,EAC1D,YAAY,GAAG,IAAI;QAEnB,OAAO,KAAK,CAAC,YAAY,CACvB,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACpC,WAAW,EACX,YAAY,CACb,CAAC;IACJ,CAAC;IAcQ,KAAK,CAAC,YAAY,CACzB,UAAkD,EAClD,KAAwC,EACxC,WAA0D,EAC1D,YAAY,GAAG,IAAI;QAEnB,OAAO,KAAK,CAAC,YAAY,CACvB,UAAU,EACV,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACpC,WAAW,EACX,YAAY,CACb,CAAC;IACJ,CAAC;CACF;AAlED,sDAkEC"}
|