Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/config/nodejs-dev.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"functions/log/helloWorld",
"functions/log/processEntry",
"functions/memorystore/redis",
"functions/ocr/app",
"functions/pubsub/publish",
"functions/pubsub/subscribe",
"functions/scheduleinstance",
Expand Down
1 change: 0 additions & 1 deletion .github/config/nodejs-prod.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"document-ai", // [ERR_REQUIRE_ESM]: require() of ES Module
"functions/billing", // (untested) Error: Request failed with status code 500
"functions/imagemagick", // (untested) Error: A bucket name is needed to use Cloud Storage
"functions/ocr/app", // (untested) Error: Bucket not provided. Make sure you have a "bucket" property in your request
"functions/slack", // TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type ... Received undefined
"functions/v2/imagemagick", // (untested) Error: A bucket name is needed to use Cloud Storage.
"healthcare/fhir", // Error: Cannot find module 'whatwg-url'
Expand Down
9 changes: 9 additions & 0 deletions functions/ocr/app/ci-setup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"env": {
"FUNCTIONS_BUCKET": "nodejs-docs-samples-tests",
"RESULT_BUCKET": "nodejs-docs-samples-tests",
"TRANSLATE_TOPIC": "integration-tests-instance",
"RESULT_TOPIC": "integration-tests-instance",
"TO_LANG": "en,es"
}
}
3 changes: 1 addition & 2 deletions functions/ocr/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ const translate = new Translate();
const publishResult = async (topicName, data) => {
const dataBuffer = Buffer.from(JSON.stringify(data));

const [topic] = await pubsub.topic(topicName).get({autoCreate: true});
topic.publishMessage({data: dataBuffer});
pubsub.topic(topicName).publishMessage(dataBuffer);
};

// [START functions_ocr_detect]
Expand Down
Loading