@foxtware/mineral 0.1.26 → 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.
Files changed (119) hide show
  1. package/.creds.yml.sample +22 -4
  2. package/AGENTS.md +17 -0
  3. package/api/fastsimon/.gitkeep +0 -0
  4. package/api/fastsimon/docs.md +14 -0
  5. package/api/fastsimon/fastsimon.constants.js +18 -0
  6. package/api/fastsimon/fastsimon.utils.js +246 -0
  7. package/api/fastsimon/fastsimonSearch.js +84 -0
  8. package/api/figma/docs.md +3 -3
  9. package/api/figma/figma.constants.js +1 -1
  10. package/api/figma/figma.utils.js +13 -2
  11. package/api/figma/figmaActivityLogsGet.js +44 -0
  12. package/api/figma/figmaAiUsageDailyGet.js +44 -0
  13. package/api/figma/figmaComponentGet.js +48 -0
  14. package/api/figma/figmaComponentSetGet.js +48 -0
  15. package/api/figma/figmaDevResourcesCreate.js +47 -0
  16. package/api/figma/figmaDevResourcesUpdate.js +47 -0
  17. package/api/figma/figmaDeveloperLogsCreate.js +47 -0
  18. package/api/figma/figmaDiscoveryGet.js +44 -0
  19. package/api/figma/figmaFileCommentCreate.js +50 -0
  20. package/api/figma/figmaFileCommentDelete.js +51 -0
  21. package/api/figma/figmaFileCommentReactionCreate.js +53 -0
  22. package/api/figma/figmaFileCommentReactionDelete.js +51 -0
  23. package/api/figma/figmaFileCommentReactionsGet.js +51 -0
  24. package/api/figma/figmaFileCommentsGet.js +48 -0
  25. package/api/figma/figmaFileComponentSetsGet.js +48 -0
  26. package/api/figma/figmaFileComponentsGet.js +48 -0
  27. package/api/figma/figmaFileDevResourceDelete.js +51 -0
  28. package/api/figma/figmaFileDevResourcesGet.js +48 -0
  29. package/api/figma/figmaFileGet.js +48 -0
  30. package/api/figma/figmaFileImageFillsGet.js +48 -0
  31. package/api/figma/figmaFileImagesGet.js +48 -0
  32. package/api/figma/figmaFileMetaGet.js +48 -0
  33. package/api/figma/figmaFileNodesGet.js +48 -0
  34. package/api/figma/figmaFileStylesGet.js +48 -0
  35. package/api/figma/figmaFileVersionsGet.js +48 -0
  36. package/api/figma/figmaFolderFilesGet.js +48 -0
  37. package/api/figma/figmaFolderFoldersGet.js +48 -0
  38. package/api/figma/figmaFolderMetaGet.js +48 -0
  39. package/api/figma/figmaGet.js +15 -63
  40. package/api/figma/figmaMeGet.js +53 -0
  41. package/api/figma/figmaOembedGet.js +44 -0
  42. package/api/figma/figmaPaymentsGet.js +44 -0
  43. package/api/figma/figmaProjectFilesGet.js +48 -0
  44. package/api/figma/figmaProjectMetaGet.js +48 -0
  45. package/api/figma/figmaStyleGet.js +48 -0
  46. package/api/figma/figmaTeamComponentSetsGet.js +48 -0
  47. package/api/figma/figmaTeamComponentsGet.js +48 -0
  48. package/api/figma/figmaTeamFoldersGet.js +48 -0
  49. package/api/figma/figmaTeamProjectsGet.js +48 -0
  50. package/api/figma/figmaTeamStylesGet.js +48 -0
  51. package/api/figma/figmaTeamWebhooksGet.js +47 -0
  52. package/api/figma/figmaVariablesLocalGet.js +48 -0
  53. package/api/figma/figmaVariablesPublishedGet.js +48 -0
  54. package/api/figma/figmaVariablesUpdate.js +50 -0
  55. package/api/figma/figmaWebhookCreate.js +47 -0
  56. package/api/figma/figmaWebhookDelete.js +48 -0
  57. package/api/figma/figmaWebhookGet.js +46 -0
  58. package/api/figma/figmaWebhookRequestsGet.js +47 -0
  59. package/api/figma/figmaWebhookUpdate.js +50 -0
  60. package/api/figma/figmaWebhooksGet.js +47 -0
  61. package/api/gorgias/gorgiasTicketCreate.js +1 -1
  62. package/api/gorgias/gorgiasTicketMessageCreate.js +1 -1
  63. package/api/gorgias/gorgiasTicketUpdate.js +1 -1
  64. package/api/linear/linearAttachmentCreate.js +1 -1
  65. package/api/linear/linearCommentCreate.js +1 -1
  66. package/api/linear/linearCommentUpdate.js +1 -1
  67. package/api/linear/linearIssueLabelCreate.js +1 -1
  68. package/api/linear/linearIssueUpdate.js +1 -1
  69. package/api/linear/linearProjectCreate.js +1 -1
  70. package/api/linear/linearProjectUpdate.js +1 -1
  71. package/api/linear/linearWebhookCreate.js +1 -1
  72. package/api/salesforce/salesforce.constants.js +13 -0
  73. package/api/salesforce/salesforce.utils.js +61 -0
  74. package/api/salesforce/salesforceAuthGet.js +115 -0
  75. package/api/salesforce/salesforceComposite.js +79 -0
  76. package/api/salesforce/salesforceCompositeBatch.js +73 -0
  77. package/api/salesforce/salesforceLimitsGet.js +55 -0
  78. package/api/salesforce/salesforceQuery.js +69 -0
  79. package/api/salesforce/salesforceQueryAll.js +62 -0
  80. package/api/salesforce/salesforceQueryMore.js +75 -0
  81. package/api/salesforce/salesforceRecentItemsGet.js +63 -0
  82. package/api/salesforce/salesforceResourcesGet.js +55 -0
  83. package/api/salesforce/salesforceSearch.js +62 -0
  84. package/api/salesforce/salesforceSobjectBasicInfoGet.js +81 -0
  85. package/api/salesforce/salesforceSobjectBlobGet.js +67 -0
  86. package/api/salesforce/salesforceSobjectCollectionCreate.js +78 -0
  87. package/api/salesforce/salesforceSobjectCollectionDelete.js +70 -0
  88. package/api/salesforce/salesforceSobjectCollectionGet.js +75 -0
  89. package/api/salesforce/salesforceSobjectCollectionUpdate.js +74 -0
  90. package/api/salesforce/salesforceSobjectCreate.js +66 -0
  91. package/api/salesforce/salesforceSobjectDelete.js +86 -0
  92. package/api/salesforce/salesforceSobjectDeleteByExternalId.js +91 -0
  93. package/api/salesforce/salesforceSobjectDeletedGet.js +71 -0
  94. package/api/salesforce/salesforceSobjectDescribe.js +81 -0
  95. package/api/salesforce/salesforceSobjectDescribeLayouts.js +64 -0
  96. package/api/salesforce/salesforceSobjectGet.js +93 -0
  97. package/api/salesforce/salesforceSobjectGetByExternalId.js +98 -0
  98. package/api/salesforce/salesforceSobjectTreeCreate.js +79 -0
  99. package/api/salesforce/salesforceSobjectUpdate.js +94 -0
  100. package/api/salesforce/salesforceSobjectUpdatedGet.js +71 -0
  101. package/api/salesforce/salesforceSobjectUpsert.js +74 -0
  102. package/api/salesforce/salesforceSobjectsDescribeGlobal.js +55 -0
  103. package/api/salesforce/salesforceVersionsGet.js +62 -0
  104. package/api/shopify/shopifyMetaobjectCreate.js +72 -0
  105. package/api/tableau/tableau.constants.js +8 -0
  106. package/api/tableau/tableau.utils.js +93 -0
  107. package/api/tableau/tableauGet.js +174 -0
  108. package/api/tableau/tableauUserAdd.js +16 -94
  109. package/api/tableau/tableauUsersGet.js +46 -134
  110. package/api/tagalys/docs.md +2 -2
  111. package/api/tagalys/tagalys.constants.js +17 -0
  112. package/api/tagalys/tagalys.utils.js +125 -0
  113. package/api/tagalys/tagalysAnalyticsEventSend.js +125 -0
  114. package/api/tagalys/tagalysCollectionGet.js +100 -0
  115. package/api/tagalys/tagalysPopularSearchesGet.js +60 -0
  116. package/api/tagalys/tagalysRecommendationGet.js +109 -0
  117. package/api/tagalys/tagalysSearch.js +82 -0
  118. package/api/tagalys/tagalysSearchSuggestionsGet.js +76 -0
  119. package/package.json +2 -1
@@ -0,0 +1,55 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { salesforceClient } = require('../salesforce/salesforce.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ]);
10
+
11
+ const salesforceLimitsGet = async (
12
+ credsPayload,
13
+ {
14
+ apiVersion,
15
+ inspect = false,
16
+ fetchClient = salesforceClient,
17
+ } = {},
18
+ ) => {
19
+
20
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
21
+ credsPayload,
22
+ });
23
+ if (rejectResponse) {
24
+ return rejectResponse;
25
+ }
26
+
27
+ return fetchClient.fetch({
28
+ requestPayload: {
29
+ method: 'get',
30
+ url: '/limits',
31
+ },
32
+ context: {
33
+ credsPayload,
34
+ apiVersion,
35
+ },
36
+ inspect,
37
+ });
38
+ };
39
+
40
+ const funcApiConfig = {
41
+ argsWarden,
42
+ };
43
+
44
+ module.exports = {
45
+ salesforceLimitsGet,
46
+ funcApiConfig,
47
+ };
48
+
49
+ /*
50
+ curl -X POST "http://localhost:8000/salesforceLimitsGet" \
51
+ -H "Content-Type: application/json" \
52
+ -d '{
53
+ "credsPayload": { "credsPath": "salesforce" }
54
+ }'
55
+ */
@@ -0,0 +1,69 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query.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
+ ['soql'],
10
+ ]);
11
+
12
+ const salesforceQuery = async (
13
+ credsPayload,
14
+ soql,
15
+ {
16
+ apiVersion,
17
+ inspect = false,
18
+ fetchClient = salesforceClient,
19
+ } = {},
20
+ ) => {
21
+
22
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
23
+ credsPayload,
24
+ soql,
25
+ });
26
+ if (rejectResponse) {
27
+ return rejectResponse;
28
+ }
29
+
30
+ return fetchClient.fetch({
31
+ requestPayload: {
32
+ method: 'get',
33
+ url: '/query',
34
+ params: {
35
+ q: soql,
36
+ },
37
+ },
38
+ context: {
39
+ credsPayload,
40
+ apiVersion,
41
+ },
42
+ inspect,
43
+ });
44
+ };
45
+
46
+ const funcApiConfig = {
47
+ argsWarden,
48
+ };
49
+
50
+ module.exports = {
51
+ salesforceQuery,
52
+ funcApiConfig,
53
+ };
54
+
55
+ /*
56
+ curl -X POST "http://localhost:8000/salesforceQuery" \
57
+ -H "Content-Type: application/json" \
58
+ -d '{
59
+ "credsPayload": { "credsPath": "salesforce" },
60
+ "soql": "SELECT Id, Name FROM Account LIMIT 5"
61
+ }'
62
+
63
+ curl -X POST "http://localhost:8000/salesforceQuery" \
64
+ -H "Content-Type: application/json" \
65
+ -d '{
66
+ "credsPayload": {"credsPath": "salesforce"},
67
+ "soql": "SELECT Id, Name, Email, Phone, Account.Name FROM Contact ORDER BY LastModifiedDate DESC LIMIT 10"
68
+ }'
69
+ */
@@ -0,0 +1,62 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_queryall.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
+ ['soql'],
10
+ ]);
11
+
12
+ const salesforceQueryAll = async (
13
+ credsPayload,
14
+ soql,
15
+ {
16
+ apiVersion,
17
+ inspect = false,
18
+ fetchClient = salesforceClient,
19
+ } = {},
20
+ ) => {
21
+
22
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
23
+ credsPayload,
24
+ soql,
25
+ });
26
+ if (rejectResponse) {
27
+ return rejectResponse;
28
+ }
29
+
30
+ return fetchClient.fetch({
31
+ requestPayload: {
32
+ method: 'get',
33
+ url: '/queryAll',
34
+ params: {
35
+ q: soql,
36
+ },
37
+ },
38
+ context: {
39
+ credsPayload,
40
+ apiVersion,
41
+ },
42
+ inspect,
43
+ });
44
+ };
45
+
46
+ const funcApiConfig = {
47
+ argsWarden,
48
+ };
49
+
50
+ module.exports = {
51
+ salesforceQueryAll,
52
+ funcApiConfig,
53
+ };
54
+
55
+ /*
56
+ curl -X POST "http://localhost:8000/salesforceQueryAll" \
57
+ -H "Content-Type: application/json" \
58
+ -d '{
59
+ "credsPayload": { "credsPath": "salesforce" },
60
+ "soql": "SELECT Id, Name, IsDeleted FROM Account WHERE IsDeleted = true"
61
+ }'
62
+ */
@@ -0,0 +1,75 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_query_more.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
+ ['nextRecordsUrl'],
10
+ ]);
11
+
12
+ /**
13
+ * nextRecordsUrl from a prior query response is typically
14
+ * /services/data/vXX.X/query/{locator}. The client prefixes
15
+ * {instance}/services/data/v{version}, so strip down to /query/...
16
+ */
17
+ const pathFromNextRecordsUrl = (nextRecordsUrl) => {
18
+ const match = String(nextRecordsUrl).match(/\/services\/data\/v[\d.]+(\/.*)$/i);
19
+ if (match) {
20
+ return match[1];
21
+ }
22
+ if (String(nextRecordsUrl).startsWith('/query')) {
23
+ return nextRecordsUrl;
24
+ }
25
+ return `/query/${ nextRecordsUrl }`;
26
+ };
27
+
28
+ const salesforceQueryMore = async (
29
+ credsPayload,
30
+ nextRecordsUrl,
31
+ {
32
+ apiVersion,
33
+ inspect = false,
34
+ fetchClient = salesforceClient,
35
+ } = {},
36
+ ) => {
37
+
38
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
39
+ credsPayload,
40
+ nextRecordsUrl,
41
+ });
42
+ if (rejectResponse) {
43
+ return rejectResponse;
44
+ }
45
+
46
+ return fetchClient.fetch({
47
+ requestPayload: {
48
+ method: 'get',
49
+ url: pathFromNextRecordsUrl(nextRecordsUrl),
50
+ },
51
+ context: {
52
+ credsPayload,
53
+ apiVersion,
54
+ },
55
+ inspect,
56
+ });
57
+ };
58
+
59
+ const funcApiConfig = {
60
+ argsWarden,
61
+ };
62
+
63
+ module.exports = {
64
+ salesforceQueryMore,
65
+ funcApiConfig,
66
+ };
67
+
68
+ /*
69
+ curl -X POST "http://localhost:8000/salesforceQueryMore" \
70
+ -H "Content-Type: application/json" \
71
+ -d '{
72
+ "credsPayload": { "credsPath": "salesforce" },
73
+ "nextRecordsUrl": "/services/data/v62.0/query/01gxx000000xxxx-2000"
74
+ }'
75
+ */
@@ -0,0 +1,63 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_recent_items.htm
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { salesforceClient } = require('../salesforce/salesforce.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ]);
10
+
11
+ const salesforceRecentItemsGet = async (
12
+ credsPayload,
13
+ {
14
+ limit,
15
+ apiVersion,
16
+ inspect = false,
17
+ fetchClient = salesforceClient,
18
+ } = {},
19
+ ) => {
20
+
21
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
22
+ credsPayload,
23
+ });
24
+ if (rejectResponse) {
25
+ return rejectResponse;
26
+ }
27
+
28
+ const params = {};
29
+ if (limit !== undefined) {
30
+ params.limit = limit;
31
+ }
32
+
33
+ return fetchClient.fetch({
34
+ requestPayload: {
35
+ method: 'get',
36
+ url: '/recent',
37
+ params,
38
+ },
39
+ context: {
40
+ credsPayload,
41
+ apiVersion,
42
+ },
43
+ inspect,
44
+ });
45
+ };
46
+
47
+ const funcApiConfig = {
48
+ argsWarden,
49
+ };
50
+
51
+ module.exports = {
52
+ salesforceRecentItemsGet,
53
+ funcApiConfig,
54
+ };
55
+
56
+ /*
57
+ curl -X POST "http://localhost:8000/salesforceRecentItemsGet" \
58
+ -H "Content-Type: application/json" \
59
+ -d '{
60
+ "credsPayload": { "credsPath": "salesforce" },
61
+ "options": { "limit": 10 }
62
+ }'
63
+ */
@@ -0,0 +1,55 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_discoveryresource.htm
2
+
3
+ const { ArgsWarden } = require('../utils');
4
+ const { credsValidator } = require('../validators');
5
+ const { salesforceClient } = require('../salesforce/salesforce.utils');
6
+
7
+ const argsWarden = new ArgsWarden([
8
+ ['credsPayload', credsValidator],
9
+ ]);
10
+
11
+ const salesforceResourcesGet = async (
12
+ credsPayload,
13
+ {
14
+ apiVersion,
15
+ inspect = false,
16
+ fetchClient = salesforceClient,
17
+ } = {},
18
+ ) => {
19
+
20
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
21
+ credsPayload,
22
+ });
23
+ if (rejectResponse) {
24
+ return rejectResponse;
25
+ }
26
+
27
+ return fetchClient.fetch({
28
+ requestPayload: {
29
+ method: 'get',
30
+ url: '/',
31
+ },
32
+ context: {
33
+ credsPayload,
34
+ apiVersion,
35
+ },
36
+ inspect,
37
+ });
38
+ };
39
+
40
+ const funcApiConfig = {
41
+ argsWarden,
42
+ };
43
+
44
+ module.exports = {
45
+ salesforceResourcesGet,
46
+ funcApiConfig,
47
+ };
48
+
49
+ /*
50
+ curl -X POST "http://localhost:8000/salesforceResourcesGet" \
51
+ -H "Content-Type: application/json" \
52
+ -d '{
53
+ "credsPayload": { "credsPath": "salesforce" }
54
+ }'
55
+ */
@@ -0,0 +1,62 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search.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
+ ['sosl'],
10
+ ]);
11
+
12
+ const salesforceSearch = async (
13
+ credsPayload,
14
+ sosl,
15
+ {
16
+ apiVersion,
17
+ inspect = false,
18
+ fetchClient = salesforceClient,
19
+ } = {},
20
+ ) => {
21
+
22
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
23
+ credsPayload,
24
+ sosl,
25
+ });
26
+ if (rejectResponse) {
27
+ return rejectResponse;
28
+ }
29
+
30
+ return fetchClient.fetch({
31
+ requestPayload: {
32
+ method: 'get',
33
+ url: '/search',
34
+ params: {
35
+ q: sosl,
36
+ },
37
+ },
38
+ context: {
39
+ credsPayload,
40
+ apiVersion,
41
+ },
42
+ inspect,
43
+ });
44
+ };
45
+
46
+ const funcApiConfig = {
47
+ argsWarden,
48
+ };
49
+
50
+ module.exports = {
51
+ salesforceSearch,
52
+ funcApiConfig,
53
+ };
54
+
55
+ /*
56
+ curl -X POST "http://localhost:8000/salesforceSearch" \
57
+ -H "Content-Type: application/json" \
58
+ -d '{
59
+ "credsPayload": { "credsPath": "salesforce" },
60
+ "sosl": "FIND {Acme} IN ALL FIELDS RETURNING Account(Id, Name), Contact(Id, Name)"
61
+ }'
62
+ */
@@ -0,0 +1,81 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_basic_info.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 salesforceSobjectBasicInfoGetSingle = 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 }`,
26
+ },
27
+ context: {
28
+ credsPayload,
29
+ apiVersion,
30
+ },
31
+ inspect,
32
+ });
33
+ };
34
+
35
+ const salesforceSobjectBasicInfoGet = 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
+ salesforceSobjectBasicInfoGetSingle,
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
+ salesforceSobjectBasicInfoGet,
70
+ salesforceSobjectBasicInfoGetSingle,
71
+ funcApiConfig,
72
+ };
73
+
74
+ /*
75
+ curl -X POST "http://localhost:8000/salesforceSobjectBasicInfoGet" \
76
+ -H "Content-Type: application/json" \
77
+ -d '{
78
+ "credsPayload": { "credsPath": "salesforce" },
79
+ "sobjectType": "Account"
80
+ }'
81
+ */
@@ -0,0 +1,67 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_blob_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
+ ['id'],
11
+ ['blobField'],
12
+ ]);
13
+
14
+ const salesforceSobjectBlobGet = async (
15
+ credsPayload,
16
+ sobjectType,
17
+ id,
18
+ blobField,
19
+ {
20
+ apiVersion,
21
+ inspect = false,
22
+ fetchClient = salesforceClient,
23
+ } = {},
24
+ ) => {
25
+
26
+ const rejectResponse = await argsWarden.responseIfRejectingArgs({
27
+ credsPayload,
28
+ sobjectType,
29
+ id,
30
+ blobField,
31
+ });
32
+ if (rejectResponse) {
33
+ return rejectResponse;
34
+ }
35
+
36
+ return fetchClient.fetch({
37
+ requestPayload: {
38
+ method: 'get',
39
+ url: `/sobjects/${ sobjectType }/${ id }/${ blobField }`,
40
+ },
41
+ context: {
42
+ credsPayload,
43
+ apiVersion,
44
+ },
45
+ inspect,
46
+ });
47
+ };
48
+
49
+ const funcApiConfig = {
50
+ argsWarden,
51
+ };
52
+
53
+ module.exports = {
54
+ salesforceSobjectBlobGet,
55
+ funcApiConfig,
56
+ };
57
+
58
+ /*
59
+ curl -X POST "http://localhost:8000/salesforceSobjectBlobGet" \
60
+ -H "Content-Type: application/json" \
61
+ -d '{
62
+ "credsPayload": { "credsPath": "salesforce" },
63
+ "sobjectType": "Document",
64
+ "id": "015xx0000000001",
65
+ "blobField": "Body"
66
+ }'
67
+ */
@@ -0,0 +1,78 @@
1
+ // https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_create.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 salesforceSobjectCollectionCreate = 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: 'post',
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
+ salesforceSobjectCollectionCreate,
58
+ funcApiConfig,
59
+ };
60
+
61
+ /*
62
+ curl -X POST "http://localhost:8000/salesforceSobjectCollectionCreate" \
63
+ -H "Content-Type: application/json" \
64
+ -d '{
65
+ "credsPayload": { "credsPath": "salesforce" },
66
+ "records": [
67
+ {
68
+ "attributes": { "type": "Account" },
69
+ "Name": "Collection Account 1"
70
+ },
71
+ {
72
+ "attributes": { "type": "Account" },
73
+ "Name": "Collection Account 2"
74
+ }
75
+ ],
76
+ "options": { "allOrNone": false }
77
+ }'
78
+ */