Skip to content

Commit b1896db

Browse files
feat(api): api update
1 parent 471570b commit b1896db

12 files changed

Lines changed: 678 additions & 4 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/unlayer/unlayer-3d1f50d8fdb57c0bbafaa16aeffc061ee7532ed5a9823bacbce1cc0916c008b9.yml
3-
openapi_spec_hash: 97d36fb19154cc936e9ef2558965e290
4-
config_hash: 20e7fbba9d423291aaf676f6a629dcaf
1+
configured_endpoints: 14
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/unlayer/unlayer-8f62b635191810fa318afdeaabbbb0276b0e1f85f18b5ff2ddaad9a18241f047.yml
3+
openapi_spec_hash: e80a61e80827f2a822db46f4ba82c15d
4+
config_hash: 2949daec69cb6f5d34ae232544245952

api.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,46 @@ Methods:
4040

4141
- <code title="post /v3/templates/convert/simple-to-full">client.templates.convertSimpleToFull.<a href="./src/resources/templates/convert-simple-to-full.ts">create</a>({ ...params }) -> ConvertSimpleToFullCreateResponse</code>
4242

43+
## ExportHTML
44+
45+
Types:
46+
47+
- <code><a href="./src/resources/templates/export-html.ts">ExportHTMLCreateResponse</a></code>
48+
49+
Methods:
50+
51+
- <code title="post /v3/templates/export/html">client.templates.exportHTML.<a href="./src/resources/templates/export-html.ts">create</a>({ ...params }) -> ExportHTMLCreateResponse</code>
52+
53+
## ExportImage
54+
55+
Types:
56+
57+
- <code><a href="./src/resources/templates/export-image.ts">ExportImageCreateResponse</a></code>
58+
59+
Methods:
60+
61+
- <code title="post /v3/templates/export/image">client.templates.exportImage.<a href="./src/resources/templates/export-image.ts">create</a>({ ...params }) -> ExportImageCreateResponse</code>
62+
63+
## ExportPdf
64+
65+
Types:
66+
67+
- <code><a href="./src/resources/templates/export-pdf.ts">ExportPdfCreateResponse</a></code>
68+
69+
Methods:
70+
71+
- <code title="post /v3/templates/export/pdf">client.templates.exportPdf.<a href="./src/resources/templates/export-pdf.ts">create</a>({ ...params }) -> ExportPdfCreateResponse</code>
72+
73+
## ExportZip
74+
75+
Types:
76+
77+
- <code><a href="./src/resources/templates/export-zip.ts">ExportZipCreateResponse</a></code>
78+
79+
Methods:
80+
81+
- <code title="post /v3/templates/export/zip">client.templates.exportZip.<a href="./src/resources/templates/export-zip.ts">create</a>({ ...params }) -> ExportZipCreateResponse</code>
82+
4383
## Generate
4484

4585
Types:
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../core/resource';
4+
import { APIPromise } from '../../core/api-promise';
5+
import { RequestOptions } from '../../internal/request-options';
6+
7+
export class ExportHTML extends APIResource {
8+
/**
9+
* Export a design as rendered HTML.
10+
*/
11+
create(params: ExportHTMLCreateParams, options?: RequestOptions): APIPromise<ExportHTMLCreateResponse> {
12+
const { projectId, ...body } = params;
13+
return this._client.post('/v3/templates/export/html', { query: { projectId }, body, ...options });
14+
}
15+
}
16+
17+
export interface ExportHTMLCreateResponse {
18+
data?: ExportHTMLCreateResponse.Data;
19+
20+
success?: boolean;
21+
}
22+
23+
export namespace ExportHTMLCreateResponse {
24+
export interface Data {
25+
chunks?: Data.Chunks;
26+
27+
html?: string;
28+
}
29+
30+
export namespace Data {
31+
export interface Chunks {
32+
body?: string;
33+
34+
css?: string;
35+
36+
fonts?: Array<unknown>;
37+
38+
js?: string;
39+
}
40+
}
41+
}
42+
43+
export interface ExportHTMLCreateParams {
44+
/**
45+
* Body param: Unlayer design JSON
46+
*/
47+
design: unknown;
48+
49+
/**
50+
* Query param: The project ID (required for PAT auth, auto-resolved for API key
51+
* auth)
52+
*/
53+
projectId?: string;
54+
55+
/**
56+
* Body param
57+
*/
58+
customJS?: string | Array<string>;
59+
60+
/**
61+
* Body param
62+
*/
63+
designTags?: unknown;
64+
65+
/**
66+
* Body param
67+
*/
68+
designTagsConfig?: unknown;
69+
70+
/**
71+
* Body param
72+
*/
73+
displayMode?: 'email' | 'web' | 'popup' | 'document';
74+
75+
/**
76+
* Body param
77+
*/
78+
editorVersion?: string;
79+
80+
/**
81+
* Body param
82+
*/
83+
language?: string;
84+
85+
/**
86+
* Body param
87+
*/
88+
languages?: Array<string>;
89+
90+
/**
91+
* Body param
92+
*/
93+
mergeTags?: unknown;
94+
95+
/**
96+
* Body param
97+
*/
98+
mergeTagsSchema?: unknown;
99+
100+
/**
101+
* Body param
102+
*/
103+
safeHtml?: boolean;
104+
}
105+
106+
export declare namespace ExportHTML {
107+
export {
108+
type ExportHTMLCreateResponse as ExportHTMLCreateResponse,
109+
type ExportHTMLCreateParams as ExportHTMLCreateParams,
110+
};
111+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../core/resource';
4+
import { APIPromise } from '../../core/api-promise';
5+
import { RequestOptions } from '../../internal/request-options';
6+
7+
export class ExportImage extends APIResource {
8+
/**
9+
* Export a design as a PNG image.
10+
*/
11+
create(params: ExportImageCreateParams, options?: RequestOptions): APIPromise<ExportImageCreateResponse> {
12+
const { projectId, ...body } = params;
13+
return this._client.post('/v3/templates/export/image', { query: { projectId }, body, ...options });
14+
}
15+
}
16+
17+
export interface ExportImageCreateResponse {
18+
data?: ExportImageCreateResponse.Data;
19+
20+
success?: boolean;
21+
}
22+
23+
export namespace ExportImageCreateResponse {
24+
export interface Data {
25+
url?: string;
26+
}
27+
}
28+
29+
export interface ExportImageCreateParams {
30+
/**
31+
* Body param: Unlayer design JSON
32+
*/
33+
design: unknown;
34+
35+
/**
36+
* Query param: The project ID (required for PAT auth, auto-resolved for API key
37+
* auth)
38+
*/
39+
projectId?: string;
40+
41+
/**
42+
* Body param
43+
*/
44+
customJS?: string | Array<string>;
45+
46+
/**
47+
* Body param
48+
*/
49+
designTags?: unknown;
50+
51+
/**
52+
* Body param
53+
*/
54+
designTagsConfig?: unknown;
55+
56+
/**
57+
* Body param
58+
*/
59+
deviceScaleFactor?: number;
60+
61+
/**
62+
* Body param
63+
*/
64+
displayMode?: 'email' | 'web' | 'popup' | 'document';
65+
66+
/**
67+
* Body param
68+
*/
69+
editorVersion?: string;
70+
71+
/**
72+
* Body param
73+
*/
74+
fullPage?: boolean;
75+
76+
/**
77+
* Body param
78+
*/
79+
height?: number;
80+
81+
/**
82+
* Body param
83+
*/
84+
language?: string;
85+
86+
/**
87+
* Body param
88+
*/
89+
languages?: Array<string>;
90+
91+
/**
92+
* Body param
93+
*/
94+
mergeTags?: unknown;
95+
96+
/**
97+
* Body param
98+
*/
99+
mergeTagsSchema?: unknown;
100+
101+
/**
102+
* Body param
103+
*/
104+
safeHtml?: boolean;
105+
106+
/**
107+
* Body param
108+
*/
109+
width?: number;
110+
}
111+
112+
export declare namespace ExportImage {
113+
export {
114+
type ExportImageCreateResponse as ExportImageCreateResponse,
115+
type ExportImageCreateParams as ExportImageCreateParams,
116+
};
117+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../core/resource';
4+
import { APIPromise } from '../../core/api-promise';
5+
import { RequestOptions } from '../../internal/request-options';
6+
7+
export class ExportPdf extends APIResource {
8+
/**
9+
* Export a design as a PDF document.
10+
*/
11+
create(params: ExportPdfCreateParams, options?: RequestOptions): APIPromise<ExportPdfCreateResponse> {
12+
const { projectId, ...body } = params;
13+
return this._client.post('/v3/templates/export/pdf', { query: { projectId }, body, ...options });
14+
}
15+
}
16+
17+
export interface ExportPdfCreateResponse {
18+
data?: ExportPdfCreateResponse.Data;
19+
20+
success?: boolean;
21+
}
22+
23+
export namespace ExportPdfCreateResponse {
24+
export interface Data {
25+
url?: string;
26+
}
27+
}
28+
29+
export interface ExportPdfCreateParams {
30+
/**
31+
* Body param: Unlayer design JSON
32+
*/
33+
design: unknown;
34+
35+
/**
36+
* Query param: The project ID (required for PAT auth, auto-resolved for API key
37+
* auth)
38+
*/
39+
projectId?: string;
40+
41+
/**
42+
* Body param
43+
*/
44+
contentWidth?: number | 'full';
45+
46+
/**
47+
* Body param
48+
*/
49+
customJS?: string | Array<string>;
50+
51+
/**
52+
* Body param
53+
*/
54+
designTags?: unknown;
55+
56+
/**
57+
* Body param
58+
*/
59+
designTagsConfig?: unknown;
60+
61+
/**
62+
* Body param
63+
*/
64+
displayMode?: 'email' | 'web' | 'popup' | 'document';
65+
66+
/**
67+
* Body param
68+
*/
69+
editorVersion?: string;
70+
71+
/**
72+
* Body param
73+
*/
74+
language?: string;
75+
76+
/**
77+
* Body param
78+
*/
79+
languages?: Array<string>;
80+
81+
/**
82+
* Body param
83+
*/
84+
mergeTags?: unknown;
85+
86+
/**
87+
* Body param
88+
*/
89+
mergeTagsSchema?: unknown;
90+
91+
/**
92+
* Body param
93+
*/
94+
pageSize?: 'Letter' | 'Legal' | 'Tabloid' | 'Ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6';
95+
96+
/**
97+
* Body param
98+
*/
99+
safeHtml?: boolean;
100+
}
101+
102+
export declare namespace ExportPdf {
103+
export {
104+
type ExportPdfCreateResponse as ExportPdfCreateResponse,
105+
type ExportPdfCreateParams as ExportPdfCreateParams,
106+
};
107+
}

0 commit comments

Comments
 (0)