@foxtware/mineral 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.creds.yml.sample +17 -0
- package/AGENTS.md +17 -0
- package/api/fastsimon/.gitkeep +0 -0
- package/api/fastsimon/docs.md +14 -0
- package/api/fastsimon/fastsimon.constants.js +18 -0
- package/api/fastsimon/fastsimon.utils.js +246 -0
- package/api/fastsimon/fastsimonSearch.js +84 -0
- package/api/figma/docs.md +3 -3
- package/api/figma/figma.constants.js +1 -1
- package/api/figma/figma.utils.js +13 -2
- package/api/figma/figmaActivityLogsGet.js +44 -0
- package/api/figma/figmaAiUsageDailyGet.js +44 -0
- package/api/figma/figmaComponentGet.js +48 -0
- package/api/figma/figmaComponentSetGet.js +48 -0
- package/api/figma/figmaDevResourcesCreate.js +47 -0
- package/api/figma/figmaDevResourcesUpdate.js +47 -0
- package/api/figma/figmaDeveloperLogsCreate.js +47 -0
- package/api/figma/figmaDiscoveryGet.js +44 -0
- package/api/figma/figmaFileCommentCreate.js +50 -0
- package/api/figma/figmaFileCommentDelete.js +51 -0
- package/api/figma/figmaFileCommentReactionCreate.js +53 -0
- package/api/figma/figmaFileCommentReactionDelete.js +51 -0
- package/api/figma/figmaFileCommentReactionsGet.js +51 -0
- package/api/figma/figmaFileCommentsGet.js +48 -0
- package/api/figma/figmaFileComponentSetsGet.js +48 -0
- package/api/figma/figmaFileComponentsGet.js +48 -0
- package/api/figma/figmaFileDevResourceDelete.js +51 -0
- package/api/figma/figmaFileDevResourcesGet.js +48 -0
- package/api/figma/figmaFileGet.js +48 -0
- package/api/figma/figmaFileImageFillsGet.js +48 -0
- package/api/figma/figmaFileImagesGet.js +48 -0
- package/api/figma/figmaFileMetaGet.js +48 -0
- package/api/figma/figmaFileNodesGet.js +48 -0
- package/api/figma/figmaFileStylesGet.js +48 -0
- package/api/figma/figmaFileVersionsGet.js +48 -0
- package/api/figma/figmaFolderFilesGet.js +48 -0
- package/api/figma/figmaFolderFoldersGet.js +48 -0
- package/api/figma/figmaFolderMetaGet.js +48 -0
- package/api/figma/figmaGet.js +15 -63
- package/api/figma/figmaMeGet.js +53 -0
- package/api/figma/figmaOembedGet.js +44 -0
- package/api/figma/figmaPaymentsGet.js +44 -0
- package/api/figma/figmaProjectFilesGet.js +48 -0
- package/api/figma/figmaProjectMetaGet.js +48 -0
- package/api/figma/figmaStyleGet.js +48 -0
- package/api/figma/figmaTeamComponentSetsGet.js +48 -0
- package/api/figma/figmaTeamComponentsGet.js +48 -0
- package/api/figma/figmaTeamFoldersGet.js +48 -0
- package/api/figma/figmaTeamProjectsGet.js +48 -0
- package/api/figma/figmaTeamStylesGet.js +48 -0
- package/api/figma/figmaTeamWebhooksGet.js +47 -0
- package/api/figma/figmaVariablesLocalGet.js +48 -0
- package/api/figma/figmaVariablesPublishedGet.js +48 -0
- package/api/figma/figmaVariablesUpdate.js +50 -0
- package/api/figma/figmaWebhookCreate.js +47 -0
- package/api/figma/figmaWebhookDelete.js +48 -0
- package/api/figma/figmaWebhookGet.js +46 -0
- package/api/figma/figmaWebhookRequestsGet.js +47 -0
- package/api/figma/figmaWebhookUpdate.js +50 -0
- package/api/figma/figmaWebhooksGet.js +47 -0
- package/api/gorgias/gorgiasTicketCreate.js +1 -1
- package/api/gorgias/gorgiasTicketMessageCreate.js +1 -1
- package/api/gorgias/gorgiasTicketUpdate.js +1 -1
- package/api/linear/linearAttachmentCreate.js +1 -1
- package/api/linear/linearCommentCreate.js +1 -1
- package/api/linear/linearCommentUpdate.js +1 -1
- package/api/linear/linearIssueLabelCreate.js +1 -1
- package/api/linear/linearIssueUpdate.js +1 -1
- package/api/linear/linearProjectCreate.js +1 -1
- package/api/linear/linearProjectUpdate.js +1 -1
- package/api/linear/linearWebhookCreate.js +1 -1
- package/api/salesforce/salesforce.constants.js +13 -0
- package/api/salesforce/salesforce.utils.js +61 -0
- package/api/salesforce/salesforceAuthGet.js +115 -0
- package/api/salesforce/salesforceComposite.js +79 -0
- package/api/salesforce/salesforceCompositeBatch.js +73 -0
- package/api/salesforce/salesforceLimitsGet.js +55 -0
- package/api/salesforce/salesforceQuery.js +69 -0
- package/api/salesforce/salesforceQueryAll.js +62 -0
- package/api/salesforce/salesforceQueryMore.js +75 -0
- package/api/salesforce/salesforceRecentItemsGet.js +63 -0
- package/api/salesforce/salesforceResourcesGet.js +55 -0
- package/api/salesforce/salesforceSearch.js +62 -0
- package/api/salesforce/salesforceSobjectBasicInfoGet.js +81 -0
- package/api/salesforce/salesforceSobjectBlobGet.js +67 -0
- package/api/salesforce/salesforceSobjectCollectionCreate.js +78 -0
- package/api/salesforce/salesforceSobjectCollectionDelete.js +70 -0
- package/api/salesforce/salesforceSobjectCollectionGet.js +75 -0
- package/api/salesforce/salesforceSobjectCollectionUpdate.js +74 -0
- package/api/salesforce/salesforceSobjectCreate.js +66 -0
- package/api/salesforce/salesforceSobjectDelete.js +86 -0
- package/api/salesforce/salesforceSobjectDeleteByExternalId.js +91 -0
- package/api/salesforce/salesforceSobjectDeletedGet.js +71 -0
- package/api/salesforce/salesforceSobjectDescribe.js +81 -0
- package/api/salesforce/salesforceSobjectDescribeLayouts.js +64 -0
- package/api/salesforce/salesforceSobjectGet.js +93 -0
- package/api/salesforce/salesforceSobjectGetByExternalId.js +98 -0
- package/api/salesforce/salesforceSobjectTreeCreate.js +79 -0
- package/api/salesforce/salesforceSobjectUpdate.js +94 -0
- package/api/salesforce/salesforceSobjectUpdatedGet.js +71 -0
- package/api/salesforce/salesforceSobjectUpsert.js +74 -0
- package/api/salesforce/salesforceSobjectsDescribeGlobal.js +55 -0
- package/api/salesforce/salesforceVersionsGet.js +62 -0
- package/api/shopify/shopifyMetaobjectCreate.js +72 -0
- package/api/tableau/tableau.constants.js +8 -0
- package/api/tableau/tableau.utils.js +93 -0
- package/api/tableau/tableauGet.js +174 -0
- package/api/tableau/tableauUserAdd.js +16 -94
- package/api/tableau/tableauUsersGet.js +46 -134
- package/api/tagalys/docs.md +2 -2
- package/api/tagalys/tagalys.constants.js +17 -0
- package/api/tagalys/tagalys.utils.js +125 -0
- package/api/tagalys/tagalysAnalyticsEventSend.js +125 -0
- package/api/tagalys/tagalysCollectionGet.js +100 -0
- package/api/tagalys/tagalysPopularSearchesGet.js +60 -0
- package/api/tagalys/tagalysRecommendationGet.js +109 -0
- package/api/tagalys/tagalysSearch.js +15 -89
- package/api/tagalys/tagalysSearchSuggestionsGet.js +76 -0
- package/package.json +2 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_delete.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['ids'],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const salesforceSobjectCollectionDelete = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
ids,
|
|
15
|
+
{
|
|
16
|
+
allOrNone,
|
|
17
|
+
apiVersion,
|
|
18
|
+
inspect = false,
|
|
19
|
+
fetchClient = salesforceClient,
|
|
20
|
+
} = {},
|
|
21
|
+
) => {
|
|
22
|
+
|
|
23
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
24
|
+
credsPayload,
|
|
25
|
+
ids,
|
|
26
|
+
});
|
|
27
|
+
if (rejectResponse) {
|
|
28
|
+
return rejectResponse;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const idList = Array.isArray(ids) ? ids.join(',') : ids;
|
|
32
|
+
|
|
33
|
+
const params = {
|
|
34
|
+
ids: idList,
|
|
35
|
+
};
|
|
36
|
+
if (allOrNone !== undefined) {
|
|
37
|
+
params.allOrNone = allOrNone;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return fetchClient.fetch({
|
|
41
|
+
requestPayload: {
|
|
42
|
+
method: 'delete',
|
|
43
|
+
url: '/composite/sobjects',
|
|
44
|
+
params,
|
|
45
|
+
},
|
|
46
|
+
context: {
|
|
47
|
+
credsPayload,
|
|
48
|
+
apiVersion,
|
|
49
|
+
},
|
|
50
|
+
inspect,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const funcApiConfig = {
|
|
55
|
+
argsWarden,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
salesforceSobjectCollectionDelete,
|
|
60
|
+
funcApiConfig,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
curl -X POST "http://localhost:8000/salesforceSobjectCollectionDelete" \
|
|
65
|
+
-H "Content-Type: application/json" \
|
|
66
|
+
-d '{
|
|
67
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
68
|
+
"ids": ["001xx000003DGb2AAG", "001xx000003DGb3AAG"]
|
|
69
|
+
}'
|
|
70
|
+
*/
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_retrieve.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
['ids'],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const salesforceSobjectCollectionGet = async (
|
|
14
|
+
credsPayload,
|
|
15
|
+
sobjectType,
|
|
16
|
+
ids,
|
|
17
|
+
{
|
|
18
|
+
fields,
|
|
19
|
+
apiVersion,
|
|
20
|
+
inspect = false,
|
|
21
|
+
fetchClient = salesforceClient,
|
|
22
|
+
} = {},
|
|
23
|
+
) => {
|
|
24
|
+
|
|
25
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
26
|
+
credsPayload,
|
|
27
|
+
sobjectType,
|
|
28
|
+
ids,
|
|
29
|
+
});
|
|
30
|
+
if (rejectResponse) {
|
|
31
|
+
return rejectResponse;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const idList = Array.isArray(ids) ? ids.join(',') : ids;
|
|
35
|
+
|
|
36
|
+
const params = {
|
|
37
|
+
ids: idList,
|
|
38
|
+
};
|
|
39
|
+
if (fields) {
|
|
40
|
+
params.fields = Array.isArray(fields) ? fields.join(',') : fields;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return fetchClient.fetch({
|
|
44
|
+
requestPayload: {
|
|
45
|
+
method: 'get',
|
|
46
|
+
url: `/composite/sobjects/${ sobjectType }`,
|
|
47
|
+
params,
|
|
48
|
+
},
|
|
49
|
+
context: {
|
|
50
|
+
credsPayload,
|
|
51
|
+
apiVersion,
|
|
52
|
+
},
|
|
53
|
+
inspect,
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const funcApiConfig = {
|
|
58
|
+
argsWarden,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
salesforceSobjectCollectionGet,
|
|
63
|
+
funcApiConfig,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
curl -X POST "http://localhost:8000/salesforceSobjectCollectionGet" \
|
|
68
|
+
-H "Content-Type: application/json" \
|
|
69
|
+
-d '{
|
|
70
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
71
|
+
"sobjectType": "Account",
|
|
72
|
+
"ids": ["001xx000003DGb2AAG"],
|
|
73
|
+
"options": { "fields": ["Id", "Name"] }
|
|
74
|
+
}'
|
|
75
|
+
*/
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_update.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['records'],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const salesforceSobjectCollectionUpdate = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
records,
|
|
15
|
+
{
|
|
16
|
+
allOrNone,
|
|
17
|
+
apiVersion,
|
|
18
|
+
inspect = false,
|
|
19
|
+
fetchClient = salesforceClient,
|
|
20
|
+
} = {},
|
|
21
|
+
) => {
|
|
22
|
+
|
|
23
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
24
|
+
credsPayload,
|
|
25
|
+
records,
|
|
26
|
+
});
|
|
27
|
+
if (rejectResponse) {
|
|
28
|
+
return rejectResponse;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const body = {
|
|
32
|
+
records,
|
|
33
|
+
};
|
|
34
|
+
if (allOrNone !== undefined) {
|
|
35
|
+
body.allOrNone = allOrNone;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return fetchClient.fetch({
|
|
39
|
+
requestPayload: {
|
|
40
|
+
method: 'patch',
|
|
41
|
+
url: '/composite/sobjects',
|
|
42
|
+
body,
|
|
43
|
+
},
|
|
44
|
+
context: {
|
|
45
|
+
credsPayload,
|
|
46
|
+
apiVersion,
|
|
47
|
+
},
|
|
48
|
+
inspect,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const funcApiConfig = {
|
|
53
|
+
argsWarden,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
salesforceSobjectCollectionUpdate,
|
|
58
|
+
funcApiConfig,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/*
|
|
62
|
+
curl -X POST "http://localhost:8000/salesforceSobjectCollectionUpdate" \
|
|
63
|
+
-H "Content-Type: application/json" \
|
|
64
|
+
-d '{
|
|
65
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
66
|
+
"records": [
|
|
67
|
+
{
|
|
68
|
+
"attributes": { "type": "Account" },
|
|
69
|
+
"Id": "001xx000003DGb2AAG",
|
|
70
|
+
"Name": "Updated via collection"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}'
|
|
74
|
+
*/
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_basic_info.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
['record'],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const salesforceSobjectCreate = async (
|
|
14
|
+
credsPayload,
|
|
15
|
+
sobjectType,
|
|
16
|
+
record,
|
|
17
|
+
{
|
|
18
|
+
apiVersion,
|
|
19
|
+
inspect = false,
|
|
20
|
+
fetchClient = salesforceClient,
|
|
21
|
+
} = {},
|
|
22
|
+
) => {
|
|
23
|
+
|
|
24
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
25
|
+
credsPayload,
|
|
26
|
+
sobjectType,
|
|
27
|
+
record,
|
|
28
|
+
});
|
|
29
|
+
if (rejectResponse) {
|
|
30
|
+
return rejectResponse;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return fetchClient.fetch({
|
|
34
|
+
requestPayload: {
|
|
35
|
+
method: 'post',
|
|
36
|
+
url: `/sobjects/${ sobjectType }`,
|
|
37
|
+
body: record,
|
|
38
|
+
},
|
|
39
|
+
context: {
|
|
40
|
+
credsPayload,
|
|
41
|
+
apiVersion,
|
|
42
|
+
},
|
|
43
|
+
inspect,
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const funcApiConfig = {
|
|
48
|
+
argsWarden,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
module.exports = {
|
|
52
|
+
salesforceSobjectCreate,
|
|
53
|
+
funcApiConfig,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
curl -X POST "http://localhost:8000/salesforceSobjectCreate" \
|
|
58
|
+
-H "Content-Type: application/json" \
|
|
59
|
+
-d '{
|
|
60
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
61
|
+
"sobjectType": "Account",
|
|
62
|
+
"record": {
|
|
63
|
+
"Name": "Example Account"
|
|
64
|
+
}
|
|
65
|
+
}'
|
|
66
|
+
*/
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_retrieve.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, actionSingleOrMultiple, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
['id'],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const salesforceSobjectDeleteSingle = async (
|
|
14
|
+
credsPayload,
|
|
15
|
+
sobjectType,
|
|
16
|
+
id,
|
|
17
|
+
{
|
|
18
|
+
apiVersion,
|
|
19
|
+
inspect = false,
|
|
20
|
+
fetchClient = salesforceClient,
|
|
21
|
+
} = {},
|
|
22
|
+
) => {
|
|
23
|
+
|
|
24
|
+
return fetchClient.fetch({
|
|
25
|
+
requestPayload: {
|
|
26
|
+
method: 'delete',
|
|
27
|
+
url: `/sobjects/${ sobjectType }/${ id }`,
|
|
28
|
+
},
|
|
29
|
+
context: {
|
|
30
|
+
credsPayload,
|
|
31
|
+
apiVersion,
|
|
32
|
+
},
|
|
33
|
+
inspect,
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const salesforceSobjectDelete = async (
|
|
38
|
+
credsPayload,
|
|
39
|
+
sobjectType,
|
|
40
|
+
id,
|
|
41
|
+
{
|
|
42
|
+
queueRunOptions,
|
|
43
|
+
...options
|
|
44
|
+
} = {},
|
|
45
|
+
) => {
|
|
46
|
+
|
|
47
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
48
|
+
credsPayload,
|
|
49
|
+
sobjectType,
|
|
50
|
+
id,
|
|
51
|
+
});
|
|
52
|
+
if (rejectResponse) {
|
|
53
|
+
return rejectResponse;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return actionSingleOrMultiple(
|
|
57
|
+
id,
|
|
58
|
+
salesforceSobjectDeleteSingle,
|
|
59
|
+
(idItem) => ({
|
|
60
|
+
args: [credsPayload, sobjectType, idItem, options],
|
|
61
|
+
}),
|
|
62
|
+
{
|
|
63
|
+
...(queueRunOptions ? { queueRunOptions } : {}),
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const funcApiConfig = {
|
|
69
|
+
argsWarden,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
salesforceSobjectDelete,
|
|
74
|
+
salesforceSobjectDeleteSingle,
|
|
75
|
+
funcApiConfig,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
curl -X POST "http://localhost:8000/salesforceSobjectDelete" \
|
|
80
|
+
-H "Content-Type: application/json" \
|
|
81
|
+
-d '{
|
|
82
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
83
|
+
"sobjectType": "Account",
|
|
84
|
+
"id": "001xx000003DGb2AAG"
|
|
85
|
+
}'
|
|
86
|
+
*/
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_upsert.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, actionSingleOrMultiple, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
['externalIdField'],
|
|
11
|
+
['externalId'],
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
const salesforceSobjectDeleteByExternalIdSingle = async (
|
|
15
|
+
credsPayload,
|
|
16
|
+
sobjectType,
|
|
17
|
+
externalIdField,
|
|
18
|
+
externalId,
|
|
19
|
+
{
|
|
20
|
+
apiVersion,
|
|
21
|
+
inspect = false,
|
|
22
|
+
fetchClient = salesforceClient,
|
|
23
|
+
} = {},
|
|
24
|
+
) => {
|
|
25
|
+
|
|
26
|
+
return fetchClient.fetch({
|
|
27
|
+
requestPayload: {
|
|
28
|
+
method: 'delete',
|
|
29
|
+
url: `/sobjects/${ sobjectType }/${ externalIdField }/${ encodeURIComponent(externalId) }`,
|
|
30
|
+
},
|
|
31
|
+
context: {
|
|
32
|
+
credsPayload,
|
|
33
|
+
apiVersion,
|
|
34
|
+
},
|
|
35
|
+
inspect,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const salesforceSobjectDeleteByExternalId = async (
|
|
40
|
+
credsPayload,
|
|
41
|
+
sobjectType,
|
|
42
|
+
externalIdField,
|
|
43
|
+
externalId,
|
|
44
|
+
{
|
|
45
|
+
queueRunOptions,
|
|
46
|
+
...options
|
|
47
|
+
} = {},
|
|
48
|
+
) => {
|
|
49
|
+
|
|
50
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
51
|
+
credsPayload,
|
|
52
|
+
sobjectType,
|
|
53
|
+
externalIdField,
|
|
54
|
+
externalId,
|
|
55
|
+
});
|
|
56
|
+
if (rejectResponse) {
|
|
57
|
+
return rejectResponse;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return actionSingleOrMultiple(
|
|
61
|
+
externalId,
|
|
62
|
+
salesforceSobjectDeleteByExternalIdSingle,
|
|
63
|
+
(externalIdItem) => ({
|
|
64
|
+
args: [credsPayload, sobjectType, externalIdField, externalIdItem, options],
|
|
65
|
+
}),
|
|
66
|
+
{
|
|
67
|
+
...(queueRunOptions ? { queueRunOptions } : {}),
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const funcApiConfig = {
|
|
73
|
+
argsWarden,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
module.exports = {
|
|
77
|
+
salesforceSobjectDeleteByExternalId,
|
|
78
|
+
salesforceSobjectDeleteByExternalIdSingle,
|
|
79
|
+
funcApiConfig,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
curl -X POST "http://localhost:8000/salesforceSobjectDeleteByExternalId" \
|
|
84
|
+
-H "Content-Type: application/json" \
|
|
85
|
+
-d '{
|
|
86
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
87
|
+
"sobjectType": "Account",
|
|
88
|
+
"externalIdField": "External_Id__c",
|
|
89
|
+
"externalId": "ext-123"
|
|
90
|
+
}'
|
|
91
|
+
*/
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_getdeleted.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
['start'],
|
|
11
|
+
['end'],
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
const salesforceSobjectDeletedGet = async (
|
|
15
|
+
credsPayload,
|
|
16
|
+
sobjectType,
|
|
17
|
+
start,
|
|
18
|
+
end,
|
|
19
|
+
{
|
|
20
|
+
apiVersion,
|
|
21
|
+
inspect = false,
|
|
22
|
+
fetchClient = salesforceClient,
|
|
23
|
+
} = {},
|
|
24
|
+
) => {
|
|
25
|
+
|
|
26
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
27
|
+
credsPayload,
|
|
28
|
+
sobjectType,
|
|
29
|
+
start,
|
|
30
|
+
end,
|
|
31
|
+
});
|
|
32
|
+
if (rejectResponse) {
|
|
33
|
+
return rejectResponse;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return fetchClient.fetch({
|
|
37
|
+
requestPayload: {
|
|
38
|
+
method: 'get',
|
|
39
|
+
url: `/sobjects/${ sobjectType }/deleted`,
|
|
40
|
+
params: {
|
|
41
|
+
start,
|
|
42
|
+
end,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
context: {
|
|
46
|
+
credsPayload,
|
|
47
|
+
apiVersion,
|
|
48
|
+
},
|
|
49
|
+
inspect,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const funcApiConfig = {
|
|
54
|
+
argsWarden,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
module.exports = {
|
|
58
|
+
salesforceSobjectDeletedGet,
|
|
59
|
+
funcApiConfig,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
curl -X POST "http://localhost:8000/salesforceSobjectDeletedGet" \
|
|
64
|
+
-H "Content-Type: application/json" \
|
|
65
|
+
-d '{
|
|
66
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
67
|
+
"sobjectType": "Account",
|
|
68
|
+
"start": "2026-01-01T00:00:00+00:00",
|
|
69
|
+
"end": "2026-01-02T00:00:00+00:00"
|
|
70
|
+
}'
|
|
71
|
+
*/
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_describe.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, actionSingleOrMultiple, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const salesforceSobjectDescribeSingle = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
sobjectType,
|
|
15
|
+
{
|
|
16
|
+
apiVersion,
|
|
17
|
+
inspect = false,
|
|
18
|
+
fetchClient = salesforceClient,
|
|
19
|
+
} = {},
|
|
20
|
+
) => {
|
|
21
|
+
|
|
22
|
+
return fetchClient.fetch({
|
|
23
|
+
requestPayload: {
|
|
24
|
+
method: 'get',
|
|
25
|
+
url: `/sobjects/${ sobjectType }/describe`,
|
|
26
|
+
},
|
|
27
|
+
context: {
|
|
28
|
+
credsPayload,
|
|
29
|
+
apiVersion,
|
|
30
|
+
},
|
|
31
|
+
inspect,
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const salesforceSobjectDescribe = async (
|
|
36
|
+
credsPayload,
|
|
37
|
+
sobjectType,
|
|
38
|
+
{
|
|
39
|
+
queueRunOptions,
|
|
40
|
+
...options
|
|
41
|
+
} = {},
|
|
42
|
+
) => {
|
|
43
|
+
|
|
44
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
45
|
+
credsPayload,
|
|
46
|
+
sobjectType,
|
|
47
|
+
});
|
|
48
|
+
if (rejectResponse) {
|
|
49
|
+
return rejectResponse;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return actionSingleOrMultiple(
|
|
53
|
+
sobjectType,
|
|
54
|
+
salesforceSobjectDescribeSingle,
|
|
55
|
+
(sobjectTypeItem) => ({
|
|
56
|
+
args: [credsPayload, sobjectTypeItem, options],
|
|
57
|
+
}),
|
|
58
|
+
{
|
|
59
|
+
...(queueRunOptions ? { queueRunOptions } : {}),
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const funcApiConfig = {
|
|
65
|
+
argsWarden,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
module.exports = {
|
|
69
|
+
salesforceSobjectDescribe,
|
|
70
|
+
salesforceSobjectDescribeSingle,
|
|
71
|
+
funcApiConfig,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
curl -X POST "http://localhost:8000/salesforceSobjectDescribe" \
|
|
76
|
+
-H "Content-Type: application/json" \
|
|
77
|
+
-d '{
|
|
78
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
79
|
+
"sobjectType": "Account"
|
|
80
|
+
}'
|
|
81
|
+
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_layouts.htm
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { salesforceClient } = require('../salesforce/salesforce.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['sobjectType'],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const salesforceSobjectDescribeLayouts = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
sobjectType,
|
|
15
|
+
{
|
|
16
|
+
recordTypeId,
|
|
17
|
+
apiVersion,
|
|
18
|
+
inspect = false,
|
|
19
|
+
fetchClient = salesforceClient,
|
|
20
|
+
} = {},
|
|
21
|
+
) => {
|
|
22
|
+
|
|
23
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
24
|
+
credsPayload,
|
|
25
|
+
sobjectType,
|
|
26
|
+
});
|
|
27
|
+
if (rejectResponse) {
|
|
28
|
+
return rejectResponse;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const url = recordTypeId
|
|
32
|
+
? `/sobjects/${ sobjectType }/describe/layouts/${ recordTypeId }`
|
|
33
|
+
: `/sobjects/${ sobjectType }/describe/layouts`;
|
|
34
|
+
|
|
35
|
+
return fetchClient.fetch({
|
|
36
|
+
requestPayload: {
|
|
37
|
+
method: 'get',
|
|
38
|
+
url,
|
|
39
|
+
},
|
|
40
|
+
context: {
|
|
41
|
+
credsPayload,
|
|
42
|
+
apiVersion,
|
|
43
|
+
},
|
|
44
|
+
inspect,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const funcApiConfig = {
|
|
49
|
+
argsWarden,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
module.exports = {
|
|
53
|
+
salesforceSobjectDescribeLayouts,
|
|
54
|
+
funcApiConfig,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
curl -X POST "http://localhost:8000/salesforceSobjectDescribeLayouts" \
|
|
59
|
+
-H "Content-Type: application/json" \
|
|
60
|
+
-d '{
|
|
61
|
+
"credsPayload": { "credsPath": "salesforce" },
|
|
62
|
+
"sobjectType": "Account"
|
|
63
|
+
}'
|
|
64
|
+
*/
|