mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,21 +1,10 @@
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
NodeApiError,
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
get,
|
||||
} from 'lodash';
|
||||
import { get } from 'lodash';
|
||||
|
||||
/**
|
||||
* Make an API request to Spotify
|
||||
@@ -26,15 +15,21 @@ import {
|
||||
* @param {object} body
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
export async function spotifyApiRequest(this: IHookFunctions | IExecuteFunctions,
|
||||
method: string, endpoint: string, body: object, query?: object, uri?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function spotifyApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: object,
|
||||
query?: object,
|
||||
uri?: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const options: OptionsWithUri = {
|
||||
method,
|
||||
headers: {
|
||||
'User-Agent': 'n8n',
|
||||
'Content-Type': 'text/plain',
|
||||
'Accept': ' application/json',
|
||||
Accept: ' application/json',
|
||||
},
|
||||
qs: query,
|
||||
uri: uri || `https://api.spotify.com/v1${endpoint}`,
|
||||
@@ -51,9 +46,15 @@ export async function spotifyApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
}
|
||||
}
|
||||
|
||||
export async function spotifyApiRequestAllItems(this: IHookFunctions | IExecuteFunctions,
|
||||
propertyName: string, method: string, endpoint: string, body: object, query?: object): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
export async function spotifyApiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions,
|
||||
propertyName: string,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: object,
|
||||
query?: object,
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
let responseData;
|
||||
@@ -72,7 +73,8 @@ export async function spotifyApiRequestAllItems(this: IHookFunctions | IExecuteF
|
||||
}
|
||||
} while (
|
||||
(responseData['next'] !== null && responseData['next'] !== undefined) ||
|
||||
(responseData[propertyName.split('.')[0]].next !== null && responseData[propertyName.split('.')[0]].next !== undefined)
|
||||
(responseData[propertyName.split('.')[0]].next !== null &&
|
||||
responseData[propertyName.split('.')[0]].next !== undefined)
|
||||
);
|
||||
|
||||
return returnData;
|
||||
|
||||
Reference in New Issue
Block a user