@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
|
@@ -0,0 +1,75 @@
|
|
|
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 { OmniCollectionKind } from './omni-collection-kind.enum.js';
|
|
5
|
+
import { OmniCollectionEntity } from './omni-collection.entity.js';
|
|
6
|
+
import type { OmniDeletePolicy, OmniScope } from './omni-scope.js';
|
|
7
|
+
import { OmniScopedService } from './omni-scoped.service.js';
|
|
8
|
+
|
|
9
|
+
export class OmniCollectionService extends OmniScopedService<OmniCollectionEntity> {
|
|
10
|
+
constructor(
|
|
11
|
+
repository: GenericTypeORMRepository<OmniCollectionEntity>,
|
|
12
|
+
scopeOrRepositoryWrite?:
|
|
13
|
+
OmniScope | GenericTypeORMRepository<OmniCollectionEntity>,
|
|
14
|
+
deletion: OmniDeletePolicy = 'tombstone',
|
|
15
|
+
) {
|
|
16
|
+
super(repository, scopeOrRepositoryWrite, deletion);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected normalizeCollectionInput(
|
|
20
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
21
|
+
): DeepPartial<OmniCollectionEntity> {
|
|
22
|
+
return {
|
|
23
|
+
...input,
|
|
24
|
+
kind: OmniCollectionKind.Collection,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
override async createEntity(
|
|
29
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
30
|
+
findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>,
|
|
31
|
+
returnEntity?: true,
|
|
32
|
+
): Promise<OmniCollectionEntity>;
|
|
33
|
+
override async createEntity(
|
|
34
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
35
|
+
findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>,
|
|
36
|
+
returnEntity?: boolean,
|
|
37
|
+
): Promise<OmniCollectionEntity | boolean>;
|
|
38
|
+
override async createEntity(
|
|
39
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
40
|
+
findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>,
|
|
41
|
+
returnEntity = true,
|
|
42
|
+
): Promise<OmniCollectionEntity | boolean> {
|
|
43
|
+
return super.createEntity(
|
|
44
|
+
this.normalizeCollectionInput(input),
|
|
45
|
+
findOptions,
|
|
46
|
+
returnEntity,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
override async updateEntity(
|
|
51
|
+
conditions: FindOptionsWhere<OmniCollectionEntity>,
|
|
52
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
53
|
+
findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>,
|
|
54
|
+
returnEntity?: true,
|
|
55
|
+
): Promise<OmniCollectionEntity>;
|
|
56
|
+
override async updateEntity(
|
|
57
|
+
conditions: FindOptionsWhere<OmniCollectionEntity>,
|
|
58
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
59
|
+
findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>,
|
|
60
|
+
returnEntity?: boolean,
|
|
61
|
+
): Promise<OmniCollectionEntity | boolean>;
|
|
62
|
+
override async updateEntity(
|
|
63
|
+
conditions: FindOptionsWhere<OmniCollectionEntity>,
|
|
64
|
+
input: DeepPartial<OmniCollectionEntity>,
|
|
65
|
+
findOptions?: CrudGenFindManyOptions<OmniCollectionEntity>,
|
|
66
|
+
returnEntity = true,
|
|
67
|
+
): Promise<OmniCollectionEntity | boolean> {
|
|
68
|
+
return super.updateEntity(
|
|
69
|
+
conditions,
|
|
70
|
+
this.normalizeCollectionInput(input),
|
|
71
|
+
findOptions,
|
|
72
|
+
returnEntity,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OmniDocumentKind = void 0;
|
|
4
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
5
|
+
var OmniDocumentKind;
|
|
6
|
+
(function (OmniDocumentKind) {
|
|
7
|
+
OmniDocumentKind["Document"] = "document";
|
|
8
|
+
OmniDocumentKind["Note"] = "note";
|
|
9
|
+
OmniDocumentKind["Article"] = "article";
|
|
10
|
+
OmniDocumentKind["Page"] = "page";
|
|
11
|
+
})(OmniDocumentKind || (exports.OmniDocumentKind = OmniDocumentKind = {}));
|
|
12
|
+
(0, graphql_1.registerEnumType)(OmniDocumentKind, {
|
|
13
|
+
name: 'OmniDocumentKind',
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=omni-document-kind.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-document-kind.enum.js","sourceRoot":"","sources":["omni-document-kind.enum.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AAEnD,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,iCAAa,CAAA;IACb,uCAAmB,CAAA;IACnB,iCAAa,CAAA;AACf,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED,IAAA,0BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;CACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omniDocumentBackendProvidersFactory = void 0;
|
|
4
|
+
const omni_document_entity_js_1 = require("./omni-document.entity.js");
|
|
5
|
+
const omni_document_service_js_1 = require("./omni-document.service.js");
|
|
6
|
+
const omni_scoped_backend_js_1 = require("./omni-scoped.backend.js");
|
|
7
|
+
const omniDocumentBackendProvidersFactory = (dbConnection) => (0, omni_scoped_backend_js_1.omniScopedBackendProvidersFactory)({
|
|
8
|
+
entityModel: omni_document_entity_js_1.OmniDocumentEntity,
|
|
9
|
+
dbConnection,
|
|
10
|
+
serviceToken: (0, omni_scoped_backend_js_1.omniBackendServiceToken)(omni_document_service_js_1.OmniDocumentService),
|
|
11
|
+
serviceProvider: omni_document_service_js_1.OmniDocumentService,
|
|
12
|
+
createService: (repository, scope, options) => new omni_document_service_js_1.OmniDocumentService(repository, scope, options.deletion.document),
|
|
13
|
+
});
|
|
14
|
+
exports.omniDocumentBackendProvidersFactory = omniDocumentBackendProvidersFactory;
|
|
15
|
+
//# sourceMappingURL=omni-document.backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-document.backend.js","sourceRoot":"","sources":["omni-document.backend.ts"],"names":[],"mappings":";;;AAAA,uEAA+D;AAC/D,yEAAiE;AACjE,qEAGkC;AAE3B,MAAM,mCAAmC,GAAG,CAAC,YAAoB,EAAE,EAAE,CAC1E,IAAA,0DAAiC,EAAqB;IACpD,WAAW,EAAE,4CAAkB;IAC/B,YAAY;IACZ,YAAY,EAAE,IAAA,gDAAuB,EAAC,8CAAmB,CAAC;IAC1D,eAAe,EAAE,8CAAmB;IACpC,aAAa,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAC5C,IAAI,8CAAmB,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;CACxE,CAAC,CAAC;AARQ,QAAA,mCAAmC,uCAQ3C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OmniDocumentEntity } from './omni-document.entity.js';
|
|
2
|
+
import { OmniDocumentService } from './omni-document.service.js';
|
|
3
|
+
import {
|
|
4
|
+
omniBackendServiceToken,
|
|
5
|
+
omniScopedBackendProvidersFactory,
|
|
6
|
+
} from './omni-scoped.backend.js';
|
|
7
|
+
|
|
8
|
+
export const omniDocumentBackendProvidersFactory = (dbConnection: string) =>
|
|
9
|
+
omniScopedBackendProvidersFactory<OmniDocumentEntity>({
|
|
10
|
+
entityModel: OmniDocumentEntity,
|
|
11
|
+
dbConnection,
|
|
12
|
+
serviceToken: omniBackendServiceToken(OmniDocumentService),
|
|
13
|
+
serviceProvider: OmniDocumentService,
|
|
14
|
+
createService: (repository, scope, options) =>
|
|
15
|
+
new OmniDocumentService(repository, scope, options.deletion.document),
|
|
16
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Relation } from 'typeorm';
|
|
2
|
+
import { OmniDocumentEntity } from './omni-document.entity.js';
|
|
3
|
+
import { OmniDocumentKind } from './omni-document-kind.enum.js';
|
|
4
|
+
import { OmniRecordStatus } from './omni-record-status.enum.js';
|
|
5
|
+
import { OmniRelationType } from './omni-relation.dto.js';
|
|
6
|
+
export declare class OmniDocumentType extends OmniDocumentEntity {
|
|
7
|
+
constructor(data?: Partial<OmniDocumentType>);
|
|
8
|
+
guid: string;
|
|
9
|
+
revision: number;
|
|
10
|
+
externalId?: string | null;
|
|
11
|
+
title: string;
|
|
12
|
+
slug?: string | null;
|
|
13
|
+
kind: OmniDocumentKind;
|
|
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
|
+
documentKind: OmniDocumentKind;
|
|
21
|
+
content?: string | null;
|
|
22
|
+
contentMimeType?: string | null;
|
|
23
|
+
sourceUrl?: string | null;
|
|
24
|
+
publishedAt?: Date | null;
|
|
25
|
+
}
|
|
26
|
+
declare const OmniDocumentCreateInput_base: import("@nestjs/common").Type<Omit<OmniDocumentType, "revision" | "createdAt" | "updatedAt" | "kind" | "outgoingRelations" | "incomingRelations">>;
|
|
27
|
+
export declare class OmniDocumentCreateInput extends OmniDocumentCreateInput_base {
|
|
28
|
+
}
|
|
29
|
+
declare const OmniDocumentCondition_base: import("@nestjs/common").Type<Partial<OmniDocumentCreateInput>>;
|
|
30
|
+
export declare class OmniDocumentCondition extends OmniDocumentCondition_base {
|
|
31
|
+
}
|
|
32
|
+
declare const OmniDocumentUpdateInput_base: import("@nestjs/common").Type<Partial<OmniDocumentCreateInput>>;
|
|
33
|
+
export declare class OmniDocumentUpdateInput extends OmniDocumentUpdateInput_base {
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,213 @@
|
|
|
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.OmniDocumentUpdateInput = exports.OmniDocumentCondition = exports.OmniDocumentCreateInput = exports.OmniDocumentType = 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_document_entity_js_1 = require("./omni-document.entity.js");
|
|
23
|
+
const omni_document_kind_enum_js_1 = require("./omni-document-kind.enum.js");
|
|
24
|
+
const omni_dto_helpers_js_1 = require("./omni-dto.helpers.js");
|
|
25
|
+
const omni_record_status_enum_js_1 = require("./omni-record-status.enum.js");
|
|
26
|
+
const omni_relation_entity_js_1 = require("./base/omni-relation.entity.js");
|
|
27
|
+
const omni_relation_dto_js_1 = require("./omni-relation.dto.js");
|
|
28
|
+
let OmniDocumentType = class OmniDocumentType extends omni_document_entity_js_1.OmniDocumentEntity {
|
|
29
|
+
constructor(data) {
|
|
30
|
+
super();
|
|
31
|
+
if (data) {
|
|
32
|
+
(0, omni_dto_helpers_js_1.assignOmniPublicDto)(this, data);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.OmniDocumentType = OmniDocumentType;
|
|
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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.prototype, "slug", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(omni_document_kind_enum_js_1.OmniDocumentKind) }),
|
|
75
|
+
(0, class_validator_1.IsEnum)(omni_document_kind_enum_js_1.OmniDocumentKind),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.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
|
+
], OmniDocumentType.prototype, "incomingRelations", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, object_decorator_js_1.ModelField)({ gqlType: (0, returnValue_js_1.default)(omni_document_kind_enum_js_1.OmniDocumentKind) }),
|
|
139
|
+
(0, class_validator_1.IsEnum)(omni_document_kind_enum_js_1.OmniDocumentKind),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], OmniDocumentType.prototype, "documentKind", 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
|
+
], OmniDocumentType.prototype, "content", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, object_decorator_js_1.ModelField)({
|
|
153
|
+
gqlType: (0, returnValue_js_1.default)(String),
|
|
154
|
+
gqlOptions: { nullable: true },
|
|
155
|
+
}),
|
|
156
|
+
(0, class_validator_1.IsOptional)(),
|
|
157
|
+
(0, class_validator_1.IsString)(),
|
|
158
|
+
(0, class_validator_1.MaxLength)(128),
|
|
159
|
+
__metadata("design:type", Object)
|
|
160
|
+
], OmniDocumentType.prototype, "contentMimeType", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, object_decorator_js_1.ModelField)({
|
|
163
|
+
gqlType: (0, returnValue_js_1.default)(String),
|
|
164
|
+
gqlOptions: { nullable: true },
|
|
165
|
+
}),
|
|
166
|
+
(0, class_validator_1.IsOptional)(),
|
|
167
|
+
(0, class_validator_1.IsUrl)(),
|
|
168
|
+
(0, class_validator_1.MaxLength)(2048),
|
|
169
|
+
__metadata("design:type", Object)
|
|
170
|
+
], OmniDocumentType.prototype, "sourceUrl", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, object_decorator_js_1.ModelField)({
|
|
173
|
+
gqlType: (0, returnValue_js_1.default)(Date),
|
|
174
|
+
gqlOptions: { nullable: true },
|
|
175
|
+
}),
|
|
176
|
+
(0, class_validator_1.IsOptional)(),
|
|
177
|
+
(0, class_validator_1.IsDate)(),
|
|
178
|
+
__metadata("design:type", Object)
|
|
179
|
+
], OmniDocumentType.prototype, "publishedAt", void 0);
|
|
180
|
+
exports.OmniDocumentType = OmniDocumentType = __decorate([
|
|
181
|
+
(0, graphql_1.ObjectType)(),
|
|
182
|
+
(0, object_decorator_js_1.ModelObject)(),
|
|
183
|
+
__metadata("design:paramtypes", [Object])
|
|
184
|
+
], OmniDocumentType);
|
|
185
|
+
let OmniDocumentCreateInput = class OmniDocumentCreateInput extends (0, graphql_1.OmitType)(OmniDocumentType, [
|
|
186
|
+
'createdAt',
|
|
187
|
+
'updatedAt',
|
|
188
|
+
'revision',
|
|
189
|
+
'kind',
|
|
190
|
+
'outgoingRelations',
|
|
191
|
+
'incomingRelations',
|
|
192
|
+
], graphql_1.InputType) {
|
|
193
|
+
};
|
|
194
|
+
exports.OmniDocumentCreateInput = OmniDocumentCreateInput;
|
|
195
|
+
exports.OmniDocumentCreateInput = OmniDocumentCreateInput = __decorate([
|
|
196
|
+
(0, graphql_1.InputType)(),
|
|
197
|
+
(0, object_decorator_js_1.ModelObject)()
|
|
198
|
+
], OmniDocumentCreateInput);
|
|
199
|
+
let OmniDocumentCondition = class OmniDocumentCondition extends (0, graphql_1.PartialType)(OmniDocumentCreateInput, graphql_1.InputType) {
|
|
200
|
+
};
|
|
201
|
+
exports.OmniDocumentCondition = OmniDocumentCondition;
|
|
202
|
+
exports.OmniDocumentCondition = OmniDocumentCondition = __decorate([
|
|
203
|
+
(0, graphql_1.InputType)(),
|
|
204
|
+
(0, object_decorator_js_1.ModelObject)({ copyFrom: OmniDocumentType })
|
|
205
|
+
], OmniDocumentCondition);
|
|
206
|
+
let OmniDocumentUpdateInput = class OmniDocumentUpdateInput extends (0, graphql_1.PartialType)(OmniDocumentCreateInput, graphql_1.InputType) {
|
|
207
|
+
};
|
|
208
|
+
exports.OmniDocumentUpdateInput = OmniDocumentUpdateInput;
|
|
209
|
+
exports.OmniDocumentUpdateInput = OmniDocumentUpdateInput = __decorate([
|
|
210
|
+
(0, graphql_1.InputType)(),
|
|
211
|
+
(0, object_decorator_js_1.ModelObject)({ copyFrom: OmniDocumentType })
|
|
212
|
+
], OmniDocumentUpdateInput);
|
|
213
|
+
//# sourceMappingURL=omni-document.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-document.dto.js","sourceRoot":"","sources":["omni-document.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAMyB;AACzB,mFAGmD;AACnD,gFAAyE;AACzE,uFAA4D;AAC5D,qDAUyB;AACzB,yDAAsD;AAEtD,uEAA+D;AAC/D,6EAAgE;AAChE,+DAA4D;AAC5D,6EAAgE;AAChE,4EAAoE;AACpE,iEAA0D;AAInD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,4CAAkB;IACtD,YAAY,IAAgC;QAC1C,KAAK,EAAE,CAAC;QACR,IAAI,IAAI,EAAE,CAAC;YACT,IAAA,yCAAmB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CA+HF,CAAA;AArIY,4CAAgB;AAU3B;IAFC,IAAA,gCAAU,EAAC,EAAE,OAAO,EAAE,IAAA,wBAAW,EAAC,2BAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAClE,IAAA,wBAAM,GAAE;;8CACK;AAId;IAFC,IAAA,gCAAU,EAAC,EAAE,OAAO,EAAE,IAAA,wBAAW,EAAC,aAAG,CAAC,EAAE,CAAC;IACzC,IAAA,uBAAK,GAAE;;kDACU;AASlB;IAPC,IAAA,gCAAU,EAAC;QACV,OAAO,EAAE,IAAA,wBAAW,EAAC,MAAM,CAAC;QAC5B,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC/B,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;oDACY;AAK3B;IAHC,IAAA,gCAAU,EAAC,EAAE,OAAO,EAAE,IAAA,wBAAW,EAAC,MAAM,CAAC,EAAE,CAAC;IAC5C,IAAA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M,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,IAAA,qBAAW,EACtD,uBAAuB,EACvB,mBAAS,CACV;CAAG,CAAA;AAHS,0DAAuB;kCAAvB,uBAAuB;IAFnC,IAAA,mBAAS,GAAE;IACX,IAAA,iCAAW,EAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;GAC/B,uBAAuB,CAGhC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
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
|
+
IsDate,
|
|
16
|
+
IsEnum,
|
|
17
|
+
IsInt,
|
|
18
|
+
IsObject,
|
|
19
|
+
IsOptional,
|
|
20
|
+
IsString,
|
|
21
|
+
IsUrl,
|
|
22
|
+
IsUUID,
|
|
23
|
+
MaxLength,
|
|
24
|
+
} from 'class-validator';
|
|
25
|
+
import { GraphQLJSONObject } from 'graphql-type-json';
|
|
26
|
+
import type { Relation } from 'typeorm';
|
|
27
|
+
import { OmniDocumentEntity } from './omni-document.entity.js';
|
|
28
|
+
import { OmniDocumentKind } from './omni-document-kind.enum.js';
|
|
29
|
+
import { assignOmniPublicDto } from './omni-dto.helpers.js';
|
|
30
|
+
import { OmniRecordStatus } from './omni-record-status.enum.js';
|
|
31
|
+
import { OmniRelationEntity } from './base/omni-relation.entity.js';
|
|
32
|
+
import { OmniRelationType } from './omni-relation.dto.js';
|
|
33
|
+
|
|
34
|
+
@ObjectType()
|
|
35
|
+
@ModelObject()
|
|
36
|
+
export class OmniDocumentType extends OmniDocumentEntity {
|
|
37
|
+
constructor(data?: Partial<OmniDocumentType>) {
|
|
38
|
+
super();
|
|
39
|
+
if (data) {
|
|
40
|
+
assignOmniPublicDto(this, data);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@ModelField({ gqlType: returnValue(UUIDScalar), isRequired: true })
|
|
45
|
+
@IsUUID()
|
|
46
|
+
guid!: string;
|
|
47
|
+
|
|
48
|
+
@ModelField({ gqlType: returnValue(Int) })
|
|
49
|
+
@IsInt()
|
|
50
|
+
revision!: number;
|
|
51
|
+
|
|
52
|
+
@ModelField({
|
|
53
|
+
gqlType: returnValue(String),
|
|
54
|
+
gqlOptions: { nullable: true },
|
|
55
|
+
})
|
|
56
|
+
@IsOptional()
|
|
57
|
+
@IsString()
|
|
58
|
+
@MaxLength(128)
|
|
59
|
+
externalId?: string | null;
|
|
60
|
+
|
|
61
|
+
@ModelField({ gqlType: returnValue(String) })
|
|
62
|
+
@IsString()
|
|
63
|
+
@MaxLength(255)
|
|
64
|
+
title!: string;
|
|
65
|
+
|
|
66
|
+
@ModelField({
|
|
67
|
+
gqlType: returnValue(String),
|
|
68
|
+
gqlOptions: { nullable: true },
|
|
69
|
+
})
|
|
70
|
+
@IsOptional()
|
|
71
|
+
@IsString()
|
|
72
|
+
@MaxLength(255)
|
|
73
|
+
slug?: string | null;
|
|
74
|
+
|
|
75
|
+
@ModelField({ gqlType: returnValue(OmniDocumentKind) })
|
|
76
|
+
@IsEnum(OmniDocumentKind)
|
|
77
|
+
kind!: OmniDocumentKind;
|
|
78
|
+
|
|
79
|
+
@ModelField({ gqlType: returnValue(OmniRecordStatus) })
|
|
80
|
+
@IsEnum(OmniRecordStatus)
|
|
81
|
+
status!: OmniRecordStatus;
|
|
82
|
+
|
|
83
|
+
@ModelField({
|
|
84
|
+
gqlType: returnValue(GraphQLJSONObject),
|
|
85
|
+
gqlOptions: { nullable: true },
|
|
86
|
+
})
|
|
87
|
+
@IsOptional()
|
|
88
|
+
@IsObject()
|
|
89
|
+
payload?: Record<string, unknown> | null;
|
|
90
|
+
|
|
91
|
+
@ModelField({
|
|
92
|
+
gqlType: returnValue(String),
|
|
93
|
+
gqlOptions: { nullable: true },
|
|
94
|
+
})
|
|
95
|
+
@IsOptional()
|
|
96
|
+
@IsString()
|
|
97
|
+
@MaxLength(128)
|
|
98
|
+
payloadSchemaId?: string | null;
|
|
99
|
+
|
|
100
|
+
@ModelField({
|
|
101
|
+
gqlType: returnValue(Int),
|
|
102
|
+
gqlOptions: { nullable: true },
|
|
103
|
+
})
|
|
104
|
+
@IsOptional()
|
|
105
|
+
@IsInt()
|
|
106
|
+
payloadSchemaVersion?: number | null;
|
|
107
|
+
|
|
108
|
+
@ModelField({
|
|
109
|
+
gqlType: () => [OmniRelationType],
|
|
110
|
+
gqlOptions: { nullable: true },
|
|
111
|
+
relation: {
|
|
112
|
+
relationType: 'one-to-many',
|
|
113
|
+
sourceKey: { dst: 'guid', alias: 'guid' },
|
|
114
|
+
targetKey: { dst: 'sourceRecordId', alias: 'sourceRecordId' },
|
|
115
|
+
type: () => OmniRelationEntity,
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
outgoingRelations?: Relation<OmniRelationType[]>;
|
|
119
|
+
|
|
120
|
+
@ModelField({
|
|
121
|
+
gqlType: () => [OmniRelationType],
|
|
122
|
+
gqlOptions: { nullable: true },
|
|
123
|
+
relation: {
|
|
124
|
+
relationType: 'one-to-many',
|
|
125
|
+
sourceKey: { dst: 'guid', alias: 'guid' },
|
|
126
|
+
targetKey: { dst: 'targetRecordId', alias: 'targetRecordId' },
|
|
127
|
+
type: () => OmniRelationEntity,
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
incomingRelations?: Relation<OmniRelationType[]>;
|
|
131
|
+
|
|
132
|
+
@ModelField({ gqlType: returnValue(OmniDocumentKind) })
|
|
133
|
+
@IsEnum(OmniDocumentKind)
|
|
134
|
+
documentKind!: OmniDocumentKind;
|
|
135
|
+
|
|
136
|
+
@ModelField({
|
|
137
|
+
gqlType: returnValue(String),
|
|
138
|
+
gqlOptions: { nullable: true },
|
|
139
|
+
})
|
|
140
|
+
@IsOptional()
|
|
141
|
+
@IsString()
|
|
142
|
+
content?: string | null;
|
|
143
|
+
|
|
144
|
+
@ModelField({
|
|
145
|
+
gqlType: returnValue(String),
|
|
146
|
+
gqlOptions: { nullable: true },
|
|
147
|
+
})
|
|
148
|
+
@IsOptional()
|
|
149
|
+
@IsString()
|
|
150
|
+
@MaxLength(128)
|
|
151
|
+
contentMimeType?: string | null;
|
|
152
|
+
|
|
153
|
+
@ModelField({
|
|
154
|
+
gqlType: returnValue(String),
|
|
155
|
+
gqlOptions: { nullable: true },
|
|
156
|
+
})
|
|
157
|
+
@IsOptional()
|
|
158
|
+
@IsUrl()
|
|
159
|
+
@MaxLength(2048)
|
|
160
|
+
sourceUrl?: string | null;
|
|
161
|
+
|
|
162
|
+
@ModelField({
|
|
163
|
+
gqlType: returnValue(Date),
|
|
164
|
+
gqlOptions: { nullable: true },
|
|
165
|
+
})
|
|
166
|
+
@IsOptional()
|
|
167
|
+
@IsDate()
|
|
168
|
+
publishedAt?: Date | null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@InputType()
|
|
172
|
+
@ModelObject()
|
|
173
|
+
export class OmniDocumentCreateInput extends OmitType(
|
|
174
|
+
OmniDocumentType,
|
|
175
|
+
[
|
|
176
|
+
'createdAt',
|
|
177
|
+
'updatedAt',
|
|
178
|
+
'revision',
|
|
179
|
+
'kind',
|
|
180
|
+
'outgoingRelations',
|
|
181
|
+
'incomingRelations',
|
|
182
|
+
] as const,
|
|
183
|
+
InputType,
|
|
184
|
+
) {}
|
|
185
|
+
|
|
186
|
+
@InputType()
|
|
187
|
+
@ModelObject({ copyFrom: OmniDocumentType })
|
|
188
|
+
export class OmniDocumentCondition extends PartialType(
|
|
189
|
+
OmniDocumentCreateInput,
|
|
190
|
+
InputType,
|
|
191
|
+
) {}
|
|
192
|
+
|
|
193
|
+
@InputType()
|
|
194
|
+
@ModelObject({ copyFrom: OmniDocumentType })
|
|
195
|
+
export class OmniDocumentUpdateInput extends PartialType(
|
|
196
|
+
OmniDocumentCreateInput,
|
|
197
|
+
InputType,
|
|
198
|
+
) {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OmniRecordEntity } from './base/omni-record.entity.js';
|
|
2
|
+
import { OmniDocumentKind } from './omni-document-kind.enum.js';
|
|
3
|
+
export declare class OmniDocumentEntity extends OmniRecordEntity {
|
|
4
|
+
kind: OmniDocumentKind;
|
|
5
|
+
documentKind: OmniDocumentKind;
|
|
6
|
+
content?: string | null;
|
|
7
|
+
contentMimeType?: string | null;
|
|
8
|
+
sourceUrl?: string | null;
|
|
9
|
+
publishedAt?: Date | null;
|
|
10
|
+
}
|