sendhive 0.1.0-beta.1 → 0.1.0-beta.2

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 CHANGED
@@ -69,12 +69,15 @@ Every variable the template uses must have a value in `data`, otherwise you get
69
69
 
70
70
  Ready-made templates work without saving anything: use `preset:` plus the preset id, for example `template: 'preset:welcome'`.
71
71
 
72
+ **Designer templates** are polished ready-made layouts (sets Barebone, Matte, Protocol, Arcane and Studio: welcome, password reset, order confirmation and more). They are sent the same way, for example `template: 'preset:matte-welcome'`, but they cannot be edited in the visual editor. `templates.list()` marks them with `style: 'designer'` and their `set`; the `variables` field tells you which `data` keys to pass.
73
+
72
74
  ## Templates
73
75
 
74
76
  ```ts
75
77
  // Your templates and the ready-made ones (slug 'preset:welcome', 'preset:order-shipped', ...)
76
78
  const { data: templates, error } = await sendhive.templates.list()
77
- // templates[0] -> { id, slug, name, kind: 'custom' | 'preset', subject, preview_text, variables, updated_at }
79
+ // templates[0] -> { id, slug, name, kind: 'custom' | 'preset', subject, preview_text, variables, updated_at,
80
+ // style?: 'editable' | 'designer', set?: 'Barebone' | 'Matte' | 'Protocol' | 'Arcane' | 'Studio' }
78
81
 
79
82
  // Draw a template with data. Missing values are not an error: they show as {{name}} and are listed.
80
83
  const { data: preview } = await sendhive.templates.preview('preset:welcome', { customer_name: 'Asha' })
package/dist/index.d.cts CHANGED
@@ -97,6 +97,10 @@ interface TemplateSummary {
97
97
  variables: string[];
98
98
  /** Null for ready-made presets. */
99
99
  updated_at: string | null;
100
+ /** `editable` templates open in the visual editor; `designer` ones are ready-made layouts that are only sent. */
101
+ style?: 'editable' | 'designer';
102
+ /** The designer set a `designer` template belongs to. */
103
+ set?: 'Barebone' | 'Matte' | 'Protocol' | 'Arcane' | 'Studio';
100
104
  }
101
105
  interface TemplateList {
102
106
  data: TemplateSummary[];
package/dist/index.d.ts CHANGED
@@ -97,6 +97,10 @@ interface TemplateSummary {
97
97
  variables: string[];
98
98
  /** Null for ready-made presets. */
99
99
  updated_at: string | null;
100
+ /** `editable` templates open in the visual editor; `designer` ones are ready-made layouts that are only sent. */
101
+ style?: 'editable' | 'designer';
102
+ /** The designer set a `designer` template belongs to. */
103
+ set?: 'Barebone' | 'Matte' | 'Protocol' | 'Arcane' | 'Studio';
100
104
  }
101
105
  interface TemplateList {
102
106
  data: TemplateSummary[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sendhive",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "description": "Tiny TypeScript SDK for the Sendhive email API (Resend-compatible shape).",
5
5
  "keywords": [
6
6
  "email",