@squadbase/connectors 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.d.ts CHANGED
@@ -34,7 +34,7 @@ interface KintoneConnectorSdk {
34
34
  * @param params - Resolved parameter values keyed by parameter slug
35
35
  * ("base-url", "username", "password")
36
36
  */
37
- declare function createClient$1(params: Record<string, string>): KintoneConnectorSdk;
37
+ declare function createClient$5(params: Record<string, string>): KintoneConnectorSdk;
38
38
 
39
39
  interface OpenAIConnectorSdk {
40
40
  apiKey: string;
@@ -44,6 +44,346 @@ interface OpenAIConnectorSdk {
44
44
  *
45
45
  * @param params - Resolved parameter values keyed by parameter slug ("api-key")
46
46
  */
47
- declare function createClient(params: Record<string, string>): OpenAIConnectorSdk;
47
+ declare function createClient$4(params: Record<string, string>): OpenAIConnectorSdk;
48
48
 
49
- export { type KintoneConnectorSdk, type OpenAIConnectorSdk, createClient$1 as kintone, createClient as openai };
49
+ /** Shape returned by the Airtable API for a single record. */
50
+ interface AirtableRecord {
51
+ id: string;
52
+ createdTime: string;
53
+ fields: Record<string, unknown>;
54
+ }
55
+ interface AirtableConnectorSdk {
56
+ /**
57
+ * Send an authenticated request to the Airtable REST API.
58
+ * Interface matches `fetch` — only auth headers and base URL are added automatically.
59
+ *
60
+ * The placeholder `{baseId}` in the path is automatically replaced with the
61
+ * configured Base ID.
62
+ *
63
+ * @param path - API path (e.g., "/{baseId}/TableName")
64
+ * @param init - Standard RequestInit (same as fetch)
65
+ * @returns Standard Response (same as fetch)
66
+ */
67
+ request(path: string, init?: RequestInit): Promise<Response>;
68
+ /**
69
+ * List records in a table.
70
+ *
71
+ * @see https://airtable.com/developers/web/api/list-records
72
+ */
73
+ listRecords(tableIdOrName: string, options?: {
74
+ fields?: string[];
75
+ filterByFormula?: string;
76
+ maxRecords?: number;
77
+ sort?: {
78
+ field: string;
79
+ direction?: "asc" | "desc";
80
+ }[];
81
+ pageSize?: number;
82
+ view?: string;
83
+ offset?: string;
84
+ }): Promise<{
85
+ records: AirtableRecord[];
86
+ offset?: string;
87
+ }>;
88
+ /**
89
+ * Get a single record by ID.
90
+ *
91
+ * @see https://airtable.com/developers/web/api/get-record
92
+ */
93
+ getRecord(tableIdOrName: string, recordId: string): Promise<AirtableRecord>;
94
+ /**
95
+ * Create one or more records (max 10 per request).
96
+ *
97
+ * @see https://airtable.com/developers/web/api/create-records
98
+ */
99
+ createRecords(tableIdOrName: string, records: {
100
+ fields: Record<string, unknown>;
101
+ }[], options?: {
102
+ typecast?: boolean;
103
+ }): Promise<{
104
+ records: AirtableRecord[];
105
+ }>;
106
+ /**
107
+ * Update one or more records via PATCH (partial update, max 10 per request).
108
+ *
109
+ * @see https://airtable.com/developers/web/api/update-multiple-records
110
+ */
111
+ updateRecords(tableIdOrName: string, records: {
112
+ id: string;
113
+ fields: Record<string, unknown>;
114
+ }[], options?: {
115
+ typecast?: boolean;
116
+ }): Promise<{
117
+ records: AirtableRecord[];
118
+ }>;
119
+ /**
120
+ * List tables in the base (Meta API).
121
+ *
122
+ * @see https://airtable.com/developers/web/api/get-base-schema
123
+ */
124
+ listTables(): Promise<{
125
+ tables: Record<string, unknown>[];
126
+ }>;
127
+ }
128
+ /**
129
+ * Create an Airtable client from resolved connection parameters.
130
+ *
131
+ * @param params - Resolved parameter values keyed by parameter slug
132
+ * ("base-id", "api-key")
133
+ */
134
+ declare function createClient$3(params: Record<string, string>): AirtableConnectorSdk;
135
+
136
+ interface GoogleAnalyticsConnectorSdk {
137
+ /**
138
+ * Send an authenticated request to the Google Analytics Data API.
139
+ * Interface matches `fetch` — only auth headers and base URL are added automatically.
140
+ *
141
+ * Base URL: https://analyticsdata.googleapis.com/v1beta/
142
+ * Occurrences of `{propertyId}` in the path are auto-replaced with the configured property ID.
143
+ *
144
+ * @param path - API path (e.g., "properties/{propertyId}:runReport")
145
+ * @param init - Standard RequestInit (same as fetch)
146
+ * @returns Standard Response (same as fetch)
147
+ */
148
+ request(path: string, init?: RequestInit): Promise<Response>;
149
+ /**
150
+ * Run a GA4 report.
151
+ *
152
+ * @see https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runReport
153
+ */
154
+ runReport(request: {
155
+ dateRanges: {
156
+ startDate: string;
157
+ endDate: string;
158
+ }[];
159
+ dimensions?: {
160
+ name: string;
161
+ }[];
162
+ metrics: {
163
+ name: string;
164
+ }[];
165
+ limit?: number;
166
+ offset?: number;
167
+ dimensionFilter?: Record<string, unknown>;
168
+ metricFilter?: Record<string, unknown>;
169
+ orderBys?: Record<string, unknown>[];
170
+ }): Promise<{
171
+ rows: {
172
+ dimensionValues: {
173
+ value: string;
174
+ }[];
175
+ metricValues: {
176
+ value: string;
177
+ }[];
178
+ }[];
179
+ rowCount: number;
180
+ }>;
181
+ /**
182
+ * Get available dimensions and metrics for a property.
183
+ *
184
+ * @see https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata
185
+ */
186
+ getMetadata(): Promise<{
187
+ name: string;
188
+ dimensions: {
189
+ apiName: string;
190
+ uiName: string;
191
+ description: string;
192
+ [key: string]: unknown;
193
+ }[];
194
+ metrics: {
195
+ apiName: string;
196
+ uiName: string;
197
+ description: string;
198
+ type: string;
199
+ [key: string]: unknown;
200
+ }[];
201
+ }>;
202
+ /**
203
+ * Run a realtime report.
204
+ *
205
+ * @see https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runRealtimeReport
206
+ */
207
+ runRealtimeReport(request: {
208
+ dimensions?: {
209
+ name: string;
210
+ }[];
211
+ metrics: {
212
+ name: string;
213
+ }[];
214
+ limit?: number;
215
+ dimensionFilter?: Record<string, unknown>;
216
+ metricFilter?: Record<string, unknown>;
217
+ minuteRanges?: {
218
+ startMinutesAgo?: number;
219
+ endMinutesAgo?: number;
220
+ name?: string;
221
+ }[];
222
+ }): Promise<{
223
+ rows: {
224
+ dimensionValues: {
225
+ value: string;
226
+ }[];
227
+ metricValues: {
228
+ value: string;
229
+ }[];
230
+ }[];
231
+ rowCount: number;
232
+ }>;
233
+ }
234
+ /**
235
+ * Create a Google Analytics client from resolved connection parameters.
236
+ *
237
+ * @param params - Resolved parameter values keyed by parameter slug
238
+ * ("service-account-key-json-base64", "property-id")
239
+ */
240
+ declare function createClient$2(params: Record<string, string>): GoogleAnalyticsConnectorSdk;
241
+
242
+ interface WixStoreConnectorSdk {
243
+ /**
244
+ * Send an authenticated request to the Wix REST API.
245
+ * Interface matches `fetch` — only auth headers and base URL are added automatically.
246
+ *
247
+ * @param path - API path (e.g., "/stores/v1/products/query")
248
+ * @param init - Standard RequestInit (same as fetch)
249
+ * @returns Standard Response (same as fetch)
250
+ */
251
+ request(path: string, init?: RequestInit): Promise<Response>;
252
+ /**
253
+ * Query products via POST /stores/v1/products/query.
254
+ */
255
+ queryProducts(options?: {
256
+ filter?: Record<string, unknown>;
257
+ sort?: Record<string, unknown>;
258
+ paging?: {
259
+ limit?: number;
260
+ offset?: number;
261
+ };
262
+ }): Promise<{
263
+ products: Record<string, unknown>[];
264
+ totalResults: number;
265
+ }>;
266
+ /**
267
+ * Get a single product by ID via GET /stores/v1/products/{productId}.
268
+ */
269
+ getProduct(productId: string): Promise<{
270
+ product: Record<string, unknown>;
271
+ }>;
272
+ /**
273
+ * Search orders via POST /ecom/v1/orders/search (eCommerce Orders V1).
274
+ * Uses cursor-based pagination.
275
+ */
276
+ queryOrders(options?: {
277
+ filter?: Record<string, unknown>;
278
+ sort?: Record<string, unknown>;
279
+ cursorPaging?: {
280
+ limit?: number;
281
+ cursor?: string;
282
+ };
283
+ }): Promise<{
284
+ orders: Record<string, unknown>[];
285
+ pagingMetadata?: {
286
+ cursors?: {
287
+ next?: string;
288
+ prev?: string;
289
+ };
290
+ };
291
+ }>;
292
+ /**
293
+ * Get a single order by ID via GET /ecom/v1/orders/{orderId}.
294
+ */
295
+ getOrder(orderId: string): Promise<{
296
+ order: Record<string, unknown>;
297
+ }>;
298
+ /**
299
+ * Query collections via POST /stores/v1/collections/query.
300
+ */
301
+ queryCollections(options?: {
302
+ filter?: Record<string, unknown>;
303
+ sort?: Record<string, unknown>;
304
+ paging?: {
305
+ limit?: number;
306
+ offset?: number;
307
+ };
308
+ }): Promise<{
309
+ collections: Record<string, unknown>[];
310
+ }>;
311
+ /**
312
+ * Query inventory items via POST /stores/v2/inventoryItems/query.
313
+ */
314
+ queryInventory(options?: {
315
+ filter?: Record<string, unknown>;
316
+ paging?: {
317
+ limit?: number;
318
+ offset?: number;
319
+ };
320
+ }): Promise<{
321
+ inventoryItems: Record<string, unknown>[];
322
+ totalResults: number;
323
+ }>;
324
+ }
325
+ /**
326
+ * Create a Wix Store client from resolved connection parameters.
327
+ *
328
+ * @param params - Resolved parameter values keyed by parameter slug
329
+ * ("account-id", "site-id", "api-key")
330
+ */
331
+ declare function createClient$1(params: Record<string, string>): WixStoreConnectorSdk;
332
+
333
+ interface DbtConnectorSdk {
334
+ /**
335
+ * Send an authenticated request to the dbt Cloud API.
336
+ * Interface matches `fetch` — only auth headers and base URL are added automatically.
337
+ * Any `{environmentId}` placeholder in the path is replaced with the production environment ID.
338
+ *
339
+ * @param path - API path (e.g., "/api/v2/accounts/...")
340
+ * @param init - Standard RequestInit (same as fetch)
341
+ * @returns Standard Response (same as fetch)
342
+ */
343
+ request(path: string, init?: RequestInit): Promise<Response>;
344
+ /**
345
+ * Execute a raw GraphQL query against the dbt Cloud Discovery API.
346
+ * The `environmentId` variable is auto-injected.
347
+ *
348
+ * @param graphqlQuery - GraphQL query string
349
+ * @param variables - Additional GraphQL variables (environmentId is merged automatically)
350
+ */
351
+ query(graphqlQuery: string, variables?: Record<string, unknown>): Promise<Record<string, unknown>>;
352
+ /**
353
+ * List models in the production environment.
354
+ */
355
+ getModels(options?: {
356
+ limit?: number;
357
+ }): Promise<Record<string, unknown>[]>;
358
+ /**
359
+ * Get a specific model by its uniqueId, including catalog columns.
360
+ */
361
+ getModelByUniqueId(uniqueId: string): Promise<Record<string, unknown> | null>;
362
+ /**
363
+ * List sources in the production environment, including freshness info.
364
+ */
365
+ getSources(options?: {
366
+ limit?: number;
367
+ }): Promise<Record<string, unknown>[]>;
368
+ /**
369
+ * List tests and their results in the production environment.
370
+ */
371
+ getTests(options?: {
372
+ limit?: number;
373
+ }): Promise<Record<string, unknown>[]>;
374
+ /**
375
+ * List metrics defined in the project (from definition state).
376
+ */
377
+ getMetrics(options?: {
378
+ limit?: number;
379
+ }): Promise<Record<string, unknown>[]>;
380
+ }
381
+ /**
382
+ * Create a dbt Cloud client from resolved connection parameters.
383
+ *
384
+ * @param params - Resolved parameter values keyed by parameter slug
385
+ * ("host", "account-id", "prod-env-id", "token")
386
+ */
387
+ declare function createClient(params: Record<string, string>): DbtConnectorSdk;
388
+
389
+ export { type AirtableConnectorSdk, type DbtConnectorSdk, type GoogleAnalyticsConnectorSdk, type KintoneConnectorSdk, type OpenAIConnectorSdk, type WixStoreConnectorSdk, createClient$3 as airtable, createClient as dbt, createClient$2 as googleAnalytics, createClient$5 as kintone, createClient$4 as openai, createClient$1 as wixStore };