@myapihq/sdk 2.17.0 → 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 +5 -0
- package/dist/auth.js +16 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
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) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.
|
|
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.
|
|
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.
|
|
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
|
},
|