-
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.
Merge pull request #342 from DougMidgley/develop
July 7 2024 Patch of SFMC-SDK
- Loading branch information
Showing
19 changed files
with
224 additions
and
119 deletions.
There are no files selected for viewing
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,3 +1,3 @@ | ||
# update typescript type declarations | ||
npx tsc | ||
npx tsc -p tsconfig.precommit.json | ||
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,46 +1,72 @@ | ||
/** | ||
* @typedef {object} AuthObject - Auth object | ||
* @property {number} [expiration] - expiration time of token | ||
* @property {string} access_token - access token | ||
* @property {string} client_id - client id of installed package | ||
* @property {string} client_secret - client secret of installed package | ||
* @property {string} auth_url - auth url for the SFMC instance | ||
* @property {string} account_id - MID of the business unit you want to access | ||
* @property {string[]} [scope] - array of scopes for the request | ||
*/ | ||
/** | ||
* 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 {AuthObject} authObject Auth Payload | ||
* @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[]; | ||
}; | ||
constructor(authObject: AuthObject, options: object); | ||
authObject: AuthObject; | ||
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 | ||
* @returns {Promise.<any>} current session information | ||
*/ | ||
getAccessToken(forceRefresh?: boolean, remainingAttempts?: number): Promise<object>; | ||
getAccessToken(forceRefresh?: boolean, remainingAttempts?: number): Promise<any>; | ||
/** | ||
* Helper to get back list of scopes supported by SDK | ||
* | ||
* @returns {string[]} array of potential scopes | ||
*/ | ||
getSupportedScopes(): string[]; | ||
} | ||
/** | ||
* - Auth object | ||
*/ | ||
export type AuthObject = { | ||
/** | ||
* - expiration time of token | ||
*/ | ||
expiration?: number; | ||
/** | ||
* - access token | ||
*/ | ||
access_token: string; | ||
/** | ||
* - client id of installed package | ||
*/ | ||
client_id: string; | ||
/** | ||
* - client secret of installed package | ||
*/ | ||
client_secret: string; | ||
/** | ||
* - auth url for the SFMC instance | ||
*/ | ||
auth_url: string; | ||
/** | ||
* - MID of the business unit you want to access | ||
*/ | ||
account_id: string; | ||
/** | ||
* - array of scopes for the request | ||
*/ | ||
scope?: 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
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
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
Oops, something went wrong.