@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,72 @@
|
|
|
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.OmniExternalRefEntity = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const omni_base_entity_js_1 = require("./omni-base.entity.js");
|
|
16
|
+
const omni_external_ref_internal_type_enum_js_1 = require("../omni-external-ref-internal-type.enum.js");
|
|
17
|
+
let OmniExternalRefEntity = class OmniExternalRefEntity extends omni_base_entity_js_1.OmniBaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.OmniExternalRefEntity = OmniExternalRefEntity;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.Column)({
|
|
22
|
+
type: 'varchar',
|
|
23
|
+
enum: Object.values(omni_external_ref_internal_type_enum_js_1.OmniExternalRefInternalType),
|
|
24
|
+
length: 64,
|
|
25
|
+
}),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], OmniExternalRefEntity.prototype, "internalType", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 36 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], OmniExternalRefEntity.prototype, "internalId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 128 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], OmniExternalRefEntity.prototype, "provider", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: '', length: 128 }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], OmniExternalRefEntity.prototype, "account", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: '', length: 128 }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], OmniExternalRefEntity.prototype, "container", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], OmniExternalRefEntity.prototype, "externalId", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], OmniExternalRefEntity.prototype, "payload", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true, length: 128 }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], OmniExternalRefEntity.prototype, "payloadSchemaId", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], OmniExternalRefEntity.prototype, "payloadSchemaVersion", void 0);
|
|
60
|
+
exports.OmniExternalRefEntity = OmniExternalRefEntity = __decorate([
|
|
61
|
+
(0, typeorm_1.Entity)('omni-external-ref'),
|
|
62
|
+
(0, typeorm_1.Index)('omni_external_ref_scope_external_identity_unique', ['scopeId', 'provider', 'account', 'container', 'externalId'], { unique: true }),
|
|
63
|
+
(0, typeorm_1.Index)('omni_external_ref_scope_internal_lookup_idx', [
|
|
64
|
+
'scopeId',
|
|
65
|
+
'internalType',
|
|
66
|
+
'internalId',
|
|
67
|
+
'provider',
|
|
68
|
+
'guid',
|
|
69
|
+
]),
|
|
70
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
71
|
+
], OmniExternalRefEntity);
|
|
72
|
+
//# sourceMappingURL=omni-external-ref.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-external-ref.entity.js","sourceRoot":"","sources":["omni-external-ref.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,qCAAgD;AAChD,+DAAuD;AACvD,wGAAyF;AAgBlF,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,oCAAc;CAiCxD,CAAA;AAjCY,sDAAqB;AAMhC;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,MAAM,CAAC,MAAM,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V,MAAM;KACP,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACpB,qBAAqB,CAiCjC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ObjectType } from '@nestjs/graphql';
|
|
2
|
+
import { Column, Entity, Index } from 'typeorm';
|
|
3
|
+
import { OmniBaseEntity } from './omni-base.entity.js';
|
|
4
|
+
import { OmniExternalRefInternalType } from '../omni-external-ref-internal-type.enum.js';
|
|
5
|
+
|
|
6
|
+
@Entity('omni-external-ref')
|
|
7
|
+
@Index(
|
|
8
|
+
'omni_external_ref_scope_external_identity_unique',
|
|
9
|
+
['scopeId', 'provider', 'account', 'container', 'externalId'],
|
|
10
|
+
{ unique: true },
|
|
11
|
+
)
|
|
12
|
+
@Index('omni_external_ref_scope_internal_lookup_idx', [
|
|
13
|
+
'scopeId',
|
|
14
|
+
'internalType',
|
|
15
|
+
'internalId',
|
|
16
|
+
'provider',
|
|
17
|
+
'guid',
|
|
18
|
+
])
|
|
19
|
+
@ObjectType({ isAbstract: true })
|
|
20
|
+
export class OmniExternalRefEntity extends OmniBaseEntity {
|
|
21
|
+
@Column({
|
|
22
|
+
type: 'varchar',
|
|
23
|
+
enum: Object.values(OmniExternalRefInternalType),
|
|
24
|
+
length: 64,
|
|
25
|
+
})
|
|
26
|
+
internalType!: OmniExternalRefInternalType;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'varchar', length: 36 })
|
|
29
|
+
internalId!: string;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'varchar', length: 128 })
|
|
32
|
+
provider!: string;
|
|
33
|
+
|
|
34
|
+
/** Empty string is the canonical storage representation of no account. */
|
|
35
|
+
@Column({ type: 'varchar', default: '', length: 128 })
|
|
36
|
+
account?: string | null;
|
|
37
|
+
|
|
38
|
+
/** Empty string is the canonical storage representation of no container. */
|
|
39
|
+
@Column({ type: 'varchar', default: '', length: 128 })
|
|
40
|
+
container?: string | null;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'varchar', length: 255 })
|
|
43
|
+
externalId!: string;
|
|
44
|
+
|
|
45
|
+
@Column({ type: 'simple-json', nullable: true })
|
|
46
|
+
payload?: Record<string, unknown> | null;
|
|
47
|
+
|
|
48
|
+
@Column({ type: 'varchar', nullable: true, length: 128 })
|
|
49
|
+
payloadSchemaId?: string | null;
|
|
50
|
+
|
|
51
|
+
@Column({ type: 'integer', nullable: true })
|
|
52
|
+
payloadSchemaVersion?: number | null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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.OmniNamedEntity = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const omni_base_entity_js_1 = require("./omni-base.entity.js");
|
|
16
|
+
let OmniNamedEntity = class OmniNamedEntity extends omni_base_entity_js_1.OmniBaseEntity {
|
|
17
|
+
};
|
|
18
|
+
exports.OmniNamedEntity = OmniNamedEntity;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true, length: 128 }),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], OmniNamedEntity.prototype, "externalId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], OmniNamedEntity.prototype, "title", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true, length: 255 }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], OmniNamedEntity.prototype, "slug", void 0);
|
|
31
|
+
exports.OmniNamedEntity = OmniNamedEntity = __decorate([
|
|
32
|
+
(0, typeorm_1.Entity)('omni-named'),
|
|
33
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
34
|
+
], OmniNamedEntity);
|
|
35
|
+
//# sourceMappingURL=omni-named.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-named.entity.js","sourceRoot":"","sources":["omni-named.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,qCAAyC;AACzC,+DAAuD;AAIhD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,oCAAc;CASlD,CAAA;AATY,0CAAe;AAE1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;mDAC9B;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;8CAC1B;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;6CACpC;0BARV,eAAe;IAF3B,IAAA,gBAAM,EAAC,YAAY,CAAC;IACpB,IAAA,oBAAU,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACpB,eAAe,CAS3B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ObjectType } from '@nestjs/graphql';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
import { OmniBaseEntity } from './omni-base.entity.js';
|
|
4
|
+
|
|
5
|
+
@Entity('omni-named')
|
|
6
|
+
@ObjectType({ isAbstract: true })
|
|
7
|
+
export class OmniNamedEntity extends OmniBaseEntity {
|
|
8
|
+
@Column({ type: 'varchar', nullable: true, length: 128 })
|
|
9
|
+
externalId?: string | null;
|
|
10
|
+
|
|
11
|
+
@Column({ type: 'varchar', length: 255 })
|
|
12
|
+
title!: string;
|
|
13
|
+
|
|
14
|
+
@Column({ type: 'varchar', nullable: true, length: 255 })
|
|
15
|
+
slug?: string | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Relation } from 'typeorm';
|
|
2
|
+
import { OmniNamedEntity } from './omni-named.entity.js';
|
|
3
|
+
import { OmniRelationEntity } from './omni-relation.entity.js';
|
|
4
|
+
import { OmniRecordStatus } from '../omni-record-status.enum.js';
|
|
5
|
+
export declare class OmniRecordEntity extends OmniNamedEntity {
|
|
6
|
+
kind: string;
|
|
7
|
+
status: OmniRecordStatus;
|
|
8
|
+
payload?: Record<string, unknown> | null;
|
|
9
|
+
payloadSchemaId?: string | null;
|
|
10
|
+
payloadSchemaVersion?: number | null;
|
|
11
|
+
outgoingRelations?: Relation<OmniRelationEntity[]>;
|
|
12
|
+
incomingRelations?: Relation<OmniRelationEntity[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.OmniRecordEntity = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const omni_named_entity_js_1 = require("./omni-named.entity.js");
|
|
16
|
+
const omni_relation_entity_js_1 = require("./omni-relation.entity.js");
|
|
17
|
+
const omni_record_status_enum_js_1 = require("../omni-record-status.enum.js");
|
|
18
|
+
let OmniRecordEntity = class OmniRecordEntity extends omni_named_entity_js_1.OmniNamedEntity {
|
|
19
|
+
};
|
|
20
|
+
exports.OmniRecordEntity = OmniRecordEntity;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 64 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OmniRecordEntity.prototype, "kind", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({
|
|
27
|
+
type: 'varchar',
|
|
28
|
+
default: omni_record_status_enum_js_1.OmniRecordStatus.Draft,
|
|
29
|
+
enum: Object.values(omni_record_status_enum_js_1.OmniRecordStatus),
|
|
30
|
+
length: 32,
|
|
31
|
+
}),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], OmniRecordEntity.prototype, "status", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], OmniRecordEntity.prototype, "payload", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true, length: 128 }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], OmniRecordEntity.prototype, "payloadSchemaId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], OmniRecordEntity.prototype, "payloadSchemaVersion", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.OneToMany)(() => omni_relation_entity_js_1.OmniRelationEntity, (relation) => relation.sourceRecord),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], OmniRecordEntity.prototype, "outgoingRelations", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.OneToMany)(() => omni_relation_entity_js_1.OmniRelationEntity, (relation) => relation.targetRecord),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], OmniRecordEntity.prototype, "incomingRelations", void 0);
|
|
54
|
+
exports.OmniRecordEntity = OmniRecordEntity = __decorate([
|
|
55
|
+
(0, typeorm_1.Entity)('omni-record'),
|
|
56
|
+
(0, typeorm_1.Index)('omni_record_scope_kind_status_guid_idx', [
|
|
57
|
+
'scopeId',
|
|
58
|
+
'kind',
|
|
59
|
+
'status',
|
|
60
|
+
'guid',
|
|
61
|
+
]),
|
|
62
|
+
(0, typeorm_1.TableInheritance)({
|
|
63
|
+
column: {
|
|
64
|
+
name: 'recordType',
|
|
65
|
+
type: 'varchar',
|
|
66
|
+
length: 32,
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
70
|
+
], OmniRecordEntity);
|
|
71
|
+
//# sourceMappingURL=omni-record.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-record.entity.js","sourceRo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KACP,CAAC;IACD,IAAA,0BAAgB,EAAC;QAChB,MAAM,EAAE;YACN,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,EAAE;SACX;KACF,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACpB,gBAAgB,CA4B5B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ObjectType } from '@nestjs/graphql';
|
|
2
|
+
import { Column, Entity, Index, OneToMany, TableInheritance } from 'typeorm';
|
|
3
|
+
import type { Relation } from 'typeorm';
|
|
4
|
+
import { OmniNamedEntity } from './omni-named.entity.js';
|
|
5
|
+
import { OmniRelationEntity } from './omni-relation.entity.js';
|
|
6
|
+
import { OmniRecordStatus } from '../omni-record-status.enum.js';
|
|
7
|
+
|
|
8
|
+
@Entity('omni-record')
|
|
9
|
+
@Index('omni_record_scope_kind_status_guid_idx', [
|
|
10
|
+
'scopeId',
|
|
11
|
+
'kind',
|
|
12
|
+
'status',
|
|
13
|
+
'guid',
|
|
14
|
+
])
|
|
15
|
+
@TableInheritance({
|
|
16
|
+
column: {
|
|
17
|
+
name: 'recordType',
|
|
18
|
+
type: 'varchar',
|
|
19
|
+
length: 32,
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
@ObjectType({ isAbstract: true })
|
|
23
|
+
export class OmniRecordEntity extends OmniNamedEntity {
|
|
24
|
+
@Column({ type: 'varchar', length: 64 })
|
|
25
|
+
kind!: string;
|
|
26
|
+
|
|
27
|
+
@Column({
|
|
28
|
+
type: 'varchar',
|
|
29
|
+
default: OmniRecordStatus.Draft,
|
|
30
|
+
enum: Object.values(OmniRecordStatus),
|
|
31
|
+
length: 32,
|
|
32
|
+
})
|
|
33
|
+
status!: OmniRecordStatus;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'simple-json', nullable: true })
|
|
36
|
+
payload?: Record<string, unknown> | null;
|
|
37
|
+
|
|
38
|
+
/** Logical schema identity for JSON payload compatibility and migration. */
|
|
39
|
+
@Column({ type: 'varchar', nullable: true, length: 128 })
|
|
40
|
+
payloadSchemaId?: string | null;
|
|
41
|
+
|
|
42
|
+
/** Revision of payloadSchemaId; a schema change is explicit metadata. */
|
|
43
|
+
@Column({ type: 'integer', nullable: true })
|
|
44
|
+
payloadSchemaVersion?: number | null;
|
|
45
|
+
|
|
46
|
+
@OneToMany(() => OmniRelationEntity, (relation) => relation.sourceRecord)
|
|
47
|
+
outgoingRelations?: Relation<OmniRelationEntity[]>;
|
|
48
|
+
|
|
49
|
+
@OneToMany(() => OmniRelationEntity, (relation) => relation.targetRecord)
|
|
50
|
+
incomingRelations?: Relation<OmniRelationEntity[]>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Relation } from 'typeorm';
|
|
2
|
+
import { OmniBaseEntity } from './omni-base.entity.js';
|
|
3
|
+
import { OmniRecordEntity } from './omni-record.entity.js';
|
|
4
|
+
import { OmniRelationStatus } from '../omni-relation-status.enum.js';
|
|
5
|
+
export declare class OmniRelationEntity extends OmniBaseEntity {
|
|
6
|
+
sourceRecordId: string;
|
|
7
|
+
sourceRecord: Relation<OmniRecordEntity>;
|
|
8
|
+
targetRecordId: string;
|
|
9
|
+
targetRecord: Relation<OmniRecordEntity>;
|
|
10
|
+
kind: string;
|
|
11
|
+
status: OmniRelationStatus;
|
|
12
|
+
payload?: Record<string, unknown> | null;
|
|
13
|
+
payloadSchemaId?: string | null;
|
|
14
|
+
payloadSchemaVersion?: number | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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.OmniRelationEntity = void 0;
|
|
13
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const omni_base_entity_js_1 = require("./omni-base.entity.js");
|
|
16
|
+
const omni_record_entity_js_1 = require("./omni-record.entity.js");
|
|
17
|
+
const omni_relation_status_enum_js_1 = require("../omni-relation-status.enum.js");
|
|
18
|
+
let OmniRelationEntity = class OmniRelationEntity extends omni_base_entity_js_1.OmniBaseEntity {
|
|
19
|
+
};
|
|
20
|
+
exports.OmniRelationEntity = OmniRelationEntity;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 36 }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], OmniRelationEntity.prototype, "sourceRecordId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => omni_record_entity_js_1.OmniRecordEntity, (record) => record.outgoingRelations),
|
|
27
|
+
(0, typeorm_1.JoinColumn)([
|
|
28
|
+
{ name: 'scopeId', referencedColumnName: 'scopeId' },
|
|
29
|
+
{ name: 'sourceRecordId', referencedColumnName: 'guid' },
|
|
30
|
+
]),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], OmniRelationEntity.prototype, "sourceRecord", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 36 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], OmniRelationEntity.prototype, "targetRecordId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => omni_record_entity_js_1.OmniRecordEntity, (record) => record.incomingRelations),
|
|
39
|
+
(0, typeorm_1.JoinColumn)([
|
|
40
|
+
{ name: 'scopeId', referencedColumnName: 'scopeId' },
|
|
41
|
+
{ name: 'targetRecordId', referencedColumnName: 'guid' },
|
|
42
|
+
]),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], OmniRelationEntity.prototype, "targetRecord", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 64 }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], OmniRelationEntity.prototype, "kind", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({
|
|
51
|
+
type: 'varchar',
|
|
52
|
+
default: omni_relation_status_enum_js_1.OmniRelationStatus.Active,
|
|
53
|
+
enum: Object.values(omni_relation_status_enum_js_1.OmniRelationStatus),
|
|
54
|
+
length: 32,
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], OmniRelationEntity.prototype, "status", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], OmniRelationEntity.prototype, "payload", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true, length: 128 }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], OmniRelationEntity.prototype, "payloadSchemaId", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], OmniRelationEntity.prototype, "payloadSchemaVersion", void 0);
|
|
70
|
+
exports.OmniRelationEntity = OmniRelationEntity = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)('omni-relation'),
|
|
72
|
+
(0, typeorm_1.Index)('omni_relation_scope_source_kind_status_created_guid_idx', [
|
|
73
|
+
'scopeId',
|
|
74
|
+
'sourceRecordId',
|
|
75
|
+
'kind',
|
|
76
|
+
'status',
|
|
77
|
+
'createdAt',
|
|
78
|
+
'guid',
|
|
79
|
+
]),
|
|
80
|
+
(0, typeorm_1.Index)('omni_relation_scope_target_kind_status_created_guid_idx', [
|
|
81
|
+
'scopeId',
|
|
82
|
+
'targetRecordId',
|
|
83
|
+
'kind',
|
|
84
|
+
'status',
|
|
85
|
+
'createdAt',
|
|
86
|
+
'guid',
|
|
87
|
+
]),
|
|
88
|
+
(0, typeorm_1.Index)('omni_relation_scope_edge_kind_status_unique', ['scopeId', 'sourceRecordId', 'targetRecordId', 'kind', 'status'], { unique: true }),
|
|
89
|
+
(0, graphql_1.ObjectType)({ isAbstract: true })
|
|
90
|
+
], OmniRelationEntity);
|
|
91
|
+
//# sourceMappingURL=omni-relation.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-relation.entity.js","sourceRoot":"","sources":["omni-relation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAC7C,qCAAuE;AAEvE,+DAAuD;AACvD,mEAA2D;AAC3D,kFAAqE;AAyB9D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,oCAAc;CAyCrD,CAAA;AAzCY,gDAAkB;AAE7B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;0DAChB;AAOxB;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wCAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC;IACvE,IAAA,oBAAU,EAAC;QACV,EAAE,IAAI,EAAE,SAAS,EA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;QACT,gBAAgB;QAChB,MAAM;QACN,QAAQ;QACR,WAAW;QACX,MAAM;KACP,CAAC;IACD,IAAA,eAAK,EAAC,yDAAyD,EAAE;QAChE,SAAS;QACT,gBAAgB;QAChB,MAAM;QACN,QAAQ;QACR,WAAW;QACX,MAAM;KACP,CAAC;IACD,IAAA,eAAK,EACJ,6CAA6C,EAC7C,CAAC,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,CAAC,EACjE,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,oBAAU,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GACpB,kBAAkB,CAyC9B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ObjectType } from '@nestjs/graphql';
|
|
2
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from 'typeorm';
|
|
3
|
+
import type { Relation } from 'typeorm';
|
|
4
|
+
import { OmniBaseEntity } from './omni-base.entity.js';
|
|
5
|
+
import { OmniRecordEntity } from './omni-record.entity.js';
|
|
6
|
+
import { OmniRelationStatus } from '../omni-relation-status.enum.js';
|
|
7
|
+
|
|
8
|
+
@Entity('omni-relation')
|
|
9
|
+
@Index('omni_relation_scope_source_kind_status_created_guid_idx', [
|
|
10
|
+
'scopeId',
|
|
11
|
+
'sourceRecordId',
|
|
12
|
+
'kind',
|
|
13
|
+
'status',
|
|
14
|
+
'createdAt',
|
|
15
|
+
'guid',
|
|
16
|
+
])
|
|
17
|
+
@Index('omni_relation_scope_target_kind_status_created_guid_idx', [
|
|
18
|
+
'scopeId',
|
|
19
|
+
'targetRecordId',
|
|
20
|
+
'kind',
|
|
21
|
+
'status',
|
|
22
|
+
'createdAt',
|
|
23
|
+
'guid',
|
|
24
|
+
])
|
|
25
|
+
@Index(
|
|
26
|
+
'omni_relation_scope_edge_kind_status_unique',
|
|
27
|
+
['scopeId', 'sourceRecordId', 'targetRecordId', 'kind', 'status'],
|
|
28
|
+
{ unique: true },
|
|
29
|
+
)
|
|
30
|
+
@ObjectType({ isAbstract: true })
|
|
31
|
+
export class OmniRelationEntity extends OmniBaseEntity {
|
|
32
|
+
@Column({ type: 'varchar', length: 36 })
|
|
33
|
+
sourceRecordId!: string;
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => OmniRecordEntity, (record) => record.outgoingRelations)
|
|
36
|
+
@JoinColumn([
|
|
37
|
+
{ name: 'scopeId', referencedColumnName: 'scopeId' },
|
|
38
|
+
{ name: 'sourceRecordId', referencedColumnName: 'guid' },
|
|
39
|
+
])
|
|
40
|
+
sourceRecord!: Relation<OmniRecordEntity>;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'varchar', length: 36 })
|
|
43
|
+
targetRecordId!: string;
|
|
44
|
+
|
|
45
|
+
@ManyToOne(() => OmniRecordEntity, (record) => record.incomingRelations)
|
|
46
|
+
@JoinColumn([
|
|
47
|
+
{ name: 'scopeId', referencedColumnName: 'scopeId' },
|
|
48
|
+
{ name: 'targetRecordId', referencedColumnName: 'guid' },
|
|
49
|
+
])
|
|
50
|
+
targetRecord!: Relation<OmniRecordEntity>;
|
|
51
|
+
|
|
52
|
+
/** Validated by the registered relation-kind contract, not a closed enum. */
|
|
53
|
+
@Column({ type: 'varchar', length: 64 })
|
|
54
|
+
kind!: string;
|
|
55
|
+
|
|
56
|
+
@Column({
|
|
57
|
+
type: 'varchar',
|
|
58
|
+
default: OmniRelationStatus.Active,
|
|
59
|
+
enum: Object.values(OmniRelationStatus),
|
|
60
|
+
length: 32,
|
|
61
|
+
})
|
|
62
|
+
status!: OmniRelationStatus;
|
|
63
|
+
|
|
64
|
+
@Column({ type: 'simple-json', nullable: true })
|
|
65
|
+
payload?: Record<string, unknown> | null;
|
|
66
|
+
|
|
67
|
+
@Column({ type: 'varchar', nullable: true, length: 128 })
|
|
68
|
+
payloadSchemaId?: string | null;
|
|
69
|
+
|
|
70
|
+
@Column({ type: 'integer', nullable: true })
|
|
71
|
+
payloadSchemaVersion?: number | null;
|
|
72
|
+
}
|
package/src/index.d.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';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./base/omni-base.entity.js"), exports);
|
|
18
|
+
__exportStar(require("./base/omni-named.entity.js"), exports);
|
|
19
|
+
__exportStar(require("./base/omni-record.entity.js"), exports);
|
|
20
|
+
__exportStar(require("./base/omni-relation.entity.js"), exports);
|
|
21
|
+
__exportStar(require("./base/omni-external-ref.entity.js"), exports);
|
|
22
|
+
__exportStar(require("./omni-named.dto.js"), exports);
|
|
23
|
+
__exportStar(require("./omni-dto.helpers.js"), exports);
|
|
24
|
+
__exportStar(require("./omni-named.backend.js"), exports);
|
|
25
|
+
__exportStar(require("./omni-record-status.enum.js"), exports);
|
|
26
|
+
__exportStar(require("./omni-relation-status.enum.js"), exports);
|
|
27
|
+
__exportStar(require("./omni-relation-kind.enum.js"), exports);
|
|
28
|
+
__exportStar(require("./omni-relation-kind.contract.js"), exports);
|
|
29
|
+
__exportStar(require("./omni-relation-semantics.js"), exports);
|
|
30
|
+
__exportStar(require("./omni-record.dto.js"), exports);
|
|
31
|
+
__exportStar(require("./omni-record.backend.js"), exports);
|
|
32
|
+
__exportStar(require("./omni-record.service.js"), exports);
|
|
33
|
+
__exportStar(require("./omni-collection-kind.enum.js"), exports);
|
|
34
|
+
__exportStar(require("./omni-collection.entity.js"), exports);
|
|
35
|
+
__exportStar(require("./omni-collection.dto.js"), exports);
|
|
36
|
+
__exportStar(require("./omni-collection.service.js"), exports);
|
|
37
|
+
__exportStar(require("./omni-collection.backend.js"), exports);
|
|
38
|
+
__exportStar(require("./omni-document-kind.enum.js"), exports);
|
|
39
|
+
__exportStar(require("./omni-document.entity.js"), exports);
|
|
40
|
+
__exportStar(require("./omni-document.dto.js"), exports);
|
|
41
|
+
__exportStar(require("./omni-document.service.js"), exports);
|
|
42
|
+
__exportStar(require("./omni-document.backend.js"), exports);
|
|
43
|
+
__exportStar(require("./omni-relation.dto.js"), exports);
|
|
44
|
+
__exportStar(require("./omni-relation.backend.js"), exports);
|
|
45
|
+
__exportStar(require("./omni-external-ref-internal-type.enum.js"), exports);
|
|
46
|
+
__exportStar(require("./omni-external-ref-binding.validator.js"), exports);
|
|
47
|
+
__exportStar(require("./omni-external-ref.dto.js"), exports);
|
|
48
|
+
__exportStar(require("./omni-external-ref.service.js"), exports);
|
|
49
|
+
__exportStar(require("./omni-external-ref.backend.js"), exports);
|
|
50
|
+
__exportStar(require("./omni-scoped.repository.js"), exports);
|
|
51
|
+
__exportStar(require("./omni-scoped.service.js"), exports);
|
|
52
|
+
__exportStar(require("./omni-scope.js"), exports);
|
|
53
|
+
__exportStar(require("./omni-scoped.backend.js"), exports);
|
|
54
|
+
__exportStar(require("./omni-projection.lifecycle.js"), exports);
|
|
55
|
+
__exportStar(require("./omni-projection.catalog.js"), exports);
|
|
56
|
+
__exportStar(require("./omni-extension-projection.definition.js"), exports);
|
|
57
|
+
__exportStar(require("./omni-extension-projection.resource.js"), exports);
|
|
58
|
+
__exportStar(require("./omni-extension-projection.service.js"), exports);
|
|
59
|
+
__exportStar(require("./omni-migration.js"), exports);
|
|
60
|
+
__exportStar(require("./omni-relation-projection.definition.js"), exports);
|
|
61
|
+
__exportStar(require("./omni-relation-projection.resource.js"), exports);
|
|
62
|
+
__exportStar(require("./omni-relation-projection.service.js"), exports);
|
|
63
|
+
__exportStar(require("./omnikernel.query.service.js"), exports);
|
|
64
|
+
__exportStar(require("./omnikernel.diagnostics.js"), exports);
|
|
65
|
+
__exportStar(require("./omnikernel.module.js"), exports);
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,8DAA4C;AAC5C,+DAA6C;AAC7C,iEAA+C;AAC/C,qEAAmD;AACnD,sDAAoC;AACpC,wDAAsC;AACtC,0DAAwC;AACxC,+DAA6C;AAC7C,iEAA+C;AAC/C,+DAA6C;AAC7C,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,2DAAyC;AACzC,2DAAyC;AACzC,iEAA+C;AAC/C,8DAA4C;AAC5C,2DAAyC;AACzC,+DAA6C;AAC7C,+DAA6C;AAC7C,+DAA6C;AAC7C,4DAA0C;AAC1C,yDAAuC;AACvC,6DAA2C;AAC3C,6DAA2C;AAC3C,yDAAuC;AACvC,6DAA2C;AAC3C,4EAA0D;AAC1D,2EAAyD;AACzD,6DAA2C;AAC3C,iEAA+C;AAC/C,iEAA+C;AAC/C,8DAA4C;AAC5C,2DAAyC;AACzC,kDAAgC;AAChC,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAC7C,4EAA0D;AAC1D,0EAAwD;AACxD,yEAAuD;AACvD,sDAAoC;AACpC,2EAAyD;AACzD,yEAAuD;AACvD,wEAAsD;AACtD,gEAA8C;AAC9C,8DAA4C;AAC5C,yDAAuC"}
|