@oxyhq/core 3.8.1 → 3.9.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/README.md +10 -0
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/HttpService.js +18 -4
- package/dist/cjs/OxyServices.base.js +15 -1
- package/dist/cjs/mixins/OxyServices.applications.js +69 -6
- package/dist/cjs/mixins/OxyServices.assets.js +16 -3
- package/dist/cjs/mixins/OxyServices.features.js +47 -10
- package/dist/cjs/mixins/OxyServices.managedAccounts.js +29 -3
- package/dist/cjs/mixins/OxyServices.privacy.js +34 -8
- package/dist/cjs/mixins/OxyServices.topics.js +5 -1
- package/dist/cjs/mixins/OxyServices.user.js +11 -2
- package/dist/cjs/mixins/OxyServices.workspaces.js +38 -3
- package/dist/cjs/utils/cache.js +9 -2
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/HttpService.js +18 -4
- package/dist/esm/OxyServices.base.js +15 -1
- package/dist/esm/mixins/OxyServices.applications.js +69 -6
- package/dist/esm/mixins/OxyServices.assets.js +16 -3
- package/dist/esm/mixins/OxyServices.features.js +47 -10
- package/dist/esm/mixins/OxyServices.managedAccounts.js +29 -3
- package/dist/esm/mixins/OxyServices.privacy.js +34 -8
- package/dist/esm/mixins/OxyServices.topics.js +5 -1
- package/dist/esm/mixins/OxyServices.user.js +11 -2
- package/dist/esm/mixins/OxyServices.workspaces.js +38 -3
- package/dist/esm/utils/cache.js +9 -2
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/HttpService.d.ts +9 -0
- package/dist/types/OxyServices.base.d.ts +12 -0
- package/dist/types/mixins/OxyServices.applications.d.ts +26 -0
- package/dist/types/mixins/OxyServices.features.d.ts +27 -6
- package/dist/types/mixins/OxyServices.managedAccounts.d.ts +16 -1
- package/dist/types/mixins/OxyServices.privacy.d.ts +22 -4
- package/dist/types/mixins/OxyServices.user.d.ts +8 -1
- package/dist/types/mixins/OxyServices.workspaces.d.ts +12 -0
- package/dist/types/models/interfaces.d.ts +12 -0
- package/dist/types/utils/cache.d.ts +4 -1
- package/package.json +1 -4
- package/src/HttpService.ts +28 -4
- package/src/OxyServices.base.ts +15 -1
- package/src/__tests__/httpServiceCache.test.ts +68 -0
- package/src/__tests__/linkedClient.test.ts +61 -0
- package/src/mixins/OxyServices.applications.ts +71 -6
- package/src/mixins/OxyServices.assets.ts +16 -3
- package/src/mixins/OxyServices.features.ts +47 -10
- package/src/mixins/OxyServices.managedAccounts.ts +29 -3
- package/src/mixins/OxyServices.privacy.ts +34 -8
- package/src/mixins/OxyServices.topics.ts +5 -1
- package/src/mixins/OxyServices.user.ts +11 -2
- package/src/mixins/OxyServices.workspaces.ts +39 -3
- package/src/mixins/__tests__/privacyCacheInvalidation.test.ts +147 -0
- package/src/models/interfaces.ts +13 -1
- package/src/utils/cache.ts +9 -2
- package/dist/cjs/mixins/OxyServices.popup.js +0 -263
- package/dist/esm/mixins/OxyServices.popup.js +0 -261
- package/dist/types/mixins/OxyServices.popup.d.ts +0 -170
package/README.md
CHANGED
|
@@ -93,6 +93,16 @@ Linked clients send the current Oxy bearer token for authenticated requests.
|
|
|
93
93
|
State-changing bearer requests do not fetch app-local CSRF tokens; cookie-only
|
|
94
94
|
writes still use CSRF.
|
|
95
95
|
|
|
96
|
+
**GET response caching is OFF by default for linked clients** (since 3.9.0). The
|
|
97
|
+
SDK's per-instance GET cache is only safe on the canonical `OxyServices` client,
|
|
98
|
+
where every mutation (`updateProfile`, `followUser`, `blockUser`, …) busts the
|
|
99
|
+
matching cached GET. A linked client targets the consuming app's own backend,
|
|
100
|
+
whose resources and write endpoints the SDK cannot know or invalidate — so a
|
|
101
|
+
cached GET there would serve stale data after the app mutates its own data.
|
|
102
|
+
Caching is left to the consumer's own layer (React Query / stores). Pass
|
|
103
|
+
`oxy.createLinkedClient({ baseURL, enableCache: true })` to opt back in when the
|
|
104
|
+
consumer accepts responsibility for invalidation.
|
|
105
|
+
|
|
96
106
|
## Backend Auth Middleware
|
|
97
107
|
|
|
98
108
|
Backends should use the SDK server helpers instead of local auth request types
|