-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump eslint-plugin-jsdoc from 46.5.1 to 48.2.6 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 46.5.1 to 48.2.6. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](gajus/eslint-plugin-jsdoc@v46.5.1...v48.2.6) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * #285: allow customizing headers for patch, put and post calls this is a copy of what phjulia pushed earlier but with fixed jsdocs * #285: eslint -fix * #285: upgrade eslint, eslint-config-prettier, eslint-plugin-prettier, eslint-plugin-unicorn, prettier-eslint; add prettier * #285: jsdoc rules copied from mcdev * #300: fixing bad jsdocs that break typescript tests * #300: enable typescript validation * #300: fixes for typescript validation * #300: add exports section in package.json * #300: add automatic d.ts generation and update husky * #309: fix postcheck failing on checkout of develop branch * #309: auto-run npm install if changes to package-lock were found * Bump sinon from 15.2.0 to 18.0.0 Bumps [sinon](https://github.com/sinonjs/sinon) from 15.2.0 to 18.0.0. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md) - [Commits](sinonjs/sinon@v15.2.0...v18.0.0) --- updated-dependencies: - dependency-name: sinon dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Bump eslint-plugin-prettier from 5.0.0 to 5.1.3 Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.0.0 to 5.1.3. - [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases) - [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md) - [Commits](prettier/eslint-plugin-prettier@v5.0.0...v5.1.3) --- updated-dependencies: - dependency-name: eslint-plugin-prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump axios-mock-adapter from 1.21.5 to 1.22.0 Bumps [axios-mock-adapter](https://github.com/ctimmerm/axios-mock-adapter) from 1.21.5 to 1.22.0. - [Release notes](https://github.com/ctimmerm/axios-mock-adapter/releases) - [Changelog](https://github.com/ctimmerm/axios-mock-adapter/blob/master/CHANGELOG.md) - [Commits](ctimmerm/axios-mock-adapter@v1.21.5...v1.22.0) --- updated-dependencies: - dependency-name: axios-mock-adapter dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump assert from 2.0.0 to 2.1.0 Bumps [assert](https://github.com/browserify/commonjs-assert) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/browserify/commonjs-assert/releases) - [Changelog](https://github.com/browserify/commonjs-assert/blob/main/CHANGELOG.md) - [Commits](browserify/commonjs-assert@v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: assert dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * #318 EsLint Update plus General Actions Update (#319) * #318 EsLint Update plus General Actions Update * #318 intent issue and dep update --------- Co-authored-by: Douglas Midgley <[email protected]> * Chores/318 update eslint (#335) * #318 EsLint Update plus General Actions Update * #318 intent issue and dep update * #318: restrict eslint scope and general update --------- Co-authored-by: Douglas Midgley <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Doug Midgley <[email protected]> Co-authored-by: Douglas Midgley <[email protected]>
- Loading branch information
1 parent
143abbc
commit 4b2c741
Showing
34 changed files
with
3,378 additions
and
2,656 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "main" | ||
- uses: release-drafter/release-drafter@v5 | ||
- uses: release-drafter/release-drafter@v6 | ||
id: create_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
node-version: 22 | ||
registry-url: https://registry.npmjs.org/ | ||
- uses: HarmvZ/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
#!/bin/sh | ||
# ### git commit message template ### | ||
git config commit.template .git/templatemessage | ||
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '((feature|bug|bugfix|fix|hotfix|task|chore)\/)\K\d{1,7}'` | ||
echo "[POST_CHECKOUT] Setting template commit to $TICKETID" | ||
echo "#$TICKETID: " > ".git/templatemessage" | ||
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '^((feature|bug|bugfix|fix|hotfix|task|chore)\/)?\K\d{1,7}' || true` | ||
if [ -z "$TICKETID" ] | ||
then | ||
TICKETID="0" | ||
fi | ||
TEMPLATE="#$TICKETID: " | ||
echo "[POST_CHECKOUT] Setting template commit to '$TEMPLATE'" | ||
# wrap $TEMPLATE in quotes or else it is trimmed automatically | ||
echo "$TEMPLATE" > ".git/templatemessage" | ||
|
||
|
||
# ### run npm install ### | ||
echo "[POST-CHECKOUT] 📦 Checking for changes to dependencies" | ||
# define how to split strings into array elements | ||
IFS=$'\n' | ||
# $1 is the new HEAD pointer | ||
NEWHEAD=$1 | ||
# $2 is the previous HEAD pointer | ||
OLDHEAD=$2 | ||
# extract all paths to package-lock.json files | ||
PACKAGE_LOCK_REGEX="(^package-lock\.json)" | ||
PACKAGES=$(git diff --name-only $NEWHEAD $OLDHEAD | grep -E $PACKAGE_LOCK_REGEX || true) | ||
|
||
if [[ ${PACKAGES[@]} ]]; then | ||
for package in $PACKAGES; do | ||
echo "📦 $package was changed." | ||
done | ||
echo "📦 Running npm install to update your dependencies..." | ||
npm install | ||
npm run lint:fix | ||
else | ||
echo "📦 All packages up-to-date. No need to run npm install." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# update typescript type declarations | ||
npx tsc | ||
git add @types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"tabWidth": 4, | ||
"printWidth": 100, | ||
"singleQuote": true | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"js/ts.implicitProjectConfig.checkJs": true, | ||
"javascript.validate.enable": true, | ||
"eslint.useESLintClass": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Class which handles authentication logic | ||
*/ | ||
export default class Auth { | ||
/** | ||
* Creates an instance of Auth. | ||
* | ||
* @param {object} authObject Auth Payload | ||
* @param {string} authObject.client_id Client Id from SFMC config | ||
* @param {string} authObject.client_secret Client Secret from SFMC config | ||
* @param {number} authObject.account_id MID of Business Unit used for API Calls | ||
* @param {string} authObject.auth_url Auth URL from SFMC config | ||
* @param {string[]} [authObject.scope] Array of scopes used for requests | ||
* @param {object} options options for the SDK as a whole, for example collection of handler functions, or retry settings | ||
*/ | ||
constructor(authObject: { | ||
client_id: string; | ||
client_secret: string; | ||
account_id: number; | ||
auth_url: string; | ||
scope?: string[]; | ||
}, options: object); | ||
authObject: { | ||
client_id: string; | ||
client_secret: string; | ||
account_id: number; | ||
auth_url: string; | ||
scope?: string[]; | ||
}; | ||
options: any; | ||
/** | ||
* | ||
* | ||
* @param {boolean} [forceRefresh] used to enforce a refresh of token | ||
* @param {number} [remainingAttempts] number of retries in case of issues | ||
* @returns {Promise.<object>} current session information | ||
*/ | ||
getAccessToken(forceRefresh?: boolean, remainingAttempts?: number): Promise<object>; | ||
/** | ||
* Helper to get back list of scopes supported by SDK | ||
* | ||
* @returns {string[]} array of potential scopes | ||
*/ | ||
getSupportedScopes(): string[]; | ||
} | ||
//# sourceMappingURL=auth.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Class main handler for the SDK | ||
*/ | ||
export default class SDK { | ||
/** | ||
* Creates an instance of SDK. | ||
* | ||
* @param {object} authObject Auth Object for making requests | ||
* @param {object} [options] options for the SDK as a whole, for example collection of handler functions, or retry settings | ||
* @param {number} [options.requestAttempts] number of retries which should be done, defaulted to 1 | ||
* @param {boolean} [options.retryOnConnectionError] should request be retried in case of connection issues | ||
* @param {object} [options.eventHandlers] collection of functions which are executed on certain events | ||
*/ | ||
constructor(authObject: object, options?: { | ||
requestAttempts?: number; | ||
retryOnConnectionError?: boolean; | ||
eventHandlers?: object; | ||
}); | ||
auth: Auth; | ||
rest: Rest; | ||
soap: Soap; | ||
} | ||
import Auth from './auth.js'; | ||
import Rest from './rest.js'; | ||
import Soap from './soap.js'; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/** | ||
* Class which handles rest endpoints | ||
*/ | ||
export default class Rest { | ||
/** | ||
* Constuctor of Rest object | ||
* | ||
* @function Object() { [native code] } | ||
* @param {object} authObject Auth object used for initializing | ||
* @param {object} options options for the SDK as a whole, for example collection of handler functions, or retry settings | ||
*/ | ||
constructor(authObject: object, options: object); | ||
auth: any; | ||
options: any; | ||
transactionalApis: string[]; | ||
/** | ||
* Method that makes the GET API request | ||
* | ||
* @param {string} url of the resource to retrieve | ||
* @returns {Promise.<object>} API response | ||
*/ | ||
get(url: string): Promise<object>; | ||
/** | ||
* helper for {@link this.getBulk} to determine if the url is a transactional message API | ||
* | ||
* @private | ||
* @param {string} url url without query params | ||
* @returns {boolean} true if the url is a transactional message API | ||
*/ | ||
private _isTransactionalMessageApi; | ||
/** | ||
* helper for {@link this.getBulk} to determine if the url is a legacy API | ||
* | ||
* @private | ||
* @param {string} url url without query params | ||
* @returns {boolean} true if the url is a legacy API | ||
*/ | ||
private _isLegacyApi; | ||
/** | ||
* Method that makes paginated GET API Requests using $pageSize and $page parameters | ||
* | ||
* @param {string} url of the resource to retrieve | ||
* @param {number} [pageSize] of the response, defaults to 50 | ||
* @param {string} [iteratorField] attribute of the response to iterate over (only required if it's not 'items'|'definitions'|'entry') | ||
* @returns {Promise.<object>} API response combined items | ||
*/ | ||
getBulk(url: string, pageSize?: number, iteratorField?: string): Promise<object>; | ||
/** | ||
* Method that makes a GET API request for each URL (including rate limiting) | ||
* | ||
* @param {string[]} urlArray of the resource to retrieve | ||
* @param {number} [concurrentLimit] number of requests to execute at once | ||
* @returns {Promise.<Array>} API response | ||
*/ | ||
getCollection(urlArray: string[], concurrentLimit?: number): Promise<any[]>; | ||
/** | ||
* Method that makes the POST api request | ||
* | ||
* @param {string} url of the resource to create | ||
* @param {object} payload for the POST request body | ||
* @param {object} [headers] optional headers to include in the request; note that Authorization-header is always overwritten | ||
* @returns {Promise.<object>} API response | ||
*/ | ||
post(url: string, payload: object, headers?: object): Promise<object>; | ||
/** | ||
* Method that makes the PUT api request | ||
* | ||
* @param {string} url of the resource to replace | ||
* @param {object} payload for the PUT request body | ||
* @param {object} [headers] optional headers to include in the request; note that Authorization-header is always overwritten | ||
* @returns {Promise.<object>} API response | ||
*/ | ||
put(url: string, payload: object, headers?: object): Promise<object>; | ||
/** | ||
* Method that makes the PATCH api request | ||
* | ||
* @param {string} url of the resource to update | ||
* @param {object} payload for the PATCH request body | ||
* @param {object} [headers] optional headers to include in the request; note that Authorization-header is always overwritten | ||
* @returns {Promise.<object>} API response | ||
*/ | ||
patch(url: string, payload: object, headers?: object): Promise<object>; | ||
/** | ||
* Method that makes the DELETE api request | ||
* | ||
* @param {string} url of the resource to delete | ||
* @returns {Promise.<object>} API response | ||
*/ | ||
delete(url: string): Promise<object>; | ||
/** | ||
* Method that makes the api request | ||
* | ||
* @param {object} requestOptions configuration for the request including body | ||
* @param {number} remainingAttempts number of times this request should be reattempted in case of error | ||
* @param {object} [headers] optional headers to include in the request; note that Authorization-header is always overwritten | ||
* @returns {Promise.<object>} Results from the Rest request in Object format | ||
*/ | ||
_apiRequest(requestOptions: object, remainingAttempts: number, headers?: object): Promise<object>; | ||
} | ||
//# sourceMappingURL=rest.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.