@oxy.so/core 7.11.1 → 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.
- package/dist/cjs/HttpService.js +70 -1
- package/dist/cjs/OxyServices.js +1 -1
- package/dist/cjs/api/apps.js +1 -1
- package/dist/cjs/api/auth.js +1 -1
- package/dist/cjs/api/billing.js +4 -3
- package/dist/cjs/api/devices.js +5 -4
- package/dist/cjs/api/follows.js +11 -10
- package/dist/cjs/api/holderEvidence.js +12 -0
- package/dist/cjs/api/privacy.js +8 -7
- package/dist/cjs/api/session.js +128 -7
- package/dist/cjs/api/topics.js +4 -3
- package/dist/cjs/api/users.js +5 -4
- package/dist/cjs/i18n/locales/compact/es-ES.generated.js +1 -1
- package/dist/cjs/i18n/locales/en-US.js +40 -15
- package/dist/cjs/i18n/locales/es-ES.js +40 -15
- package/dist/cjs/index.js +6 -4
- package/dist/esm/HttpService.js +70 -1
- package/dist/esm/OxyServices.js +1 -1
- package/dist/esm/api/apps.js +1 -1
- package/dist/esm/api/auth.js +1 -1
- package/dist/esm/api/billing.js +4 -3
- package/dist/esm/api/devices.js +5 -4
- package/dist/esm/api/follows.js +11 -10
- package/dist/esm/api/holderEvidence.js +9 -0
- package/dist/esm/api/privacy.js +8 -7
- package/dist/esm/api/session.js +128 -7
- package/dist/esm/api/topics.js +4 -3
- package/dist/esm/api/users.js +5 -4
- package/dist/esm/i18n/locales/compact/es-ES.generated.js +1 -1
- package/dist/esm/i18n/locales/en-US.js +40 -15
- package/dist/esm/i18n/locales/es-ES.js +40 -15
- package/dist/esm/index.js +1 -0
- package/dist/types/HttpService.d.ts +25 -1
- package/dist/types/api/holderEvidence.d.ts +45 -0
- package/dist/types/api/session.d.ts +21 -0
- package/dist/types/i18n/locales/en-US.d.ts +37 -12
- package/dist/types/i18n/locales/es-ES.d.ts +37 -12
- package/dist/types/index.d.ts +3 -1
- package/dist/types/server/safety.d.ts +9 -9
- package/package.json +2 -2
- package/src/HttpService.ts +108 -1
- package/src/OxyServices.ts +4 -1
- package/src/api/apps.ts +1 -1
- package/src/api/auth.ts +9 -4
- package/src/api/billing.ts +12 -5
- package/src/api/devices.ts +6 -4
- package/src/api/follows.ts +12 -10
- package/src/api/holderEvidence.ts +66 -0
- package/src/api/privacy.ts +9 -7
- package/src/api/session.ts +163 -9
- package/src/api/topics.ts +5 -3
- package/src/api/users.ts +6 -4
- package/src/i18n/locales/compact/es-ES.generated.ts +1 -1
- package/src/i18n/locales/en-US.ts +41 -15
- package/src/i18n/locales/es-ES.ts +42 -15
- package/src/index.ts +8 -0
package/dist/cjs/api/users.js
CHANGED
|
@@ -42,6 +42,7 @@ const accountCacheSweep_1 = require("../utils/accountCacheSweep");
|
|
|
42
42
|
const errorUtils_1 = require("../utils/errorUtils");
|
|
43
43
|
const batchLookup_1 = require("../utils/batchLookup");
|
|
44
44
|
const logger_1 = require("../logger");
|
|
45
|
+
const enc = encodeURIComponent;
|
|
45
46
|
const PROFILE_TTL = 5 * 60 * 1000;
|
|
46
47
|
const SESSION_USER_TTL = 2 * 60 * 1000;
|
|
47
48
|
const ME_TTL = 60 * 1000;
|
|
@@ -61,7 +62,7 @@ class UsersApi {
|
|
|
61
62
|
* registry-fresh read that neither serves nor overwrites a cached entry.
|
|
62
63
|
*/
|
|
63
64
|
async get(userId, options) {
|
|
64
|
-
const user = await this.ctx.request('GET', `/users/${userId}`, undefined, {
|
|
65
|
+
const user = await this.ctx.request('GET', `/users/${enc(userId)}`, undefined, {
|
|
65
66
|
cache: options?.cache ?? true,
|
|
66
67
|
cacheTTL: PROFILE_TTL,
|
|
67
68
|
});
|
|
@@ -143,7 +144,7 @@ class UsersApi {
|
|
|
143
144
|
}
|
|
144
145
|
/** The user a session belongs to. */
|
|
145
146
|
async bySession(sessionId) {
|
|
146
|
-
const user = await this.ctx.request('GET', `/session/user/${sessionId}`, undefined, {
|
|
147
|
+
const user = await this.ctx.request('GET', `/session/user/${enc(sessionId)}`, undefined, {
|
|
147
148
|
cache: true,
|
|
148
149
|
cacheTTL: SESSION_USER_TTL,
|
|
149
150
|
});
|
|
@@ -219,7 +220,7 @@ class UsersApi {
|
|
|
219
220
|
const pagination = typeof limitOrPagination === 'number'
|
|
220
221
|
? { limit: limitOrPagination }
|
|
221
222
|
: (limitOrPagination ?? {});
|
|
222
|
-
const users = await this.ctx.request('GET', `/profiles/${userId}/similar`, (0, apiUtils_1.buildQueryParams)(pagination), {
|
|
223
|
+
const users = await this.ctx.request('GET', `/profiles/${enc(userId)}/similar`, (0, apiUtils_1.buildQueryParams)(pagination), {
|
|
223
224
|
cache: true,
|
|
224
225
|
cacheTTL: PROFILE_TTL,
|
|
225
226
|
});
|
|
@@ -231,7 +232,7 @@ class UsersApi {
|
|
|
231
232
|
* account. Cached 5 minutes.
|
|
232
233
|
*/
|
|
233
234
|
async moderators(communityId) {
|
|
234
|
-
const moderators = await this.ctx.request('GET', `/users/${communityId}/moderators`, undefined, { cache: true, cacheTTL: PROFILE_TTL });
|
|
235
|
+
const moderators = await this.ctx.request('GET', `/users/${enc(communityId)}/moderators`, undefined, { cache: true, cacheTTL: PROFILE_TTL });
|
|
235
236
|
return moderators.map((user) => (0, userIdentity_1.normalizeUserIdentity)(user));
|
|
236
237
|
}
|
|
237
238
|
/**
|