postgrid-node 0.1.0-alpha.1 → 0.1.0-alpha.3

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +3 -3
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +12 -1
  7. package/core.d.ts.map +1 -1
  8. package/core.js +10 -7
  9. package/core.js.map +1 -1
  10. package/core.mjs +11 -8
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +2 -2
  13. package/index.d.ts +2 -2
  14. package/index.d.ts.map +1 -1
  15. package/index.js.map +1 -1
  16. package/index.mjs.map +1 -1
  17. package/package.json +8 -29
  18. package/resources/campaigns.d.ts +1 -1
  19. package/resources/campaigns.d.ts.map +1 -1
  20. package/resources/cheques.d.ts +2 -0
  21. package/resources/cheques.d.ts.map +1 -0
  22. package/resources/cheques.js +19 -0
  23. package/resources/cheques.js.map +1 -0
  24. package/resources/cheques.mjs +3 -0
  25. package/resources/cheques.mjs.map +1 -0
  26. package/resources/index.d.ts +1 -1
  27. package/resources/index.d.ts.map +1 -1
  28. package/resources/index.js.map +1 -1
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/reports/index.d.ts +1 -2
  31. package/resources/reports/index.d.ts.map +1 -1
  32. package/resources/reports/index.js +1 -3
  33. package/resources/reports/index.js.map +1 -1
  34. package/resources/reports/index.mjs +0 -1
  35. package/resources/reports/index.mjs.map +1 -1
  36. package/resources/reports/reports.d.ts +74 -5
  37. package/resources/reports/reports.d.ts.map +1 -1
  38. package/resources/reports/reports.js +17 -4
  39. package/resources/reports/reports.js.map +1 -1
  40. package/resources/reports/reports.mjs +17 -4
  41. package/resources/reports/reports.mjs.map +1 -1
  42. package/resources/reports.d.ts +2 -0
  43. package/resources/reports.d.ts.map +1 -0
  44. package/resources/reports.js +19 -0
  45. package/resources/reports.js.map +1 -0
  46. package/resources/reports.mjs +3 -0
  47. package/resources/reports.mjs.map +1 -0
  48. package/resources.d.ts +2 -0
  49. package/resources.d.ts.map +1 -0
  50. package/resources.js +18 -0
  51. package/resources.js.map +1 -0
  52. package/resources.mjs +2 -0
  53. package/resources.mjs.map +1 -0
  54. package/src/_shims/index.d.ts +2 -0
  55. package/src/_shims/index.js +5 -1
  56. package/src/_shims/index.mjs +5 -1
  57. package/src/core.ts +27 -8
  58. package/src/index.ts +8 -0
  59. package/src/resources/campaigns.ts +1 -1
  60. package/src/resources/cheques.ts +3 -0
  61. package/src/resources/index.ts +4 -0
  62. package/src/resources/reports/index.ts +4 -7
  63. package/src/resources/reports/reports.ts +101 -18
  64. package/src/resources/reports.ts +3 -0
  65. package/src/resources.ts +1 -0
  66. package/src/version.ts +1 -1
  67. package/version.d.ts +1 -1
  68. package/version.js +1 -1
  69. package/version.mjs +1 -1
  70. package/resources/reports/samples.d.ts +0 -81
  71. package/resources/reports/samples.d.ts.map +0 -1
  72. package/resources/reports/samples.js +0 -26
  73. package/resources/reports/samples.js.map +0 -1
  74. package/resources/reports/samples.mjs +0 -22
  75. package/resources/reports/samples.mjs.map +0 -1
  76. package/src/resources/reports/samples.ts +0 -109
package/resources.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./resources/index.js"), exports);
18
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAkC"}
package/resources.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./resources/index.mjs";
2
+ //# sourceMappingURL=resources.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
@@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi
79
79
  export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
80
80
 
81
81
  export function isFsReadStream(value: any): value is FsReadStream;
82
+
83
+ export const init: () => void;
@@ -3,7 +3,9 @@
3
3
  */
4
4
  const shims = require('./registry');
5
5
  const auto = require('postgrid-node/_shims/auto/runtime');
6
- if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
6
+ exports.init = () => {
7
+ if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
8
+ };
7
9
  for (const property of Object.keys(shims)) {
8
10
  Object.defineProperty(exports, property, {
9
11
  get() {
@@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) {
11
13
  },
12
14
  });
13
15
  }
16
+
17
+ exports.init();
@@ -3,5 +3,9 @@
3
3
  */
4
4
  import * as shims from './registry.mjs';
5
5
  import * as auto from "./auto/runtime";
6
- if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
6
+ export const init = () => {
7
+ if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
8
+ };
7
9
  export * from './registry.mjs';
10
+
11
+ init();
package/src/core.ts CHANGED
@@ -16,7 +16,12 @@ import {
16
16
  type RequestInit,
17
17
  type Response,
18
18
  type HeadersInit,
19
+ init,
19
20
  } from './_shims/index';
21
+
22
+ // try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881
23
+ init();
24
+
20
25
  export { type Response };
21
26
  import { BlobLike, isBlobLike, isMultipartBody } from './uploads';
22
27
  export {
@@ -28,6 +33,20 @@ export {
28
33
 
29
34
  export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
30
35
 
36
+ /**
37
+ * An alias to the builtin `Array` type so we can
38
+ * easily alias it in import statements if there are name clashes.
39
+ */
40
+ type _Array<T> = Array<T>;
41
+
42
+ /**
43
+ * An alias to the builtin `Record` type so we can
44
+ * easily alias it in import statements if there are name clashes.
45
+ */
46
+ type _Record<K extends keyof any, T> = Record<K, T>;
47
+
48
+ export type { _Array as Array, _Record as Record };
49
+
31
50
  type PromiseOrValue<T> = T | Promise<T>;
32
51
 
33
52
  type APIResponseProps = {
@@ -48,8 +67,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
48
67
  }
49
68
 
50
69
  const contentType = response.headers.get('content-type');
51
- const isJSON =
52
- contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
70
+ const mediaType = contentType?.split(';')[0]?.trim();
71
+ const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
53
72
  if (isJSON) {
54
73
  const json = await response.json();
55
74
 
@@ -277,10 +296,10 @@ export abstract class APIClient {
277
296
  }
278
297
 
279
298
  buildRequest<Req>(
280
- options: FinalRequestOptions<Req>,
299
+ inputOptions: FinalRequestOptions<Req>,
281
300
  { retryCount = 0 }: { retryCount?: number } = {},
282
301
  ): { req: RequestInit; url: string; timeout: number } {
283
- options = { ...options };
302
+ const options = { ...inputOptions };
284
303
  const { method, path, query, headers: headers = {} } = options;
285
304
 
286
305
  const body =
@@ -308,8 +327,8 @@ export abstract class APIClient {
308
327
  }
309
328
 
310
329
  if (this.idempotencyHeader && method !== 'get') {
311
- if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
312
- headers[this.idempotencyHeader] = options.idempotencyKey;
330
+ if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
331
+ headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
313
332
  }
314
333
 
315
334
  const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
@@ -366,7 +385,7 @@ export abstract class APIClient {
366
385
  getHeader(headers, 'x-stainless-timeout') === undefined &&
367
386
  options.timeout
368
387
  ) {
369
- reqHeaders['x-stainless-timeout'] = String(options.timeout);
388
+ reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
370
389
  }
371
390
 
372
391
  this.validateHeaders(reqHeaders, headers);
@@ -395,7 +414,7 @@ export abstract class APIClient {
395
414
  !headers ? {}
396
415
  : Symbol.iterator in headers ?
397
416
  Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
398
- : { ...headers }
417
+ : { ...(headers as any as Record<string, string>) }
399
418
  );
400
419
  }
401
420
 
package/src/index.ts CHANGED
@@ -102,6 +102,10 @@ import {
102
102
  ReportListResponse,
103
103
  ReportListResponsesList,
104
104
  ReportRetrieveResponse,
105
+ ReportRunAdHocQueryParams,
106
+ ReportRunAdHocQueryResponse,
107
+ ReportSampleParams,
108
+ ReportSampleResponse,
105
109
  ReportUpdateParams,
106
110
  ReportUpdateResponse,
107
111
  Reports,
@@ -386,10 +390,14 @@ export declare namespace PostGrid {
386
390
  type ReportUpdateResponse as ReportUpdateResponse,
387
391
  type ReportListResponse as ReportListResponse,
388
392
  type ReportDeleteResponse as ReportDeleteResponse,
393
+ type ReportRunAdHocQueryResponse as ReportRunAdHocQueryResponse,
394
+ type ReportSampleResponse as ReportSampleResponse,
389
395
  ReportListResponsesList as ReportListResponsesList,
390
396
  type ReportCreateParams as ReportCreateParams,
391
397
  type ReportUpdateParams as ReportUpdateParams,
392
398
  type ReportListParams as ReportListParams,
399
+ type ReportRunAdHocQueryParams as ReportRunAdHocQueryParams,
400
+ type ReportSampleParams as ReportSampleParams,
393
401
  };
394
402
 
395
403
  export {
@@ -831,7 +831,7 @@ export interface CampaignSendParams {
831
831
  * The date and time the campaign should be sent. Must be in the future. If
832
832
  * omitted, defaults to the earliest possible processing date.
833
833
  */
834
- sendDate?: string | string;
834
+ sendDate?: (string & {}) | string;
835
835
  }
836
836
 
837
837
  Campaigns.CampaignListResponsesList = CampaignListResponsesList;
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './cheques/index';
@@ -76,9 +76,13 @@ export {
76
76
  type ReportUpdateResponse,
77
77
  type ReportListResponse,
78
78
  type ReportDeleteResponse,
79
+ type ReportRunAdHocQueryResponse,
80
+ type ReportSampleResponse,
79
81
  type ReportCreateParams,
80
82
  type ReportUpdateParams,
81
83
  type ReportListParams,
84
+ type ReportRunAdHocQueryParams,
85
+ type ReportSampleParams,
82
86
  } from './reports/reports';
83
87
  export {
84
88
  SelfMailerListResponsesList,
@@ -15,14 +15,11 @@ export {
15
15
  type ReportUpdateResponse,
16
16
  type ReportListResponse,
17
17
  type ReportDeleteResponse,
18
+ type ReportRunAdHocQueryResponse,
19
+ type ReportSampleResponse,
18
20
  type ReportCreateParams,
19
21
  type ReportUpdateParams,
20
22
  type ReportListParams,
23
+ type ReportRunAdHocQueryParams,
24
+ type ReportSampleParams,
21
25
  } from './reports';
22
- export {
23
- Samples,
24
- type SampleRunResponse,
25
- type SampleSampleResponse,
26
- type SampleRunParams,
27
- type SampleSampleParams,
28
- } from './samples';
@@ -11,18 +11,9 @@ import {
11
11
  ExportRetrieveResponse,
12
12
  Exports,
13
13
  } from './exports';
14
- import * as SamplesAPI from './samples';
15
- import {
16
- SampleRunParams,
17
- SampleRunResponse,
18
- SampleSampleParams,
19
- SampleSampleResponse,
20
- Samples,
21
- } from './samples';
22
14
  import { List, type ListParams } from '../../pagination';
23
15
 
24
16
  export class Reports extends APIResource {
25
- samples: SamplesAPI.Samples = new SamplesAPI.Samples(this._client);
26
17
  exports: ExportsAPI.Exports = new ExportsAPI.Exports(this._client);
27
18
 
28
19
  /**
@@ -80,6 +71,32 @@ export class Reports extends APIResource {
80
71
  delete(id: string, options?: Core.RequestOptions): Core.APIPromise<ReportDeleteResponse> {
81
72
  return this._client.delete(`/reports/${id}`, options);
82
73
  }
74
+
75
+ /**
76
+ * Run an ad-hoc SQL query against your data lake and get a sample of the results.
77
+ * This is useful for quickly testing queries without saving them as a report. The
78
+ * query execution time and result size are limited.
79
+ */
80
+ runAdHocQuery(
81
+ body: ReportRunAdHocQueryParams,
82
+ options?: Core.RequestOptions,
83
+ ): Core.APIPromise<ReportRunAdHocQueryResponse> {
84
+ return this._client.post('/reports/samples', { body, ...options });
85
+ }
86
+
87
+ /**
88
+ * Run the query associated with a saved report and get a sample of the results.
89
+ * This allows getting up to 1000 rows of resutls but the runtime of the query is
90
+ * limited to 30 seconds. If you need more rows or longer runtime, you should
91
+ * create an export from this report.
92
+ */
93
+ sample(
94
+ id: string,
95
+ body: ReportSampleParams,
96
+ options?: Core.RequestOptions,
97
+ ): Core.APIPromise<ReportSampleResponse> {
98
+ return this._client.post(`/reports/${id}/samples`, { body, ...options });
99
+ }
83
100
  }
84
101
 
85
102
  export class ReportListResponsesList extends List<ReportListResponse> {}
@@ -279,6 +296,46 @@ export interface ReportDeleteResponse {
279
296
  deleted: true;
280
297
  }
281
298
 
299
+ /**
300
+ * Represents the result of a report sample query.
301
+ */
302
+ export interface ReportRunAdHocQueryResponse {
303
+ /**
304
+ * Unique identifier for the sample query result.
305
+ */
306
+ id: string;
307
+
308
+ /**
309
+ * The actual data records returned by the sample query.
310
+ */
311
+ records: Array<Record<string, unknown>>;
312
+
313
+ /**
314
+ * The ID of the report this sample was generated from, or null for ad-hoc samples.
315
+ */
316
+ report: string | null;
317
+ }
318
+
319
+ /**
320
+ * Represents the result of a report sample query.
321
+ */
322
+ export interface ReportSampleResponse {
323
+ /**
324
+ * Unique identifier for the sample query result.
325
+ */
326
+ id: string;
327
+
328
+ /**
329
+ * The actual data records returned by the sample query.
330
+ */
331
+ records: Array<Record<string, unknown>>;
332
+
333
+ /**
334
+ * The ID of the report this sample was generated from, or null for ad-hoc samples.
335
+ */
336
+ report: string | null;
337
+ }
338
+
282
339
  export interface ReportCreateParams {
283
340
  /**
284
341
  * The SQL query defining the report.
@@ -324,8 +381,38 @@ export interface ReportListParams extends ListParams {
324
381
  search?: string;
325
382
  }
326
383
 
384
+ export interface ReportRunAdHocQueryParams {
385
+ /**
386
+ * The SQL query to execute for the sample.
387
+ */
388
+ sqlQuery: string;
389
+
390
+ /**
391
+ * Maximum number of rows to return in the sample.
392
+ */
393
+ limit?: number;
394
+
395
+ /**
396
+ * Optional parameters to bind to the SQL query (e.g., for placeholders like ? or
397
+ * $1).
398
+ */
399
+ params?: Array<string>;
400
+ }
401
+
402
+ export interface ReportSampleParams {
403
+ /**
404
+ * Maximum number of rows to return in the sample.
405
+ */
406
+ limit?: number;
407
+
408
+ /**
409
+ * Optional parameters to bind to the SQL query (e.g., for placeholders like ? or
410
+ * $1).
411
+ */
412
+ params?: Array<string>;
413
+ }
414
+
327
415
  Reports.ReportListResponsesList = ReportListResponsesList;
328
- Reports.Samples = Samples;
329
416
  Reports.Exports = Exports;
330
417
 
331
418
  export declare namespace Reports {
@@ -335,18 +422,14 @@ export declare namespace Reports {
335
422
  type ReportUpdateResponse as ReportUpdateResponse,
336
423
  type ReportListResponse as ReportListResponse,
337
424
  type ReportDeleteResponse as ReportDeleteResponse,
425
+ type ReportRunAdHocQueryResponse as ReportRunAdHocQueryResponse,
426
+ type ReportSampleResponse as ReportSampleResponse,
338
427
  ReportListResponsesList as ReportListResponsesList,
339
428
  type ReportCreateParams as ReportCreateParams,
340
429
  type ReportUpdateParams as ReportUpdateParams,
341
430
  type ReportListParams as ReportListParams,
342
- };
343
-
344
- export {
345
- Samples as Samples,
346
- type SampleRunResponse as SampleRunResponse,
347
- type SampleSampleResponse as SampleSampleResponse,
348
- type SampleRunParams as SampleRunParams,
349
- type SampleSampleParams as SampleSampleParams,
431
+ type ReportRunAdHocQueryParams as ReportRunAdHocQueryParams,
432
+ type ReportSampleParams as ReportSampleParams,
350
433
  };
351
434
 
352
435
  export {
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './reports/index';
@@ -0,0 +1 @@
1
+ export * from './resources/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.1'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.1";
1
+ export declare const VERSION = "0.1.0-alpha.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.0-alpha.1'; // x-release-please-version
4
+ exports.VERSION = '0.1.0-alpha.3'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.1'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,81 +0,0 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
3
- export declare class Samples extends APIResource {
4
- /**
5
- * Run an ad-hoc SQL query against your data lake and get a sample of the results.
6
- * This is useful for quickly testing queries without saving them as a report. The
7
- * query execution time and result size are limited.
8
- */
9
- run(body: SampleRunParams, options?: Core.RequestOptions): Core.APIPromise<SampleRunResponse>;
10
- /**
11
- * Run the query associated with a saved report and get a sample of the results.
12
- * This allows getting up to 1000 rows of resutls but the runtime of the query is
13
- * limited to 30 seconds. If you need more rows or longer runtime, you should
14
- * create an export from this report.
15
- */
16
- sample(id: string, body: SampleSampleParams, options?: Core.RequestOptions): Core.APIPromise<SampleSampleResponse>;
17
- }
18
- /**
19
- * Represents the result of a report sample query.
20
- */
21
- export interface SampleRunResponse {
22
- /**
23
- * Unique identifier for the sample query result.
24
- */
25
- id: string;
26
- /**
27
- * The actual data records returned by the sample query.
28
- */
29
- records: Array<Record<string, unknown>>;
30
- /**
31
- * The ID of the report this sample was generated from, or null for ad-hoc samples.
32
- */
33
- report: string | null;
34
- }
35
- /**
36
- * Represents the result of a report sample query.
37
- */
38
- export interface SampleSampleResponse {
39
- /**
40
- * Unique identifier for the sample query result.
41
- */
42
- id: string;
43
- /**
44
- * The actual data records returned by the sample query.
45
- */
46
- records: Array<Record<string, unknown>>;
47
- /**
48
- * The ID of the report this sample was generated from, or null for ad-hoc samples.
49
- */
50
- report: string | null;
51
- }
52
- export interface SampleRunParams {
53
- /**
54
- * The SQL query to execute for the sample.
55
- */
56
- sqlQuery: string;
57
- /**
58
- * Maximum number of rows to return in the sample.
59
- */
60
- limit?: number;
61
- /**
62
- * Optional parameters to bind to the SQL query (e.g., for placeholders like ? or
63
- * $1).
64
- */
65
- params?: Array<string>;
66
- }
67
- export interface SampleSampleParams {
68
- /**
69
- * Maximum number of rows to return in the sample.
70
- */
71
- limit?: number;
72
- /**
73
- * Optional parameters to bind to the SQL query (e.g., for placeholders like ? or
74
- * $1).
75
- */
76
- params?: Array<string>;
77
- }
78
- export declare namespace Samples {
79
- export { type SampleRunResponse as SampleRunResponse, type SampleSampleResponse as SampleSampleResponse, type SampleRunParams as SampleRunParams, type SampleSampleParams as SampleSampleParams, };
80
- }
81
- //# sourceMappingURL=samples.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/resources/reports/samples.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAI7F;;;;;OAKG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAGzC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAExC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAExC;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Samples = void 0;
5
- const resource_1 = require("../../resource.js");
6
- class Samples extends resource_1.APIResource {
7
- /**
8
- * Run an ad-hoc SQL query against your data lake and get a sample of the results.
9
- * This is useful for quickly testing queries without saving them as a report. The
10
- * query execution time and result size are limited.
11
- */
12
- run(body, options) {
13
- return this._client.post('/reports/samples', { body, ...options });
14
- }
15
- /**
16
- * Run the query associated with a saved report and get a sample of the results.
17
- * This allows getting up to 1000 rows of resutls but the runtime of the query is
18
- * limited to 30 seconds. If you need more rows or longer runtime, you should
19
- * create an export from this report.
20
- */
21
- sample(id, body, options) {
22
- return this._client.post(`/reports/${id}/samples`, { body, ...options });
23
- }
24
- }
25
- exports.Samples = Samples;
26
- //# sourceMappingURL=samples.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"samples.js","sourceRoot":"","sources":["../../src/resources/reports/samples.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;OAIG;IACH,GAAG,CAAC,IAAqB,EAAE,OAA6B;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACH,MAAM,CACJ,EAAU,EACV,IAAwB,EACxB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF;AAvBD,0BAuBC"}
@@ -1,22 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../resource.mjs";
3
- export class Samples extends APIResource {
4
- /**
5
- * Run an ad-hoc SQL query against your data lake and get a sample of the results.
6
- * This is useful for quickly testing queries without saving them as a report. The
7
- * query execution time and result size are limited.
8
- */
9
- run(body, options) {
10
- return this._client.post('/reports/samples', { body, ...options });
11
- }
12
- /**
13
- * Run the query associated with a saved report and get a sample of the results.
14
- * This allows getting up to 1000 rows of resutls but the runtime of the query is
15
- * limited to 30 seconds. If you need more rows or longer runtime, you should
16
- * create an export from this report.
17
- */
18
- sample(id, body, options) {
19
- return this._client.post(`/reports/${id}/samples`, { body, ...options });
20
- }
21
- }
22
- //# sourceMappingURL=samples.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"samples.mjs","sourceRoot":"","sources":["../../src/resources/reports/samples.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,GAAG,CAAC,IAAqB,EAAE,OAA6B;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACH,MAAM,CACJ,EAAU,EACV,IAAwB,EACxB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF"}
@@ -1,109 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
5
-
6
- export class Samples extends APIResource {
7
- /**
8
- * Run an ad-hoc SQL query against your data lake and get a sample of the results.
9
- * This is useful for quickly testing queries without saving them as a report. The
10
- * query execution time and result size are limited.
11
- */
12
- run(body: SampleRunParams, options?: Core.RequestOptions): Core.APIPromise<SampleRunResponse> {
13
- return this._client.post('/reports/samples', { body, ...options });
14
- }
15
-
16
- /**
17
- * Run the query associated with a saved report and get a sample of the results.
18
- * This allows getting up to 1000 rows of resutls but the runtime of the query is
19
- * limited to 30 seconds. If you need more rows or longer runtime, you should
20
- * create an export from this report.
21
- */
22
- sample(
23
- id: string,
24
- body: SampleSampleParams,
25
- options?: Core.RequestOptions,
26
- ): Core.APIPromise<SampleSampleResponse> {
27
- return this._client.post(`/reports/${id}/samples`, { body, ...options });
28
- }
29
- }
30
-
31
- /**
32
- * Represents the result of a report sample query.
33
- */
34
- export interface SampleRunResponse {
35
- /**
36
- * Unique identifier for the sample query result.
37
- */
38
- id: string;
39
-
40
- /**
41
- * The actual data records returned by the sample query.
42
- */
43
- records: Array<Record<string, unknown>>;
44
-
45
- /**
46
- * The ID of the report this sample was generated from, or null for ad-hoc samples.
47
- */
48
- report: string | null;
49
- }
50
-
51
- /**
52
- * Represents the result of a report sample query.
53
- */
54
- export interface SampleSampleResponse {
55
- /**
56
- * Unique identifier for the sample query result.
57
- */
58
- id: string;
59
-
60
- /**
61
- * The actual data records returned by the sample query.
62
- */
63
- records: Array<Record<string, unknown>>;
64
-
65
- /**
66
- * The ID of the report this sample was generated from, or null for ad-hoc samples.
67
- */
68
- report: string | null;
69
- }
70
-
71
- export interface SampleRunParams {
72
- /**
73
- * The SQL query to execute for the sample.
74
- */
75
- sqlQuery: string;
76
-
77
- /**
78
- * Maximum number of rows to return in the sample.
79
- */
80
- limit?: number;
81
-
82
- /**
83
- * Optional parameters to bind to the SQL query (e.g., for placeholders like ? or
84
- * $1).
85
- */
86
- params?: Array<string>;
87
- }
88
-
89
- export interface SampleSampleParams {
90
- /**
91
- * Maximum number of rows to return in the sample.
92
- */
93
- limit?: number;
94
-
95
- /**
96
- * Optional parameters to bind to the SQL query (e.g., for placeholders like ? or
97
- * $1).
98
- */
99
- params?: Array<string>;
100
- }
101
-
102
- export declare namespace Samples {
103
- export {
104
- type SampleRunResponse as SampleRunResponse,
105
- type SampleSampleResponse as SampleSampleResponse,
106
- type SampleRunParams as SampleRunParams,
107
- type SampleSampleParams as SampleSampleParams,
108
- };
109
- }