@kurrent/kurrentdb-client 1.2.0-alpha.0 → 1.2.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/dist/Client/http.d.ts +7 -1
- package/dist/Client/http.js +50 -48
- package/dist/Client/http.js.map +1 -1
- package/dist/Client/index.d.ts +30 -6
- package/dist/Client/index.js +77 -11
- package/dist/Client/index.js.map +1 -1
- package/dist/Client/parseConnectionString.d.ts +2 -2
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +6 -1
- package/dist/constants.js.map +1 -1
- package/dist/events/binaryEvent.js +2 -2
- package/dist/events/binaryEvent.js.map +1 -1
- package/dist/events/jsonEvent.js +2 -2
- package/dist/events/jsonEvent.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/projections/createProjection.d.ts +10 -1
- package/dist/projections/createProjection.js +13 -2
- package/dist/projections/createProjection.js.map +1 -1
- package/dist/streams/appendToStream/appendRecords.d.ts +3 -0
- package/dist/streams/appendToStream/appendRecords.js +132 -0
- package/dist/streams/appendToStream/appendRecords.js.map +1 -0
- package/dist/streams/appendToStream/batchAppend.js +2 -2
- package/dist/streams/appendToStream/batchAppend.js.map +1 -1
- package/dist/streams/appendToStream/index.d.ts +9 -1
- package/dist/streams/appendToStream/index.js +8 -0
- package/dist/streams/appendToStream/index.js.map +1 -1
- package/dist/streams/readAll.js +18 -18
- package/dist/streams/readAll.js.map +1 -1
- package/dist/streams/readStream.js +26 -34
- package/dist/streams/readStream.js.map +1 -1
- package/dist/types/index.d.ts +88 -2
- package/dist/types/index.js.map +1 -1
- package/dist/utils/CommandError.d.ts +9 -3
- package/dist/utils/CommandError.js +50 -1
- package/dist/utils/CommandError.js.map +1 -1
- package/dist/utils/convertBridgeError.d.ts +2 -1
- package/dist/utils/convertBridgeError.js +14 -24
- package/dist/utils/convertBridgeError.js.map +1 -1
- package/dist/utils/credentials.d.ts +19 -0
- package/dist/utils/credentials.js +31 -0
- package/dist/utils/credentials.js.map +1 -0
- package/dist/utils/grpcUUID.d.ts +1 -0
- package/dist/utils/grpcUUID.js +12 -12
- package/dist/utils/grpcUUID.js.map +1 -1
- package/generated/kurrentdb/protocols/v1/projectionmanagement_pb.d.ts +3 -0
- package/generated/kurrentdb/protocols/v1/projectionmanagement_pb.js +31 -1
- package/generated/kurrentdb/protocols/v2/core_pb.d.ts +188 -188
- package/generated/kurrentdb/protocols/v2/core_pb.js +1301 -1301
- package/generated/kurrentdb/protocols/v2/features/service_grpc_pb.d.ts +43 -43
- package/generated/kurrentdb/protocols/v2/features/service_grpc_pb.js +50 -50
- package/generated/kurrentdb/protocols/v2/features/service_pb.d.ts +227 -227
- package/generated/kurrentdb/protocols/v2/features/service_pb.js +1753 -1753
- package/generated/kurrentdb/protocols/v2/streams/errors_pb.d.ts +85 -0
- package/generated/kurrentdb/protocols/v2/streams/errors_pb.js +625 -1
- package/generated/kurrentdb/protocols/v2/streams/shared_pb.d.ts +218 -218
- package/generated/kurrentdb/protocols/v2/streams/shared_pb.js +1561 -1561
- package/generated/kurrentdb/protocols/v2/streams/streams_grpc_pb.d.ts +17 -0
- package/generated/kurrentdb/protocols/v2/streams/streams_grpc_pb.js +53 -0
- package/generated/kurrentdb/protocols/v2/streams/streams_pb.d.ts +134 -0
- package/generated/kurrentdb/protocols/v2/streams/streams_pb.js +1041 -1
- package/package.json +64 -66
- package/dist/schemaRegistry/checkSchemaCompatibility.d.ts +0 -12
- package/dist/schemaRegistry/checkSchemaCompatibility.js +0 -60
- package/dist/schemaRegistry/checkSchemaCompatibility.js.map +0 -1
- package/dist/schemaRegistry/createSchema.d.ts +0 -13
- package/dist/schemaRegistry/createSchema.js +0 -36
- package/dist/schemaRegistry/createSchema.js.map +0 -1
- package/dist/schemaRegistry/deleteSchema.d.ts +0 -11
- package/dist/schemaRegistry/deleteSchema.js +0 -23
- package/dist/schemaRegistry/deleteSchema.js.map +0 -1
- package/dist/schemaRegistry/deleteSchemaVersions.d.ts +0 -13
- package/dist/schemaRegistry/deleteSchemaVersions.js +0 -29
- package/dist/schemaRegistry/deleteSchemaVersions.js.map +0 -1
- package/dist/schemaRegistry/getSchema.d.ts +0 -12
- package/dist/schemaRegistry/getSchema.js +0 -28
- package/dist/schemaRegistry/getSchema.js.map +0 -1
- package/dist/schemaRegistry/getSchemaVersion.d.ts +0 -12
- package/dist/schemaRegistry/getSchemaVersion.js +0 -33
- package/dist/schemaRegistry/getSchemaVersion.js.map +0 -1
- package/dist/schemaRegistry/getSchemaVersionById.d.ts +0 -12
- package/dist/schemaRegistry/getSchemaVersionById.js +0 -28
- package/dist/schemaRegistry/getSchemaVersionById.js.map +0 -1
- package/dist/schemaRegistry/index.d.ts +0 -14
- package/dist/schemaRegistry/index.js +0 -35
- package/dist/schemaRegistry/index.js.map +0 -1
- package/dist/schemaRegistry/listRegisteredSchemas.d.ts +0 -11
- package/dist/schemaRegistry/listRegisteredSchemas.js +0 -41
- package/dist/schemaRegistry/listRegisteredSchemas.js.map +0 -1
- package/dist/schemaRegistry/listSchemaVersions.d.ts +0 -12
- package/dist/schemaRegistry/listSchemaVersions.js +0 -28
- package/dist/schemaRegistry/listSchemaVersions.js.map +0 -1
- package/dist/schemaRegistry/listSchemas.d.ts +0 -11
- package/dist/schemaRegistry/listSchemas.js +0 -35
- package/dist/schemaRegistry/listSchemas.js.map +0 -1
- package/dist/schemaRegistry/lookupSchemaName.d.ts +0 -12
- package/dist/schemaRegistry/lookupSchemaName.js +0 -23
- package/dist/schemaRegistry/lookupSchemaName.js.map +0 -1
- package/dist/schemaRegistry/registerSchemaVersion.d.ts +0 -13
- package/dist/schemaRegistry/registerSchemaVersion.js +0 -31
- package/dist/schemaRegistry/registerSchemaVersion.js.map +0 -1
- package/dist/schemaRegistry/types.d.ts +0 -347
- package/dist/schemaRegistry/types.js +0 -3
- package/dist/schemaRegistry/types.js.map +0 -1
- package/dist/schemaRegistry/updateSchema.d.ts +0 -11
- package/dist/schemaRegistry/updateSchema.js +0 -51
- package/dist/schemaRegistry/updateSchema.js.map +0 -1
- package/dist/schemaRegistry/utils/index.d.ts +0 -1
- package/dist/schemaRegistry/utils/index.js +0 -18
- package/dist/schemaRegistry/utils/index.js.map +0 -1
- package/dist/schemaRegistry/utils/mappers.d.ts +0 -24
- package/dist/schemaRegistry/utils/mappers.js +0 -198
- package/dist/schemaRegistry/utils/mappers.js.map +0 -1
- package/generated/kurrentdb/protocols/v2/registry/errors_grpc_pb.js +0 -1
- package/generated/kurrentdb/protocols/v2/registry/errors_pb.d.ts +0 -75
- package/generated/kurrentdb/protocols/v2/registry/errors_pb.js +0 -493
- package/generated/kurrentdb/protocols/v2/registry/events_grpc_pb.js +0 -1
- package/generated/kurrentdb/protocols/v2/registry/events_pb.d.ts +0 -255
- package/generated/kurrentdb/protocols/v2/registry/events_pb.js +0 -2057
- package/generated/kurrentdb/protocols/v2/registry/groups_grpc_pb.js +0 -1
- package/generated/kurrentdb/protocols/v2/registry/groups_pb.d.ts +0 -474
- package/generated/kurrentdb/protocols/v2/registry/groups_pb.js +0 -3593
- package/generated/kurrentdb/protocols/v2/registry/schemas_grpc_pb.js +0 -1
- package/generated/kurrentdb/protocols/v2/registry/schemas_pb.d.ts +0 -825
- package/generated/kurrentdb/protocols/v2/registry/schemas_pb.js +0 -6500
- package/generated/kurrentdb/protocols/v2/registry/service_grpc_pb.d.ts +0 -350
- package/generated/kurrentdb/protocols/v2/registry/service_grpc_pb.js +0 -654
- package/generated/kurrentdb/protocols/v2/registry/service_pb.d.ts +0 -10
- package/generated/kurrentdb/protocols/v2/registry/service_pb.js +0 -29
- package/generated/kurrentdb/protocols/v2/registry/shared_grpc_pb.js +0 -1
- package/generated/kurrentdb/protocols/v2/registry/shared_pb.d.ts +0 -26
- package/generated/kurrentdb/protocols/v2/registry/shared_pb.js +0 -51
- package/generated/kurrentdb/protocols/v2/registry/validation_grpc_pb.js +0 -1
- package/generated/kurrentdb/protocols/v2/registry/validation_pb.d.ts +0 -247
- package/generated/kurrentdb/protocols/v2/registry/validation_pb.js +0 -1789
package/package.json
CHANGED
|
@@ -1,66 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@kurrent/kurrentdb-client",
|
|
3
|
-
"version": "1.2.0
|
|
4
|
-
"description": "KurrentDB gRPC NodeJS Client SDK",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "yarn generate && yarn build:ts",
|
|
9
|
-
"build:ts": "tsc --build",
|
|
10
|
-
"build:watch": "yarn generate && yarn build:ts-watch",
|
|
11
|
-
"build:ts-watch": "tsc --build --watch",
|
|
12
|
-
"generate": "yarn generate:folder && yarn generate:sed-append && yarn generate:sed-insert && yarn generate:js",
|
|
13
|
-
"generate:sed-append": "shx sed -i \"s/int64 ([A-z_]*) = ([0-9]*) \\[deprecated = true\\];/int64 \\$1 = \\$2 [deprecated = true, jstype = JS_STRING];/g\" ./protos/kurrentdb/protocols/**/*.proto",
|
|
14
|
-
"generate:sed-insert": "shx sed -i \"s/int64 ([A-z_]*) = ([0-9]*);/int64 \\$1 = \\$2 [jstype = JS_STRING];/g\" ./protos/kurrentdb/protocols/**/*.proto",
|
|
15
|
-
"generate:folder": "shx mkdir -p ./generated",
|
|
16
|
-
"generate:js": "grpc_tools_node_protoc ./protos/kurrentdb/protocols/**/*.proto --proto_path=./protos --grpc_out=grpc_js:./generated --js_out=import_style=commonjs,binary:./generated --ts_out=generate_package_definition:./generated",
|
|
17
|
-
"clean": "yarn clean:generated && yarn clean:dist && yarn clean:buildinfo",
|
|
18
|
-
"clean:generated": "shx rm -rf ./generated",
|
|
19
|
-
"clean:dist": "shx rm -rf ./dist",
|
|
20
|
-
"clean:buildinfo": "shx rm -rf *.tsbuildinfo"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist/",
|
|
24
|
-
"generated/"
|
|
25
|
-
],
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/kurrent-io/KurrentDB-Client-NodeJS.git"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [
|
|
31
|
-
"Kurrent",
|
|
32
|
-
"EventSourcing",
|
|
33
|
-
"Client"
|
|
34
|
-
],
|
|
35
|
-
"author": "Kurrent, Inc",
|
|
36
|
-
"license": "Apache-2.0",
|
|
37
|
-
"bugs": {
|
|
38
|
-
"url": "https://github.com/kurrent-io/KurrentDB-Client-NodeJS/issues"
|
|
39
|
-
},
|
|
40
|
-
"homepage": "https://developers.kurrent.io/clients/grpc/getting-started?codeLanguage=NodeJS",
|
|
41
|
-
"publishConfig": {
|
|
42
|
-
"access": "public"
|
|
43
|
-
},
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=20"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"@grpc/grpc-js": "^1.
|
|
49
|
-
"@kurrent/bridge": "^0.
|
|
50
|
-
"@types/debug": "^4.1.12",
|
|
51
|
-
"@types/google-protobuf": "^3.15.12",
|
|
52
|
-
"@types/node": "^22.10.2",
|
|
53
|
-
"debug": "^4.4.0",
|
|
54
|
-
"google-protobuf": "^3.21.4",
|
|
55
|
-
"semver": "^7.7.2"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@kurrent/kurrentdb-client",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "KurrentDB gRPC NodeJS Client SDK",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "yarn generate && yarn build:ts",
|
|
9
|
+
"build:ts": "tsc --build",
|
|
10
|
+
"build:watch": "yarn generate && yarn build:ts-watch",
|
|
11
|
+
"build:ts-watch": "tsc --build --watch",
|
|
12
|
+
"generate": "yarn generate:folder && yarn generate:sed-append && yarn generate:sed-insert && yarn generate:js",
|
|
13
|
+
"generate:sed-append": "shx sed -i \"s/int64 ([A-z_]*) = ([0-9]*) \\[deprecated = true\\];/int64 \\$1 = \\$2 [deprecated = true, jstype = JS_STRING];/g\" ./protos/kurrentdb/protocols/**/*.proto",
|
|
14
|
+
"generate:sed-insert": "shx sed -i \"s/int64 ([A-z_]*) = ([0-9]*);/int64 \\$1 = \\$2 [jstype = JS_STRING];/g\" ./protos/kurrentdb/protocols/**/*.proto",
|
|
15
|
+
"generate:folder": "shx mkdir -p ./generated",
|
|
16
|
+
"generate:js": "grpc_tools_node_protoc ./protos/kurrentdb/protocols/**/*.proto --proto_path=./protos --grpc_out=grpc_js:./generated --js_out=import_style=commonjs,binary:./generated --ts_out=generate_package_definition:./generated",
|
|
17
|
+
"clean": "yarn clean:generated && yarn clean:dist && yarn clean:buildinfo",
|
|
18
|
+
"clean:generated": "shx rm -rf ./generated",
|
|
19
|
+
"clean:dist": "shx rm -rf ./dist",
|
|
20
|
+
"clean:buildinfo": "shx rm -rf *.tsbuildinfo"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist/",
|
|
24
|
+
"generated/"
|
|
25
|
+
],
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/kurrent-io/KurrentDB-Client-NodeJS.git"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"Kurrent",
|
|
32
|
+
"EventSourcing",
|
|
33
|
+
"Client"
|
|
34
|
+
],
|
|
35
|
+
"author": "Kurrent, Inc",
|
|
36
|
+
"license": "Apache-2.0",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/kurrent-io/KurrentDB-Client-NodeJS/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://developers.kurrent.io/clients/grpc/getting-started?codeLanguage=NodeJS",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@grpc/grpc-js": "^1.14.3",
|
|
49
|
+
"@kurrent/bridge": "^0.2.0",
|
|
50
|
+
"@types/debug": "^4.1.12",
|
|
51
|
+
"@types/google-protobuf": "^3.15.12",
|
|
52
|
+
"@types/node": "^22.10.2",
|
|
53
|
+
"debug": "^4.4.0",
|
|
54
|
+
"google-protobuf": "^3.21.4",
|
|
55
|
+
"semver": "^7.7.2"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/semver": "^7.7.0",
|
|
59
|
+
"grpc-tools": "^1.13.1",
|
|
60
|
+
"grpc_tools_node_protoc_ts": "^5.3.3",
|
|
61
|
+
"nx": "20.1.3",
|
|
62
|
+
"shx": "^0.3.4"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CheckSchemaCompatibilityOptions, CheckSchemaCompatibilityResult } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Checks if a schema definition is compatible with an existing schema.
|
|
6
|
-
* @param schemaDefinition - The schema definition to check.
|
|
7
|
-
* @param options - Options specifying the schema or version to check against, and the data format.
|
|
8
|
-
* @returns The compatibility result including any errors.
|
|
9
|
-
*/
|
|
10
|
-
checkSchemaCompatibility(schemaDefinition: string | Uint8Array, options: CheckSchemaCompatibilityOptions): Promise<CheckSchemaCompatibilityResult>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const validation_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/validation_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.checkSchemaCompatibility = async function (schemaDefinition, options) {
|
|
9
|
-
const { schemaName, schemaVersionId, dataFormat, ...baseOptions } = options;
|
|
10
|
-
if (!schemaName && !schemaVersionId) {
|
|
11
|
-
throw new Error("Either schemaName or schemaVersionId must be provided in options");
|
|
12
|
-
}
|
|
13
|
-
const req = new validation_pb_1.CheckSchemaCompatibilityRequest();
|
|
14
|
-
req.setDefinition((0, mappers_1.toSchemaDefinitionBytes)(schemaDefinition));
|
|
15
|
-
req.setDataFormat((0, mappers_1.mapSchemaDataFormatToGrpc)(dataFormat));
|
|
16
|
-
if (schemaName !== undefined) {
|
|
17
|
-
req.setSchemaName(schemaName);
|
|
18
|
-
}
|
|
19
|
-
else if (schemaVersionId !== undefined) {
|
|
20
|
-
req.setSchemaVersionId(schemaVersionId);
|
|
21
|
-
}
|
|
22
|
-
utils_1.debug.command("checkSchemaCompatibility: %O", {
|
|
23
|
-
schemaName,
|
|
24
|
-
schemaVersionId,
|
|
25
|
-
dataFormat,
|
|
26
|
-
definitionLength: typeof schemaDefinition === "string"
|
|
27
|
-
? schemaDefinition.length
|
|
28
|
-
: schemaDefinition.byteLength,
|
|
29
|
-
options: baseOptions,
|
|
30
|
-
});
|
|
31
|
-
utils_1.debug.command_grpc("checkSchemaCompatibility: %g", req);
|
|
32
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "checkSchemaCompatibility", (client) => new Promise((resolve, reject) => {
|
|
33
|
-
client.checkSchemaCompatibility(req, ...this.callArguments(baseOptions), (error, response) => {
|
|
34
|
-
if (error)
|
|
35
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
36
|
-
const success = response?.getSuccess();
|
|
37
|
-
if (success) {
|
|
38
|
-
return resolve({
|
|
39
|
-
isCompatible: true,
|
|
40
|
-
schemaVersionId: success.getSchemaVersionId(),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const failure = response?.getFailure();
|
|
44
|
-
if (failure) {
|
|
45
|
-
return resolve({
|
|
46
|
-
isCompatible: false,
|
|
47
|
-
errors: failure
|
|
48
|
-
.getErrorsList()
|
|
49
|
-
.map(mappers_1.mapGrpcSchemaCompatibilityError),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
// Default to incompatible with no errors if response is empty
|
|
53
|
-
return resolve({
|
|
54
|
-
isCompatible: false,
|
|
55
|
-
errors: [],
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}));
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=checkSchemaCompatibility.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkSchemaCompatibility.js","sourceRoot":"","sources":["../../src/schemaRegistry/checkSchemaCompatibility.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,iGAAgH;AAEhH,sCAAmC;AACnC,oCAAwD;AAMxD,6CAIyB;AAiBzB,eAAM,CAAC,SAAS,CAAC,wBAAwB,GAAG,KAAK,WAE/C,gBAAqC,EACrC,OAAwC;IAExC,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAE5E,IAAI,CAAC,UAAU,IAAI,CAAC,eAAe,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,+CAA+B,EAAE,CAAC;IAClD,GAAG,CAAC,aAAa,CAAC,IAAA,iCAAuB,EAAC,gBAAgB,CAAC,CAAC,CAAC;IAC7D,GAAG,CAAC,aAAa,CAAC,IAAA,mCAAyB,EAAC,UAAU,CAAC,CAAC,CAAC;IAEzD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,MAAM,EAAE,OAAO;yBACZ,aAAa,EAAE;yBACf,GAAG,CAAC,yCAA+B,CAAC;iBACxC,CAAC,CAAC;YACL,CAAC;YAED,8DAA8D;YAC9D,OAAO,OAAO,CAAC;gBACb,YAAY,EAAE,KAAK;gBACnB,MAAM,EAAE,EAAE;aACX,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CreateSchemaOptions, CreateSchemaResult, SchemaDetails } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Creates a new schema in the schema registry.
|
|
6
|
-
* @param schemaName - The name of the schema to create.
|
|
7
|
-
* @param details - The schema details including data format and compatibility mode.
|
|
8
|
-
* @param options - Optional settings including initial schema definition.
|
|
9
|
-
* @returns The result containing schema version ID and version number if a definition was provided.
|
|
10
|
-
*/
|
|
11
|
-
createSchema(schemaName: string, details: SchemaDetails, options?: CreateSchemaOptions): Promise<CreateSchemaResult>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.createSchema = async function (schemaName, details, options = {}) {
|
|
9
|
-
const { schemaDefinition, ...baseOptions } = options;
|
|
10
|
-
const req = new schemas_pb_1.CreateSchemaRequest();
|
|
11
|
-
req.setSchemaName(schemaName);
|
|
12
|
-
req.setDetails((0, mappers_1.createGrpcSchemaDetails)(details));
|
|
13
|
-
if (schemaDefinition !== undefined) {
|
|
14
|
-
req.setSchemaDefinition((0, mappers_1.toSchemaDefinitionBytes)(schemaDefinition));
|
|
15
|
-
}
|
|
16
|
-
utils_1.debug.command("createSchema: %O", {
|
|
17
|
-
schemaName,
|
|
18
|
-
details,
|
|
19
|
-
hasDefinition: schemaDefinition !== undefined,
|
|
20
|
-
options: baseOptions,
|
|
21
|
-
});
|
|
22
|
-
utils_1.debug.command_grpc("createSchema: %g", req);
|
|
23
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "createSchema", (client) => new Promise((resolve, reject) => {
|
|
24
|
-
client.createSchema(req, ...this.callArguments(baseOptions), (error, response) => {
|
|
25
|
-
if (error)
|
|
26
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
27
|
-
const result = {};
|
|
28
|
-
if (schemaDefinition !== undefined && response) {
|
|
29
|
-
result.schemaVersionId = response.getSchemaVersionId();
|
|
30
|
-
result.versionNumber = response.getVersionNumber();
|
|
31
|
-
}
|
|
32
|
-
return resolve(result);
|
|
33
|
-
});
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=createSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSchema.js","sourceRoot":"","sources":["../../src/schemaRegistry/createSchema.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAAiG;AAEjG,sCAAmC;AACnC,oCAAwD;AAOxD,6CAGyB;AAmBzB,eAAM,CAAC,SAAS,CAAC,YAAY,GAAG,KAAK,WAEnC,UAAkB,EAClB,OAAsB,EACtB,UAA+B,EAAE;IAEjC,MAAM,EAAE,gBAAgB,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,GAAG,GAAG,IAAI,gCAAmB,EAAE,CAAC;IACtC,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC9B,GAAG,CAAC,UAAU,CAAC,IA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|
-
* Deletes a schema and all its versions from the registry.
|
|
6
|
-
* @param schemaName - The name of the schema to delete.
|
|
7
|
-
* @param options - Command options.
|
|
8
|
-
*/
|
|
9
|
-
deleteSchema(schemaName: string, options?: DeleteSchemaOptions): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
Client_1.Client.prototype.deleteSchema = async function (schemaName, options = {}) {
|
|
8
|
-
const req = new schemas_pb_1.DeleteSchemaRequest();
|
|
9
|
-
req.setSchemaName(schemaName);
|
|
10
|
-
utils_1.debug.command("deleteSchema: %O", {
|
|
11
|
-
schemaName,
|
|
12
|
-
options,
|
|
13
|
-
});
|
|
14
|
-
utils_1.debug.command_grpc("deleteSchema: %g", req);
|
|
15
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "deleteSchema", (client) => new Promise((resolve, reject) => {
|
|
16
|
-
client.deleteSchema(req, ...this.callArguments(options), (error) => {
|
|
17
|
-
if (error)
|
|
18
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
19
|
-
return resolve();
|
|
20
|
-
});
|
|
21
|
-
}));
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=deleteSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteSchema.js","sourceRoot":"","sources":["../../src/schemaRegistry/deleteSchema.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAAiG;AAEjG,sCAAmC;AACnC,oCAAwD;AAkBxD,eAAM,CAAC,SAAS,CAAC,YAAY,GAAG,KAAK,WAEnC,UAAkB,EAClB,UAA+B,EAAE;IAEjC,MAAM,GAAG,GAAG,IAAI,gCAAmB,EAAE,CAAC;IACtC,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAE9B,aAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE;QAChC,UAAU;QACV,OAAO;KACR,CAAC,CAAC;IACH,aAAK,CAAC,YAAY,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAE5C,OAAO,IAAI,CAAC,OAAO,CACjB,6CAA2B,EAC3B,cAAc,EACd,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACpC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;YACjE,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;YACvD,OAAO,OAAO,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DeleteSchemaVersionsOptions, DeleteSchemaVersionsResult } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Deletes specific versions of a schema.
|
|
6
|
-
* @param schemaName - The name of the schema.
|
|
7
|
-
* @param versions - The version numbers to delete.
|
|
8
|
-
* @param options - Command options.
|
|
9
|
-
* @returns Any errors that occurred during deletion.
|
|
10
|
-
*/
|
|
11
|
-
deleteSchemaVersions(schemaName: string, versions: number[], options?: DeleteSchemaVersionsOptions): Promise<DeleteSchemaVersionsResult>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.deleteSchemaVersions = async function (schemaName, versions, options = {}) {
|
|
9
|
-
const req = new schemas_pb_1.DeleteSchemaVersionsRequest();
|
|
10
|
-
req.setSchemaName(schemaName);
|
|
11
|
-
req.setVersionsList(versions);
|
|
12
|
-
utils_1.debug.command("deleteSchemaVersions: %O", {
|
|
13
|
-
schemaName,
|
|
14
|
-
versions,
|
|
15
|
-
options,
|
|
16
|
-
});
|
|
17
|
-
utils_1.debug.command_grpc("deleteSchemaVersions: %g", req);
|
|
18
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "deleteSchemaVersions", (client) => new Promise((resolve, reject) => {
|
|
19
|
-
client.deleteSchemaVersions(req, ...this.callArguments(options), (error, response) => {
|
|
20
|
-
if (error)
|
|
21
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
22
|
-
const errors = response?.getErrorsList() ?? [];
|
|
23
|
-
return resolve({
|
|
24
|
-
errors: errors.map(mappers_1.mapGrpcSchemaVersionError),
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=deleteSchemaVersions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteSchemaVersions.js","sourceRoot":"","sources":["../../src/schemaRegistry/deleteSchemaVersions.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAAyG;AAEzG,sCAAmC;AACnC,oCAAwD;AACxD,6CAA4D;AAwB5D,eAAM,CAAC,SAAS,CAAC,oBAAoB,GAAG,KAAK,WAE3C,UAAkB,EAClB,QAAkB,EAClB,UAAuC,EAAE;IAEzC,MAAM,GAAG,GAAG,IAAI,wCAA2B,EAAE,CAAC;IAC9C,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC9B,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE9B,aAAK,CAAC,OAAO,CAAC,0BAA0B,EAAE;QACxC,UAAU;QACV,QAAQ;QACR,OAAO;KACR,CAAC,CAAC;IACH,aAAK,CAAC,YAAY,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IAEpD,OAAO,IAAI,CAAC,OAAO,CACjB,6CAA2B,EAC3B,sBAAsB,EACtB,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,OAAO,CAA6B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1D,MAAM,CAAC,oBAAoB,CACzB,GAAG,EACH,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAC9B,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAClB,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;YAEvD,MAAM,MAAM,GAAG,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;YAC/C,OAAO,OAAO,CAAC;gBACb,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,mCAAyB,CAAC;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { GetSchemaOptions, Schema } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves schema metadata by name.
|
|
6
|
-
* @param schemaName - The name of the schema to retrieve.
|
|
7
|
-
* @param options - Command options.
|
|
8
|
-
* @returns The schema metadata.
|
|
9
|
-
*/
|
|
10
|
-
getSchema(schemaName: string, options?: GetSchemaOptions): Promise<Schema>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.getSchema = async function (schemaName, options = {}) {
|
|
9
|
-
const req = new schemas_pb_1.GetSchemaRequest();
|
|
10
|
-
req.setSchemaName(schemaName);
|
|
11
|
-
utils_1.debug.command("getSchema: %O", {
|
|
12
|
-
schemaName,
|
|
13
|
-
options,
|
|
14
|
-
});
|
|
15
|
-
utils_1.debug.command_grpc("getSchema: %g", req);
|
|
16
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "getSchema", (client) => new Promise((resolve, reject) => {
|
|
17
|
-
client.getSchema(req, ...this.callArguments(options), (error, response) => {
|
|
18
|
-
if (error)
|
|
19
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
20
|
-
const grpcSchema = response?.getSchema();
|
|
21
|
-
if (!grpcSchema) {
|
|
22
|
-
return reject(new Error("Schema not found in response"));
|
|
23
|
-
}
|
|
24
|
-
return resolve((0, mappers_1.mapGrpcSchema)(grpcSchema));
|
|
25
|
-
});
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=getSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSchema.js","sourceRoot":"","sources":["../../src/schemaRegistry/getSchema.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAA8F;AAE9F,sCAAmC;AACnC,oCAAwD;AAGxD,6CAAgD;AAchD,eAAM,CAAC,SAAS,CAAC,SAAS,GAAG,KAAK,WAEhC,UAAkB,EAClB,UAA4B,EAAE;IAE9B,MAAM,GAAG,GAAG,IAAI,6BAAgB,EAAE,CAAC;IACnC,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAE9B,aAAK,CAAC,OAAO,CAAC,eAAe,EAAE;QAC7B,UAAU;QACV,OAAO;KACR,CAAC,CAAC;IACH,aAAK,CAAC,YAAY,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IAEzC,OAAO,IAAI,CAAC,OAAO,CACjB,6CAA2B,EAC3B,WAAW,EACX,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,CAAC,SAAS,CACd,GAAG,EACH,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAC9B,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAClB,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;YAEvD,MAAM,UAAU,GAAG,QAAQ,EAAE,SAAS,EAAE,CAAC;YACzC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;YAC3D,CAAC;YAED,OAAO,OAAO,CAAC,IAAA,uBAAa,EAAC,UAAU,CAAC,CAAC,CAAC;QAC5C,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { GetSchemaVersionOptions, SchemaVersion } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves a schema version by schema name and optional version number.
|
|
6
|
-
* @param schemaName - The name of the schema.
|
|
7
|
-
* @param options - Options including specific version number. If not provided, returns the latest version.
|
|
8
|
-
* @returns The schema version details.
|
|
9
|
-
*/
|
|
10
|
-
getSchemaVersion(schemaName: string, options?: GetSchemaVersionOptions): Promise<SchemaVersion>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.getSchemaVersion = async function (schemaName, options = {}) {
|
|
9
|
-
const { versionNumber, ...baseOptions } = options;
|
|
10
|
-
const req = new schemas_pb_1.GetSchemaVersionRequest();
|
|
11
|
-
req.setSchemaName(schemaName);
|
|
12
|
-
if (versionNumber !== undefined) {
|
|
13
|
-
req.setVersionNumber(versionNumber);
|
|
14
|
-
}
|
|
15
|
-
utils_1.debug.command("getSchemaVersion: %O", {
|
|
16
|
-
schemaName,
|
|
17
|
-
versionNumber,
|
|
18
|
-
options: baseOptions,
|
|
19
|
-
});
|
|
20
|
-
utils_1.debug.command_grpc("getSchemaVersion: %g", req);
|
|
21
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "getSchemaVersion", (client) => new Promise((resolve, reject) => {
|
|
22
|
-
client.getSchemaVersion(req, ...this.callArguments(baseOptions), (error, response) => {
|
|
23
|
-
if (error)
|
|
24
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
25
|
-
const version = response?.getVersion();
|
|
26
|
-
if (!version) {
|
|
27
|
-
return reject(new Error("Schema version not found in response"));
|
|
28
|
-
}
|
|
29
|
-
return resolve((0, mappers_1.mapGrpcSchemaVersion)(version));
|
|
30
|
-
});
|
|
31
|
-
}));
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=getSchemaVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaVersion.js","sourceRoot":"","sources":["../../src/schemaRegistry/getSchemaVersion.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAAqG;AAErG,sCAAmC;AACnC,oCAAwD;AAGxD,6CAAuD;AAiBvD,eAAM,CAAC,SAAS,CAAC,gBAAgB,GAAG,KAAK,WAEvC,UAAkB,EAClB,UAAmC,EAAE;IAErC,MAAM,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,GAAG,GAAG,IAAI,oCAAuB,EAAE,CAAC;IAC1C,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAE9B,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,GAAG,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAED,aAAK,CAAC,OAAO,CAAC,sBAAsB,EAAE;QACpC,UAAU;QACV,aAAa;QACb,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;IACH,aAAK,CAAC,YAAY,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;IAEhD,OAAO,IAAI,CAAC,OAAO,CACjB,6CAA2B,EAC3B,kBAAkB,EAClB,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,CAAC,gBAAgB,CACrB,GAAG,EACH,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAClC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAClB,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;YAEvD,MAAM,OAAO,GAAG,QAAQ,EAAE,UAAU,EAAE,CAAC;YACvC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;YACnE,CAAC;YAED,OAAO,OAAO,CAAC,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC,CAAC;QAChD,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { GetSchemaVersionByIdOptions, SchemaVersion } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves a schema version by its unique version ID.
|
|
6
|
-
* @param schemaVersionId - The unique identifier of the schema version.
|
|
7
|
-
* @param options - Command options.
|
|
8
|
-
* @returns The schema version details.
|
|
9
|
-
*/
|
|
10
|
-
getSchemaVersionById(schemaVersionId: string, options?: GetSchemaVersionByIdOptions): Promise<SchemaVersion>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.getSchemaVersionById = async function (schemaVersionId, options = {}) {
|
|
9
|
-
const req = new schemas_pb_1.GetSchemaVersionByIdRequest();
|
|
10
|
-
req.setSchemaVersionId(schemaVersionId);
|
|
11
|
-
utils_1.debug.command("getSchemaVersionById: %O", {
|
|
12
|
-
schemaVersionId,
|
|
13
|
-
options,
|
|
14
|
-
});
|
|
15
|
-
utils_1.debug.command_grpc("getSchemaVersionById: %g", req);
|
|
16
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "getSchemaVersionById", (client) => new Promise((resolve, reject) => {
|
|
17
|
-
client.getSchemaVersionById(req, ...this.callArguments(options), (error, response) => {
|
|
18
|
-
if (error)
|
|
19
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
20
|
-
const version = response?.getVersion();
|
|
21
|
-
if (!version) {
|
|
22
|
-
return reject(new Error("Schema version not found in response"));
|
|
23
|
-
}
|
|
24
|
-
return resolve((0, mappers_1.mapGrpcSchemaVersion)(version));
|
|
25
|
-
});
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=getSchemaVersionById.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaVersionById.js","sourceRoot":"","sources":["../../src/schemaRegistry/getSchemaVersionById.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAAyG;AAEzG,sCAAmC;AACnC,oCAAwD;AAGxD,6CAAuD;AAiBvD,eAAM,CAAC,SAAS,CAAC,oBAAoB,GAAG,KAAK,WAE3C,eAAuB,EACvB,UAAuC,EAAE;IAEzC,MAAM,GAAG,GAAG,IAAI,wCAA2B,EAAE,CAAC;IAC9C,GAAG,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAExC,aAAK,CAAC,OAAO,CAAC,0BAA0B,EAAE;QACxC,eAAe;QACf,OAAO;KACR,CAAC,CAAC;IACH,aAAK,CAAC,YAAY,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IAEpD,OAAO,IAAI,CAAC,OAAO,CACjB,6CAA2B,EAC3B,sBAAsB,EACtB,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,CAAC,oBAAoB,CACzB,GAAG,EACH,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAC9B,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAClB,IAAI,KAAK;gBAAE,OAAO,MAAM,CAAC,IAAA,6BAAqB,EAAC,KAAK,CAAC,CAAC,CAAC;YAEvD,MAAM,OAAO,GAAG,QAAQ,EAAE,UAAU,EAAE,CAAC;YACvC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC,CAAC;YACnE,CAAC;YAED,OAAO,OAAO,CAAC,IAAA,8BAAoB,EAAC,OAAO,CAAC,CAAC,CAAC;QAChD,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./createSchema";
|
|
2
|
-
export * from "./updateSchema";
|
|
3
|
-
export * from "./deleteSchema";
|
|
4
|
-
export * from "./getSchema";
|
|
5
|
-
export * from "./listSchemas";
|
|
6
|
-
export * from "./lookupSchemaName";
|
|
7
|
-
export * from "./registerSchemaVersion";
|
|
8
|
-
export * from "./deleteSchemaVersions";
|
|
9
|
-
export * from "./getSchemaVersion";
|
|
10
|
-
export * from "./getSchemaVersionById";
|
|
11
|
-
export * from "./listSchemaVersions";
|
|
12
|
-
export * from "./listRegisteredSchemas";
|
|
13
|
-
export * from "./checkSchemaCompatibility";
|
|
14
|
-
export * from "./types";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Schema Management
|
|
18
|
-
__exportStar(require("./createSchema"), exports);
|
|
19
|
-
__exportStar(require("./updateSchema"), exports);
|
|
20
|
-
__exportStar(require("./deleteSchema"), exports);
|
|
21
|
-
__exportStar(require("./getSchema"), exports);
|
|
22
|
-
__exportStar(require("./listSchemas"), exports);
|
|
23
|
-
__exportStar(require("./lookupSchemaName"), exports);
|
|
24
|
-
// Schema Version Management
|
|
25
|
-
__exportStar(require("./registerSchemaVersion"), exports);
|
|
26
|
-
__exportStar(require("./deleteSchemaVersions"), exports);
|
|
27
|
-
__exportStar(require("./getSchemaVersion"), exports);
|
|
28
|
-
__exportStar(require("./getSchemaVersionById"), exports);
|
|
29
|
-
__exportStar(require("./listSchemaVersions"), exports);
|
|
30
|
-
__exportStar(require("./listRegisteredSchemas"), exports);
|
|
31
|
-
// Schema Compatibility
|
|
32
|
-
__exportStar(require("./checkSchemaCompatibility"), exports);
|
|
33
|
-
// Types
|
|
34
|
-
__exportStar(require("./types"), exports);
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemaRegistry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,iDAA+B;AAC/B,iDAA+B;AAC/B,iDAA+B;AAC/B,8CAA4B;AAC5B,gDAA8B;AAC9B,qDAAmC;AAEnC,4BAA4B;AAC5B,0DAAwC;AACxC,yDAAuC;AACvC,qDAAmC;AACnC,yDAAuC;AACvC,uDAAqC;AACrC,0DAAwC;AAExC,uBAAuB;AACvB,6DAA2C;AAE3C,QAAQ;AACR,0CAAwB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ListRegisteredSchemasOptions, RegisteredSchema } from "./types";
|
|
2
|
-
declare module "../Client" {
|
|
3
|
-
interface Client {
|
|
4
|
-
/**
|
|
5
|
-
* Lists schemas with their latest version information.
|
|
6
|
-
* @param options - Filter and command options.
|
|
7
|
-
* @returns An array of registered schemas with their latest versions.
|
|
8
|
-
*/
|
|
9
|
-
listRegisteredSchemas(options?: ListRegisteredSchemasOptions): Promise<RegisteredSchema[]>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const service_grpc_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/service_grpc_pb");
|
|
4
|
-
const schemas_pb_1 = require("../../generated/kurrentdb/protocols/v2/registry/schemas_pb");
|
|
5
|
-
const Client_1 = require("../Client");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const mappers_1 = require("./utils/mappers");
|
|
8
|
-
Client_1.Client.prototype.listRegisteredSchemas = async function (options = {}) {
|
|
9
|
-
const { schemaVersionId, schemaNamePrefix, schemaTags, includeDefinition = false, ...baseOptions } = options;
|
|
10
|
-
const req = new schemas_pb_1.ListRegisteredSchemasRequest();
|
|
11
|
-
if (schemaVersionId !== undefined) {
|
|
12
|
-
req.setSchemaVersionId(schemaVersionId);
|
|
13
|
-
}
|
|
14
|
-
if (schemaNamePrefix !== undefined) {
|
|
15
|
-
req.setSchemaNamePrefix(schemaNamePrefix);
|
|
16
|
-
}
|
|
17
|
-
if (schemaTags !== undefined) {
|
|
18
|
-
const tagsMap = req.getSchemaTagsMap();
|
|
19
|
-
for (const [key, value] of Object.entries(schemaTags)) {
|
|
20
|
-
tagsMap.set(key, value);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
req.setIncludeDefinition(includeDefinition);
|
|
24
|
-
utils_1.debug.command("listRegisteredSchemas: %O", {
|
|
25
|
-
schemaVersionId,
|
|
26
|
-
schemaNamePrefix,
|
|
27
|
-
schemaTags,
|
|
28
|
-
includeDefinition,
|
|
29
|
-
options: baseOptions,
|
|
30
|
-
});
|
|
31
|
-
utils_1.debug.command_grpc("listRegisteredSchemas: %g", req);
|
|
32
|
-
return this.execute(service_grpc_pb_1.SchemaRegistryServiceClient, "listRegisteredSchemas", (client) => new Promise((resolve, reject) => {
|
|
33
|
-
client.listRegisteredSchemas(req, ...this.callArguments(baseOptions), (error, response) => {
|
|
34
|
-
if (error)
|
|
35
|
-
return reject((0, utils_1.convertToCommandError)(error));
|
|
36
|
-
const schemas = response?.getSchemasList() ?? [];
|
|
37
|
-
return resolve(schemas.map(mappers_1.mapGrpcRegisteredSchema));
|
|
38
|
-
});
|
|
39
|
-
}));
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=listRegisteredSchemas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listRegisteredSchemas.js","sourceRoot":"","sources":["../../src/schemaRegistry/listRegisteredSchemas.ts"],"names":[],"mappings":";;AAAA,qGAA8G;AAC9G,2FAA0G;AAE1G,sCAAmC;AACnC,oCAAwD;AAGxD,6CAA0D;AAe1D,eAAM,CAAC,SAAS,CAAC,qBAAqB,GAAG,KAAK,WAE5C,UAAwC,EAAE;IAE1C,MAAM,EACJ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,GAAG,KAAK,EACzB,GAAG,WAAW,EACf,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,IAAI,yCAA4B,EAAE,CAAC;IAE/C,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,GAAG,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,GAAG,CAAC,mBAAmB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