@salesforce/salesforce-sdk
Salesforce SDK for Node.js
Last updated a month ago by dhagberg-sf .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @salesforce/salesforce-sdk 
SYNC missed versions from official npm registry.

CircleCI

Salesforce Function SDK for Node.js

Note: This feature is in beta and has been released early so we can collect feedback. It may contain significant problems, undergo major changes, or be discontinued. The use of this feature is governed by the Salesforce.com Program Agreement.

Usage

import * as sdk from 'salesforce-sdk';

export default async function execute(event: sdk.InvocationEvent, context: sdk.Context, logger: sdk.Logger): Promise<any> {
    debugger;

    // Invoke function
    const fx: HelloFunction = new HelloFunction(event, context, logger);
    const response = await fx.invoke();

    return JSON.stringify(response);
}


class HelloFunction {

    constructor(private readonly event: sdk.InvocationEvent,
                private readonly context: sdk.Context,
                private readonly logger: sdk.Logger) {
        this.logger = context.logger;
        this.logger.info(`${this.getName()}.init()`);
    }

    public getName(): string {
        return this.constructor.name;
    }

    public async invoke(): Promise<any>  {
        this.logger.info(`${this.getName()}.invoke()`);

        const results = await this.context.org.data.query('SELECT Name FROM Account');
        this.logger.info(JSON.stringify(query));

        return results;
    }
}

Publish salesforce-sdk

salesforce-sdk is published to https://www.npmjs.com/package/@salesforce/salesforce-sdk.

Note: Requires access to @salesforce/salesforce-sdk.

To publish to @salesforce/salesforce-sdk:

  1. Ensure you have latest source locally.
git pull
...
  1. Install, build & test.
yarn install
...

yarn test
...
  134 passing (176ms)

...
$ eslint src --ext .ts
Done in 11.43s.

Ensure that code coverage meets standards.

  1. Increment version in package.json.

If applicable, can use npm version.

TODO: Decide when to git-tag version.

  1. Publish to npmjs.com.
npm publish
...

May use np, eg:

np 1.0.1 --no-release-draft --tag=1.0.1 --any-branch
  1. Test and push to repo.
yarn install
...

git commit -a -m "<updated-version>"
...

git push
...

TODO: Decide when to git-tag version.

Current Tags

  • 1.3.0                                ...           latest (a month ago)

8 Versions

  • 1.3.0                                ...           a month ago
  • 1.2.0                                ...           3 months ago
  • 1.1.2                                ...           4 months ago
  • 1.1.1                                ...           4 months ago
  • 1.1.0                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
  • 0.0.1-develop.12                                ...           6 months ago
  • 0.0.1-develop.11                                ...           6 months ago

Copyright 2014 - 2016 © taobao.org |