@nest-yalc-2/omnikernel-module 2.2.2 → 2.2.4
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/package.json +17 -15
- package/src/__tests__/omni-collection.entity.spec.ts +49 -49
- package/src/__tests__/omni-collection.service.spec.ts +83 -83
- package/src/__tests__/omni-document.entity.spec.ts +55 -55
- package/src/__tests__/omni-document.service.spec.ts +83 -83
- package/src/__tests__/omni-extension-projection-constraints.spec.ts +518 -518
- package/src/__tests__/omni-extension-projection.registration.spec.ts +947 -946
- package/src/__tests__/omni-extension-projection.service.spec.ts +806 -806
- package/src/__tests__/omni-external-ref.entity.spec.ts +36 -36
- package/src/__tests__/omni-external-ref.service.spec.ts +252 -252
- package/src/__tests__/omni-named.entity.spec.ts +33 -33
- package/src/__tests__/omni-record.entity.spec.ts +32 -32
- package/src/__tests__/omni-record.service.spec.ts +107 -107
- package/src/__tests__/omni-relation-semantics.spec.ts +102 -102
- package/src/__tests__/omni-relation.entity.spec.ts +38 -38
- package/src/__tests__/omni-scope-substrate.spec.ts +81 -81
- package/src/__tests__/omni-scoped.backend.spec.ts +115 -115
- package/src/__tests__/omni-scoped.service.spec.ts +354 -354
- package/src/__tests__/omnikernel.diagnostics.spec.ts +94 -94
- package/src/__tests__/omnikernel.module.spec.ts +38 -40
- package/src/__tests__/omnikernel.persistence.spec.ts +154 -154
- package/src/__tests__/omnikernel.public-api.spec.ts +238 -238
- package/src/__tests__/omnikernel.query.service.spec.ts +155 -155
- package/src/base/omni-base.entity.ts +41 -41
- package/src/base/omni-external-ref.entity.ts +53 -53
- package/src/base/omni-named.entity.ts +16 -16
- package/src/base/omni-record.entity.ts +51 -51
- package/src/base/omni-relation.entity.ts +72 -72
- package/src/index.ts +49 -49
- package/src/omni-collection-kind.enum.ts +10 -10
- package/src/omni-collection.backend.ts +16 -16
- package/src/omni-collection.dto.ts +170 -170
- package/src/omni-collection.entity.ts +21 -21
- package/src/omni-collection.service.ts +75 -75
- package/src/omni-document-kind.enum.ts +12 -12
- package/src/omni-document.backend.ts +16 -16
- package/src/omni-document.dto.ts +198 -198
- package/src/omni-document.entity.ts +30 -30
- package/src/omni-document.service.ts +75 -75
- package/src/omni-dto.helpers.ts +21 -21
- package/src/omni-extension-projection.definition.ts +294 -294
- package/src/omni-extension-projection.resource.ts +274 -274
- package/src/omni-extension-projection.service.ts +452 -452
- package/src/omni-external-ref-binding.validator.ts +53 -53
- package/src/omni-external-ref-internal-type.enum.ts +11 -11
- package/src/omni-external-ref.backend.ts +25 -25
- package/src/omni-external-ref.dto.ts +128 -128
- package/src/omni-external-ref.service.ts +255 -255
- package/src/omni-migration.ts +365 -365
- package/src/omni-named.backend.ts +11 -11
- package/src/omni-named.dto.ts +86 -86
- package/src/omni-projection.catalog.ts +345 -345
- package/src/omni-projection.lifecycle.ts +53 -53
- package/src/omni-record-status.enum.ts +11 -11
- package/src/omni-record.backend.ts +19 -19
- package/src/omni-record.dto.ts +157 -157
- package/src/omni-record.service.ts +113 -113
- package/src/omni-relation-kind.contract.ts +49 -49
- package/src/omni-relation-kind.enum.ts +12 -12
- package/src/omni-relation-projection.definition.ts +166 -166
- package/src/omni-relation-projection.resource.ts +360 -360
- package/src/omni-relation-projection.service.ts +610 -610
- package/src/omni-relation-semantics.ts +52 -52
- package/src/omni-relation-status.enum.ts +11 -11
- package/src/omni-relation.backend.ts +21 -21
- package/src/omni-relation.dto.ts +142 -142
- package/src/omni-relation.service.ts +159 -159
- package/src/omni-scope.ts +161 -161
- package/src/omni-scoped.backend.ts +110 -110
- package/src/omni-scoped.repository.ts +34 -34
- package/src/omni-scoped.service.ts +338 -338
- package/src/omnikernel.diagnostics.ts +83 -83
- package/src/omnikernel.module.ts +97 -97
- package/src/omnikernel.query.service.ts +108 -108
|
@@ -1,238 +1,238 @@
|
|
|
1
|
-
import { describe, expect, it } from '@jest/globals';
|
|
2
|
-
import 'reflect-metadata';
|
|
3
|
-
import { OmniCollectionKind } from '../omni-collection-kind.enum.js';
|
|
4
|
-
import { OmniDocumentKind } from '../omni-document-kind.enum.js';
|
|
5
|
-
import { OmniRecordStatus } from '../omni-record-status.enum.js';
|
|
6
|
-
import { OmniRelationKind } from '../omni-relation-kind.enum.js';
|
|
7
|
-
import { OmniRelationStatus } from '../omni-relation-status.enum.js';
|
|
8
|
-
|
|
9
|
-
import * as namedDto from '../omni-named.dto.js';
|
|
10
|
-
import * as recordDto from '../omni-record.dto.js';
|
|
11
|
-
import * as collectionDto from '../omni-collection.dto.js';
|
|
12
|
-
import * as relationDto from '../omni-relation.dto.js';
|
|
13
|
-
import * as externalRefDto from '../omni-external-ref.dto.js';
|
|
14
|
-
import * as documentDto from '../omni-document.dto.js';
|
|
15
|
-
import { OmniCollectionEntity } from '../omni-collection.entity.js';
|
|
16
|
-
import { OmniCollectionService } from '../omni-collection.service.js';
|
|
17
|
-
import { OmniDocumentEntity } from '../omni-document.entity.js';
|
|
18
|
-
import { OmniDocumentService } from '../omni-document.service.js';
|
|
19
|
-
import { OmniExternalRefInternalType } from '../omni-external-ref-internal-type.enum.js';
|
|
20
|
-
import { OmniExternalRefService } from '../omni-external-ref.service.js';
|
|
21
|
-
import * as relationSemantics from '../omni-relation-semantics.js';
|
|
22
|
-
import { OmniKernelQueryService } from '../omnikernel.query.service.js';
|
|
23
|
-
import { omniCollectionBackendProvidersFactory } from '../omni-collection.backend.js';
|
|
24
|
-
import { omniNamedBackendProvidersFactory } from '../omni-named.backend.js';
|
|
25
|
-
import { omniRecordBackendProvidersFactory } from '../omni-record.backend.js';
|
|
26
|
-
import { omniRelationBackendProvidersFactory } from '../omni-relation.backend.js';
|
|
27
|
-
import { omniExternalRefBackendProvidersFactory } from '../omni-external-ref.backend.js';
|
|
28
|
-
import { omniDocumentBackendProvidersFactory } from '../omni-document.backend.js';
|
|
29
|
-
import * as omnikernelPublicApi from '../index.js';
|
|
30
|
-
|
|
31
|
-
describe('OmniKernel public API', () => {
|
|
32
|
-
it('copies data through DTO constructors', () => {
|
|
33
|
-
const named = new namedDto.OmniNamedType({
|
|
34
|
-
guid: '6c1bfae7-b56c-4537-a5c7-98c84ce2d23a',
|
|
35
|
-
title: 'Named',
|
|
36
|
-
slug: 'named',
|
|
37
|
-
});
|
|
38
|
-
const record = new recordDto.OmniRecordType({
|
|
39
|
-
guid: 'b7df87c7-b8b8-43a3-99c0-811024a48b39',
|
|
40
|
-
title: 'Record',
|
|
41
|
-
kind: 'generic',
|
|
42
|
-
status: OmniRecordStatus.Active,
|
|
43
|
-
payload: { ok: true },
|
|
44
|
-
});
|
|
45
|
-
const collection = new collectionDto.OmniCollectionType({
|
|
46
|
-
guid: '0f7f6978-66f2-4d96-a7f3-a0ecf399f2e2',
|
|
47
|
-
title: 'Collection',
|
|
48
|
-
kind: OmniCollectionKind.Collection,
|
|
49
|
-
status: OmniRecordStatus.Active,
|
|
50
|
-
collectionKind: OmniCollectionKind.Folder,
|
|
51
|
-
summary: 'Container',
|
|
52
|
-
});
|
|
53
|
-
const relation = new relationDto.OmniRelationType({
|
|
54
|
-
guid: '5bba1944-1a52-4918-ba54-453e09d3d9b3',
|
|
55
|
-
sourceRecordId: 'b7df87c7-b8b8-43a3-99c0-811024a48b39',
|
|
56
|
-
targetRecordId: '6c1bfae7-b56c-4537-a5c7-98c84ce2d23a',
|
|
57
|
-
kind: OmniRelationKind.Contains,
|
|
58
|
-
status: OmniRelationStatus.Active,
|
|
59
|
-
});
|
|
60
|
-
const externalRef = new externalRefDto.OmniExternalRefType({
|
|
61
|
-
guid: '47eaf320-9fbe-4f2e-9a0a-c2c4cbdb2d9e',
|
|
62
|
-
internalType: OmniExternalRefInternalType.Document,
|
|
63
|
-
internalId: 'b7df87c7-b8b8-43a3-99c0-811024a48b39',
|
|
64
|
-
provider: 'github',
|
|
65
|
-
externalId: '123',
|
|
66
|
-
});
|
|
67
|
-
const document = new documentDto.OmniDocumentType({
|
|
68
|
-
guid: 'ebf2fd92-9271-4cb7-b5a8-a7ce0105dff5',
|
|
69
|
-
title: 'Document',
|
|
70
|
-
kind: OmniDocumentKind.Document,
|
|
71
|
-
status: OmniRecordStatus.Active,
|
|
72
|
-
documentKind: OmniDocumentKind.Document,
|
|
73
|
-
content: 'Body',
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
expect(named.title).toBe('Named');
|
|
77
|
-
expect(record.payload).toEqual({ ok: true });
|
|
78
|
-
expect(collection.collectionKind).toBe(OmniCollectionKind.Folder);
|
|
79
|
-
expect(relation.kind).toBe(OmniRelationKind.Contains);
|
|
80
|
-
expect(externalRef.provider).toBe('github');
|
|
81
|
-
expect(document.documentKind).toBe(OmniDocumentKind.Document);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('exposes generated GraphQL input types', () => {
|
|
85
|
-
expect(new namedDto.OmniNamedCreateInput()).toBeInstanceOf(
|
|
86
|
-
namedDto.OmniNamedCreateInput,
|
|
87
|
-
);
|
|
88
|
-
expect(new namedDto.OmniNamedCondition()).toBeInstanceOf(
|
|
89
|
-
namedDto.OmniNamedCondition,
|
|
90
|
-
);
|
|
91
|
-
expect(new namedDto.OmniNamedUpdateInput()).toBeInstanceOf(
|
|
92
|
-
namedDto.OmniNamedUpdateInput,
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
expect(new recordDto.OmniRecordCreateInput()).toBeInstanceOf(
|
|
96
|
-
recordDto.OmniRecordCreateInput,
|
|
97
|
-
);
|
|
98
|
-
expect(new recordDto.OmniRecordCondition()).toBeInstanceOf(
|
|
99
|
-
recordDto.OmniRecordCondition,
|
|
100
|
-
);
|
|
101
|
-
expect(new recordDto.OmniRecordUpdateInput()).toBeInstanceOf(
|
|
102
|
-
recordDto.OmniRecordUpdateInput,
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
expect(new collectionDto.OmniCollectionCreateInput()).toBeInstanceOf(
|
|
106
|
-
collectionDto.OmniCollectionCreateInput,
|
|
107
|
-
);
|
|
108
|
-
expect(new collectionDto.OmniCollectionCondition()).toBeInstanceOf(
|
|
109
|
-
collectionDto.OmniCollectionCondition,
|
|
110
|
-
);
|
|
111
|
-
expect(new collectionDto.OmniCollectionUpdateInput()).toBeInstanceOf(
|
|
112
|
-
collectionDto.OmniCollectionUpdateInput,
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
expect(new relationDto.OmniRelationCreateInput()).toBeInstanceOf(
|
|
116
|
-
relationDto.OmniRelationCreateInput,
|
|
117
|
-
);
|
|
118
|
-
expect(new relationDto.OmniRelationCondition()).toBeInstanceOf(
|
|
119
|
-
relationDto.OmniRelationCondition,
|
|
120
|
-
);
|
|
121
|
-
expect(new relationDto.OmniRelationUpdateInput()).toBeInstanceOf(
|
|
122
|
-
relationDto.OmniRelationUpdateInput,
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
expect(new externalRefDto.OmniExternalRefCreateInput()).toBeInstanceOf(
|
|
126
|
-
externalRefDto.OmniExternalRefCreateInput,
|
|
127
|
-
);
|
|
128
|
-
expect(new externalRefDto.OmniExternalRefCondition()).toBeInstanceOf(
|
|
129
|
-
externalRefDto.OmniExternalRefCondition,
|
|
130
|
-
);
|
|
131
|
-
expect(new externalRefDto.OmniExternalRefUpdateInput()).toBeInstanceOf(
|
|
132
|
-
externalRefDto.OmniExternalRefUpdateInput,
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
expect(new documentDto.OmniDocumentCreateInput()).toBeInstanceOf(
|
|
136
|
-
documentDto.OmniDocumentCreateInput,
|
|
137
|
-
);
|
|
138
|
-
expect(new documentDto.OmniDocumentCondition()).toBeInstanceOf(
|
|
139
|
-
documentDto.OmniDocumentCondition,
|
|
140
|
-
);
|
|
141
|
-
expect(new documentDto.OmniDocumentUpdateInput()).toBeInstanceOf(
|
|
142
|
-
documentDto.OmniDocumentUpdateInput,
|
|
143
|
-
);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it('builds backend provider configs for every public backend factory', () => {
|
|
147
|
-
const named = omniNamedBackendProvidersFactory('db');
|
|
148
|
-
const record = omniRecordBackendProvidersFactory('db');
|
|
149
|
-
const collection = omniCollectionBackendProvidersFactory('db');
|
|
150
|
-
const relation = omniRelationBackendProvidersFactory('db');
|
|
151
|
-
const externalRef = omniExternalRefBackendProvidersFactory('db');
|
|
152
|
-
const document = omniDocumentBackendProvidersFactory('db');
|
|
153
|
-
|
|
154
|
-
expect(named.repository).toBeDefined();
|
|
155
|
-
expect(record.repository).toBeDefined();
|
|
156
|
-
expect(collection.repository).toBeDefined();
|
|
157
|
-
expect(relation.repository).toBeDefined();
|
|
158
|
-
expect(externalRef.repository).toBeDefined();
|
|
159
|
-
expect(document.repository).toBeDefined();
|
|
160
|
-
expect(record.providers.length).toBeGreaterThan(0);
|
|
161
|
-
expect(collection.providers.length).toBeGreaterThan(0);
|
|
162
|
-
expect(document.providers.length).toBeGreaterThan(0);
|
|
163
|
-
expect(
|
|
164
|
-
collection.providers.some(
|
|
165
|
-
(provider) =>
|
|
166
|
-
typeof provider === 'object' &&
|
|
167
|
-
provider !== null &&
|
|
168
|
-
'provide' in provider &&
|
|
169
|
-
provider.provide === OmniCollectionService,
|
|
170
|
-
),
|
|
171
|
-
).toBe(true);
|
|
172
|
-
expect(
|
|
173
|
-
document.providers.some(
|
|
174
|
-
(provider) =>
|
|
175
|
-
typeof provider === 'object' &&
|
|
176
|
-
provider !== null &&
|
|
177
|
-
'provide' in provider &&
|
|
178
|
-
provider.provide === OmniDocumentService,
|
|
179
|
-
),
|
|
180
|
-
).toBe(true);
|
|
181
|
-
expect(
|
|
182
|
-
externalRef.providers.some(
|
|
183
|
-
(provider) =>
|
|
184
|
-
typeof provider === 'object' &&
|
|
185
|
-
provider !== null &&
|
|
186
|
-
'provide' in provider &&
|
|
187
|
-
provider.provide === OmniExternalRefService,
|
|
188
|
-
),
|
|
189
|
-
).toBe(true);
|
|
190
|
-
expect(OmniCollectionEntity).toBe(omnikernelPublicApi.OmniCollectionEntity);
|
|
191
|
-
expect(OmniDocumentEntity).toBe(omnikernelPublicApi.OmniDocumentEntity);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it('re-exports the documented OmniKernel surface from index.ts', () => {
|
|
195
|
-
expect(omnikernelPublicApi.OmniKernelModule).toBeDefined();
|
|
196
|
-
expect(omnikernelPublicApi.OmniNamedType).toBe(namedDto.OmniNamedType);
|
|
197
|
-
expect(omnikernelPublicApi.OmniRecordType).toBe(recordDto.OmniRecordType);
|
|
198
|
-
expect(omnikernelPublicApi.OmniCollectionType).toBe(
|
|
199
|
-
collectionDto.OmniCollectionType,
|
|
200
|
-
);
|
|
201
|
-
expect(omnikernelPublicApi.OmniRelationType).toBe(
|
|
202
|
-
relationDto.OmniRelationType,
|
|
203
|
-
);
|
|
204
|
-
expect(omnikernelPublicApi.OmniExternalRefType).toBe(
|
|
205
|
-
externalRefDto.OmniExternalRefType,
|
|
206
|
-
);
|
|
207
|
-
expect(omnikernelPublicApi.OmniDocumentType).toBe(
|
|
208
|
-
documentDto.OmniDocumentType,
|
|
209
|
-
);
|
|
210
|
-
expect(omnikernelPublicApi.omniDocumentBackendProvidersFactory).toBe(
|
|
211
|
-
omniDocumentBackendProvidersFactory,
|
|
212
|
-
);
|
|
213
|
-
expect(omnikernelPublicApi.omniCollectionBackendProvidersFactory).toBe(
|
|
214
|
-
omniCollectionBackendProvidersFactory,
|
|
215
|
-
);
|
|
216
|
-
expect(omnikernelPublicApi.omniNamedBackendProvidersFactory).toBe(
|
|
217
|
-
omniNamedBackendProvidersFactory,
|
|
218
|
-
);
|
|
219
|
-
expect(omnikernelPublicApi.omniRecordBackendProvidersFactory).toBe(
|
|
220
|
-
omniRecordBackendProvidersFactory,
|
|
221
|
-
);
|
|
222
|
-
expect(omnikernelPublicApi.omniRelationBackendProvidersFactory).toBe(
|
|
223
|
-
omniRelationBackendProvidersFactory,
|
|
224
|
-
);
|
|
225
|
-
expect(omnikernelPublicApi.omniExternalRefBackendProvidersFactory).toBe(
|
|
226
|
-
omniExternalRefBackendProvidersFactory,
|
|
227
|
-
);
|
|
228
|
-
expect(omnikernelPublicApi.isAllowedOmniRelation).toBe(
|
|
229
|
-
relationSemantics.isAllowedOmniRelation,
|
|
230
|
-
);
|
|
231
|
-
expect(omnikernelPublicApi.OmniExternalRefInternalType).toBe(
|
|
232
|
-
OmniExternalRefInternalType,
|
|
233
|
-
);
|
|
234
|
-
expect(omnikernelPublicApi.OmniKernelQueryService).toBe(
|
|
235
|
-
OmniKernelQueryService,
|
|
236
|
-
);
|
|
237
|
-
});
|
|
238
|
-
});
|
|
1
|
+
import { describe, expect, it } from '@jest/globals';
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
import { OmniCollectionKind } from '../omni-collection-kind.enum.js';
|
|
4
|
+
import { OmniDocumentKind } from '../omni-document-kind.enum.js';
|
|
5
|
+
import { OmniRecordStatus } from '../omni-record-status.enum.js';
|
|
6
|
+
import { OmniRelationKind } from '../omni-relation-kind.enum.js';
|
|
7
|
+
import { OmniRelationStatus } from '../omni-relation-status.enum.js';
|
|
8
|
+
|
|
9
|
+
import * as namedDto from '../omni-named.dto.js';
|
|
10
|
+
import * as recordDto from '../omni-record.dto.js';
|
|
11
|
+
import * as collectionDto from '../omni-collection.dto.js';
|
|
12
|
+
import * as relationDto from '../omni-relation.dto.js';
|
|
13
|
+
import * as externalRefDto from '../omni-external-ref.dto.js';
|
|
14
|
+
import * as documentDto from '../omni-document.dto.js';
|
|
15
|
+
import { OmniCollectionEntity } from '../omni-collection.entity.js';
|
|
16
|
+
import { OmniCollectionService } from '../omni-collection.service.js';
|
|
17
|
+
import { OmniDocumentEntity } from '../omni-document.entity.js';
|
|
18
|
+
import { OmniDocumentService } from '../omni-document.service.js';
|
|
19
|
+
import { OmniExternalRefInternalType } from '../omni-external-ref-internal-type.enum.js';
|
|
20
|
+
import { OmniExternalRefService } from '../omni-external-ref.service.js';
|
|
21
|
+
import * as relationSemantics from '../omni-relation-semantics.js';
|
|
22
|
+
import { OmniKernelQueryService } from '../omnikernel.query.service.js';
|
|
23
|
+
import { omniCollectionBackendProvidersFactory } from '../omni-collection.backend.js';
|
|
24
|
+
import { omniNamedBackendProvidersFactory } from '../omni-named.backend.js';
|
|
25
|
+
import { omniRecordBackendProvidersFactory } from '../omni-record.backend.js';
|
|
26
|
+
import { omniRelationBackendProvidersFactory } from '../omni-relation.backend.js';
|
|
27
|
+
import { omniExternalRefBackendProvidersFactory } from '../omni-external-ref.backend.js';
|
|
28
|
+
import { omniDocumentBackendProvidersFactory } from '../omni-document.backend.js';
|
|
29
|
+
import * as omnikernelPublicApi from '../index.js';
|
|
30
|
+
|
|
31
|
+
describe('OmniKernel public API', () => {
|
|
32
|
+
it('copies data through DTO constructors', () => {
|
|
33
|
+
const named = new namedDto.OmniNamedType({
|
|
34
|
+
guid: '6c1bfae7-b56c-4537-a5c7-98c84ce2d23a',
|
|
35
|
+
title: 'Named',
|
|
36
|
+
slug: 'named',
|
|
37
|
+
});
|
|
38
|
+
const record = new recordDto.OmniRecordType({
|
|
39
|
+
guid: 'b7df87c7-b8b8-43a3-99c0-811024a48b39',
|
|
40
|
+
title: 'Record',
|
|
41
|
+
kind: 'generic',
|
|
42
|
+
status: OmniRecordStatus.Active,
|
|
43
|
+
payload: { ok: true },
|
|
44
|
+
});
|
|
45
|
+
const collection = new collectionDto.OmniCollectionType({
|
|
46
|
+
guid: '0f7f6978-66f2-4d96-a7f3-a0ecf399f2e2',
|
|
47
|
+
title: 'Collection',
|
|
48
|
+
kind: OmniCollectionKind.Collection,
|
|
49
|
+
status: OmniRecordStatus.Active,
|
|
50
|
+
collectionKind: OmniCollectionKind.Folder,
|
|
51
|
+
summary: 'Container',
|
|
52
|
+
});
|
|
53
|
+
const relation = new relationDto.OmniRelationType({
|
|
54
|
+
guid: '5bba1944-1a52-4918-ba54-453e09d3d9b3',
|
|
55
|
+
sourceRecordId: 'b7df87c7-b8b8-43a3-99c0-811024a48b39',
|
|
56
|
+
targetRecordId: '6c1bfae7-b56c-4537-a5c7-98c84ce2d23a',
|
|
57
|
+
kind: OmniRelationKind.Contains,
|
|
58
|
+
status: OmniRelationStatus.Active,
|
|
59
|
+
});
|
|
60
|
+
const externalRef = new externalRefDto.OmniExternalRefType({
|
|
61
|
+
guid: '47eaf320-9fbe-4f2e-9a0a-c2c4cbdb2d9e',
|
|
62
|
+
internalType: OmniExternalRefInternalType.Document,
|
|
63
|
+
internalId: 'b7df87c7-b8b8-43a3-99c0-811024a48b39',
|
|
64
|
+
provider: 'github',
|
|
65
|
+
externalId: '123',
|
|
66
|
+
});
|
|
67
|
+
const document = new documentDto.OmniDocumentType({
|
|
68
|
+
guid: 'ebf2fd92-9271-4cb7-b5a8-a7ce0105dff5',
|
|
69
|
+
title: 'Document',
|
|
70
|
+
kind: OmniDocumentKind.Document,
|
|
71
|
+
status: OmniRecordStatus.Active,
|
|
72
|
+
documentKind: OmniDocumentKind.Document,
|
|
73
|
+
content: 'Body',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
expect(named.title).toBe('Named');
|
|
77
|
+
expect(record.payload).toEqual({ ok: true });
|
|
78
|
+
expect(collection.collectionKind).toBe(OmniCollectionKind.Folder);
|
|
79
|
+
expect(relation.kind).toBe(OmniRelationKind.Contains);
|
|
80
|
+
expect(externalRef.provider).toBe('github');
|
|
81
|
+
expect(document.documentKind).toBe(OmniDocumentKind.Document);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('exposes generated GraphQL input types', () => {
|
|
85
|
+
expect(new namedDto.OmniNamedCreateInput()).toBeInstanceOf(
|
|
86
|
+
namedDto.OmniNamedCreateInput,
|
|
87
|
+
);
|
|
88
|
+
expect(new namedDto.OmniNamedCondition()).toBeInstanceOf(
|
|
89
|
+
namedDto.OmniNamedCondition,
|
|
90
|
+
);
|
|
91
|
+
expect(new namedDto.OmniNamedUpdateInput()).toBeInstanceOf(
|
|
92
|
+
namedDto.OmniNamedUpdateInput,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
expect(new recordDto.OmniRecordCreateInput()).toBeInstanceOf(
|
|
96
|
+
recordDto.OmniRecordCreateInput,
|
|
97
|
+
);
|
|
98
|
+
expect(new recordDto.OmniRecordCondition()).toBeInstanceOf(
|
|
99
|
+
recordDto.OmniRecordCondition,
|
|
100
|
+
);
|
|
101
|
+
expect(new recordDto.OmniRecordUpdateInput()).toBeInstanceOf(
|
|
102
|
+
recordDto.OmniRecordUpdateInput,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
expect(new collectionDto.OmniCollectionCreateInput()).toBeInstanceOf(
|
|
106
|
+
collectionDto.OmniCollectionCreateInput,
|
|
107
|
+
);
|
|
108
|
+
expect(new collectionDto.OmniCollectionCondition()).toBeInstanceOf(
|
|
109
|
+
collectionDto.OmniCollectionCondition,
|
|
110
|
+
);
|
|
111
|
+
expect(new collectionDto.OmniCollectionUpdateInput()).toBeInstanceOf(
|
|
112
|
+
collectionDto.OmniCollectionUpdateInput,
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
expect(new relationDto.OmniRelationCreateInput()).toBeInstanceOf(
|
|
116
|
+
relationDto.OmniRelationCreateInput,
|
|
117
|
+
);
|
|
118
|
+
expect(new relationDto.OmniRelationCondition()).toBeInstanceOf(
|
|
119
|
+
relationDto.OmniRelationCondition,
|
|
120
|
+
);
|
|
121
|
+
expect(new relationDto.OmniRelationUpdateInput()).toBeInstanceOf(
|
|
122
|
+
relationDto.OmniRelationUpdateInput,
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
expect(new externalRefDto.OmniExternalRefCreateInput()).toBeInstanceOf(
|
|
126
|
+
externalRefDto.OmniExternalRefCreateInput,
|
|
127
|
+
);
|
|
128
|
+
expect(new externalRefDto.OmniExternalRefCondition()).toBeInstanceOf(
|
|
129
|
+
externalRefDto.OmniExternalRefCondition,
|
|
130
|
+
);
|
|
131
|
+
expect(new externalRefDto.OmniExternalRefUpdateInput()).toBeInstanceOf(
|
|
132
|
+
externalRefDto.OmniExternalRefUpdateInput,
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
expect(new documentDto.OmniDocumentCreateInput()).toBeInstanceOf(
|
|
136
|
+
documentDto.OmniDocumentCreateInput,
|
|
137
|
+
);
|
|
138
|
+
expect(new documentDto.OmniDocumentCondition()).toBeInstanceOf(
|
|
139
|
+
documentDto.OmniDocumentCondition,
|
|
140
|
+
);
|
|
141
|
+
expect(new documentDto.OmniDocumentUpdateInput()).toBeInstanceOf(
|
|
142
|
+
documentDto.OmniDocumentUpdateInput,
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('builds backend provider configs for every public backend factory', () => {
|
|
147
|
+
const named = omniNamedBackendProvidersFactory('db');
|
|
148
|
+
const record = omniRecordBackendProvidersFactory('db');
|
|
149
|
+
const collection = omniCollectionBackendProvidersFactory('db');
|
|
150
|
+
const relation = omniRelationBackendProvidersFactory('db');
|
|
151
|
+
const externalRef = omniExternalRefBackendProvidersFactory('db');
|
|
152
|
+
const document = omniDocumentBackendProvidersFactory('db');
|
|
153
|
+
|
|
154
|
+
expect(named.repository).toBeDefined();
|
|
155
|
+
expect(record.repository).toBeDefined();
|
|
156
|
+
expect(collection.repository).toBeDefined();
|
|
157
|
+
expect(relation.repository).toBeDefined();
|
|
158
|
+
expect(externalRef.repository).toBeDefined();
|
|
159
|
+
expect(document.repository).toBeDefined();
|
|
160
|
+
expect(record.providers.length).toBeGreaterThan(0);
|
|
161
|
+
expect(collection.providers.length).toBeGreaterThan(0);
|
|
162
|
+
expect(document.providers.length).toBeGreaterThan(0);
|
|
163
|
+
expect(
|
|
164
|
+
collection.providers.some(
|
|
165
|
+
(provider) =>
|
|
166
|
+
typeof provider === 'object' &&
|
|
167
|
+
provider !== null &&
|
|
168
|
+
'provide' in provider &&
|
|
169
|
+
provider.provide === OmniCollectionService,
|
|
170
|
+
),
|
|
171
|
+
).toBe(true);
|
|
172
|
+
expect(
|
|
173
|
+
document.providers.some(
|
|
174
|
+
(provider) =>
|
|
175
|
+
typeof provider === 'object' &&
|
|
176
|
+
provider !== null &&
|
|
177
|
+
'provide' in provider &&
|
|
178
|
+
provider.provide === OmniDocumentService,
|
|
179
|
+
),
|
|
180
|
+
).toBe(true);
|
|
181
|
+
expect(
|
|
182
|
+
externalRef.providers.some(
|
|
183
|
+
(provider) =>
|
|
184
|
+
typeof provider === 'object' &&
|
|
185
|
+
provider !== null &&
|
|
186
|
+
'provide' in provider &&
|
|
187
|
+
provider.provide === OmniExternalRefService,
|
|
188
|
+
),
|
|
189
|
+
).toBe(true);
|
|
190
|
+
expect(OmniCollectionEntity).toBe(omnikernelPublicApi.OmniCollectionEntity);
|
|
191
|
+
expect(OmniDocumentEntity).toBe(omnikernelPublicApi.OmniDocumentEntity);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it('re-exports the documented OmniKernel surface from index.ts', () => {
|
|
195
|
+
expect(omnikernelPublicApi.OmniKernelModule).toBeDefined();
|
|
196
|
+
expect(omnikernelPublicApi.OmniNamedType).toBe(namedDto.OmniNamedType);
|
|
197
|
+
expect(omnikernelPublicApi.OmniRecordType).toBe(recordDto.OmniRecordType);
|
|
198
|
+
expect(omnikernelPublicApi.OmniCollectionType).toBe(
|
|
199
|
+
collectionDto.OmniCollectionType,
|
|
200
|
+
);
|
|
201
|
+
expect(omnikernelPublicApi.OmniRelationType).toBe(
|
|
202
|
+
relationDto.OmniRelationType,
|
|
203
|
+
);
|
|
204
|
+
expect(omnikernelPublicApi.OmniExternalRefType).toBe(
|
|
205
|
+
externalRefDto.OmniExternalRefType,
|
|
206
|
+
);
|
|
207
|
+
expect(omnikernelPublicApi.OmniDocumentType).toBe(
|
|
208
|
+
documentDto.OmniDocumentType,
|
|
209
|
+
);
|
|
210
|
+
expect(omnikernelPublicApi.omniDocumentBackendProvidersFactory).toBe(
|
|
211
|
+
omniDocumentBackendProvidersFactory,
|
|
212
|
+
);
|
|
213
|
+
expect(omnikernelPublicApi.omniCollectionBackendProvidersFactory).toBe(
|
|
214
|
+
omniCollectionBackendProvidersFactory,
|
|
215
|
+
);
|
|
216
|
+
expect(omnikernelPublicApi.omniNamedBackendProvidersFactory).toBe(
|
|
217
|
+
omniNamedBackendProvidersFactory,
|
|
218
|
+
);
|
|
219
|
+
expect(omnikernelPublicApi.omniRecordBackendProvidersFactory).toBe(
|
|
220
|
+
omniRecordBackendProvidersFactory,
|
|
221
|
+
);
|
|
222
|
+
expect(omnikernelPublicApi.omniRelationBackendProvidersFactory).toBe(
|
|
223
|
+
omniRelationBackendProvidersFactory,
|
|
224
|
+
);
|
|
225
|
+
expect(omnikernelPublicApi.omniExternalRefBackendProvidersFactory).toBe(
|
|
226
|
+
omniExternalRefBackendProvidersFactory,
|
|
227
|
+
);
|
|
228
|
+
expect(omnikernelPublicApi.isAllowedOmniRelation).toBe(
|
|
229
|
+
relationSemantics.isAllowedOmniRelation,
|
|
230
|
+
);
|
|
231
|
+
expect(omnikernelPublicApi.OmniExternalRefInternalType).toBe(
|
|
232
|
+
OmniExternalRefInternalType,
|
|
233
|
+
);
|
|
234
|
+
expect(omnikernelPublicApi.OmniKernelQueryService).toBe(
|
|
235
|
+
OmniKernelQueryService,
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
});
|