@myapihq/sdk 2.17.0 → 2.19.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) {
@@ -85,6 +85,20 @@ export interface ListFeedbackOptions {
85
85
  limit?: number;
86
86
  offset?: number;
87
87
  }
88
+ /** What a widget is allowed to collect from the reporter's page.
89
+ *
90
+ * Both default to true server-side. An ABSENT field means "leave it alone",
91
+ * never "off" — every widget embedded before capture existed keeps behaving
92
+ * exactly as it did, and a partial update must not flip the field the operator
93
+ * did not mention.
94
+ *
95
+ * `text: false` keeps the SHAPE of the element the reporter pointed at — tag,
96
+ * role, id, data-feedback-id — and drops the words inside it. On a table row
97
+ * that is the difference between "row, id row-8" and the tenant's name. */
98
+ export interface WidgetCapture {
99
+ screenshot?: boolean;
100
+ text?: boolean;
101
+ }
88
102
  export interface Widget {
89
103
  id: string;
90
104
  org_id: string;
@@ -97,6 +111,7 @@ export interface Widget {
97
111
  position?: string;
98
112
  label?: string;
99
113
  };
114
+ capture?: WidgetCapture;
100
115
  script_tag?: string;
101
116
  created_at: string;
102
117
  }
@@ -121,7 +136,7 @@ export interface CreateFeedbackInput {
121
136
  export declare function createFeedback(apiKey: string, orgId: string, input: CreateFeedbackInput): Promise<FeedbackItem>;
122
137
  export declare function resolveFeedback(apiKey: string, orgId: string, id: string): Promise<void>;
123
138
  export declare function deleteFeedback(apiKey: string, orgId: string, id: string): Promise<void>;
124
- export declare function createWidget(apiKey: string, orgId: string, name: string, allowedOrigins?: string[]): Promise<Widget>;
139
+ export declare function createWidget(apiKey: string, orgId: string, name: string, allowedOrigins?: string[], capture?: WidgetCapture): Promise<Widget>;
125
140
  /** Where the button appears and how it looks. Routes are compiled into the
126
141
  * hosted widget.js, which is why changing them here reaches browsers within
127
142
  * ~5 minutes without the customer redeploying their site. */
@@ -134,6 +149,7 @@ export interface WidgetUpdate {
134
149
  position?: string;
135
150
  label?: string;
136
151
  };
152
+ capture?: WidgetCapture;
137
153
  }
138
154
  export declare function updateWidget(apiKey: string, orgId: string, id: string, patch: WidgetUpdate): Promise<Widget>;
139
155
  export declare function listWidgets(apiKey: string, orgId: string): Promise<Widget[]>;
package/dist/feedback.js CHANGED
@@ -61,10 +61,12 @@ async function deleteFeedback(apiKey, orgId, id) {
61
61
  // nobody — it names an org so a page can submit without a credential. Set
62
62
  // `allowed_origins` so another site cannot post through it, and revoke it if
63
63
  // it is abused; the feedback already collected is kept.
64
- async function createWidget(apiKey, orgId, name, allowedOrigins) {
64
+ async function createWidget(apiKey, orgId, name, allowedOrigins, capture) {
65
65
  const body = { name };
66
66
  if (allowedOrigins?.length)
67
67
  body.allowed_origins = allowedOrigins;
68
+ if (capture && Object.keys(capture).length)
69
+ body.capture = capture;
68
70
  return (0, client_1.request)('POST', `${orgBase(orgId)}/widgets`, apiKey, body);
69
71
  }
70
72
  // Every field optional, and an omitted field keeps its value — so this is a
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.17.0";
1
+ export declare const SDK_VERSION = "2.19.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.17.0';
11
+ exports.SDK_VERSION = '2.19.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.17.0",
4
+ "version": "2.19.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
  },