@myapihq/sdk 2.16.4 → 2.17.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.
@@ -50,6 +50,31 @@ export interface DeployResponse {
50
50
  export declare function createContainer(apiKey: string, orgId: string, payload: CreatePayload): Promise<CreateResponse>;
51
51
  export declare function listContainers(apiKey: string, orgId: string): Promise<Container[]>;
52
52
  export declare function getContainer(apiKey: string, orgId: string, containerId: string): Promise<Container>;
53
+ /** The result of an environment change. `env` is the RESULT of the merge, so a
54
+ * caller never has to GET afterwards to see what a PATCH did. */
55
+ export interface EnvUpdate {
56
+ set: string[];
57
+ removed: string[];
58
+ /** Whether a new revision was rolled. False when the container has never been
59
+ * deployed — the values are stored and apply on the first deploy. */
60
+ applied: boolean;
61
+ env: Record<string, string>;
62
+ revision?: string;
63
+ url?: string;
64
+ message?: string;
65
+ }
66
+ /**
67
+ * Change environment variables on an existing container.
68
+ *
69
+ * A MERGE: pass only what changes, and `null` to delete one. Everything else
70
+ * keeps its value — which matters, because replace semantics would mean
71
+ * resending every secret correctly to add one variable.
72
+ *
73
+ * Rolls a new revision on the SAME image; the container keeps its URL, its
74
+ * scoped key and its custom domain. Until 2026-08-19 this was impossible and
75
+ * the documented answer was to recreate the container.
76
+ */
77
+ export declare function updateContainerEnv(apiKey: string, orgId: string, containerId: string, env: Record<string, string | null>): Promise<EnvUpdate>;
53
78
  export declare function deleteContainer(apiKey: string, orgId: string, containerId: string): Promise<void>;
54
79
  export interface SmokeCheck {
55
80
  path?: string;
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.updateContainerEnv = updateContainerEnv;
7
8
  exports.deleteContainer = deleteContainer;
8
9
  exports.deployContainer = deployContainer;
9
10
  exports.listRevisions = listRevisions;
@@ -23,6 +24,7 @@ exports.EXPOSES = [
23
24
  'GET /container/orgs/{org_id}/containers',
24
25
  'GET /container/orgs/{org_id}/containers/{id}',
25
26
  'DELETE /container/orgs/{org_id}/containers/{id}',
27
+ 'PATCH /container/orgs/{org_id}/containers/{id}',
26
28
  'POST /container/orgs/{org_id}/containers/{id}/deploy',
27
29
  'GET /container/orgs/{org_id}/containers/{id}/revisions',
28
30
  'POST /container/orgs/{org_id}/containers/{id}/promote',
@@ -40,6 +42,20 @@ async function listContainers(apiKey, orgId) {
40
42
  async function getContainer(apiKey, orgId, containerId) {
41
43
  return (0, client_1.request)('GET', `${config_1.CONTAINER_BASE}/container/orgs/${encodeURIComponent(orgId)}/containers/${encodeURIComponent(containerId)}`, apiKey);
42
44
  }
45
+ /**
46
+ * Change environment variables on an existing container.
47
+ *
48
+ * A MERGE: pass only what changes, and `null` to delete one. Everything else
49
+ * keeps its value — which matters, because replace semantics would mean
50
+ * resending every secret correctly to add one variable.
51
+ *
52
+ * Rolls a new revision on the SAME image; the container keeps its URL, its
53
+ * scoped key and its custom domain. Until 2026-08-19 this was impossible and
54
+ * the documented answer was to recreate the container.
55
+ */
56
+ async function updateContainerEnv(apiKey, orgId, containerId, env) {
57
+ return (0, client_1.request)('PATCH', `${config_1.CONTAINER_BASE}/container/orgs/${encodeURIComponent(orgId)}/containers/${encodeURIComponent(containerId)}`, apiKey, { env });
58
+ }
43
59
  async function deleteContainer(apiKey, orgId, containerId) {
44
60
  return (0, client_1.request)('DELETE', `${config_1.CONTAINER_BASE}/container/orgs/${encodeURIComponent(orgId)}/containers/${encodeURIComponent(containerId)}`, apiKey);
45
61
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.16.4";
1
+ export declare const SDK_VERSION = "2.17.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.16.4';
11
+ exports.SDK_VERSION = '2.17.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.16.4",
4
+ "version": "2.17.0",
5
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
6
6
  "repository": {
7
7
  "type": "git",