@eventcatalog/sdk 2.16.0 → 2.17.1
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.mts +95 -1
- package/dist/index.d.ts +95 -1
- package/dist/index.js +570 -233
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +567 -230
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -360,6 +360,86 @@ interface ToDSLOptions {
|
|
|
360
360
|
hydrate?: boolean;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
+
type SnapshotGitInfo = {
|
|
364
|
+
branch: string;
|
|
365
|
+
commit: string;
|
|
366
|
+
dirty: boolean;
|
|
367
|
+
};
|
|
368
|
+
type SnapshotResources = {
|
|
369
|
+
domains: Record<string, any>[];
|
|
370
|
+
services: Record<string, any>[];
|
|
371
|
+
messages: {
|
|
372
|
+
events: Record<string, any>[];
|
|
373
|
+
commands: Record<string, any>[];
|
|
374
|
+
queries: Record<string, any>[];
|
|
375
|
+
};
|
|
376
|
+
channels: Record<string, any>[];
|
|
377
|
+
};
|
|
378
|
+
type CatalogSnapshot = {
|
|
379
|
+
snapshotVersion: string;
|
|
380
|
+
catalogVersion: string;
|
|
381
|
+
label: string;
|
|
382
|
+
createdAt: string;
|
|
383
|
+
git?: SnapshotGitInfo;
|
|
384
|
+
resources: SnapshotResources;
|
|
385
|
+
};
|
|
386
|
+
type SnapshotOptions = {
|
|
387
|
+
label?: string;
|
|
388
|
+
outputDir?: string;
|
|
389
|
+
git?: SnapshotGitInfo;
|
|
390
|
+
};
|
|
391
|
+
type SnapshotResult = {
|
|
392
|
+
filePath: string;
|
|
393
|
+
snapshot: CatalogSnapshot;
|
|
394
|
+
};
|
|
395
|
+
type SnapshotMeta = {
|
|
396
|
+
label: string;
|
|
397
|
+
createdAt: string;
|
|
398
|
+
filePath: string;
|
|
399
|
+
git?: SnapshotGitInfo;
|
|
400
|
+
};
|
|
401
|
+
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'domain' | 'channel';
|
|
402
|
+
type ResourceChangeType = 'added' | 'removed' | 'modified' | 'versioned';
|
|
403
|
+
type ResourceChange = {
|
|
404
|
+
resourceId: string;
|
|
405
|
+
version: string;
|
|
406
|
+
type: SnapshotResourceType;
|
|
407
|
+
changeType: ResourceChangeType;
|
|
408
|
+
changedFields?: string[];
|
|
409
|
+
previousVersion?: string;
|
|
410
|
+
newVersion?: string;
|
|
411
|
+
};
|
|
412
|
+
type RelationshipChange = {
|
|
413
|
+
serviceId: string;
|
|
414
|
+
serviceVersion: string;
|
|
415
|
+
resourceId: string;
|
|
416
|
+
resourceVersion?: string;
|
|
417
|
+
direction: 'sends' | 'receives';
|
|
418
|
+
changeType: 'added' | 'removed';
|
|
419
|
+
};
|
|
420
|
+
type DiffSummary = {
|
|
421
|
+
totalChanges: number;
|
|
422
|
+
resourcesAdded: number;
|
|
423
|
+
resourcesRemoved: number;
|
|
424
|
+
resourcesModified: number;
|
|
425
|
+
resourcesVersioned: number;
|
|
426
|
+
relationshipsAdded: number;
|
|
427
|
+
relationshipsRemoved: number;
|
|
428
|
+
};
|
|
429
|
+
type SnapshotDiff = {
|
|
430
|
+
snapshotA: {
|
|
431
|
+
label: string;
|
|
432
|
+
createdAt: string;
|
|
433
|
+
};
|
|
434
|
+
snapshotB: {
|
|
435
|
+
label: string;
|
|
436
|
+
createdAt: string;
|
|
437
|
+
};
|
|
438
|
+
summary: DiffSummary;
|
|
439
|
+
resources: ResourceChange[];
|
|
440
|
+
relationships: RelationshipChange[];
|
|
441
|
+
};
|
|
442
|
+
|
|
363
443
|
/**
|
|
364
444
|
* Init the SDK for EventCatalog
|
|
365
445
|
*
|
|
@@ -1445,6 +1525,17 @@ declare const _default: (path: string) => {
|
|
|
1445
1525
|
* @returns Service[]
|
|
1446
1526
|
*/
|
|
1447
1527
|
getProducersOfSchema: (path: string) => Promise<Service[]>;
|
|
1528
|
+
/**
|
|
1529
|
+
* Returns the schema for a given message (event, command or query) by its id and version.
|
|
1530
|
+
* If no version is given, the latest version is used.
|
|
1531
|
+
* @param id - The id of the message to get the schema for
|
|
1532
|
+
* @param version - Optional version of the message
|
|
1533
|
+
* @returns { schema: string, fileName: string } | undefined
|
|
1534
|
+
*/
|
|
1535
|
+
getSchemaForMessage: (id: string, version?: string) => Promise<{
|
|
1536
|
+
schema: string;
|
|
1537
|
+
fileName: string;
|
|
1538
|
+
} | undefined>;
|
|
1448
1539
|
/**
|
|
1449
1540
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
1450
1541
|
* @param id - The id of the resource to get the owners for
|
|
@@ -1770,7 +1861,10 @@ declare const _default: (path: string) => {
|
|
|
1770
1861
|
* const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
|
|
1771
1862
|
* ```
|
|
1772
1863
|
*/
|
|
1864
|
+
createSnapshot: (options?: SnapshotOptions) => Promise<SnapshotResult>;
|
|
1865
|
+
diffSnapshots: (snapshotAPath: string, snapshotBPath: string) => Promise<SnapshotDiff>;
|
|
1866
|
+
listSnapshots: () => Promise<SnapshotMeta[]>;
|
|
1773
1867
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
1774
1868
|
};
|
|
1775
1869
|
|
|
1776
|
-
export { type Badge, type BaseSchema, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type Domain, type Entity, type Event, type EventCatalog, type Message, type Operation, type Query, type ReceivesPointer, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
|
|
1870
|
+
export { type Badge, type BaseSchema, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type Entity, type Event, type EventCatalog, type Message, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -360,6 +360,86 @@ interface ToDSLOptions {
|
|
|
360
360
|
hydrate?: boolean;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
+
type SnapshotGitInfo = {
|
|
364
|
+
branch: string;
|
|
365
|
+
commit: string;
|
|
366
|
+
dirty: boolean;
|
|
367
|
+
};
|
|
368
|
+
type SnapshotResources = {
|
|
369
|
+
domains: Record<string, any>[];
|
|
370
|
+
services: Record<string, any>[];
|
|
371
|
+
messages: {
|
|
372
|
+
events: Record<string, any>[];
|
|
373
|
+
commands: Record<string, any>[];
|
|
374
|
+
queries: Record<string, any>[];
|
|
375
|
+
};
|
|
376
|
+
channels: Record<string, any>[];
|
|
377
|
+
};
|
|
378
|
+
type CatalogSnapshot = {
|
|
379
|
+
snapshotVersion: string;
|
|
380
|
+
catalogVersion: string;
|
|
381
|
+
label: string;
|
|
382
|
+
createdAt: string;
|
|
383
|
+
git?: SnapshotGitInfo;
|
|
384
|
+
resources: SnapshotResources;
|
|
385
|
+
};
|
|
386
|
+
type SnapshotOptions = {
|
|
387
|
+
label?: string;
|
|
388
|
+
outputDir?: string;
|
|
389
|
+
git?: SnapshotGitInfo;
|
|
390
|
+
};
|
|
391
|
+
type SnapshotResult = {
|
|
392
|
+
filePath: string;
|
|
393
|
+
snapshot: CatalogSnapshot;
|
|
394
|
+
};
|
|
395
|
+
type SnapshotMeta = {
|
|
396
|
+
label: string;
|
|
397
|
+
createdAt: string;
|
|
398
|
+
filePath: string;
|
|
399
|
+
git?: SnapshotGitInfo;
|
|
400
|
+
};
|
|
401
|
+
type SnapshotResourceType = 'event' | 'command' | 'query' | 'service' | 'domain' | 'channel';
|
|
402
|
+
type ResourceChangeType = 'added' | 'removed' | 'modified' | 'versioned';
|
|
403
|
+
type ResourceChange = {
|
|
404
|
+
resourceId: string;
|
|
405
|
+
version: string;
|
|
406
|
+
type: SnapshotResourceType;
|
|
407
|
+
changeType: ResourceChangeType;
|
|
408
|
+
changedFields?: string[];
|
|
409
|
+
previousVersion?: string;
|
|
410
|
+
newVersion?: string;
|
|
411
|
+
};
|
|
412
|
+
type RelationshipChange = {
|
|
413
|
+
serviceId: string;
|
|
414
|
+
serviceVersion: string;
|
|
415
|
+
resourceId: string;
|
|
416
|
+
resourceVersion?: string;
|
|
417
|
+
direction: 'sends' | 'receives';
|
|
418
|
+
changeType: 'added' | 'removed';
|
|
419
|
+
};
|
|
420
|
+
type DiffSummary = {
|
|
421
|
+
totalChanges: number;
|
|
422
|
+
resourcesAdded: number;
|
|
423
|
+
resourcesRemoved: number;
|
|
424
|
+
resourcesModified: number;
|
|
425
|
+
resourcesVersioned: number;
|
|
426
|
+
relationshipsAdded: number;
|
|
427
|
+
relationshipsRemoved: number;
|
|
428
|
+
};
|
|
429
|
+
type SnapshotDiff = {
|
|
430
|
+
snapshotA: {
|
|
431
|
+
label: string;
|
|
432
|
+
createdAt: string;
|
|
433
|
+
};
|
|
434
|
+
snapshotB: {
|
|
435
|
+
label: string;
|
|
436
|
+
createdAt: string;
|
|
437
|
+
};
|
|
438
|
+
summary: DiffSummary;
|
|
439
|
+
resources: ResourceChange[];
|
|
440
|
+
relationships: RelationshipChange[];
|
|
441
|
+
};
|
|
442
|
+
|
|
363
443
|
/**
|
|
364
444
|
* Init the SDK for EventCatalog
|
|
365
445
|
*
|
|
@@ -1445,6 +1525,17 @@ declare const _default: (path: string) => {
|
|
|
1445
1525
|
* @returns Service[]
|
|
1446
1526
|
*/
|
|
1447
1527
|
getProducersOfSchema: (path: string) => Promise<Service[]>;
|
|
1528
|
+
/**
|
|
1529
|
+
* Returns the schema for a given message (event, command or query) by its id and version.
|
|
1530
|
+
* If no version is given, the latest version is used.
|
|
1531
|
+
* @param id - The id of the message to get the schema for
|
|
1532
|
+
* @param version - Optional version of the message
|
|
1533
|
+
* @returns { schema: string, fileName: string } | undefined
|
|
1534
|
+
*/
|
|
1535
|
+
getSchemaForMessage: (id: string, version?: string) => Promise<{
|
|
1536
|
+
schema: string;
|
|
1537
|
+
fileName: string;
|
|
1538
|
+
} | undefined>;
|
|
1448
1539
|
/**
|
|
1449
1540
|
* Returns the owners for a given resource (e.g domain, service, event, command, query, etc.)
|
|
1450
1541
|
* @param id - The id of the resource to get the owners for
|
|
@@ -1770,7 +1861,10 @@ declare const _default: (path: string) => {
|
|
|
1770
1861
|
* const dsl = await sdk.toDSL(services, { type: 'service', hydrate: true });
|
|
1771
1862
|
* ```
|
|
1772
1863
|
*/
|
|
1864
|
+
createSnapshot: (options?: SnapshotOptions) => Promise<SnapshotResult>;
|
|
1865
|
+
diffSnapshots: (snapshotAPath: string, snapshotBPath: string) => Promise<SnapshotDiff>;
|
|
1866
|
+
listSnapshots: () => Promise<SnapshotMeta[]>;
|
|
1773
1867
|
toDSL: (resource: (Event | Command | Query | Service | Domain) | (Event | Command | Query | Service | Domain)[], options: ToDSLOptions) => Promise<string>;
|
|
1774
1868
|
};
|
|
1775
1869
|
|
|
1776
|
-
export { type Badge, type BaseSchema, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type Domain, type Entity, type Event, type EventCatalog, type Message, type Operation, type Query, type ReceivesPointer, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
|
|
1870
|
+
export { type Badge, type BaseSchema, type CatalogSnapshot, type Changelog, type Channel, type ChannelPointer, type Command, type Container, type CustomDoc, type DataProduct, type DataProductOutputPointer, type Diagram, type DiffSummary, type Domain, type Entity, type Event, type EventCatalog, type Message, type Operation, type Query, type ReceivesPointer, type RelationshipChange, type ResourceChange, type ResourceChangeType, type ResourceGroup, type ResourcePointer, type SendsPointer, type Service, type SnapshotDiff, type SnapshotGitInfo, type SnapshotMeta, type SnapshotOptions, type SnapshotResourceType, type SnapshotResources, type SnapshotResult, type Specification, type Specifications, type Team, type UbiquitousLanguage, type UbiquitousLanguageDictionary, type User, _default as default };
|