@x12i/reportic-catalog 0.2.0 → 0.2.3
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/dist/index.d.ts +154 -0
- package/dist/schema.d.ts +22 -0
- package/dist/types.d.ts +359 -0
- package/package.json +4 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { JsonSchema, StudioDiagnostic, Agent, DatasetDefinition, TemplateDocument, Fixture, DatasetSource, DatasetPlanRecord, DatasetRunRecord, DatasetResponseFixture, HostIdentity, Principal, Action, FieldDescriptor, SchemaVersion, AuthoringManifest, Analysis, Mapping } from './types.js';
|
|
2
|
+
export { ApprovedOperation, BindingInspection, Compatibility, DatasetAction, DatasetCount, DatasetCoverage, DatasetDiagnostic, DatasetObject, DatasetPlanSummary, DatasetPlanVersion, DatasetPrecision, DatasetProtocol, DatasetRunMetadata, DatasetScope, DatasetTrace, DatasetVerification, Presence, PublishedRevision, ReportAcquisition, RequestSlot, SchemaChange, SourceRevision, StudioAsset, datasetActions } from './types.js';
|
|
3
|
+
import { compatibility } from './schema.js';
|
|
4
|
+
export { ProjectionOptions, compareSchemas, fieldAt, inferSchema, isObject, jsonPointer, projectFields, resolveSchemaRef, safeInput, schemaTypes } from './schema.js';
|
|
5
|
+
import * as ajv from 'ajv';
|
|
6
|
+
import Ajv2020 from 'ajv/dist/2020.js';
|
|
7
|
+
import { ComponentDefinition } from '@x12i/reportic-core';
|
|
8
|
+
|
|
9
|
+
declare const canonicalJson: (value: any) => string;
|
|
10
|
+
declare const digest: (value: any) => string;
|
|
11
|
+
declare function schemaReferences(schema: any): string[];
|
|
12
|
+
declare function createSchemaValidator(schema: JsonSchema, registry?: Record<string, JsonSchema>): {
|
|
13
|
+
ajv: Ajv2020;
|
|
14
|
+
validate: ajv.ValidateFunction<unknown>;
|
|
15
|
+
};
|
|
16
|
+
declare function validateSchemaDocument(schema: any, registry?: Record<string, JsonSchema>): StudioDiagnostic[];
|
|
17
|
+
declare function validateSample(schema: JsonSchema, value: any, registry?: Record<string, JsonSchema>): {
|
|
18
|
+
valid: boolean;
|
|
19
|
+
diagnostics: StudioDiagnostic[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type AuditEvent = {
|
|
23
|
+
id: string;
|
|
24
|
+
at: string;
|
|
25
|
+
actor: string;
|
|
26
|
+
workspaceId: string;
|
|
27
|
+
agentId: string;
|
|
28
|
+
action: string;
|
|
29
|
+
resourceId: string;
|
|
30
|
+
detail?: Record<string, any>;
|
|
31
|
+
};
|
|
32
|
+
type CatalogState = {
|
|
33
|
+
version: 1;
|
|
34
|
+
agents: Agent[];
|
|
35
|
+
datasets: DatasetDefinition[];
|
|
36
|
+
templates: TemplateDocument[];
|
|
37
|
+
fixtures: Fixture[];
|
|
38
|
+
audit: AuditEvent[];
|
|
39
|
+
datasetSources?: DatasetSource[];
|
|
40
|
+
datasetPlans?: DatasetPlanRecord[];
|
|
41
|
+
datasetRuns?: DatasetRunRecord[];
|
|
42
|
+
datasetResponseFixtures?: DatasetResponseFixture[];
|
|
43
|
+
};
|
|
44
|
+
interface CatalogStorage {
|
|
45
|
+
read(): Promise<CatalogState>;
|
|
46
|
+
transaction<T>(work: (state: CatalogState) => T | Promise<T>): Promise<T>;
|
|
47
|
+
}
|
|
48
|
+
declare const emptyState: () => CatalogState;
|
|
49
|
+
declare class MemoryCatalogStorage implements CatalogStorage {
|
|
50
|
+
private state;
|
|
51
|
+
private pending;
|
|
52
|
+
constructor(seed?: CatalogState);
|
|
53
|
+
read(): Promise<CatalogState>;
|
|
54
|
+
transaction<T>(work: (state: CatalogState) => T | Promise<T>): Promise<T>;
|
|
55
|
+
}
|
|
56
|
+
declare class FileCatalogStorage implements CatalogStorage {
|
|
57
|
+
readonly filename: string;
|
|
58
|
+
private pending;
|
|
59
|
+
constructor(filename: string);
|
|
60
|
+
read(): Promise<CatalogState>;
|
|
61
|
+
private load;
|
|
62
|
+
transaction<T>(work: (state: CatalogState) => T | Promise<T>): Promise<T>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare class CatalogError extends Error {
|
|
66
|
+
code: string;
|
|
67
|
+
status: number;
|
|
68
|
+
details?: any | undefined;
|
|
69
|
+
constructor(code: string, message: string, status?: number, details?: any | undefined);
|
|
70
|
+
}
|
|
71
|
+
declare function assertName(name: any): void;
|
|
72
|
+
declare const scopeMatch: (v: {
|
|
73
|
+
workspaceId: string;
|
|
74
|
+
agentId: string;
|
|
75
|
+
}, p: Principal, agentId: string) => boolean;
|
|
76
|
+
declare function audit(state: CatalogState, p: Principal, agentId: string, action: string, resourceId: string, detail?: any): void;
|
|
77
|
+
declare const manifestFor: (agentId: string) => AuthoringManifest;
|
|
78
|
+
declare function publishDatasetSchema(state: CatalogState, actor: Principal, dataset: DatasetDefinition, expectedRevision: number, registry: Record<string, Record<string, unknown>>): SchemaVersion;
|
|
79
|
+
declare class CatalogService {
|
|
80
|
+
storage: CatalogStorage;
|
|
81
|
+
identity: HostIdentity;
|
|
82
|
+
constructor(storage: CatalogStorage, identity: HostIdentity);
|
|
83
|
+
authorize(principal: Principal, agentId: string, action: Action): Promise<Agent>;
|
|
84
|
+
agents(p: Principal): Promise<Agent[]>;
|
|
85
|
+
registry(p: Principal, agentId: string): Promise<Record<string, any>>;
|
|
86
|
+
registryFrom(state: CatalogState, p: Principal, agentId: string): Record<string, any>;
|
|
87
|
+
listDatasets(p: Principal, agentId: string, search?: string, includeArchived?: boolean): Promise<DatasetDefinition[]>;
|
|
88
|
+
getDataset(p: Principal, agentId: string, id: string): Promise<DatasetDefinition>;
|
|
89
|
+
createDataset(p: Principal, agentId: string, input: any): Promise<DatasetDefinition>;
|
|
90
|
+
saveDataset(p: Principal, agentId: string, id: string, input: any): Promise<DatasetDefinition>;
|
|
91
|
+
checkDataset(p: Principal, agentId: string, id: string, sample?: any): Promise<{
|
|
92
|
+
valid: boolean;
|
|
93
|
+
diagnostics: {
|
|
94
|
+
code: string;
|
|
95
|
+
severity: string;
|
|
96
|
+
phase: string;
|
|
97
|
+
message: string;
|
|
98
|
+
}[];
|
|
99
|
+
fields: never[];
|
|
100
|
+
sample?: undefined;
|
|
101
|
+
} | {
|
|
102
|
+
valid: boolean;
|
|
103
|
+
diagnostics: StudioDiagnostic[];
|
|
104
|
+
fields: FieldDescriptor[];
|
|
105
|
+
sample: {
|
|
106
|
+
valid: boolean;
|
|
107
|
+
diagnostics: StudioDiagnostic[];
|
|
108
|
+
} | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
publishDataset(p: Principal, agentId: string, id: string, expectedRevision: number): Promise<{
|
|
111
|
+
dataset: DatasetDefinition;
|
|
112
|
+
version: SchemaVersion;
|
|
113
|
+
}>;
|
|
114
|
+
setLifecycle(p: Principal, agentId: string, id: string, status: any, expectedRevision: number): Promise<DatasetDefinition>;
|
|
115
|
+
removeVersion(p: Principal, agentId: string, id: string, version: number): Promise<never>;
|
|
116
|
+
listTemplates(p: Principal, agentId: string): Promise<TemplateDocument[]>;
|
|
117
|
+
getTemplate(p: Principal, agentId: string, id: string): Promise<TemplateDocument>;
|
|
118
|
+
createTemplate(p: Principal, agentId: string, input: any): Promise<TemplateDocument>;
|
|
119
|
+
saveTemplate(p: Principal, agentId: string, id: string, input: any): Promise<TemplateDocument>;
|
|
120
|
+
listFixtures(p: Principal, agentId: string, templateId?: string): Promise<{
|
|
121
|
+
id: string;
|
|
122
|
+
workspaceId: string;
|
|
123
|
+
agentId: string;
|
|
124
|
+
templateId?: string;
|
|
125
|
+
name: string;
|
|
126
|
+
schemaPins: Record<string, string>;
|
|
127
|
+
createdAt: string;
|
|
128
|
+
expiresAt: string;
|
|
129
|
+
owner: string;
|
|
130
|
+
sample: boolean;
|
|
131
|
+
}[]>;
|
|
132
|
+
getFixture(p: Principal, agentId: string, id: string): Promise<Fixture>;
|
|
133
|
+
createFixture(p: Principal, agentId: string, input: any): Promise<Fixture>;
|
|
134
|
+
expireFixture(p: Principal, agentId: string, id: string): Promise<{
|
|
135
|
+
id: string;
|
|
136
|
+
state: string;
|
|
137
|
+
}>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare const slotPath: (path: string) => (string | number)[];
|
|
141
|
+
declare const valueAt: (value: any, path: (string | number)[]) => any;
|
|
142
|
+
declare function analyzeBindings(source: string, manifest: AuthoringManifest, datasets: DatasetDefinition[], components: Pick<ComponentDefinition, 'type' | 'schema' | 'rowScopes' | 'bindingSlots' | 'capabilities'>[], options?: {
|
|
143
|
+
agentId?: string;
|
|
144
|
+
format?: string;
|
|
145
|
+
editability?: string;
|
|
146
|
+
}): Analysis;
|
|
147
|
+
declare function bindingCandidates(source: string, manifest: AuthoringManifest, datasets: DatasetDefinition[], components: Pick<ComponentDefinition, 'type' | 'schema' | 'rowScopes' | 'bindingSlots' | 'capabilities'>[], elementId: string, propertyPath: string): {
|
|
148
|
+
field: FieldDescriptor;
|
|
149
|
+
compatibility: ReturnType<typeof compatibility>;
|
|
150
|
+
mapping?: Mapping;
|
|
151
|
+
alias?: string;
|
|
152
|
+
}[];
|
|
153
|
+
|
|
154
|
+
export { Action, Agent, Analysis, type AuditEvent, AuthoringManifest, CatalogError, CatalogService, type CatalogState, type CatalogStorage, DatasetDefinition, DatasetPlanRecord, DatasetResponseFixture, DatasetRunRecord, DatasetSource, FieldDescriptor, FileCatalogStorage, Fixture, HostIdentity, JsonSchema, Mapping, MemoryCatalogStorage, Principal, SchemaVersion, StudioDiagnostic, TemplateDocument, analyzeBindings, assertName, audit, bindingCandidates, canonicalJson, compatibility, createSchemaValidator, digest, emptyState, manifestFor, publishDatasetSchema, schemaReferences, scopeMatch, slotPath, validateSample, validateSchemaDocument, valueAt };
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonSchema, FieldDescriptor, Compatibility, SchemaChange } from './types.js';
|
|
2
|
+
|
|
3
|
+
declare const isObject: (v: any) => v is Record<string, any>;
|
|
4
|
+
declare const jsonPointer: (s: string) => string;
|
|
5
|
+
declare function safeInput(value: any, depth?: number): void;
|
|
6
|
+
declare function schemaTypes(schema: JsonSchema): string[];
|
|
7
|
+
type ProjectionOptions = {
|
|
8
|
+
root?: 'dataSets' | 'variables' | 'row';
|
|
9
|
+
alias?: string;
|
|
10
|
+
datasetId?: string;
|
|
11
|
+
schemaRef?: string;
|
|
12
|
+
registry?: Record<string, JsonSchema>;
|
|
13
|
+
maxDepth?: number;
|
|
14
|
+
};
|
|
15
|
+
declare function resolveSchemaRef(ref: string, document: JsonSchema, registry?: Record<string, JsonSchema>): JsonSchema | undefined;
|
|
16
|
+
declare function projectFields(schema: JsonSchema, options?: ProjectionOptions): FieldDescriptor[];
|
|
17
|
+
declare function fieldAt(schema: JsonSchema, path: string, options?: ProjectionOptions): FieldDescriptor | undefined;
|
|
18
|
+
declare function compatibility(field: Pick<FieldDescriptor, 'types' | 'presence' | 'nullable' | 'addressable' | 'schema'>, expected: JsonSchema, roles?: string[]): Compatibility;
|
|
19
|
+
declare function inferSchema(samples: unknown[]): Record<string, any>;
|
|
20
|
+
declare function compareSchemas(previous: JsonSchema, next: JsonSchema, registry?: Record<string, JsonSchema>): SchemaChange[];
|
|
21
|
+
|
|
22
|
+
export { type ProjectionOptions, compareSchemas, compatibility, fieldAt, inferSchema, isObject, jsonPointer, projectFields, resolveSchemaRef, safeInput, schemaTypes };
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
type DatasetProtocol = 'rest' | 'graphql' | 'grpc' | 'postgrest' | 'mongo';
|
|
2
|
+
type DatasetObject = Record<string, unknown>;
|
|
3
|
+
type DatasetPrecision = 'exact' | 'estimated' | 'unknown';
|
|
4
|
+
type DatasetCoverage = 'complete' | 'limitedByDesign' | 'partial' | 'failed';
|
|
5
|
+
interface DatasetScope {
|
|
6
|
+
workspaceId: string;
|
|
7
|
+
agentId: string;
|
|
8
|
+
}
|
|
9
|
+
interface RequestSlot {
|
|
10
|
+
section: 'path' | 'query' | 'body' | 'variables' | 'message' | 'operands';
|
|
11
|
+
name: string;
|
|
12
|
+
schema: DatasetObject;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface ApprovedOperation {
|
|
16
|
+
label: string;
|
|
17
|
+
slots: RequestSlot[];
|
|
18
|
+
configuration: DatasetObject;
|
|
19
|
+
responseSchema?: DatasetObject;
|
|
20
|
+
safeToRetry?: boolean;
|
|
21
|
+
stableOrder?: boolean;
|
|
22
|
+
rawPreviewPaths?: string[];
|
|
23
|
+
}
|
|
24
|
+
interface SourceRevision extends DatasetScope {
|
|
25
|
+
id: string;
|
|
26
|
+
sourceId: string;
|
|
27
|
+
revision: number;
|
|
28
|
+
protocol: DatasetProtocol;
|
|
29
|
+
connectionRef: string;
|
|
30
|
+
connectionRevision?: string;
|
|
31
|
+
fixtureOnly: boolean;
|
|
32
|
+
operations: Record<string, ApprovedOperation>;
|
|
33
|
+
publishedAt: string;
|
|
34
|
+
publishedBy: string;
|
|
35
|
+
digest: string;
|
|
36
|
+
}
|
|
37
|
+
interface DatasetSource extends DatasetScope {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
status: 'active' | 'deprecated' | 'revoked';
|
|
41
|
+
revision: number;
|
|
42
|
+
versions: SourceRevision[];
|
|
43
|
+
}
|
|
44
|
+
interface DatasetPlanSummary {
|
|
45
|
+
revision: number;
|
|
46
|
+
schemaRef: string;
|
|
47
|
+
digest: string;
|
|
48
|
+
publishedAt: string;
|
|
49
|
+
}
|
|
50
|
+
interface DatasetPlanVersion extends DatasetPlanSummary {
|
|
51
|
+
sourceText: string;
|
|
52
|
+
sourceRefs: string[];
|
|
53
|
+
publishedBy: string;
|
|
54
|
+
verification: DatasetVerification;
|
|
55
|
+
}
|
|
56
|
+
interface DatasetVerification {
|
|
57
|
+
digest: string;
|
|
58
|
+
mode: 'fixture' | 'live';
|
|
59
|
+
at: string;
|
|
60
|
+
}
|
|
61
|
+
interface DatasetPlanRecord extends DatasetScope {
|
|
62
|
+
datasetId: string;
|
|
63
|
+
draft: {
|
|
64
|
+
revision: number;
|
|
65
|
+
sourceText: string;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
verification?: DatasetVerification;
|
|
68
|
+
};
|
|
69
|
+
versions: DatasetPlanVersion[];
|
|
70
|
+
}
|
|
71
|
+
interface DatasetCount {
|
|
72
|
+
value: number | string | null;
|
|
73
|
+
precision: DatasetPrecision;
|
|
74
|
+
scope: string;
|
|
75
|
+
}
|
|
76
|
+
interface DatasetDiagnostic {
|
|
77
|
+
code: string;
|
|
78
|
+
phase: 'plan' | 'connection' | 'request' | 'page' | 'mapping' | 'reduction' | 'output' | 'run';
|
|
79
|
+
message: string;
|
|
80
|
+
operation?: string;
|
|
81
|
+
path?: string;
|
|
82
|
+
line?: number;
|
|
83
|
+
retryable?: boolean;
|
|
84
|
+
}
|
|
85
|
+
interface DatasetTrace {
|
|
86
|
+
operation: string;
|
|
87
|
+
protocol: DatasetProtocol;
|
|
88
|
+
page: number;
|
|
89
|
+
attempt: number;
|
|
90
|
+
outcome: 'accepted' | 'retry' | 'failed';
|
|
91
|
+
status?: number;
|
|
92
|
+
rows: number;
|
|
93
|
+
bytes: number;
|
|
94
|
+
durationMs: number;
|
|
95
|
+
slots: string[];
|
|
96
|
+
}
|
|
97
|
+
interface DatasetRunMetadata {
|
|
98
|
+
schemaRef: string;
|
|
99
|
+
planRevision?: number;
|
|
100
|
+
sourceRefs: string[];
|
|
101
|
+
startedAt: string;
|
|
102
|
+
finishedAt: string;
|
|
103
|
+
durationMs: number;
|
|
104
|
+
calls: number;
|
|
105
|
+
pages: number;
|
|
106
|
+
rows: number;
|
|
107
|
+
bytes: number;
|
|
108
|
+
retries: number;
|
|
109
|
+
completeness: DatasetCoverage;
|
|
110
|
+
consistency: 'bestEffort' | 'snapshot';
|
|
111
|
+
counts: Record<string, DatasetCount>;
|
|
112
|
+
operationCoverage: Record<string, DatasetCoverage>;
|
|
113
|
+
reductions: Record<string, {
|
|
114
|
+
coverage: DatasetCoverage;
|
|
115
|
+
rows: number;
|
|
116
|
+
}>;
|
|
117
|
+
trace: DatasetTrace[];
|
|
118
|
+
diagnostics: DatasetDiagnostic[];
|
|
119
|
+
}
|
|
120
|
+
interface DatasetRunRecord extends DatasetScope {
|
|
121
|
+
id: string;
|
|
122
|
+
datasetId: string;
|
|
123
|
+
actor: string;
|
|
124
|
+
planRevision: number;
|
|
125
|
+
schemaRef: string;
|
|
126
|
+
sourceRefs: string[];
|
|
127
|
+
state: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
128
|
+
createdAt: string;
|
|
129
|
+
expiresAt: string;
|
|
130
|
+
workerPid: number;
|
|
131
|
+
idempotencyKey?: string;
|
|
132
|
+
requestDigest: string;
|
|
133
|
+
cancelRequested?: boolean;
|
|
134
|
+
metadata?: DatasetRunMetadata;
|
|
135
|
+
diagnostics: DatasetDiagnostic[];
|
|
136
|
+
data?: DatasetObject;
|
|
137
|
+
}
|
|
138
|
+
interface DatasetResponseFixture extends DatasetScope {
|
|
139
|
+
id: string;
|
|
140
|
+
datasetId: string;
|
|
141
|
+
owner: string;
|
|
142
|
+
name: string;
|
|
143
|
+
createdAt: string;
|
|
144
|
+
expiresAt: string;
|
|
145
|
+
parameters: DatasetObject;
|
|
146
|
+
responses: Record<string, DatasetObject[]>;
|
|
147
|
+
}
|
|
148
|
+
interface ReportAcquisition {
|
|
149
|
+
planRevision: number;
|
|
150
|
+
parameters?: Record<string, unknown>;
|
|
151
|
+
}
|
|
152
|
+
declare const datasetActions: readonly ["sources.read", "sources.manage", "sources.connect", "datasets.plan.edit", "datasets.test", "datasets.execute", "datasets.results", "datasets.raw", "datasets.publish"];
|
|
153
|
+
type DatasetAction = typeof datasetActions[number];
|
|
154
|
+
|
|
155
|
+
type JsonSchema = boolean | Record<string, any>;
|
|
156
|
+
type Presence = 'required' | 'optional' | 'conditional' | 'unknown';
|
|
157
|
+
type FieldDescriptor = {
|
|
158
|
+
path: string;
|
|
159
|
+
segments: string[];
|
|
160
|
+
reporticPath?: string;
|
|
161
|
+
schemaPointer: string;
|
|
162
|
+
types: string[];
|
|
163
|
+
presence: Presence;
|
|
164
|
+
nullable: boolean;
|
|
165
|
+
addressable: boolean;
|
|
166
|
+
reason?: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
label: string;
|
|
169
|
+
format?: string;
|
|
170
|
+
role?: string;
|
|
171
|
+
unit?: string;
|
|
172
|
+
sensitivity?: string;
|
|
173
|
+
schema: JsonSchema;
|
|
174
|
+
itemSchema?: JsonSchema;
|
|
175
|
+
datasetId?: string;
|
|
176
|
+
schemaRef?: string;
|
|
177
|
+
scope: 'dataSets' | 'variables' | 'row';
|
|
178
|
+
collectionPath?: string;
|
|
179
|
+
conditional?: boolean;
|
|
180
|
+
recursive?: boolean;
|
|
181
|
+
};
|
|
182
|
+
type Compatibility = {
|
|
183
|
+
state: 'compatible' | 'conditional' | 'unknown' | 'incompatible';
|
|
184
|
+
reason: string;
|
|
185
|
+
score: number;
|
|
186
|
+
};
|
|
187
|
+
type SchemaChange = {
|
|
188
|
+
path: string;
|
|
189
|
+
kind: string;
|
|
190
|
+
severity: 'breaking' | 'review' | 'additive';
|
|
191
|
+
message: string;
|
|
192
|
+
replacement?: string;
|
|
193
|
+
};
|
|
194
|
+
type Mapping = {
|
|
195
|
+
datasetId: string;
|
|
196
|
+
schemaVersion: number;
|
|
197
|
+
schemaRef: string;
|
|
198
|
+
acquisition?: ReportAcquisition;
|
|
199
|
+
};
|
|
200
|
+
type AuthoringManifest = {
|
|
201
|
+
manifestVersion: 1;
|
|
202
|
+
agentId: string;
|
|
203
|
+
dataSetMappings: Record<string, Mapping>;
|
|
204
|
+
variablesSchema?: Record<string, any>;
|
|
205
|
+
variablesContract?: Mapping;
|
|
206
|
+
};
|
|
207
|
+
type StudioAsset = {
|
|
208
|
+
base64: string;
|
|
209
|
+
mediaType: string;
|
|
210
|
+
name?: string;
|
|
211
|
+
};
|
|
212
|
+
type TemplateDocument = {
|
|
213
|
+
id: string;
|
|
214
|
+
workspaceId: string;
|
|
215
|
+
agentId: string;
|
|
216
|
+
name: string;
|
|
217
|
+
description: string;
|
|
218
|
+
category: string;
|
|
219
|
+
color: string;
|
|
220
|
+
source: string;
|
|
221
|
+
manifest: AuthoringManifest;
|
|
222
|
+
revision: number;
|
|
223
|
+
theme: string;
|
|
224
|
+
css?: string;
|
|
225
|
+
assets: Record<string, StudioAsset>;
|
|
226
|
+
fixtureId?: string;
|
|
227
|
+
updatedAt: string;
|
|
228
|
+
updatedBy: string;
|
|
229
|
+
publishedRevisions: PublishedRevision[];
|
|
230
|
+
};
|
|
231
|
+
type PublishedRevision = {
|
|
232
|
+
number: number;
|
|
233
|
+
source: string;
|
|
234
|
+
manifest: AuthoringManifest;
|
|
235
|
+
theme: string;
|
|
236
|
+
css?: string;
|
|
237
|
+
assets: Record<string, StudioAsset>;
|
|
238
|
+
publishedAt: string;
|
|
239
|
+
publishedBy: string;
|
|
240
|
+
registryRevision: string;
|
|
241
|
+
diagnostics: any[];
|
|
242
|
+
fixtureVerification?: {
|
|
243
|
+
fixtureId: string;
|
|
244
|
+
fingerprint: string;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
type SchemaVersion = {
|
|
248
|
+
version: number;
|
|
249
|
+
schemaRef: string;
|
|
250
|
+
schema: Record<string, any>;
|
|
251
|
+
digest: string;
|
|
252
|
+
references: string[];
|
|
253
|
+
publishedAt: string;
|
|
254
|
+
publishedBy: string;
|
|
255
|
+
compatibility: SchemaChange[];
|
|
256
|
+
};
|
|
257
|
+
type DatasetDefinition = {
|
|
258
|
+
id: string;
|
|
259
|
+
workspaceId: string;
|
|
260
|
+
agentId: string;
|
|
261
|
+
name: string;
|
|
262
|
+
displayName: string;
|
|
263
|
+
description: string;
|
|
264
|
+
tags: string[];
|
|
265
|
+
producer?: string;
|
|
266
|
+
kind: 'dataset' | 'variables';
|
|
267
|
+
status: 'draft' | 'active' | 'deprecated' | 'archived';
|
|
268
|
+
revision: number;
|
|
269
|
+
draftSchemaText: string;
|
|
270
|
+
versions: SchemaVersion[];
|
|
271
|
+
createdAt: string;
|
|
272
|
+
updatedAt: string;
|
|
273
|
+
owner: string;
|
|
274
|
+
execution?: {
|
|
275
|
+
activeRevision: number;
|
|
276
|
+
versions: DatasetPlanSummary[];
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
type Fixture = {
|
|
280
|
+
id: string;
|
|
281
|
+
workspaceId: string;
|
|
282
|
+
agentId: string;
|
|
283
|
+
templateId?: string;
|
|
284
|
+
name: string;
|
|
285
|
+
dataSets: {
|
|
286
|
+
name: string;
|
|
287
|
+
data: Record<string, any>;
|
|
288
|
+
}[];
|
|
289
|
+
variables: Record<string, any>;
|
|
290
|
+
schemaPins: Record<string, string>;
|
|
291
|
+
createdAt: string;
|
|
292
|
+
expiresAt: string;
|
|
293
|
+
owner: string;
|
|
294
|
+
sample: boolean;
|
|
295
|
+
};
|
|
296
|
+
type Agent = {
|
|
297
|
+
id: string;
|
|
298
|
+
workspaceId: string;
|
|
299
|
+
name: string;
|
|
300
|
+
description: string;
|
|
301
|
+
};
|
|
302
|
+
type Action = 'catalog.read' | 'catalog.edit' | 'catalog.publish' | 'templates.read' | 'templates.edit' | 'templates.publish' | 'fixtures.read' | 'fixtures.manage' | 'reports.render' | 'artifacts.download' | 'audit.read' | DatasetAction;
|
|
303
|
+
type Principal = {
|
|
304
|
+
id: string;
|
|
305
|
+
workspaceId: string;
|
|
306
|
+
agentIds: string[];
|
|
307
|
+
actions: Action[];
|
|
308
|
+
displayName?: string;
|
|
309
|
+
development?: boolean;
|
|
310
|
+
};
|
|
311
|
+
type HostIdentity = {
|
|
312
|
+
authenticate: (request: unknown) => Promise<Principal | null> | Principal | null;
|
|
313
|
+
authorize?: (principal: Principal, agent: Agent, action: Action) => Promise<boolean> | boolean;
|
|
314
|
+
};
|
|
315
|
+
type StudioDiagnostic = {
|
|
316
|
+
code: string;
|
|
317
|
+
severity: 'error' | 'warning' | 'info';
|
|
318
|
+
phase: string;
|
|
319
|
+
message: string;
|
|
320
|
+
elementId?: string;
|
|
321
|
+
slot?: string;
|
|
322
|
+
bindingPath?: string;
|
|
323
|
+
datasetAlias?: string;
|
|
324
|
+
schemaRef?: string;
|
|
325
|
+
line?: number;
|
|
326
|
+
column?: number;
|
|
327
|
+
range?: {
|
|
328
|
+
from: number;
|
|
329
|
+
to: number;
|
|
330
|
+
};
|
|
331
|
+
guidance?: string;
|
|
332
|
+
state?: string;
|
|
333
|
+
};
|
|
334
|
+
type BindingInspection = {
|
|
335
|
+
elementId: string;
|
|
336
|
+
slot: string;
|
|
337
|
+
path: string;
|
|
338
|
+
range: {
|
|
339
|
+
from: number;
|
|
340
|
+
to: number;
|
|
341
|
+
line: number;
|
|
342
|
+
column: number;
|
|
343
|
+
};
|
|
344
|
+
datasetAlias?: string;
|
|
345
|
+
schemaRef?: string;
|
|
346
|
+
catalogPath?: string;
|
|
347
|
+
compatibility: Compatibility;
|
|
348
|
+
field?: FieldDescriptor;
|
|
349
|
+
};
|
|
350
|
+
type Analysis = {
|
|
351
|
+
valid: boolean;
|
|
352
|
+
status: 'Invalid' | 'Conditional' | 'Unverified' | 'Verified with fixture' | 'Structurally valid';
|
|
353
|
+
diagnostics: StudioDiagnostic[];
|
|
354
|
+
bindings: BindingInspection[];
|
|
355
|
+
fingerprint: string;
|
|
356
|
+
schemaPins: Record<string, string>;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
export { type Action, type Agent, type Analysis, type ApprovedOperation, type AuthoringManifest, type BindingInspection, type Compatibility, type DatasetAction, type DatasetCount, type DatasetCoverage, type DatasetDefinition, type DatasetDiagnostic, type DatasetObject, type DatasetPlanRecord, type DatasetPlanSummary, type DatasetPlanVersion, type DatasetPrecision, type DatasetProtocol, type DatasetResponseFixture, type DatasetRunMetadata, type DatasetRunRecord, type DatasetScope, type DatasetSource, type DatasetTrace, type DatasetVerification, type FieldDescriptor, type Fixture, type HostIdentity, type JsonSchema, type Mapping, type Presence, type Principal, type PublishedRevision, type ReportAcquisition, type RequestSlot, type SchemaChange, type SchemaVersion, type SourceRevision, type StudioAsset, type StudioDiagnostic, type TemplateDocument, datasetActions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/reportic-catalog",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "reportic-catalog — integrated Reportic authoring and catalog",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@x12i/reportic-core": "0.2.
|
|
35
|
-
"@x12i/reportic": "0.2.
|
|
36
|
-
"@x12i/reportic-elements": "0.2.
|
|
34
|
+
"@x12i/reportic-core": "0.2.3",
|
|
35
|
+
"@x12i/reportic": "0.2.3",
|
|
36
|
+
"@x12i/reportic-elements": "0.2.3",
|
|
37
37
|
"ajv": "^8.17.1",
|
|
38
38
|
"ajv-formats": "^3.0.1",
|
|
39
39
|
"yaml": "^2.8.1"
|