@anvilco/types 0.1.0

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @anvilco/types
2
+
3
+ TypeScript types generated from the [Anvil](https://www.useanvil.com) OpenAPI spec. Consumed internally by `@anvilco/browser` and `@anvilco/react`.
4
+
5
+ Types are regenerated weekly from the production spec via `yarn workspace @anvilco/types generate:rest`.
package/dist/index.cjs ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,374 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ interface paths {
6
+ '/api/v1/fill/{castEid}.pdf': {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ get?: never;
14
+ put?: never;
15
+ /**
16
+ * Fill a PDF template
17
+ * @description Fills a PDF template (Cast) with the provided data and returns the resulting PDF.
18
+ *
19
+ * Templates are created and managed in the Anvil dashboard or via the GraphQL `createCast` mutation.
20
+ * Each template defines named fields (text, date, checkbox, signature, etc.) that can be populated via
21
+ * this endpoint. The field data can be supplied as a flat object keyed by field ID
22
+ * or alias, or as an array of objects for multi-page repeating templates.
23
+ *
24
+ * Supports both JSON and multipart/form-data request bodies. When using
25
+ * multipart/form-data, string values for `fontSize` and `page` are automatically
26
+ * parsed.
27
+ *
28
+ * Requires API key (Basic auth) or OAuth authentication. Development API keys
29
+ * produce watermarked PDFs; production keys produce clean PDFs and count toward
30
+ * your plan's usage.
31
+ */
32
+ post: operations['fillPdf'];
33
+ delete?: never;
34
+ options?: never;
35
+ head?: never;
36
+ patch?: never;
37
+ trace?: never;
38
+ };
39
+ '/api/v1/generate-pdf': {
40
+ parameters: {
41
+ query?: never;
42
+ header?: never;
43
+ path?: never;
44
+ cookie?: never;
45
+ };
46
+ get?: never;
47
+ put?: never;
48
+ /**
49
+ * Generate a PDF from HTML or Markdown
50
+ * @description Generates a PDF document from either Markdown content or raw HTML/CSS.
51
+ * The generation mode is determined automatically: if the request body
52
+ * contains `type: "html"` or the `data` property includes an `html` key,
53
+ * HTML-to-PDF rendering is used; otherwise, Markdown-to-PDF rendering is used.
54
+ *
55
+ * **Markdown mode** accepts structured content blocks (headings, labels,
56
+ * body text, and tables) and renders them into a styled PDF with optional
57
+ * logo, timestamp, and custom page dimensions.
58
+ *
59
+ * **HTML mode** accepts raw HTML and optional CSS, rendering them directly
60
+ * into a PDF with optional custom page dimensions.
61
+ *
62
+ * Supports both JSON and multipart/form-data request bodies. Requires API
63
+ * key (Basic auth) or OAuth authentication.
64
+ */
65
+ post: operations['generatePdf'];
66
+ delete?: never;
67
+ options?: never;
68
+ head?: never;
69
+ patch?: never;
70
+ trace?: never;
71
+ };
72
+ }
73
+ interface components {
74
+ schemas: {
75
+ FillPdfRequest: {
76
+ /** @description Custom title for the generated PDF. Overrides the template's default title. */
77
+ title?: string;
78
+ /**
79
+ * @description The field data to fill into the template. Can be a single object keyed by
80
+ * field ID or alias, or an array of objects for multi-page / repeating fills.
81
+ * Each value can be a primitive (string, number, boolean), or a value object
82
+ * with a `value` key alongside styling overrides.
83
+ */
84
+ data: {
85
+ [key: string]: string | number | boolean | {
86
+ value?: string | number | boolean;
87
+ };
88
+ } | {
89
+ [key: string]: string | number | boolean | {
90
+ value?: string | number | boolean;
91
+ };
92
+ }[];
93
+ /** @description Default text color for all fields, as a CSS hex color (e.g. `#FF0000`). */
94
+ textColor?: string;
95
+ /** @description Default font size in points for all fields. */
96
+ fontSize?: number;
97
+ /** @description Default font family name for all fields. */
98
+ fontFamily?: string;
99
+ /** @description Default border color for field bounding boxes, as a CSS hex color. */
100
+ borderColor?: string;
101
+ /**
102
+ * @description Default vertical alignment for text within fields.
103
+ * @enum {string}
104
+ */
105
+ verticalAlignment?: 'top' | 'middle' | 'bottom';
106
+ /** @description The character used to represent a checked checkbox. */
107
+ defaultCheckboxCharacter?: string;
108
+ /** @description When true, checkbox fields are rendered as squares instead of the default shape. */
109
+ defaultMakeCheckboxSquare?: boolean;
110
+ /**
111
+ * @description When true, the filled PDF will contain interactive AcroForm fields
112
+ * that can be edited by the recipient in a PDF viewer. Requires a paid plan.
113
+ */
114
+ useInteractiveFields?: boolean;
115
+ /** @description When true, draws visible bounding boxes around each field for debugging layout issues. */
116
+ drawDebugBoxes?: boolean;
117
+ /** @description When true, removes all PDF annotations from the output. */
118
+ stripAnnotations?: boolean;
119
+ /**
120
+ * @description Controls whether interactive AcroForm fields default to read-only.
121
+ * Only applicable when `useInteractiveFields` is true. Defaults to false
122
+ * when `useInteractiveFields` is enabled.
123
+ */
124
+ defaultReadOnly?: boolean;
125
+ };
126
+ /** @description Custom page dimensions and margins for the generated PDF. */
127
+ PageOptions: {
128
+ /** @description Page width with unit (e.g. `8.5in`, `210mm`). */
129
+ width?: string;
130
+ /** @description Page height with unit (e.g. `11in`, `297mm`). */
131
+ height?: string;
132
+ /** @description Shorthand margin for all sides (e.g. `0.5in`, `10mm 20mm`). */
133
+ margin?: string;
134
+ /** @description Top margin with unit. */
135
+ marginTop?: string;
136
+ /** @description Right margin with unit. */
137
+ marginRight?: string;
138
+ /** @description Bottom margin with unit. */
139
+ marginBottom?: string;
140
+ /** @description Left margin with unit. */
141
+ marginLeft?: string;
142
+ /**
143
+ * @description Position to render page numbers on each page.
144
+ * @enum {string}
145
+ */
146
+ pageCount?: 'topLeft' | 'topRight' | 'topCenter' | 'bottomLeft' | 'bottomRight' | 'bottomCenter';
147
+ };
148
+ /**
149
+ * @description Generate a PDF from structured Markdown-style content blocks.
150
+ * Each item in the `data` array represents a content section that
151
+ * can contain headings, labeled values, body text, or tables.
152
+ */
153
+ GenerateMarkdownPdfRequest: {
154
+ /** @description The document title. Used as the PDF metadata title and in the output filename. */
155
+ title?: string;
156
+ /**
157
+ * @description An array of content blocks that make up the PDF body. Each block
158
+ * can contain one or more of: `heading`, `label`, `content`, `table`.
159
+ */
160
+ data: {
161
+ /** @description A section heading rendered in a larger, bold font. */
162
+ heading?: string;
163
+ /** @description A label rendered in bold, typically used for key-value pairs. */
164
+ label?: string;
165
+ /** @description Body text content, rendered as a paragraph. Supports Markdown formatting. */
166
+ content?: string;
167
+ /** @description A table rendered inline in the PDF. */
168
+ table?: {
169
+ /** @description Table data as a 2D array of strings (array of rows, each row is an array of cell values). */
170
+ rows: string[][];
171
+ /** @description Per-column display options. */
172
+ columnOptions?: {
173
+ /**
174
+ * @description Horizontal text alignment for this column.
175
+ * @enum {string}
176
+ */
177
+ align?: 'left' | 'center' | 'right';
178
+ /** @description Column width as a percentage or pixel value (e.g. `25%`, `100px`). */
179
+ width?: string;
180
+ }[];
181
+ /**
182
+ * @description Vertical alignment of cell content.
183
+ * @enum {string}
184
+ */
185
+ verticalAlign?: 'top' | 'center' | 'bottom';
186
+ /** @description When true, the first row is rendered as a header row with bold styling. */
187
+ firstRowHeaders?: boolean;
188
+ /** @description When true, horizontal gridlines are drawn between rows. */
189
+ rowGridlines?: boolean;
190
+ /** @description When true, vertical gridlines are drawn between columns. */
191
+ columnGridlines?: boolean;
192
+ };
193
+ /** @description Font size override for this content block. */
194
+ fontSize?: number;
195
+ /** @description Text color override for this block, as a CSS hex color. */
196
+ textColor?: string;
197
+ /** @description Font family override for this content block. */
198
+ fontFamily?: string;
199
+ }[];
200
+ /** @description Default text color for the document, as a CSS hex color (e.g. `#333333`). */
201
+ textColor?: string;
202
+ /** @description Default font size in points for the document. */
203
+ fontSize?: number;
204
+ /** @description Default font family for the document. */
205
+ fontFamily?: string;
206
+ /**
207
+ * @description A logo image to display at the top of the PDF. Set to `false` to
208
+ * explicitly disable any default logo. Provide an object with a
209
+ * base64-encoded or URL image source to include a logo.
210
+ */
211
+ logo?: false | {
212
+ /** @description Image source: a base64-encoded data URI or an HTTPS URL. */
213
+ src: string;
214
+ /** @description Maximum width of the logo in pixels. */
215
+ maxWidth?: string | number;
216
+ /** @description Maximum height of the logo in pixels. */
217
+ maxHeight?: string | number;
218
+ };
219
+ /** @description When true, a timestamp is printed on the PDF showing when it was generated. */
220
+ includeTimestamp?: boolean;
221
+ page?: components['schemas']['PageOptions'];
222
+ };
223
+ /** @description Generate a PDF by rendering raw HTML and optional CSS. */
224
+ GenerateHtmlPdfRequest: {
225
+ /** @description The document title. Used as the PDF metadata title and in the output filename. */
226
+ title?: string;
227
+ /**
228
+ * @description Set to `html` to explicitly select HTML-to-PDF rendering.
229
+ * @enum {string}
230
+ */
231
+ type?: 'html';
232
+ /** @description The HTML content and optional CSS to render into a PDF. */
233
+ data: {
234
+ /** @description The HTML markup to render. This is the full body content of the PDF. */
235
+ html: string;
236
+ /** @description Optional CSS stylesheet applied to the HTML content during rendering. */
237
+ css?: string;
238
+ };
239
+ page?: components['schemas']['PageOptions'];
240
+ };
241
+ };
242
+ responses: never;
243
+ parameters: never;
244
+ requestBodies: never;
245
+ headers: never;
246
+ pathItems: never;
247
+ }
248
+ interface operations {
249
+ fillPdf: {
250
+ parameters: {
251
+ query?: {
252
+ /**
253
+ * @description The version number of the template to use. If omitted, the latest
254
+ * published version is used. Use this to pin fills to a specific
255
+ * template revision.
256
+ */
257
+ versionNumber?: number;
258
+ };
259
+ header?: never;
260
+ path: {
261
+ /** @description The EID (external identifier) of the PDF template (Cast) to fill. */
262
+ castEid: string;
263
+ };
264
+ cookie?: never;
265
+ };
266
+ requestBody: {
267
+ content: {
268
+ 'application/json': components['schemas']['FillPdfRequest'];
269
+ 'multipart/form-data': components['schemas']['FillPdfRequest'];
270
+ };
271
+ };
272
+ responses: {
273
+ /** @description The filled PDF document. */
274
+ 200: {
275
+ headers: {
276
+ [name: string]: unknown;
277
+ };
278
+ content: {
279
+ 'application/pdf': string;
280
+ };
281
+ };
282
+ /** @description Validation error — invalid or missing fields in the request body. */
283
+ 400: {
284
+ headers: {
285
+ [name: string]: unknown;
286
+ };
287
+ content?: never;
288
+ };
289
+ /** @description Authentication required — API key or OAuth token is missing or invalid. */
290
+ 401: {
291
+ headers: {
292
+ [name: string]: unknown;
293
+ };
294
+ content?: never;
295
+ };
296
+ /** @description Template not found — no Cast exists with the given EID, or the authenticated user lacks access. */
297
+ 404: {
298
+ headers: {
299
+ [name: string]: unknown;
300
+ };
301
+ content?: never;
302
+ };
303
+ /** @description Unsupported media type — Content-Type must be application/json or multipart/form-data. */
304
+ 415: {
305
+ headers: {
306
+ [name: string]: unknown;
307
+ };
308
+ content?: never;
309
+ };
310
+ /** @description Concurrency limit exceeded — too many simultaneous requests on a development API key. */
311
+ 429: {
312
+ headers: {
313
+ [name: string]: unknown;
314
+ };
315
+ content?: never;
316
+ };
317
+ };
318
+ };
319
+ generatePdf: {
320
+ parameters: {
321
+ query?: never;
322
+ header?: never;
323
+ path?: never;
324
+ cookie?: never;
325
+ };
326
+ requestBody: {
327
+ content: {
328
+ 'application/json': components['schemas']['GenerateMarkdownPdfRequest'] | components['schemas']['GenerateHtmlPdfRequest'];
329
+ 'multipart/form-data': components['schemas']['GenerateMarkdownPdfRequest'] | components['schemas']['GenerateHtmlPdfRequest'];
330
+ };
331
+ };
332
+ responses: {
333
+ /** @description The generated PDF document. */
334
+ 200: {
335
+ headers: {
336
+ [name: string]: unknown;
337
+ };
338
+ content: {
339
+ 'application/pdf': string;
340
+ };
341
+ };
342
+ /** @description Validation error — invalid or missing fields in the request body. */
343
+ 400: {
344
+ headers: {
345
+ [name: string]: unknown;
346
+ };
347
+ content?: never;
348
+ };
349
+ /** @description Authentication required — API key or OAuth token is missing or invalid. */
350
+ 401: {
351
+ headers: {
352
+ [name: string]: unknown;
353
+ };
354
+ content?: never;
355
+ };
356
+ /** @description Unsupported media type — Content-Type must be application/json or multipart/form-data. */
357
+ 415: {
358
+ headers: {
359
+ [name: string]: unknown;
360
+ };
361
+ content?: never;
362
+ };
363
+ /** @description Concurrency limit exceeded — too many simultaneous requests on a development API key. */
364
+ 429: {
365
+ headers: {
366
+ [name: string]: unknown;
367
+ };
368
+ content?: never;
369
+ };
370
+ };
371
+ };
372
+ }
373
+
374
+ export type { components, operations, paths };
@@ -0,0 +1,374 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ interface paths {
6
+ '/api/v1/fill/{castEid}.pdf': {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ get?: never;
14
+ put?: never;
15
+ /**
16
+ * Fill a PDF template
17
+ * @description Fills a PDF template (Cast) with the provided data and returns the resulting PDF.
18
+ *
19
+ * Templates are created and managed in the Anvil dashboard or via the GraphQL `createCast` mutation.
20
+ * Each template defines named fields (text, date, checkbox, signature, etc.) that can be populated via
21
+ * this endpoint. The field data can be supplied as a flat object keyed by field ID
22
+ * or alias, or as an array of objects for multi-page repeating templates.
23
+ *
24
+ * Supports both JSON and multipart/form-data request bodies. When using
25
+ * multipart/form-data, string values for `fontSize` and `page` are automatically
26
+ * parsed.
27
+ *
28
+ * Requires API key (Basic auth) or OAuth authentication. Development API keys
29
+ * produce watermarked PDFs; production keys produce clean PDFs and count toward
30
+ * your plan's usage.
31
+ */
32
+ post: operations['fillPdf'];
33
+ delete?: never;
34
+ options?: never;
35
+ head?: never;
36
+ patch?: never;
37
+ trace?: never;
38
+ };
39
+ '/api/v1/generate-pdf': {
40
+ parameters: {
41
+ query?: never;
42
+ header?: never;
43
+ path?: never;
44
+ cookie?: never;
45
+ };
46
+ get?: never;
47
+ put?: never;
48
+ /**
49
+ * Generate a PDF from HTML or Markdown
50
+ * @description Generates a PDF document from either Markdown content or raw HTML/CSS.
51
+ * The generation mode is determined automatically: if the request body
52
+ * contains `type: "html"` or the `data` property includes an `html` key,
53
+ * HTML-to-PDF rendering is used; otherwise, Markdown-to-PDF rendering is used.
54
+ *
55
+ * **Markdown mode** accepts structured content blocks (headings, labels,
56
+ * body text, and tables) and renders them into a styled PDF with optional
57
+ * logo, timestamp, and custom page dimensions.
58
+ *
59
+ * **HTML mode** accepts raw HTML and optional CSS, rendering them directly
60
+ * into a PDF with optional custom page dimensions.
61
+ *
62
+ * Supports both JSON and multipart/form-data request bodies. Requires API
63
+ * key (Basic auth) or OAuth authentication.
64
+ */
65
+ post: operations['generatePdf'];
66
+ delete?: never;
67
+ options?: never;
68
+ head?: never;
69
+ patch?: never;
70
+ trace?: never;
71
+ };
72
+ }
73
+ interface components {
74
+ schemas: {
75
+ FillPdfRequest: {
76
+ /** @description Custom title for the generated PDF. Overrides the template's default title. */
77
+ title?: string;
78
+ /**
79
+ * @description The field data to fill into the template. Can be a single object keyed by
80
+ * field ID or alias, or an array of objects for multi-page / repeating fills.
81
+ * Each value can be a primitive (string, number, boolean), or a value object
82
+ * with a `value` key alongside styling overrides.
83
+ */
84
+ data: {
85
+ [key: string]: string | number | boolean | {
86
+ value?: string | number | boolean;
87
+ };
88
+ } | {
89
+ [key: string]: string | number | boolean | {
90
+ value?: string | number | boolean;
91
+ };
92
+ }[];
93
+ /** @description Default text color for all fields, as a CSS hex color (e.g. `#FF0000`). */
94
+ textColor?: string;
95
+ /** @description Default font size in points for all fields. */
96
+ fontSize?: number;
97
+ /** @description Default font family name for all fields. */
98
+ fontFamily?: string;
99
+ /** @description Default border color for field bounding boxes, as a CSS hex color. */
100
+ borderColor?: string;
101
+ /**
102
+ * @description Default vertical alignment for text within fields.
103
+ * @enum {string}
104
+ */
105
+ verticalAlignment?: 'top' | 'middle' | 'bottom';
106
+ /** @description The character used to represent a checked checkbox. */
107
+ defaultCheckboxCharacter?: string;
108
+ /** @description When true, checkbox fields are rendered as squares instead of the default shape. */
109
+ defaultMakeCheckboxSquare?: boolean;
110
+ /**
111
+ * @description When true, the filled PDF will contain interactive AcroForm fields
112
+ * that can be edited by the recipient in a PDF viewer. Requires a paid plan.
113
+ */
114
+ useInteractiveFields?: boolean;
115
+ /** @description When true, draws visible bounding boxes around each field for debugging layout issues. */
116
+ drawDebugBoxes?: boolean;
117
+ /** @description When true, removes all PDF annotations from the output. */
118
+ stripAnnotations?: boolean;
119
+ /**
120
+ * @description Controls whether interactive AcroForm fields default to read-only.
121
+ * Only applicable when `useInteractiveFields` is true. Defaults to false
122
+ * when `useInteractiveFields` is enabled.
123
+ */
124
+ defaultReadOnly?: boolean;
125
+ };
126
+ /** @description Custom page dimensions and margins for the generated PDF. */
127
+ PageOptions: {
128
+ /** @description Page width with unit (e.g. `8.5in`, `210mm`). */
129
+ width?: string;
130
+ /** @description Page height with unit (e.g. `11in`, `297mm`). */
131
+ height?: string;
132
+ /** @description Shorthand margin for all sides (e.g. `0.5in`, `10mm 20mm`). */
133
+ margin?: string;
134
+ /** @description Top margin with unit. */
135
+ marginTop?: string;
136
+ /** @description Right margin with unit. */
137
+ marginRight?: string;
138
+ /** @description Bottom margin with unit. */
139
+ marginBottom?: string;
140
+ /** @description Left margin with unit. */
141
+ marginLeft?: string;
142
+ /**
143
+ * @description Position to render page numbers on each page.
144
+ * @enum {string}
145
+ */
146
+ pageCount?: 'topLeft' | 'topRight' | 'topCenter' | 'bottomLeft' | 'bottomRight' | 'bottomCenter';
147
+ };
148
+ /**
149
+ * @description Generate a PDF from structured Markdown-style content blocks.
150
+ * Each item in the `data` array represents a content section that
151
+ * can contain headings, labeled values, body text, or tables.
152
+ */
153
+ GenerateMarkdownPdfRequest: {
154
+ /** @description The document title. Used as the PDF metadata title and in the output filename. */
155
+ title?: string;
156
+ /**
157
+ * @description An array of content blocks that make up the PDF body. Each block
158
+ * can contain one or more of: `heading`, `label`, `content`, `table`.
159
+ */
160
+ data: {
161
+ /** @description A section heading rendered in a larger, bold font. */
162
+ heading?: string;
163
+ /** @description A label rendered in bold, typically used for key-value pairs. */
164
+ label?: string;
165
+ /** @description Body text content, rendered as a paragraph. Supports Markdown formatting. */
166
+ content?: string;
167
+ /** @description A table rendered inline in the PDF. */
168
+ table?: {
169
+ /** @description Table data as a 2D array of strings (array of rows, each row is an array of cell values). */
170
+ rows: string[][];
171
+ /** @description Per-column display options. */
172
+ columnOptions?: {
173
+ /**
174
+ * @description Horizontal text alignment for this column.
175
+ * @enum {string}
176
+ */
177
+ align?: 'left' | 'center' | 'right';
178
+ /** @description Column width as a percentage or pixel value (e.g. `25%`, `100px`). */
179
+ width?: string;
180
+ }[];
181
+ /**
182
+ * @description Vertical alignment of cell content.
183
+ * @enum {string}
184
+ */
185
+ verticalAlign?: 'top' | 'center' | 'bottom';
186
+ /** @description When true, the first row is rendered as a header row with bold styling. */
187
+ firstRowHeaders?: boolean;
188
+ /** @description When true, horizontal gridlines are drawn between rows. */
189
+ rowGridlines?: boolean;
190
+ /** @description When true, vertical gridlines are drawn between columns. */
191
+ columnGridlines?: boolean;
192
+ };
193
+ /** @description Font size override for this content block. */
194
+ fontSize?: number;
195
+ /** @description Text color override for this block, as a CSS hex color. */
196
+ textColor?: string;
197
+ /** @description Font family override for this content block. */
198
+ fontFamily?: string;
199
+ }[];
200
+ /** @description Default text color for the document, as a CSS hex color (e.g. `#333333`). */
201
+ textColor?: string;
202
+ /** @description Default font size in points for the document. */
203
+ fontSize?: number;
204
+ /** @description Default font family for the document. */
205
+ fontFamily?: string;
206
+ /**
207
+ * @description A logo image to display at the top of the PDF. Set to `false` to
208
+ * explicitly disable any default logo. Provide an object with a
209
+ * base64-encoded or URL image source to include a logo.
210
+ */
211
+ logo?: false | {
212
+ /** @description Image source: a base64-encoded data URI or an HTTPS URL. */
213
+ src: string;
214
+ /** @description Maximum width of the logo in pixels. */
215
+ maxWidth?: string | number;
216
+ /** @description Maximum height of the logo in pixels. */
217
+ maxHeight?: string | number;
218
+ };
219
+ /** @description When true, a timestamp is printed on the PDF showing when it was generated. */
220
+ includeTimestamp?: boolean;
221
+ page?: components['schemas']['PageOptions'];
222
+ };
223
+ /** @description Generate a PDF by rendering raw HTML and optional CSS. */
224
+ GenerateHtmlPdfRequest: {
225
+ /** @description The document title. Used as the PDF metadata title and in the output filename. */
226
+ title?: string;
227
+ /**
228
+ * @description Set to `html` to explicitly select HTML-to-PDF rendering.
229
+ * @enum {string}
230
+ */
231
+ type?: 'html';
232
+ /** @description The HTML content and optional CSS to render into a PDF. */
233
+ data: {
234
+ /** @description The HTML markup to render. This is the full body content of the PDF. */
235
+ html: string;
236
+ /** @description Optional CSS stylesheet applied to the HTML content during rendering. */
237
+ css?: string;
238
+ };
239
+ page?: components['schemas']['PageOptions'];
240
+ };
241
+ };
242
+ responses: never;
243
+ parameters: never;
244
+ requestBodies: never;
245
+ headers: never;
246
+ pathItems: never;
247
+ }
248
+ interface operations {
249
+ fillPdf: {
250
+ parameters: {
251
+ query?: {
252
+ /**
253
+ * @description The version number of the template to use. If omitted, the latest
254
+ * published version is used. Use this to pin fills to a specific
255
+ * template revision.
256
+ */
257
+ versionNumber?: number;
258
+ };
259
+ header?: never;
260
+ path: {
261
+ /** @description The EID (external identifier) of the PDF template (Cast) to fill. */
262
+ castEid: string;
263
+ };
264
+ cookie?: never;
265
+ };
266
+ requestBody: {
267
+ content: {
268
+ 'application/json': components['schemas']['FillPdfRequest'];
269
+ 'multipart/form-data': components['schemas']['FillPdfRequest'];
270
+ };
271
+ };
272
+ responses: {
273
+ /** @description The filled PDF document. */
274
+ 200: {
275
+ headers: {
276
+ [name: string]: unknown;
277
+ };
278
+ content: {
279
+ 'application/pdf': string;
280
+ };
281
+ };
282
+ /** @description Validation error — invalid or missing fields in the request body. */
283
+ 400: {
284
+ headers: {
285
+ [name: string]: unknown;
286
+ };
287
+ content?: never;
288
+ };
289
+ /** @description Authentication required — API key or OAuth token is missing or invalid. */
290
+ 401: {
291
+ headers: {
292
+ [name: string]: unknown;
293
+ };
294
+ content?: never;
295
+ };
296
+ /** @description Template not found — no Cast exists with the given EID, or the authenticated user lacks access. */
297
+ 404: {
298
+ headers: {
299
+ [name: string]: unknown;
300
+ };
301
+ content?: never;
302
+ };
303
+ /** @description Unsupported media type — Content-Type must be application/json or multipart/form-data. */
304
+ 415: {
305
+ headers: {
306
+ [name: string]: unknown;
307
+ };
308
+ content?: never;
309
+ };
310
+ /** @description Concurrency limit exceeded — too many simultaneous requests on a development API key. */
311
+ 429: {
312
+ headers: {
313
+ [name: string]: unknown;
314
+ };
315
+ content?: never;
316
+ };
317
+ };
318
+ };
319
+ generatePdf: {
320
+ parameters: {
321
+ query?: never;
322
+ header?: never;
323
+ path?: never;
324
+ cookie?: never;
325
+ };
326
+ requestBody: {
327
+ content: {
328
+ 'application/json': components['schemas']['GenerateMarkdownPdfRequest'] | components['schemas']['GenerateHtmlPdfRequest'];
329
+ 'multipart/form-data': components['schemas']['GenerateMarkdownPdfRequest'] | components['schemas']['GenerateHtmlPdfRequest'];
330
+ };
331
+ };
332
+ responses: {
333
+ /** @description The generated PDF document. */
334
+ 200: {
335
+ headers: {
336
+ [name: string]: unknown;
337
+ };
338
+ content: {
339
+ 'application/pdf': string;
340
+ };
341
+ };
342
+ /** @description Validation error — invalid or missing fields in the request body. */
343
+ 400: {
344
+ headers: {
345
+ [name: string]: unknown;
346
+ };
347
+ content?: never;
348
+ };
349
+ /** @description Authentication required — API key or OAuth token is missing or invalid. */
350
+ 401: {
351
+ headers: {
352
+ [name: string]: unknown;
353
+ };
354
+ content?: never;
355
+ };
356
+ /** @description Unsupported media type — Content-Type must be application/json or multipart/form-data. */
357
+ 415: {
358
+ headers: {
359
+ [name: string]: unknown;
360
+ };
361
+ content?: never;
362
+ };
363
+ /** @description Concurrency limit exceeded — too many simultaneous requests on a development API key. */
364
+ 429: {
365
+ headers: {
366
+ [name: string]: unknown;
367
+ };
368
+ content?: never;
369
+ };
370
+ };
371
+ };
372
+ }
373
+
374
+ export type { components, operations, paths };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@anvilco/types",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript types generated from the Anvil OpenAPI spec",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "prepack": "yarn build",
21
+ "build": "tsup",
22
+ "generate:rest": "openapi-typescript https://app.useanvil.com/api/v1/openapi.json -o src/rest.ts && prettier --write src/rest.ts",
23
+ "test": "echo 'No tests for types package'",
24
+ "typecheck": "tsc --noEmit",
25
+ "lint": "eslint src"
26
+ },
27
+ "keywords": [
28
+ "anvil",
29
+ "pdf",
30
+ "typescript",
31
+ "openapi"
32
+ ],
33
+ "license": "MIT",
34
+ "homepage": "https://github.com/anvilco/anvil-js/tree/main/packages/types#readme",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/anvilco/anvil-js.git",
38
+ "directory": "packages/types"
39
+ },
40
+ "sideEffects": false,
41
+ "engines": {
42
+ "node": ">=18.0.0"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "devDependencies": {
48
+ "openapi-typescript": "^7.13.0",
49
+ "prettier": "^3.8.3",
50
+ "tsup": "^8.0.0"
51
+ }
52
+ }