@major-tech/resource-client 0.2.46 → 0.2.48
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/bin/generate-clients.mjs +6 -3
- package/dist/clients/dynamics.d.ts +117 -0
- package/dist/clients/dynamics.d.ts.map +1 -0
- package/dist/clients/linear.d.ts +10 -0
- package/dist/clients/linear.d.ts.map +1 -0
- package/dist/clients/ringcentral.d.ts +111 -0
- package/dist/clients/ringcentral.d.ts.map +1 -0
- package/dist/index.cjs +405 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +405 -0
- package/dist/index.js.map +3 -3
- package/dist/payload-builders/dynamics.d.ts +51 -0
- package/dist/payload-builders/dynamics.d.ts.map +1 -0
- package/dist/payload-builders/from-extracted-params.d.ts.map +1 -1
- package/dist/payload-builders/index.d.ts +3 -0
- package/dist/payload-builders/index.d.ts.map +1 -1
- package/dist/payload-builders/linear.d.ts +7 -0
- package/dist/payload-builders/linear.d.ts.map +1 -0
- package/dist/payload-builders/ringcentral.d.ts +63 -0
- package/dist/payload-builders/ringcentral.d.ts.map +1 -0
- package/dist/schemas/api-dynamics.d.ts +28 -0
- package/dist/schemas/api-dynamics.d.ts.map +1 -0
- package/dist/schemas/api-linear.d.ts +9 -0
- package/dist/schemas/api-linear.d.ts.map +1 -0
- package/dist/schemas/api-ringcentral.d.ts +20 -0
- package/dist/schemas/api-ringcentral.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +7 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/response.d.ts +12 -0
- package/dist/schemas/response.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ export { MajorAuthResourceClient } from "./clients/auth";
|
|
|
21
21
|
export { GoogleAnalyticsResourceClient } from "./clients/google-analytics";
|
|
22
22
|
export { GraphQLResourceClient } from "./clients/api-graphql";
|
|
23
23
|
export { GongResourceClient } from "./clients/gong";
|
|
24
|
+
export { DynamicsResourceClient } from "./clients/dynamics";
|
|
25
|
+
export { LinearResourceClient } from "./clients/linear";
|
|
26
|
+
export { RingCentralResourceClient } from "./clients/ringcentral";
|
|
24
27
|
export * from "./payload-builders";
|
|
25
|
-
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, OutreachInvokeResponse, Neo4jInvokeResponse, SlackInvokeResponse, QuickBooksInvokeResponse, AuthInvokeResponse, GoogleAnalyticsInvokeResponse, GraphQLInvokeResponse, GongInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
28
|
+
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, OutreachInvokeResponse, Neo4jInvokeResponse, SlackInvokeResponse, QuickBooksInvokeResponse, AuthInvokeResponse, GoogleAnalyticsInvokeResponse, GraphQLInvokeResponse, GongInvokeResponse, DynamicsInvokeResponse, LinearInvokeResponse, RingCentralInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
26
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,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AsB,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,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1478,6 +1478,329 @@ var GongResourceClient = class extends BaseResourceClient {
|
|
|
1478
1478
|
}
|
|
1479
1479
|
};
|
|
1480
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
|
+
|
|
1608
|
+
// src/payload-builders/linear.ts
|
|
1609
|
+
function buildLinearGraphQLPayload(query, options) {
|
|
1610
|
+
return {
|
|
1611
|
+
type: "api",
|
|
1612
|
+
subtype: "linear",
|
|
1613
|
+
query,
|
|
1614
|
+
variables: options?.variables,
|
|
1615
|
+
operationName: options?.operationName,
|
|
1616
|
+
timeoutMs: options?.timeoutMs ?? 3e4
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
// src/clients/linear.ts
|
|
1621
|
+
var LinearResourceClient = class extends BaseResourceClient {
|
|
1622
|
+
async graphql(query, invocationKey, options = {}) {
|
|
1623
|
+
const payload = buildLinearGraphQLPayload(query, options);
|
|
1624
|
+
return this.invokeRaw(payload, invocationKey);
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
// src/payload-builders/ringcentral.ts
|
|
1629
|
+
function buildRingCentralInvokePayload(method, path, options) {
|
|
1630
|
+
return {
|
|
1631
|
+
type: "api",
|
|
1632
|
+
subtype: "ringcentral",
|
|
1633
|
+
method,
|
|
1634
|
+
path,
|
|
1635
|
+
query: options?.query,
|
|
1636
|
+
body: options?.body,
|
|
1637
|
+
timeoutMs: options?.timeoutMs ?? 3e4
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
function buildRingCentralListCallLogPayload(options) {
|
|
1641
|
+
const query = {};
|
|
1642
|
+
if (options?.dateFrom) query.dateFrom = options.dateFrom;
|
|
1643
|
+
if (options?.dateTo) query.dateTo = options.dateTo;
|
|
1644
|
+
if (options?.direction) query.direction = options.direction;
|
|
1645
|
+
if (options?.type) query.type = options.type;
|
|
1646
|
+
if (options?.perPage !== void 0) query.perPage = String(options.perPage);
|
|
1647
|
+
if (options?.page !== void 0) query.page = String(options.page);
|
|
1648
|
+
return buildRingCentralInvokePayload("GET", "/v1.0/account/~/call-log", {
|
|
1649
|
+
query: Object.keys(query).length > 0 ? query : void 0
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
function buildRingCentralGetCallRecordPayload(callRecordId) {
|
|
1653
|
+
return buildRingCentralInvokePayload("GET", `/v1.0/account/~/call-log/${callRecordId}`);
|
|
1654
|
+
}
|
|
1655
|
+
function buildRingCentralSendSmsPayload(from, to, text) {
|
|
1656
|
+
return buildRingCentralInvokePayload("POST", "/v1.0/account/~/extension/~/sms", {
|
|
1657
|
+
body: {
|
|
1658
|
+
type: "json",
|
|
1659
|
+
value: {
|
|
1660
|
+
from: { phoneNumber: from },
|
|
1661
|
+
to: [{ phoneNumber: to }],
|
|
1662
|
+
text
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
function buildRingCentralListMessagesPayload(options) {
|
|
1668
|
+
const query = {};
|
|
1669
|
+
if (options?.messageType) query.messageType = options.messageType;
|
|
1670
|
+
if (options?.dateFrom) query.dateFrom = options.dateFrom;
|
|
1671
|
+
if (options?.dateTo) query.dateTo = options.dateTo;
|
|
1672
|
+
if (options?.perPage !== void 0) query.perPage = String(options.perPage);
|
|
1673
|
+
if (options?.page !== void 0) query.page = String(options.page);
|
|
1674
|
+
return buildRingCentralInvokePayload("GET", "/v1.0/account/~/extension/~/message-store", {
|
|
1675
|
+
query: Object.keys(query).length > 0 ? query : void 0
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
function buildRingCentralListExtensionsPayload(options) {
|
|
1679
|
+
const query = {};
|
|
1680
|
+
if (options?.type) query.type = options.type;
|
|
1681
|
+
if (options?.status) query.status = options.status;
|
|
1682
|
+
if (options?.perPage !== void 0) query.perPage = String(options.perPage);
|
|
1683
|
+
if (options?.page !== void 0) query.page = String(options.page);
|
|
1684
|
+
return buildRingCentralInvokePayload("GET", "/v1.0/account/~/extension", {
|
|
1685
|
+
query: Object.keys(query).length > 0 ? query : void 0
|
|
1686
|
+
});
|
|
1687
|
+
}
|
|
1688
|
+
function buildRingCentralGetExtensionPayload(extensionId) {
|
|
1689
|
+
return buildRingCentralInvokePayload("GET", `/v1.0/account/~/extension/${extensionId}`);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
// src/clients/ringcentral.ts
|
|
1693
|
+
var RingCentralResourceClient = class extends BaseResourceClient {
|
|
1694
|
+
/**
|
|
1695
|
+
* Invoke a RingCentral API request
|
|
1696
|
+
*
|
|
1697
|
+
* @param method - HTTP method (GET, POST, PUT, PATCH, DELETE)
|
|
1698
|
+
* @param path - RingCentral API path (e.g., "/v1.0/account/~/call-log")
|
|
1699
|
+
* @param invocationKey - Unique key for this invocation (for tracking)
|
|
1700
|
+
* @param options - Optional query params, body, and timeout
|
|
1701
|
+
* @returns The API response with status and body
|
|
1702
|
+
*/
|
|
1703
|
+
async invoke(method, path, invocationKey, options = {}) {
|
|
1704
|
+
const payload = buildRingCentralInvokePayload(method, path, options);
|
|
1705
|
+
return this.invokeRaw(payload, invocationKey);
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* List call log entries
|
|
1709
|
+
*
|
|
1710
|
+
* @param invocationKey - Unique key for this invocation
|
|
1711
|
+
* @param options - Optional filters (dateFrom, dateTo, direction, type, perPage, page)
|
|
1712
|
+
* @returns Call log records
|
|
1713
|
+
*/
|
|
1714
|
+
async listCallLog(invocationKey, options) {
|
|
1715
|
+
const query = {};
|
|
1716
|
+
if (options?.dateFrom) query.dateFrom = options.dateFrom;
|
|
1717
|
+
if (options?.dateTo) query.dateTo = options.dateTo;
|
|
1718
|
+
if (options?.direction) query.direction = options.direction;
|
|
1719
|
+
if (options?.type) query.type = options.type;
|
|
1720
|
+
if (options?.perPage !== void 0) query.perPage = String(options.perPage);
|
|
1721
|
+
if (options?.page !== void 0) query.page = String(options.page);
|
|
1722
|
+
return this.invoke("GET", "/v1.0/account/~/call-log", invocationKey, {
|
|
1723
|
+
query: Object.keys(query).length > 0 ? query : void 0
|
|
1724
|
+
});
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Get a specific call record by ID
|
|
1728
|
+
*
|
|
1729
|
+
* @param callRecordId - The call record ID
|
|
1730
|
+
* @param invocationKey - Unique key for this invocation
|
|
1731
|
+
* @returns The call record details
|
|
1732
|
+
*/
|
|
1733
|
+
async getCallRecord(callRecordId, invocationKey) {
|
|
1734
|
+
return this.invoke("GET", `/v1.0/account/~/call-log/${callRecordId}`, invocationKey);
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Send an SMS message
|
|
1738
|
+
*
|
|
1739
|
+
* @param from - Sender phone number
|
|
1740
|
+
* @param to - Recipient phone number
|
|
1741
|
+
* @param text - Message text
|
|
1742
|
+
* @param invocationKey - Unique key for this invocation
|
|
1743
|
+
* @returns The sent message details
|
|
1744
|
+
*/
|
|
1745
|
+
async sendSms(from, to, text, invocationKey) {
|
|
1746
|
+
return this.invoke("POST", "/v1.0/account/~/extension/~/sms", invocationKey, {
|
|
1747
|
+
body: {
|
|
1748
|
+
type: "json",
|
|
1749
|
+
value: {
|
|
1750
|
+
from: { phoneNumber: from },
|
|
1751
|
+
to: [{ phoneNumber: to }],
|
|
1752
|
+
text
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* List messages from the message store
|
|
1759
|
+
*
|
|
1760
|
+
* @param invocationKey - Unique key for this invocation
|
|
1761
|
+
* @param options - Optional filters (messageType, dateFrom, dateTo, perPage, page)
|
|
1762
|
+
* @returns Message records
|
|
1763
|
+
*/
|
|
1764
|
+
async listMessages(invocationKey, options) {
|
|
1765
|
+
const query = {};
|
|
1766
|
+
if (options?.messageType) query.messageType = options.messageType;
|
|
1767
|
+
if (options?.dateFrom) query.dateFrom = options.dateFrom;
|
|
1768
|
+
if (options?.dateTo) query.dateTo = options.dateTo;
|
|
1769
|
+
if (options?.perPage !== void 0) query.perPage = String(options.perPage);
|
|
1770
|
+
if (options?.page !== void 0) query.page = String(options.page);
|
|
1771
|
+
return this.invoke("GET", "/v1.0/account/~/extension/~/message-store", invocationKey, {
|
|
1772
|
+
query: Object.keys(query).length > 0 ? query : void 0
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* List extensions on the account
|
|
1777
|
+
*
|
|
1778
|
+
* @param invocationKey - Unique key for this invocation
|
|
1779
|
+
* @param options - Optional filters (type, status, perPage, page)
|
|
1780
|
+
* @returns Extension records
|
|
1781
|
+
*/
|
|
1782
|
+
async listExtensions(invocationKey, options) {
|
|
1783
|
+
const query = {};
|
|
1784
|
+
if (options?.type) query.type = options.type;
|
|
1785
|
+
if (options?.status) query.status = options.status;
|
|
1786
|
+
if (options?.perPage !== void 0) query.perPage = String(options.perPage);
|
|
1787
|
+
if (options?.page !== void 0) query.page = String(options.page);
|
|
1788
|
+
return this.invoke("GET", "/v1.0/account/~/extension", invocationKey, {
|
|
1789
|
+
query: Object.keys(query).length > 0 ? query : void 0
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Get a specific extension by ID
|
|
1794
|
+
*
|
|
1795
|
+
* @param extensionId - The extension ID
|
|
1796
|
+
* @param invocationKey - Unique key for this invocation
|
|
1797
|
+
* @returns The extension details
|
|
1798
|
+
*/
|
|
1799
|
+
async getExtension(extensionId, invocationKey) {
|
|
1800
|
+
return this.invoke("GET", `/v1.0/account/~/extension/${extensionId}`, invocationKey);
|
|
1801
|
+
}
|
|
1802
|
+
};
|
|
1803
|
+
|
|
1481
1804
|
// src/payload-builders/outreach.ts
|
|
1482
1805
|
function buildOutreachInvokePayload(method, path, options) {
|
|
1483
1806
|
return {
|
|
@@ -1894,6 +2217,73 @@ function buildPayloadFromExtractedParams(subtype, methodName, extractedParams) {
|
|
|
1894
2217
|
const options = findParam(extractedParams, "Options");
|
|
1895
2218
|
return buildGraphQLInvokePayload(query, options);
|
|
1896
2219
|
}
|
|
2220
|
+
// =========================================================================
|
|
2221
|
+
// Dynamics 365 (Dataverse Web API)
|
|
2222
|
+
// =========================================================================
|
|
2223
|
+
case "dynamics": {
|
|
2224
|
+
if (methodName === "listEntities") {
|
|
2225
|
+
const options2 = findParam(extractedParams, "Options");
|
|
2226
|
+
return buildDynamicsListEntitiesPayload(options2);
|
|
2227
|
+
}
|
|
2228
|
+
if (methodName === "getRecords") {
|
|
2229
|
+
const entitySet = findParam(extractedParams, "EntitySet");
|
|
2230
|
+
const options2 = findParam(extractedParams, "Options");
|
|
2231
|
+
return buildDynamicsGetRecordsPayload(entitySet, options2);
|
|
2232
|
+
}
|
|
2233
|
+
if (methodName === "getRecord") {
|
|
2234
|
+
const entitySet = findParam(extractedParams, "EntitySet");
|
|
2235
|
+
const recordId = findParam(extractedParams, "RecordID");
|
|
2236
|
+
const options2 = findParam(extractedParams, "Options");
|
|
2237
|
+
return buildDynamicsGetRecordPayload(entitySet, recordId, options2);
|
|
2238
|
+
}
|
|
2239
|
+
const method = findParam(extractedParams, "Method");
|
|
2240
|
+
const path = findParam(extractedParams, "Path");
|
|
2241
|
+
const options = findParam(extractedParams, "Options");
|
|
2242
|
+
return buildDynamicsInvokePayload(method, path, options);
|
|
2243
|
+
}
|
|
2244
|
+
// =========================================================================
|
|
2245
|
+
// Linear
|
|
2246
|
+
// =========================================================================
|
|
2247
|
+
case "linear": {
|
|
2248
|
+
const query = findParam(extractedParams, "Query");
|
|
2249
|
+
const options = findParam(extractedParams, "Options");
|
|
2250
|
+
return buildLinearGraphQLPayload(query, options);
|
|
2251
|
+
}
|
|
2252
|
+
// =========================================================================
|
|
2253
|
+
// RingCentral
|
|
2254
|
+
// =========================================================================
|
|
2255
|
+
case "ringcentral": {
|
|
2256
|
+
if (methodName === "listCallLog") {
|
|
2257
|
+
const options2 = findParam(extractedParams, "Options");
|
|
2258
|
+
return buildRingCentralListCallLogPayload(options2);
|
|
2259
|
+
}
|
|
2260
|
+
if (methodName === "getCallRecord") {
|
|
2261
|
+
const callRecordId = findParam(extractedParams, "CallRecordId");
|
|
2262
|
+
return buildRingCentralGetCallRecordPayload(callRecordId);
|
|
2263
|
+
}
|
|
2264
|
+
if (methodName === "sendSms") {
|
|
2265
|
+
const from = findParam(extractedParams, "From");
|
|
2266
|
+
const to = findParam(extractedParams, "To");
|
|
2267
|
+
const text = findParam(extractedParams, "Text");
|
|
2268
|
+
return buildRingCentralSendSmsPayload(from, to, text);
|
|
2269
|
+
}
|
|
2270
|
+
if (methodName === "listMessages") {
|
|
2271
|
+
const options2 = findParam(extractedParams, "Options");
|
|
2272
|
+
return buildRingCentralListMessagesPayload(options2);
|
|
2273
|
+
}
|
|
2274
|
+
if (methodName === "listExtensions") {
|
|
2275
|
+
const options2 = findParam(extractedParams, "Options");
|
|
2276
|
+
return buildRingCentralListExtensionsPayload(options2);
|
|
2277
|
+
}
|
|
2278
|
+
if (methodName === "getExtension") {
|
|
2279
|
+
const extensionId = findParam(extractedParams, "ExtensionId");
|
|
2280
|
+
return buildRingCentralGetExtensionPayload(extensionId);
|
|
2281
|
+
}
|
|
2282
|
+
const method = findParam(extractedParams, "Method");
|
|
2283
|
+
const path = findParam(extractedParams, "Path");
|
|
2284
|
+
const options = findParam(extractedParams, "Options");
|
|
2285
|
+
return buildRingCentralInvokePayload(method, path, options);
|
|
2286
|
+
}
|
|
1897
2287
|
default:
|
|
1898
2288
|
throw new Error(`Unsupported resource subtype: ${subtype}`);
|
|
1899
2289
|
}
|
|
@@ -1903,6 +2293,7 @@ export {
|
|
|
1903
2293
|
BigQueryResourceClient,
|
|
1904
2294
|
CosmosDBResourceClient,
|
|
1905
2295
|
CustomApiResourceClient,
|
|
2296
|
+
DynamicsResourceClient,
|
|
1906
2297
|
DynamoDBResourceClient,
|
|
1907
2298
|
GongResourceClient,
|
|
1908
2299
|
GoogleAnalyticsResourceClient,
|
|
@@ -1910,6 +2301,7 @@ export {
|
|
|
1910
2301
|
GraphQLResourceClient,
|
|
1911
2302
|
HubSpotResourceClient,
|
|
1912
2303
|
LambdaResourceClient,
|
|
2304
|
+
LinearResourceClient,
|
|
1913
2305
|
MajorAuthResourceClient,
|
|
1914
2306
|
MssqlResourceClient,
|
|
1915
2307
|
Neo4jResourceClient,
|
|
@@ -1917,6 +2309,7 @@ export {
|
|
|
1917
2309
|
PostgresResourceClient,
|
|
1918
2310
|
QuickBooksResourceClient,
|
|
1919
2311
|
ResourceInvokeError,
|
|
2312
|
+
RingCentralResourceClient,
|
|
1920
2313
|
S3ResourceClient,
|
|
1921
2314
|
SalesforceResourceClient,
|
|
1922
2315
|
SlackResourceClient,
|
|
@@ -1939,6 +2332,10 @@ export {
|
|
|
1939
2332
|
buildCosmosDBReplacePayload,
|
|
1940
2333
|
buildCosmosDBUpsertPayload,
|
|
1941
2334
|
buildCustomApiInvokePayload,
|
|
2335
|
+
buildDynamicsGetRecordPayload,
|
|
2336
|
+
buildDynamicsGetRecordsPayload,
|
|
2337
|
+
buildDynamicsInvokePayload,
|
|
2338
|
+
buildDynamicsListEntitiesPayload,
|
|
1942
2339
|
buildDynamoDBInvokePayload,
|
|
1943
2340
|
buildGongInvokePayload,
|
|
1944
2341
|
buildGoogleAnalyticsGetMetadataPayload,
|
|
@@ -1960,6 +2357,7 @@ export {
|
|
|
1960
2357
|
buildGraphQLInvokePayload,
|
|
1961
2358
|
buildHubSpotInvokePayload,
|
|
1962
2359
|
buildLambdaInvokePayload,
|
|
2360
|
+
buildLinearGraphQLPayload,
|
|
1963
2361
|
buildMssqlInvokePayload,
|
|
1964
2362
|
buildNeo4jInvokePayload,
|
|
1965
2363
|
buildOutreachInvokePayload,
|
|
@@ -1967,6 +2365,13 @@ export {
|
|
|
1967
2365
|
buildPostgresInvokePayload,
|
|
1968
2366
|
buildQuickBooksInvokePayload,
|
|
1969
2367
|
buildQuickBooksQueryPayload,
|
|
2368
|
+
buildRingCentralGetCallRecordPayload,
|
|
2369
|
+
buildRingCentralGetExtensionPayload,
|
|
2370
|
+
buildRingCentralInvokePayload,
|
|
2371
|
+
buildRingCentralListCallLogPayload,
|
|
2372
|
+
buildRingCentralListExtensionsPayload,
|
|
2373
|
+
buildRingCentralListMessagesPayload,
|
|
2374
|
+
buildRingCentralSendSmsPayload,
|
|
1970
2375
|
buildS3InvokePayload,
|
|
1971
2376
|
buildSalesforceCreateRecordPayload,
|
|
1972
2377
|
buildSalesforceDeleteRecordPayload,
|