@major-tech/resource-client 0.2.3 → 0.2.5

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.
@@ -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: database-postgresql | database-dynamodb | api-hubspot | api-custom | storage-s3
11
+ * Types: database-postgresql | database-dynamodb | api-hubspot | api-googlesheets | api-custom | storage-s3
12
12
  *
13
13
  * Examples:
14
14
  * npx @major-tech/resource-client add "abc-123" "orders-db" "database-postgresql" "Orders database" "app-123"
@@ -27,13 +27,35 @@ const __dirname = path.dirname(__filename);
27
27
  // User's project root (where the command is run from)
28
28
  const projectRoot = process.cwd();
29
29
  const resourcesConfigPath = path.join(projectRoot, 'resources.json');
30
- const clientsDir = path.join(projectRoot, 'src', 'clients');
30
+
31
+ function getClientsDir() {
32
+ const srcDir = path.join(projectRoot, 'src');
33
+ if (fs.existsSync(srcDir)) {
34
+ return path.join(srcDir, 'clients');
35
+ }
36
+ return path.join(projectRoot, 'clients');
37
+ }
31
38
 
32
39
  /**
33
40
  * Client template
34
41
  */
35
- function clientTemplate(data) {
36
- return `import { ${data.clientClass} } from '@major-tech/resource-client';
42
+ function clientTemplate(data, framework) {
43
+ const isNextJs = framework === 'nextjs';
44
+
45
+ const imports = [
46
+ `import { ${data.clientClass} } from '@major-tech/resource-client';`,
47
+ isNextJs ? `import { headers } from 'next/headers';` : ''
48
+ ].filter(Boolean).join('\n');
49
+
50
+ const getHeadersConfig = isNextJs ? `
51
+ getHeaders: async () => {
52
+ const h = await headers();
53
+ return {
54
+ 'x-major-user-jwt': h.get('x-major-user-jwt') || '',
55
+ };
56
+ },` : '';
57
+
58
+ return `${imports}
37
59
 
38
60
  /**
39
61
  * ${data.description}
@@ -45,8 +67,8 @@ function clientTemplate(data) {
45
67
  * DO NOT EDIT - Auto-generated by @major-tech/resource-client
46
68
  */
47
69
 
48
- const BASE_URL = import.meta.env.MAJOR_API_BASE_URL || 'https://api.prod.major.build';
49
- const MAJOR_JWT_TOKEN = import.meta.env.MAJOR_JWT_TOKEN;
70
+ const BASE_URL = ${isNextJs ? 'process.env.MAJOR_API_BASE_URL' : 'import.meta.env.MAJOR_API_BASE_URL'} || 'https://api.prod.major.build';
71
+ const MAJOR_JWT_TOKEN = ${isNextJs ? 'process.env.MAJOR_JWT_TOKEN' : 'import.meta.env.MAJOR_JWT_TOKEN'};
50
72
 
51
73
  class ${data.clientName}Singleton {
52
74
  private static instance: ${data.clientClass} | null = null;
@@ -58,7 +80,7 @@ class ${data.clientName}Singleton {
58
80
  majorJwtToken: MAJOR_JWT_TOKEN,
59
81
  applicationId: '${data.applicationId}',
60
82
  resourceId: '${data.resourceId}',
61
- fetch: (...args) => fetch(...args),
83
+ fetch: (...args) => fetch(...args),${getHeadersConfig}
62
84
  });
63
85
  }
64
86
  return ${data.clientName}Singleton.instance;
@@ -122,12 +144,13 @@ function getClientClass(type) {
122
144
  'database-dynamodb': 'DynamoDBResourceClient',
123
145
  'api-custom': 'CustomApiResourceClient',
124
146
  'api-hubspot': 'HubSpotResourceClient',
147
+ 'api-googlesheets': 'GoogleSheetsResourceClient',
125
148
  'storage-s3': 'S3ResourceClient',
126
149
  };
127
150
  return typeMap[type] || 'PostgresResourceClient';
128
151
  }
129
152
 
130
- function generateClientFile(resource) {
153
+ function generateClientFile(resource, framework) {
131
154
  const clientName = toCamelCase(resource.name) + 'Client';
132
155
  const clientClass = getClientClass(resource.type);
133
156
 
@@ -138,7 +161,7 @@ function generateClientFile(resource) {
138
161
  resourceId: resource.id,
139
162
  applicationId: resource.applicationId,
140
163
  clientName,
141
- });
164
+ }, framework);
142
165
  }
143
166
 
144
167
  function generateIndexFile(resources) {
@@ -155,8 +178,8 @@ function generateIndexFile(resources) {
155
178
  return indexTemplate({ exports });
156
179
  }
157
180
 
158
- function addResource(resourceId, name, type, description, applicationId) {
159
- const validTypes = ['database-postgresql', 'database-dynamodb', 'api-hubspot', 'api-custom', 'storage-s3'];
181
+ function addResource(resourceId, name, type, description, applicationId, framework) {
182
+ const validTypes = ['database-postgresql', 'database-dynamodb', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
160
183
  if (!validTypes.includes(type)) {
161
184
  console.error(`❌ Invalid type: ${type}`);
162
185
  console.log(` Valid types: ${validTypes.join(', ')}`);
@@ -192,13 +215,13 @@ function addResource(resourceId, name, type, description, applicationId) {
192
215
  console.log(` Type: ${type}`);
193
216
  console.log(` ID: ${resourceId}`);
194
217
 
195
- regenerateClients(resources);
218
+ regenerateClients(resources, framework);
196
219
  }
197
220
 
198
221
  /**
199
222
  * Remove a resource by name
200
223
  */
201
- function removeResource(name) {
224
+ function removeResource(name, framework) {
202
225
  const resources = loadResources();
203
226
  const index = resources.findIndex(r => r.name === name);
204
227
 
@@ -213,7 +236,7 @@ function removeResource(name) {
213
236
  console.log(`✅ Removed resource: ${removed.name}`);
214
237
  console.log(` ID: ${removed.id}`);
215
238
 
216
- regenerateClients(resources);
239
+ regenerateClients(resources, framework);
217
240
  }
218
241
 
219
242
  /**
@@ -239,7 +262,9 @@ function listResources() {
239
262
  /**
240
263
  * Regenerate all client files
241
264
  */
242
- function regenerateClients(resources) {
265
+ function regenerateClients(resources, framework) {
266
+ const clientsDir = getClientsDir();
267
+
243
268
  // Ensure clients directory exists
244
269
  if (!fs.existsSync(clientsDir)) {
245
270
  fs.mkdirSync(clientsDir, { recursive: true });
@@ -255,7 +280,7 @@ function regenerateClients(resources) {
255
280
  resources.forEach(resource => {
256
281
  const fileName = toCamelCase(resource.name) + '.ts';
257
282
  const filePath = path.join(clientsDir, fileName);
258
- const code = generateClientFile(resource);
283
+ const code = generateClientFile(resource, framework);
259
284
  fs.writeFileSync(filePath, code, 'utf-8');
260
285
  });
261
286
 
@@ -265,6 +290,9 @@ function regenerateClients(resources) {
265
290
  fs.writeFileSync(indexPath, indexCode, 'utf-8');
266
291
 
267
292
  console.log(`✅ Generated ${resources.length} client(s) in ${clientsDir}`);
293
+ if (framework) {
294
+ console.log(` Framework: ${framework}`);
295
+ }
268
296
  }
269
297
 
270
298
  /**
@@ -274,12 +302,21 @@ function main() {
274
302
  const args = process.argv.slice(2);
275
303
  const command = args[0];
276
304
 
305
+ // Extract --framework flag
306
+ const frameworkIndex = args.indexOf('--framework');
307
+ let framework = undefined;
308
+ if (frameworkIndex !== -1 && args[frameworkIndex + 1]) {
309
+ framework = args[frameworkIndex + 1];
310
+ // Remove --framework and its value from args
311
+ args.splice(frameworkIndex, 2);
312
+ }
313
+
277
314
  if (!command) {
278
315
  console.log('Usage:');
279
- console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id>');
280
- console.log(' npx @major-tech/resource-client remove <name>');
316
+ console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
317
+ console.log(' npx @major-tech/resource-client remove <name> [--framework <nextjs|vite>]');
281
318
  console.log(' npx @major-tech/resource-client list');
282
- console.log('\nTypes: database-postgresql | database-dynamodb | api-hubspot | api-custom | storage-s3');
319
+ console.log('\nTypes: database-postgresql | database-dynamodb | api-hubspot | api-googlesheets | api-custom | storage-s3');
283
320
  return;
284
321
  }
285
322
 
@@ -288,10 +325,10 @@ function main() {
288
325
  const [, resourceId, name, type, description, applicationId] = args;
289
326
  if (!resourceId || !name || !type || !description || !applicationId) {
290
327
  console.error('❌ Missing arguments');
291
- console.log('Usage: add <resource_id> <name> <type> <description> <application_id>');
328
+ console.log('Usage: add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
292
329
  process.exit(1);
293
330
  }
294
- addResource(resourceId, name, type, description, applicationId);
331
+ addResource(resourceId, name, type, description, applicationId, framework);
295
332
  break;
296
333
  }
297
334
 
@@ -301,7 +338,7 @@ function main() {
301
338
  console.error('❌ Missing name');
302
339
  process.exit(1);
303
340
  }
304
- removeResource(name);
341
+ removeResource(name, framework);
305
342
  break;
306
343
  }
307
344
 
@@ -309,13 +346,7 @@ function main() {
309
346
  listResources();
310
347
  break;
311
348
  }
312
-
313
- case 'regenerate': {
314
- const resources = loadResources();
315
- regenerateClients(resources);
316
- break;
317
- }
318
-
349
+
319
350
  default: {
320
351
  console.error(`❌ Unknown command: ${command}`);
321
352
  process.exit(1);
package/dist/base.cjs CHANGED
@@ -34,7 +34,8 @@ class BaseResourceClient {
34
34
  majorJwtToken: config.majorJwtToken,
35
35
  applicationId: config.applicationId,
36
36
  resourceId: config.resourceId,
37
- fetch: config.fetch || globalThis.fetch
37
+ fetch: config.fetch || globalThis.fetch,
38
+ getHeaders: config.getHeaders
38
39
  };
39
40
  }
40
41
  async invokeRaw(payload, invocationKey) {
@@ -43,12 +44,16 @@ class BaseResourceClient {
43
44
  payload,
44
45
  invocationKey
45
46
  };
46
- const headers = {
47
+ let headers = {
47
48
  "Content-Type": "application/json"
48
49
  };
49
50
  if (this.config.majorJwtToken) {
50
51
  headers["x-major-jwt"] = this.config.majorJwtToken;
51
52
  }
53
+ if (this.config.getHeaders) {
54
+ const extraHeaders = await this.config.getHeaders();
55
+ headers = { ...headers, ...extraHeaders };
56
+ }
52
57
  try {
53
58
  const response = await this.config.fetch(url, {
54
59
  method: "POST",
package/dist/base.cjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/base.ts"],
4
- "sourcesContent": ["import type {\n ResourceInvokePayload,\n InvokeResponse,\n InvokeRequest,\n} from \"./schemas\";\nimport { ResourceInvokeError } from \"./errors\";\n\nexport interface BaseClientConfig {\n baseUrl: string;\n majorJwtToken?: string;\n applicationId: string;\n resourceId: string;\n fetch?: typeof fetch;\n}\n\nexport abstract class BaseResourceClient {\n protected readonly config: {\n baseUrl: string;\n majorJwtToken?: string;\n applicationId: string;\n resourceId: string;\n fetch: typeof fetch;\n };\n\n constructor(config: BaseClientConfig) {\n this.config = {\n baseUrl: config.baseUrl.replace(/\\/$/, \"\"),\n majorJwtToken: config.majorJwtToken,\n applicationId: config.applicationId,\n resourceId: config.resourceId,\n fetch: config.fetch || globalThis.fetch,\n };\n }\n\n protected async invokeRaw(\n payload: ResourceInvokePayload,\n invocationKey: string,\n ): Promise<InvokeResponse> {\n const url = `${this.config.baseUrl}/internal/apps/v1/${this.config.applicationId}/resource/${this.config.resourceId}/invoke`;\n \n const body: InvokeRequest = {\n payload,\n invocationKey,\n };\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n };\n\n if (this.config.majorJwtToken) {\n headers[\"x-major-jwt\"] = this.config.majorJwtToken;\n }\n\n try {\n const response = await this.config.fetch(url, {\n method: \"POST\",\n headers,\n credentials: \"include\",\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n return data as InvokeResponse;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new ResourceInvokeError(`Failed to invoke resource: ${message}`);\n }\n }\n}\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAA,oBAAoC;AAU9B,MAAgB,mBAAkB;EAVxC,OAUwC;;;EACnB;EAQnB,YAAY,QAAwB;AAClC,SAAK,SAAS;MACZ,SAAS,OAAO,QAAQ,QAAQ,OAAO,EAAE;MACzC,eAAe,OAAO;MACtB,eAAe,OAAO;MACtB,YAAY,OAAO;MACnB,OAAO,OAAO,SAAS,WAAW;;EAEtC;EAEU,MAAM,UACd,SACA,eAAqB;AAErB,UAAM,MAAM,GAAG,KAAK,OAAO,OAAO,qBAAqB,KAAK,OAAO,aAAa,aAAa,KAAK,OAAO,UAAU;AAEnH,UAAM,OAAsB;MAC1B;MACA;;AAGF,UAAM,UAAkC;MACtC,gBAAgB;;AAGlB,QAAI,KAAK,OAAO,eAAe;AAC7B,cAAQ,aAAa,IAAI,KAAK,OAAO;IACvC;AAEA,QAAI;AACF,YAAM,WAAW,MAAM,KAAK,OAAO,MAAM,KAAK;QAC5C,QAAQ;QACR;QACA,aAAa;QACb,MAAM,KAAK,UAAU,IAAI;OAC1B;AAED,YAAM,OAAO,MAAM,SAAS,KAAI;AAChC,aAAO;IACT,SAAS,OAAO;AACd,YAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,YAAM,IAAI,kCAAoB,8BAA8B,OAAO,EAAE;IACvE;EACF;;",
4
+ "sourcesContent": ["import type {\n ResourceInvokePayload,\n InvokeResponse,\n InvokeRequest,\n} from \"./schemas\";\nimport { ResourceInvokeError } from \"./errors\";\n\nexport interface BaseClientConfig {\n baseUrl: string;\n majorJwtToken?: string;\n applicationId: string;\n resourceId: string;\n fetch?: typeof fetch;\n /**\n * Optional function to get additional headers (e.g. for auth)\n * Useful for Next.js Server Components where headers() must be called dynamically\n */\n getHeaders?: () => Promise<Record<string, string>> | Record<string, string>;\n}\n\nexport abstract class BaseResourceClient {\n protected readonly config: {\n baseUrl: string;\n majorJwtToken?: string;\n applicationId: string;\n resourceId: string;\n fetch: typeof fetch;\n getHeaders?: () => Promise<Record<string, string>> | Record<string, string>;\n };\n\n constructor(config: BaseClientConfig) {\n this.config = {\n baseUrl: config.baseUrl.replace(/\\/$/, \"\"),\n majorJwtToken: config.majorJwtToken,\n applicationId: config.applicationId,\n resourceId: config.resourceId,\n fetch: config.fetch || globalThis.fetch,\n getHeaders: config.getHeaders,\n };\n }\n\n protected async invokeRaw(\n payload: ResourceInvokePayload,\n invocationKey: string,\n ): Promise<InvokeResponse> {\n const url = `${this.config.baseUrl}/internal/apps/v1/${this.config.applicationId}/resource/${this.config.resourceId}/invoke`;\n \n const body: InvokeRequest = {\n payload,\n invocationKey,\n };\n\n let headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n };\n\n if (this.config.majorJwtToken) {\n headers[\"x-major-jwt\"] = this.config.majorJwtToken;\n }\n\n if (this.config.getHeaders) {\n const extraHeaders = await this.config.getHeaders();\n headers = { ...headers, ...extraHeaders };\n }\n\n try {\n const response = await this.config.fetch(url, {\n method: \"POST\",\n headers,\n credentials: \"include\",\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n return data as InvokeResponse;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new ResourceInvokeError(`Failed to invoke resource: ${message}`);\n }\n }\n}\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAA,oBAAoC;AAe9B,MAAgB,mBAAkB;EAfxC,OAewC;;;EACnB;EASnB,YAAY,QAAwB;AAClC,SAAK,SAAS;MACZ,SAAS,OAAO,QAAQ,QAAQ,OAAO,EAAE;MACzC,eAAe,OAAO;MACtB,eAAe,OAAO;MACtB,YAAY,OAAO;MACnB,OAAO,OAAO,SAAS,WAAW;MAClC,YAAY,OAAO;;EAEvB;EAEU,MAAM,UACd,SACA,eAAqB;AAErB,UAAM,MAAM,GAAG,KAAK,OAAO,OAAO,qBAAqB,KAAK,OAAO,aAAa,aAAa,KAAK,OAAO,UAAU;AAEnH,UAAM,OAAsB;MAC1B;MACA;;AAGF,QAAI,UAAkC;MACpC,gBAAgB;;AAGlB,QAAI,KAAK,OAAO,eAAe;AAC7B,cAAQ,aAAa,IAAI,KAAK,OAAO;IACvC;AAEA,QAAI,KAAK,OAAO,YAAY;AAC1B,YAAM,eAAe,MAAM,KAAK,OAAO,WAAU;AACjD,gBAAU,EAAE,GAAG,SAAS,GAAG,aAAY;IACzC;AAEA,QAAI;AACF,YAAM,WAAW,MAAM,KAAK,OAAO,MAAM,KAAK;QAC5C,QAAQ;QACR;QACA,aAAa;QACb,MAAM,KAAK,UAAU,IAAI;OAC1B;AAED,YAAM,OAAO,MAAM,SAAS,KAAI;AAChC,aAAO;IACT,SAAS,OAAO;AACd,YAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,YAAM,IAAI,kCAAoB,8BAA8B,OAAO,EAAE;IACvE;EACF;;",
6
6
  "names": []
7
7
  }
package/dist/base.d.ts CHANGED
@@ -5,6 +5,11 @@ export interface BaseClientConfig {
5
5
  applicationId: string;
6
6
  resourceId: string;
7
7
  fetch?: typeof fetch;
8
+ /**
9
+ * Optional function to get additional headers (e.g. for auth)
10
+ * Useful for Next.js Server Components where headers() must be called dynamically
11
+ */
12
+ getHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
8
13
  }
9
14
  export declare abstract class BaseResourceClient {
10
15
  protected readonly config: {
@@ -13,6 +18,7 @@ export declare abstract class BaseResourceClient {
13
18
  applicationId: string;
14
19
  resourceId: string;
15
20
  fetch: typeof fetch;
21
+ getHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
16
22
  };
17
23
  constructor(config: BaseClientConfig);
18
24
  protected invokeRaw(payload: ResourceInvokePayload, invocationKey: string): Promise<InvokeResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EAEf,MAAM,WAAW,CAAC;AAGnB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,8BAAsB,kBAAkB;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,OAAO,KAAK,CAAC;KACrB,CAAC;gBAEU,MAAM,EAAE,gBAAgB;cAUpB,SAAS,CACvB,OAAO,EAAE,qBAAqB,EAC9B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,CAAC;CA+B3B"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EAEf,MAAM,WAAW,CAAC;AAGnB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7E;AAED,8BAAsB,kBAAkB;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;QACzB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,OAAO,KAAK,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC7E,CAAC;gBAEU,MAAM,EAAE,gBAAgB;cAWpB,SAAS,CACvB,OAAO,EAAE,qBAAqB,EAC9B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,CAAC;CAoC3B"}
package/dist/base.js CHANGED
@@ -8,6 +8,7 @@ export class BaseResourceClient {
8
8
  applicationId: config.applicationId,
9
9
  resourceId: config.resourceId,
10
10
  fetch: config.fetch || globalThis.fetch,
11
+ getHeaders: config.getHeaders,
11
12
  };
12
13
  }
13
14
  async invokeRaw(payload, invocationKey) {
@@ -16,12 +17,16 @@ export class BaseResourceClient {
16
17
  payload,
17
18
  invocationKey,
18
19
  };
19
- const headers = {
20
+ let headers = {
20
21
  "Content-Type": "application/json",
21
22
  };
22
23
  if (this.config.majorJwtToken) {
23
24
  headers["x-major-jwt"] = this.config.majorJwtToken;
24
25
  }
26
+ if (this.config.getHeaders) {
27
+ const extraHeaders = await this.config.getHeaders();
28
+ headers = { ...headers, ...extraHeaders };
29
+ }
25
30
  try {
26
31
  const response = await this.config.fetch(url, {
27
32
  method: "POST",
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAU/C,MAAM,OAAgB,kBAAkB;IACnB,MAAM,CAMvB;IAEF,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;YAC1C,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK;SACxC,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,SAAS,CACvB,OAA8B,EAC9B,aAAqB;QAErB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,qBAAqB,IAAI,CAAC,MAAM,CAAC,aAAa,aAAa,IAAI,CAAC,MAAM,CAAC,UAAU,SAAS,CAAC;QAE7H,MAAM,IAAI,GAAkB;YAC1B,OAAO;YACP,aAAa;SACd,CAAC;QAEF,MAAM,OAAO,GAA2B;YACtC,cAAc,EAAE,kBAAkB;SACnC,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YAC9B,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;QACrD,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAA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E7H,MAAM,IAAI,GAAkB;YAC1B,OAAO;YACP,aAAa;SACd,CAAC;QAEF,IAAI,OAAO,GAA2B;YACpC,cAAc,EAAE,kBAAkB;SACnC,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YAC9B,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;QACrD,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YACpD,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,YAAY,EAAE,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;gBAC5C,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aAC3B,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAsB,CAAC;QAChC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,MAAM,IAAI,mBAAmB,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,129 @@
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 googlesheets_exports = {};
21
+ __export(googlesheets_exports, {
22
+ GoogleSheetsResourceClient: () => GoogleSheetsResourceClient
23
+ });
24
+ module.exports = __toCommonJS(googlesheets_exports);
25
+ var import_base = require("../base");
26
+ class GoogleSheetsResourceClient extends import_base.BaseResourceClient {
27
+ static {
28
+ __name(this, "GoogleSheetsResourceClient");
29
+ }
30
+ async invoke(method, path, invocationKey, options = {}) {
31
+ const payload = {
32
+ type: "api",
33
+ subtype: "googlesheets",
34
+ method,
35
+ path,
36
+ query: options.query,
37
+ body: options.body,
38
+ timeoutMs: options.timeoutMs || 3e4
39
+ };
40
+ return this.invokeRaw(payload, invocationKey);
41
+ }
42
+ /**
43
+ * Get values from a range in the spreadsheet
44
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
45
+ * @param invocationKey Unique key for tracking this invocation
46
+ */
47
+ async getValues(range, invocationKey) {
48
+ return this.invoke("GET", `/values/${range}`, invocationKey);
49
+ }
50
+ /**
51
+ * Update values in a range in the spreadsheet
52
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
53
+ * @param values 2D array of values to write
54
+ * @param invocationKey Unique key for tracking this invocation
55
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
56
+ */
57
+ async updateValues(range, values, invocationKey, valueInputOption = "USER_ENTERED") {
58
+ return this.invoke("PUT", `/values/${range}`, invocationKey, {
59
+ query: { valueInputOption },
60
+ body: { type: "json", value: { values } }
61
+ });
62
+ }
63
+ /**
64
+ * Append values to a sheet
65
+ * @param range A1 notation range (e.g., "Sheet1!A1:D1")
66
+ * @param values 2D array of values to append
67
+ * @param invocationKey Unique key for tracking this invocation
68
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
69
+ */
70
+ async appendValues(range, values, invocationKey, valueInputOption = "USER_ENTERED") {
71
+ return this.invoke("POST", `/values/${range}:append`, invocationKey, {
72
+ query: { valueInputOption },
73
+ body: { type: "json", value: { values } }
74
+ });
75
+ }
76
+ /**
77
+ * Clear values in a range
78
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
79
+ * @param invocationKey Unique key for tracking this invocation
80
+ */
81
+ async clearValues(range, invocationKey) {
82
+ return this.invoke("POST", `/values/${range}:clear`, invocationKey);
83
+ }
84
+ /**
85
+ * Batch get multiple ranges
86
+ * @param ranges Array of A1 notation ranges
87
+ * @param invocationKey Unique key for tracking this invocation
88
+ */
89
+ async batchGetValues(ranges, invocationKey) {
90
+ return this.invoke("GET", "/values:batchGet", invocationKey, {
91
+ query: { ranges }
92
+ });
93
+ }
94
+ /**
95
+ * Batch update multiple ranges
96
+ * @param data Array of range updates
97
+ * @param invocationKey Unique key for tracking this invocation
98
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
99
+ */
100
+ async batchUpdateValues(data, invocationKey, valueInputOption = "USER_ENTERED") {
101
+ return this.invoke("POST", "/values:batchUpdate", invocationKey, {
102
+ body: {
103
+ type: "json",
104
+ value: {
105
+ valueInputOption,
106
+ data
107
+ }
108
+ }
109
+ });
110
+ }
111
+ /**
112
+ * Get spreadsheet metadata
113
+ * @param invocationKey Unique key for tracking this invocation
114
+ */
115
+ async getSpreadsheet(invocationKey) {
116
+ return this.invoke("GET", "/", invocationKey);
117
+ }
118
+ /**
119
+ * Batch update spreadsheet (for formatting, creating sheets, etc.)
120
+ * @param requests Array of update requests
121
+ * @param invocationKey Unique key for tracking this invocation
122
+ */
123
+ async batchUpdate(requests, invocationKey) {
124
+ return this.invoke("POST", "/:batchUpdate", invocationKey, {
125
+ body: { type: "json", value: { requests } }
126
+ });
127
+ }
128
+ }
129
+ //# sourceMappingURL=googlesheets.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/clients/googlesheets.ts"],
4
+ "sourcesContent": ["import type {\n HttpMethod,\n QueryParams,\n ApiGoogleSheetsPayload,\n ApiInvokeResponse,\n} from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\n\nexport class GoogleSheetsResourceClient extends BaseResourceClient {\n async invoke(\n method: HttpMethod,\n path: string,\n invocationKey: string,\n options: {\n query?: QueryParams;\n body?: { type: \"json\"; value: unknown };\n timeoutMs?: number;\n } = {}\n ): Promise<ApiInvokeResponse> {\n const payload: ApiGoogleSheetsPayload = {\n type: \"api\",\n subtype: \"googlesheets\",\n method,\n path,\n query: options.query,\n body: options.body,\n timeoutMs: options.timeoutMs || 30000,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<ApiInvokeResponse>;\n }\n\n /**\n * Get values from a range in the spreadsheet\n * @param range A1 notation range (e.g., \"Sheet1!A1:D5\")\n * @param invocationKey Unique key for tracking this invocation\n */\n async getValues(\n range: string,\n invocationKey: string\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\"GET\", `/values/${range}`, invocationKey);\n }\n\n /**\n * Update values in a range in the spreadsheet\n * @param range A1 notation range (e.g., \"Sheet1!A1:D5\")\n * @param values 2D array of values to write\n * @param invocationKey Unique key for tracking this invocation\n * @param valueInputOption How to interpret input values (\"RAW\" or \"USER_ENTERED\")\n */\n async updateValues(\n range: string,\n values: unknown[][],\n invocationKey: string,\n valueInputOption: \"RAW\" | \"USER_ENTERED\" = \"USER_ENTERED\"\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\n \"PUT\",\n `/values/${range}`,\n invocationKey,\n {\n query: { valueInputOption },\n body: { type: \"json\", value: { values } },\n }\n );\n }\n\n /**\n * Append values to a sheet\n * @param range A1 notation range (e.g., \"Sheet1!A1:D1\")\n * @param values 2D array of values to append\n * @param invocationKey Unique key for tracking this invocation\n * @param valueInputOption How to interpret input values (\"RAW\" or \"USER_ENTERED\")\n */\n async appendValues(\n range: string,\n values: unknown[][],\n invocationKey: string,\n valueInputOption: \"RAW\" | \"USER_ENTERED\" = \"USER_ENTERED\"\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\n \"POST\",\n `/values/${range}:append`,\n invocationKey,\n {\n query: { valueInputOption },\n body: { type: \"json\", value: { values } },\n }\n );\n }\n\n /**\n * Clear values in a range\n * @param range A1 notation range (e.g., \"Sheet1!A1:D5\")\n * @param invocationKey Unique key for tracking this invocation\n */\n async clearValues(\n range: string,\n invocationKey: string\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\"POST\", `/values/${range}:clear`, invocationKey);\n }\n\n /**\n * Batch get multiple ranges\n * @param ranges Array of A1 notation ranges\n * @param invocationKey Unique key for tracking this invocation\n */\n async batchGetValues(\n ranges: string[],\n invocationKey: string\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\"GET\", \"/values:batchGet\", invocationKey, {\n query: { ranges },\n });\n }\n\n /**\n * Batch update multiple ranges\n * @param data Array of range updates\n * @param invocationKey Unique key for tracking this invocation\n * @param valueInputOption How to interpret input values (\"RAW\" or \"USER_ENTERED\")\n */\n async batchUpdateValues(\n data: Array<{ range: string; values: unknown[][] }>,\n invocationKey: string,\n valueInputOption: \"RAW\" | \"USER_ENTERED\" = \"USER_ENTERED\"\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\"POST\", \"/values:batchUpdate\", invocationKey, {\n body: {\n type: \"json\",\n value: {\n valueInputOption,\n data,\n },\n },\n });\n }\n\n /**\n * Get spreadsheet metadata\n * @param invocationKey Unique key for tracking this invocation\n */\n async getSpreadsheet(invocationKey: string): Promise<ApiInvokeResponse> {\n return this.invoke(\"GET\", \"/\", invocationKey);\n }\n\n /**\n * Batch update spreadsheet (for formatting, creating sheets, etc.)\n * @param requests Array of update requests\n * @param invocationKey Unique key for tracking this invocation\n */\n async batchUpdate(\n requests: unknown[],\n invocationKey: string\n ): Promise<ApiInvokeResponse> {\n return this.invoke(\"POST\", \"/:batchUpdate\", invocationKey, {\n body: { type: \"json\", value: { requests } },\n });\n }\n}\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAMA;;;;;AAAA,kBAAmC;AAE7B,MAAO,mCAAmC,+BAAkB;EAFlE,OAEkE;;;EAChE,MAAM,OACJ,QACA,MACA,eACA,UAII,CAAA,GAAE;AAEN,UAAM,UAAkC;MACtC,MAAM;MACN,SAAS;MACT;MACA;MACA,OAAO,QAAQ;MACf,MAAM,QAAQ;MACd,WAAW,QAAQ,aAAa;;AAGlC,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;;;;;EAOA,MAAM,UACJ,OACA,eAAqB;AAErB,WAAO,KAAK,OAAO,OAAO,WAAW,KAAK,IAAI,aAAa;EAC7D;;;;;;;;EASA,MAAM,aACJ,OACA,QACA,eACA,mBAA2C,gBAAc;AAEzD,WAAO,KAAK,OACV,OACA,WAAW,KAAK,IAChB,eACA;MACE,OAAO,EAAE,iBAAgB;MACzB,MAAM,EAAE,MAAM,QAAQ,OAAO,EAAE,OAAM,EAAE;KACxC;EAEL;;;;;;;;EASA,MAAM,aACJ,OACA,QACA,eACA,mBAA2C,gBAAc;AAEzD,WAAO,KAAK,OACV,QACA,WAAW,KAAK,WAChB,eACA;MACE,OAAO,EAAE,iBAAgB;MACzB,MAAM,EAAE,MAAM,QAAQ,OAAO,EAAE,OAAM,EAAE;KACxC;EAEL;;;;;;EAOA,MAAM,YACJ,OACA,eAAqB;AAErB,WAAO,KAAK,OAAO,QAAQ,WAAW,KAAK,UAAU,aAAa;EACpE;;;;;;EAOA,MAAM,eACJ,QACA,eAAqB;AAErB,WAAO,KAAK,OAAO,OAAO,oBAAoB,eAAe;MAC3D,OAAO,EAAE,OAAM;KAChB;EACH;;;;;;;EAQA,MAAM,kBACJ,MACA,eACA,mBAA2C,gBAAc;AAEzD,WAAO,KAAK,OAAO,QAAQ,uBAAuB,eAAe;MAC/D,MAAM;QACJ,MAAM;QACN,OAAO;UACL;UACA;;;KAGL;EACH;;;;;EAMA,MAAM,eAAe,eAAqB;AACxC,WAAO,KAAK,OAAO,OAAO,KAAK,aAAa;EAC9C;;;;;;EAOA,MAAM,YACJ,UACA,eAAqB;AAErB,WAAO,KAAK,OAAO,QAAQ,iBAAiB,eAAe;MACzD,MAAM,EAAE,MAAM,QAAQ,OAAO,EAAE,SAAQ,EAAE;KAC1C;EACH;;",
6
+ "names": []
7
+ }
@@ -0,0 +1,68 @@
1
+ import type { HttpMethod, QueryParams, ApiInvokeResponse } from "../schemas";
2
+ import { BaseResourceClient } from "../base";
3
+ export declare class GoogleSheetsResourceClient extends BaseResourceClient {
4
+ invoke(method: HttpMethod, path: string, invocationKey: string, options?: {
5
+ query?: QueryParams;
6
+ body?: {
7
+ type: "json";
8
+ value: unknown;
9
+ };
10
+ timeoutMs?: number;
11
+ }): Promise<ApiInvokeResponse>;
12
+ /**
13
+ * Get values from a range in the spreadsheet
14
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
15
+ * @param invocationKey Unique key for tracking this invocation
16
+ */
17
+ getValues(range: string, invocationKey: string): Promise<ApiInvokeResponse>;
18
+ /**
19
+ * Update values in a range in the spreadsheet
20
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
21
+ * @param values 2D array of values to write
22
+ * @param invocationKey Unique key for tracking this invocation
23
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
24
+ */
25
+ updateValues(range: string, values: unknown[][], invocationKey: string, valueInputOption?: "RAW" | "USER_ENTERED"): Promise<ApiInvokeResponse>;
26
+ /**
27
+ * Append values to a sheet
28
+ * @param range A1 notation range (e.g., "Sheet1!A1:D1")
29
+ * @param values 2D array of values to append
30
+ * @param invocationKey Unique key for tracking this invocation
31
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
32
+ */
33
+ appendValues(range: string, values: unknown[][], invocationKey: string, valueInputOption?: "RAW" | "USER_ENTERED"): Promise<ApiInvokeResponse>;
34
+ /**
35
+ * Clear values in a range
36
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
37
+ * @param invocationKey Unique key for tracking this invocation
38
+ */
39
+ clearValues(range: string, invocationKey: string): Promise<ApiInvokeResponse>;
40
+ /**
41
+ * Batch get multiple ranges
42
+ * @param ranges Array of A1 notation ranges
43
+ * @param invocationKey Unique key for tracking this invocation
44
+ */
45
+ batchGetValues(ranges: string[], invocationKey: string): Promise<ApiInvokeResponse>;
46
+ /**
47
+ * Batch update multiple ranges
48
+ * @param data Array of range updates
49
+ * @param invocationKey Unique key for tracking this invocation
50
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
51
+ */
52
+ batchUpdateValues(data: Array<{
53
+ range: string;
54
+ values: unknown[][];
55
+ }>, invocationKey: string, valueInputOption?: "RAW" | "USER_ENTERED"): Promise<ApiInvokeResponse>;
56
+ /**
57
+ * Get spreadsheet metadata
58
+ * @param invocationKey Unique key for tracking this invocation
59
+ */
60
+ getSpreadsheet(invocationKey: string): Promise<ApiInvokeResponse>;
61
+ /**
62
+ * Batch update spreadsheet (for formatting, creating sheets, etc.)
63
+ * @param requests Array of update requests
64
+ * @param invocationKey Unique key for tracking this invocation
65
+ */
66
+ batchUpdate(requests: unknown[], invocationKey: string): Promise<ApiInvokeResponse>;
67
+ }
68
+ //# sourceMappingURL=googlesheets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googlesheets.d.ts","sourceRoot":"","sources":["../../src/clients/googlesheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAEX,iBAAiB,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,0BAA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ACxD,OAAO,CAAC,iBAAiB,CAAC;IAY7B;;;OAGG;IACG,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIvE;;;;OAIG;IACG,WAAW,CACf,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC;CAK9B"}
@@ -0,0 +1,102 @@
1
+ import { BaseResourceClient } from "../base";
2
+ export class GoogleSheetsResourceClient extends BaseResourceClient {
3
+ async invoke(method, path, invocationKey, options = {}) {
4
+ const payload = {
5
+ type: "api",
6
+ subtype: "googlesheets",
7
+ method,
8
+ path,
9
+ query: options.query,
10
+ body: options.body,
11
+ timeoutMs: options.timeoutMs || 30000,
12
+ };
13
+ return this.invokeRaw(payload, invocationKey);
14
+ }
15
+ /**
16
+ * Get values from a range in the spreadsheet
17
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
18
+ * @param invocationKey Unique key for tracking this invocation
19
+ */
20
+ async getValues(range, invocationKey) {
21
+ return this.invoke("GET", `/values/${range}`, invocationKey);
22
+ }
23
+ /**
24
+ * Update values in a range in the spreadsheet
25
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
26
+ * @param values 2D array of values to write
27
+ * @param invocationKey Unique key for tracking this invocation
28
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
29
+ */
30
+ async updateValues(range, values, invocationKey, valueInputOption = "USER_ENTERED") {
31
+ return this.invoke("PUT", `/values/${range}`, invocationKey, {
32
+ query: { valueInputOption },
33
+ body: { type: "json", value: { values } },
34
+ });
35
+ }
36
+ /**
37
+ * Append values to a sheet
38
+ * @param range A1 notation range (e.g., "Sheet1!A1:D1")
39
+ * @param values 2D array of values to append
40
+ * @param invocationKey Unique key for tracking this invocation
41
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
42
+ */
43
+ async appendValues(range, values, invocationKey, valueInputOption = "USER_ENTERED") {
44
+ return this.invoke("POST", `/values/${range}:append`, invocationKey, {
45
+ query: { valueInputOption },
46
+ body: { type: "json", value: { values } },
47
+ });
48
+ }
49
+ /**
50
+ * Clear values in a range
51
+ * @param range A1 notation range (e.g., "Sheet1!A1:D5")
52
+ * @param invocationKey Unique key for tracking this invocation
53
+ */
54
+ async clearValues(range, invocationKey) {
55
+ return this.invoke("POST", `/values/${range}:clear`, invocationKey);
56
+ }
57
+ /**
58
+ * Batch get multiple ranges
59
+ * @param ranges Array of A1 notation ranges
60
+ * @param invocationKey Unique key for tracking this invocation
61
+ */
62
+ async batchGetValues(ranges, invocationKey) {
63
+ return this.invoke("GET", "/values:batchGet", invocationKey, {
64
+ query: { ranges },
65
+ });
66
+ }
67
+ /**
68
+ * Batch update multiple ranges
69
+ * @param data Array of range updates
70
+ * @param invocationKey Unique key for tracking this invocation
71
+ * @param valueInputOption How to interpret input values ("RAW" or "USER_ENTERED")
72
+ */
73
+ async batchUpdateValues(data, invocationKey, valueInputOption = "USER_ENTERED") {
74
+ return this.invoke("POST", "/values:batchUpdate", invocationKey, {
75
+ body: {
76
+ type: "json",
77
+ value: {
78
+ valueInputOption,
79
+ data,
80
+ },
81
+ },
82
+ });
83
+ }
84
+ /**
85
+ * Get spreadsheet metadata
86
+ * @param invocationKey Unique key for tracking this invocation
87
+ */
88
+ async getSpreadsheet(invocationKey) {
89
+ return this.invoke("GET", "/", invocationKey);
90
+ }
91
+ /**
92
+ * Batch update spreadsheet (for formatting, creating sheets, etc.)
93
+ * @param requests Array of update requests
94
+ * @param invocationKey Unique key for tracking this invocation
95
+ */
96
+ async batchUpdate(requests, invocationKey) {
97
+ return this.invoke("POST", "/:batchUpdate", invocationKey, {
98
+ body: { type: "json", value: { requests } },
99
+ });
100
+ }
101
+ }
102
+ //# sourceMappingURL=googlesheets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googlesheets.js","sourceRoot":"","sources":["../../src/clients/googlesheets.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAk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EAAE,MAAM,EAAE,EAAE;SAC1C,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CACf,KAAa,EACb,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,KAAK,QAAQ,EAAE,aAAa,CAAC,CAAC;IACtE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,cAAc,CAClB,MAAgB,EAChB,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE;YAC3D,KAAK,EAAE,EAAE,MAAM,EAAE;SAClB,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CACrB,IAAmD,EACnD,aAAqB,EACrB,mBAA2C,cAAc;QAEzD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,EAAE,aAAa,EAAE;YAC/D,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE;oBACL,gBAAgB;oBAChB,IAAI;iBACL;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,aAAqB;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CACf,QAAmB,EACnB,aAAqB;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE;YACzD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF"}
package/dist/index.cjs CHANGED
@@ -22,6 +22,7 @@ __export(index_exports, {
22
22
  BaseResourceClient: () => import_base.BaseResourceClient,
23
23
  CustomApiResourceClient: () => import_api_custom.CustomApiResourceClient,
24
24
  DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
25
+ GoogleSheetsResourceClient: () => import_googlesheets.GoogleSheetsResourceClient,
25
26
  HubSpotResourceClient: () => import_hubspot.HubSpotResourceClient,
26
27
  PostgresResourceClient: () => import_postgres.PostgresResourceClient,
27
28
  ResourceInvokeError: () => import_errors.ResourceInvokeError,
@@ -35,5 +36,6 @@ var import_postgres = require("./clients/postgres");
35
36
  var import_dynamodb = require("./clients/dynamodb");
36
37
  var import_api_custom = require("./clients/api-custom");
37
38
  var import_hubspot = require("./clients/hubspot");
39
+ var import_googlesheets = require("./clients/googlesheets");
38
40
  var import_s3 = require("./clients/s3");
39
41
  //# sourceMappingURL=index.cjs.map
@@ -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 { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,sBAAuC;AACvC,wBAAwC;AACxC,qBAAsC;AACtC,gBAAiC;",
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 { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,sBAAuC;AACvC,wBAAwC;AACxC,qBAAsC;AACtC,0BAA2C;AAC3C,gBAAiC;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { PostgresResourceClient } from "./clients/postgres";
5
5
  export { DynamoDBResourceClient } from "./clients/dynamodb";
6
6
  export { CustomApiResourceClient } from "./clients/api-custom";
7
7
  export { HubSpotResourceClient } from "./clients/hubspot";
8
+ export { GoogleSheetsResourceClient } from "./clients/googlesheets";
8
9
  export { S3ResourceClient } from "./clients/s3";
9
10
  export type { DatabaseInvokeResponse, DynamoDBInvokeResponse, ApiInvokeResponse, StorageInvokeResponse, BaseInvokeSuccess, } from "./schemas/response";
10
11
  //# 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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -9,5 +9,6 @@ export { PostgresResourceClient } from "./clients/postgres";
9
9
  export { DynamoDBResourceClient } from "./clients/dynamodb";
10
10
  export { CustomApiResourceClient } from "./clients/api-custom";
11
11
  export { HubSpotResourceClient } from "./clients/hubspot";
12
+ export { GoogleSheetsResourceClient } from "./clients/googlesheets";
12
13
  export { S3ResourceClient } from "./clients/s3";
13
14
  //# 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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
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,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,17 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var api_googlesheets_exports = {};
16
+ module.exports = __toCommonJS(api_googlesheets_exports);
17
+ //# sourceMappingURL=api-googlesheets.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["api-googlesheets.js"],
4
+ "sourcesContent": ["export {};\n//# sourceMappingURL=api-googlesheets.js.map"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import type { JsonBody, HttpMethod, QueryParams } from "./common";
2
+ /**
3
+ * Payload for invoking a Google Sheets API resource
4
+ * Note: Google Sheets authentication is handled automatically by the API
5
+ * The resource is bound to a specific spreadsheet (stored in resourceMeta)
6
+ */
7
+ export interface ApiGoogleSheetsPayload {
8
+ type: "api";
9
+ subtype: "googlesheets";
10
+ /** HTTP method to use */
11
+ method: HttpMethod;
12
+ /**
13
+ * Google Sheets API path relative to the spreadsheet
14
+ * Examples:
15
+ * - "/values/{range}" - Get/update cell values (e.g., "/values/Sheet1!A1:D5")
16
+ * - "/values:batchGet" - Get multiple ranges
17
+ * - "/values:batchUpdate" - Update multiple ranges
18
+ * - "/values:append" - Append values
19
+ * - "/values:clear" - Clear values
20
+ * - "/:batchUpdate" - Update spreadsheet properties, formatting, etc.
21
+ * - "" or "/" - Get spreadsheet metadata
22
+ */
23
+ path: string;
24
+ /** Optional query parameters */
25
+ query?: QueryParams;
26
+ /** Optional JSON body (Google Sheets uses JSON) */
27
+ body?: JsonBody;
28
+ /** Optional timeout in milliseconds (default: 30000) */
29
+ timeoutMs?: number;
30
+ }
31
+ //# sourceMappingURL=api-googlesheets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-googlesheets.d.ts","sourceRoot":"","sources":["../../src/schemas/api-googlesheets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,cAAc,CAAC;IACxB,yBAAyB;IACzB,MAAM,EAAE,UAAU,CAAC;IACnB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,mDAAmD;IACnD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=api-googlesheets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-googlesheets.js","sourceRoot":"","sources":["../../src/schemas/api-googlesheets.ts"],"names":[],"mappings":""}
@@ -21,6 +21,7 @@ __reExport(index_exports, require("./dynamodb"), module.exports);
21
21
  __reExport(index_exports, require("./s3"), module.exports);
22
22
  __reExport(index_exports, require("./api-custom"), module.exports);
23
23
  __reExport(index_exports, require("./api-hubspot"), module.exports);
24
+ __reExport(index_exports, require("./api-googlesheets"), module.exports);
24
25
  __reExport(index_exports, require("./request"), module.exports);
25
26
  __reExport(index_exports, require("./response"), module.exports);
26
27
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/schemas/index.ts"],
4
- "sourcesContent": ["// Re-export all types\nexport * from \"./common\";\nexport * from \"./postgres\";\nexport * from \"./dynamodb\";\nexport * from \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\nexport * from \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\nimport type { DbPostgresPayload } from \"./postgres\";\nimport type { DbDynamoDBPayload } from \"./dynamodb\";\nimport type { StorageS3Payload } from \"./s3\";\n\n/**\n * Discriminated union of all resource payload types\n * Use the 'subtype' field to narrow the type\n */\nexport type ResourceInvokePayload =\n | ApiCustomPayload\n | DbPostgresPayload\n | DbDynamoDBPayload\n | ApiHubSpotPayload\n | StorageS3Payload;\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,iBAJd;AAKA,0BAAc,yBALd;AAMA,0BAAc,0BANd;AAOA,0BAAc,sBAPd;AAQA,0BAAc,uBARd;",
4
+ "sourcesContent": ["// Re-export all types\nexport * from \"./common\";\nexport * from \"./postgres\";\nexport * from \"./dynamodb\";\nexport * from \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\nexport * from \"./api-googlesheets\";\nexport * from \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\nimport type { ApiGoogleSheetsPayload } from \"./api-googlesheets\";\nimport type { DbPostgresPayload } from \"./postgres\";\nimport type { DbDynamoDBPayload } from \"./dynamodb\";\nimport type { StorageS3Payload } from \"./s3\";\n\n/**\n * Discriminated union of all resource payload types\n * Use the 'subtype' field to narrow the type\n */\nexport type ResourceInvokePayload =\n | ApiCustomPayload\n | DbPostgresPayload\n | DbDynamoDBPayload\n | ApiHubSpotPayload\n | ApiGoogleSheetsPayload\n | StorageS3Payload;\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,iBAJd;AAKA,0BAAc,yBALd;AAMA,0BAAc,0BANd;AAOA,0BAAc,+BAPd;AAQA,0BAAc,sBARd;AASA,0BAAc,uBATd;",
6
6
  "names": []
7
7
  }
@@ -4,10 +4,12 @@ export * from "./dynamodb";
4
4
  export * from "./s3";
5
5
  export * from "./api-custom";
6
6
  export * from "./api-hubspot";
7
+ export * from "./api-googlesheets";
7
8
  export * from "./request";
8
9
  export * from "./response";
9
10
  import type { ApiCustomPayload } from "./api-custom";
10
11
  import type { ApiHubSpotPayload } from "./api-hubspot";
12
+ import type { ApiGoogleSheetsPayload } from "./api-googlesheets";
11
13
  import type { DbPostgresPayload } from "./postgres";
12
14
  import type { DbDynamoDBPayload } from "./dynamodb";
13
15
  import type { StorageS3Payload } from "./s3";
@@ -15,5 +17,5 @@ import type { StorageS3Payload } from "./s3";
15
17
  * Discriminated union of all resource payload types
16
18
  * Use the 'subtype' field to narrow the type
17
19
  */
18
- export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | ApiHubSpotPayload | StorageS3Payload;
20
+ export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
19
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAA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5
  export * from "./s3";
6
6
  export * from "./api-custom";
7
7
  export * from "./api-hubspot";
8
+ export * from "./api-googlesheets";
8
9
  export * from "./request";
9
10
  export * from "./response";
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ResourceInvokePayload } from "./";
1
+ import type { ResourceInvokePayload } from ".";
2
2
  /**
3
3
  * Request envelope for resource invocation
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/schemas/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,OAAO,EAAE,qBAAqB,CAAC;IAC/B;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB"}
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/schemas/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,OAAO,EAAE,qBAAqB,CAAC;IAC/B;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@major-tech/resource-client",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "TypeScript client library for invoking Major resources (PostgreSQL, Custom APIs, HubSpot, S3)",
5
5
  "type": "module",
6
6
  "sideEffects": false,