diff --git a/README.md b/README.md index 6115837..140db09 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Heroku Integration - Salesforce SDK for Node.js +# Node.js SDK for Heroku AppLink -Use the Salesforce SDK for Node.js to develop [Heroku Integration](https://devcenter.heroku.com/articles/heroku-integration) managed apps that interact with Salesforce and Data Cloud orgs. +Use the Node.js SDK for Heroku AppLink to develop [Heroku AppLink](https://devcenter.heroku.com/articles/applink) managed apps that interact with Salesforce and Data Cloud orgs. -Salesforce SDK for Node.js provides: + Node.js SDK for Heroku AppLink provides: - Utilities to parse requests from Salesforce Heroku-type [External Services](https://help.salesforce.com/s/articleView?id=sf.external_services.htm&type=5) and Data Cloud [Data Action Targets](https://help.salesforce.com/s/articleView?id=sf.c360_a_create_a_data_action_target_of_webhook_type.htm&type=5) hydrating SDK objects that response the request: [InvocationEvent](docs/interfaces/InvocationEvent.md) and [Context](docs/interfaces/Context.md). - Objects that encapsulate the requesting Salesforce or Data Cloud [Org](docs/interfaces/Org.md) and [User](docs/interfaces/User.md). @@ -14,7 +14,7 @@ And much more! For more information, see [API docs](docs/README.md). ## Example -Example use of the Salesforce SDK for Node.js provided as part of the [Heroku Integration CLI Plugin's](https://github.com/heroku/heroku-cli-plugin-integration) `integration:project` template: +Example use of the Node.js SDK for Heroku AppLink provided as part of the [Heroku AppLink CLI Plugin's](https://github.com/heroku/heroku-cli-plugin-applnk) `applink:project` template: ```javascript fastify.get('/accounts', async function (request, reply) { const {event, context, logger} = request.sdk; @@ -26,10 +26,10 @@ fastify.get('/accounts', async function (request, reply) { if (process.env.SALESFORCE_ORG_NAME) { // If an org reference is set, query Accounts in that org const orgName = process.env.SALESFORCE_ORG_NAME; - const herokuIntegrationAddon = request.sdk.addons.herokuIntegration; + const applinkAddon = request.sdk.addons.applink; - logger.info(`Getting org '${orgName}' connection from Heroku Integration add-on...`); - const anotherOrg = await herokuIntegrationAddon.getConnection(orgName); + logger.info(`Getting org '${orgName}' connection from Heroku Applink add-on...`); + const anotherOrg = await applinkAddon.getConnection(orgName); logger.info(`Querying org '${orgName}' (${anotherOrg.id}) Accounts...`); try { diff --git a/docs/functions/init.md b/docs/functions/init.md index c3a9892..0016c6d 100644 --- a/docs/functions/init.md +++ b/docs/functions/init.md @@ -22,13 +22,13 @@ Functional organized modules having helper methods for addons, Data Cloud, and S addons: object; ``` -### addons.herokuIntegration +### addons.applink ```ts -herokuIntegration: object; +applink: object; ``` -### addons.herokuIntegration.getConnection() +### addons.applink.getConnection() ```ts getConnection: (name) => Promise; diff --git a/src/add-ons/heroku-integration.ts b/src/add-ons/heroku-applink.ts similarity index 80% rename from src/add-ons/heroku-integration.ts rename to src/add-ons/heroku-applink.ts index 1b4a09f..b5af11b 100644 --- a/src/add-ons/heroku-integration.ts +++ b/src/add-ons/heroku-applink.ts @@ -21,14 +21,14 @@ export async function getConnection(name: string): Promise { throw Error(`Connection name not provided`); } - const addonEndpoint = process.env.HEROKU_INTEGRATION_API_URL || process.env.HEROKU_INTEGRATION_STAGING_API_URL; + const addonEndpoint = process.env.HEROKU_APPLINK_API_URL || process.env.HEROKU_APPLINK_STAGING_API_URL; if (!addonEndpoint) { - throw Error(`Heroku Integration add-on not provisioned on app or endpoint not provided`); + throw Error(`Heroku Applink add-on not provisioned on app or endpoint not provided`); } - const addonAuthToken = process.env.HEROKU_INTEGRATION_TOKEN; + const addonAuthToken = process.env.HEROKU_APPLINK_TOKEN; if (!addonAuthToken) { - throw Error(`Heroku Integration add-on not provisioned on app or authorization token not found`); + throw Error(`Heroku Applink add-on not provisioned on app or authorization token not found`); } const authUrl = `${addonEndpoint}/invocations/authorization`; diff --git a/src/index.ts b/src/index.ts index 8f4972a..22b0a27 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ import { ContextImpl } from "./sdk/context.js"; import { InvocationEventImpl } from "./sdk/invocation-event.js"; import { LoggerImpl } from "./sdk/logger.js"; import { QueryOperation } from "jsforce/lib/api/bulk"; -import { getConnection } from "./add-ons/heroku-integration.js"; +import { getConnection } from "./add-ons/heroku-applink.js"; const CONTENT_TYPE_HEADER = "Content-Type"; const X_CLIENT_CONTEXT_HEADER = "x-client-context"; @@ -24,7 +24,7 @@ const X_CLIENT_CONTEXT_HEADER = "x-client-context"; export function init() { return { addons: { - herokuIntegration: { + applink: { getConnection } },