@myapihq/sdk 2.23.2 → 2.24.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.
@@ -17,6 +17,8 @@ export interface Container {
17
17
  custom_domain?: string;
18
18
  status: string;
19
19
  egress: string;
20
+ /** Startup probe path. Absent (omitempty) when the probe is a bare TCP connect. */
21
+ health_check?: string;
20
22
  created_at: string;
21
23
  updated_at: string;
22
24
  }
@@ -74,6 +76,21 @@ export interface EnvUpdate {
74
76
  * scoped key and its custom domain. Until 2026-08-19 this was impossible and
75
77
  * the documented answer was to recreate the container.
76
78
  */
79
+ /**
80
+ * Changes environment variables and/or the startup probe on an existing
81
+ * container, rolling a new revision on the SAME image. Send only what you are
82
+ * changing; a variable set to null is removed, and `health_check: ''` clears
83
+ * the probe.
84
+ *
85
+ * Anything settable at creation but not here becomes a delete-and-recreate,
86
+ * which costs the URL, the scoped key and the custom domain. That is why this
87
+ * takes a patch rather than one named field.
88
+ */
89
+ export declare function updateContainer(apiKey: string, orgId: string, containerId: string, patch: {
90
+ env?: Record<string, string | null>;
91
+ health_check?: string;
92
+ }): Promise<EnvUpdate>;
93
+ /** Environment-only shorthand for {@link updateContainer}. */
77
94
  export declare function updateContainerEnv(apiKey: string, orgId: string, containerId: string, env: Record<string, string | null>): Promise<EnvUpdate>;
78
95
  export declare function deleteContainer(apiKey: string, orgId: string, containerId: string): Promise<void>;
79
96
  export interface SmokeCheck {
package/dist/container.js CHANGED
@@ -4,6 +4,7 @@ exports.EXPOSES = void 0;
4
4
  exports.createContainer = createContainer;
5
5
  exports.listContainers = listContainers;
6
6
  exports.getContainer = getContainer;
7
+ exports.updateContainer = updateContainer;
7
8
  exports.updateContainerEnv = updateContainerEnv;
8
9
  exports.deleteContainer = deleteContainer;
9
10
  exports.deployContainer = deployContainer;
@@ -56,8 +57,22 @@ async function getContainer(apiKey, orgId, containerId) {
56
57
  * scoped key and its custom domain. Until 2026-08-19 this was impossible and
57
58
  * the documented answer was to recreate the container.
58
59
  */
60
+ /**
61
+ * Changes environment variables and/or the startup probe on an existing
62
+ * container, rolling a new revision on the SAME image. Send only what you are
63
+ * changing; a variable set to null is removed, and `health_check: ''` clears
64
+ * the probe.
65
+ *
66
+ * Anything settable at creation but not here becomes a delete-and-recreate,
67
+ * which costs the URL, the scoped key and the custom domain. That is why this
68
+ * takes a patch rather than one named field.
69
+ */
70
+ async function updateContainer(apiKey, orgId, containerId, patch) {
71
+ return (0, client_1.request)('PATCH', `${config_1.CONTAINER_BASE}/container/orgs/${encodeURIComponent(orgId)}/containers/${encodeURIComponent(containerId)}`, apiKey, patch);
72
+ }
73
+ /** Environment-only shorthand for {@link updateContainer}. */
59
74
  async function updateContainerEnv(apiKey, orgId, containerId, env) {
60
- return (0, client_1.request)('PATCH', `${config_1.CONTAINER_BASE}/container/orgs/${encodeURIComponent(orgId)}/containers/${encodeURIComponent(containerId)}`, apiKey, { env });
75
+ return updateContainer(apiKey, orgId, containerId, { env });
61
76
  }
62
77
  async function deleteContainer(apiKey, orgId, containerId) {
63
78
  return (0, client_1.request)('DELETE', `${config_1.CONTAINER_BASE}/container/orgs/${encodeURIComponent(orgId)}/containers/${encodeURIComponent(containerId)}`, apiKey);
package/dist/email.d.ts CHANGED
@@ -184,7 +184,8 @@ export interface CampaignListSource {
184
184
  }
185
185
  export interface CreateCampaignInput {
186
186
  name: string;
187
- template_id: string;
187
+ /** Null once the template it was built from has been deleted — the campaign and its send log survive that. */
188
+ template_id: string | null;
188
189
  from_address: string;
189
190
  source_kind: CampaignSourceKind;
190
191
  source_ref?: CampaignCRMQuery | CampaignListSource;
@@ -240,5 +241,15 @@ export declare function startCampaign(apiKey: string, orgId: string, id: string)
240
241
  export declare function pauseCampaign(apiKey: string, orgId: string, id: string): Promise<Campaign>;
241
242
  export declare function resumeCampaign(apiKey: string, orgId: string, id: string): Promise<Campaign>;
242
243
  export declare function cancelCampaign(apiKey: string, orgId: string, id: string): Promise<Campaign>;
244
+ /**
245
+ * Removes the campaign and its recipient rows. Messages already sent stay in
246
+ * the send log — deleting a campaign must not erase the record that mail went
247
+ * out. Refuses (409 CAMPAIGN_ACTIVE) while it is still sending.
248
+ */
249
+ export declare function deleteCampaign(apiKey: string, orgId: string, id: string): Promise<{
250
+ deleted: boolean;
251
+ id: string;
252
+ note?: string;
253
+ }>;
243
254
  export declare function listCampaignRecipients(apiKey: string, orgId: string, id: string, state?: string): Promise<CampaignRecipient[]>;
244
255
  export declare function getCampaignStats(apiKey: string, orgId: string, id: string): Promise<CampaignStats>;
package/dist/email.js CHANGED
@@ -39,6 +39,7 @@ exports.startCampaign = startCampaign;
39
39
  exports.pauseCampaign = pauseCampaign;
40
40
  exports.resumeCampaign = resumeCampaign;
41
41
  exports.cancelCampaign = cancelCampaign;
42
+ exports.deleteCampaign = deleteCampaign;
42
43
  exports.listCampaignRecipients = listCampaignRecipients;
43
44
  exports.getCampaignStats = getCampaignStats;
44
45
  const client_1 = require("./client");
@@ -82,6 +83,7 @@ exports.EXPOSES = [
82
83
  'POST /email/orgs/{org_id}/campaigns',
83
84
  'GET /email/orgs/{org_id}/campaigns',
84
85
  'GET /email/orgs/{org_id}/campaigns/{campaign_id}',
86
+ 'DELETE /email/orgs/{org_id}/campaigns/{campaign_id}',
85
87
  'PATCH /email/orgs/{org_id}/campaigns/{campaign_id}',
86
88
  'POST /email/orgs/{org_id}/campaigns/{campaign_id}/resolve',
87
89
  'POST /email/orgs/{org_id}/campaigns/{campaign_id}/start',
@@ -254,6 +256,14 @@ async function resumeCampaign(apiKey, orgId, id) {
254
256
  async function cancelCampaign(apiKey, orgId, id) {
255
257
  return (0, client_1.request)('POST', `${campaignUrl(orgId, id)}/cancel`, apiKey);
256
258
  }
259
+ /**
260
+ * Removes the campaign and its recipient rows. Messages already sent stay in
261
+ * the send log — deleting a campaign must not erase the record that mail went
262
+ * out. Refuses (409 CAMPAIGN_ACTIVE) while it is still sending.
263
+ */
264
+ async function deleteCampaign(apiKey, orgId, id) {
265
+ return (0, client_1.request)('DELETE', campaignUrl(orgId, id), apiKey);
266
+ }
257
267
  async function listCampaignRecipients(apiKey, orgId, id, state) {
258
268
  const url = state
259
269
  ? `${campaignUrl(orgId, id)}/recipients?state=${encodeURIComponent(state)}`
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.23.2";
1
+ export declare const SDK_VERSION = "2.24.0";
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@ exports.SDK_VERSION = void 0;
8
8
  // Why a constant and not a package.json read: the SDK runs inside edge
9
9
  // functions (Cloudflare Workers), so it must not import node:fs. A literal
10
10
  // is the only version source that works in every runtime we ship to.
11
- exports.SDK_VERSION = '2.23.2';
11
+ exports.SDK_VERSION = '2.24.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "2.23.2",
4
+ "version": "2.24.0",
5
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
6
6
  "repository": {
7
7
  "type": "git",