Skip to content

Commit

Permalink
#789: add TODOs to make sure we dont forget removing the sfmc-sdk ext…
Browse files Browse the repository at this point in the history
…ensions
  • Loading branch information
JoernBerkefeld committed Mar 28, 2023
1 parent da56388 commit 3ee4c62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,7 @@ helper for [retrieve](#MobileMessage.retrieve) and [retrieveForCache](#MobileMes

### Campaign.getBulkForLegacyApi(url, [pageSize], [iteratorField]) ⇒ <code>Promise.&lt;object&gt;</code>
Method that makes paginated GET API Requests using $pageSize and $page parameters
TODO: remove before release in favor of upgrading SFMC-SDK

**Kind**: static method of [<code>Campaign</code>](#Campaign)
**Returns**: <code>Promise.&lt;object&gt;</code> - API response combined items
Expand Down Expand Up @@ -4100,6 +4101,7 @@ helper for [retrieve](#MobileMessage.retrieve) and [retrieveForCache](#MobileMes

### MobileMessage.getBulkForLegacyApi(url, [pageSize], [iteratorField]) ⇒ <code>Promise.&lt;object&gt;</code>
Method that makes paginated GET API Requests using $pageSize and $page parameters
TODO: remove before release in favor of upgrading SFMC-SDK

**Kind**: static method of [<code>MobileMessage</code>](#MobileMessage)
**Returns**: <code>Promise.&lt;object&gt;</code> - API response combined items
Expand Down
5 changes: 3 additions & 2 deletions lib/metadataTypes/Campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,19 @@ class Campaign extends MetadataType {
*/
static upgradeGetBulk() {
this.getBulkBackup ||= this.client.rest.getBulk;
this.client.rest.getBulk = this.getBulkForMobileApi.bind(this.client.rest);
this.client.rest.getBulk = this.getBulkForLegacyApi.bind(this.client.rest);
}

/**
* Method that makes paginated GET API Requests using $pageSize and $page parameters
* TODO: remove before release in favor of upgrading SFMC-SDK
*
* @param {string} url of the resource to retrieve
* @param {number} [pageSize] of the response, defaults to 50
* @param {'items'|'definitions'|'entry'} [iteratorField] attribute of the response to iterate over
* @returns {Promise.<object>} API response combined items
*/
static async getBulkForMobileApi(url, pageSize, iteratorField) {
static async getBulkForLegacyApi(url, pageSize, iteratorField) {
let page = 1;
const baseUrl = url.split('?')[0];
const isTransactionalMessageApi = this.isTransactionalMessageApi(baseUrl);
Expand Down
5 changes: 3 additions & 2 deletions lib/metadataTypes/MobileMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,19 @@ class MobileMessage extends MetadataType {
*/
static upgradeGetBulk() {
this.getBulkBackup ||= this.client.rest.getBulk;
this.client.rest.getBulk = this.getBulkForMobileApi.bind(this.client.rest);
this.client.rest.getBulk = this.getBulkForLegacyApi.bind(this.client.rest);
}

/**
* Method that makes paginated GET API Requests using $pageSize and $page parameters
* TODO: remove before release in favor of upgrading SFMC-SDK
*
* @param {string} url of the resource to retrieve
* @param {number} [pageSize] of the response, defaults to 50
* @param {'items'|'definitions'|'entry'} [iteratorField] attribute of the response to iterate over
* @returns {Promise.<object>} API response combined items
*/
static async getBulkForMobileApi(url, pageSize, iteratorField) {
static async getBulkForLegacyApi(url, pageSize, iteratorField) {
let page = 1;
const baseUrl = url.split('?')[0];
const isTransactionalMessageApi = this.isTransactionalMessageApi(baseUrl);
Expand Down

0 comments on commit 3ee4c62

Please sign in to comment.