@templr/sdk 0.3.0 → 0.4.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/CHANGELOG.md +19 -0
- package/README.md +50 -15
- package/dist/client.d.ts +4 -1
- package/dist/client.js +5 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +6 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/resources/asset-folders.d.ts +15 -0
- package/dist/resources/asset-folders.js +19 -0
- package/dist/resources/assets.d.ts +48 -3
- package/dist/resources/assets.js +39 -3
- package/dist/resources/templates.d.ts +47 -3
- package/dist/resources/templates.js +41 -3
- package/dist/schemas.d.ts +80 -2
- package/dist/schemas.js +20 -1
- package/dist/transport.js +3 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,25 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.0] - 2026-12-05
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `templates.create` and `templates.update` to create templates as drafts and change their name, document
|
|
15
|
+
or brand kit, with the `CreateTemplateOptions`, `UpdateTemplateOptions` and `SavedTemplate` types. They
|
|
16
|
+
return `editorUrl`, the link that opens the template in the editor, and require a `write` key.
|
|
17
|
+
- `UnprocessableEntityError` for 422 responses: a template document that does not match the document
|
|
18
|
+
model (`invalid_document`), with every problem in `issues`.
|
|
19
|
+
- `brandKitId` field in `Template` (`null` for the workspace default brand kit, or when the instance does
|
|
20
|
+
not return it).
|
|
21
|
+
- `assetFolders.list` to list the image folders of the workspace, with the `AssetFolder` type.
|
|
22
|
+
- `folder` and `search` options in `assets.list`: the images of one folder (`root` for those outside every
|
|
23
|
+
folder) and those whose file name or description contains a text (`ListAssetsOptions`).
|
|
24
|
+
- `assets.importFromUrl` to upload an image from a public URL (`ImportAssetOptions`), and `assets.update`
|
|
25
|
+
to change its description and folder (`UpdateAssetOptions`). Both require a `write` key.
|
|
26
|
+
- `description`, `folderId`, `width`, `height` and `previewUrl` fields in `Asset`. Sizes in pixels are read
|
|
27
|
+
by the server from the image; `previewUrl` is the image `url` with instances that do not return previews.
|
|
28
|
+
|
|
10
29
|
## [0.3.0] - 2026-12-04
|
|
11
30
|
|
|
12
31
|
### Added
|
package/README.md
CHANGED
|
@@ -89,6 +89,24 @@ const email = await templr.templates.render(templateId, { values: { name: 'Ada',
|
|
|
89
89
|
const preview = await templr.templates.render(templateId, { draft: true, values: { name: 'Ada' } });
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
+
### Creating and updating templates
|
|
93
|
+
|
|
94
|
+
With a `write` key you can create templates and change their drafts. The document is TipTap JSON that
|
|
95
|
+
must match the `TemplateDocumentModel` schema of the OpenAPI document; otherwise the API answers with an
|
|
96
|
+
`UnprocessableEntityError` whose `issues` list every problem. Nothing is published: templates are
|
|
97
|
+
published from the editor, at the returned `editorUrl`.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
const created = await templr.templates.create({
|
|
101
|
+
document: { content: [{ content: [{ text: 'Hello', type: 'text' }], type: 'paragraph' }], type: 'doc' },
|
|
102
|
+
name: 'Welcome',
|
|
103
|
+
}); // brandKitId: '...' for a brand kit other than the workspace default
|
|
104
|
+
console.log(created.editorUrl);
|
|
105
|
+
|
|
106
|
+
// Change the name, the document, the brand kit (null for the workspace default) or several of them
|
|
107
|
+
await templr.templates.update(created.id, { name: 'Welcome email' });
|
|
108
|
+
```
|
|
109
|
+
|
|
92
110
|
### Variables
|
|
93
111
|
|
|
94
112
|
The variables of a template are the values `render` takes. Each key appears once, in document order.
|
|
@@ -154,8 +172,24 @@ if (!response.ok) throw new Error(`Upload failed with ${response.status}`);
|
|
|
154
172
|
const confirmed = await templr.assets.confirm(upload.assetId);
|
|
155
173
|
```
|
|
156
174
|
|
|
175
|
+
The server reads the `width` and `height` of every confirmed image from the image itself, and stores a
|
|
176
|
+
small WebP preview (`previewUrl`, at most 256 pixels on its longest side).
|
|
177
|
+
|
|
178
|
+
An image can also be uploaded from a public URL: the server downloads it (PNG, JPEG, GIF or WebP, up to
|
|
179
|
+
5 MiB) and stores it. URLs that point to private addresses are refused with a `BadRequestError`.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
const hero = await templr.assets.importFromUrl('https://images.example.com/hero.png', { description: 'Summer hero', name: 'hero.png' });
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Images can be grouped in folders, searched by file name or description, described and moved:
|
|
186
|
+
|
|
157
187
|
```ts
|
|
158
|
-
const
|
|
188
|
+
const folders = await templr.assetFolders.list(); // [{ id, name, assetCount, ... }]
|
|
189
|
+
const inFolder = await templr.assets.list({ folder: folders[0].id, search: 'logo' });
|
|
190
|
+
const atRoot = await templr.assets.list({ folder: 'root' });
|
|
191
|
+
|
|
192
|
+
await templr.assets.update(asset.id, { description: 'Company logo', folderId: null }); // null moves it to the root
|
|
159
193
|
await templr.assets.delete(asset.id); // Templates that use it will show a broken image
|
|
160
194
|
```
|
|
161
195
|
|
|
@@ -210,20 +244,21 @@ try {
|
|
|
210
244
|
}
|
|
211
245
|
```
|
|
212
246
|
|
|
213
|
-
| Error
|
|
214
|
-
|
|
|
215
|
-
| `BadRequestError`
|
|
216
|
-
| `AuthenticationError`
|
|
217
|
-
| `PermissionDeniedError`
|
|
218
|
-
| `NotFoundError`
|
|
219
|
-
| `ConflictError`
|
|
220
|
-
| `PayloadTooLargeError`
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
247
|
+
| Error | Status | API codes |
|
|
248
|
+
| -------------------------- | ------ | ---------------------------------------------------------------------------------------------- |
|
|
249
|
+
| `BadRequestError` | 400 | `invalid_input`, `validation_error` |
|
|
250
|
+
| `AuthenticationError` | 401 | `unauthorized` |
|
|
251
|
+
| `PermissionDeniedError` | 403 | `forbidden` |
|
|
252
|
+
| `NotFoundError` | 404 | `not_found` |
|
|
253
|
+
| `ConflictError` | 409 | `upload_missing`, `conflict` |
|
|
254
|
+
| `PayloadTooLargeError` | 413 | `payload_too_large` |
|
|
255
|
+
| `UnprocessableEntityError` | 422 | `invalid_document` |
|
|
256
|
+
| `RateLimitError` | 429 | `rate_limited` |
|
|
257
|
+
| `InternalServerError` | 5xx | `internal_error`, `database_error`, `render_failed`, `storage_error`, `storage_not_configured` |
|
|
258
|
+
| `UploadError` | bucket | `upload_failed`: the storage bucket rejected the file sent by `assets.upload` |
|
|
259
|
+
| `APIConnectionError` | none | `connection_error` |
|
|
260
|
+
| `APITimeoutError` | none | `timeout` |
|
|
261
|
+
| `UnexpectedResponseError` | 2xx | `unexpected_response`: the server answered with a body this SDK does not understand |
|
|
227
262
|
|
|
228
263
|
An error response without a Templr error body (for example, an HTML page from a proxy) throws the class
|
|
229
264
|
of its status with the code `unknown_error`. Invalid options (an empty `apiKey`, or a `baseUrl` that is
|
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
import { AssetFolders } from './resources/asset-folders.js';
|
|
6
7
|
import { Assets } from './resources/assets.js';
|
|
7
8
|
import { AuditEvents } from './resources/audit-events.js';
|
|
8
9
|
import { Payments } from './resources/payments.js';
|
|
@@ -36,8 +37,10 @@ export declare class Templr {
|
|
|
36
37
|
#private;
|
|
37
38
|
/** List, get and render templates. */
|
|
38
39
|
readonly templates: Templates;
|
|
39
|
-
/** Upload, list and delete images. */
|
|
40
|
+
/** Upload, list, search, organize and delete images. */
|
|
40
41
|
readonly assets: Assets;
|
|
42
|
+
/** Folders of images. */
|
|
43
|
+
readonly assetFolders: AssetFolders;
|
|
41
44
|
/** Read the audit log; requires a key with the `audit` grant. */
|
|
42
45
|
readonly auditEvents: AuditEvents;
|
|
43
46
|
/** Read the payments of the workspace owner's subscription; requires a key with the `billing` grant. */
|
package/dist/client.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
import { AssetFolders } from './resources/asset-folders.js';
|
|
6
7
|
import { Assets } from './resources/assets.js';
|
|
7
8
|
import { AuditEvents } from './resources/audit-events.js';
|
|
8
9
|
import { Payments } from './resources/payments.js';
|
|
@@ -24,8 +25,10 @@ import { DEFAULT_TIMEOUT_MS, Transport } from './transport.js';
|
|
|
24
25
|
export class Templr {
|
|
25
26
|
/** List, get and render templates. */
|
|
26
27
|
templates;
|
|
27
|
-
/** Upload, list and delete images. */
|
|
28
|
+
/** Upload, list, search, organize and delete images. */
|
|
28
29
|
assets;
|
|
30
|
+
/** Folders of images. */
|
|
31
|
+
assetFolders;
|
|
29
32
|
/** Read the audit log; requires a key with the `audit` grant. */
|
|
30
33
|
auditEvents;
|
|
31
34
|
/** Read the payments of the workspace owner's subscription; requires a key with the `billing` grant. */
|
|
@@ -45,6 +48,7 @@ export class Templr {
|
|
|
45
48
|
});
|
|
46
49
|
this.templates = new Templates(this.#transport);
|
|
47
50
|
this.assets = new Assets(this.#transport);
|
|
51
|
+
this.assetFolders = new AssetFolders(this.#transport);
|
|
48
52
|
this.auditEvents = new AuditEvents(this.#transport);
|
|
49
53
|
this.payments = new Payments(this.#transport);
|
|
50
54
|
}
|
package/dist/errors.d.ts
CHANGED
|
@@ -80,6 +80,12 @@ export declare class NotFoundError extends APIError {
|
|
|
80
80
|
*/
|
|
81
81
|
export declare class ConflictError extends APIError {
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* 422: the template document does not match the document model
|
|
85
|
+
* (`invalid_document`); `issues` lists every problem, each naming the block it is in.
|
|
86
|
+
*/
|
|
87
|
+
export declare class UnprocessableEntityError extends APIError {
|
|
88
|
+
}
|
|
83
89
|
/** 413: the request body is too large (`payload_too_large`). */
|
|
84
90
|
export declare class PayloadTooLargeError extends APIError {
|
|
85
91
|
}
|
package/dist/errors.js
CHANGED
|
@@ -90,6 +90,12 @@ export class NotFoundError extends APIError {
|
|
|
90
90
|
*/
|
|
91
91
|
export class ConflictError extends APIError {
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* 422: the template document does not match the document model
|
|
95
|
+
* (`invalid_document`); `issues` lists every problem, each naming the block it is in.
|
|
96
|
+
*/
|
|
97
|
+
export class UnprocessableEntityError extends APIError {
|
|
98
|
+
}
|
|
93
99
|
/** 413: the request body is too large (`payload_too_large`). */
|
|
94
100
|
export class PayloadTooLargeError extends APIError {
|
|
95
101
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
15
|
export { Templr, type TemplrOptions } from './client.js';
|
|
16
|
-
export { APIConnectionError, APIError, type APIErrorDetails, APITimeoutError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PayloadTooLargeError, PermissionDeniedError, RateLimitError, TemplrError, UnexpectedResponseError, UploadError, } from './errors.js';
|
|
17
|
-
export type {
|
|
16
|
+
export { APIConnectionError, APIError, type APIErrorDetails, APITimeoutError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PayloadTooLargeError, PermissionDeniedError, RateLimitError, TemplrError, UnexpectedResponseError, UnprocessableEntityError, UploadError, } from './errors.js';
|
|
17
|
+
export type { AssetFolders } from './resources/asset-folders.js';
|
|
18
|
+
export type { Assets, CreateUploadOptions, ImportAssetOptions, ListAssetsOptions, UpdateAssetOptions, UploadOptions } from './resources/assets.js';
|
|
18
19
|
export type { AuditEvents } from './resources/audit-events.js';
|
|
19
20
|
export type { Payments } from './resources/payments.js';
|
|
20
|
-
export type { ListOptions, ListTemplatesOptions, ListVariablesOptions, RenderOptions, SortOrder, Templates, UpdateVariableOptions } from './resources/templates.js';
|
|
21
|
-
export type { Asset, AssetUpload, AuditEvent, Deleted, ImageContentType, JsonValue, OpenApiDocument, Page, Payment, PresignedUpload, RenderedTemplate, Template, TemplateDocument, TemplateMark, TemplateNode, TemplateSummary, TemplateVariable, TemplateVersion, TemplateVersionSummary, } from './schemas.js';
|
|
21
|
+
export type { CreateTemplateOptions, ListOptions, ListTemplatesOptions, ListVariablesOptions, RenderOptions, SortOrder, Templates, UpdateTemplateOptions, UpdateVariableOptions, } from './resources/templates.js';
|
|
22
|
+
export type { Asset, AssetFolder, AssetUpload, AuditEvent, Deleted, ImageContentType, JsonValue, OpenApiDocument, Page, Payment, PresignedUpload, RenderedTemplate, SavedTemplate, Template, TemplateDocument, TemplateMark, TemplateNode, TemplateSummary, TemplateVariable, TemplateVersion, TemplateVersionSummary, } from './schemas.js';
|
|
22
23
|
export type { Fetch } from './transport.js';
|
|
23
24
|
export { VERSION } from './version.js';
|
package/dist/index.js
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
15
|
export { Templr } from './client.js';
|
|
16
|
-
export { APIConnectionError, APIError, APITimeoutError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PayloadTooLargeError, PermissionDeniedError, RateLimitError, TemplrError, UnexpectedResponseError, UploadError, } from './errors.js';
|
|
16
|
+
export { APIConnectionError, APIError, APITimeoutError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PayloadTooLargeError, PermissionDeniedError, RateLimitError, TemplrError, UnexpectedResponseError, UnprocessableEntityError, UploadError, } from './errors.js';
|
|
17
17
|
export { VERSION } from './version.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `assetFolders` resource: the folders that group the images of the workspace.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type AssetFolder } from '../schemas.js';
|
|
7
|
+
import type { Transport } from '../transport.js';
|
|
8
|
+
/** Folders of images of the workspace. */
|
|
9
|
+
export declare class AssetFolders {
|
|
10
|
+
#private;
|
|
11
|
+
/** @internal */
|
|
12
|
+
constructor(transport: Transport);
|
|
13
|
+
/** Lists every folder by name, with how many images each holds. Requires a `read` or `write` API key. */
|
|
14
|
+
list(): Promise<readonly AssetFolder[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `assetFolders` resource: the folders that group the images of the workspace.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { assetFolderListSchema } from '../schemas.js';
|
|
7
|
+
/** Folders of images of the workspace. */
|
|
8
|
+
export class AssetFolders {
|
|
9
|
+
#transport;
|
|
10
|
+
/** @internal */
|
|
11
|
+
constructor(transport) {
|
|
12
|
+
this.#transport = transport;
|
|
13
|
+
}
|
|
14
|
+
/** Lists every folder by name, with how many images each holds. Requires a `read` or `write` API key. */
|
|
15
|
+
async list() {
|
|
16
|
+
const list = await this.#transport.send({ method: 'GET', path: '/api/v1/asset-folders' }, assetFolderListSchema);
|
|
17
|
+
return list.items;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `assets` resource: upload, list and delete the
|
|
2
|
+
* The `assets` resource: upload, list, search, describe, move and delete the
|
|
3
|
+
* images used by templates.
|
|
3
4
|
*
|
|
4
5
|
* @module
|
|
5
6
|
*/
|
|
@@ -22,6 +23,29 @@ export interface CreateUploadOptions {
|
|
|
22
23
|
/** The exact size of the file, in bytes (at most 5 MiB). */
|
|
23
24
|
readonly sizeBytes: number;
|
|
24
25
|
}
|
|
26
|
+
/** Options of {@link Assets.list}. */
|
|
27
|
+
export interface ListAssetsOptions extends ListOptions {
|
|
28
|
+
/** Only the images of this folder: its id, or `root` for the images outside every folder. Every image when omitted. */
|
|
29
|
+
readonly folder?: string;
|
|
30
|
+
/** Only the images whose file name or description contains this text, whatever its case (at most 100 characters). */
|
|
31
|
+
readonly search?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Options of {@link Assets.importFromUrl}. */
|
|
34
|
+
export interface ImportAssetOptions {
|
|
35
|
+
/** What the image shows, used as its alt text (at most 500 characters). */
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
/** The folder to store it in; the root when omitted. */
|
|
38
|
+
readonly folderId?: string;
|
|
39
|
+
/** The file name (at most 255 characters). Defaults to the last segment of the URL's path. */
|
|
40
|
+
readonly name?: string;
|
|
41
|
+
}
|
|
42
|
+
/** The changes of {@link Assets.update}; give `description`, `folderId` or both. */
|
|
43
|
+
export interface UpdateAssetOptions {
|
|
44
|
+
/** What the image shows, used as its alt text; `null` or an empty text clears it. */
|
|
45
|
+
readonly description?: string | null;
|
|
46
|
+
/** The folder to move it to; `null` moves it to the root. */
|
|
47
|
+
readonly folderId?: string | null;
|
|
48
|
+
}
|
|
25
49
|
/**
|
|
26
50
|
* Images of the workspace.
|
|
27
51
|
*
|
|
@@ -33,8 +57,29 @@ export declare class Assets {
|
|
|
33
57
|
#private;
|
|
34
58
|
/** @internal */
|
|
35
59
|
constructor(transport: Transport);
|
|
36
|
-
/**
|
|
37
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Lists the confirmed images, newest first: every image, those of one
|
|
62
|
+
* `folder`, and only those matching `search`. Requires a `read` or `write` API key.
|
|
63
|
+
*
|
|
64
|
+
* @throws NotFoundError when the folder does not exist.
|
|
65
|
+
*/
|
|
66
|
+
list(options?: ListAssetsOptions): Promise<Page<Asset>>;
|
|
67
|
+
/**
|
|
68
|
+
* Uploads an image from a public URL: the server downloads it (PNG, JPEG,
|
|
69
|
+
* GIF or WebP, at most 5 MiB) and stores it with its size in pixels and a
|
|
70
|
+
* preview. Requires a `write` API key.
|
|
71
|
+
*
|
|
72
|
+
* @param url - The public `http` or `https` URL of the image.
|
|
73
|
+
* @throws BadRequestError when the URL is refused (e.g. a private address) or is not such an image.
|
|
74
|
+
* @throws NotFoundError when the folder does not exist.
|
|
75
|
+
*/
|
|
76
|
+
importFromUrl(url: string, options?: ImportAssetOptions): Promise<Asset>;
|
|
77
|
+
/**
|
|
78
|
+
* Changes the description of an image, moves it to another folder, or both. Requires a `write` API key.
|
|
79
|
+
*
|
|
80
|
+
* @throws NotFoundError when the image or the folder does not exist.
|
|
81
|
+
*/
|
|
82
|
+
update(assetId: string, changes: UpdateAssetOptions): Promise<Asset>;
|
|
38
83
|
/**
|
|
39
84
|
* Uploads an image: starts the upload, sends the file to the storage bucket
|
|
40
85
|
* and confirms it. Requires a `write` API key.
|
package/dist/resources/assets.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `assets` resource: upload, list and delete the
|
|
2
|
+
* The `assets` resource: upload, list, search, describe, move and delete the
|
|
3
|
+
* images used by templates.
|
|
3
4
|
*
|
|
4
5
|
* @module
|
|
5
6
|
*/
|
|
@@ -19,9 +20,44 @@ export class Assets {
|
|
|
19
20
|
constructor(transport) {
|
|
20
21
|
this.#transport = transport;
|
|
21
22
|
}
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Lists the confirmed images, newest first: every image, those of one
|
|
25
|
+
* `folder`, and only those matching `search`. Requires a `read` or `write` API key.
|
|
26
|
+
*
|
|
27
|
+
* @throws NotFoundError when the folder does not exist.
|
|
28
|
+
*/
|
|
23
29
|
list(options = {}) {
|
|
24
|
-
return this.#transport.send({ method: 'GET', path: '/api/v1/assets', query: { cursor: options.cursor, limit: options.limit } }, assetPage);
|
|
30
|
+
return this.#transport.send({ method: 'GET', path: '/api/v1/assets', query: { cursor: options.cursor, folder: options.folder, limit: options.limit, search: options.search } }, assetPage);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Uploads an image from a public URL: the server downloads it (PNG, JPEG,
|
|
34
|
+
* GIF or WebP, at most 5 MiB) and stores it with its size in pixels and a
|
|
35
|
+
* preview. Requires a `write` API key.
|
|
36
|
+
*
|
|
37
|
+
* @param url - The public `http` or `https` URL of the image.
|
|
38
|
+
* @throws BadRequestError when the URL is refused (e.g. a private address) or is not such an image.
|
|
39
|
+
* @throws NotFoundError when the folder does not exist.
|
|
40
|
+
*/
|
|
41
|
+
importFromUrl(url, options = {}) {
|
|
42
|
+
const { description, folderId, name } = options;
|
|
43
|
+
return this.#transport.send({
|
|
44
|
+
body: { url, ...(description === undefined ? {} : { description }), ...(folderId === undefined ? {} : { folderId }), ...(name === undefined ? {} : { name }) },
|
|
45
|
+
method: 'POST',
|
|
46
|
+
path: '/api/v1/assets/import',
|
|
47
|
+
}, assetSchema);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Changes the description of an image, moves it to another folder, or both. Requires a `write` API key.
|
|
51
|
+
*
|
|
52
|
+
* @throws NotFoundError when the image or the folder does not exist.
|
|
53
|
+
*/
|
|
54
|
+
update(assetId, changes) {
|
|
55
|
+
const { description, folderId } = changes;
|
|
56
|
+
return this.#transport.send({
|
|
57
|
+
body: { ...(description === undefined ? {} : { description }), ...(folderId === undefined ? {} : { folderId }) },
|
|
58
|
+
method: 'PATCH',
|
|
59
|
+
path: `/api/v1/assets/${pathId(assetId)}`,
|
|
60
|
+
}, assetSchema);
|
|
25
61
|
}
|
|
26
62
|
/**
|
|
27
63
|
* Uploads an image: starts the upload, sends the file to the storage bucket
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `templates` resource: list, get and render templates, and manage their variables.
|
|
2
|
+
* The `templates` resource: create, update, list, get and render templates, and manage their variables.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { type Page, type RenderedTemplate, type Template, type TemplateSummary, type TemplateVariable, type TemplateVersion, type TemplateVersionSummary } from '../schemas.js';
|
|
6
|
+
import { type JsonValue, type Page, type RenderedTemplate, type SavedTemplate, type Template, type TemplateSummary, type TemplateVariable, type TemplateVersion, type TemplateVersionSummary } from '../schemas.js';
|
|
7
7
|
import { type Transport } from '../transport.js';
|
|
8
8
|
/** Options of the list methods. */
|
|
9
9
|
export interface ListOptions {
|
|
@@ -38,8 +38,32 @@ export interface UpdateVariableOptions {
|
|
|
38
38
|
/** The new key: letters, digits and `_`, starting with a letter or `_`. */
|
|
39
39
|
readonly key?: string;
|
|
40
40
|
}
|
|
41
|
+
/** A new template. */
|
|
42
|
+
export interface CreateTemplateOptions {
|
|
43
|
+
/** The brand kit the template renders with, from the same workspace; omit it or pass `null` for the workspace default. */
|
|
44
|
+
readonly brandKitId?: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* The document: TipTap JSON with a `doc` root that matches the
|
|
47
|
+
* `TemplateDocumentModel` schema of the OpenAPI document. The API checks it
|
|
48
|
+
* and answers 422 with every problem when it does not.
|
|
49
|
+
*/
|
|
50
|
+
readonly document: JsonValue;
|
|
51
|
+
/** The name, from 1 to 200 characters. */
|
|
52
|
+
readonly name: string;
|
|
53
|
+
}
|
|
54
|
+
/** A change to the draft of a template; give at least one field. */
|
|
55
|
+
export interface UpdateTemplateOptions {
|
|
56
|
+
/** The brand kit the template renders with, from the same workspace; `null` for the workspace default. Omit it to keep the current one. */
|
|
57
|
+
readonly brandKitId?: string | null;
|
|
58
|
+
/** The new document, like {@link CreateTemplateOptions.document}. Omit it to keep the current one. */
|
|
59
|
+
readonly document?: JsonValue;
|
|
60
|
+
/** The new name. Omit it to keep the current one. */
|
|
61
|
+
readonly name?: string;
|
|
62
|
+
}
|
|
41
63
|
/**
|
|
42
|
-
* Templates of the workspace.
|
|
64
|
+
* Templates of the workspace. Reads require a `read` or `write` API key;
|
|
65
|
+
* {@link Templates.create}, {@link Templates.update} and
|
|
66
|
+
* {@link Templates.updateVariable} require a `write` key.
|
|
43
67
|
*
|
|
44
68
|
* By default the API serves the latest **published** version of each template;
|
|
45
69
|
* the `*Draft*` methods and `draft: true` serve the draft editors work on.
|
|
@@ -48,6 +72,26 @@ export declare class Templates {
|
|
|
48
72
|
#private;
|
|
49
73
|
/** @internal */
|
|
50
74
|
constructor(transport: Transport);
|
|
75
|
+
/**
|
|
76
|
+
* Creates a template as a draft: nothing is published until someone
|
|
77
|
+
* publishes it in the editor. Returns it with `editorUrl`, the link that
|
|
78
|
+
* opens it in the editor. Requires a `write` API key.
|
|
79
|
+
*
|
|
80
|
+
* @throws BadRequestError when the name is invalid or the brand kit is not in the workspace.
|
|
81
|
+
* @throws UnprocessableEntityError when the document does not match the document model; `issues` lists every problem.
|
|
82
|
+
* @throws APIError with status 402 (`quota_exceeded`) on Templr Cloud when the plan allows no more templates.
|
|
83
|
+
*/
|
|
84
|
+
create(template: CreateTemplateOptions): Promise<SavedTemplate>;
|
|
85
|
+
/**
|
|
86
|
+
* Changes the name, the document, the brand kit or several of them in the
|
|
87
|
+
* draft of a template, like an autosave of the editor: published versions
|
|
88
|
+
* are not changed. Returns it with `editorUrl`. Requires a `write` API key.
|
|
89
|
+
*
|
|
90
|
+
* @throws BadRequestError when no field is given, the name is invalid or the brand kit is not in the workspace.
|
|
91
|
+
* @throws NotFoundError when the template does not exist.
|
|
92
|
+
* @throws UnprocessableEntityError when the document does not match the document model; `issues` lists every problem.
|
|
93
|
+
*/
|
|
94
|
+
update(templateId: string, change: UpdateTemplateOptions): Promise<SavedTemplate>;
|
|
51
95
|
/** Lists the published templates, each with its latest version, most recently published first (oldest first with `order: 'asc'`). */
|
|
52
96
|
list(options?: ListTemplatesOptions): Promise<Page<TemplateVersionSummary>>;
|
|
53
97
|
/** Lists every template with its draft, most recently updated first (oldest first with `order: 'asc'`). */
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `templates` resource: list, get and render templates, and manage their variables.
|
|
2
|
+
* The `templates` resource: create, update, list, get and render templates, and manage their variables.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { pageSchema, renderedTemplateSchema, templateSchema, templateSummarySchema, templateVariableListSchema, templateVariableSchema, templateVersionSchema, templateVersionSummarySchema, } from '../schemas.js';
|
|
6
|
+
import { pageSchema, renderedTemplateSchema, savedTemplateSchema, templateSchema, templateSummarySchema, templateVariableListSchema, templateVariableSchema, templateVersionSchema, templateVersionSummarySchema, } from '../schemas.js';
|
|
7
7
|
import { pathId } from '../transport.js';
|
|
8
8
|
const versionPage = pageSchema(templateVersionSummarySchema);
|
|
9
9
|
const draftPage = pageSchema(templateSummarySchema);
|
|
10
10
|
/**
|
|
11
|
-
* Templates of the workspace.
|
|
11
|
+
* Templates of the workspace. Reads require a `read` or `write` API key;
|
|
12
|
+
* {@link Templates.create}, {@link Templates.update} and
|
|
13
|
+
* {@link Templates.updateVariable} require a `write` key.
|
|
12
14
|
*
|
|
13
15
|
* By default the API serves the latest **published** version of each template;
|
|
14
16
|
* the `*Draft*` methods and `draft: true` serve the draft editors work on.
|
|
@@ -19,6 +21,42 @@ export class Templates {
|
|
|
19
21
|
constructor(transport) {
|
|
20
22
|
this.#transport = transport;
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates a template as a draft: nothing is published until someone
|
|
26
|
+
* publishes it in the editor. Returns it with `editorUrl`, the link that
|
|
27
|
+
* opens it in the editor. Requires a `write` API key.
|
|
28
|
+
*
|
|
29
|
+
* @throws BadRequestError when the name is invalid or the brand kit is not in the workspace.
|
|
30
|
+
* @throws UnprocessableEntityError when the document does not match the document model; `issues` lists every problem.
|
|
31
|
+
* @throws APIError with status 402 (`quota_exceeded`) on Templr Cloud when the plan allows no more templates.
|
|
32
|
+
*/
|
|
33
|
+
create(template) {
|
|
34
|
+
return this.#transport.send({
|
|
35
|
+
body: { ...(template.brandKitId === undefined ? {} : { brandKitId: template.brandKitId }), document: template.document, name: template.name },
|
|
36
|
+
method: 'POST',
|
|
37
|
+
path: '/api/v1/templates',
|
|
38
|
+
}, savedTemplateSchema);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Changes the name, the document, the brand kit or several of them in the
|
|
42
|
+
* draft of a template, like an autosave of the editor: published versions
|
|
43
|
+
* are not changed. Returns it with `editorUrl`. Requires a `write` API key.
|
|
44
|
+
*
|
|
45
|
+
* @throws BadRequestError when no field is given, the name is invalid or the brand kit is not in the workspace.
|
|
46
|
+
* @throws NotFoundError when the template does not exist.
|
|
47
|
+
* @throws UnprocessableEntityError when the document does not match the document model; `issues` lists every problem.
|
|
48
|
+
*/
|
|
49
|
+
update(templateId, change) {
|
|
50
|
+
return this.#transport.send({
|
|
51
|
+
body: {
|
|
52
|
+
...(change.brandKitId === undefined ? {} : { brandKitId: change.brandKitId }),
|
|
53
|
+
...(change.document === undefined ? {} : { document: change.document }),
|
|
54
|
+
...(change.name === undefined ? {} : { name: change.name }),
|
|
55
|
+
},
|
|
56
|
+
method: 'PATCH',
|
|
57
|
+
path: `/api/v1/templates/${pathId(templateId)}`,
|
|
58
|
+
}, savedTemplateSchema);
|
|
59
|
+
}
|
|
22
60
|
/** Lists the published templates, each with its latest version, most recently published first (oldest first with `order: 'asc'`). */
|
|
23
61
|
list(options = {}) {
|
|
24
62
|
return this.#transport.send({ method: 'GET', path: '/api/v1/templates', query: { cursor: options.cursor, limit: options.limit, order: options.order } }, versionPage);
|
package/dist/schemas.d.ts
CHANGED
|
@@ -46,8 +46,20 @@ export declare const templateSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
46
46
|
name: z.ZodString;
|
|
47
47
|
updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
48
48
|
workspaceId: z.ZodString;
|
|
49
|
+
brandKitId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
49
50
|
document: z.ZodType<TemplateDocument, unknown, z.core.$ZodTypeInternals<TemplateDocument, unknown>>;
|
|
50
51
|
}, z.core.$strip>>;
|
|
52
|
+
/** A template created or updated through the API, with the link that opens it in the editor. */
|
|
53
|
+
export declare const savedTemplateSchema: z.ZodReadonly<z.ZodObject<{
|
|
54
|
+
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
58
|
+
workspaceId: z.ZodString;
|
|
59
|
+
brandKitId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
document: z.ZodType<TemplateDocument, unknown, z.core.$ZodTypeInternals<TemplateDocument, unknown>>;
|
|
61
|
+
editorUrl: z.ZodString;
|
|
62
|
+
}, z.core.$strip>>;
|
|
51
63
|
/** A published version of a template, without its document. */
|
|
52
64
|
export declare const templateVersionSummarySchema: z.ZodReadonly<z.ZodObject<{
|
|
53
65
|
id: z.ZodString;
|
|
@@ -85,14 +97,65 @@ export declare const templateVariableListSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
85
97
|
}, z.core.$strip>>>>;
|
|
86
98
|
}, z.core.$strip>>;
|
|
87
99
|
/** An uploaded image with its public URL. */
|
|
88
|
-
export declare const assetSchema: z.ZodReadonly<z.ZodObject<{
|
|
100
|
+
export declare const assetSchema: z.ZodReadonly<z.ZodPipe<z.ZodObject<{
|
|
89
101
|
contentType: z.ZodString;
|
|
90
102
|
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
103
|
+
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
folderId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
height: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
91
106
|
id: z.ZodString;
|
|
92
107
|
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
108
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
93
109
|
sizeBytes: z.ZodNumber;
|
|
94
110
|
url: z.ZodString;
|
|
111
|
+
width: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
95
112
|
workspaceId: z.ZodString;
|
|
113
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
114
|
+
contentType: string;
|
|
115
|
+
createdAt: Date;
|
|
116
|
+
description: string | null;
|
|
117
|
+
folderId: string | null;
|
|
118
|
+
height: number | null;
|
|
119
|
+
id: string;
|
|
120
|
+
name: string | null;
|
|
121
|
+
sizeBytes: number;
|
|
122
|
+
url: string;
|
|
123
|
+
width: number | null;
|
|
124
|
+
workspaceId: string;
|
|
125
|
+
previewUrl: string;
|
|
126
|
+
}, {
|
|
127
|
+
contentType: string;
|
|
128
|
+
createdAt: Date;
|
|
129
|
+
description: string | null;
|
|
130
|
+
folderId: string | null;
|
|
131
|
+
height: number | null;
|
|
132
|
+
id: string;
|
|
133
|
+
name: string | null;
|
|
134
|
+
previewUrl?: string | undefined;
|
|
135
|
+
sizeBytes: number;
|
|
136
|
+
url: string;
|
|
137
|
+
width: number | null;
|
|
138
|
+
workspaceId: string;
|
|
139
|
+
}>>>;
|
|
140
|
+
/** A folder of images. */
|
|
141
|
+
export declare const assetFolderSchema: z.ZodReadonly<z.ZodObject<{
|
|
142
|
+
assetCount: z.ZodNumber;
|
|
143
|
+
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
144
|
+
id: z.ZodString;
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
147
|
+
workspaceId: z.ZodString;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
/** Every folder of the workspace. */
|
|
150
|
+
export declare const assetFolderListSchema: z.ZodReadonly<z.ZodObject<{
|
|
151
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
152
|
+
assetCount: z.ZodNumber;
|
|
153
|
+
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
updatedAt: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<Date, string>>;
|
|
157
|
+
workspaceId: z.ZodString;
|
|
158
|
+
}, z.core.$strip>>>>;
|
|
96
159
|
}, z.core.$strip>>;
|
|
97
160
|
/** Where and how to upload the file of a pending image upload. */
|
|
98
161
|
export declare const presignedUploadSchema: z.ZodReadonly<z.ZodObject<{
|
|
@@ -174,6 +237,12 @@ export interface Page<Item> {
|
|
|
174
237
|
export type TemplateSummary = z.output<typeof templateSummarySchema>;
|
|
175
238
|
/** A template with its draft document. */
|
|
176
239
|
export type Template = z.output<typeof templateSchema>;
|
|
240
|
+
/**
|
|
241
|
+
* A template created or updated through the API, with `editorUrl`: the page
|
|
242
|
+
* of the app that opens it in the editor (the editor shows the templates of
|
|
243
|
+
* the user's active workspace).
|
|
244
|
+
*/
|
|
245
|
+
export type SavedTemplate = z.output<typeof savedTemplateSchema>;
|
|
177
246
|
/** A published version of a template, without its document. */
|
|
178
247
|
export type TemplateVersionSummary = z.output<typeof templateVersionSummarySchema>;
|
|
179
248
|
/** A published version of a template, with its document. */
|
|
@@ -182,8 +251,17 @@ export type TemplateVersion = z.output<typeof templateVersionSchema>;
|
|
|
182
251
|
export type TemplateVariable = z.output<typeof templateVariableSchema>;
|
|
183
252
|
/** A rendered email: `html` and its plain `text` version. */
|
|
184
253
|
export type RenderedTemplate = z.output<typeof renderedTemplateSchema>;
|
|
185
|
-
/**
|
|
254
|
+
/**
|
|
255
|
+
* An uploaded image: its public `url` and `previewUrl` (a WebP of at most 256
|
|
256
|
+
* pixels on its longest side; the image `url` for images uploaded before
|
|
257
|
+
* previews existed), its `folderId` (`null` at the root), its `description`
|
|
258
|
+
* (the alt text; `null` until someone writes one) and its `width` and
|
|
259
|
+
* `height` in pixels, read from the image by the server (`null` for images
|
|
260
|
+
* uploaded before they were read).
|
|
261
|
+
*/
|
|
186
262
|
export type Asset = z.output<typeof assetSchema>;
|
|
263
|
+
/** A folder of images, with how many images it holds (`assetCount`). */
|
|
264
|
+
export type AssetFolder = z.output<typeof assetFolderSchema>;
|
|
187
265
|
/**
|
|
188
266
|
* A recorded event of the workspace audit log: who did it (`actor`, a member
|
|
189
267
|
* by user id or an API key by key id), what happened (`action`, e.g.
|
package/dist/schemas.js
CHANGED
|
@@ -34,8 +34,16 @@ const templateVersionSummaryShape = {
|
|
|
34
34
|
};
|
|
35
35
|
/** A template without its document (the draft editors work on). */
|
|
36
36
|
export const templateSummarySchema = z.object(templateSummaryShape).readonly();
|
|
37
|
+
const templateShape = {
|
|
38
|
+
...templateSummaryShape,
|
|
39
|
+
// Instances older than brand kits return no `brandKitId`.
|
|
40
|
+
brandKitId: z.string().nullable().default(null),
|
|
41
|
+
document: templateDocument,
|
|
42
|
+
};
|
|
37
43
|
/** A template with its draft document. */
|
|
38
|
-
export const templateSchema = z.object(
|
|
44
|
+
export const templateSchema = z.object(templateShape).readonly();
|
|
45
|
+
/** A template created or updated through the API, with the link that opens it in the editor. */
|
|
46
|
+
export const savedTemplateSchema = z.object({ ...templateShape, editorUrl: z.string() }).readonly();
|
|
39
47
|
/** A published version of a template, without its document. */
|
|
40
48
|
export const templateVersionSummarySchema = z.object(templateVersionSummaryShape).readonly();
|
|
41
49
|
/** A published version of a template, with its document. */
|
|
@@ -51,14 +59,25 @@ export const assetSchema = z
|
|
|
51
59
|
.object({
|
|
52
60
|
contentType: z.string(),
|
|
53
61
|
createdAt: timestamp,
|
|
62
|
+
// Instances older than folders, descriptions, sizes in pixels or previews do not return them.
|
|
63
|
+
description: z.string().nullable().default(null),
|
|
64
|
+
folderId: z.string().nullable().default(null),
|
|
65
|
+
height: z.number().int().nullable().default(null),
|
|
54
66
|
id: z.string(),
|
|
55
67
|
// Instances older than the file name return no `name`.
|
|
56
68
|
name: z.string().nullable().default(null),
|
|
69
|
+
previewUrl: z.string().optional(),
|
|
57
70
|
sizeBytes: z.number().int(),
|
|
58
71
|
url: z.string(),
|
|
72
|
+
width: z.number().int().nullable().default(null),
|
|
59
73
|
workspaceId: z.string(),
|
|
60
74
|
})
|
|
75
|
+
.transform(asset => ({ ...asset, previewUrl: asset.previewUrl ?? asset.url }))
|
|
61
76
|
.readonly();
|
|
77
|
+
/** A folder of images. */
|
|
78
|
+
export const assetFolderSchema = z.object({ assetCount: z.number().int(), createdAt: timestamp, id: z.string(), name: z.string(), updatedAt: timestamp, workspaceId: z.string() }).readonly();
|
|
79
|
+
/** Every folder of the workspace. */
|
|
80
|
+
export const assetFolderListSchema = z.object({ items: z.array(assetFolderSchema).readonly() }).readonly();
|
|
62
81
|
/** Where and how to upload the file of a pending image upload. */
|
|
63
82
|
export const presignedUploadSchema = z.object({ fields: z.record(z.string(), z.string()).readonly(), url: z.string() }).readonly();
|
|
64
83
|
/** A pending image upload. */
|
package/dist/transport.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { APIConnectionError, APIError, APITimeoutError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PayloadTooLargeError, PermissionDeniedError, RateLimitError, UnexpectedResponseError, UploadError, } from './errors.js';
|
|
7
|
+
import { APIConnectionError, APIError, APITimeoutError, AuthenticationError, BadRequestError, ConflictError, InternalServerError, NotFoundError, PayloadTooLargeError, PermissionDeniedError, RateLimitError, UnexpectedResponseError, UnprocessableEntityError, UploadError, } from './errors.js';
|
|
8
8
|
import { errorBodySchema } from './schemas.js';
|
|
9
9
|
import { VERSION } from './version.js';
|
|
10
10
|
/** The header that carries the workspace API key. */
|
|
@@ -68,6 +68,8 @@ export function errorFromResponse(response, text) {
|
|
|
68
68
|
return new ConflictError(details);
|
|
69
69
|
case 413:
|
|
70
70
|
return new PayloadTooLargeError(details);
|
|
71
|
+
case 422:
|
|
72
|
+
return new UnprocessableEntityError(details);
|
|
71
73
|
case 429:
|
|
72
74
|
return new RateLimitError(details, retryAfter(response));
|
|
73
75
|
default:
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of this SDK; kept equal to `package.json` by a test. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.4.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of this SDK; kept equal to `package.json` by a test. */
|
|
2
|
-
export const VERSION = '0.
|
|
2
|
+
export const VERSION = '0.4.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@templr/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Official TypeScript SDK for the Templr REST API.",
|
|
5
5
|
"keywords": ["templr", "email", "email-templates", "react-email", "sdk", "api-client"],
|
|
6
6
|
"homepage": "https://github.com/SebastianUrdaneguiBisalaya/templr/tree/main/sdks/typescript#readme",
|