@oxy.so/core 7.12.0 → 7.13.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.
Files changed (39) hide show
  1. package/dist/cjs/api/apps.js +1 -1
  2. package/dist/cjs/api/auth.js +1 -1
  3. package/dist/cjs/api/billing.js +4 -3
  4. package/dist/cjs/api/devices.js +5 -4
  5. package/dist/cjs/api/follows.js +11 -10
  6. package/dist/cjs/api/privacy.js +8 -7
  7. package/dist/cjs/api/session.js +10 -7
  8. package/dist/cjs/api/topics.js +4 -3
  9. package/dist/cjs/api/users.js +5 -4
  10. package/dist/cjs/i18n/locales/compact/es-ES.generated.js +1 -1
  11. package/dist/cjs/i18n/locales/en-US.js +40 -15
  12. package/dist/cjs/i18n/locales/es-ES.js +40 -15
  13. package/dist/esm/api/apps.js +1 -1
  14. package/dist/esm/api/auth.js +1 -1
  15. package/dist/esm/api/billing.js +4 -3
  16. package/dist/esm/api/devices.js +5 -4
  17. package/dist/esm/api/follows.js +11 -10
  18. package/dist/esm/api/privacy.js +8 -7
  19. package/dist/esm/api/session.js +10 -7
  20. package/dist/esm/api/topics.js +4 -3
  21. package/dist/esm/api/users.js +5 -4
  22. package/dist/esm/i18n/locales/compact/es-ES.generated.js +1 -1
  23. package/dist/esm/i18n/locales/en-US.js +40 -15
  24. package/dist/esm/i18n/locales/es-ES.js +40 -15
  25. package/dist/types/i18n/locales/en-US.d.ts +37 -12
  26. package/dist/types/i18n/locales/es-ES.d.ts +37 -12
  27. package/package.json +2 -2
  28. package/src/api/apps.ts +1 -1
  29. package/src/api/auth.ts +9 -4
  30. package/src/api/billing.ts +12 -5
  31. package/src/api/devices.ts +6 -4
  32. package/src/api/follows.ts +12 -10
  33. package/src/api/privacy.ts +9 -7
  34. package/src/api/session.ts +18 -9
  35. package/src/api/topics.ts +5 -3
  36. package/src/api/users.ts +6 -4
  37. package/src/i18n/locales/compact/es-ES.generated.ts +1 -1
  38. package/src/i18n/locales/en-US.ts +41 -15
  39. package/src/i18n/locales/es-ES.ts +42 -15
@@ -6,6 +6,7 @@ import { OXY_ACCOUNT_LIST_CACHE_KEY, OXY_ACCOUNT_LIST_CACHE_QUERY_PREFIX, oxyAcc
6
6
  import { extractErrorStatus } from '../utils/errorUtils.js';
7
7
  import { runBatchLookup } from '../utils/batchLookup.js';
8
8
  import { logger } from '../logger/index.js';
9
+ const enc = encodeURIComponent;
9
10
  const PROFILE_TTL = 5 * 60 * 1000;
10
11
  const SESSION_USER_TTL = 2 * 60 * 1000;
11
12
  const ME_TTL = 60 * 1000;
@@ -25,7 +26,7 @@ export class UsersApi {
25
26
  * registry-fresh read that neither serves nor overwrites a cached entry.
26
27
  */
27
28
  async get(userId, options) {
28
- const user = await this.ctx.request('GET', `/users/${userId}`, undefined, {
29
+ const user = await this.ctx.request('GET', `/users/${enc(userId)}`, undefined, {
29
30
  cache: options?.cache ?? true,
30
31
  cacheTTL: PROFILE_TTL,
31
32
  });
@@ -107,7 +108,7 @@ export class UsersApi {
107
108
  }
108
109
  /** The user a session belongs to. */
109
110
  async bySession(sessionId) {
110
- const user = await this.ctx.request('GET', `/session/user/${sessionId}`, undefined, {
111
+ const user = await this.ctx.request('GET', `/session/user/${enc(sessionId)}`, undefined, {
111
112
  cache: true,
112
113
  cacheTTL: SESSION_USER_TTL,
113
114
  });
@@ -183,7 +184,7 @@ export class UsersApi {
183
184
  const pagination = typeof limitOrPagination === 'number'
184
185
  ? { limit: limitOrPagination }
185
186
  : (limitOrPagination ?? {});
186
- const users = await this.ctx.request('GET', `/profiles/${userId}/similar`, buildQueryParams(pagination), {
187
+ const users = await this.ctx.request('GET', `/profiles/${enc(userId)}/similar`, buildQueryParams(pagination), {
187
188
  cache: true,
188
189
  cacheTTL: PROFILE_TTL,
189
190
  });
@@ -195,7 +196,7 @@ export class UsersApi {
195
196
  * account. Cached 5 minutes.
196
197
  */
197
198
  async moderators(communityId) {
198
- const moderators = await this.ctx.request('GET', `/users/${communityId}/moderators`, undefined, { cache: true, cacheTTL: PROFILE_TTL });
199
+ const moderators = await this.ctx.request('GET', `/users/${enc(communityId)}/moderators`, undefined, { cache: true, cacheTTL: PROFILE_TTL });
199
200
  return moderators.map((user) => normalizeUserIdentity(user));
200
201
  }
201
202
  /**