@myapihq/sdk 2.16.4 → 2.18.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/dist/auth.d.ts CHANGED
@@ -11,6 +11,10 @@ export interface CreateTenantInput {
11
11
  connections?: AuthConnection[];
12
12
  theme?: unknown;
13
13
  }
14
+ export interface UpdateClientInput {
15
+ name?: string;
16
+ redirect_uris?: string[];
17
+ }
14
18
  export interface AuthClient {
15
19
  client_id: string;
16
20
  name?: string;
@@ -55,6 +59,7 @@ export declare function createTenant(apiKey: string, orgId: string, input?: Crea
55
59
  export declare function getTenant(apiKey: string, orgId: string): Promise<Tenant>;
56
60
  export declare function createClient(apiKey: string, orgId: string, input: CreateClientInput): Promise<AuthClient>;
57
61
  export declare function listClients(apiKey: string, orgId: string): Promise<ListClientsResponse>;
62
+ export declare function updateClient(apiKey: string, orgId: string, clientId: string, input: UpdateClientInput): Promise<AuthClient>;
58
63
  export declare function deleteClient(apiKey: string, orgId: string, clientId: string): Promise<{
59
64
  client_id: string;
60
65
  deleted: boolean;
package/dist/auth.js CHANGED
@@ -5,6 +5,7 @@ exports.createTenant = createTenant;
5
5
  exports.getTenant = getTenant;
6
6
  exports.createClient = createClient;
7
7
  exports.listClients = listClients;
8
+ exports.updateClient = updateClient;
8
9
  exports.deleteClient = deleteClient;
9
10
  exports.rotateClient = rotateClient;
10
11
  exports.getUsage = getUsage;
@@ -32,6 +33,7 @@ exports.EXPOSES = [
32
33
  'GET /auth/orgs/{org_id}/tenant',
33
34
  'POST /auth/orgs/{org_id}/clients',
34
35
  'GET /auth/orgs/{org_id}/clients',
36
+ 'PATCH /auth/orgs/{org_id}/clients/{client_id}',
35
37
  'DELETE /auth/orgs/{org_id}/clients/{client_id}',
36
38
  'POST /auth/orgs/{org_id}/clients/{client_id}/rotate',
37
39
  'GET /auth/orgs/{org_id}/usage',
@@ -63,6 +65,20 @@ async function createClient(apiKey, orgId, input) {
63
65
  async function listClients(apiKey, orgId) {
64
66
  return (0, client_1.request)('GET', `${config_1.AUTH_BASE}/auth/orgs/${encodeURIComponent(orgId)}/clients`, apiKey);
65
67
  }
68
+ // Change a client's redirect URIs or name, keeping the SAME client_id and
69
+ // secret.
70
+ //
71
+ // redirect_uris REPLACES the list rather than adding to it: send every URI you
72
+ // want the client to have, including the ones already there. Fetch it with
73
+ // listClients first if you do not have them.
74
+ //
75
+ // Without this the only way to add a callback URL was delete-and-recreate,
76
+ // which mints a new client_id — so every deployed copy of the app has to be
77
+ // reconfigured, and the cutover needs two audiences accepted at once. The route
78
+ // has existed since 19.08.2026; this is the SDK catching up to it.
79
+ async function updateClient(apiKey, orgId, clientId, input) {
80
+ return (0, client_1.request)('PATCH', `${config_1.AUTH_BASE}/auth/orgs/${encodeURIComponent(orgId)}/clients/${encodeURIComponent(clientId)}`, apiKey, input);
81
+ }
66
82
  // Delete (revoke) an OIDC client. Irreversible — the client_id stops
67
83
  // authenticating immediately.
68
84
  async function deleteClient(apiKey, orgId, clientId) {
@@ -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.18.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.18.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.18.0",
5
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
6
6
  "repository": {
7
7
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "dist"
15
15
  ],
16
16
  "scripts": {
17
- "build": "tsc",
17
+ "build": "rm -rf dist && tsc",
18
18
  "dev": "tsc --watch",
19
19
  "test": "cd ../cli && npx vitest run src"
20
20
  },