postgrid-node 0.1.0-alpha.1
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/CHANGELOG.md +19 -0
- package/LICENSE +201 -0
- package/README.md +346 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +914 -0
- package/core.js.map +1 -0
- package/core.mjs +882 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +144 -0
- package/index.d.ts +144 -0
- package/index.d.ts.map +1 -0
- package/index.js +161 -0
- package/index.js.map +1 -0
- package/index.mjs +118 -0
- package/index.mjs.map +1 -0
- package/package.json +124 -0
- package/pagination.d.ts +24 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +45 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +41 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/bank-accounts.d.ts +285 -0
- package/resources/bank-accounts.d.ts.map +1 -0
- package/resources/bank-accounts.js +45 -0
- package/resources/bank-accounts.js.map +1 -0
- package/resources/bank-accounts.mjs +40 -0
- package/resources/bank-accounts.mjs.map +1 -0
- package/resources/boxes.d.ts +683 -0
- package/resources/boxes.d.ts.map +1 -0
- package/resources/boxes.js +54 -0
- package/resources/boxes.js.map +1 -0
- package/resources/boxes.mjs +49 -0
- package/resources/boxes.mjs.map +1 -0
- package/resources/campaigns.d.ts +644 -0
- package/resources/campaigns.d.ts.map +1 -0
- package/resources/campaigns.js +67 -0
- package/resources/campaigns.js.map +1 -0
- package/resources/campaigns.mjs +62 -0
- package/resources/campaigns.mjs.map +1 -0
- package/resources/cheques/cheques.d.ts +349 -0
- package/resources/cheques/cheques.d.ts.map +1 -0
- package/resources/cheques/cheques.js +95 -0
- package/resources/cheques/cheques.js.map +1 -0
- package/resources/cheques/cheques.mjs +67 -0
- package/resources/cheques/cheques.mjs.map +1 -0
- package/resources/cheques/index.d.ts +4 -0
- package/resources/cheques/index.d.ts.map +1 -0
- package/resources/cheques/index.js +12 -0
- package/resources/cheques/index.js.map +1 -0
- package/resources/cheques/index.mjs +5 -0
- package/resources/cheques/index.mjs.map +1 -0
- package/resources/cheques/url.d.ts +29 -0
- package/resources/cheques/url.d.ts.map +1 -0
- package/resources/cheques/url.js +20 -0
- package/resources/cheques/url.js.map +1 -0
- package/resources/cheques/url.mjs +16 -0
- package/resources/cheques/url.mjs.map +1 -0
- package/resources/cheques/with-deposit-ready-pdf.d.ts +13 -0
- package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -0
- package/resources/cheques/with-deposit-ready-pdf.js +18 -0
- package/resources/cheques/with-deposit-ready-pdf.js.map +1 -0
- package/resources/cheques/with-deposit-ready-pdf.mjs +14 -0
- package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -0
- package/resources/contacts.d.ts +295 -0
- package/resources/contacts.d.ts.map +1 -0
- package/resources/contacts.js +52 -0
- package/resources/contacts.js.map +1 -0
- package/resources/contacts.mjs +47 -0
- package/resources/contacts.mjs.map +1 -0
- package/resources/index.d.ts +12 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +50 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +13 -0
- package/resources/index.mjs.map +1 -0
- package/resources/letters.d.ts +639 -0
- package/resources/letters.d.ts.map +1 -0
- package/resources/letters.js +55 -0
- package/resources/letters.js.map +1 -0
- package/resources/letters.mjs +50 -0
- package/resources/letters.mjs.map +1 -0
- package/resources/postcards.d.ts +346 -0
- package/resources/postcards.d.ts.map +1 -0
- package/resources/postcards.js +56 -0
- package/resources/postcards.js.map +1 -0
- package/resources/postcards.mjs +51 -0
- package/resources/postcards.mjs.map +1 -0
- package/resources/reports/exports.d.ts +207 -0
- package/resources/reports/exports.d.ts.map +1 -0
- package/resources/reports/exports.js +33 -0
- package/resources/reports/exports.js.map +1 -0
- package/resources/reports/exports.mjs +29 -0
- package/resources/reports/exports.mjs.map +1 -0
- package/resources/reports/index.d.ts +4 -0
- package/resources/reports/index.d.ts.map +1 -0
- package/resources/reports/index.js +12 -0
- package/resources/reports/index.js.map +1 -0
- package/resources/reports/index.mjs +5 -0
- package/resources/reports/index.mjs.map +1 -0
- package/resources/reports/reports.d.ts +245 -0
- package/resources/reports/reports.d.ts.map +1 -0
- package/resources/reports/reports.js +85 -0
- package/resources/reports/reports.js.map +1 -0
- package/resources/reports/reports.mjs +57 -0
- package/resources/reports/reports.mjs.map +1 -0
- package/resources/reports/samples.d.ts +81 -0
- package/resources/reports/samples.d.ts.map +1 -0
- package/resources/reports/samples.js +26 -0
- package/resources/reports/samples.js.map +1 -0
- package/resources/reports/samples.mjs +22 -0
- package/resources/reports/samples.mjs.map +1 -0
- package/resources/self-mailers.d.ts +622 -0
- package/resources/self-mailers.d.ts.map +1 -0
- package/resources/self-mailers.js +45 -0
- package/resources/self-mailers.js.map +1 -0
- package/resources/self-mailers.mjs +40 -0
- package/resources/self-mailers.mjs.map +1 -0
- package/resources/shared.d.ts +147 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/templates.d.ts +126 -0
- package/resources/templates.d.ts.map +1 -0
- package/resources/templates.js +46 -0
- package/resources/templates.js.map +1 -0
- package/resources/templates.mjs +41 -0
- package/resources/templates.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1208 -0
- package/src/error.ts +130 -0
- package/src/index.ts +428 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +69 -0
- package/src/resource.ts +11 -0
- package/src/resources/bank-accounts.ts +382 -0
- package/src/resources/boxes.ts +982 -0
- package/src/resources/campaigns.ts +853 -0
- package/src/resources/cheques/cheques.ts +493 -0
- package/src/resources/cheques/index.ts +12 -0
- package/src/resources/cheques/url.ts +37 -0
- package/src/resources/cheques/with-deposit-ready-pdf.ts +17 -0
- package/src/resources/contacts.ts +387 -0
- package/src/resources/index.ts +102 -0
- package/src/resources/letters.ts +870 -0
- package/src/resources/postcards.ts +548 -0
- package/src/resources/reports/exports.ts +272 -0
- package/src/resources/reports/index.ts +28 -0
- package/src/resources/reports/reports.ts +359 -0
- package/src/resources/reports/samples.ts +109 -0
- package/src/resources/self-mailers.ts +958 -0
- package/src/resources/shared.ts +182 -0
- package/src/resources/templates.ts +184 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,272 @@
|
|
|
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 Exports extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new export job for a saved report. This runs the report's query
|
|
9
|
+
* asynchronously and generates a downloadable CSV file with the full results. Your
|
|
10
|
+
* queries can run for up to 13 minutes the resulting file can be up to 100mb
|
|
11
|
+
* large.
|
|
12
|
+
*/
|
|
13
|
+
create(
|
|
14
|
+
reportId: string,
|
|
15
|
+
body: ExportCreateParams,
|
|
16
|
+
options?: Core.RequestOptions,
|
|
17
|
+
): Core.APIPromise<ExportCreateResponse> {
|
|
18
|
+
return this._client.post(`/reports/${reportId}/exports`, { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve the status and details of a specific report export job. Check the
|
|
23
|
+
* `outputURL` property for the download link once generation is complete.
|
|
24
|
+
*/
|
|
25
|
+
retrieve(
|
|
26
|
+
reportId: string,
|
|
27
|
+
exportId: string,
|
|
28
|
+
options?: Core.RequestOptions,
|
|
29
|
+
): Core.APIPromise<ExportRetrieveResponse> {
|
|
30
|
+
return this._client.get(`/reports/${reportId}/exports/${exportId}`, options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Delete a completed or failed report export job and its associated output file
|
|
35
|
+
* (if any). This action cannot be undone. You cannot delete an export that is
|
|
36
|
+
* still generating.
|
|
37
|
+
*/
|
|
38
|
+
delete(
|
|
39
|
+
reportId: string,
|
|
40
|
+
exportId: string,
|
|
41
|
+
options?: Core.RequestOptions,
|
|
42
|
+
): Core.APIPromise<ExportDeleteResponse> {
|
|
43
|
+
return this._client.delete(`/reports/${reportId}/exports/${exportId}`, options);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Represents a report export job and its results.
|
|
49
|
+
*/
|
|
50
|
+
export interface ExportCreateResponse {
|
|
51
|
+
/**
|
|
52
|
+
* Unique identifier for the report export.
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Timestamp when the export was created.
|
|
58
|
+
*/
|
|
59
|
+
createdAt: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Indicates if the export is associated with the live or test environment.
|
|
63
|
+
*/
|
|
64
|
+
live: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Always `report_export`.
|
|
68
|
+
*/
|
|
69
|
+
object: 'report_export';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Details of the report this export was generated from.
|
|
73
|
+
*/
|
|
74
|
+
report: ExportCreateResponse.Report;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Timestamp when the export was last updated (e.g., finished generation).
|
|
78
|
+
*/
|
|
79
|
+
updatedAt: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* An optional user-friendly description for the export.
|
|
83
|
+
*/
|
|
84
|
+
description?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* If export generation failed, this contains the error message.
|
|
88
|
+
*/
|
|
89
|
+
failureMessage?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Optional key-value metadata associated with the export.
|
|
93
|
+
*/
|
|
94
|
+
metadata?: Record<string, string>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A signed URL to download the exported data (CSV format). Available when
|
|
98
|
+
* generation is complete and successful.
|
|
99
|
+
*/
|
|
100
|
+
outputURL?: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Optional parameters to bind to the SQL query of the associated report.
|
|
104
|
+
*/
|
|
105
|
+
params?: Array<string>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The number of rows in the exported data.
|
|
109
|
+
*/
|
|
110
|
+
rowCount?: number;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The size of the generated export file in bytes.
|
|
114
|
+
*/
|
|
115
|
+
sizeInBytes?: number;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* If the output was truncated, indicates the byte limit reached.
|
|
119
|
+
*/
|
|
120
|
+
truncatedToBytes?: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export namespace ExportCreateResponse {
|
|
124
|
+
/**
|
|
125
|
+
* Details of the report this export was generated from.
|
|
126
|
+
*/
|
|
127
|
+
export interface Report {
|
|
128
|
+
/**
|
|
129
|
+
* The ID of the report.
|
|
130
|
+
*/
|
|
131
|
+
id: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The SQL query used for this export (snapshotted at creation time).
|
|
135
|
+
*/
|
|
136
|
+
sqlQuery: string;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Represents a report export job and its results.
|
|
142
|
+
*/
|
|
143
|
+
export interface ExportRetrieveResponse {
|
|
144
|
+
/**
|
|
145
|
+
* Unique identifier for the report export.
|
|
146
|
+
*/
|
|
147
|
+
id: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Timestamp when the export was created.
|
|
151
|
+
*/
|
|
152
|
+
createdAt: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Indicates if the export is associated with the live or test environment.
|
|
156
|
+
*/
|
|
157
|
+
live: boolean;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Always `report_export`.
|
|
161
|
+
*/
|
|
162
|
+
object: 'report_export';
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Details of the report this export was generated from.
|
|
166
|
+
*/
|
|
167
|
+
report: ExportRetrieveResponse.Report;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Timestamp when the export was last updated (e.g., finished generation).
|
|
171
|
+
*/
|
|
172
|
+
updatedAt: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* An optional user-friendly description for the export.
|
|
176
|
+
*/
|
|
177
|
+
description?: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* If export generation failed, this contains the error message.
|
|
181
|
+
*/
|
|
182
|
+
failureMessage?: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Optional key-value metadata associated with the export.
|
|
186
|
+
*/
|
|
187
|
+
metadata?: Record<string, string>;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* A signed URL to download the exported data (CSV format). Available when
|
|
191
|
+
* generation is complete and successful.
|
|
192
|
+
*/
|
|
193
|
+
outputURL?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Optional parameters to bind to the SQL query of the associated report.
|
|
197
|
+
*/
|
|
198
|
+
params?: Array<string>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The number of rows in the exported data.
|
|
202
|
+
*/
|
|
203
|
+
rowCount?: number;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The size of the generated export file in bytes.
|
|
207
|
+
*/
|
|
208
|
+
sizeInBytes?: number;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* If the output was truncated, indicates the byte limit reached.
|
|
212
|
+
*/
|
|
213
|
+
truncatedToBytes?: number;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export namespace ExportRetrieveResponse {
|
|
217
|
+
/**
|
|
218
|
+
* Details of the report this export was generated from.
|
|
219
|
+
*/
|
|
220
|
+
export interface Report {
|
|
221
|
+
/**
|
|
222
|
+
* The ID of the report.
|
|
223
|
+
*/
|
|
224
|
+
id: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The SQL query used for this export (snapshotted at creation time).
|
|
228
|
+
*/
|
|
229
|
+
sqlQuery: string;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Generic response for delete operations.
|
|
235
|
+
*/
|
|
236
|
+
export interface ExportDeleteResponse {
|
|
237
|
+
/**
|
|
238
|
+
* The ID of the deleted resource.
|
|
239
|
+
*/
|
|
240
|
+
id: string;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Indicates the resource was successfully deleted.
|
|
244
|
+
*/
|
|
245
|
+
deleted: true;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface ExportCreateParams {
|
|
249
|
+
/**
|
|
250
|
+
* An optional user-friendly description for the export.
|
|
251
|
+
*/
|
|
252
|
+
description?: string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Optional key-value metadata associated with the export.
|
|
256
|
+
*/
|
|
257
|
+
metadata?: Record<string, string>;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Optional parameters to bind to the SQL query of the associated report.
|
|
261
|
+
*/
|
|
262
|
+
params?: Array<string>;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export declare namespace Exports {
|
|
266
|
+
export {
|
|
267
|
+
type ExportCreateResponse as ExportCreateResponse,
|
|
268
|
+
type ExportRetrieveResponse as ExportRetrieveResponse,
|
|
269
|
+
type ExportDeleteResponse as ExportDeleteResponse,
|
|
270
|
+
type ExportCreateParams as ExportCreateParams,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Exports,
|
|
5
|
+
type ExportCreateResponse,
|
|
6
|
+
type ExportRetrieveResponse,
|
|
7
|
+
type ExportDeleteResponse,
|
|
8
|
+
type ExportCreateParams,
|
|
9
|
+
} from './exports';
|
|
10
|
+
export {
|
|
11
|
+
ReportListResponsesList,
|
|
12
|
+
Reports,
|
|
13
|
+
type ReportCreateResponse,
|
|
14
|
+
type ReportRetrieveResponse,
|
|
15
|
+
type ReportUpdateResponse,
|
|
16
|
+
type ReportListResponse,
|
|
17
|
+
type ReportDeleteResponse,
|
|
18
|
+
type ReportCreateParams,
|
|
19
|
+
type ReportUpdateParams,
|
|
20
|
+
type ReportListParams,
|
|
21
|
+
} from './reports';
|
|
22
|
+
export {
|
|
23
|
+
Samples,
|
|
24
|
+
type SampleRunResponse,
|
|
25
|
+
type SampleSampleResponse,
|
|
26
|
+
type SampleRunParams,
|
|
27
|
+
type SampleSampleParams,
|
|
28
|
+
} from './samples';
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as ExportsAPI from './exports';
|
|
7
|
+
import {
|
|
8
|
+
ExportCreateParams,
|
|
9
|
+
ExportCreateResponse,
|
|
10
|
+
ExportDeleteResponse,
|
|
11
|
+
ExportRetrieveResponse,
|
|
12
|
+
Exports,
|
|
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
|
+
import { List, type ListParams } from '../../pagination';
|
|
23
|
+
|
|
24
|
+
export class Reports extends APIResource {
|
|
25
|
+
samples: SamplesAPI.Samples = new SamplesAPI.Samples(this._client);
|
|
26
|
+
exports: ExportsAPI.Exports = new ExportsAPI.Exports(this._client);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create a new saved report definition. Saved reports are SQL queries that can be
|
|
30
|
+
* executed later to generate full exports or samples.
|
|
31
|
+
*
|
|
32
|
+
* If you just want to do ad-hoc queries, you should use the `/reports/samples`
|
|
33
|
+
* endpoint.
|
|
34
|
+
*/
|
|
35
|
+
create(body: ReportCreateParams, options?: Core.RequestOptions): Core.APIPromise<ReportCreateResponse> {
|
|
36
|
+
return this._client.post('/reports/', { body, ...options });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Retrieve the details of a specific saved report by its ID.
|
|
41
|
+
*/
|
|
42
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ReportRetrieveResponse> {
|
|
43
|
+
return this._client.get(`/reports/${id}`, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Update an existing saved report definition. You can change the query,
|
|
48
|
+
* description, or metadata.
|
|
49
|
+
*/
|
|
50
|
+
update(
|
|
51
|
+
id: string,
|
|
52
|
+
body: ReportUpdateParams,
|
|
53
|
+
options?: Core.RequestOptions,
|
|
54
|
+
): Core.APIPromise<ReportUpdateResponse> {
|
|
55
|
+
return this._client.post(`/reports/${id}`, { body, ...options });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Retrieve a list of saved reports for your organization.
|
|
60
|
+
*/
|
|
61
|
+
list(
|
|
62
|
+
query?: ReportListParams,
|
|
63
|
+
options?: Core.RequestOptions,
|
|
64
|
+
): Core.PagePromise<ReportListResponsesList, ReportListResponse>;
|
|
65
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ReportListResponsesList, ReportListResponse>;
|
|
66
|
+
list(
|
|
67
|
+
query: ReportListParams | Core.RequestOptions = {},
|
|
68
|
+
options?: Core.RequestOptions,
|
|
69
|
+
): Core.PagePromise<ReportListResponsesList, ReportListResponse> {
|
|
70
|
+
if (isRequestOptions(query)) {
|
|
71
|
+
return this.list({}, query);
|
|
72
|
+
}
|
|
73
|
+
return this._client.getAPIList('/reports/', ReportListResponsesList, { query, ...options });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Delete a saved report definition. This action cannot be undone. Associated
|
|
78
|
+
* exports are not automatically deleted.
|
|
79
|
+
*/
|
|
80
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<ReportDeleteResponse> {
|
|
81
|
+
return this._client.delete(`/reports/${id}`, options);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class ReportListResponsesList extends List<ReportListResponse> {}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Represents a saved Report definition.
|
|
89
|
+
*/
|
|
90
|
+
export interface ReportCreateResponse {
|
|
91
|
+
/**
|
|
92
|
+
* Unique identifier for the report.
|
|
93
|
+
*/
|
|
94
|
+
id: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Timestamp when the report was created.
|
|
98
|
+
*/
|
|
99
|
+
createdAt: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Indicates if the report is associated with the live or test environment.
|
|
103
|
+
*/
|
|
104
|
+
live: boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Always `report`.
|
|
108
|
+
*/
|
|
109
|
+
object: 'report';
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The SQL query defining the report.
|
|
113
|
+
*/
|
|
114
|
+
sqlQuery: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Timestamp when the report was last updated.
|
|
118
|
+
*/
|
|
119
|
+
updatedAt: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* An optional user-friendly description for the report.
|
|
123
|
+
*/
|
|
124
|
+
description?: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Optional key-value metadata associated with the report.
|
|
128
|
+
*/
|
|
129
|
+
metadata?: Record<string, string>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Represents a saved Report definition.
|
|
134
|
+
*/
|
|
135
|
+
export interface ReportRetrieveResponse {
|
|
136
|
+
/**
|
|
137
|
+
* Unique identifier for the report.
|
|
138
|
+
*/
|
|
139
|
+
id: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Timestamp when the report was created.
|
|
143
|
+
*/
|
|
144
|
+
createdAt: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Indicates if the report is associated with the live or test environment.
|
|
148
|
+
*/
|
|
149
|
+
live: boolean;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Always `report`.
|
|
153
|
+
*/
|
|
154
|
+
object: 'report';
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The SQL query defining the report.
|
|
158
|
+
*/
|
|
159
|
+
sqlQuery: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Timestamp when the report was last updated.
|
|
163
|
+
*/
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* An optional user-friendly description for the report.
|
|
168
|
+
*/
|
|
169
|
+
description?: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Optional key-value metadata associated with the report.
|
|
173
|
+
*/
|
|
174
|
+
metadata?: Record<string, string>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Represents a saved Report definition.
|
|
179
|
+
*/
|
|
180
|
+
export interface ReportUpdateResponse {
|
|
181
|
+
/**
|
|
182
|
+
* Unique identifier for the report.
|
|
183
|
+
*/
|
|
184
|
+
id: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Timestamp when the report was created.
|
|
188
|
+
*/
|
|
189
|
+
createdAt: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Indicates if the report is associated with the live or test environment.
|
|
193
|
+
*/
|
|
194
|
+
live: boolean;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Always `report`.
|
|
198
|
+
*/
|
|
199
|
+
object: 'report';
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The SQL query defining the report.
|
|
203
|
+
*/
|
|
204
|
+
sqlQuery: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Timestamp when the report was last updated.
|
|
208
|
+
*/
|
|
209
|
+
updatedAt: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* An optional user-friendly description for the report.
|
|
213
|
+
*/
|
|
214
|
+
description?: string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Optional key-value metadata associated with the report.
|
|
218
|
+
*/
|
|
219
|
+
metadata?: Record<string, string>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Represents a saved Report definition.
|
|
224
|
+
*/
|
|
225
|
+
export interface ReportListResponse {
|
|
226
|
+
/**
|
|
227
|
+
* Unique identifier for the report.
|
|
228
|
+
*/
|
|
229
|
+
id: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Timestamp when the report was created.
|
|
233
|
+
*/
|
|
234
|
+
createdAt: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Indicates if the report is associated with the live or test environment.
|
|
238
|
+
*/
|
|
239
|
+
live: boolean;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Always `report`.
|
|
243
|
+
*/
|
|
244
|
+
object: 'report';
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The SQL query defining the report.
|
|
248
|
+
*/
|
|
249
|
+
sqlQuery: string;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Timestamp when the report was last updated.
|
|
253
|
+
*/
|
|
254
|
+
updatedAt: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* An optional user-friendly description for the report.
|
|
258
|
+
*/
|
|
259
|
+
description?: string;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Optional key-value metadata associated with the report.
|
|
263
|
+
*/
|
|
264
|
+
metadata?: Record<string, string>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Generic response for delete operations.
|
|
269
|
+
*/
|
|
270
|
+
export interface ReportDeleteResponse {
|
|
271
|
+
/**
|
|
272
|
+
* The ID of the deleted resource.
|
|
273
|
+
*/
|
|
274
|
+
id: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Indicates the resource was successfully deleted.
|
|
278
|
+
*/
|
|
279
|
+
deleted: true;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface ReportCreateParams {
|
|
283
|
+
/**
|
|
284
|
+
* The SQL query defining the report.
|
|
285
|
+
*/
|
|
286
|
+
sqlQuery: string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* An optional user-friendly description for the report.
|
|
290
|
+
*/
|
|
291
|
+
description?: string;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Optional key-value metadata associated with the report.
|
|
295
|
+
*/
|
|
296
|
+
metadata?: Record<string, string>;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface ReportUpdateParams {
|
|
300
|
+
/**
|
|
301
|
+
* An optional user-friendly description for the report. Set to null to remove.
|
|
302
|
+
*/
|
|
303
|
+
description?: string | null;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Optional key-value metadata associated with the report. Set to null to remove.
|
|
307
|
+
*/
|
|
308
|
+
metadata?: Record<string, string> | null;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The SQL query defining the report.
|
|
312
|
+
*/
|
|
313
|
+
sqlQuery?: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface ReportListParams extends ListParams {
|
|
317
|
+
/**
|
|
318
|
+
* You can supply any string to help narrow down the list of resources. For
|
|
319
|
+
* example, if you pass `"New York"` (quoted), it will return resources that have
|
|
320
|
+
* that string present somewhere in their response. Alternatively, you can supply a
|
|
321
|
+
* structured search query. See the documentation on `StructuredSearchQuery` for
|
|
322
|
+
* more details.
|
|
323
|
+
*/
|
|
324
|
+
search?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
Reports.ReportListResponsesList = ReportListResponsesList;
|
|
328
|
+
Reports.Samples = Samples;
|
|
329
|
+
Reports.Exports = Exports;
|
|
330
|
+
|
|
331
|
+
export declare namespace Reports {
|
|
332
|
+
export {
|
|
333
|
+
type ReportCreateResponse as ReportCreateResponse,
|
|
334
|
+
type ReportRetrieveResponse as ReportRetrieveResponse,
|
|
335
|
+
type ReportUpdateResponse as ReportUpdateResponse,
|
|
336
|
+
type ReportListResponse as ReportListResponse,
|
|
337
|
+
type ReportDeleteResponse as ReportDeleteResponse,
|
|
338
|
+
ReportListResponsesList as ReportListResponsesList,
|
|
339
|
+
type ReportCreateParams as ReportCreateParams,
|
|
340
|
+
type ReportUpdateParams as ReportUpdateParams,
|
|
341
|
+
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,
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export {
|
|
353
|
+
Exports as Exports,
|
|
354
|
+
type ExportCreateResponse as ExportCreateResponse,
|
|
355
|
+
type ExportRetrieveResponse as ExportRetrieveResponse,
|
|
356
|
+
type ExportDeleteResponse as ExportDeleteResponse,
|
|
357
|
+
type ExportCreateParams as ExportCreateParams,
|
|
358
|
+
};
|
|
359
|
+
}
|