Skip to content
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

Develop #338

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f5b3fb9
Bump eslint-plugin-jsdoc from 46.5.1 to 48.2.6
dependabot[bot] May 24, 2024
84ba96b
Merge pull request #303 from DougMidgley/dependabot/npm_and_yarn/deve…
JoernBerkefeld May 24, 2024
809bdef
#285: allow customizing headers for patch, put and post calls
JoernBerkefeld May 24, 2024
36e7cd5
#285: eslint -fix
JoernBerkefeld May 24, 2024
a2dbf1b
#285: upgrade eslint, eslint-config-prettier, eslint-plugin-prettier,…
JoernBerkefeld May 24, 2024
0cc951a
#285: jsdoc rules copied from mcdev
JoernBerkefeld May 24, 2024
2eb1c89
Merge pull request #307 from DougMidgley/feature/285-allow-adding-hea…
JoernBerkefeld May 24, 2024
8a5d3a5
#300: fixing bad jsdocs that break typescript tests
JoernBerkefeld May 24, 2024
b70dc9a
#300: enable typescript validation
JoernBerkefeld May 24, 2024
32ef4f3
#300: fixes for typescript validation
JoernBerkefeld May 24, 2024
ad754d8
#300: add exports section in package.json
JoernBerkefeld May 24, 2024
b0b9190
#300: add automatic d.ts generation and update husky
JoernBerkefeld May 24, 2024
5d7b786
Merge pull request #308 from DougMidgley/bugfix/300-fix-incorrect-jsdocs
JoernBerkefeld May 24, 2024
488c6a1
#309: fix postcheck failing on checkout of develop branch
JoernBerkefeld May 27, 2024
0804376
#309: auto-run npm install if changes to package-lock were found
JoernBerkefeld May 27, 2024
0c664ed
Merge pull request #310 from DougMidgley/309-bug-postcheck-script-fai…
JoernBerkefeld May 27, 2024
6c5a888
Bump sinon from 15.2.0 to 18.0.0
dependabot[bot] May 27, 2024
3fb515a
Merge pull request #306 from DougMidgley/dependabot/npm_and_yarn/deve…
JoernBerkefeld May 27, 2024
86f650c
Bump eslint-plugin-prettier from 5.0.0 to 5.1.3
dependabot[bot] May 27, 2024
4673be8
Merge pull request #304 from DougMidgley/dependabot/npm_and_yarn/deve…
JoernBerkefeld May 27, 2024
64836d0
Bump axios-mock-adapter from 1.21.5 to 1.22.0
dependabot[bot] May 27, 2024
d65917b
Merge pull request #274 from DougMidgley/dependabot/npm_and_yarn/deve…
JoernBerkefeld May 27, 2024
ba30b51
Bump assert from 2.0.0 to 2.1.0
dependabot[bot] May 27, 2024
88eb0e8
Merge pull request #272 from DougMidgley/dependabot/npm_and_yarn/deve…
JoernBerkefeld May 27, 2024
8ca3988
#318 EsLint Update plus General Actions Update (#319)
DougMidgley Jun 13, 2024
c3b3187
Chores/318 update eslint (#335)
DougMidgley Jul 1, 2024
ed96f9f
Merge remote-tracking branch 'origin/main' into develop
DougMidgley Jul 4, 2024
c5bddff
#339 fix types object causes issues and needs to be replaced with any…
JoernBerkefeld Jul 5, 2024
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
2 changes: 1 addition & 1 deletion .husky/pre-commit
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
70 changes: 48 additions & 22 deletions @types/auth.d.ts
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
2 changes: 1 addition & 1 deletion @types/auth.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion @types/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions @types/rest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class Rest {
* Method that makes the GET API request
*
* @param {string} url of the resource to retrieve
* @returns {Promise.<object>} API response
* @returns {Promise.<any>} API response
*/
get(url: string): Promise<object>;
get(url: string): Promise<any>;
/**
* helper for {@link this.getBulk} to determine if the url is a transactional message API
*
Expand All @@ -42,9 +42,9 @@ export default class Rest {
* @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
* @returns {Promise.<any>} API response combined items
*/
getBulk(url: string, pageSize?: number, iteratorField?: string): Promise<object>;
getBulk(url: string, pageSize?: number, iteratorField?: string): Promise<any>;
/**
* Method that makes a GET API request for each URL (including rate limiting)
*
Expand All @@ -59,42 +59,42 @@ export default class Rest {
* @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
* @returns {Promise.<any>} API response
*/
post(url: string, payload: object, headers?: object): Promise<object>;
post(url: string, payload: object, headers?: object): Promise<any>;
/**
* 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
* @returns {Promise.<any>} API response
*/
put(url: string, payload: object, headers?: object): Promise<object>;
put(url: string, payload: object, headers?: object): Promise<any>;
/**
* 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
* @returns {Promise.<any>} API response
*/
patch(url: string, payload: object, headers?: object): Promise<object>;
patch(url: string, payload: object, headers?: object): Promise<any>;
/**
* Method that makes the DELETE api request
*
* @param {string} url of the resource to delete
* @returns {Promise.<object>} API response
* @returns {Promise.<any>} API response
*/
delete(url: string): Promise<object>;
delete(url: string): Promise<any>;
/**
* 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
* @returns {Promise.<any>} Results from the Rest request in Object format
*/
_apiRequest(requestOptions: object, remainingAttempts: number, headers?: object): Promise<object>;
_apiRequest(requestOptions: object, remainingAttempts: number, headers?: object): Promise<any>;
}
//# sourceMappingURL=rest.d.ts.map
2 changes: 1 addition & 1 deletion @types/rest.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions @types/soap.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,45 @@ export default class Soap {
* @param {string} type - SOAP Object type
* @param {string[]} propertiesList - Properties which should be retrieved
* @param {object} [requestParameters] - additional RetrieveRequest parameters, for example filter or options
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
retrieve(type: string, propertiesList: string[], requestParameters?: object): Promise<object>;
retrieve(type: string, propertiesList: string[], requestParameters?: object): Promise<any>;
/**
* Method used to retrieve all data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {string[]} propertiesList - Properties which should be retrieved
* @param {object} [requestParameters] - additional RetrieveRequest parameters, for example filter or options
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
retrieveBulk(type: string, propertiesList: string[], requestParameters?: object): Promise<object>;
retrieveBulk(type: string, propertiesList: string[], requestParameters?: object): Promise<any>;
/**
* Method used to create data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {object} properties - Properties with values which should be created
* @param {object} [requestParameters] - additional RetrieveRequest parameters, for example filter or options
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
create(type: string, properties: object, requestParameters?: object): Promise<object>;
create(type: string, properties: object, requestParameters?: object): Promise<any>;
/**
* Method used to update data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {object} properties - Properties with values which should be updated
* @param {object} [requestParameters] - additional RetrieveRequest parameters, for example filter or options
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
update(type: string, properties: object, requestParameters?: object): Promise<object>;
update(type: string, properties: object, requestParameters?: object): Promise<any>;
/**
* Method used to delete data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {object} properties - Properties with values
* @param {object} [requestParameters] - additional RetrieveRequest parameters, for example filter or options
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
delete(type: string, properties: object, requestParameters?: object): Promise<object>;
delete(type: string, properties: object, requestParameters?: object): Promise<any>;
/**
* Method used to schedule data via SOAP API
*
Expand All @@ -65,48 +65,48 @@ export default class Soap {
* @param {Array | object} interactions - Object or array of interactions
* @param {string} action - type of schedule
* @param {object} [options] - additional options for the request
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
schedule(type: string, schedule: object, interactions: any[] | object, action: string, options?: object): Promise<object>;
schedule(type: string, schedule: object, interactions: any[] | object, action: string, options?: object): Promise<any>;
/**
* Method used to describe metadata via SOAP API
*
* @param {string} type - SOAP Object type
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
describe(type: string): Promise<object>;
describe(type: string): Promise<any>;
/**
* Method used to execute data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {object} properties - Properties with values
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
execute(type: string, properties: object): Promise<object>;
execute(type: string, properties: object): Promise<any>;
/**
* Method used to execute data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {string} action - type of action, for example 'Start'
* @param {object} payload - relevant payload to perform, for example query Definition
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
perform(type: string, action: string, payload: object): Promise<object>;
perform(type: string, action: string, payload: object): Promise<any>;
/**
* Method used to configure data via SOAP API
*
* @param {string} type - SOAP Object type
* @param {object[]} configArray - Properties which should be updated
* @returns {Promise.<object>} SOAP object converted from XML
* @returns {Promise.<any>} SOAP object converted from XML
*/
configure(type: string, configArray: object[]): Promise<object>;
configure(type: string, configArray: object[]): Promise<any>;
/**
* Method that makes the api request
*
* @param {object} options configuration for the request including body
* @param {number} remainingAttempts number of times this request should be reattempted in case of error
* @returns {Promise.<object>} Results from the SOAP request in Object format
* @returns {Promise.<any>} Results from the SOAP request in Object format
*/
_apiRequest(options: object, remainingAttempts: number): Promise<object>;
_apiRequest(options: object, remainingAttempts: number): Promise<any>;
}
//# sourceMappingURL=soap.d.ts.map
2 changes: 1 addition & 1 deletion @types/soap.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading