style: auto format whole project
This commit is contained in:
@@ -10,15 +10,13 @@ export default async function createAuthData($: IGlobalVariable) {
|
||||
const searchParams = qs.stringify({
|
||||
client_id: $.auth.data.consumerKey as string,
|
||||
redirect_uri: redirectUri,
|
||||
response_type: 'code'
|
||||
})
|
||||
response_type: 'code',
|
||||
});
|
||||
|
||||
await $.auth.set({
|
||||
url: `${$.auth.data.oauth2Url}/authorize?${searchParams}`,
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Error occured while verifying credentials: ${error}`
|
||||
);
|
||||
throw new Error(`Error occured while verifying credentials: ${error}`);
|
||||
}
|
||||
}
|
||||
|
@@ -34,8 +34,8 @@ export default {
|
||||
{
|
||||
label: 'sandbox',
|
||||
value: 'https://test.salesforce.com/services/oauth2',
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'consumerKey',
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
properties: [
|
||||
{
|
||||
name: 'oauth2Url',
|
||||
value: '{fields.oauth2Url}'
|
||||
value: '{fields.oauth2Url}',
|
||||
},
|
||||
{
|
||||
name: 'consumerKey',
|
||||
|
@@ -13,10 +13,10 @@ const verifyCredentials = async ($: IGlobalVariable) => {
|
||||
grant_type: 'authorization_code',
|
||||
client_id: $.auth.data.consumerKey as string,
|
||||
client_secret: $.auth.data.consumerSecret as string,
|
||||
redirect_uri: redirectUri
|
||||
redirect_uri: redirectUri,
|
||||
});
|
||||
const { data } = await $.http.post(
|
||||
`${$.auth.data.oauth2Url}/token?${searchParams}`,
|
||||
`${$.auth.data.oauth2Url}/token?${searchParams}`
|
||||
);
|
||||
|
||||
await $.auth.set({
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import listObjects from './list-objects';
|
||||
import listFields from './list-fields';
|
||||
|
||||
export default [
|
||||
listObjects,
|
||||
listFields,
|
||||
];
|
||||
export default [listObjects, listFields];
|
||||
|
@@ -2,19 +2,21 @@ import { IGlobalVariable } from '@automatisch/types';
|
||||
|
||||
type TResponse = {
|
||||
sobjects: TObject[];
|
||||
}
|
||||
};
|
||||
|
||||
type TObject = {
|
||||
name: string;
|
||||
label: string;
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'List objects',
|
||||
key: 'listObjects',
|
||||
|
||||
async run($: IGlobalVariable) {
|
||||
const response = await $.http.get<TResponse>('/services/data/v56.0/sobjects');
|
||||
const response = await $.http.get<TResponse>(
|
||||
'/services/data/v56.0/sobjects'
|
||||
);
|
||||
|
||||
const objects = response.data.sobjects.map((object) => {
|
||||
return {
|
||||
|
@@ -1,5 +1,3 @@
|
||||
import updatedFieldInRecords from "./updated-field-in-records";
|
||||
import updatedFieldInRecords from './updated-field-in-records';
|
||||
|
||||
export default [
|
||||
updatedFieldInRecords
|
||||
];
|
||||
export default [updatedFieldInRecords];
|
||||
|
@@ -23,7 +23,7 @@ const updatedFieldInRecord = async ($: IGlobalVariable): Promise<void> => {
|
||||
const options = {
|
||||
params: {
|
||||
q: getQuery(object, limit, offset),
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
response = await $.http.get('/services/data/v56.0/query', options);
|
||||
@@ -34,7 +34,7 @@ const updatedFieldInRecord = async ($: IGlobalVariable): Promise<void> => {
|
||||
raw: record,
|
||||
meta: {
|
||||
internalId: `${record.Id}-${record[field]}`,
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user