@major-tech/resource-client 0.2.44 → 0.2.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -20,6 +20,8 @@ export { QuickBooksResourceClient } from "./clients/quickbooks";
20
20
  export { MajorAuthResourceClient } from "./clients/auth";
21
21
  export { GoogleAnalyticsResourceClient } from "./clients/google-analytics";
22
22
  export { GraphQLResourceClient } from "./clients/api-graphql";
23
+ export { GongResourceClient } from "./clients/gong";
24
+ export { DynamicsResourceClient } from "./clients/dynamics";
23
25
  export * from "./payload-builders";
24
- export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, OutreachInvokeResponse, Neo4jInvokeResponse, SlackInvokeResponse, QuickBooksInvokeResponse, AuthInvokeResponse, GoogleAnalyticsInvokeResponse, GraphQLInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
26
+ export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, OutreachInvokeResponse, Neo4jInvokeResponse, SlackInvokeResponse, QuickBooksInvokeResponse, AuthInvokeResponse, GoogleAnalyticsInvokeResponse, GraphQLInvokeResponse, GongInvokeResponse, DynamicsInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
25
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,sBAAs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;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,cAAc,oBAAoB,CAAC;AAGnC,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1457,6 +1457,154 @@ var GraphQLResourceClient = class extends BaseResourceClient {
1457
1457
  }
1458
1458
  };
1459
1459
 
1460
+ // src/payload-builders/gong.ts
1461
+ function buildGongInvokePayload(method, path, options) {
1462
+ return {
1463
+ type: "api",
1464
+ subtype: "gong",
1465
+ method,
1466
+ path,
1467
+ query: options?.query,
1468
+ body: options?.body,
1469
+ timeoutMs: options?.timeoutMs ?? 3e4
1470
+ };
1471
+ }
1472
+
1473
+ // src/clients/gong.ts
1474
+ var GongResourceClient = class extends BaseResourceClient {
1475
+ async invoke(method, path, invocationKey, options = {}) {
1476
+ const payload = buildGongInvokePayload(method, path, options);
1477
+ return this.invokeRaw(payload, invocationKey);
1478
+ }
1479
+ };
1480
+
1481
+ // src/payload-builders/dynamics.ts
1482
+ function buildDynamicsInvokePayload(method, path, options) {
1483
+ return {
1484
+ type: "api",
1485
+ subtype: "dynamics",
1486
+ method,
1487
+ path,
1488
+ query: options?.query,
1489
+ body: options?.body,
1490
+ timeoutMs: options?.timeoutMs ?? 3e4
1491
+ };
1492
+ }
1493
+ function buildDynamicsListEntitiesPayload(options) {
1494
+ return buildDynamicsInvokePayload("GET", "EntityDefinitions", {
1495
+ query: { "$select": ["LogicalName,DisplayName,EntitySetName"] },
1496
+ timeoutMs: options?.timeoutMs
1497
+ });
1498
+ }
1499
+ function buildDynamicsGetRecordsPayload(entitySet, options) {
1500
+ const query = {};
1501
+ if (options?.select) {
1502
+ query["$select"] = [options.select];
1503
+ }
1504
+ if (options?.filter) {
1505
+ query["$filter"] = [options.filter];
1506
+ }
1507
+ if (options?.orderBy) {
1508
+ query["$orderby"] = [options.orderBy];
1509
+ }
1510
+ if (options?.top !== void 0) {
1511
+ query["$top"] = [String(options.top)];
1512
+ }
1513
+ if (options?.expand) {
1514
+ query["$expand"] = [options.expand];
1515
+ }
1516
+ return buildDynamicsInvokePayload("GET", entitySet, {
1517
+ query: Object.keys(query).length > 0 ? query : void 0,
1518
+ timeoutMs: options?.timeoutMs
1519
+ });
1520
+ }
1521
+ function buildDynamicsGetRecordPayload(entitySet, recordId, options) {
1522
+ const query = {};
1523
+ if (options?.select) {
1524
+ query["$select"] = [options.select];
1525
+ }
1526
+ if (options?.expand) {
1527
+ query["$expand"] = [options.expand];
1528
+ }
1529
+ return buildDynamicsInvokePayload("GET", `${entitySet}(${recordId})`, {
1530
+ query: Object.keys(query).length > 0 ? query : void 0,
1531
+ timeoutMs: options?.timeoutMs
1532
+ });
1533
+ }
1534
+
1535
+ // src/clients/dynamics.ts
1536
+ var DynamicsResourceClient = class extends BaseResourceClient {
1537
+ /**
1538
+ * List available entity definitions from the Dataverse metadata endpoint.
1539
+ *
1540
+ * @param invocationKey - Unique key for this invocation (for tracking)
1541
+ * @param options - Optional timeout
1542
+ * @returns Entity definitions including LogicalName, DisplayName, EntitySetName
1543
+ */
1544
+ async listEntities(invocationKey, options = {}) {
1545
+ const payload = buildDynamicsListEntitiesPayload(options);
1546
+ return this.invokeRaw(payload, invocationKey);
1547
+ }
1548
+ /**
1549
+ * Get multiple records from an entity set with optional OData query options.
1550
+ *
1551
+ * @param entitySet - Entity set name (e.g. "accounts", "contacts", "opportunities")
1552
+ * @param invocationKey - Unique key for this invocation (for tracking)
1553
+ * @param options - OData query options and timeout
1554
+ * @returns The records matching the query
1555
+ *
1556
+ * @example
1557
+ * ```typescript
1558
+ * const result = await client.getRecords("accounts", "list-accounts", {
1559
+ * select: "name,revenue,createdon",
1560
+ * filter: "statecode eq 0",
1561
+ * orderBy: "name asc",
1562
+ * top: 100,
1563
+ * });
1564
+ * ```
1565
+ */
1566
+ async getRecords(entitySet, invocationKey, options = {}) {
1567
+ const payload = buildDynamicsGetRecordsPayload(entitySet, options);
1568
+ return this.invokeRaw(payload, invocationKey);
1569
+ }
1570
+ /**
1571
+ * Get a single record by its GUID.
1572
+ *
1573
+ * @param entitySet - Entity set name (e.g. "accounts", "contacts")
1574
+ * @param recordId - The GUID of the record
1575
+ * @param invocationKey - Unique key for this invocation (for tracking)
1576
+ * @param options - Optional select/expand fields and timeout
1577
+ * @returns The record data
1578
+ *
1579
+ * @example
1580
+ * ```typescript
1581
+ * const result = await client.getRecord(
1582
+ * "contacts",
1583
+ * "00000000-0000-0000-0000-000000000001",
1584
+ * "get-contact",
1585
+ * { select: "firstname,lastname,emailaddress1" }
1586
+ * );
1587
+ * ```
1588
+ */
1589
+ async getRecord(entitySet, recordId, invocationKey, options = {}) {
1590
+ const payload = buildDynamicsGetRecordPayload(entitySet, recordId, options);
1591
+ return this.invokeRaw(payload, invocationKey);
1592
+ }
1593
+ /**
1594
+ * Generic passthrough for any Dataverse Web API request.
1595
+ *
1596
+ * @param method - HTTP method (GET, POST, PATCH, DELETE)
1597
+ * @param path - Dataverse API path (e.g. "accounts", "contacts(guid)")
1598
+ * @param invocationKey - Unique key for this invocation (for tracking)
1599
+ * @param options - Optional query params, body, and timeout
1600
+ * @returns The API response with status and body
1601
+ */
1602
+ async invoke(method, path, invocationKey, options = {}) {
1603
+ const payload = buildDynamicsInvokePayload(method, path, options);
1604
+ return this.invokeRaw(payload, invocationKey);
1605
+ }
1606
+ };
1607
+
1460
1608
  // src/payload-builders/outreach.ts
1461
1609
  function buildOutreachInvokePayload(method, path, options) {
1462
1610
  return {
@@ -1678,6 +1826,15 @@ function buildPayloadFromExtractedParams(subtype, methodName, extractedParams) {
1678
1826
  return buildHubSpotInvokePayload(method, path, options);
1679
1827
  }
1680
1828
  // =========================================================================
1829
+ // Gong
1830
+ // =========================================================================
1831
+ case "gong": {
1832
+ const method = findParam(extractedParams, "Method");
1833
+ const path = findParam(extractedParams, "Path");
1834
+ const options = findParam(extractedParams, "Options");
1835
+ return buildGongInvokePayload(method, path, options);
1836
+ }
1837
+ // =========================================================================
1681
1838
  // Salesforce
1682
1839
  // =========================================================================
1683
1840
  case "salesforce": {
@@ -1864,6 +2021,30 @@ function buildPayloadFromExtractedParams(subtype, methodName, extractedParams) {
1864
2021
  const options = findParam(extractedParams, "Options");
1865
2022
  return buildGraphQLInvokePayload(query, options);
1866
2023
  }
2024
+ // =========================================================================
2025
+ // Dynamics 365 (Dataverse Web API)
2026
+ // =========================================================================
2027
+ case "dynamics": {
2028
+ if (methodName === "listEntities") {
2029
+ const options2 = findParam(extractedParams, "Options");
2030
+ return buildDynamicsListEntitiesPayload(options2);
2031
+ }
2032
+ if (methodName === "getRecords") {
2033
+ const entitySet = findParam(extractedParams, "EntitySet");
2034
+ const options2 = findParam(extractedParams, "Options");
2035
+ return buildDynamicsGetRecordsPayload(entitySet, options2);
2036
+ }
2037
+ if (methodName === "getRecord") {
2038
+ const entitySet = findParam(extractedParams, "EntitySet");
2039
+ const recordId = findParam(extractedParams, "RecordID");
2040
+ const options2 = findParam(extractedParams, "Options");
2041
+ return buildDynamicsGetRecordPayload(entitySet, recordId, options2);
2042
+ }
2043
+ const method = findParam(extractedParams, "Method");
2044
+ const path = findParam(extractedParams, "Path");
2045
+ const options = findParam(extractedParams, "Options");
2046
+ return buildDynamicsInvokePayload(method, path, options);
2047
+ }
1867
2048
  default:
1868
2049
  throw new Error(`Unsupported resource subtype: ${subtype}`);
1869
2050
  }
@@ -1873,7 +2054,9 @@ export {
1873
2054
  BigQueryResourceClient,
1874
2055
  CosmosDBResourceClient,
1875
2056
  CustomApiResourceClient,
2057
+ DynamicsResourceClient,
1876
2058
  DynamoDBResourceClient,
2059
+ GongResourceClient,
1877
2060
  GoogleAnalyticsResourceClient,
1878
2061
  GoogleSheetsResourceClient,
1879
2062
  GraphQLResourceClient,
@@ -1908,7 +2091,12 @@ export {
1908
2091
  buildCosmosDBReplacePayload,
1909
2092
  buildCosmosDBUpsertPayload,
1910
2093
  buildCustomApiInvokePayload,
2094
+ buildDynamicsGetRecordPayload,
2095
+ buildDynamicsGetRecordsPayload,
2096
+ buildDynamicsInvokePayload,
2097
+ buildDynamicsListEntitiesPayload,
1911
2098
  buildDynamoDBInvokePayload,
2099
+ buildGongInvokePayload,
1912
2100
  buildGoogleAnalyticsGetMetadataPayload,
1913
2101
  buildGoogleAnalyticsInvokePayload,
1914
2102
  buildGoogleAnalyticsListAccountsPayload,