@major-tech/resource-client 0.2.42 → 0.2.44

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 (265) hide show
  1. package/dist/index.cjs +1952 -45
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/index.js +1952 -29
  4. package/dist/index.js.map +7 -1
  5. package/package.json +1 -1
  6. package/dist/base.cjs +0 -78
  7. package/dist/base.cjs.map +0 -7
  8. package/dist/base.js +0 -52
  9. package/dist/base.js.map +0 -1
  10. package/dist/clients/api-custom.cjs +0 -36
  11. package/dist/clients/api-custom.cjs.map +0 -7
  12. package/dist/clients/api-custom.js +0 -9
  13. package/dist/clients/api-custom.js.map +0 -1
  14. package/dist/clients/api-graphql.cjs +0 -40
  15. package/dist/clients/api-graphql.cjs.map +0 -7
  16. package/dist/clients/api-graphql.js +0 -13
  17. package/dist/clients/api-graphql.js.map +0 -1
  18. package/dist/clients/auth.cjs +0 -49
  19. package/dist/clients/auth.cjs.map +0 -7
  20. package/dist/clients/auth.js +0 -22
  21. package/dist/clients/auth.js.map +0 -1
  22. package/dist/clients/bigquery.cjs +0 -104
  23. package/dist/clients/bigquery.cjs.map +0 -7
  24. package/dist/clients/bigquery.js +0 -77
  25. package/dist/clients/bigquery.js.map +0 -1
  26. package/dist/clients/cosmosdb.cjs +0 -119
  27. package/dist/clients/cosmosdb.cjs.map +0 -7
  28. package/dist/clients/cosmosdb.js +0 -92
  29. package/dist/clients/cosmosdb.js.map +0 -1
  30. package/dist/clients/dynamodb.cjs +0 -36
  31. package/dist/clients/dynamodb.cjs.map +0 -7
  32. package/dist/clients/dynamodb.js +0 -9
  33. package/dist/clients/dynamodb.js.map +0 -1
  34. package/dist/clients/google-analytics.cjs +0 -101
  35. package/dist/clients/google-analytics.cjs.map +0 -7
  36. package/dist/clients/google-analytics.js +0 -74
  37. package/dist/clients/google-analytics.js.map +0 -1
  38. package/dist/clients/googlesheets.cjs +0 -122
  39. package/dist/clients/googlesheets.cjs.map +0 -7
  40. package/dist/clients/googlesheets.js +0 -95
  41. package/dist/clients/googlesheets.js.map +0 -1
  42. package/dist/clients/hubspot.cjs +0 -36
  43. package/dist/clients/hubspot.cjs.map +0 -7
  44. package/dist/clients/hubspot.js +0 -9
  45. package/dist/clients/hubspot.js.map +0 -1
  46. package/dist/clients/lambda.cjs +0 -81
  47. package/dist/clients/lambda.cjs.map +0 -7
  48. package/dist/clients/lambda.js +0 -54
  49. package/dist/clients/lambda.js.map +0 -1
  50. package/dist/clients/mssql.cjs +0 -59
  51. package/dist/clients/mssql.cjs.map +0 -7
  52. package/dist/clients/mssql.js +0 -32
  53. package/dist/clients/mssql.js.map +0 -1
  54. package/dist/clients/neo4j.cjs +0 -57
  55. package/dist/clients/neo4j.cjs.map +0 -7
  56. package/dist/clients/neo4j.js +0 -30
  57. package/dist/clients/neo4j.js.map +0 -1
  58. package/dist/clients/outreach.cjs +0 -51
  59. package/dist/clients/outreach.cjs.map +0 -7
  60. package/dist/clients/outreach.js +0 -24
  61. package/dist/clients/outreach.js.map +0 -1
  62. package/dist/clients/postgres.cjs +0 -59
  63. package/dist/clients/postgres.cjs.map +0 -7
  64. package/dist/clients/postgres.js +0 -32
  65. package/dist/clients/postgres.js.map +0 -1
  66. package/dist/clients/quickbooks.cjs +0 -65
  67. package/dist/clients/quickbooks.cjs.map +0 -7
  68. package/dist/clients/quickbooks.js +0 -38
  69. package/dist/clients/quickbooks.js.map +0 -1
  70. package/dist/clients/s3.cjs +0 -36
  71. package/dist/clients/s3.cjs.map +0 -7
  72. package/dist/clients/s3.js +0 -9
  73. package/dist/clients/s3.js.map +0 -1
  74. package/dist/clients/salesforce.cjs +0 -131
  75. package/dist/clients/salesforce.cjs.map +0 -7
  76. package/dist/clients/salesforce.js +0 -144
  77. package/dist/clients/salesforce.js.map +0 -1
  78. package/dist/clients/slack.cjs +0 -66
  79. package/dist/clients/slack.cjs.map +0 -7
  80. package/dist/clients/slack.js +0 -39
  81. package/dist/clients/slack.js.map +0 -1
  82. package/dist/clients/snowflake.cjs +0 -69
  83. package/dist/clients/snowflake.cjs.map +0 -7
  84. package/dist/clients/snowflake.js +0 -42
  85. package/dist/clients/snowflake.js.map +0 -1
  86. package/dist/errors.cjs +0 -38
  87. package/dist/errors.cjs.map +0 -7
  88. package/dist/errors.js +0 -15
  89. package/dist/errors.js.map +0 -1
  90. package/dist/payload-builders/auth.cjs +0 -44
  91. package/dist/payload-builders/auth.cjs.map +0 -7
  92. package/dist/payload-builders/auth.js +0 -25
  93. package/dist/payload-builders/auth.js.map +0 -1
  94. package/dist/payload-builders/bigquery.cjs +0 -103
  95. package/dist/payload-builders/bigquery.cjs.map +0 -7
  96. package/dist/payload-builders/bigquery.js +0 -103
  97. package/dist/payload-builders/bigquery.js.map +0 -1
  98. package/dist/payload-builders/cosmosdb.cjs +0 -126
  99. package/dist/payload-builders/cosmosdb.cjs.map +0 -7
  100. package/dist/payload-builders/cosmosdb.js +0 -112
  101. package/dist/payload-builders/cosmosdb.js.map +0 -1
  102. package/dist/payload-builders/custom.cjs +0 -38
  103. package/dist/payload-builders/custom.cjs.map +0 -7
  104. package/dist/payload-builders/custom.js +0 -19
  105. package/dist/payload-builders/custom.js.map +0 -1
  106. package/dist/payload-builders/dynamodb.cjs +0 -34
  107. package/dist/payload-builders/dynamodb.cjs.map +0 -7
  108. package/dist/payload-builders/dynamodb.js +0 -14
  109. package/dist/payload-builders/dynamodb.js.map +0 -1
  110. package/dist/payload-builders/from-extracted-params.cjs +0 -442
  111. package/dist/payload-builders/from-extracted-params.cjs.map +0 -7
  112. package/dist/payload-builders/from-extracted-params.js +0 -444
  113. package/dist/payload-builders/from-extracted-params.js.map +0 -1
  114. package/dist/payload-builders/google-analytics.cjs +0 -106
  115. package/dist/payload-builders/google-analytics.cjs.map +0 -7
  116. package/dist/payload-builders/google-analytics.js +0 -90
  117. package/dist/payload-builders/google-analytics.js.map +0 -1
  118. package/dist/payload-builders/googlesheets.cjs +0 -106
  119. package/dist/payload-builders/googlesheets.cjs.map +0 -7
  120. package/dist/payload-builders/googlesheets.js +0 -115
  121. package/dist/payload-builders/googlesheets.js.map +0 -1
  122. package/dist/payload-builders/graphql.cjs +0 -37
  123. package/dist/payload-builders/graphql.cjs.map +0 -7
  124. package/dist/payload-builders/graphql.js +0 -17
  125. package/dist/payload-builders/graphql.js.map +0 -1
  126. package/dist/payload-builders/hubspot.cjs +0 -37
  127. package/dist/payload-builders/hubspot.cjs.map +0 -7
  128. package/dist/payload-builders/hubspot.js +0 -18
  129. package/dist/payload-builders/hubspot.js.map +0 -1
  130. package/dist/payload-builders/index.cjs +0 -101
  131. package/dist/payload-builders/index.cjs.map +0 -7
  132. package/dist/payload-builders/index.js +0 -41
  133. package/dist/payload-builders/index.js.map +0 -1
  134. package/dist/payload-builders/lambda.cjs +0 -35
  135. package/dist/payload-builders/lambda.cjs.map +0 -7
  136. package/dist/payload-builders/lambda.js +0 -16
  137. package/dist/payload-builders/lambda.js.map +0 -1
  138. package/dist/payload-builders/mssql.cjs +0 -35
  139. package/dist/payload-builders/mssql.cjs.map +0 -7
  140. package/dist/payload-builders/mssql.js +0 -16
  141. package/dist/payload-builders/mssql.js.map +0 -1
  142. package/dist/payload-builders/neo4j.cjs +0 -35
  143. package/dist/payload-builders/neo4j.cjs.map +0 -7
  144. package/dist/payload-builders/neo4j.js +0 -16
  145. package/dist/payload-builders/neo4j.js.map +0 -1
  146. package/dist/payload-builders/outreach.cjs +0 -37
  147. package/dist/payload-builders/outreach.cjs.map +0 -7
  148. package/dist/payload-builders/outreach.js +0 -18
  149. package/dist/payload-builders/outreach.js.map +0 -1
  150. package/dist/payload-builders/postgres.cjs +0 -35
  151. package/dist/payload-builders/postgres.cjs.map +0 -7
  152. package/dist/payload-builders/postgres.js +0 -16
  153. package/dist/payload-builders/postgres.js.map +0 -1
  154. package/dist/payload-builders/quickbooks.cjs +0 -45
  155. package/dist/payload-builders/quickbooks.cjs.map +0 -7
  156. package/dist/payload-builders/quickbooks.js +0 -18
  157. package/dist/payload-builders/quickbooks.js.map +0 -1
  158. package/dist/payload-builders/s3.cjs +0 -35
  159. package/dist/payload-builders/s3.cjs.map +0 -7
  160. package/dist/payload-builders/s3.js +0 -16
  161. package/dist/payload-builders/s3.js.map +0 -1
  162. package/dist/payload-builders/salesforce.cjs +0 -87
  163. package/dist/payload-builders/salesforce.cjs.map +0 -7
  164. package/dist/payload-builders/salesforce.js +0 -91
  165. package/dist/payload-builders/salesforce.js.map +0 -1
  166. package/dist/payload-builders/slack.cjs +0 -59
  167. package/dist/payload-builders/slack.cjs.map +0 -7
  168. package/dist/payload-builders/slack.js +0 -35
  169. package/dist/payload-builders/slack.js.map +0 -1
  170. package/dist/payload-builders/snowflake.cjs +0 -70
  171. package/dist/payload-builders/snowflake.cjs.map +0 -7
  172. package/dist/payload-builders/snowflake.js +0 -57
  173. package/dist/payload-builders/snowflake.js.map +0 -1
  174. package/dist/schemas/api-custom.cjs +0 -17
  175. package/dist/schemas/api-custom.cjs.map +0 -7
  176. package/dist/schemas/api-custom.js +0 -2
  177. package/dist/schemas/api-custom.js.map +0 -1
  178. package/dist/schemas/api-googlesheets.cjs +0 -17
  179. package/dist/schemas/api-googlesheets.cjs.map +0 -7
  180. package/dist/schemas/api-googlesheets.js +0 -2
  181. package/dist/schemas/api-googlesheets.js.map +0 -1
  182. package/dist/schemas/api-graphql.cjs +0 -17
  183. package/dist/schemas/api-graphql.cjs.map +0 -7
  184. package/dist/schemas/api-graphql.js +0 -2
  185. package/dist/schemas/api-graphql.js.map +0 -1
  186. package/dist/schemas/api-hubspot.cjs +0 -17
  187. package/dist/schemas/api-hubspot.cjs.map +0 -7
  188. package/dist/schemas/api-hubspot.js +0 -2
  189. package/dist/schemas/api-hubspot.js.map +0 -1
  190. package/dist/schemas/api-outreach.cjs +0 -17
  191. package/dist/schemas/api-outreach.cjs.map +0 -7
  192. package/dist/schemas/api-outreach.js +0 -2
  193. package/dist/schemas/api-outreach.js.map +0 -1
  194. package/dist/schemas/api-quickbooks.cjs +0 -17
  195. package/dist/schemas/api-quickbooks.cjs.map +0 -7
  196. package/dist/schemas/api-quickbooks.js +0 -2
  197. package/dist/schemas/api-quickbooks.js.map +0 -1
  198. package/dist/schemas/api-salesforce.cjs +0 -17
  199. package/dist/schemas/api-salesforce.cjs.map +0 -7
  200. package/dist/schemas/api-salesforce.js +0 -2
  201. package/dist/schemas/api-salesforce.js.map +0 -1
  202. package/dist/schemas/api-slack.cjs +0 -17
  203. package/dist/schemas/api-slack.cjs.map +0 -7
  204. package/dist/schemas/api-slack.js +0 -2
  205. package/dist/schemas/api-slack.js.map +0 -1
  206. package/dist/schemas/auth.cjs +0 -17
  207. package/dist/schemas/auth.cjs.map +0 -7
  208. package/dist/schemas/auth.js +0 -5
  209. package/dist/schemas/auth.js.map +0 -1
  210. package/dist/schemas/bigquery.cjs +0 -17
  211. package/dist/schemas/bigquery.cjs.map +0 -7
  212. package/dist/schemas/bigquery.js +0 -5
  213. package/dist/schemas/bigquery.js.map +0 -1
  214. package/dist/schemas/common.cjs +0 -17
  215. package/dist/schemas/common.cjs.map +0 -7
  216. package/dist/schemas/common.js +0 -2
  217. package/dist/schemas/common.js.map +0 -1
  218. package/dist/schemas/cosmosdb.cjs +0 -17
  219. package/dist/schemas/cosmosdb.cjs.map +0 -7
  220. package/dist/schemas/cosmosdb.js +0 -2
  221. package/dist/schemas/cosmosdb.js.map +0 -1
  222. package/dist/schemas/dynamodb.cjs +0 -17
  223. package/dist/schemas/dynamodb.cjs.map +0 -7
  224. package/dist/schemas/dynamodb.js +0 -2
  225. package/dist/schemas/dynamodb.js.map +0 -1
  226. package/dist/schemas/google-analytics.cjs +0 -17
  227. package/dist/schemas/google-analytics.cjs.map +0 -7
  228. package/dist/schemas/google-analytics.js +0 -2
  229. package/dist/schemas/google-analytics.js.map +0 -1
  230. package/dist/schemas/index.cjs +0 -40
  231. package/dist/schemas/index.cjs.map +0 -7
  232. package/dist/schemas/index.js +0 -24
  233. package/dist/schemas/index.js.map +0 -1
  234. package/dist/schemas/lambda.cjs +0 -17
  235. package/dist/schemas/lambda.cjs.map +0 -7
  236. package/dist/schemas/lambda.js +0 -2
  237. package/dist/schemas/lambda.js.map +0 -1
  238. package/dist/schemas/mssql.cjs +0 -17
  239. package/dist/schemas/mssql.cjs.map +0 -7
  240. package/dist/schemas/mssql.js +0 -2
  241. package/dist/schemas/mssql.js.map +0 -1
  242. package/dist/schemas/neo4j.cjs +0 -17
  243. package/dist/schemas/neo4j.cjs.map +0 -7
  244. package/dist/schemas/neo4j.js +0 -2
  245. package/dist/schemas/neo4j.js.map +0 -1
  246. package/dist/schemas/postgres.cjs +0 -17
  247. package/dist/schemas/postgres.cjs.map +0 -7
  248. package/dist/schemas/postgres.js +0 -2
  249. package/dist/schemas/postgres.js.map +0 -1
  250. package/dist/schemas/request.cjs +0 -17
  251. package/dist/schemas/request.cjs.map +0 -7
  252. package/dist/schemas/request.js +0 -2
  253. package/dist/schemas/request.js.map +0 -1
  254. package/dist/schemas/response.cjs +0 -17
  255. package/dist/schemas/response.cjs.map +0 -7
  256. package/dist/schemas/response.js +0 -2
  257. package/dist/schemas/response.js.map +0 -1
  258. package/dist/schemas/s3.cjs +0 -17
  259. package/dist/schemas/s3.cjs.map +0 -7
  260. package/dist/schemas/s3.js +0 -2
  261. package/dist/schemas/s3.js.map +0 -1
  262. package/dist/schemas/snowflake.cjs +0 -17
  263. package/dist/schemas/snowflake.cjs.map +0 -7
  264. package/dist/schemas/snowflake.js +0 -2
  265. package/dist/schemas/snowflake.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -15,54 +15,1961 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
20
21
  var index_exports = {};
21
22
  __export(index_exports, {
22
- BaseResourceClient: () => import_base.BaseResourceClient,
23
- BigQueryResourceClient: () => import_bigquery.BigQueryResourceClient,
24
- CosmosDBResourceClient: () => import_cosmosdb.CosmosDBResourceClient,
25
- CustomApiResourceClient: () => import_api_custom.CustomApiResourceClient,
26
- DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
27
- GoogleAnalyticsResourceClient: () => import_google_analytics.GoogleAnalyticsResourceClient,
28
- GoogleSheetsResourceClient: () => import_googlesheets.GoogleSheetsResourceClient,
29
- GraphQLResourceClient: () => import_api_graphql.GraphQLResourceClient,
30
- HubSpotResourceClient: () => import_hubspot.HubSpotResourceClient,
31
- LambdaResourceClient: () => import_lambda.LambdaResourceClient,
32
- MajorAuthResourceClient: () => import_auth.MajorAuthResourceClient,
33
- MssqlResourceClient: () => import_mssql.MssqlResourceClient,
34
- Neo4jResourceClient: () => import_neo4j.Neo4jResourceClient,
35
- OutreachResourceClient: () => import_outreach.OutreachResourceClient,
36
- PostgresResourceClient: () => import_postgres.PostgresResourceClient,
37
- QuickBooksResourceClient: () => import_quickbooks.QuickBooksResourceClient,
38
- ResourceInvokeError: () => import_errors.ResourceInvokeError,
39
- S3ResourceClient: () => import_s3.S3ResourceClient,
40
- SalesforceResourceClient: () => import_salesforce.SalesforceResourceClient,
41
- SlackResourceClient: () => import_slack.SlackResourceClient,
42
- SnowflakeResourceClient: () => import_snowflake.SnowflakeResourceClient
23
+ BaseResourceClient: () => BaseResourceClient,
24
+ BigQueryResourceClient: () => BigQueryResourceClient,
25
+ CosmosDBResourceClient: () => CosmosDBResourceClient,
26
+ CustomApiResourceClient: () => CustomApiResourceClient,
27
+ DynamoDBResourceClient: () => DynamoDBResourceClient,
28
+ GoogleAnalyticsResourceClient: () => GoogleAnalyticsResourceClient,
29
+ GoogleSheetsResourceClient: () => GoogleSheetsResourceClient,
30
+ GraphQLResourceClient: () => GraphQLResourceClient,
31
+ HubSpotResourceClient: () => HubSpotResourceClient,
32
+ LambdaResourceClient: () => LambdaResourceClient,
33
+ MajorAuthResourceClient: () => MajorAuthResourceClient,
34
+ MssqlResourceClient: () => MssqlResourceClient,
35
+ Neo4jResourceClient: () => Neo4jResourceClient,
36
+ OutreachResourceClient: () => OutreachResourceClient,
37
+ PostgresResourceClient: () => PostgresResourceClient,
38
+ QuickBooksResourceClient: () => QuickBooksResourceClient,
39
+ ResourceInvokeError: () => ResourceInvokeError,
40
+ S3ResourceClient: () => S3ResourceClient,
41
+ SalesforceResourceClient: () => SalesforceResourceClient,
42
+ SlackResourceClient: () => SlackResourceClient,
43
+ SnowflakeResourceClient: () => SnowflakeResourceClient,
44
+ buildAuthRevokeAccessPayload: () => buildAuthRevokeAccessPayload,
45
+ buildAuthShareAccessPayload: () => buildAuthShareAccessPayload,
46
+ buildBigQueryCreateTablePayload: () => buildBigQueryCreateTablePayload,
47
+ buildBigQueryGetTablePayload: () => buildBigQueryGetTablePayload,
48
+ buildBigQueryInsertRowsPayload: () => buildBigQueryInsertRowsPayload,
49
+ buildBigQueryInvokePayload: () => buildBigQueryInvokePayload,
50
+ buildBigQueryListDatasetsPayload: () => buildBigQueryListDatasetsPayload,
51
+ buildBigQueryListTablesPayload: () => buildBigQueryListTablesPayload,
52
+ buildBigQueryQueryPayload: () => buildBigQueryQueryPayload,
53
+ buildCosmosDBCreatePayload: () => buildCosmosDBCreatePayload,
54
+ buildCosmosDBDeletePayload: () => buildCosmosDBDeletePayload,
55
+ buildCosmosDBInvokePayload: () => buildCosmosDBInvokePayload,
56
+ buildCosmosDBPatchPayload: () => buildCosmosDBPatchPayload,
57
+ buildCosmosDBQueryPayload: () => buildCosmosDBQueryPayload,
58
+ buildCosmosDBReadPayload: () => buildCosmosDBReadPayload,
59
+ buildCosmosDBReplacePayload: () => buildCosmosDBReplacePayload,
60
+ buildCosmosDBUpsertPayload: () => buildCosmosDBUpsertPayload,
61
+ buildCustomApiInvokePayload: () => buildCustomApiInvokePayload,
62
+ buildDynamoDBInvokePayload: () => buildDynamoDBInvokePayload,
63
+ buildGoogleAnalyticsGetMetadataPayload: () => buildGoogleAnalyticsGetMetadataPayload,
64
+ buildGoogleAnalyticsInvokePayload: () => buildGoogleAnalyticsInvokePayload,
65
+ buildGoogleAnalyticsListAccountsPayload: () => buildGoogleAnalyticsListAccountsPayload,
66
+ buildGoogleAnalyticsListDataStreamsPayload: () => buildGoogleAnalyticsListDataStreamsPayload,
67
+ buildGoogleAnalyticsListPropertiesPayload: () => buildGoogleAnalyticsListPropertiesPayload,
68
+ buildGoogleAnalyticsRunRealtimeReportPayload: () => buildGoogleAnalyticsRunRealtimeReportPayload,
69
+ buildGoogleAnalyticsRunReportPayload: () => buildGoogleAnalyticsRunReportPayload,
70
+ buildGoogleSheetsAppendValuesPayload: () => buildGoogleSheetsAppendValuesPayload,
71
+ buildGoogleSheetsBatchGetValuesPayload: () => buildGoogleSheetsBatchGetValuesPayload,
72
+ buildGoogleSheetsBatchUpdatePayload: () => buildGoogleSheetsBatchUpdatePayload,
73
+ buildGoogleSheetsBatchUpdateValuesPayload: () => buildGoogleSheetsBatchUpdateValuesPayload,
74
+ buildGoogleSheetsClearValuesPayload: () => buildGoogleSheetsClearValuesPayload,
75
+ buildGoogleSheetsGetSpreadsheetPayload: () => buildGoogleSheetsGetSpreadsheetPayload,
76
+ buildGoogleSheetsGetValuesPayload: () => buildGoogleSheetsGetValuesPayload,
77
+ buildGoogleSheetsInvokePayload: () => buildGoogleSheetsInvokePayload,
78
+ buildGoogleSheetsUpdateValuesPayload: () => buildGoogleSheetsUpdateValuesPayload,
79
+ buildGraphQLInvokePayload: () => buildGraphQLInvokePayload,
80
+ buildHubSpotInvokePayload: () => buildHubSpotInvokePayload,
81
+ buildLambdaInvokePayload: () => buildLambdaInvokePayload,
82
+ buildMssqlInvokePayload: () => buildMssqlInvokePayload,
83
+ buildNeo4jInvokePayload: () => buildNeo4jInvokePayload,
84
+ buildOutreachInvokePayload: () => buildOutreachInvokePayload,
85
+ buildPayloadFromExtractedParams: () => buildPayloadFromExtractedParams,
86
+ buildPostgresInvokePayload: () => buildPostgresInvokePayload,
87
+ buildQuickBooksInvokePayload: () => buildQuickBooksInvokePayload,
88
+ buildQuickBooksQueryPayload: () => buildQuickBooksQueryPayload,
89
+ buildS3InvokePayload: () => buildS3InvokePayload,
90
+ buildSalesforceCreateRecordPayload: () => buildSalesforceCreateRecordPayload,
91
+ buildSalesforceDeleteRecordPayload: () => buildSalesforceDeleteRecordPayload,
92
+ buildSalesforceDescribeObjectPayload: () => buildSalesforceDescribeObjectPayload,
93
+ buildSalesforceGetRecordPayload: () => buildSalesforceGetRecordPayload,
94
+ buildSalesforceInvokePayload: () => buildSalesforceInvokePayload,
95
+ buildSalesforceQueryPayload: () => buildSalesforceQueryPayload,
96
+ buildSalesforceUpdateRecordPayload: () => buildSalesforceUpdateRecordPayload,
97
+ buildSlackInvokePayload: () => buildSlackInvokePayload,
98
+ buildSnowflakeCancelPayload: () => buildSnowflakeCancelPayload,
99
+ buildSnowflakeExecutePayload: () => buildSnowflakeExecutePayload,
100
+ buildSnowflakeInvokePayload: () => buildSnowflakeInvokePayload,
101
+ buildSnowflakeStatusPayload: () => buildSnowflakeStatusPayload
43
102
  });
44
103
  module.exports = __toCommonJS(index_exports);
45
- __reExport(index_exports, require("./schemas"), module.exports);
46
- var import_base = require("./base");
47
- var import_errors = require("./errors");
48
- var import_postgres = require("./clients/postgres");
49
- var import_mssql = require("./clients/mssql");
50
- var import_dynamodb = require("./clients/dynamodb");
51
- var import_cosmosdb = require("./clients/cosmosdb");
52
- var import_snowflake = require("./clients/snowflake");
53
- var import_api_custom = require("./clients/api-custom");
54
- var import_hubspot = require("./clients/hubspot");
55
- var import_salesforce = require("./clients/salesforce");
56
- var import_googlesheets = require("./clients/googlesheets");
57
- var import_s3 = require("./clients/s3");
58
- var import_lambda = require("./clients/lambda");
59
- var import_bigquery = require("./clients/bigquery");
60
- var import_outreach = require("./clients/outreach");
61
- var import_neo4j = require("./clients/neo4j");
62
- var import_slack = require("./clients/slack");
63
- var import_quickbooks = require("./clients/quickbooks");
64
- var import_auth = require("./clients/auth");
65
- var import_google_analytics = require("./clients/google-analytics");
66
- var import_api_graphql = require("./clients/api-graphql");
67
- __reExport(index_exports, require("./payload-builders"), module.exports);
104
+
105
+ // src/errors.ts
106
+ var ResourceInvokeError = class extends Error {
107
+ httpStatus;
108
+ requestId;
109
+ constructor(message, httpStatus, requestId) {
110
+ super(message);
111
+ this.name = "ResourceInvokeError";
112
+ this.httpStatus = httpStatus;
113
+ this.requestId = requestId;
114
+ }
115
+ };
116
+
117
+ // src/base.ts
118
+ var BaseResourceClient = class {
119
+ config;
120
+ constructor(config) {
121
+ if (!config.applicationId && !config.toolId) {
122
+ throw new Error("BaseResourceClient requires either applicationId or toolId");
123
+ }
124
+ this.config = {
125
+ baseUrl: config.baseUrl.replace(/\/$/, ""),
126
+ majorJwtToken: config.majorJwtToken,
127
+ applicationId: config.applicationId,
128
+ toolId: config.toolId,
129
+ resourceId: config.resourceId,
130
+ fetch: config.fetch || globalThis.fetch,
131
+ getHeaders: config.getHeaders
132
+ };
133
+ }
134
+ async invokeRaw(payload, invocationKey) {
135
+ const entityType = this.config.toolId ? "tools" : "apps";
136
+ const entityId = this.config.toolId || this.config.applicationId;
137
+ const url = `${this.config.baseUrl}/internal/${entityType}/v1/${entityId}/resource/${this.config.resourceId}/invoke`;
138
+ const body = {
139
+ payload,
140
+ invocationKey
141
+ };
142
+ let headers = {
143
+ "Content-Type": "application/json"
144
+ };
145
+ if (this.config.majorJwtToken) {
146
+ headers["x-major-jwt"] = this.config.majorJwtToken;
147
+ }
148
+ if (this.config.getHeaders) {
149
+ const extraHeaders = await this.config.getHeaders();
150
+ headers = { ...headers, ...extraHeaders };
151
+ }
152
+ try {
153
+ const response = await this.config.fetch(url, {
154
+ method: "POST",
155
+ headers,
156
+ credentials: "include",
157
+ body: JSON.stringify(body)
158
+ });
159
+ const data = await response.json();
160
+ return data;
161
+ } catch (error) {
162
+ const message = error instanceof Error ? error.message : String(error);
163
+ throw new ResourceInvokeError(`Failed to invoke resource: ${message}`);
164
+ }
165
+ }
166
+ };
167
+
168
+ // src/payload-builders/postgres.ts
169
+ function buildPostgresInvokePayload(sql, params, timeoutMs) {
170
+ return {
171
+ type: "database",
172
+ subtype: "postgresql",
173
+ sql,
174
+ params,
175
+ timeoutMs
176
+ };
177
+ }
178
+
179
+ // src/clients/postgres.ts
180
+ var PostgresResourceClient = class extends BaseResourceClient {
181
+ /**
182
+ * Execute a SQL query against PostgreSQL
183
+ * @param sql The SQL query to execute
184
+ * @param params Optional positional parameters ($1, $2, etc.)
185
+ * @param invocationKey Unique key for tracking this invocation
186
+ * @param timeoutMs Optional timeout in milliseconds
187
+ * @returns Typed response with rows of type T
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * interface User { id: number; name: string; email: string }
192
+ *
193
+ * const response = await client.invoke<User>(
194
+ * "SELECT id, name, email FROM users WHERE id = $1",
195
+ * [123],
196
+ * "get-user-123"
197
+ * );
198
+ *
199
+ * if (response.ok) {
200
+ * const users: User[] = response.result.rows;
201
+ * }
202
+ * ```
203
+ */
204
+ async invoke(sql, params, invocationKey, timeoutMs) {
205
+ const payload = buildPostgresInvokePayload(sql, params, timeoutMs);
206
+ return this.invokeRaw(payload, invocationKey);
207
+ }
208
+ };
209
+
210
+ // src/payload-builders/mssql.ts
211
+ function buildMssqlInvokePayload(sql, params, timeoutMs) {
212
+ return {
213
+ type: "database",
214
+ subtype: "mssql",
215
+ sql,
216
+ params,
217
+ timeoutMs
218
+ };
219
+ }
220
+
221
+ // src/clients/mssql.ts
222
+ var MssqlResourceClient = class extends BaseResourceClient {
223
+ /**
224
+ * Execute a SQL query against MSSQL
225
+ * @param sql The SQL query to execute
226
+ * @param params Optional named parameters (e.g., { id: 123 } for @id in the query)
227
+ * @param invocationKey Unique key for tracking this invocation
228
+ * @param timeoutMs Optional timeout in milliseconds
229
+ * @returns Typed response with rows of type T
230
+ *
231
+ * @example
232
+ * ```ts
233
+ * interface User { id: number; name: string; email: string }
234
+ *
235
+ * const response = await client.invoke<User>(
236
+ * "SELECT id, name, email FROM users WHERE id = @id",
237
+ * { id: 123 },
238
+ * "get-user-123"
239
+ * );
240
+ *
241
+ * if (response.ok) {
242
+ * const users: User[] = response.result.rows;
243
+ * }
244
+ * ```
245
+ */
246
+ async invoke(sql, params, invocationKey, timeoutMs) {
247
+ const payload = buildMssqlInvokePayload(sql, params, timeoutMs);
248
+ return this.invokeRaw(payload, invocationKey);
249
+ }
250
+ };
251
+
252
+ // src/payload-builders/dynamodb.ts
253
+ function buildDynamoDBInvokePayload(command, params) {
254
+ return {
255
+ type: "database",
256
+ subtype: "dynamodb",
257
+ command,
258
+ params
259
+ };
260
+ }
261
+
262
+ // src/clients/dynamodb.ts
263
+ var DynamoDBResourceClient = class extends BaseResourceClient {
264
+ async invoke(command, params, invocationKey) {
265
+ const payload = buildDynamoDBInvokePayload(command, params);
266
+ return this.invokeRaw(payload, invocationKey);
267
+ }
268
+ };
269
+
270
+ // src/payload-builders/cosmosdb.ts
271
+ function buildCosmosDBInvokePayload(payload) {
272
+ return payload;
273
+ }
274
+ function buildCosmosDBQueryPayload(container, query, options) {
275
+ return {
276
+ type: "database",
277
+ subtype: "cosmosdb",
278
+ operation: "query",
279
+ container,
280
+ query,
281
+ parameters: options?.parameters,
282
+ partitionKey: options?.partitionKey,
283
+ maxItemCount: options?.maxItemCount,
284
+ continuationToken: options?.continuationToken,
285
+ timeoutMs: options?.timeoutMs
286
+ };
287
+ }
288
+ function buildCosmosDBReadPayload(container, id, options) {
289
+ return {
290
+ type: "database",
291
+ subtype: "cosmosdb",
292
+ operation: "read",
293
+ container,
294
+ id,
295
+ partitionKey: options?.partitionKey,
296
+ timeoutMs: options?.timeoutMs
297
+ };
298
+ }
299
+ function buildCosmosDBCreatePayload(container, body, options) {
300
+ return {
301
+ type: "database",
302
+ subtype: "cosmosdb",
303
+ operation: "create",
304
+ container,
305
+ body,
306
+ partitionKey: options?.partitionKey,
307
+ timeoutMs: options?.timeoutMs
308
+ };
309
+ }
310
+ function buildCosmosDBReplacePayload(container, id, body, options) {
311
+ return {
312
+ type: "database",
313
+ subtype: "cosmosdb",
314
+ operation: "replace",
315
+ container,
316
+ id,
317
+ body,
318
+ partitionKey: options?.partitionKey,
319
+ timeoutMs: options?.timeoutMs
320
+ };
321
+ }
322
+ function buildCosmosDBUpsertPayload(container, body, options) {
323
+ return {
324
+ type: "database",
325
+ subtype: "cosmosdb",
326
+ operation: "upsert",
327
+ container,
328
+ body,
329
+ partitionKey: options?.partitionKey,
330
+ timeoutMs: options?.timeoutMs
331
+ };
332
+ }
333
+ function buildCosmosDBDeletePayload(container, id, options) {
334
+ return {
335
+ type: "database",
336
+ subtype: "cosmosdb",
337
+ operation: "delete",
338
+ container,
339
+ id,
340
+ partitionKey: options?.partitionKey,
341
+ timeoutMs: options?.timeoutMs
342
+ };
343
+ }
344
+ function buildCosmosDBPatchPayload(container, id, patchOperations, options) {
345
+ return {
346
+ type: "database",
347
+ subtype: "cosmosdb",
348
+ operation: "patch",
349
+ container,
350
+ id,
351
+ patchOperations,
352
+ partitionKey: options?.partitionKey,
353
+ condition: options?.condition,
354
+ timeoutMs: options?.timeoutMs
355
+ };
356
+ }
357
+
358
+ // src/clients/cosmosdb.ts
359
+ var CosmosDBResourceClient = class extends BaseResourceClient {
360
+ /**
361
+ * Invoke a CosmosDB operation with a raw payload
362
+ * @param payload The complete operation payload
363
+ * @param invocationKey Unique key for tracking this invocation
364
+ */
365
+ async invoke(payload, invocationKey) {
366
+ return this.invokeRaw(buildCosmosDBInvokePayload(payload), invocationKey);
367
+ }
368
+ /**
369
+ * Execute a SQL query against a container
370
+ * @param container The container name
371
+ * @param query The SQL query string
372
+ * @param invocationKey Unique key for tracking this invocation
373
+ * @param options Query options (parameters, partitionKey, pagination)
374
+ */
375
+ async query(container, query, invocationKey, options) {
376
+ const payload = buildCosmosDBQueryPayload(container, query, options);
377
+ return this.invokeRaw(payload, invocationKey);
378
+ }
379
+ /**
380
+ * Read a single document by ID
381
+ * @param container The container name
382
+ * @param id The document ID
383
+ * @param invocationKey Unique key for tracking this invocation
384
+ * @param options Additional options (partitionKey, timeoutMs)
385
+ */
386
+ async read(container, id, invocationKey, options) {
387
+ const payload = buildCosmosDBReadPayload(container, id, options);
388
+ return this.invokeRaw(payload, invocationKey);
389
+ }
390
+ /**
391
+ * Create a new document
392
+ * @param container The container name
393
+ * @param body The document body (must include id and partition key properties)
394
+ * @param invocationKey Unique key for tracking this invocation
395
+ * @param options Additional options (partitionKey, timeoutMs)
396
+ */
397
+ async create(container, body, invocationKey, options) {
398
+ const payload = buildCosmosDBCreatePayload(container, body, options);
399
+ return this.invokeRaw(payload, invocationKey);
400
+ }
401
+ /**
402
+ * Replace an existing document
403
+ * @param container The container name
404
+ * @param id The document ID
405
+ * @param body The new document body
406
+ * @param invocationKey Unique key for tracking this invocation
407
+ * @param options Additional options (partitionKey, timeoutMs)
408
+ */
409
+ async replace(container, id, body, invocationKey, options) {
410
+ const payload = buildCosmosDBReplacePayload(container, id, body, options);
411
+ return this.invokeRaw(payload, invocationKey);
412
+ }
413
+ /**
414
+ * Upsert a document (insert or replace)
415
+ * @param container The container name
416
+ * @param body The document body (must include id and partition key properties)
417
+ * @param invocationKey Unique key for tracking this invocation
418
+ * @param options Additional options (partitionKey, timeoutMs)
419
+ */
420
+ async upsert(container, body, invocationKey, options) {
421
+ const payload = buildCosmosDBUpsertPayload(container, body, options);
422
+ return this.invokeRaw(payload, invocationKey);
423
+ }
424
+ /**
425
+ * Delete a document
426
+ * @param container The container name
427
+ * @param id The document ID
428
+ * @param invocationKey Unique key for tracking this invocation
429
+ * @param options Additional options (partitionKey, timeoutMs)
430
+ */
431
+ async delete(container, id, invocationKey, options) {
432
+ const payload = buildCosmosDBDeletePayload(container, id, options);
433
+ return this.invokeRaw(payload, invocationKey);
434
+ }
435
+ /**
436
+ * Patch a document with partial updates
437
+ * @param container The container name
438
+ * @param id The document ID
439
+ * @param patchOperations Array of patch operations
440
+ * @param invocationKey Unique key for tracking this invocation
441
+ * @param options Additional options (partitionKey, condition, timeoutMs)
442
+ */
443
+ async patch(container, id, patchOperations, invocationKey, options) {
444
+ const payload = buildCosmosDBPatchPayload(container, id, patchOperations, options);
445
+ return this.invokeRaw(payload, invocationKey);
446
+ }
447
+ };
448
+
449
+ // src/payload-builders/snowflake.ts
450
+ function buildSnowflakeInvokePayload(payload) {
451
+ return payload;
452
+ }
453
+ function buildSnowflakeExecutePayload(statement, options) {
454
+ return {
455
+ type: "database",
456
+ subtype: "snowflake",
457
+ operation: "execute",
458
+ statement,
459
+ bindings: options?.bindings,
460
+ database: options?.database,
461
+ schema: options?.schema,
462
+ warehouse: options?.warehouse,
463
+ role: options?.role,
464
+ timeout: options?.timeout,
465
+ async: options?.async,
466
+ parameters: options?.parameters,
467
+ nullable: options?.nullable,
468
+ requestId: options?.requestId
469
+ };
470
+ }
471
+ function buildSnowflakeStatusPayload(statementHandle, options) {
472
+ return {
473
+ type: "database",
474
+ subtype: "snowflake",
475
+ operation: "status",
476
+ statementHandle,
477
+ partition: options?.partition
478
+ };
479
+ }
480
+ function buildSnowflakeCancelPayload(statementHandle) {
481
+ return {
482
+ type: "database",
483
+ subtype: "snowflake",
484
+ operation: "cancel",
485
+ statementHandle
486
+ };
487
+ }
488
+
489
+ // src/clients/snowflake.ts
490
+ var SnowflakeResourceClient = class extends BaseResourceClient {
491
+ /**
492
+ * Invoke a Snowflake operation with a raw payload
493
+ * @param payload The complete operation payload
494
+ * @param invocationKey Unique key for tracking this invocation
495
+ */
496
+ async invoke(payload, invocationKey) {
497
+ return this.invokeRaw(buildSnowflakeInvokePayload(payload), invocationKey);
498
+ }
499
+ /**
500
+ * Execute a SQL statement
501
+ * @param statement The SQL statement to execute
502
+ * @param invocationKey Unique key for tracking this invocation
503
+ * @param options Execution options (bindings, database overrides, async, etc.)
504
+ */
505
+ async execute(statement, invocationKey, options = {}) {
506
+ const payload = buildSnowflakeExecutePayload(statement, options);
507
+ return this.invokeRaw(payload, invocationKey);
508
+ }
509
+ /**
510
+ * Get status or results of a statement
511
+ * @param statementHandle The statement handle from execute operation
512
+ * @param invocationKey Unique key for tracking this invocation
513
+ * @param options Status options (partition for paginated results)
514
+ */
515
+ async status(statementHandle, invocationKey, options = {}) {
516
+ const payload = buildSnowflakeStatusPayload(statementHandle, options);
517
+ return this.invokeRaw(payload, invocationKey);
518
+ }
519
+ /**
520
+ * Cancel a running statement
521
+ * @param statementHandle The statement handle to cancel
522
+ * @param invocationKey Unique key for tracking this invocation
523
+ */
524
+ async cancel(statementHandle, invocationKey) {
525
+ const payload = buildSnowflakeCancelPayload(statementHandle);
526
+ return this.invokeRaw(payload, invocationKey);
527
+ }
528
+ };
529
+
530
+ // src/payload-builders/custom.ts
531
+ function buildCustomApiInvokePayload(method, path, options) {
532
+ return {
533
+ type: "api",
534
+ subtype: "custom",
535
+ method,
536
+ path,
537
+ query: options?.query,
538
+ headers: options?.headers,
539
+ body: options?.body,
540
+ timeoutMs: options?.timeoutMs ?? 3e4
541
+ };
542
+ }
543
+
544
+ // src/clients/api-custom.ts
545
+ var CustomApiResourceClient = class extends BaseResourceClient {
546
+ async invoke(method, path, invocationKey, options = {}) {
547
+ const payload = buildCustomApiInvokePayload(method, path, options);
548
+ return this.invokeRaw(payload, invocationKey);
549
+ }
550
+ };
551
+
552
+ // src/payload-builders/hubspot.ts
553
+ function buildHubSpotInvokePayload(method, path, options) {
554
+ return {
555
+ type: "api",
556
+ subtype: "hubspot",
557
+ method,
558
+ path,
559
+ query: options?.query,
560
+ body: options?.body,
561
+ timeoutMs: options?.timeoutMs ?? 3e4
562
+ };
563
+ }
564
+
565
+ // src/clients/hubspot.ts
566
+ var HubSpotResourceClient = class extends BaseResourceClient {
567
+ async invoke(method, path, invocationKey, options = {}) {
568
+ const payload = buildHubSpotInvokePayload(method, path, options);
569
+ return this.invokeRaw(payload, invocationKey);
570
+ }
571
+ };
572
+
573
+ // src/payload-builders/salesforce.ts
574
+ function buildSalesforceInvokePayload(method, path, options) {
575
+ return {
576
+ type: "api",
577
+ subtype: "salesforce",
578
+ method,
579
+ path,
580
+ query: options?.query,
581
+ body: options?.body,
582
+ timeoutMs: options?.timeoutMs ?? 3e4
583
+ };
584
+ }
585
+ function buildSalesforceQueryPayload(query, options) {
586
+ return buildSalesforceInvokePayload("GET", "/services/data/v63.0/query", {
587
+ query: { q: [query] },
588
+ timeoutMs: options?.timeoutMs
589
+ });
590
+ }
591
+ function buildSalesforceGetRecordPayload(objectType, recordId, options) {
592
+ const query = {};
593
+ if (options?.fields && options.fields.length > 0) {
594
+ query.fields = [options.fields.join(",")];
595
+ }
596
+ return buildSalesforceInvokePayload(
597
+ "GET",
598
+ `/services/data/v63.0/sobjects/${objectType}/${recordId}`,
599
+ {
600
+ query: Object.keys(query).length > 0 ? query : void 0,
601
+ timeoutMs: options?.timeoutMs
602
+ }
603
+ );
604
+ }
605
+ function buildSalesforceCreateRecordPayload(objectType, data, options) {
606
+ return buildSalesforceInvokePayload(
607
+ "POST",
608
+ `/services/data/v63.0/sobjects/${objectType}`,
609
+ {
610
+ body: { type: "json", value: data },
611
+ timeoutMs: options?.timeoutMs
612
+ }
613
+ );
614
+ }
615
+ function buildSalesforceUpdateRecordPayload(objectType, recordId, data, options) {
616
+ return buildSalesforceInvokePayload(
617
+ "PATCH",
618
+ `/services/data/v63.0/sobjects/${objectType}/${recordId}`,
619
+ {
620
+ body: { type: "json", value: data },
621
+ timeoutMs: options?.timeoutMs
622
+ }
623
+ );
624
+ }
625
+ function buildSalesforceDeleteRecordPayload(objectType, recordId, options) {
626
+ return buildSalesforceInvokePayload(
627
+ "DELETE",
628
+ `/services/data/v63.0/sobjects/${objectType}/${recordId}`,
629
+ {
630
+ timeoutMs: options?.timeoutMs
631
+ }
632
+ );
633
+ }
634
+ function buildSalesforceDescribeObjectPayload(objectType, options) {
635
+ return buildSalesforceInvokePayload(
636
+ "GET",
637
+ `/services/data/v63.0/sobjects/${objectType}/describe`,
638
+ {
639
+ timeoutMs: options?.timeoutMs
640
+ }
641
+ );
642
+ }
643
+
644
+ // src/clients/salesforce.ts
645
+ var SalesforceResourceClient = class extends BaseResourceClient {
646
+ /**
647
+ * Invoke a Salesforce API request
648
+ *
649
+ * @param method - HTTP method (GET, POST, PATCH, DELETE)
650
+ * @param path - Salesforce API path (e.g., "/services/data/v63.0/query")
651
+ * @param invocationKey - Unique key for this invocation (for tracking)
652
+ * @param options - Optional query params, body, and timeout
653
+ * @returns The API response with status and body
654
+ */
655
+ async invoke(method, path, invocationKey, options = {}) {
656
+ const payload = buildSalesforceInvokePayload(method, path, options);
657
+ return this.invokeRaw(payload, invocationKey);
658
+ }
659
+ /**
660
+ * Execute a SOQL query
661
+ *
662
+ * @param query - SOQL query string
663
+ * @param invocationKey - Unique key for this invocation
664
+ * @param options - Optional timeout
665
+ * @returns Query results
666
+ *
667
+ * @example
668
+ * ```typescript
669
+ * const result = await client.query(
670
+ * "SELECT Id, Name, CreatedDate FROM Account WHERE CreatedDate > 2024-01-01T00:00:00Z",
671
+ * "recent-accounts"
672
+ * );
673
+ * ```
674
+ */
675
+ async query(query, invocationKey, options = {}) {
676
+ return this.invoke("GET", "/services/data/v63.0/query", invocationKey, {
677
+ query: { q: [query] },
678
+ timeoutMs: options.timeoutMs
679
+ });
680
+ }
681
+ /**
682
+ * Get a single record by ID
683
+ *
684
+ * @param objectType - Salesforce object type (e.g., "Account", "Contact")
685
+ * @param recordId - The record ID
686
+ * @param invocationKey - Unique key for this invocation
687
+ * @param options - Optional fields to retrieve and timeout
688
+ * @returns The record data
689
+ */
690
+ async getRecord(objectType, recordId, invocationKey, options = {}) {
691
+ const query = {};
692
+ if (options.fields && options.fields.length > 0) {
693
+ query.fields = [options.fields.join(",")];
694
+ }
695
+ return this.invoke(
696
+ "GET",
697
+ `/services/data/v63.0/sobjects/${objectType}/${recordId}`,
698
+ invocationKey,
699
+ { query: Object.keys(query).length > 0 ? query : void 0, timeoutMs: options.timeoutMs }
700
+ );
701
+ }
702
+ /**
703
+ * Create a new record
704
+ *
705
+ * @param objectType - Salesforce object type (e.g., "Account", "Contact")
706
+ * @param data - Record data
707
+ * @param invocationKey - Unique key for this invocation
708
+ * @param options - Optional timeout
709
+ * @returns The created record ID
710
+ */
711
+ async createRecord(objectType, data, invocationKey, options = {}) {
712
+ return this.invoke(
713
+ "POST",
714
+ `/services/data/v63.0/sobjects/${objectType}`,
715
+ invocationKey,
716
+ { body: { type: "json", value: data }, timeoutMs: options.timeoutMs }
717
+ );
718
+ }
719
+ /**
720
+ * Update an existing record
721
+ *
722
+ * @param objectType - Salesforce object type (e.g., "Account", "Contact")
723
+ * @param recordId - The record ID to update
724
+ * @param data - Fields to update
725
+ * @param invocationKey - Unique key for this invocation
726
+ * @param options - Optional timeout
727
+ * @returns Empty response on success
728
+ */
729
+ async updateRecord(objectType, recordId, data, invocationKey, options = {}) {
730
+ return this.invoke(
731
+ "PATCH",
732
+ `/services/data/v63.0/sobjects/${objectType}/${recordId}`,
733
+ invocationKey,
734
+ { body: { type: "json", value: data }, timeoutMs: options.timeoutMs }
735
+ );
736
+ }
737
+ /**
738
+ * Delete a record
739
+ *
740
+ * @param objectType - Salesforce object type (e.g., "Account", "Contact")
741
+ * @param recordId - The record ID to delete
742
+ * @param invocationKey - Unique key for this invocation
743
+ * @param options - Optional timeout
744
+ * @returns Empty response on success
745
+ */
746
+ async deleteRecord(objectType, recordId, invocationKey, options = {}) {
747
+ return this.invoke(
748
+ "DELETE",
749
+ `/services/data/v63.0/sobjects/${objectType}/${recordId}`,
750
+ invocationKey,
751
+ { timeoutMs: options.timeoutMs }
752
+ );
753
+ }
754
+ /**
755
+ * Describe an object to get its metadata
756
+ *
757
+ * @param objectType - Salesforce object type (e.g., "Account", "Contact")
758
+ * @param invocationKey - Unique key for this invocation
759
+ * @param options - Optional timeout
760
+ * @returns Object metadata including fields, relationships, etc.
761
+ */
762
+ async describeObject(objectType, invocationKey, options = {}) {
763
+ return this.invoke(
764
+ "GET",
765
+ `/services/data/v63.0/sobjects/${objectType}/describe`,
766
+ invocationKey,
767
+ { timeoutMs: options.timeoutMs }
768
+ );
769
+ }
770
+ };
771
+
772
+ // src/payload-builders/googlesheets.ts
773
+ function buildGoogleSheetsInvokePayload(method, path, options) {
774
+ return {
775
+ type: "api",
776
+ subtype: "googlesheets",
777
+ method,
778
+ path,
779
+ query: options?.query,
780
+ body: options?.body,
781
+ timeoutMs: options?.timeoutMs ?? 3e4
782
+ };
783
+ }
784
+ function buildGoogleSheetsGetValuesPayload(range, options) {
785
+ return buildGoogleSheetsInvokePayload("GET", `/values/${range}`, {
786
+ timeoutMs: options?.timeoutMs
787
+ });
788
+ }
789
+ function buildGoogleSheetsUpdateValuesPayload(range, values, valueInputOption = "USER_ENTERED", options) {
790
+ return buildGoogleSheetsInvokePayload("PUT", `/values/${range}`, {
791
+ query: { valueInputOption: [valueInputOption] },
792
+ body: { type: "json", value: { values } },
793
+ timeoutMs: options?.timeoutMs
794
+ });
795
+ }
796
+ function buildGoogleSheetsAppendValuesPayload(range, values, valueInputOption = "USER_ENTERED", options) {
797
+ return buildGoogleSheetsInvokePayload("POST", `/values/${range}:append`, {
798
+ query: { valueInputOption: [valueInputOption] },
799
+ body: { type: "json", value: { values } },
800
+ timeoutMs: options?.timeoutMs
801
+ });
802
+ }
803
+ function buildGoogleSheetsClearValuesPayload(range, options) {
804
+ return buildGoogleSheetsInvokePayload("POST", `/values/${range}:clear`, {
805
+ timeoutMs: options?.timeoutMs
806
+ });
807
+ }
808
+ function buildGoogleSheetsBatchGetValuesPayload(ranges, options) {
809
+ return buildGoogleSheetsInvokePayload("GET", "/values:batchGet", {
810
+ query: { ranges },
811
+ timeoutMs: options?.timeoutMs
812
+ });
813
+ }
814
+ function buildGoogleSheetsBatchUpdateValuesPayload(data, valueInputOption = "USER_ENTERED", options) {
815
+ return buildGoogleSheetsInvokePayload("POST", "/values:batchUpdate", {
816
+ body: {
817
+ type: "json",
818
+ value: {
819
+ valueInputOption,
820
+ data
821
+ }
822
+ },
823
+ timeoutMs: options?.timeoutMs
824
+ });
825
+ }
826
+ function buildGoogleSheetsGetSpreadsheetPayload(options) {
827
+ return buildGoogleSheetsInvokePayload("GET", "/", {
828
+ timeoutMs: options?.timeoutMs
829
+ });
830
+ }
831
+ function buildGoogleSheetsBatchUpdatePayload(requests, options) {
832
+ return buildGoogleSheetsInvokePayload("POST", "/:batchUpdate", {
833
+ body: { type: "json", value: { requests } },
834
+ timeoutMs: options?.timeoutMs
835
+ });
836
+ }
837
+
838
+ // src/clients/googlesheets.ts
839
+ var GoogleSheetsResourceClient = class extends BaseResourceClient {
840
+ async invoke(method, path, invocationKey, options = {}) {
841
+ const payload = buildGoogleSheetsInvokePayload(method, path, options);
842
+ return this.invokeRaw(payload, invocationKey);
843
+ }
844
+ /**
845
+ * Get values from a range in the spreadsheet
846
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
847
+ * @param invocationKey Unique key for tracking this invocation
848
+ */
849
+ async getValues(range, invocationKey) {
850
+ return this.invoke("GET", `/values/${range}`, invocationKey);
851
+ }
852
+ /**
853
+ * Update values in a range in the spreadsheet
854
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
855
+ * @param values 2D array of values to write
856
+ * @param invocationKey Unique key for tracking this invocation
857
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
858
+ */
859
+ async updateValues(range, values, invocationKey, valueInputOption = "USER_ENTERED") {
860
+ return this.invoke(
861
+ "PUT",
862
+ `/values/${range}`,
863
+ invocationKey,
864
+ {
865
+ query: { valueInputOption },
866
+ body: { type: "json", value: { values } }
867
+ }
868
+ );
869
+ }
870
+ /**
871
+ * Append values to a sheet
872
+ * @param range A1 notation range (e.g., "Sheet1!A1:D1")
873
+ * @param values 2D array of values to append
874
+ * @param invocationKey Unique key for tracking this invocation
875
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
876
+ */
877
+ async appendValues(range, values, invocationKey, valueInputOption = "USER_ENTERED") {
878
+ return this.invoke(
879
+ "POST",
880
+ `/values/${range}:append`,
881
+ invocationKey,
882
+ {
883
+ query: { valueInputOption },
884
+ body: { type: "json", value: { values } }
885
+ }
886
+ );
887
+ }
888
+ /**
889
+ * Clear values in a range
890
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
891
+ * @param invocationKey Unique key for tracking this invocation
892
+ */
893
+ async clearValues(range, invocationKey) {
894
+ return this.invoke("POST", `/values/${range}:clear`, invocationKey);
895
+ }
896
+ /**
897
+ * Batch get multiple ranges
898
+ * @param ranges Array of A1 notation ranges
899
+ * @param invocationKey Unique key for tracking this invocation
900
+ */
901
+ async batchGetValues(ranges, invocationKey) {
902
+ return this.invoke("GET", "/values:batchGet", invocationKey, {
903
+ query: { ranges }
904
+ });
905
+ }
906
+ /**
907
+ * Batch update multiple ranges
908
+ * @param data Array of range updates
909
+ * @param invocationKey Unique key for tracking this invocation
910
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
911
+ */
912
+ async batchUpdateValues(data, invocationKey, valueInputOption = "USER_ENTERED") {
913
+ return this.invoke("POST", "/values:batchUpdate", invocationKey, {
914
+ body: {
915
+ type: "json",
916
+ value: {
917
+ valueInputOption,
918
+ data
919
+ }
920
+ }
921
+ });
922
+ }
923
+ /**
924
+ * Get spreadsheet metadata
925
+ * @param invocationKey Unique key for tracking this invocation
926
+ */
927
+ async getSpreadsheet(invocationKey) {
928
+ return this.invoke("GET", "/", invocationKey);
929
+ }
930
+ /**
931
+ * Batch update spreadsheet (for formatting, creating sheets, etc.)
932
+ * @param requests Array of update requests
933
+ * @param invocationKey Unique key for tracking this invocation
934
+ */
935
+ async batchUpdate(requests, invocationKey) {
936
+ return this.invoke("POST", "/:batchUpdate", invocationKey, {
937
+ body: { type: "json", value: { requests } }
938
+ });
939
+ }
940
+ };
941
+
942
+ // src/payload-builders/s3.ts
943
+ function buildS3InvokePayload(command, params, options) {
944
+ return {
945
+ type: "storage",
946
+ subtype: "s3",
947
+ command,
948
+ params,
949
+ timeoutMs: options?.timeoutMs
950
+ };
951
+ }
952
+
953
+ // src/clients/s3.ts
954
+ var S3ResourceClient = class extends BaseResourceClient {
955
+ async invoke(command, params, invocationKey, options = {}) {
956
+ const payload = buildS3InvokePayload(command, params, options);
957
+ return this.invokeRaw(payload, invocationKey);
958
+ }
959
+ };
960
+
961
+ // src/payload-builders/lambda.ts
962
+ function buildLambdaInvokePayload(functionName, payload, options) {
963
+ return {
964
+ type: "api",
965
+ subtype: "lambda",
966
+ FunctionName: functionName,
967
+ Payload: payload,
968
+ ...options
969
+ };
970
+ }
971
+
972
+ // src/clients/lambda.ts
973
+ var LambdaResourceClient = class extends BaseResourceClient {
974
+ /**
975
+ * Invoke a Lambda function
976
+ *
977
+ * @param functionName - The name, ARN, or partial ARN of the Lambda function
978
+ * @param payload - The JSON input for the Lambda function (optional)
979
+ * @param invocationKey - A unique key for tracking this invocation
980
+ * @param options - Additional invocation options
981
+ * @returns The Lambda invocation result
982
+ *
983
+ * @example
984
+ * ```typescript
985
+ * // Simple synchronous invocation
986
+ * const result = await lambdaClient.invoke(
987
+ * "my-function",
988
+ * { key: "value" },
989
+ * "process-data"
990
+ * );
991
+ *
992
+ * if (result.ok) {
993
+ * console.log("Response:", result.result.Payload);
994
+ * }
995
+ *
996
+ * // Asynchronous invocation
997
+ * const asyncResult = await lambdaClient.invoke(
998
+ * "my-function",
999
+ * { key: "value" },
1000
+ * "async-process",
1001
+ * { InvocationType: "Event" }
1002
+ * );
1003
+ *
1004
+ * // With execution logs
1005
+ * const debugResult = await lambdaClient.invoke(
1006
+ * "my-function",
1007
+ * { key: "value" },
1008
+ * "debug-invocation",
1009
+ * { LogType: "Tail" }
1010
+ * );
1011
+ *
1012
+ * if (debugResult.ok) {
1013
+ * // LogResult is base64 encoded
1014
+ * const logs = atob(debugResult.result.LogResult || "");
1015
+ * console.log("Execution logs:", logs);
1016
+ * }
1017
+ * ```
1018
+ */
1019
+ async invoke(functionName, payload, invocationKey, options = {}) {
1020
+ const invokePayload = buildLambdaInvokePayload(functionName, payload, options);
1021
+ return this.invokeRaw(invokePayload, invocationKey);
1022
+ }
1023
+ };
1024
+
1025
+ // src/payload-builders/bigquery.ts
1026
+ function buildBigQueryQueryPayload(sql, params, options) {
1027
+ return {
1028
+ type: "database",
1029
+ subtype: "bigquery",
1030
+ operation: "query",
1031
+ sql,
1032
+ params,
1033
+ timeoutMs: options?.timeoutMs,
1034
+ maxResults: options?.maxResults
1035
+ };
1036
+ }
1037
+ function buildBigQueryListDatasetsPayload(options) {
1038
+ return {
1039
+ type: "database",
1040
+ subtype: "bigquery",
1041
+ operation: "listDatasets",
1042
+ maxResults: options?.maxResults
1043
+ };
1044
+ }
1045
+ function buildBigQueryListTablesPayload(datasetId, options) {
1046
+ return {
1047
+ type: "database",
1048
+ subtype: "bigquery",
1049
+ operation: "listTables",
1050
+ datasetId,
1051
+ maxResults: options?.maxResults
1052
+ };
1053
+ }
1054
+ function buildBigQueryGetTablePayload(datasetId, tableId) {
1055
+ return {
1056
+ type: "database",
1057
+ subtype: "bigquery",
1058
+ operation: "getTable",
1059
+ datasetId,
1060
+ tableId
1061
+ };
1062
+ }
1063
+ function buildBigQueryInsertRowsPayload(datasetId, tableId, rows) {
1064
+ return {
1065
+ type: "database",
1066
+ subtype: "bigquery",
1067
+ operation: "insertRows",
1068
+ datasetId,
1069
+ tableId,
1070
+ rows
1071
+ };
1072
+ }
1073
+ function buildBigQueryCreateTablePayload(datasetId, tableId, schema, options) {
1074
+ return {
1075
+ type: "database",
1076
+ subtype: "bigquery",
1077
+ operation: "createTable",
1078
+ datasetId,
1079
+ tableId,
1080
+ schema,
1081
+ timeoutMs: options?.timeoutMs
1082
+ };
1083
+ }
1084
+ function buildBigQueryInvokePayload(payload) {
1085
+ return {
1086
+ type: "database",
1087
+ subtype: "bigquery",
1088
+ ...payload
1089
+ };
1090
+ }
1091
+
1092
+ // src/clients/bigquery.ts
1093
+ var BigQueryResourceClient = class extends BaseResourceClient {
1094
+ /**
1095
+ * Execute a SQL query
1096
+ * @param sql The SQL query to execute
1097
+ * @param params Optional query parameters (named parameters)
1098
+ * @param invocationKey Unique key for tracking this invocation
1099
+ * @param options Query options
1100
+ */
1101
+ async query(sql, params, invocationKey, options) {
1102
+ const payload = buildBigQueryQueryPayload(sql, params, options);
1103
+ return this.invokeRaw(payload, invocationKey);
1104
+ }
1105
+ /**
1106
+ * List all datasets in the project
1107
+ * @param invocationKey Unique key for tracking this invocation
1108
+ * @param options List options
1109
+ */
1110
+ async listDatasets(invocationKey, options) {
1111
+ const payload = buildBigQueryListDatasetsPayload(options);
1112
+ return this.invokeRaw(payload, invocationKey);
1113
+ }
1114
+ /**
1115
+ * List all tables in a dataset
1116
+ * @param datasetId The dataset ID
1117
+ * @param invocationKey Unique key for tracking this invocation
1118
+ * @param options List options
1119
+ */
1120
+ async listTables(datasetId, invocationKey, options) {
1121
+ const payload = buildBigQueryListTablesPayload(datasetId, options);
1122
+ return this.invokeRaw(payload, invocationKey);
1123
+ }
1124
+ /**
1125
+ * Get table metadata and schema
1126
+ * @param datasetId The dataset ID
1127
+ * @param tableId The table ID
1128
+ * @param invocationKey Unique key for tracking this invocation
1129
+ */
1130
+ async getTable(datasetId, tableId, invocationKey) {
1131
+ const payload = buildBigQueryGetTablePayload(datasetId, tableId);
1132
+ return this.invokeRaw(payload, invocationKey);
1133
+ }
1134
+ /**
1135
+ * Insert rows into a table (streaming insert)
1136
+ * @param datasetId The dataset ID
1137
+ * @param tableId The table ID
1138
+ * @param rows Array of rows to insert
1139
+ * @param invocationKey Unique key for tracking this invocation
1140
+ */
1141
+ async insertRows(datasetId, tableId, rows, invocationKey) {
1142
+ const payload = buildBigQueryInsertRowsPayload(datasetId, tableId, rows);
1143
+ return this.invokeRaw(payload, invocationKey);
1144
+ }
1145
+ /**
1146
+ * Create a new table
1147
+ * @param datasetId The dataset ID
1148
+ * @param tableId The table ID
1149
+ * @param schema Table schema definition
1150
+ * @param invocationKey Unique key for tracking this invocation
1151
+ * @param options Table creation options
1152
+ */
1153
+ async createTable(datasetId, tableId, schema, invocationKey, options) {
1154
+ const payload = buildBigQueryCreateTablePayload(datasetId, tableId, schema, options);
1155
+ return this.invokeRaw(payload, invocationKey);
1156
+ }
1157
+ /**
1158
+ * Raw invoke with a custom payload
1159
+ * @param payload The BigQuery payload
1160
+ * @param invocationKey Unique key for tracking this invocation
1161
+ */
1162
+ async invoke(payload, invocationKey) {
1163
+ const fullPayload = buildBigQueryInvokePayload(payload);
1164
+ return this.invokeRaw(fullPayload, invocationKey);
1165
+ }
1166
+ };
1167
+
1168
+ // src/clients/outreach.ts
1169
+ var OutreachResourceClient = class extends BaseResourceClient {
1170
+ /**
1171
+ * Invoke an Outreach API endpoint
1172
+ *
1173
+ * @param method - HTTP method (GET, POST, PUT, PATCH, DELETE)
1174
+ * @param path - Outreach API path (e.g., "/api/v2/prospects")
1175
+ * @param invocationKey - Unique key for this invocation (for idempotency/tracking)
1176
+ * @param options - Optional query params, body, and timeout
1177
+ */
1178
+ async invoke(method, path, invocationKey, options = {}) {
1179
+ const payload = {
1180
+ type: "api",
1181
+ subtype: "outreach",
1182
+ method,
1183
+ path,
1184
+ queryParams: options.queryParams,
1185
+ body: options.body,
1186
+ timeoutMs: options.timeoutMs || 3e4
1187
+ };
1188
+ return this.invokeRaw(payload, invocationKey);
1189
+ }
1190
+ };
1191
+
1192
+ // src/payload-builders/neo4j.ts
1193
+ function buildNeo4jInvokePayload(cypher, params, timeoutMs) {
1194
+ return {
1195
+ type: "database",
1196
+ subtype: "neo4j",
1197
+ cypher,
1198
+ params,
1199
+ timeoutMs
1200
+ };
1201
+ }
1202
+
1203
+ // src/clients/neo4j.ts
1204
+ var Neo4jResourceClient = class extends BaseResourceClient {
1205
+ /**
1206
+ * Execute a Cypher query against Neo4j
1207
+ * @param cypher The Cypher query to execute
1208
+ * @param params Optional named parameters for the query
1209
+ * @param invocationKey Unique key for tracking this invocation
1210
+ * @param timeoutMs Optional timeout in milliseconds
1211
+ * @returns Response with records and keys
1212
+ *
1213
+ * @example
1214
+ * ```ts
1215
+ * const response = await client.invoke(
1216
+ * "MATCH (n:Person {name: $name}) RETURN n",
1217
+ * { name: "Alice" },
1218
+ * "find-alice"
1219
+ * );
1220
+ *
1221
+ * if (response.ok) {
1222
+ * const records = response.result.records;
1223
+ * }
1224
+ * ```
1225
+ */
1226
+ async invoke(cypher, params, invocationKey, timeoutMs) {
1227
+ const payload = buildNeo4jInvokePayload(cypher, params, timeoutMs);
1228
+ return this.invokeRaw(payload, invocationKey);
1229
+ }
1230
+ };
1231
+
1232
+ // src/payload-builders/slack.ts
1233
+ function buildSlackInvokePayload(method, options) {
1234
+ return {
1235
+ type: "api",
1236
+ subtype: "slack",
1237
+ method,
1238
+ body: options?.body,
1239
+ timeoutMs: options?.timeoutMs ?? 3e4
1240
+ };
1241
+ }
1242
+ function buildSlackGetUploadURLPayload(filename, length, options) {
1243
+ return buildSlackInvokePayload("files.getUploadURLExternal", {
1244
+ body: {
1245
+ filename,
1246
+ length,
1247
+ alt_txt: options?.altText,
1248
+ snippet_type: options?.snippetType
1249
+ }
1250
+ });
1251
+ }
1252
+ function buildSlackCompleteUploadPayload(files, channelId, options) {
1253
+ return buildSlackInvokePayload("files.completeUploadExternal", {
1254
+ body: {
1255
+ files,
1256
+ channel_id: channelId,
1257
+ initial_comment: options?.initialComment,
1258
+ thread_ts: options?.threadTs
1259
+ }
1260
+ });
1261
+ }
1262
+
1263
+ // src/clients/slack.ts
1264
+ var SlackResourceClient = class extends BaseResourceClient {
1265
+ async invoke(method, invocationKey, options = {}) {
1266
+ const payload = buildSlackInvokePayload(method, options);
1267
+ return this.invokeRaw(payload, invocationKey);
1268
+ }
1269
+ /**
1270
+ * Get a pre-signed upload URL for uploading a file to Slack.
1271
+ * Step 1 of the file upload flow.
1272
+ * @see https://docs.slack.dev/reference/methods/files.getUploadURLExternal
1273
+ */
1274
+ async getUploadURL(filename, length, invocationKey, options) {
1275
+ return this.invoke("files.getUploadURLExternal", invocationKey, {
1276
+ body: {
1277
+ filename,
1278
+ length,
1279
+ alt_txt: options?.altText,
1280
+ snippet_type: options?.snippetType
1281
+ }
1282
+ });
1283
+ }
1284
+ /**
1285
+ * Complete a file upload and optionally share it to a channel.
1286
+ * Step 3 of the file upload flow (step 2 is uploading binary data to the URL from getUploadURL).
1287
+ * @see https://docs.slack.dev/reference/methods/files.completeUploadExternal
1288
+ */
1289
+ async completeUpload(files, channelId, invocationKey, options) {
1290
+ return this.invoke("files.completeUploadExternal", invocationKey, {
1291
+ body: {
1292
+ files,
1293
+ channel_id: channelId,
1294
+ initial_comment: options?.initialComment,
1295
+ thread_ts: options?.threadTs
1296
+ }
1297
+ });
1298
+ }
1299
+ };
1300
+
1301
+ // src/payload-builders/quickbooks.ts
1302
+ function buildQuickBooksInvokePayload(method, path, options) {
1303
+ return {
1304
+ type: "api",
1305
+ subtype: "quickbooks",
1306
+ method,
1307
+ path,
1308
+ query: options?.query,
1309
+ body: options?.body,
1310
+ timeoutMs: options?.timeoutMs ?? 3e4
1311
+ };
1312
+ }
1313
+ function buildQuickBooksQueryPayload(query, options) {
1314
+ return buildQuickBooksInvokePayload("GET", "/query", {
1315
+ query: { query: [query] },
1316
+ timeoutMs: options?.timeoutMs
1317
+ });
1318
+ }
1319
+
1320
+ // src/clients/quickbooks.ts
1321
+ var QuickBooksResourceClient = class extends BaseResourceClient {
1322
+ /**
1323
+ * Invoke a QuickBooks API request
1324
+ *
1325
+ * @param method - HTTP method (GET, POST, PUT, DELETE)
1326
+ * @param path - QuickBooks API path relative to /v3/company/{realmId}
1327
+ * @param invocationKey - Unique key for this invocation (for tracking)
1328
+ * @param options - Optional query params, body, and timeout
1329
+ * @returns The API response with status and body
1330
+ */
1331
+ async invoke(method, path, invocationKey, options = {}) {
1332
+ const payload = buildQuickBooksInvokePayload(method, path, options);
1333
+ return this.invokeRaw(payload, invocationKey);
1334
+ }
1335
+ /**
1336
+ * Execute a QuickBooks query using SQL-like syntax
1337
+ *
1338
+ * @param query - QuickBooks query string (e.g., "SELECT * FROM Customer WHERE DisplayName LIKE 'A%'")
1339
+ * @param invocationKey - Unique key for this invocation
1340
+ * @param options - Optional timeout
1341
+ * @returns Query results
1342
+ *
1343
+ * @example
1344
+ * ```typescript
1345
+ * const result = await client.query(
1346
+ * "SELECT * FROM Invoice WHERE TotalAmt > '100.00'",
1347
+ * "recent-invoices"
1348
+ * );
1349
+ * ```
1350
+ */
1351
+ async query(query, invocationKey, options = {}) {
1352
+ const payload = buildQuickBooksQueryPayload(query, options);
1353
+ return this.invokeRaw(payload, invocationKey);
1354
+ }
1355
+ };
1356
+
1357
+ // src/payload-builders/auth.ts
1358
+ function buildAuthShareAccessPayload(email) {
1359
+ return {
1360
+ type: "auth",
1361
+ subtype: "majorauth",
1362
+ action: "share",
1363
+ email
1364
+ };
1365
+ }
1366
+ function buildAuthRevokeAccessPayload(email) {
1367
+ return {
1368
+ type: "auth",
1369
+ subtype: "majorauth",
1370
+ action: "revoke",
1371
+ email
1372
+ };
1373
+ }
1374
+
1375
+ // src/clients/auth.ts
1376
+ var MajorAuthResourceClient = class extends BaseResourceClient {
1377
+ /**
1378
+ * Grant a user view access to this application by email.
1379
+ * If the user doesn't have an account, one will be created.
1380
+ * If the user isn't a member of the organization, they will be invited.
1381
+ */
1382
+ async shareAccess(email, invocationKey) {
1383
+ const payload = buildAuthShareAccessPayload(email);
1384
+ return this.invokeRaw(payload, invocationKey);
1385
+ }
1386
+ /**
1387
+ * Revoke a user's view access to this application by email.
1388
+ * Only removes app-level access; does not affect org membership or roles.
1389
+ */
1390
+ async revokeAccess(email, invocationKey) {
1391
+ const payload = buildAuthRevokeAccessPayload(email);
1392
+ return this.invokeRaw(payload, invocationKey);
1393
+ }
1394
+ };
1395
+
1396
+ // src/payload-builders/google-analytics.ts
1397
+ function buildGoogleAnalyticsRunReportPayload(dimensions, metrics, dateRanges, options) {
1398
+ return {
1399
+ type: "api",
1400
+ subtype: "googleanalytics",
1401
+ operation: "runReport",
1402
+ dimensions,
1403
+ metrics,
1404
+ dateRanges,
1405
+ dimensionFilter: options?.dimensionFilter,
1406
+ metricFilter: options?.metricFilter,
1407
+ orderBys: options?.orderBys,
1408
+ limit: options?.limit,
1409
+ offset: options?.offset
1410
+ };
1411
+ }
1412
+ function buildGoogleAnalyticsGetMetadataPayload() {
1413
+ return {
1414
+ type: "api",
1415
+ subtype: "googleanalytics",
1416
+ operation: "getMetadata"
1417
+ };
1418
+ }
1419
+ function buildGoogleAnalyticsRunRealtimeReportPayload(metrics, dimensions, limit) {
1420
+ return {
1421
+ type: "api",
1422
+ subtype: "googleanalytics",
1423
+ operation: "runRealtimeReport",
1424
+ metrics,
1425
+ dimensions,
1426
+ limit
1427
+ };
1428
+ }
1429
+ function buildGoogleAnalyticsListAccountsPayload(options) {
1430
+ return {
1431
+ type: "api",
1432
+ subtype: "googleanalytics",
1433
+ operation: "listAccounts",
1434
+ pageSize: options?.pageSize,
1435
+ pageToken: options?.pageToken
1436
+ };
1437
+ }
1438
+ function buildGoogleAnalyticsListPropertiesPayload(accountId, options) {
1439
+ return {
1440
+ type: "api",
1441
+ subtype: "googleanalytics",
1442
+ operation: "listProperties",
1443
+ accountId,
1444
+ pageSize: options?.pageSize,
1445
+ pageToken: options?.pageToken
1446
+ };
1447
+ }
1448
+ function buildGoogleAnalyticsListDataStreamsPayload(propertyId, options) {
1449
+ return {
1450
+ type: "api",
1451
+ subtype: "googleanalytics",
1452
+ operation: "listDataStreams",
1453
+ propertyId,
1454
+ pageSize: options?.pageSize,
1455
+ pageToken: options?.pageToken
1456
+ };
1457
+ }
1458
+ function buildGoogleAnalyticsInvokePayload(payload) {
1459
+ return {
1460
+ type: "api",
1461
+ subtype: "googleanalytics",
1462
+ ...payload
1463
+ };
1464
+ }
1465
+
1466
+ // src/clients/google-analytics.ts
1467
+ var GoogleAnalyticsResourceClient = class extends BaseResourceClient {
1468
+ /**
1469
+ * Run a GA4 report with dimensions, metrics, and date ranges
1470
+ * @param dimensions Dimensions to group by (e.g. [{name: 'country'}])
1471
+ * @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
1472
+ * @param dateRanges Date ranges (e.g. [{startDate: '2024-01-01', endDate: '2024-01-31'}])
1473
+ * @param invocationKey Unique key for tracking this invocation
1474
+ * @param options Optional report options (filters, ordering, limit, offset)
1475
+ */
1476
+ async runReport(dimensions, metrics, dateRanges, invocationKey, options) {
1477
+ const payload = buildGoogleAnalyticsRunReportPayload(dimensions, metrics, dateRanges, options);
1478
+ return this.invokeRaw(payload, invocationKey);
1479
+ }
1480
+ /**
1481
+ * Get available dimensions and metrics for the GA4 property
1482
+ * @param invocationKey Unique key for tracking this invocation
1483
+ */
1484
+ async getMetadata(invocationKey) {
1485
+ const payload = buildGoogleAnalyticsGetMetadataPayload();
1486
+ return this.invokeRaw(payload, invocationKey);
1487
+ }
1488
+ /**
1489
+ * Run a realtime report showing current live user activity
1490
+ * @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
1491
+ * @param invocationKey Unique key for tracking this invocation
1492
+ * @param dimensions Optional dimensions to group by
1493
+ * @param limit Optional row limit
1494
+ */
1495
+ async runRealtimeReport(metrics, invocationKey, dimensions, limit) {
1496
+ const payload = buildGoogleAnalyticsRunRealtimeReportPayload(metrics, dimensions, limit);
1497
+ return this.invokeRaw(payload, invocationKey);
1498
+ }
1499
+ /**
1500
+ * List all GA4 accounts accessible to the authenticated user
1501
+ * @param invocationKey Unique key for tracking this invocation
1502
+ * @param options Optional pagination options
1503
+ */
1504
+ async listAccounts(invocationKey, options) {
1505
+ const payload = buildGoogleAnalyticsListAccountsPayload(options);
1506
+ return this.invokeRaw(payload, invocationKey);
1507
+ }
1508
+ /**
1509
+ * List GA4 properties, optionally filtered by account
1510
+ * @param invocationKey Unique key for tracking this invocation
1511
+ * @param accountId Optional account filter (e.g. 'accounts/12345')
1512
+ * @param options Optional pagination options
1513
+ */
1514
+ async listProperties(invocationKey, accountId, options) {
1515
+ const payload = buildGoogleAnalyticsListPropertiesPayload(accountId, options);
1516
+ return this.invokeRaw(payload, invocationKey);
1517
+ }
1518
+ /**
1519
+ * List data streams for a GA4 property
1520
+ * @param invocationKey Unique key for tracking this invocation
1521
+ * @param propertyId Optional property ID (defaults to configured property)
1522
+ * @param options Optional pagination options
1523
+ */
1524
+ async listDataStreams(invocationKey, propertyId, options) {
1525
+ const payload = buildGoogleAnalyticsListDataStreamsPayload(propertyId, options);
1526
+ return this.invokeRaw(payload, invocationKey);
1527
+ }
1528
+ /**
1529
+ * Execute a raw Google Analytics operation
1530
+ * @param payload The raw operation payload
1531
+ * @param invocationKey Unique key for tracking this invocation
1532
+ */
1533
+ async invoke(payload, invocationKey) {
1534
+ const p = buildGoogleAnalyticsInvokePayload(payload);
1535
+ return this.invokeRaw(p, invocationKey);
1536
+ }
1537
+ };
1538
+
1539
+ // src/payload-builders/graphql.ts
1540
+ function buildGraphQLInvokePayload(query, options) {
1541
+ return {
1542
+ type: "api",
1543
+ subtype: "graphql",
1544
+ query,
1545
+ variables: options?.variables,
1546
+ operationName: options?.operationName,
1547
+ headers: options?.headers,
1548
+ timeoutMs: options?.timeoutMs ?? 3e4
1549
+ };
1550
+ }
1551
+
1552
+ // src/clients/api-graphql.ts
1553
+ var GraphQLResourceClient = class extends BaseResourceClient {
1554
+ async query(query, invocationKey, options = {}) {
1555
+ const payload = buildGraphQLInvokePayload(query, options);
1556
+ return this.invokeRaw(payload, invocationKey);
1557
+ }
1558
+ async mutate(mutation, invocationKey, options = {}) {
1559
+ const payload = buildGraphQLInvokePayload(mutation, options);
1560
+ return this.invokeRaw(payload, invocationKey);
1561
+ }
1562
+ };
1563
+
1564
+ // src/payload-builders/outreach.ts
1565
+ function buildOutreachInvokePayload(method, path, options) {
1566
+ return {
1567
+ type: "api",
1568
+ subtype: "outreach",
1569
+ method,
1570
+ path,
1571
+ queryParams: options?.queryParams,
1572
+ body: options?.body,
1573
+ timeoutMs: options?.timeoutMs ?? 3e4
1574
+ };
1575
+ }
1576
+
1577
+ // src/payload-builders/from-extracted-params.ts
1578
+ function isUndefinedParam(param) {
1579
+ return param.known === false && param.expression === "undefined";
1580
+ }
1581
+ function parseParamValue(value, valueType) {
1582
+ if (valueType === "object" || valueType === "list") {
1583
+ try {
1584
+ return JSON.parse(value);
1585
+ } catch {
1586
+ return value;
1587
+ }
1588
+ }
1589
+ if (valueType === "number") {
1590
+ const num = Number(value);
1591
+ return isNaN(num) ? value : num;
1592
+ }
1593
+ if (valueType === "boolean") {
1594
+ return value === "true";
1595
+ }
1596
+ return value;
1597
+ }
1598
+ function findParam(params, name) {
1599
+ const param = params.find((p) => p.name.toLowerCase() === name.toLowerCase());
1600
+ if (!param) return void 0;
1601
+ if (isUndefinedParam(param)) return void 0;
1602
+ return parseParamValue(param.value, param.valueType);
1603
+ }
1604
+ function buildPayloadFromExtractedParams(subtype, methodName, extractedParams) {
1605
+ switch (subtype) {
1606
+ // =========================================================================
1607
+ // PostgreSQL
1608
+ // =========================================================================
1609
+ case "postgresql": {
1610
+ const sql = findParam(extractedParams, "SQL");
1611
+ const params = findParam(extractedParams, "Params");
1612
+ const timeoutMs = findParam(extractedParams, "Timeout");
1613
+ return buildPostgresInvokePayload(sql, params, timeoutMs);
1614
+ }
1615
+ // =========================================================================
1616
+ // DynamoDB
1617
+ // =========================================================================
1618
+ case "dynamodb": {
1619
+ const command = findParam(extractedParams, "Command");
1620
+ const params = findParam(extractedParams, "Params");
1621
+ return buildDynamoDBInvokePayload(command, params);
1622
+ }
1623
+ // =========================================================================
1624
+ // CosmosDB
1625
+ // =========================================================================
1626
+ case "cosmosdb": {
1627
+ if (methodName === "invoke") {
1628
+ const payload2 = findParam(extractedParams, "Payload");
1629
+ return buildCosmosDBInvokePayload(payload2);
1630
+ }
1631
+ if (methodName === "query") {
1632
+ const container = findParam(extractedParams, "Container");
1633
+ const query = findParam(extractedParams, "Query");
1634
+ const options = findParam(extractedParams, "Options");
1635
+ return buildCosmosDBQueryPayload(container, query, options);
1636
+ }
1637
+ if (methodName === "read") {
1638
+ const container = findParam(extractedParams, "Container");
1639
+ const id = findParam(extractedParams, "Id");
1640
+ const options = findParam(extractedParams, "Options");
1641
+ return buildCosmosDBReadPayload(container, id, options);
1642
+ }
1643
+ if (methodName === "create") {
1644
+ const container = findParam(extractedParams, "Container");
1645
+ const body = findParam(extractedParams, "Body");
1646
+ const options = findParam(extractedParams, "Options");
1647
+ return buildCosmosDBCreatePayload(container, body, options);
1648
+ }
1649
+ if (methodName === "replace") {
1650
+ const container = findParam(extractedParams, "Container");
1651
+ const id = findParam(extractedParams, "Id");
1652
+ const body = findParam(extractedParams, "Body");
1653
+ const options = findParam(extractedParams, "Options");
1654
+ return buildCosmosDBReplacePayload(container, id, body, options);
1655
+ }
1656
+ if (methodName === "upsert") {
1657
+ const container = findParam(extractedParams, "Container");
1658
+ const body = findParam(extractedParams, "Body");
1659
+ const options = findParam(extractedParams, "Options");
1660
+ return buildCosmosDBUpsertPayload(container, body, options);
1661
+ }
1662
+ if (methodName === "delete") {
1663
+ const container = findParam(extractedParams, "Container");
1664
+ const id = findParam(extractedParams, "Id");
1665
+ const options = findParam(extractedParams, "Options");
1666
+ return buildCosmosDBDeletePayload(container, id, options);
1667
+ }
1668
+ if (methodName === "patch") {
1669
+ const container = findParam(extractedParams, "Container");
1670
+ const id = findParam(extractedParams, "Id");
1671
+ const patchOperations = findParam(extractedParams, "PatchOperations");
1672
+ const options = findParam(extractedParams, "Options");
1673
+ return buildCosmosDBPatchPayload(container, id, patchOperations, options);
1674
+ }
1675
+ const payload = findParam(extractedParams, "Payload");
1676
+ return buildCosmosDBInvokePayload(payload);
1677
+ }
1678
+ // =========================================================================
1679
+ // MSSQL
1680
+ // =========================================================================
1681
+ case "mssql": {
1682
+ const sql = findParam(extractedParams, "SQL");
1683
+ const params = findParam(extractedParams, "Params");
1684
+ const timeoutMs = findParam(extractedParams, "Timeout");
1685
+ return buildMssqlInvokePayload(sql, params, timeoutMs);
1686
+ }
1687
+ // =========================================================================
1688
+ // Snowflake
1689
+ // =========================================================================
1690
+ case "snowflake": {
1691
+ if (methodName === "invoke") {
1692
+ const payload2 = findParam(extractedParams, "Payload");
1693
+ return buildSnowflakeInvokePayload(payload2);
1694
+ }
1695
+ if (methodName === "execute") {
1696
+ const statement = findParam(extractedParams, "Statement");
1697
+ const options = findParam(extractedParams, "Options");
1698
+ return buildSnowflakeExecutePayload(statement, options);
1699
+ }
1700
+ if (methodName === "status") {
1701
+ const statementHandle = findParam(extractedParams, "StatementHandle");
1702
+ const options = findParam(extractedParams, "Options");
1703
+ return buildSnowflakeStatusPayload(statementHandle, options);
1704
+ }
1705
+ if (methodName === "cancel") {
1706
+ const statementHandle = findParam(extractedParams, "StatementHandle");
1707
+ return buildSnowflakeCancelPayload(statementHandle);
1708
+ }
1709
+ const payload = findParam(extractedParams, "Payload");
1710
+ return buildSnowflakeInvokePayload(payload);
1711
+ }
1712
+ // =========================================================================
1713
+ // S3
1714
+ // =========================================================================
1715
+ case "s3": {
1716
+ const command = findParam(extractedParams, "Command");
1717
+ const params = findParam(extractedParams, "Params");
1718
+ const options = findParam(extractedParams, "Options");
1719
+ return buildS3InvokePayload(command, params, options);
1720
+ }
1721
+ // =========================================================================
1722
+ // Lambda
1723
+ // =========================================================================
1724
+ case "lambda": {
1725
+ const functionName = findParam(extractedParams, "FunctionName");
1726
+ const payload = findParam(extractedParams, "Payload");
1727
+ const options = findParam(extractedParams, "Options");
1728
+ return buildLambdaInvokePayload(functionName, payload, options);
1729
+ }
1730
+ // =========================================================================
1731
+ // Google Sheets
1732
+ // =========================================================================
1733
+ case "googlesheets": {
1734
+ if (methodName === "getValues") {
1735
+ const range = findParam(extractedParams, "Range");
1736
+ return buildGoogleSheetsGetValuesPayload(range);
1737
+ }
1738
+ if (methodName === "updateValues") {
1739
+ const range = findParam(extractedParams, "Range");
1740
+ const values = findParam(extractedParams, "Values");
1741
+ const valueInputOption = findParam(extractedParams, "ValueInputOption") ?? "USER_ENTERED";
1742
+ return buildGoogleSheetsUpdateValuesPayload(range, values, valueInputOption);
1743
+ }
1744
+ if (methodName === "appendValues") {
1745
+ const range = findParam(extractedParams, "Range");
1746
+ const values = findParam(extractedParams, "Values");
1747
+ const valueInputOption = findParam(extractedParams, "ValueInputOption") ?? "USER_ENTERED";
1748
+ return buildGoogleSheetsAppendValuesPayload(range, values, valueInputOption);
1749
+ }
1750
+ if (methodName === "clearValues") {
1751
+ const range = findParam(extractedParams, "Range");
1752
+ return buildGoogleSheetsClearValuesPayload(range);
1753
+ }
1754
+ if (methodName === "batchGetValues") {
1755
+ const ranges = findParam(extractedParams, "Ranges");
1756
+ return buildGoogleSheetsBatchGetValuesPayload(ranges);
1757
+ }
1758
+ if (methodName === "batchUpdateValues") {
1759
+ const data = findParam(extractedParams, "Data");
1760
+ const valueInputOption = findParam(extractedParams, "ValueInputOption") ?? "USER_ENTERED";
1761
+ return buildGoogleSheetsBatchUpdateValuesPayload(data, valueInputOption);
1762
+ }
1763
+ if (methodName === "getSpreadsheet") {
1764
+ return buildGoogleSheetsGetSpreadsheetPayload();
1765
+ }
1766
+ if (methodName === "batchUpdate") {
1767
+ const requests = findParam(extractedParams, "Requests");
1768
+ return buildGoogleSheetsBatchUpdatePayload(requests);
1769
+ }
1770
+ const method = findParam(extractedParams, "Method");
1771
+ const path = findParam(extractedParams, "Path");
1772
+ const options = findParam(extractedParams, "Options");
1773
+ return buildGoogleSheetsInvokePayload(method, path, options);
1774
+ }
1775
+ // =========================================================================
1776
+ // HubSpot
1777
+ // =========================================================================
1778
+ case "hubspot": {
1779
+ const method = findParam(extractedParams, "Method");
1780
+ const path = findParam(extractedParams, "Path");
1781
+ const options = findParam(extractedParams, "Options");
1782
+ return buildHubSpotInvokePayload(method, path, options);
1783
+ }
1784
+ // =========================================================================
1785
+ // Salesforce
1786
+ // =========================================================================
1787
+ case "salesforce": {
1788
+ if (methodName === "query") {
1789
+ const query = findParam(extractedParams, "Query");
1790
+ return buildSalesforceQueryPayload(query);
1791
+ }
1792
+ if (methodName === "getRecord") {
1793
+ const objectType = findParam(extractedParams, "ObjectType");
1794
+ const recordId = findParam(extractedParams, "RecordId");
1795
+ return buildSalesforceGetRecordPayload(objectType, recordId);
1796
+ }
1797
+ if (methodName === "createRecord") {
1798
+ const objectType = findParam(extractedParams, "ObjectType");
1799
+ const data = findParam(extractedParams, "Data");
1800
+ return buildSalesforceCreateRecordPayload(objectType, data);
1801
+ }
1802
+ if (methodName === "updateRecord") {
1803
+ const objectType = findParam(extractedParams, "ObjectType");
1804
+ const recordId = findParam(extractedParams, "RecordId");
1805
+ const data = findParam(extractedParams, "Data");
1806
+ return buildSalesforceUpdateRecordPayload(objectType, recordId, data);
1807
+ }
1808
+ if (methodName === "deleteRecord") {
1809
+ const objectType = findParam(extractedParams, "ObjectType");
1810
+ const recordId = findParam(extractedParams, "RecordId");
1811
+ return buildSalesforceDeleteRecordPayload(objectType, recordId);
1812
+ }
1813
+ if (methodName === "describeObject") {
1814
+ const objectType = findParam(extractedParams, "ObjectType");
1815
+ return buildSalesforceDescribeObjectPayload(objectType);
1816
+ }
1817
+ const method = findParam(extractedParams, "Method");
1818
+ const path = findParam(extractedParams, "Path");
1819
+ const options = findParam(extractedParams, "Options");
1820
+ return buildSalesforceInvokePayload(method, path, options);
1821
+ }
1822
+ // =========================================================================
1823
+ // Custom API
1824
+ // =========================================================================
1825
+ case "custom": {
1826
+ const method = findParam(extractedParams, "Method");
1827
+ const path = findParam(extractedParams, "Path");
1828
+ const options = findParam(extractedParams, "Options");
1829
+ return buildCustomApiInvokePayload(method, path, options);
1830
+ }
1831
+ // =========================================================================
1832
+ // BigQuery
1833
+ // =========================================================================
1834
+ case "bigquery": {
1835
+ if (methodName === "query") {
1836
+ const sql = findParam(extractedParams, "SQL");
1837
+ const params = findParam(extractedParams, "Params");
1838
+ const options = findParam(extractedParams, "Options");
1839
+ return buildBigQueryQueryPayload(sql, params, options);
1840
+ }
1841
+ if (methodName === "listDatasets") {
1842
+ const options = findParam(extractedParams, "Options");
1843
+ return buildBigQueryListDatasetsPayload(options);
1844
+ }
1845
+ if (methodName === "listTables") {
1846
+ const datasetId = findParam(extractedParams, "DatasetId");
1847
+ const options = findParam(extractedParams, "Options");
1848
+ return buildBigQueryListTablesPayload(datasetId, options);
1849
+ }
1850
+ if (methodName === "getTable") {
1851
+ const datasetId = findParam(extractedParams, "DatasetId");
1852
+ const tableId = findParam(extractedParams, "TableId");
1853
+ return buildBigQueryGetTablePayload(datasetId, tableId);
1854
+ }
1855
+ if (methodName === "insertRows") {
1856
+ const datasetId = findParam(extractedParams, "DatasetId");
1857
+ const tableId = findParam(extractedParams, "TableId");
1858
+ const rows = findParam(extractedParams, "Rows");
1859
+ return buildBigQueryInsertRowsPayload(datasetId, tableId, rows);
1860
+ }
1861
+ if (methodName === "createTable") {
1862
+ const datasetId = findParam(extractedParams, "DatasetId");
1863
+ const tableId = findParam(extractedParams, "TableId");
1864
+ const schema = findParam(extractedParams, "Schema");
1865
+ const options = findParam(extractedParams, "Options");
1866
+ return buildBigQueryCreateTablePayload(datasetId, tableId, schema, options);
1867
+ }
1868
+ const payload = findParam(extractedParams, "Payload");
1869
+ return buildBigQueryInvokePayload(payload);
1870
+ }
1871
+ // =========================================================================
1872
+ // Outreach
1873
+ // =========================================================================
1874
+ case "outreach": {
1875
+ const method = findParam(extractedParams, "Method");
1876
+ const path = findParam(extractedParams, "Path");
1877
+ const options = findParam(extractedParams, "Options");
1878
+ return buildOutreachInvokePayload(method, path, options);
1879
+ }
1880
+ // =========================================================================
1881
+ // Neo4j
1882
+ // =========================================================================
1883
+ case "neo4j": {
1884
+ const cypher = findParam(extractedParams, "Cypher");
1885
+ const params = findParam(extractedParams, "Params");
1886
+ const timeoutMs = findParam(extractedParams, "Timeout");
1887
+ return buildNeo4jInvokePayload(cypher, params, timeoutMs);
1888
+ }
1889
+ // =========================================================================
1890
+ // Slack
1891
+ // =========================================================================
1892
+ case "slack": {
1893
+ if (methodName === "getUploadURL") {
1894
+ const filename = findParam(extractedParams, "Filename");
1895
+ const length = findParam(extractedParams, "Length");
1896
+ const options2 = findParam(extractedParams, "Options");
1897
+ return buildSlackGetUploadURLPayload(filename, length, options2);
1898
+ }
1899
+ if (methodName === "completeUpload") {
1900
+ const files = findParam(extractedParams, "Files");
1901
+ const channelId = findParam(extractedParams, "ChannelId");
1902
+ const options2 = findParam(extractedParams, "Options");
1903
+ return buildSlackCompleteUploadPayload(files, channelId, options2);
1904
+ }
1905
+ const method = findParam(extractedParams, "Method");
1906
+ const options = findParam(extractedParams, "Options");
1907
+ return buildSlackInvokePayload(method, options);
1908
+ }
1909
+ // =========================================================================
1910
+ // QuickBooks
1911
+ // =========================================================================
1912
+ case "quickbooks": {
1913
+ if (methodName === "query") {
1914
+ const query = findParam(extractedParams, "Query");
1915
+ return buildQuickBooksQueryPayload(query);
1916
+ }
1917
+ const method = findParam(extractedParams, "Method");
1918
+ const path = findParam(extractedParams, "Path");
1919
+ const options = findParam(extractedParams, "Options");
1920
+ return buildQuickBooksInvokePayload(method, path, options);
1921
+ }
1922
+ // =========================================================================
1923
+ // Major Auth
1924
+ // =========================================================================
1925
+ case "majorauth": {
1926
+ const email = findParam(extractedParams, "Email");
1927
+ if (methodName === "revokeAccess") {
1928
+ return buildAuthRevokeAccessPayload(email);
1929
+ }
1930
+ return buildAuthShareAccessPayload(email);
1931
+ }
1932
+ // =========================================================================
1933
+ // Google Analytics
1934
+ // =========================================================================
1935
+ case "googleanalytics": {
1936
+ if (methodName === "runReport") {
1937
+ const dimensions = findParam(extractedParams, "Dimensions");
1938
+ const metrics = findParam(extractedParams, "Metrics");
1939
+ const dateRanges = findParam(extractedParams, "DateRanges");
1940
+ const options = findParam(extractedParams, "Options");
1941
+ return buildGoogleAnalyticsRunReportPayload(
1942
+ dimensions ?? [],
1943
+ metrics ?? [],
1944
+ dateRanges ?? [],
1945
+ options
1946
+ );
1947
+ }
1948
+ if (methodName === "getMetadata") {
1949
+ return buildGoogleAnalyticsGetMetadataPayload();
1950
+ }
1951
+ if (methodName === "listAccounts") {
1952
+ const options = findParam(extractedParams, "Options");
1953
+ return buildGoogleAnalyticsListAccountsPayload(options);
1954
+ }
1955
+ if (methodName === "listProperties") {
1956
+ const accountId = findParam(extractedParams, "AccountId");
1957
+ const options = findParam(extractedParams, "Options");
1958
+ return buildGoogleAnalyticsListPropertiesPayload(accountId, options);
1959
+ }
1960
+ const payload = findParam(extractedParams, "Payload");
1961
+ return buildGoogleAnalyticsInvokePayload(payload);
1962
+ }
1963
+ // =========================================================================
1964
+ // GraphQL
1965
+ // =========================================================================
1966
+ case "graphql": {
1967
+ const query = findParam(extractedParams, "Query");
1968
+ const options = findParam(extractedParams, "Options");
1969
+ return buildGraphQLInvokePayload(query, options);
1970
+ }
1971
+ default:
1972
+ throw new Error(`Unsupported resource subtype: ${subtype}`);
1973
+ }
1974
+ }
68
1975
  //# sourceMappingURL=index.cjs.map