@major-tech/resource-client 0.2.29 → 0.2.33
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 +5 -3
- package/dist/clients/api-graphql.cjs +40 -0
- package/dist/clients/api-graphql.cjs.map +7 -0
- package/dist/clients/api-graphql.d.ts +15 -0
- package/dist/clients/api-graphql.d.ts.map +1 -0
- package/dist/clients/api-graphql.js +13 -0
- package/dist/clients/api-graphql.js.map +1 -0
- package/dist/clients/google-analytics.cjs +101 -0
- package/dist/clients/google-analytics.cjs.map +7 -0
- package/dist/clients/google-analytics.d.ts +62 -0
- package/dist/clients/google-analytics.d.ts.map +1 -0
- package/dist/clients/google-analytics.js +74 -0
- package/dist/clients/google-analytics.js.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/payload-builders/from-extracted-params.cjs +36 -0
- package/dist/payload-builders/from-extracted-params.cjs.map +2 -2
- package/dist/payload-builders/from-extracted-params.d.ts.map +1 -1
- package/dist/payload-builders/from-extracted-params.js +37 -0
- package/dist/payload-builders/from-extracted-params.js.map +1 -1
- package/dist/payload-builders/google-analytics.cjs +106 -0
- package/dist/payload-builders/google-analytics.cjs.map +7 -0
- package/dist/payload-builders/google-analytics.d.ts +39 -0
- package/dist/payload-builders/google-analytics.d.ts.map +1 -0
- package/dist/payload-builders/google-analytics.js +90 -0
- package/dist/payload-builders/google-analytics.js.map +1 -0
- package/dist/payload-builders/graphql.cjs +36 -0
- package/dist/payload-builders/graphql.cjs.map +7 -0
- package/dist/payload-builders/graphql.d.ts +12 -0
- package/dist/payload-builders/graphql.d.ts.map +1 -0
- package/dist/payload-builders/graphql.js +16 -0
- package/dist/payload-builders/graphql.js.map +1 -0
- package/dist/payload-builders/index.cjs +10 -0
- package/dist/payload-builders/index.cjs.map +2 -2
- package/dist/payload-builders/index.d.ts +2 -0
- package/dist/payload-builders/index.d.ts.map +1 -1
- package/dist/payload-builders/index.js +4 -0
- package/dist/payload-builders/index.js.map +1 -1
- package/dist/schemas/api-graphql.cjs +17 -0
- package/dist/schemas/api-graphql.cjs.map +7 -0
- package/dist/schemas/api-graphql.d.ts +16 -0
- package/dist/schemas/api-graphql.d.ts.map +1 -0
- package/dist/schemas/api-graphql.js +2 -0
- package/dist/schemas/api-graphql.js.map +1 -0
- package/dist/schemas/google-analytics.cjs +17 -0
- package/dist/schemas/google-analytics.cjs.map +7 -0
- package/dist/schemas/google-analytics.d.ts +133 -0
- package/dist/schemas/google-analytics.d.ts.map +1 -0
- package/dist/schemas/google-analytics.js +2 -0
- package/dist/schemas/google-analytics.js.map +1 -0
- package/dist/schemas/index.cjs +2 -0
- package/dist/schemas/index.cjs.map +2 -2
- package/dist/schemas/index.d.ts +5 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/response.d.ts +10 -1
- package/dist/schemas/response.d.ts.map +1 -1
- package/package.json +1 -1
package/bin/generate-clients.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* npx @major-tech/resource-client remove <name>
|
|
9
9
|
* npx @major-tech/resource-client list
|
|
10
10
|
*
|
|
11
|
-
* Types: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | lambda | salesforce | s3 | slack | majorauth
|
|
11
|
+
* Types: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | graphql | lambda | salesforce | s3 | slack | majorauth | googleanalytics
|
|
12
12
|
*
|
|
13
13
|
* Examples:
|
|
14
14
|
* npx @major-tech/resource-client add "abc-123" "orders-db" "postgresql" "Orders database" "app-123"
|
|
@@ -156,6 +156,8 @@ function getClientClass(type) {
|
|
|
156
156
|
's3': 'S3ResourceClient',
|
|
157
157
|
'slack': 'SlackResourceClient',
|
|
158
158
|
'majorauth': 'MajorAuthResourceClient',
|
|
159
|
+
'googleanalytics': 'GoogleAnalyticsResourceClient',
|
|
160
|
+
'graphql': 'GraphQLResourceClient',
|
|
159
161
|
};
|
|
160
162
|
return typeMap[type] || 'PostgresResourceClient';
|
|
161
163
|
}
|
|
@@ -189,7 +191,7 @@ function generateIndexFile(resources) {
|
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
function addResource(resourceId, name, type, description, applicationId, framework) {
|
|
192
|
-
const validTypes = ['postgresql', 'mssql', 'dynamodb', 'cosmosdb', 'snowflake', 'bigquery', 'neo4j', 'hubspot', 'googlesheets', 'outreach', 'custom', 'lambda', 'salesforce', 's3', 'slack', 'majorauth'];
|
|
194
|
+
const validTypes = ['postgresql', 'mssql', 'dynamodb', 'cosmosdb', 'snowflake', 'bigquery', 'neo4j', 'hubspot', 'googlesheets', 'outreach', 'custom', 'graphql', 'lambda', 'salesforce', 's3', 'slack', 'majorauth', 'googleanalytics'];
|
|
193
195
|
if (!validTypes.includes(type)) {
|
|
194
196
|
console.error(`❌ Invalid type: ${type}`);
|
|
195
197
|
console.error(` Valid types: ${validTypes.join(', ')}`);
|
|
@@ -326,7 +328,7 @@ function main() {
|
|
|
326
328
|
console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
|
|
327
329
|
console.log(' npx @major-tech/resource-client remove <name> [--framework <nextjs|vite>]');
|
|
328
330
|
console.log(' npx @major-tech/resource-client list');
|
|
329
|
-
console.log('\nTypes: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | lambda | salesforce | s3 | slack | majorauth');
|
|
331
|
+
console.log('\nTypes: postgresql | mssql | dynamodb | cosmosdb | snowflake | bigquery | neo4j | hubspot | googlesheets | outreach | custom | graphql | lambda | salesforce | s3 | slack | majorauth | googleanalytics');
|
|
330
332
|
return;
|
|
331
333
|
}
|
|
332
334
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var api_graphql_exports = {};
|
|
21
|
+
__export(api_graphql_exports, {
|
|
22
|
+
GraphQLResourceClient: () => GraphQLResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(api_graphql_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
var import_graphql = require("../payload-builders/graphql");
|
|
27
|
+
class GraphQLResourceClient extends import_base.BaseResourceClient {
|
|
28
|
+
static {
|
|
29
|
+
__name(this, "GraphQLResourceClient");
|
|
30
|
+
}
|
|
31
|
+
async query(query, invocationKey, options = {}) {
|
|
32
|
+
const payload = (0, import_graphql.buildGraphQLInvokePayload)(query, options);
|
|
33
|
+
return this.invokeRaw(payload, invocationKey);
|
|
34
|
+
}
|
|
35
|
+
async mutate(mutation, invocationKey, options = {}) {
|
|
36
|
+
const payload = (0, import_graphql.buildGraphQLInvokePayload)(mutation, options);
|
|
37
|
+
return this.invokeRaw(payload, invocationKey);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=api-graphql.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clients/api-graphql.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ApiInvokeResponse } from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\nimport { buildGraphQLInvokePayload } from \"../payload-builders/graphql\";\n\nexport class GraphQLResourceClient extends BaseResourceClient {\n async query(\n query: string,\n invocationKey: string,\n options: {\n variables?: Record<string, unknown>;\n operationName?: string;\n timeoutMs?: number;\n } = {}\n ): Promise<ApiInvokeResponse> {\n const payload = buildGraphQLInvokePayload(query, options);\n return this.invokeRaw(payload, invocationKey) as Promise<ApiInvokeResponse>;\n }\n\n async mutate(\n mutation: string,\n invocationKey: string,\n options: {\n variables?: Record<string, unknown>;\n operationName?: string;\n timeoutMs?: number;\n } = {}\n ): Promise<ApiInvokeResponse> {\n const payload = buildGraphQLInvokePayload(mutation, options);\n return this.invokeRaw(payload, invocationKey) as Promise<ApiInvokeResponse>;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;AAAA,kBAAmC;AACnC,qBAA0C;AAEpC,MAAO,8BAA8B,+BAAkB;EAH7D,OAG6D;;;EAC3D,MAAM,MACJ,OACA,eACA,UAII,CAAA,GAAE;AAEN,UAAM,cAAU,0CAA0B,OAAO,OAAO;AACxD,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;EAEA,MAAM,OACJ,UACA,eACA,UAII,CAAA,GAAE;AAEN,UAAM,cAAU,0CAA0B,UAAU,OAAO;AAC3D,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ApiInvokeResponse } from "../schemas";
|
|
2
|
+
import { BaseResourceClient } from "../base";
|
|
3
|
+
export declare class GraphQLResourceClient extends BaseResourceClient {
|
|
4
|
+
query(query: string, invocationKey: string, options?: {
|
|
5
|
+
variables?: Record<string, unknown>;
|
|
6
|
+
operationName?: string;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
}): Promise<ApiInvokeResponse>;
|
|
9
|
+
mutate(mutation: string, invocationKey: string, options?: {
|
|
10
|
+
variables?: Record<string, unknown>;
|
|
11
|
+
operationName?: string;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
}): Promise<ApiInvokeResponse>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=api-graphql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-graphql.d.ts","sourceRoot":"","sources":["../../src/clients/api-graphql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C,qBAAa,qBAAsB,SAAQ,kBAAkB;IACrD,KAAK,CACT,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;IAKvB,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,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,13 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
import { buildGraphQLInvokePayload } from "../payload-builders/graphql";
|
|
3
|
+
export class GraphQLResourceClient extends BaseResourceClient {
|
|
4
|
+
async query(query, invocationKey, options = {}) {
|
|
5
|
+
const payload = buildGraphQLInvokePayload(query, options);
|
|
6
|
+
return this.invokeRaw(payload, invocationKey);
|
|
7
|
+
}
|
|
8
|
+
async mutate(mutation, invocationKey, options = {}) {
|
|
9
|
+
const payload = buildGraphQLInvokePayload(mutation, options);
|
|
10
|
+
return this.invokeRaw(payload, invocationKey);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=api-graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-graphql.js","sourceRoot":"","sources":["../../src/clients/api-graphql.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,OAAO,qBAAsB,SAAQ,kBAAkB;IAC3D,KAAK,CAAC,KAAK,CACT,KAAa,EACb,aAAqB,EACrB,UAII,EAAE;QAEN,MAAM,OAAO,GAAG,yBAAyB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAA+B,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,MAAM,CACV,QAAgB,EAChB,aAAqB,EACrB,UAII,EAAE;QAEN,MAAM,OAAO,GAAG,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAA+B,CAAC;IAC9E,CAAC;CACF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var google_analytics_exports = {};
|
|
21
|
+
__export(google_analytics_exports, {
|
|
22
|
+
GoogleAnalyticsResourceClient: () => GoogleAnalyticsResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(google_analytics_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
var import_google_analytics = require("../payload-builders/google-analytics");
|
|
27
|
+
class GoogleAnalyticsResourceClient extends import_base.BaseResourceClient {
|
|
28
|
+
static {
|
|
29
|
+
__name(this, "GoogleAnalyticsResourceClient");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Run a GA4 report with dimensions, metrics, and date ranges
|
|
33
|
+
* @param dimensions Dimensions to group by (e.g. [{name: 'country'}])
|
|
34
|
+
* @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
|
|
35
|
+
* @param dateRanges Date ranges (e.g. [{startDate: '2024-01-01', endDate: '2024-01-31'}])
|
|
36
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
37
|
+
* @param options Optional report options (filters, ordering, limit, offset)
|
|
38
|
+
*/
|
|
39
|
+
async runReport(dimensions, metrics, dateRanges, invocationKey, options) {
|
|
40
|
+
const payload = (0, import_google_analytics.buildGoogleAnalyticsRunReportPayload)(dimensions, metrics, dateRanges, options);
|
|
41
|
+
return this.invokeRaw(payload, invocationKey);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get available dimensions and metrics for the GA4 property
|
|
45
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
46
|
+
*/
|
|
47
|
+
async getMetadata(invocationKey) {
|
|
48
|
+
const payload = (0, import_google_analytics.buildGoogleAnalyticsGetMetadataPayload)();
|
|
49
|
+
return this.invokeRaw(payload, invocationKey);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Run a realtime report showing current live user activity
|
|
53
|
+
* @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
|
|
54
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
55
|
+
* @param dimensions Optional dimensions to group by
|
|
56
|
+
* @param limit Optional row limit
|
|
57
|
+
*/
|
|
58
|
+
async runRealtimeReport(metrics, invocationKey, dimensions, limit) {
|
|
59
|
+
const payload = (0, import_google_analytics.buildGoogleAnalyticsRunRealtimeReportPayload)(metrics, dimensions, limit);
|
|
60
|
+
return this.invokeRaw(payload, invocationKey);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* List all GA4 accounts accessible to the authenticated user
|
|
64
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
65
|
+
* @param options Optional pagination options
|
|
66
|
+
*/
|
|
67
|
+
async listAccounts(invocationKey, options) {
|
|
68
|
+
const payload = (0, import_google_analytics.buildGoogleAnalyticsListAccountsPayload)(options);
|
|
69
|
+
return this.invokeRaw(payload, invocationKey);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* List GA4 properties, optionally filtered by account
|
|
73
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
74
|
+
* @param accountId Optional account filter (e.g. 'accounts/12345')
|
|
75
|
+
* @param options Optional pagination options
|
|
76
|
+
*/
|
|
77
|
+
async listProperties(invocationKey, accountId, options) {
|
|
78
|
+
const payload = (0, import_google_analytics.buildGoogleAnalyticsListPropertiesPayload)(accountId, options);
|
|
79
|
+
return this.invokeRaw(payload, invocationKey);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* List data streams for a GA4 property
|
|
83
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
84
|
+
* @param propertyId Optional property ID (defaults to configured property)
|
|
85
|
+
* @param options Optional pagination options
|
|
86
|
+
*/
|
|
87
|
+
async listDataStreams(invocationKey, propertyId, options) {
|
|
88
|
+
const payload = (0, import_google_analytics.buildGoogleAnalyticsListDataStreamsPayload)(propertyId, options);
|
|
89
|
+
return this.invokeRaw(payload, invocationKey);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Execute a raw Google Analytics operation
|
|
93
|
+
* @param payload The raw operation payload
|
|
94
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
95
|
+
*/
|
|
96
|
+
async invoke(payload, invocationKey) {
|
|
97
|
+
const p = (0, import_google_analytics.buildGoogleAnalyticsInvokePayload)(payload);
|
|
98
|
+
return this.invokeRaw(p, invocationKey);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=google-analytics.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clients/google-analytics.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n GADimension,\n GAMetric,\n GADateRange,\n GARunReportOptions,\n GoogleAnalyticsInvokeResponse,\n} from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\nimport {\n buildGoogleAnalyticsRunReportPayload,\n buildGoogleAnalyticsGetMetadataPayload,\n buildGoogleAnalyticsRunRealtimeReportPayload,\n buildGoogleAnalyticsListAccountsPayload,\n buildGoogleAnalyticsListPropertiesPayload,\n buildGoogleAnalyticsListDataStreamsPayload,\n buildGoogleAnalyticsInvokePayload,\n} from \"../payload-builders/google-analytics\";\n\nexport class GoogleAnalyticsResourceClient extends BaseResourceClient {\n /**\n * Run a GA4 report with dimensions, metrics, and date ranges\n * @param dimensions Dimensions to group by (e.g. [{name: 'country'}])\n * @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])\n * @param dateRanges Date ranges (e.g. [{startDate: '2024-01-01', endDate: '2024-01-31'}])\n * @param invocationKey Unique key for tracking this invocation\n * @param options Optional report options (filters, ordering, limit, offset)\n */\n async runReport(\n dimensions: GADimension[],\n metrics: GAMetric[],\n dateRanges: GADateRange[],\n invocationKey: string,\n options?: GARunReportOptions\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const payload = buildGoogleAnalyticsRunReportPayload(dimensions, metrics, dateRanges, options);\n return this.invokeRaw(payload, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n\n /**\n * Get available dimensions and metrics for the GA4 property\n * @param invocationKey Unique key for tracking this invocation\n */\n async getMetadata(\n invocationKey: string\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const payload = buildGoogleAnalyticsGetMetadataPayload();\n return this.invokeRaw(payload, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n\n /**\n * Run a realtime report showing current live user activity\n * @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])\n * @param invocationKey Unique key for tracking this invocation\n * @param dimensions Optional dimensions to group by\n * @param limit Optional row limit\n */\n async runRealtimeReport(\n metrics: GAMetric[],\n invocationKey: string,\n dimensions?: GADimension[],\n limit?: number\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const payload = buildGoogleAnalyticsRunRealtimeReportPayload(metrics, dimensions, limit);\n return this.invokeRaw(payload, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n\n /**\n * List all GA4 accounts accessible to the authenticated user\n * @param invocationKey Unique key for tracking this invocation\n * @param options Optional pagination options\n */\n async listAccounts(\n invocationKey: string,\n options?: { pageSize?: number; pageToken?: string }\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const payload = buildGoogleAnalyticsListAccountsPayload(options);\n return this.invokeRaw(payload, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n\n /**\n * List GA4 properties, optionally filtered by account\n * @param invocationKey Unique key for tracking this invocation\n * @param accountId Optional account filter (e.g. 'accounts/12345')\n * @param options Optional pagination options\n */\n async listProperties(\n invocationKey: string,\n accountId?: string,\n options?: { pageSize?: number; pageToken?: string }\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const payload = buildGoogleAnalyticsListPropertiesPayload(accountId, options);\n return this.invokeRaw(payload, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n\n /**\n * List data streams for a GA4 property\n * @param invocationKey Unique key for tracking this invocation\n * @param propertyId Optional property ID (defaults to configured property)\n * @param options Optional pagination options\n */\n async listDataStreams(\n invocationKey: string,\n propertyId?: string,\n options?: { pageSize?: number; pageToken?: string }\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const payload = buildGoogleAnalyticsListDataStreamsPayload(propertyId, options);\n return this.invokeRaw(payload, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n\n /**\n * Execute a raw Google Analytics operation\n * @param payload The raw operation payload\n * @param invocationKey Unique key for tracking this invocation\n */\n async invoke(\n payload: Record<string, unknown>,\n invocationKey: string\n ): Promise<GoogleAnalyticsInvokeResponse> {\n const p = buildGoogleAnalyticsInvokePayload(payload);\n return this.invokeRaw(p, invocationKey) as Promise<GoogleAnalyticsInvokeResponse>;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAOA;;;;;AAAA,kBAAmC;AACnC,8BAQO;AAED,MAAO,sCAAsC,+BAAkB;EAXrE,OAWqE;;;;;;;;;;;EASnE,MAAM,UACJ,YACA,SACA,YACA,eACA,SAA4B;AAE5B,UAAM,cAAU,8DAAqC,YAAY,SAAS,YAAY,OAAO;AAC7F,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;EAMA,MAAM,YACJ,eAAqB;AAErB,UAAM,cAAU,gEAAsC;AACtD,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;;EASA,MAAM,kBACJ,SACA,eACA,YACA,OAAc;AAEd,UAAM,cAAU,sEAA6C,SAAS,YAAY,KAAK;AACvF,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;EAOA,MAAM,aACJ,eACA,SAAmD;AAEnD,UAAM,cAAU,iEAAwC,OAAO;AAC/D,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;EAQA,MAAM,eACJ,eACA,WACA,SAAmD;AAEnD,UAAM,cAAU,mEAA0C,WAAW,OAAO;AAC5E,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;;EAQA,MAAM,gBACJ,eACA,YACA,SAAmD;AAEnD,UAAM,cAAU,oEAA2C,YAAY,OAAO;AAC9E,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;EAOA,MAAM,OACJ,SACA,eAAqB;AAErB,UAAM,QAAI,2DAAkC,OAAO;AACnD,WAAO,KAAK,UAAU,GAAG,aAAa;EACxC;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { GADimension, GAMetric, GADateRange, GARunReportOptions, GoogleAnalyticsInvokeResponse } from "../schemas";
|
|
2
|
+
import { BaseResourceClient } from "../base";
|
|
3
|
+
export declare class GoogleAnalyticsResourceClient extends BaseResourceClient {
|
|
4
|
+
/**
|
|
5
|
+
* Run a GA4 report with dimensions, metrics, and date ranges
|
|
6
|
+
* @param dimensions Dimensions to group by (e.g. [{name: 'country'}])
|
|
7
|
+
* @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
|
|
8
|
+
* @param dateRanges Date ranges (e.g. [{startDate: '2024-01-01', endDate: '2024-01-31'}])
|
|
9
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
10
|
+
* @param options Optional report options (filters, ordering, limit, offset)
|
|
11
|
+
*/
|
|
12
|
+
runReport(dimensions: GADimension[], metrics: GAMetric[], dateRanges: GADateRange[], invocationKey: string, options?: GARunReportOptions): Promise<GoogleAnalyticsInvokeResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get available dimensions and metrics for the GA4 property
|
|
15
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
16
|
+
*/
|
|
17
|
+
getMetadata(invocationKey: string): Promise<GoogleAnalyticsInvokeResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Run a realtime report showing current live user activity
|
|
20
|
+
* @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
|
|
21
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
22
|
+
* @param dimensions Optional dimensions to group by
|
|
23
|
+
* @param limit Optional row limit
|
|
24
|
+
*/
|
|
25
|
+
runRealtimeReport(metrics: GAMetric[], invocationKey: string, dimensions?: GADimension[], limit?: number): Promise<GoogleAnalyticsInvokeResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* List all GA4 accounts accessible to the authenticated user
|
|
28
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
29
|
+
* @param options Optional pagination options
|
|
30
|
+
*/
|
|
31
|
+
listAccounts(invocationKey: string, options?: {
|
|
32
|
+
pageSize?: number;
|
|
33
|
+
pageToken?: string;
|
|
34
|
+
}): Promise<GoogleAnalyticsInvokeResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* List GA4 properties, optionally filtered by account
|
|
37
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
38
|
+
* @param accountId Optional account filter (e.g. 'accounts/12345')
|
|
39
|
+
* @param options Optional pagination options
|
|
40
|
+
*/
|
|
41
|
+
listProperties(invocationKey: string, accountId?: string, options?: {
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
pageToken?: string;
|
|
44
|
+
}): Promise<GoogleAnalyticsInvokeResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* List data streams for a GA4 property
|
|
47
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
48
|
+
* @param propertyId Optional property ID (defaults to configured property)
|
|
49
|
+
* @param options Optional pagination options
|
|
50
|
+
*/
|
|
51
|
+
listDataStreams(invocationKey: string, propertyId?: string, options?: {
|
|
52
|
+
pageSize?: number;
|
|
53
|
+
pageToken?: string;
|
|
54
|
+
}): Promise<GoogleAnalyticsInvokeResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Execute a raw Google Analytics operation
|
|
57
|
+
* @param payload The raw operation payload
|
|
58
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
59
|
+
*/
|
|
60
|
+
invoke(payload: Record<string, unknown>, invocationKey: string): Promise<GoogleAnalyticsInvokeResponse>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=google-analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-analytics.d.ts","sourceRoot":"","sources":["../../src/clients/google-analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAW7C,qBAAa,6BAA8B,SAAQ,kBAAkB;IACnE;;;;;;;OAOG;IACG,SAAS,CACb,UAAU,EAAE,WAAW,EAAE,EACzB,OAAO,EAAE,QAAQ,EAAE,EACnB,UAAU,EAAE,WAAW,EAAE,EACzB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;OAGG;IACG,WAAW,CACf,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;;;OAMG;IACG,iBAAiB,CACrB,OAAO,EAAE,QAAQ,EAAE,EACnB,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,WAAW,EAAE,EAC1B,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;OAIG;IACG,YAAY,CAChB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;;OAKG;IACG,cAAc,CAClB,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;;OAKG;IACG,eAAe,CACnB,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,6BAA6B,CAAC;IAKzC;;;;OAIG;IACG,MAAM,CACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,6BAA6B,CAAC;CAI1C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
import { buildGoogleAnalyticsRunReportPayload, buildGoogleAnalyticsGetMetadataPayload, buildGoogleAnalyticsRunRealtimeReportPayload, buildGoogleAnalyticsListAccountsPayload, buildGoogleAnalyticsListPropertiesPayload, buildGoogleAnalyticsListDataStreamsPayload, buildGoogleAnalyticsInvokePayload, } from "../payload-builders/google-analytics";
|
|
3
|
+
export class GoogleAnalyticsResourceClient extends BaseResourceClient {
|
|
4
|
+
/**
|
|
5
|
+
* Run a GA4 report with dimensions, metrics, and date ranges
|
|
6
|
+
* @param dimensions Dimensions to group by (e.g. [{name: 'country'}])
|
|
7
|
+
* @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
|
|
8
|
+
* @param dateRanges Date ranges (e.g. [{startDate: '2024-01-01', endDate: '2024-01-31'}])
|
|
9
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
10
|
+
* @param options Optional report options (filters, ordering, limit, offset)
|
|
11
|
+
*/
|
|
12
|
+
async runReport(dimensions, metrics, dateRanges, invocationKey, options) {
|
|
13
|
+
const payload = buildGoogleAnalyticsRunReportPayload(dimensions, metrics, dateRanges, options);
|
|
14
|
+
return this.invokeRaw(payload, invocationKey);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get available dimensions and metrics for the GA4 property
|
|
18
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
19
|
+
*/
|
|
20
|
+
async getMetadata(invocationKey) {
|
|
21
|
+
const payload = buildGoogleAnalyticsGetMetadataPayload();
|
|
22
|
+
return this.invokeRaw(payload, invocationKey);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Run a realtime report showing current live user activity
|
|
26
|
+
* @param metrics Metrics to retrieve (e.g. [{name: 'activeUsers'}])
|
|
27
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
28
|
+
* @param dimensions Optional dimensions to group by
|
|
29
|
+
* @param limit Optional row limit
|
|
30
|
+
*/
|
|
31
|
+
async runRealtimeReport(metrics, invocationKey, dimensions, limit) {
|
|
32
|
+
const payload = buildGoogleAnalyticsRunRealtimeReportPayload(metrics, dimensions, limit);
|
|
33
|
+
return this.invokeRaw(payload, invocationKey);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* List all GA4 accounts accessible to the authenticated user
|
|
37
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
38
|
+
* @param options Optional pagination options
|
|
39
|
+
*/
|
|
40
|
+
async listAccounts(invocationKey, options) {
|
|
41
|
+
const payload = buildGoogleAnalyticsListAccountsPayload(options);
|
|
42
|
+
return this.invokeRaw(payload, invocationKey);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List GA4 properties, optionally filtered by account
|
|
46
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
47
|
+
* @param accountId Optional account filter (e.g. 'accounts/12345')
|
|
48
|
+
* @param options Optional pagination options
|
|
49
|
+
*/
|
|
50
|
+
async listProperties(invocationKey, accountId, options) {
|
|
51
|
+
const payload = buildGoogleAnalyticsListPropertiesPayload(accountId, options);
|
|
52
|
+
return this.invokeRaw(payload, invocationKey);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* List data streams for a GA4 property
|
|
56
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
57
|
+
* @param propertyId Optional property ID (defaults to configured property)
|
|
58
|
+
* @param options Optional pagination options
|
|
59
|
+
*/
|
|
60
|
+
async listDataStreams(invocationKey, propertyId, options) {
|
|
61
|
+
const payload = buildGoogleAnalyticsListDataStreamsPayload(propertyId, options);
|
|
62
|
+
return this.invokeRaw(payload, invocationKey);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Execute a raw Google Analytics operation
|
|
66
|
+
* @param payload The raw operation payload
|
|
67
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
68
|
+
*/
|
|
69
|
+
async invoke(payload, invocationKey) {
|
|
70
|
+
const p = buildGoogleAnalyticsInvokePayload(payload);
|
|
71
|
+
return this.invokeRaw(p, invocationKey);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=google-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-analytics.js","sourceRoot":"","sources":["../../src/clients/google-analytics.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EACL,oCAAoC,EACpC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AI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAA2C,CAAC;IAC1F,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,eAAe,CACnB,aAAqB,EACrB,UAAmB,EACnB,OAAmD;QAEnD,MAAM,OAAO,GAAG,0CAA0C,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAA2C,CAAC;IAC1F,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,OAAgC,EAChC,aAAqB;QAErB,MAAM,CAAC,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,CAA2C,CAAC;IACpF,CAAC;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,9 @@ __export(index_exports, {
|
|
|
24
24
|
CosmosDBResourceClient: () => import_cosmosdb.CosmosDBResourceClient,
|
|
25
25
|
CustomApiResourceClient: () => import_api_custom.CustomApiResourceClient,
|
|
26
26
|
DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
|
|
27
|
+
GoogleAnalyticsResourceClient: () => import_google_analytics.GoogleAnalyticsResourceClient,
|
|
27
28
|
GoogleSheetsResourceClient: () => import_googlesheets.GoogleSheetsResourceClient,
|
|
29
|
+
GraphQLResourceClient: () => import_api_graphql.GraphQLResourceClient,
|
|
28
30
|
HubSpotResourceClient: () => import_hubspot.HubSpotResourceClient,
|
|
29
31
|
LambdaResourceClient: () => import_lambda.LambdaResourceClient,
|
|
30
32
|
MajorAuthResourceClient: () => import_auth.MajorAuthResourceClient,
|
|
@@ -58,5 +60,7 @@ var import_outreach = require("./clients/outreach");
|
|
|
58
60
|
var import_neo4j = require("./clients/neo4j");
|
|
59
61
|
var import_slack = require("./clients/slack");
|
|
60
62
|
var import_auth = require("./clients/auth");
|
|
63
|
+
var import_google_analytics = require("./clients/google-analytics");
|
|
64
|
+
var import_api_graphql = require("./clients/api-graphql");
|
|
61
65
|
__reExport(index_exports, require("./payload-builders"), module.exports);
|
|
62
66
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Export all schemas and types\nexport * from \"./schemas\";\n\n// Export base client and config\nexport { BaseResourceClient, type BaseClientConfig } from \"./base\";\n\n// Export errors\nexport { ResourceInvokeError } from \"./errors\";\n\n// Export individual clients\nexport { PostgresResourceClient } from \"./clients/postgres\";\nexport { MssqlResourceClient } from \"./clients/mssql\";\nexport { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { SnowflakeResourceClient } from \"./clients/snowflake\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { SalesforceResourceClient } from \"./clients/salesforce\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\nexport { LambdaResourceClient } from \"./clients/lambda\";\nexport { BigQueryResourceClient } from \"./clients/bigquery\";\nexport { OutreachResourceClient } from \"./clients/outreach\";\nexport { Neo4jResourceClient } from \"./clients/neo4j\";\nexport { SlackResourceClient } from \"./clients/slack\";\nexport { MajorAuthResourceClient } from \"./clients/auth\";\n\n// Export payload builders (for use in testing UIs, etc.)\nexport * from \"./payload-builders\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n LambdaInvokeResponse,\n BigQueryInvokeResponse,\n OutreachInvokeResponse,\n Neo4jInvokeResponse,\n SlackInvokeResponse,\n AuthInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["// Export all schemas and types\nexport * from \"./schemas\";\n\n// Export base client and config\nexport { BaseResourceClient, type BaseClientConfig } from \"./base\";\n\n// Export errors\nexport { ResourceInvokeError } from \"./errors\";\n\n// Export individual clients\nexport { PostgresResourceClient } from \"./clients/postgres\";\nexport { MssqlResourceClient } from \"./clients/mssql\";\nexport { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { SnowflakeResourceClient } from \"./clients/snowflake\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { SalesforceResourceClient } from \"./clients/salesforce\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\nexport { LambdaResourceClient } from \"./clients/lambda\";\nexport { BigQueryResourceClient } from \"./clients/bigquery\";\nexport { OutreachResourceClient } from \"./clients/outreach\";\nexport { Neo4jResourceClient } from \"./clients/neo4j\";\nexport { SlackResourceClient } from \"./clients/slack\";\nexport { MajorAuthResourceClient } from \"./clients/auth\";\nexport { GoogleAnalyticsResourceClient } from \"./clients/google-analytics\";\nexport { GraphQLResourceClient } from \"./clients/api-graphql\";\n\n// Export payload builders (for use in testing UIs, etc.)\nexport * from \"./payload-builders\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n LambdaInvokeResponse,\n BigQueryInvokeResponse,\n OutreachInvokeResponse,\n Neo4jInvokeResponse,\n SlackInvokeResponse,\n AuthInvokeResponse,\n GoogleAnalyticsInvokeResponse,\n GraphQLInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,mBAAoC;AACpC,sBAAuC;AACvC,sBAAuC;AACvC,uBAAwC;AACxC,wBAAwC;AACxC,qBAAsC;AACtC,wBAAyC;AACzC,0BAA2C;AAC3C,gBAAiC;AACjC,oBAAqC;AACrC,sBAAuC;AACvC,sBAAuC;AACvC,mBAAoC;AACpC,mBAAoC;AACpC,kBAAwC;AACxC,8BAA8C;AAC9C,yBAAsC;AAGtC,0BAAc,+BA9Bd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export { OutreachResourceClient } from "./clients/outreach";
|
|
|
17
17
|
export { Neo4jResourceClient } from "./clients/neo4j";
|
|
18
18
|
export { SlackResourceClient } from "./clients/slack";
|
|
19
19
|
export { MajorAuthResourceClient } from "./clients/auth";
|
|
20
|
+
export { GoogleAnalyticsResourceClient } from "./clients/google-analytics";
|
|
21
|
+
export { GraphQLResourceClient } from "./clients/api-graphql";
|
|
20
22
|
export * from "./payload-builders";
|
|
21
|
-
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, OutreachInvokeResponse, Neo4jInvokeResponse, SlackInvokeResponse, AuthInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
23
|
+
export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, CosmosDBInvokeResponse, SnowflakeInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, LambdaInvokeResponse, BigQueryInvokeResponse, OutreachInvokeResponse, Neo4jInvokeResponse, SlackInvokeResponse, AuthInvokeResponse, GoogleAnalyticsInvokeResponse, GraphQLInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
|
|
22
24
|
//# 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,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAC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B,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,8 @@ export { OutreachResourceClient } from "./clients/outreach";
|
|
|
21
21
|
export { Neo4jResourceClient } from "./clients/neo4j";
|
|
22
22
|
export { SlackResourceClient } from "./clients/slack";
|
|
23
23
|
export { MajorAuthResourceClient } from "./clients/auth";
|
|
24
|
+
export { GoogleAnalyticsResourceClient } from "./clients/google-analytics";
|
|
25
|
+
export { GraphQLResourceClient } from "./clients/api-graphql";
|
|
24
26
|
// Export payload builders (for use in testing UIs, etc.)
|
|
25
27
|
export * from "./payload-builders";
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,cAAc,WAAW,CAAC;AAE1B,gCAAgC;AAChC,OAAO,EAAE,kBAAkB,EAAyB,MAAM,QAAQ,CAAC;AAEnE,gBAAgB;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,4BAA4B;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,O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gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,yDAAyD;AACzD,cAAc,oBAAoB,CAAC"}
|
|
@@ -38,6 +38,8 @@ var import_outreach = require("./outreach");
|
|
|
38
38
|
var import_neo4j = require("./neo4j");
|
|
39
39
|
var import_slack = require("./slack");
|
|
40
40
|
var import_auth = require("./auth");
|
|
41
|
+
var import_google_analytics = require("./google-analytics");
|
|
42
|
+
var import_graphql = require("./graphql");
|
|
41
43
|
function isUndefinedParam(param) {
|
|
42
44
|
return param.known === false && param.expression === "undefined";
|
|
43
45
|
}
|
|
@@ -372,6 +374,40 @@ function buildPayloadFromExtractedParams(subtype, methodName, extractedParams) {
|
|
|
372
374
|
}
|
|
373
375
|
return (0, import_auth.buildAuthShareAccessPayload)(email);
|
|
374
376
|
}
|
|
377
|
+
// =========================================================================
|
|
378
|
+
// Google Analytics
|
|
379
|
+
// =========================================================================
|
|
380
|
+
case "googleanalytics": {
|
|
381
|
+
if (methodName === "runReport") {
|
|
382
|
+
const dimensions = findParam(extractedParams, "Dimensions");
|
|
383
|
+
const metrics = findParam(extractedParams, "Metrics");
|
|
384
|
+
const dateRanges = findParam(extractedParams, "DateRanges");
|
|
385
|
+
const options = findParam(extractedParams, "Options");
|
|
386
|
+
return (0, import_google_analytics.buildGoogleAnalyticsRunReportPayload)(dimensions ?? [], metrics ?? [], dateRanges ?? [], options);
|
|
387
|
+
}
|
|
388
|
+
if (methodName === "getMetadata") {
|
|
389
|
+
return (0, import_google_analytics.buildGoogleAnalyticsGetMetadataPayload)();
|
|
390
|
+
}
|
|
391
|
+
if (methodName === "listAccounts") {
|
|
392
|
+
const options = findParam(extractedParams, "Options");
|
|
393
|
+
return (0, import_google_analytics.buildGoogleAnalyticsListAccountsPayload)(options);
|
|
394
|
+
}
|
|
395
|
+
if (methodName === "listProperties") {
|
|
396
|
+
const accountId = findParam(extractedParams, "AccountId");
|
|
397
|
+
const options = findParam(extractedParams, "Options");
|
|
398
|
+
return (0, import_google_analytics.buildGoogleAnalyticsListPropertiesPayload)(accountId, options);
|
|
399
|
+
}
|
|
400
|
+
const payload = findParam(extractedParams, "Payload");
|
|
401
|
+
return (0, import_google_analytics.buildGoogleAnalyticsInvokePayload)(payload);
|
|
402
|
+
}
|
|
403
|
+
// =========================================================================
|
|
404
|
+
// GraphQL
|
|
405
|
+
// =========================================================================
|
|
406
|
+
case "graphql": {
|
|
407
|
+
const query = findParam(extractedParams, "Query");
|
|
408
|
+
const options = findParam(extractedParams, "Options");
|
|
409
|
+
return (0, import_graphql.buildGraphQLInvokePayload)(query, options);
|
|
410
|
+
}
|
|
375
411
|
default:
|
|
376
412
|
throw new Error(`Unsupported resource subtype: ${subtype}`);
|
|
377
413
|
}
|