@fonderie/client 0.7.0 → 0.8.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/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -98,6 +98,11 @@ var HttpClient = class {
|
|
|
98
98
|
cache;
|
|
99
99
|
defaultTtlMs;
|
|
100
100
|
refresh;
|
|
101
|
+
// Drop all cached responses — sign-out must not leave one session's data
|
|
102
|
+
// servable to the next.
|
|
103
|
+
clearCache() {
|
|
104
|
+
this.cache?.clear();
|
|
105
|
+
}
|
|
101
106
|
async request(opts) {
|
|
102
107
|
const method = opts.method.toUpperCase();
|
|
103
108
|
const cache = this.cache;
|
|
@@ -245,6 +250,7 @@ var AuthClient = class {
|
|
|
245
250
|
mfa;
|
|
246
251
|
setAccessToken(token) {
|
|
247
252
|
this.tokens.set(token);
|
|
253
|
+
if (!token) this.http.clearCache();
|
|
248
254
|
}
|
|
249
255
|
// ── Public ─────────────────────────────────────────────────────────────────
|
|
250
256
|
register(input) {
|
|
@@ -1161,6 +1167,7 @@ var FonderieClient = class {
|
|
|
1161
1167
|
this.audit = new AuditClient(this.http, this.tokens);
|
|
1162
1168
|
this.webhooks = new WebhooksClient(this.http, this.tokens);
|
|
1163
1169
|
this.customers = new CustomersClient(this.http, this.tokens);
|
|
1170
|
+
if (opts.workspaceId !== void 0) this.setWorkspaceId(opts.workspaceId);
|
|
1164
1171
|
}
|
|
1165
1172
|
// Single-flight refresh: POST /auth/refresh with the app-supplied refresh
|
|
1166
1173
|
// token, store the new access token, notify the app, return it for the retry.
|
|
@@ -1206,6 +1213,8 @@ var FonderieClient = class {
|
|
|
1206
1213
|
this.billing.setWorkspaceId(workspaceId);
|
|
1207
1214
|
this.workspaces.setWorkspaceId(workspaceId);
|
|
1208
1215
|
this.customers.setWorkspaceId(workspaceId);
|
|
1216
|
+
this.audit.setWorkspaceId(workspaceId);
|
|
1217
|
+
this.webhooks.setWorkspaceId(workspaceId);
|
|
1209
1218
|
}
|
|
1210
1219
|
// ── Generic transport ──────────────────────────────────────────────────────
|
|
1211
1220
|
// A Fonderie-aware HTTP client for endpoints outside the typed modules (an
|