@major-tech/resource-client 0.2.42 → 0.2.46

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