@x12i/memorix-client-api 0.0.0-stage → 0.16.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/HANDOVER.md +97 -0
- package/dist/app.d.ts +64 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +412 -0
- package/dist/app.js.map +1 -0
- package/dist/authix.d.ts +9 -0
- package/dist/authix.d.ts.map +1 -0
- package/dist/authix.js +26 -0
- package/dist/authix.js.map +1 -0
- package/dist/catalog.d.ts +160 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +371 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +102 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +109 -0
- package/dist/config.js.map +1 -0
- package/dist/derived.d.ts +2 -0
- package/dist/derived.d.ts.map +1 -0
- package/dist/derived.js +35 -0
- package/dist/derived.js.map +1 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +21 -0
- package/dist/errors.js.map +1 -0
- package/dist/fetch.d.ts +17 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/fetch.js +741 -0
- package/dist/fetch.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/live-ops-nav.d.ts +2 -0
- package/dist/live-ops-nav.d.ts.map +1 -0
- package/dist/live-ops-nav.js +42 -0
- package/dist/live-ops-nav.js.map +1 -0
- package/dist/live.d.ts +20 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +8 -0
- package/dist/live.js.map +1 -0
- package/dist/markdown.d.ts +19 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +102 -0
- package/dist/markdown.js.map +1 -0
- package/dist/peers.d.ts +51 -0
- package/dist/peers.d.ts.map +1 -0
- package/dist/peers.js +127 -0
- package/dist/peers.js.map +1 -0
- package/dist/processed.d.ts +22 -0
- package/dist/processed.d.ts.map +1 -0
- package/dist/processed.js +397 -0
- package/dist/processed.js.map +1 -0
- package/dist/project.d.ts +25 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +76 -0
- package/dist/project.js.map +1 -0
- package/dist/reads-live-routes.d.ts +4 -0
- package/dist/reads-live-routes.d.ts.map +1 -0
- package/dist/reads-live-routes.js +56 -0
- package/dist/reads-live-routes.js.map +1 -0
- package/dist/reads-live-ui.d.ts +3 -0
- package/dist/reads-live-ui.d.ts.map +1 -0
- package/dist/reads-live-ui.js +204 -0
- package/dist/reads-live-ui.js.map +1 -0
- package/dist/reads-ring.d.ts +29 -0
- package/dist/reads-ring.d.ts.map +1 -0
- package/dist/reads-ring.js +44 -0
- package/dist/reads-ring.js.map +1 -0
- package/dist/refs.d.ts +24 -0
- package/dist/refs.d.ts.map +1 -0
- package/dist/refs.js +354 -0
- package/dist/refs.js.map +1 -0
- package/dist/request-countex.d.ts +53 -0
- package/dist/request-countex.d.ts.map +1 -0
- package/dist/request-countex.js +171 -0
- package/dist/request-countex.js.map +1 -0
- package/dist/scope.d.ts +13 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +46 -0
- package/dist/scope.js.map +1 -0
- package/dist/scoper.d.ts +75 -0
- package/dist/scoper.d.ts.map +1 -0
- package/dist/scoper.js +475 -0
- package/dist/scoper.js.map +1 -0
- package/dist/shaped-refs.d.ts +23 -0
- package/dist/shaped-refs.d.ts.map +1 -0
- package/dist/shaped-refs.js +395 -0
- package/dist/shaped-refs.js.map +1 -0
- package/dist/skills.d.ts +102 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +609 -0
- package/dist/skills.js.map +1 -0
- package/dist/story.d.ts +43 -0
- package/dist/story.d.ts.map +1 -0
- package/dist/story.js +121 -0
- package/dist/story.js.map +1 -0
- package/dist/upstream.d.ts +13 -0
- package/dist/upstream.d.ts.map +1 -0
- package/dist/upstream.js +58 -0
- package/dist/upstream.js.map +1 -0
- package/openapi/openapi.json +480 -0
- package/package.json +60 -6
- package/README.md +0 -3
package/dist/authix.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export async function createAuthixOrgResolver(env = process.env) {
|
|
2
|
+
const appId = env.AUTHIX_APP_ID?.trim();
|
|
3
|
+
const appSecretKey = env.AUTHIX_APP_SECRET_KEY?.trim();
|
|
4
|
+
if (!appId || !appSecretKey) {
|
|
5
|
+
throw new Error("AUTHIX_APP_ID and AUTHIX_APP_SECRET_KEY are required when MEMORIX_AUTH=authix");
|
|
6
|
+
}
|
|
7
|
+
const specifier = "@x12i/authix-sdk";
|
|
8
|
+
const sdk = (await import(specifier));
|
|
9
|
+
const audience = env.AUTHIX_AUDIENCE?.split(",").map((item) => item.trim()).filter(Boolean);
|
|
10
|
+
const verifier = sdk.createAuthixTokenVerifier({
|
|
11
|
+
appId,
|
|
12
|
+
appSecretKey,
|
|
13
|
+
issuer: env.AUTHIX_ISSUER?.trim() || undefined,
|
|
14
|
+
introspectUrl: env.AUTHIX_INTROSPECT_URL?.trim() || undefined,
|
|
15
|
+
apiKey: env.AUTHIX_API_KEY?.trim() || undefined,
|
|
16
|
+
audience: audience && audience.length > 0 ? audience : undefined,
|
|
17
|
+
});
|
|
18
|
+
return async (token) => {
|
|
19
|
+
const payload = await verifier.assertValid(token);
|
|
20
|
+
return { organizationIds: payload.scope?.organizationIds ?? [] };
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function authLabel(mode) {
|
|
24
|
+
return mode === "authix" ? "authix" : "header";
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=authix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authix.js","sourceRoot":"","sources":["../src/authix.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,KAAK,UAAU,u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AAED,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
export type FieldShape = {
|
|
2
|
+
name: string;
|
|
3
|
+
grammar: string;
|
|
4
|
+
sourceProperty?: string;
|
|
5
|
+
resolvesTo: {
|
|
6
|
+
objectType: string;
|
|
7
|
+
contentTypes: string[];
|
|
8
|
+
/** `value`, `paired-<sourceProperty>`, or a record id template containing `{value}`. */
|
|
9
|
+
recordId: string;
|
|
10
|
+
matchProperty?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type FieldView = {
|
|
14
|
+
path: string;
|
|
15
|
+
valueType: string;
|
|
16
|
+
enum?: string[];
|
|
17
|
+
mixed?: boolean;
|
|
18
|
+
shapes?: FieldShape[];
|
|
19
|
+
refersTo?: {
|
|
20
|
+
objectType: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** Who writes records of a content type or discriminator value. Display metadata only. */
|
|
24
|
+
export type OriginView = {
|
|
25
|
+
producer: "model" | "code" | "mixed";
|
|
26
|
+
/** Model values only. `always` calls a model when it has usable input; `conditional` may finish without one. */
|
|
27
|
+
use?: "always" | "conditional";
|
|
28
|
+
/** Path on the stored record that holds the per-record outcome, for example `data.aiExecution`. */
|
|
29
|
+
record?: string;
|
|
30
|
+
};
|
|
31
|
+
export type PresentationValueView = {
|
|
32
|
+
value: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
order?: number;
|
|
35
|
+
origin?: OriginView;
|
|
36
|
+
};
|
|
37
|
+
export type PresentationView = {
|
|
38
|
+
label?: string;
|
|
39
|
+
order?: number;
|
|
40
|
+
/** `always` shows the tab; `whenPresent` only when the subject has a record; `hidden` never. */
|
|
41
|
+
tab?: "always" | "whenPresent" | "hidden";
|
|
42
|
+
values?: PresentationValueView[];
|
|
43
|
+
};
|
|
44
|
+
export type FieldMappingProfileView = {
|
|
45
|
+
id: string;
|
|
46
|
+
format: "memorix-field-map/1";
|
|
47
|
+
namespace: string;
|
|
48
|
+
discriminatorValue?: string;
|
|
49
|
+
fieldMap: {
|
|
50
|
+
fields: unknown[];
|
|
51
|
+
};
|
|
52
|
+
standingRules?: unknown[];
|
|
53
|
+
requiresCapabilities?: string[];
|
|
54
|
+
provenance?: Record<string, unknown>;
|
|
55
|
+
};
|
|
56
|
+
/** What a delete does. Omitted means tracked, and the removed body is not kept. */
|
|
57
|
+
export type ContentDeletionView = {
|
|
58
|
+
mode: "logical" | "tracked" | "untracked";
|
|
59
|
+
/** Tracked deletes only. The ledger entry keeps the removed body. */
|
|
60
|
+
keepBody?: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type ContentTypeView = {
|
|
63
|
+
id: string;
|
|
64
|
+
required: boolean;
|
|
65
|
+
leading: boolean;
|
|
66
|
+
described: boolean;
|
|
67
|
+
/** Processing result stored on the subject. Source content is false. */
|
|
68
|
+
derived: boolean;
|
|
69
|
+
discriminator?: {
|
|
70
|
+
path: string;
|
|
71
|
+
required?: boolean;
|
|
72
|
+
defaultValue?: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Caller allowed to write this address. A string owns every discriminator value.
|
|
76
|
+
* A map owns one value each (`""` when the content type has none).
|
|
77
|
+
* Absent means any caller may write.
|
|
78
|
+
*/
|
|
79
|
+
writer?: string | Record<string, string>;
|
|
80
|
+
/** `_metadata` keys returned only to the caller that wrote the row. */
|
|
81
|
+
privateMetadata?: string[];
|
|
82
|
+
/** Delete policy from `profile.deletion`. Absent means tracked without a body. */
|
|
83
|
+
deletion?: ContentDeletionView;
|
|
84
|
+
/** Tab presentation stamped by the pack. Absent when the pack has not stamped it. */
|
|
85
|
+
presentation?: PresentationView;
|
|
86
|
+
/** Roll-up origin of the content type. Absent for source data. */
|
|
87
|
+
origin?: OriginView;
|
|
88
|
+
fields: FieldView[];
|
|
89
|
+
/** Assistant-published field presentation. Absent when no profile was published. */
|
|
90
|
+
fieldMappings?: FieldMappingProfileView[];
|
|
91
|
+
};
|
|
92
|
+
/** One read a function uses. Every field is optional. */
|
|
93
|
+
export type FunctionReadView = {
|
|
94
|
+
objectType?: string;
|
|
95
|
+
contentType?: string;
|
|
96
|
+
recordId?: string;
|
|
97
|
+
/** Story template id. The same string as `data.template`. */
|
|
98
|
+
template?: string;
|
|
99
|
+
sameSubject?: boolean;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* One question an object type can answer. `template` is the story discriminator,
|
|
103
|
+
* the same value as `data.template` and as `presentation.values[].value` on content type `story`.
|
|
104
|
+
*/
|
|
105
|
+
export type ObjectTypeFunctionView = {
|
|
106
|
+
id: string;
|
|
107
|
+
question: string;
|
|
108
|
+
page: string;
|
|
109
|
+
composes: boolean;
|
|
110
|
+
pageStory: boolean;
|
|
111
|
+
reads: FunctionReadView[];
|
|
112
|
+
template?: string;
|
|
113
|
+
kind?: "spine" | "threads";
|
|
114
|
+
};
|
|
115
|
+
export type ObjectTypeView = {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
dataCategory: string;
|
|
119
|
+
leadingContentType: string | null;
|
|
120
|
+
leadingSource: "metadata" | "default";
|
|
121
|
+
contentTypes: ContentTypeView[];
|
|
122
|
+
/** Questions, page stories, and story templates for this object type. Absent when the pack has none. */
|
|
123
|
+
functions?: ObjectTypeFunctionView[];
|
|
124
|
+
};
|
|
125
|
+
type RawField = {
|
|
126
|
+
path: string;
|
|
127
|
+
valueType: string;
|
|
128
|
+
contentType?: string;
|
|
129
|
+
enum?: string[];
|
|
130
|
+
mixed?: boolean;
|
|
131
|
+
shapes?: FieldShape[];
|
|
132
|
+
refersTo?: {
|
|
133
|
+
objectType: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
type RawContentType = {
|
|
137
|
+
id: string;
|
|
138
|
+
required?: boolean;
|
|
139
|
+
leading?: boolean;
|
|
140
|
+
/** Set only when metadata says so. Absent means the platform list decides. */
|
|
141
|
+
derived?: boolean;
|
|
142
|
+
discriminator?: ContentTypeView["discriminator"];
|
|
143
|
+
writer?: ContentTypeView["writer"];
|
|
144
|
+
privateMetadata?: string[];
|
|
145
|
+
deletion?: ContentDeletionView;
|
|
146
|
+
presentation?: PresentationView;
|
|
147
|
+
origin?: OriginView;
|
|
148
|
+
fieldMappings?: FieldMappingProfileView[];
|
|
149
|
+
};
|
|
150
|
+
export declare function fieldsForContentType(fields: RawField[], contentType: string): FieldView[];
|
|
151
|
+
export declare function chooseLeading(contentTypes: RawContentType[]): {
|
|
152
|
+
id: string | null;
|
|
153
|
+
source: "metadata" | "default";
|
|
154
|
+
};
|
|
155
|
+
/** Parse `GET /api/metadata/kinds/object-types`. */
|
|
156
|
+
export declare function catalogFromKinds(body: unknown): ObjectTypeView[];
|
|
157
|
+
export declare function findObjectType(catalog: ObjectTypeView[], objectType: string): ObjectTypeView | null;
|
|
158
|
+
export declare function findContentType(objectType: ObjectTypeView, contentType: string): ContentTypeView | null;
|
|
159
|
+
export {};
|
|
160
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,wFAAwF;QACxF,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IACl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M,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAC3C,CAAC;AA6PF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,CAWzF;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,cAAc,EAAE,GAAG;IAC7D,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;CAChC,CAMA;AAwCD,oDAAoD;AACpD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,EAAE,CAYhE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAEnG;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,cAAc,EAC1B,WAAW,EAAE,MAAM,GAClB,eAAe,GAAG,IAAI,CAExB"}
|
package/dist/catalog.js
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { contentTypeIsDerived } from "./derived.js";
|
|
2
|
+
function isRecord(value) {
|
|
3
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function fieldOf(raw) {
|
|
6
|
+
if (!isRecord(raw) || typeof raw.path !== "string" || typeof raw.valueType !== "string") {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const field = { path: raw.path, valueType: raw.valueType };
|
|
10
|
+
if (typeof raw.contentType === "string" && raw.contentType)
|
|
11
|
+
field.contentType = raw.contentType;
|
|
12
|
+
if (Array.isArray(raw.enum) && raw.enum.every((item) => typeof item === "string")) {
|
|
13
|
+
field.enum = raw.enum;
|
|
14
|
+
}
|
|
15
|
+
const shapes = shapesOf(raw);
|
|
16
|
+
if (shapes)
|
|
17
|
+
field.shapes = shapes;
|
|
18
|
+
if (raw.mixed === true)
|
|
19
|
+
field.mixed = true;
|
|
20
|
+
const refers = isRecord(raw.refersTo) ? raw.refersTo : null;
|
|
21
|
+
if (refers && typeof refers.objectType === "string" && refers.objectType) {
|
|
22
|
+
field.refersTo = { objectType: refers.objectType };
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const fromShapes = directRefObjectType(shapes);
|
|
26
|
+
if (fromShapes)
|
|
27
|
+
field.refersTo = fromShapes;
|
|
28
|
+
}
|
|
29
|
+
return field;
|
|
30
|
+
}
|
|
31
|
+
function shapesOf(raw) {
|
|
32
|
+
if (!Array.isArray(raw.shapes))
|
|
33
|
+
return undefined;
|
|
34
|
+
const shapes = [];
|
|
35
|
+
for (const item of raw.shapes) {
|
|
36
|
+
if (!isRecord(item) || typeof item.name !== "string" || !item.name)
|
|
37
|
+
continue;
|
|
38
|
+
if (typeof item.grammar !== "string" || !item.grammar)
|
|
39
|
+
continue;
|
|
40
|
+
const resolves = isRecord(item.resolvesTo) ? item.resolvesTo : null;
|
|
41
|
+
if (!resolves || typeof resolves.objectType !== "string" || !resolves.objectType)
|
|
42
|
+
continue;
|
|
43
|
+
if (typeof resolves.recordId !== "string" || !resolves.recordId)
|
|
44
|
+
continue;
|
|
45
|
+
const contentTypes = Array.isArray(resolves.contentTypes)
|
|
46
|
+
? resolves.contentTypes.filter((id) => typeof id === "string" && id.length > 0)
|
|
47
|
+
: [];
|
|
48
|
+
shapes.push({
|
|
49
|
+
name: item.name,
|
|
50
|
+
grammar: item.grammar,
|
|
51
|
+
...(typeof item.sourceProperty === "string" && item.sourceProperty
|
|
52
|
+
? { sourceProperty: item.sourceProperty }
|
|
53
|
+
: {}),
|
|
54
|
+
resolvesTo: {
|
|
55
|
+
objectType: resolves.objectType,
|
|
56
|
+
contentTypes: contentTypes.filter((id) => id !== "relationships"),
|
|
57
|
+
recordId: resolves.recordId,
|
|
58
|
+
...(typeof resolves.matchProperty === "string" && resolves.matchProperty
|
|
59
|
+
? { matchProperty: resolves.matchProperty }
|
|
60
|
+
: {}),
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return shapes.length > 0 ? shapes : undefined;
|
|
65
|
+
}
|
|
66
|
+
/** Object type shared by shapes whose stored string is the record id. */
|
|
67
|
+
function directRefObjectType(shapes) {
|
|
68
|
+
if (!shapes)
|
|
69
|
+
return undefined;
|
|
70
|
+
const types = new Set(shapes.filter((shape) => shape.resolvesTo.recordId === "value").map((shape) => shape.resolvesTo.objectType));
|
|
71
|
+
if (types.size !== 1)
|
|
72
|
+
return undefined;
|
|
73
|
+
return { objectType: [...types][0] };
|
|
74
|
+
}
|
|
75
|
+
function explicitDerived(raw) {
|
|
76
|
+
if (typeof raw.derived === "boolean")
|
|
77
|
+
return raw.derived;
|
|
78
|
+
if (isRecord(raw.profile) && typeof raw.profile.derived === "boolean")
|
|
79
|
+
return raw.profile.derived;
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
function originOf(raw) {
|
|
83
|
+
if (!isRecord(raw))
|
|
84
|
+
return undefined;
|
|
85
|
+
const producer = raw.producer;
|
|
86
|
+
if (producer !== "model" && producer !== "code" && producer !== "mixed")
|
|
87
|
+
return undefined;
|
|
88
|
+
return {
|
|
89
|
+
producer,
|
|
90
|
+
...(raw.use === "always" || raw.use === "conditional" ? { use: raw.use } : {}),
|
|
91
|
+
...(typeof raw.record === "string" && raw.record ? { record: raw.record } : {}),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function finiteOrder(raw) {
|
|
95
|
+
return typeof raw === "number" && Number.isFinite(raw) ? raw : undefined;
|
|
96
|
+
}
|
|
97
|
+
function presentationOf(raw) {
|
|
98
|
+
if (!isRecord(raw))
|
|
99
|
+
return undefined;
|
|
100
|
+
const out = {};
|
|
101
|
+
if (typeof raw.label === "string" && raw.label)
|
|
102
|
+
out.label = raw.label;
|
|
103
|
+
const order = finiteOrder(raw.order);
|
|
104
|
+
if (order !== undefined)
|
|
105
|
+
out.order = order;
|
|
106
|
+
if (raw.tab === "always" || raw.tab === "whenPresent" || raw.tab === "hidden")
|
|
107
|
+
out.tab = raw.tab;
|
|
108
|
+
if (Array.isArray(raw.values)) {
|
|
109
|
+
const values = [];
|
|
110
|
+
for (const item of raw.values) {
|
|
111
|
+
if (!isRecord(item) || typeof item.value !== "string" || !item.value)
|
|
112
|
+
continue;
|
|
113
|
+
const origin = originOf(item.origin);
|
|
114
|
+
const itemOrder = finiteOrder(item.order);
|
|
115
|
+
values.push({
|
|
116
|
+
value: item.value,
|
|
117
|
+
...(typeof item.label === "string" && item.label ? { label: item.label } : {}),
|
|
118
|
+
...(itemOrder !== undefined ? { order: itemOrder } : {}),
|
|
119
|
+
...(origin ? { origin } : {}),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (values.length > 0)
|
|
123
|
+
out.values = values;
|
|
124
|
+
}
|
|
125
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
126
|
+
}
|
|
127
|
+
function fieldMappingsOf(raw) {
|
|
128
|
+
if (!Array.isArray(raw))
|
|
129
|
+
return undefined;
|
|
130
|
+
const profiles = [];
|
|
131
|
+
for (const item of raw) {
|
|
132
|
+
if (!isRecord(item))
|
|
133
|
+
continue;
|
|
134
|
+
if (item.format !== "memorix-field-map/1")
|
|
135
|
+
continue;
|
|
136
|
+
if (typeof item.id !== "string" || typeof item.namespace !== "string")
|
|
137
|
+
continue;
|
|
138
|
+
if (!isRecord(item.fieldMap) || !Array.isArray(item.fieldMap.fields))
|
|
139
|
+
continue;
|
|
140
|
+
profiles.push({
|
|
141
|
+
id: item.id,
|
|
142
|
+
format: "memorix-field-map/1",
|
|
143
|
+
namespace: item.namespace,
|
|
144
|
+
...(typeof item.discriminatorValue === "string" ? { discriminatorValue: item.discriminatorValue } : {}),
|
|
145
|
+
fieldMap: { fields: item.fieldMap.fields },
|
|
146
|
+
...(Array.isArray(item.standingRules) ? { standingRules: item.standingRules } : {}),
|
|
147
|
+
...(Array.isArray(item.requiresCapabilities)
|
|
148
|
+
? { requiresCapabilities: item.requiresCapabilities.filter((entry) => typeof entry === "string") }
|
|
149
|
+
: {}),
|
|
150
|
+
...(isRecord(item.provenance) ? { provenance: item.provenance } : {}),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return profiles.length > 0 ? profiles : undefined;
|
|
154
|
+
}
|
|
155
|
+
function optionalText(raw) {
|
|
156
|
+
return typeof raw === "string" && raw ? raw : undefined;
|
|
157
|
+
}
|
|
158
|
+
function functionReadOf(raw) {
|
|
159
|
+
if (!isRecord(raw))
|
|
160
|
+
return null;
|
|
161
|
+
const read = {};
|
|
162
|
+
const objectType = optionalText(raw.objectType);
|
|
163
|
+
const contentType = optionalText(raw.contentType);
|
|
164
|
+
const recordId = optionalText(raw.recordId);
|
|
165
|
+
const template = optionalText(raw.template);
|
|
166
|
+
if (objectType)
|
|
167
|
+
read.objectType = objectType;
|
|
168
|
+
if (contentType)
|
|
169
|
+
read.contentType = contentType;
|
|
170
|
+
if (recordId)
|
|
171
|
+
read.recordId = recordId;
|
|
172
|
+
if (template)
|
|
173
|
+
read.template = template;
|
|
174
|
+
if (typeof raw.sameSubject === "boolean")
|
|
175
|
+
read.sameSubject = raw.sameSubject;
|
|
176
|
+
return Object.keys(read).length > 0 ? read : null;
|
|
177
|
+
}
|
|
178
|
+
function functionOf(raw) {
|
|
179
|
+
if (!isRecord(raw))
|
|
180
|
+
return null;
|
|
181
|
+
const id = optionalText(raw.id);
|
|
182
|
+
const question = optionalText(raw.question);
|
|
183
|
+
const page = optionalText(raw.page);
|
|
184
|
+
if (!id || !question || !page)
|
|
185
|
+
return null;
|
|
186
|
+
if (typeof raw.composes !== "boolean" || typeof raw.pageStory !== "boolean")
|
|
187
|
+
return null;
|
|
188
|
+
if (!Array.isArray(raw.reads))
|
|
189
|
+
return null;
|
|
190
|
+
const template = optionalText(raw.template);
|
|
191
|
+
const kind = raw.kind === "spine" || raw.kind === "threads" ? raw.kind : undefined;
|
|
192
|
+
return {
|
|
193
|
+
id,
|
|
194
|
+
question,
|
|
195
|
+
page,
|
|
196
|
+
composes: raw.composes,
|
|
197
|
+
pageStory: raw.pageStory,
|
|
198
|
+
reads: raw.reads.map(functionReadOf).filter((item) => item !== null),
|
|
199
|
+
...(template ? { template } : {}),
|
|
200
|
+
...(kind ? { kind } : {}),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function functionsOf(raw) {
|
|
204
|
+
if (!Array.isArray(raw))
|
|
205
|
+
return undefined;
|
|
206
|
+
const functions = raw.map(functionOf).filter((item) => item !== null);
|
|
207
|
+
return functions.length > 0 ? functions : undefined;
|
|
208
|
+
}
|
|
209
|
+
function writerOf(raw) {
|
|
210
|
+
if (typeof raw === "string" && raw.trim())
|
|
211
|
+
return raw.trim();
|
|
212
|
+
if (!isRecord(raw))
|
|
213
|
+
return undefined;
|
|
214
|
+
const writer = {};
|
|
215
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
216
|
+
if (typeof value !== "string" || !value.trim())
|
|
217
|
+
continue;
|
|
218
|
+
if (key !== "" && !key.trim())
|
|
219
|
+
continue;
|
|
220
|
+
writer[key] = value.trim();
|
|
221
|
+
}
|
|
222
|
+
return Object.keys(writer).length > 0 ? writer : undefined;
|
|
223
|
+
}
|
|
224
|
+
function privateMetadataOf(raw) {
|
|
225
|
+
if (!Array.isArray(raw))
|
|
226
|
+
return undefined;
|
|
227
|
+
const keys = [];
|
|
228
|
+
for (const item of raw) {
|
|
229
|
+
if (typeof item !== "string" || !item.trim())
|
|
230
|
+
continue;
|
|
231
|
+
const key = item.trim();
|
|
232
|
+
if (!keys.includes(key))
|
|
233
|
+
keys.push(key);
|
|
234
|
+
}
|
|
235
|
+
return keys.length > 0 ? keys : undefined;
|
|
236
|
+
}
|
|
237
|
+
function deletionOf(raw) {
|
|
238
|
+
if (!isRecord(raw))
|
|
239
|
+
return undefined;
|
|
240
|
+
const profile = isRecord(raw.profile) ? raw.profile : null;
|
|
241
|
+
const deletion = profile && isRecord(profile.deletion) ? profile.deletion : null;
|
|
242
|
+
if (!deletion)
|
|
243
|
+
return undefined;
|
|
244
|
+
const mode = deletion.mode;
|
|
245
|
+
if (mode !== "logical" && mode !== "tracked" && mode !== "untracked")
|
|
246
|
+
return undefined;
|
|
247
|
+
return {
|
|
248
|
+
mode,
|
|
249
|
+
...(deletion.keepBody === true ? { keepBody: true } : {}),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function contentTypeOf(raw) {
|
|
253
|
+
if (!isRecord(raw) || typeof raw.id !== "string" || !raw.id)
|
|
254
|
+
return null;
|
|
255
|
+
const ct = { id: raw.id };
|
|
256
|
+
if (raw.required === true)
|
|
257
|
+
ct.required = true;
|
|
258
|
+
if (raw.leading === true)
|
|
259
|
+
ct.leading = true;
|
|
260
|
+
const explicit = explicitDerived(raw);
|
|
261
|
+
if (explicit !== undefined)
|
|
262
|
+
ct.derived = explicit;
|
|
263
|
+
if (isRecord(raw.discriminator) && typeof raw.discriminator.path === "string") {
|
|
264
|
+
ct.discriminator = {
|
|
265
|
+
path: raw.discriminator.path,
|
|
266
|
+
...(raw.discriminator.required === true ? { required: true } : {}),
|
|
267
|
+
...(typeof raw.discriminator.defaultValue === "string"
|
|
268
|
+
? { defaultValue: raw.discriminator.defaultValue }
|
|
269
|
+
: {}),
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
const writer = writerOf(raw.writer);
|
|
273
|
+
if (writer)
|
|
274
|
+
ct.writer = writer;
|
|
275
|
+
const privateMetadata = privateMetadataOf(raw.privateMetadata);
|
|
276
|
+
if (privateMetadata)
|
|
277
|
+
ct.privateMetadata = privateMetadata;
|
|
278
|
+
const deletion = deletionOf(raw);
|
|
279
|
+
if (deletion)
|
|
280
|
+
ct.deletion = deletion;
|
|
281
|
+
const presentation = presentationOf(raw.presentation);
|
|
282
|
+
if (presentation)
|
|
283
|
+
ct.presentation = presentation;
|
|
284
|
+
const origin = originOf(raw.origin);
|
|
285
|
+
if (origin)
|
|
286
|
+
ct.origin = origin;
|
|
287
|
+
const fieldMappings = fieldMappingsOf(raw.fieldMappings);
|
|
288
|
+
if (fieldMappings)
|
|
289
|
+
ct.fieldMappings = fieldMappings;
|
|
290
|
+
return ct;
|
|
291
|
+
}
|
|
292
|
+
export function fieldsForContentType(fields, contentType) {
|
|
293
|
+
return fields
|
|
294
|
+
.filter((field) => field.contentType === undefined || field.contentType === contentType)
|
|
295
|
+
.map((field) => ({
|
|
296
|
+
path: field.path,
|
|
297
|
+
valueType: field.valueType,
|
|
298
|
+
...(field.enum ? { enum: field.enum } : {}),
|
|
299
|
+
...(field.mixed ? { mixed: true } : {}),
|
|
300
|
+
...(field.shapes ? { shapes: field.shapes } : {}),
|
|
301
|
+
...(field.refersTo ? { refersTo: field.refersTo } : {}),
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
export function chooseLeading(contentTypes) {
|
|
305
|
+
const marked = contentTypes.find((ct) => ct.leading);
|
|
306
|
+
if (marked)
|
|
307
|
+
return { id: marked.id, source: "metadata" };
|
|
308
|
+
const fallback = contentTypes.find((ct) => ct.id !== "relationships") ?? contentTypes[0] ?? null;
|
|
309
|
+
return { id: fallback?.id ?? null, source: "default" };
|
|
310
|
+
}
|
|
311
|
+
function objectTypeFromDefinition(definition, fallbackId) {
|
|
312
|
+
const id = typeof definition.id === "string" && definition.id ? definition.id : fallbackId;
|
|
313
|
+
if (!id)
|
|
314
|
+
return null;
|
|
315
|
+
const rawTypes = Array.isArray(definition.contentTypes) ? definition.contentTypes : [];
|
|
316
|
+
const contentTypes = rawTypes.map(contentTypeOf).filter((ct) => ct !== null);
|
|
317
|
+
const fields = (Array.isArray(definition.fields) ? definition.fields : [])
|
|
318
|
+
.map(fieldOf)
|
|
319
|
+
.filter((field) => field !== null);
|
|
320
|
+
const leading = chooseLeading(contentTypes);
|
|
321
|
+
const functions = functionsOf(definition.functions);
|
|
322
|
+
return {
|
|
323
|
+
id,
|
|
324
|
+
name: typeof definition.name === "string" && definition.name ? definition.name : id,
|
|
325
|
+
dataCategory: typeof definition.dataCategory === "string" ? definition.dataCategory : "",
|
|
326
|
+
leadingContentType: leading.id,
|
|
327
|
+
leadingSource: leading.source,
|
|
328
|
+
contentTypes: contentTypes.map((ct) => {
|
|
329
|
+
const ctFields = fieldsForContentType(fields, ct.id);
|
|
330
|
+
return {
|
|
331
|
+
id: ct.id,
|
|
332
|
+
required: ct.required === true,
|
|
333
|
+
leading: ct.id === leading.id,
|
|
334
|
+
described: ctFields.length > 0,
|
|
335
|
+
derived: contentTypeIsDerived(ct.id, ct.derived),
|
|
336
|
+
...(ct.discriminator ? { discriminator: ct.discriminator } : {}),
|
|
337
|
+
...(ct.writer ? { writer: ct.writer } : {}),
|
|
338
|
+
...(ct.privateMetadata ? { privateMetadata: ct.privateMetadata } : {}),
|
|
339
|
+
...(ct.deletion ? { deletion: ct.deletion } : {}),
|
|
340
|
+
...(ct.presentation ? { presentation: ct.presentation } : {}),
|
|
341
|
+
...(ct.origin ? { origin: ct.origin } : {}),
|
|
342
|
+
...(ct.fieldMappings ? { fieldMappings: ct.fieldMappings } : {}),
|
|
343
|
+
fields: ctFields,
|
|
344
|
+
};
|
|
345
|
+
}),
|
|
346
|
+
...(functions ? { functions } : {}),
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
/** Parse `GET /api/metadata/kinds/object-types`. */
|
|
350
|
+
export function catalogFromKinds(body) {
|
|
351
|
+
const root = isRecord(body) ? body : null;
|
|
352
|
+
const items = Array.isArray(root?.items) ? root.items : [];
|
|
353
|
+
const objectTypes = [];
|
|
354
|
+
for (const item of items) {
|
|
355
|
+
if (!isRecord(item))
|
|
356
|
+
continue;
|
|
357
|
+
const definition = isRecord(item.definition) ? item.definition : item;
|
|
358
|
+
const fallbackId = typeof item.id === "string" ? item.id : "";
|
|
359
|
+
const view = objectTypeFromDefinition(definition, fallbackId);
|
|
360
|
+
if (view)
|
|
361
|
+
objectTypes.push(view);
|
|
362
|
+
}
|
|
363
|
+
return objectTypes;
|
|
364
|
+
}
|
|
365
|
+
export function findObjectType(catalog, objectType) {
|
|
366
|
+
return catalog.find((item) => item.id === objectType) ?? null;
|
|
367
|
+
}
|
|
368
|
+
export function findContentType(objectType, contentType) {
|
|
369
|
+
return objectType.contentTypes.find((item) => item.id === contentType) ?? null;
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA8JpD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,OAAO,CAAC,GAAY;IAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;IACrE,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW;QAAE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IAChG,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,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