@sebspark/pubsub
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -53,15 +53,12 @@ "use strict"; | ||
var createOrGetTopic = async (client, name, schemaData) => { | ||
const [topic] = await client.topic(name).get({ autoCreate: true }); | ||
if (!schemaData) { | ||
return topic; | ||
const [exists] = await client.topic(name).exists(); | ||
if (exists) { | ||
const [topic2] = await client.topic(name).get(); | ||
return topic2; | ||
} | ||
const [topicMetadata] = await topic.getMetadata(); | ||
const topicSchemaMetadata = topicMetadata.schemaSettings; | ||
await topic.setMetadata({ | ||
...topicMetadata, | ||
const [topic] = await client.createTopic({ | ||
name, | ||
schemaSettings: { | ||
encoding: "JSON", | ||
firstRevisionId: (topicSchemaMetadata == null ? void 0 : topicSchemaMetadata.firstRevisionId) ?? schemaData.revisionId, | ||
lastRevisionId: schemaData.revisionId, | ||
schema: schemaData.name | ||
schema: schemaData == null ? void 0 : schemaData.name, | ||
encoding: import_pubsub.Encodings.Json | ||
} | ||
@@ -68,0 +65,0 @@ }); |
{ | ||
"name": "@sebspark/pubsub", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
23769
340