Skip to content

Rename things to Applink #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).
Expand All @@ -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;
Expand All @@ -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);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be getAuthorization(orgName[, addonName]). Likely change later, yeah?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwallsfdc yep that will be a separate PR. Wanted to keep this scoped to just renaming

logger.info(`Querying org '${orgName}' (${anotherOrg.id}) Accounts...`);
try {
Expand Down
6 changes: 3 additions & 3 deletions docs/functions/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Org>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export async function getConnection(name: string): Promise<Org> {
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`;
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -24,7 +24,7 @@ const X_CLIENT_CONTEXT_HEADER = "x-client-context";
export function init() {
return {
addons: {
herokuIntegration: {
applink: {
getConnection
}
},
Expand Down
Loading