@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.
@@ -10,7 +10,7 @@
10
10
  * npx @major-tech/resource-client list
11
11
  *
12
12
  * Modes: app (default) | tool
13
- * Types: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | graphql | lambda | salesforce | s3 | slack | majorauth | googleanalytics | quickbooks | gong
13
+ * Types: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | graphql | lambda | salesforce | s3 | slack | majorauth | googleanalytics | quickbooks | gong | dynamics | linear | ringcentral
14
14
  *
15
15
  * Examples:
16
16
  * npx @major-tech/resource-client add "abc-123" "orders-db" "postgresql" "Orders database" "app-123"
@@ -207,6 +207,9 @@ function getClientClass(type) {
207
207
  'graphql': 'GraphQLResourceClient',
208
208
  'quickbooks': 'QuickBooksResourceClient',
209
209
  'gong': 'GongResourceClient',
210
+ 'dynamics': 'DynamicsResourceClient',
211
+ 'linear': 'LinearResourceClient',
212
+ 'ringcentral': 'RingCentralResourceClient',
210
213
  };
211
214
  return typeMap[type] || 'PostgresResourceClient';
212
215
  }
@@ -265,7 +268,7 @@ function generateIndexFile(resources) {
265
268
  }
266
269
 
267
270
  function addResource(resourceId, name, type, description, applicationId, framework, mode) {
268
- const validTypes = ['postgresql', 'mssql', 'dynamodb', 'cosmosdb', 'snowflake', 'bigquery', 'neo4j', 'hubspot', 'googlesheets', 'outreach', 'custom', 'graphql', 'lambda', 'salesforce', 's3', 'slack', 'majorauth', 'googleanalytics', 'quickbooks', 'gong'];
271
+ const validTypes = ['postgresql', 'mssql', 'dynamodb', 'cosmosdb', 'snowflake', 'bigquery', 'neo4j', 'hubspot', 'googlesheets', 'outreach', 'custom', 'graphql', 'lambda', 'salesforce', 's3', 'slack', 'majorauth', 'googleanalytics', 'quickbooks', 'gong', 'dynamics', 'linear', 'ringcentral'];
269
272
  if (!validTypes.includes(type)) {
270
273
  console.error(`❌ Invalid type: ${type}`);
271
274
  console.error(` Valid types: ${validTypes.join(', ')}`);
@@ -420,7 +423,7 @@ function main() {
420
423
  console.log('\nModes: app (default) | tool');
421
424
  console.log(' app — requires <application_id>, reads MAJOR_API_BASE_URL');
422
425
  console.log(' tool — embeds toolId from tool.json at generation time, reads RESOURCE_API_URL');
423
- console.log('\nTypes: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | graphql | lambda | salesforce | s3 | slack | majorauth | googleanalytics | quickbooks | gong');
426
+ console.log('\nTypes: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | graphql | lambda | salesforce | s3 | slack | majorauth | googleanalytics | quickbooks | gong | dynamics | linear | ringcentral');
424
427
  return;
425
428
  }
426
429
 
@@ -0,0 +1,117 @@
1
+ import type { HttpMethod, QueryParams, DynamicsInvokeResponse } from "../schemas";
2
+ import { BaseResourceClient } from "../base";
3
+ /**
4
+ * Client for interacting with Microsoft Dynamics 365 (Dataverse Web API) resources.
5
+ *
6
+ * This client provides convenience methods for common Dataverse operations.
7
+ * Authentication (OAuth) is handled automatically.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // List all entity definitions
12
+ * const entities = await client.listEntities("list-entities");
13
+ *
14
+ * // Get account records with OData options
15
+ * const accounts = await client.getRecords("accounts", "get-accounts", {
16
+ * select: "name,revenue",
17
+ * filter: "revenue gt 1000000",
18
+ * top: 50,
19
+ * });
20
+ *
21
+ * // Get a single contact by GUID
22
+ * const contact = await client.getRecord(
23
+ * "contacts",
24
+ * "00000000-0000-0000-0000-000000000001",
25
+ * "get-contact",
26
+ * { select: "firstname,lastname,emailaddress1" }
27
+ * );
28
+ *
29
+ * // Generic passthrough for any Dataverse endpoint
30
+ * const result = await client.invoke(
31
+ * "POST",
32
+ * "accounts",
33
+ * "create-account",
34
+ * { body: { type: "json", value: { name: "Acme Corp" } } }
35
+ * );
36
+ * ```
37
+ */
38
+ export declare class DynamicsResourceClient extends BaseResourceClient {
39
+ /**
40
+ * List available entity definitions from the Dataverse metadata endpoint.
41
+ *
42
+ * @param invocationKey - Unique key for this invocation (for tracking)
43
+ * @param options - Optional timeout
44
+ * @returns Entity definitions including LogicalName, DisplayName, EntitySetName
45
+ */
46
+ listEntities(invocationKey: string, options?: {
47
+ timeoutMs?: number;
48
+ }): Promise<DynamicsInvokeResponse>;
49
+ /**
50
+ * Get multiple records from an entity set with optional OData query options.
51
+ *
52
+ * @param entitySet - Entity set name (e.g. "accounts", "contacts", "opportunities")
53
+ * @param invocationKey - Unique key for this invocation (for tracking)
54
+ * @param options - OData query options and timeout
55
+ * @returns The records matching the query
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const result = await client.getRecords("accounts", "list-accounts", {
60
+ * select: "name,revenue,createdon",
61
+ * filter: "statecode eq 0",
62
+ * orderBy: "name asc",
63
+ * top: 100,
64
+ * });
65
+ * ```
66
+ */
67
+ getRecords(entitySet: string, invocationKey: string, options?: {
68
+ select?: string;
69
+ filter?: string;
70
+ orderBy?: string;
71
+ top?: number;
72
+ expand?: string;
73
+ timeoutMs?: number;
74
+ }): Promise<DynamicsInvokeResponse>;
75
+ /**
76
+ * Get a single record by its GUID.
77
+ *
78
+ * @param entitySet - Entity set name (e.g. "accounts", "contacts")
79
+ * @param recordId - The GUID of the record
80
+ * @param invocationKey - Unique key for this invocation (for tracking)
81
+ * @param options - Optional select/expand fields and timeout
82
+ * @returns The record data
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const result = await client.getRecord(
87
+ * "contacts",
88
+ * "00000000-0000-0000-0000-000000000001",
89
+ * "get-contact",
90
+ * { select: "firstname,lastname,emailaddress1" }
91
+ * );
92
+ * ```
93
+ */
94
+ getRecord(entitySet: string, recordId: string, invocationKey: string, options?: {
95
+ select?: string;
96
+ expand?: string;
97
+ timeoutMs?: number;
98
+ }): Promise<DynamicsInvokeResponse>;
99
+ /**
100
+ * Generic passthrough for any Dataverse Web API request.
101
+ *
102
+ * @param method - HTTP method (GET, POST, PATCH, DELETE)
103
+ * @param path - Dataverse API path (e.g. "accounts", "contacts(guid)")
104
+ * @param invocationKey - Unique key for this invocation (for tracking)
105
+ * @param options - Optional query params, body, and timeout
106
+ * @returns The API response with status and body
107
+ */
108
+ invoke(method: HttpMethod, path: string, invocationKey: string, options?: {
109
+ query?: QueryParams;
110
+ body?: {
111
+ type: "json";
112
+ value: unknown;
113
+ };
114
+ timeoutMs?: number;
115
+ }): Promise<DynamicsInvokeResponse>;
116
+ }
117
+ //# sourceMappingURL=dynamics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamics.d.ts","sourceRoot":"","sources":["../../src/clients/dynamics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQ7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;;;OAMG;IACG,YAAY,CAChB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GACnC,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;;;;;;;;;;;;;OAiBG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GACL,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;;;;;;;;;;;;;;OAkBG;IACG,SAAS,CACb,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GACL,OAAO,CAAC,sBAAsB,CAAC;IAKlC;;;;;;;;OAQG;IACG,MAAM,CACV,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;QACP,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,IAAI,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAE,CAAC;QACxC,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GACL,OAAO,CAAC,sBAAsB,CAAC;CAInC"}
@@ -0,0 +1,10 @@
1
+ import type { ApiInvokeResponse } from "../schemas";
2
+ import { BaseResourceClient } from "../base";
3
+ export declare class LinearResourceClient extends BaseResourceClient {
4
+ graphql(query: string, invocationKey: string, options?: {
5
+ variables?: Record<string, unknown>;
6
+ operationName?: string;
7
+ timeoutMs?: number;
8
+ }): Promise<ApiInvokeResponse>;
9
+ }
10
+ //# sourceMappingURL=linear.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../src/clients/linear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C,qBAAa,oBAAqB,SAAQ,kBAAkB;IACpD,OAAO,CACX,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GACL,OAAO,CAAC,iBAAiB,CAAC;CAI9B"}
@@ -0,0 +1,111 @@
1
+ import type { HttpMethod, QueryParams, RingCentralInvokeResponse } from "../schemas";
2
+ import { BaseResourceClient } from "../base";
3
+ /**
4
+ * Client for interacting with RingCentral API resources.
5
+ *
6
+ * This client provides a simple interface for making authenticated requests
7
+ * to the RingCentral REST API. Authentication is handled automatically.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // List recent call log entries
12
+ * const calls = await client.listCallLog("list-calls", {
13
+ * dateFrom: "2024-01-01T00:00:00Z",
14
+ * perPage: 25,
15
+ * });
16
+ *
17
+ * // Send an SMS
18
+ * const sms = await client.sendSms("+15551234567", "+15559876543", "Hello!", "send-sms");
19
+ *
20
+ * // Generic API call
21
+ * const result = await client.invoke("GET", "/v1.0/account/~/extension", "list-ext");
22
+ * ```
23
+ */
24
+ export declare class RingCentralResourceClient extends BaseResourceClient {
25
+ /**
26
+ * Invoke a RingCentral API request
27
+ *
28
+ * @param method - HTTP method (GET, POST, PUT, PATCH, DELETE)
29
+ * @param path - RingCentral API path (e.g., "/v1.0/account/~/call-log")
30
+ * @param invocationKey - Unique key for this invocation (for tracking)
31
+ * @param options - Optional query params, body, and timeout
32
+ * @returns The API response with status and body
33
+ */
34
+ invoke(method: HttpMethod, path: string, invocationKey: string, options?: {
35
+ query?: QueryParams;
36
+ body?: {
37
+ type: "json";
38
+ value: unknown;
39
+ };
40
+ timeoutMs?: number;
41
+ }): Promise<RingCentralInvokeResponse>;
42
+ /**
43
+ * List call log entries
44
+ *
45
+ * @param invocationKey - Unique key for this invocation
46
+ * @param options - Optional filters (dateFrom, dateTo, direction, type, perPage, page)
47
+ * @returns Call log records
48
+ */
49
+ listCallLog(invocationKey: string, options?: {
50
+ dateFrom?: string;
51
+ dateTo?: string;
52
+ direction?: string;
53
+ type?: string;
54
+ perPage?: number;
55
+ page?: number;
56
+ }): Promise<RingCentralInvokeResponse>;
57
+ /**
58
+ * Get a specific call record by ID
59
+ *
60
+ * @param callRecordId - The call record ID
61
+ * @param invocationKey - Unique key for this invocation
62
+ * @returns The call record details
63
+ */
64
+ getCallRecord(callRecordId: string, invocationKey: string): Promise<RingCentralInvokeResponse>;
65
+ /**
66
+ * Send an SMS message
67
+ *
68
+ * @param from - Sender phone number
69
+ * @param to - Recipient phone number
70
+ * @param text - Message text
71
+ * @param invocationKey - Unique key for this invocation
72
+ * @returns The sent message details
73
+ */
74
+ sendSms(from: string, to: string, text: string, invocationKey: string): Promise<RingCentralInvokeResponse>;
75
+ /**
76
+ * List messages from the message store
77
+ *
78
+ * @param invocationKey - Unique key for this invocation
79
+ * @param options - Optional filters (messageType, dateFrom, dateTo, perPage, page)
80
+ * @returns Message records
81
+ */
82
+ listMessages(invocationKey: string, options?: {
83
+ messageType?: string;
84
+ dateFrom?: string;
85
+ dateTo?: string;
86
+ perPage?: number;
87
+ page?: number;
88
+ }): Promise<RingCentralInvokeResponse>;
89
+ /**
90
+ * List extensions on the account
91
+ *
92
+ * @param invocationKey - Unique key for this invocation
93
+ * @param options - Optional filters (type, status, perPage, page)
94
+ * @returns Extension records
95
+ */
96
+ listExtensions(invocationKey: string, options?: {
97
+ type?: string;
98
+ status?: string;
99
+ perPage?: number;
100
+ page?: number;
101
+ }): Promise<RingCentralInvokeResponse>;
102
+ /**
103
+ * Get a specific extension by ID
104
+ *
105
+ * @param extensionId - The extension ID
106
+ * @param invocationKey - Unique key for this invocation
107
+ * @returns The extension details
108
+ */
109
+ getExtension(extensionId: string, invocationKey: string): Promise<RingCentralInvokeResponse>;
110
+ }
111
+ //# sourceMappingURL=ringcentral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ringcentral.d.ts","sourceRoot":"","sources":["../../src/clients/ringcentral.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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