@eventcatalog/generator-apicurio 0.0.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.
@@ -0,0 +1,139 @@
1
+ interface ArtifactMetadata {
2
+ id: string;
3
+ version: string;
4
+ type: string;
5
+ state: string;
6
+ createdOn: string;
7
+ modifiedOn: string;
8
+ globalId: number;
9
+ contentId: number;
10
+ }
11
+ interface Artifact {
12
+ id?: string;
13
+ artifactId?: string;
14
+ name?: string;
15
+ description?: string;
16
+ createdOn: string;
17
+ createdBy?: string;
18
+ owner?: string;
19
+ type?: string;
20
+ artifactType?: string;
21
+ labels?: Record<string, string>;
22
+ state?: string;
23
+ modifiedOn: string;
24
+ modifiedBy?: string;
25
+ groupId: string;
26
+ }
27
+ interface ArtifactSearchResults {
28
+ artifacts: Artifact[];
29
+ count: number;
30
+ }
31
+ interface Version {
32
+ version: string;
33
+ globalId: number;
34
+ state: string;
35
+ createdOn: string;
36
+ modifiedOn: string;
37
+ type: string;
38
+ }
39
+ interface VersionSearchResults {
40
+ versions: Version[];
41
+ count: number;
42
+ }
43
+ interface ArtifactWithVersions {
44
+ artifact: Artifact;
45
+ versions: Version[];
46
+ latestVersion: string;
47
+ content?: any;
48
+ }
49
+ declare enum SchemaType {
50
+ OPENAPI = "OPENAPI",
51
+ ASYNCAPI = "ASYNCAPI",
52
+ AVRO = "AVRO",
53
+ JSON = "JSON",
54
+ PROTOBUF = "PROTOBUF"
55
+ }
56
+ type EventCatalogConfig = any;
57
+ type MessageType = 'event' | 'command' | 'query';
58
+ type FilterCriterion = string | string[] | {
59
+ exact?: string | string[];
60
+ prefix?: string | string[];
61
+ suffix?: string | string[];
62
+ includes?: string | string[];
63
+ };
64
+ type Filter = {
65
+ events?: FilterCriterion;
66
+ commands?: FilterCriterion;
67
+ queries?: FilterCriterion;
68
+ };
69
+ type SpecificationType = 'openapi' | 'asyncapi';
70
+ /**
71
+ * Generator configuration tuple: [generatorPackage, options]
72
+ * Example: ['@eventcatalog/generator-openapi', { debug: true }]
73
+ */
74
+ type GeneratorConfig = [string, Record<string, any>?];
75
+ type ServiceSpecification = {
76
+ type: SpecificationType;
77
+ artifactId: string;
78
+ version?: string;
79
+ /**
80
+ * Optional generator to run on the specification to create message documentation.
81
+ * When specified, the generator will be dynamically imported and executed with the spec file.
82
+ * Example: ['@eventcatalog/generator-openapi', { debug: true }]
83
+ */
84
+ generator?: GeneratorConfig;
85
+ };
86
+ type Service = {
87
+ id: string;
88
+ name?: string;
89
+ sends?: Filter[];
90
+ receives?: Filter[];
91
+ version: string;
92
+ writesTo?: {
93
+ id: string;
94
+ version?: string;
95
+ }[];
96
+ readsFrom?: {
97
+ id: string;
98
+ version?: string;
99
+ }[];
100
+ summary?: string;
101
+ specifications?: ServiceSpecification[];
102
+ };
103
+ type Schema = {
104
+ artifactId: string;
105
+ messageId: string;
106
+ version: string;
107
+ globalId: number;
108
+ schemaType: SchemaType;
109
+ schema: string;
110
+ latestVersion?: boolean;
111
+ messageType?: MessageType;
112
+ groupId?: string;
113
+ };
114
+ type Domain = {
115
+ id: string;
116
+ name: string;
117
+ version: string;
118
+ };
119
+ type GeneratorProps = {
120
+ licenseKey?: string;
121
+ /**
122
+ * URL of the Apicurio Registry
123
+ */
124
+ registryUrl: string;
125
+ /**
126
+ * Include all versions of the schemas in the catalog
127
+ */
128
+ includeAllVersions?: boolean;
129
+ /**
130
+ * Optional list of services to add to the catalog
131
+ */
132
+ services?: Service[];
133
+ /**
134
+ * Optional domain to add to the catalog and attach the services too
135
+ */
136
+ domain?: Domain;
137
+ };
138
+
139
+ export { type Artifact, type ArtifactMetadata, type ArtifactSearchResults, type ArtifactWithVersions, type Domain, type EventCatalogConfig, type Filter, type FilterCriterion, type GeneratorConfig, type GeneratorProps, type MessageType, type Schema, SchemaType, type Service, type ServiceSpecification, type SpecificationType, type Version, type VersionSearchResults };
@@ -0,0 +1,139 @@
1
+ interface ArtifactMetadata {
2
+ id: string;
3
+ version: string;
4
+ type: string;
5
+ state: string;
6
+ createdOn: string;
7
+ modifiedOn: string;
8
+ globalId: number;
9
+ contentId: number;
10
+ }
11
+ interface Artifact {
12
+ id?: string;
13
+ artifactId?: string;
14
+ name?: string;
15
+ description?: string;
16
+ createdOn: string;
17
+ createdBy?: string;
18
+ owner?: string;
19
+ type?: string;
20
+ artifactType?: string;
21
+ labels?: Record<string, string>;
22
+ state?: string;
23
+ modifiedOn: string;
24
+ modifiedBy?: string;
25
+ groupId: string;
26
+ }
27
+ interface ArtifactSearchResults {
28
+ artifacts: Artifact[];
29
+ count: number;
30
+ }
31
+ interface Version {
32
+ version: string;
33
+ globalId: number;
34
+ state: string;
35
+ createdOn: string;
36
+ modifiedOn: string;
37
+ type: string;
38
+ }
39
+ interface VersionSearchResults {
40
+ versions: Version[];
41
+ count: number;
42
+ }
43
+ interface ArtifactWithVersions {
44
+ artifact: Artifact;
45
+ versions: Version[];
46
+ latestVersion: string;
47
+ content?: any;
48
+ }
49
+ declare enum SchemaType {
50
+ OPENAPI = "OPENAPI",
51
+ ASYNCAPI = "ASYNCAPI",
52
+ AVRO = "AVRO",
53
+ JSON = "JSON",
54
+ PROTOBUF = "PROTOBUF"
55
+ }
56
+ type EventCatalogConfig = any;
57
+ type MessageType = 'event' | 'command' | 'query';
58
+ type FilterCriterion = string | string[] | {
59
+ exact?: string | string[];
60
+ prefix?: string | string[];
61
+ suffix?: string | string[];
62
+ includes?: string | string[];
63
+ };
64
+ type Filter = {
65
+ events?: FilterCriterion;
66
+ commands?: FilterCriterion;
67
+ queries?: FilterCriterion;
68
+ };
69
+ type SpecificationType = 'openapi' | 'asyncapi';
70
+ /**
71
+ * Generator configuration tuple: [generatorPackage, options]
72
+ * Example: ['@eventcatalog/generator-openapi', { debug: true }]
73
+ */
74
+ type GeneratorConfig = [string, Record<string, any>?];
75
+ type ServiceSpecification = {
76
+ type: SpecificationType;
77
+ artifactId: string;
78
+ version?: string;
79
+ /**
80
+ * Optional generator to run on the specification to create message documentation.
81
+ * When specified, the generator will be dynamically imported and executed with the spec file.
82
+ * Example: ['@eventcatalog/generator-openapi', { debug: true }]
83
+ */
84
+ generator?: GeneratorConfig;
85
+ };
86
+ type Service = {
87
+ id: string;
88
+ name?: string;
89
+ sends?: Filter[];
90
+ receives?: Filter[];
91
+ version: string;
92
+ writesTo?: {
93
+ id: string;
94
+ version?: string;
95
+ }[];
96
+ readsFrom?: {
97
+ id: string;
98
+ version?: string;
99
+ }[];
100
+ summary?: string;
101
+ specifications?: ServiceSpecification[];
102
+ };
103
+ type Schema = {
104
+ artifactId: string;
105
+ messageId: string;
106
+ version: string;
107
+ globalId: number;
108
+ schemaType: SchemaType;
109
+ schema: string;
110
+ latestVersion?: boolean;
111
+ messageType?: MessageType;
112
+ groupId?: string;
113
+ };
114
+ type Domain = {
115
+ id: string;
116
+ name: string;
117
+ version: string;
118
+ };
119
+ type GeneratorProps = {
120
+ licenseKey?: string;
121
+ /**
122
+ * URL of the Apicurio Registry
123
+ */
124
+ registryUrl: string;
125
+ /**
126
+ * Include all versions of the schemas in the catalog
127
+ */
128
+ includeAllVersions?: boolean;
129
+ /**
130
+ * Optional list of services to add to the catalog
131
+ */
132
+ services?: Service[];
133
+ /**
134
+ * Optional domain to add to the catalog and attach the services too
135
+ */
136
+ domain?: Domain;
137
+ };
138
+
139
+ export { type Artifact, type ArtifactMetadata, type ArtifactSearchResults, type ArtifactWithVersions, type Domain, type EventCatalogConfig, type Filter, type FilterCriterion, type GeneratorConfig, type GeneratorProps, type MessageType, type Schema, SchemaType, type Service, type ServiceSpecification, type SpecificationType, type Version, type VersionSearchResults };
package/dist/types.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/types.ts
21
+ var types_exports = {};
22
+ __export(types_exports, {
23
+ SchemaType: () => SchemaType
24
+ });
25
+ module.exports = __toCommonJS(types_exports);
26
+ var SchemaType = /* @__PURE__ */ ((SchemaType2) => {
27
+ SchemaType2["OPENAPI"] = "OPENAPI";
28
+ SchemaType2["ASYNCAPI"] = "ASYNCAPI";
29
+ SchemaType2["AVRO"] = "AVRO";
30
+ SchemaType2["JSON"] = "JSON";
31
+ SchemaType2["PROTOBUF"] = "PROTOBUF";
32
+ return SchemaType2;
33
+ })(SchemaType || {});
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ SchemaType
37
+ });
38
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["// Apicurio API response types\nexport interface ArtifactMetadata {\n id: string;\n version: string;\n type: string;\n state: string;\n createdOn: string;\n modifiedOn: string;\n globalId: number;\n contentId: number;\n}\n\nexport interface Artifact {\n // V2 uses 'id', V3 uses 'artifactId'\n id?: string;\n artifactId?: string;\n name?: string;\n description?: string;\n createdOn: string;\n createdBy?: string;\n owner?: string; // V3 uses 'owner' instead of 'createdBy'\n // V2 uses 'type', V3 uses 'artifactType'\n type?: string;\n artifactType?: string;\n labels?: Record<string, string>;\n state?: string;\n modifiedOn: string;\n modifiedBy?: string;\n groupId: string;\n}\n\nexport interface ArtifactSearchResults {\n artifacts: Artifact[];\n count: number;\n}\n\nexport interface Version {\n version: string;\n globalId: number;\n state: string;\n createdOn: string;\n modifiedOn: string;\n type: string;\n}\n\nexport interface VersionSearchResults {\n versions: Version[];\n count: number;\n}\n\nexport interface ArtifactWithVersions {\n artifact: Artifact;\n versions: Version[];\n latestVersion: string;\n content?: any;\n}\n\nexport enum SchemaType {\n OPENAPI = 'OPENAPI',\n ASYNCAPI = 'ASYNCAPI',\n AVRO = 'AVRO',\n JSON = 'JSON',\n PROTOBUF = 'PROTOBUF',\n}\n\n// EventCatalog generator types\nexport type EventCatalogConfig = any;\n\nexport type MessageType = 'event' | 'command' | 'query';\n\nexport type FilterCriterion =\n | string\n | string[]\n | { exact?: string | string[]; prefix?: string | string[]; suffix?: string | string[]; includes?: string | string[] };\n\nexport type Filter = {\n events?: FilterCriterion;\n commands?: FilterCriterion;\n queries?: FilterCriterion;\n};\n\nexport type SpecificationType = 'openapi' | 'asyncapi';\n\n/**\n * Generator configuration tuple: [generatorPackage, options]\n * Example: ['@eventcatalog/generator-openapi', { debug: true }]\n */\nexport type GeneratorConfig = [string, Record<string, any>?];\n\nexport type ServiceSpecification = {\n type: SpecificationType;\n artifactId: string;\n version?: string; // If not provided, uses latest\n /**\n * Optional generator to run on the specification to create message documentation.\n * When specified, the generator will be dynamically imported and executed with the spec file.\n * Example: ['@eventcatalog/generator-openapi', { debug: true }]\n */\n generator?: GeneratorConfig;\n};\n\nexport type Service = {\n id: string;\n name?: string;\n sends?: Filter[];\n receives?: Filter[];\n version: string;\n writesTo?: { id: string; version?: string }[];\n readsFrom?: { id: string; version?: string }[];\n summary?: string;\n specifications?: ServiceSpecification[];\n};\n\nexport type Schema = {\n artifactId: string;\n messageId: string;\n version: string;\n globalId: number;\n schemaType: SchemaType;\n schema: string;\n latestVersion?: boolean;\n messageType?: MessageType;\n groupId?: string;\n};\n\nexport type Domain = {\n id: string;\n name: string;\n version: string;\n};\n\nexport type GeneratorProps = {\n licenseKey?: string;\n /**\n * URL of the Apicurio Registry\n */\n registryUrl: string;\n\n /**\n * Include all versions of the schemas in the catalog\n */\n includeAllVersions?: boolean;\n\n /**\n * Optional list of services to add to the catalog\n */\n services?: Service[];\n\n /**\n * Optional domain to add to the catalog and attach the services too\n */\n domain?: Domain;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDO,IAAK,aAAL,kBAAKA,gBAAL;AACL,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,cAAW;AALD,SAAAA;AAAA,GAAA;","names":["SchemaType"]}
package/dist/types.mjs ADDED
@@ -0,0 +1,13 @@
1
+ // src/types.ts
2
+ var SchemaType = /* @__PURE__ */ ((SchemaType2) => {
3
+ SchemaType2["OPENAPI"] = "OPENAPI";
4
+ SchemaType2["ASYNCAPI"] = "ASYNCAPI";
5
+ SchemaType2["AVRO"] = "AVRO";
6
+ SchemaType2["JSON"] = "JSON";
7
+ SchemaType2["PROTOBUF"] = "PROTOBUF";
8
+ return SchemaType2;
9
+ })(SchemaType || {});
10
+ export {
11
+ SchemaType
12
+ };
13
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["// Apicurio API response types\nexport interface ArtifactMetadata {\n id: string;\n version: string;\n type: string;\n state: string;\n createdOn: string;\n modifiedOn: string;\n globalId: number;\n contentId: number;\n}\n\nexport interface Artifact {\n // V2 uses 'id', V3 uses 'artifactId'\n id?: string;\n artifactId?: string;\n name?: string;\n description?: string;\n createdOn: string;\n createdBy?: string;\n owner?: string; // V3 uses 'owner' instead of 'createdBy'\n // V2 uses 'type', V3 uses 'artifactType'\n type?: string;\n artifactType?: string;\n labels?: Record<string, string>;\n state?: string;\n modifiedOn: string;\n modifiedBy?: string;\n groupId: string;\n}\n\nexport interface ArtifactSearchResults {\n artifacts: Artifact[];\n count: number;\n}\n\nexport interface Version {\n version: string;\n globalId: number;\n state: string;\n createdOn: string;\n modifiedOn: string;\n type: string;\n}\n\nexport interface VersionSearchResults {\n versions: Version[];\n count: number;\n}\n\nexport interface ArtifactWithVersions {\n artifact: Artifact;\n versions: Version[];\n latestVersion: string;\n content?: any;\n}\n\nexport enum SchemaType {\n OPENAPI = 'OPENAPI',\n ASYNCAPI = 'ASYNCAPI',\n AVRO = 'AVRO',\n JSON = 'JSON',\n PROTOBUF = 'PROTOBUF',\n}\n\n// EventCatalog generator types\nexport type EventCatalogConfig = any;\n\nexport type MessageType = 'event' | 'command' | 'query';\n\nexport type FilterCriterion =\n | string\n | string[]\n | { exact?: string | string[]; prefix?: string | string[]; suffix?: string | string[]; includes?: string | string[] };\n\nexport type Filter = {\n events?: FilterCriterion;\n commands?: FilterCriterion;\n queries?: FilterCriterion;\n};\n\nexport type SpecificationType = 'openapi' | 'asyncapi';\n\n/**\n * Generator configuration tuple: [generatorPackage, options]\n * Example: ['@eventcatalog/generator-openapi', { debug: true }]\n */\nexport type GeneratorConfig = [string, Record<string, any>?];\n\nexport type ServiceSpecification = {\n type: SpecificationType;\n artifactId: string;\n version?: string; // If not provided, uses latest\n /**\n * Optional generator to run on the specification to create message documentation.\n * When specified, the generator will be dynamically imported and executed with the spec file.\n * Example: ['@eventcatalog/generator-openapi', { debug: true }]\n */\n generator?: GeneratorConfig;\n};\n\nexport type Service = {\n id: string;\n name?: string;\n sends?: Filter[];\n receives?: Filter[];\n version: string;\n writesTo?: { id: string; version?: string }[];\n readsFrom?: { id: string; version?: string }[];\n summary?: string;\n specifications?: ServiceSpecification[];\n};\n\nexport type Schema = {\n artifactId: string;\n messageId: string;\n version: string;\n globalId: number;\n schemaType: SchemaType;\n schema: string;\n latestVersion?: boolean;\n messageType?: MessageType;\n groupId?: string;\n};\n\nexport type Domain = {\n id: string;\n name: string;\n version: string;\n};\n\nexport type GeneratorProps = {\n licenseKey?: string;\n /**\n * URL of the Apicurio Registry\n */\n registryUrl: string;\n\n /**\n * Include all versions of the schemas in the catalog\n */\n includeAllVersions?: boolean;\n\n /**\n * Optional list of services to add to the catalog\n */\n services?: Service[];\n\n /**\n * Optional domain to add to the catalog and attach the services too\n */\n domain?: Domain;\n};\n"],"mappings":";AAyDO,IAAK,aAAL,kBAAKA,gBAAL;AACL,EAAAA,YAAA,aAAU;AACV,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,UAAO;AACP,EAAAA,YAAA,cAAW;AALD,SAAAA;AAAA,GAAA;","names":["SchemaType"]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@eventcatalog/generator-apicurio",
3
+ "version": "0.0.3",
4
+ "description": "Apicurio Registry generator for EventCatalog",
5
+ "scripts": {
6
+ "build": "tsup",
7
+ "test": "vitest",
8
+ "format": "prettier --write .",
9
+ "changeset": "changeset",
10
+ "format:diff": "prettier --list-different .",
11
+ "release": "changeset publish"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "keywords": [],
17
+ "author": "",
18
+ "license": "Dual License",
19
+ "devDependencies": {
20
+ "@types/node": "^20.16.1",
21
+ "prettier": "^3.3.3",
22
+ "tsup": "^8.1.0",
23
+ "typescript": "^5.5.3",
24
+ "vitest": "^2.0.2"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "package.json"
29
+ ],
30
+ "main": "./dist/index.js",
31
+ "module": "./dist/index.mjs",
32
+ "types": "./dist/index.d.ts",
33
+ "dependencies": {
34
+ "@changesets/cli": "^2.27.8",
35
+ "@eventcatalog/sdk": "^2.8.3",
36
+ "axios": "^1.8.4",
37
+ "chalk": "4.1.2",
38
+ "update-notifier": "^7.3.1"
39
+ },
40
+ "peerDependencies": {
41
+ "@eventcatalog/generator-openapi": ">=7.6.2",
42
+ "@eventcatalog/generator-asyncapi": ">=5.1.3"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@eventcatalog/generator-openapi": {
46
+ "optional": true
47
+ },
48
+ "@eventcatalog/generator-asyncapi": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/event-catalog/generators",
55
+ "directory": "packages/generator-apicurio"
56
+ }
57
+ }