Page MenuHomePhabricator

D11971.diff
No OneTemporary

D11971.diff

diff --git a/lib/types/identity-search/auth-message-types.js b/lib/types/identity-search/auth-message-types.js
--- a/lib/types/identity-search/auth-message-types.js
+++ b/lib/types/identity-search/auth-message-types.js
@@ -15,7 +15,7 @@
import type { TInterface } from 'tcomb';
import t from 'tcomb';
-import { tShape, tString } from '../../utils/validation-utils.js';
+import { tShape, tString, tUserID } from '../../utils/validation-utils.js';
export type IdentitySearchAuthMessage = {
+type: 'IdentitySearchAuthMessage',
@@ -27,7 +27,7 @@
export const identityAuthMessageValidator: TInterface<IdentitySearchAuthMessage> =
tShape<IdentitySearchAuthMessage>({
type: tString('IdentitySearchAuthMessage'),
- userID: t.String,
+ userID: tUserID,
deviceID: t.String,
accessToken: t.String,
});
diff --git a/lib/types/identity-search/search-response-types.js b/lib/types/identity-search/search-response-types.js
--- a/lib/types/identity-search/search-response-types.js
+++ b/lib/types/identity-search/search-response-types.js
@@ -15,7 +15,7 @@
import type { TInterface, TUnion } from 'tcomb';
import t from 'tcomb';
-import { tShape, tString } from '../../utils/validation-utils.js';
+import { tShape, tString, tUserID } from '../../utils/validation-utils.js';
export type IdentitySearchFailure = {
+id: string,
@@ -35,7 +35,7 @@
export const identitySearchUserValidator: TInterface<IdentitySearchUser> =
tShape<IdentitySearchUser>({
- userID: t.String,
+ userID: tUserID,
username: t.String,
});
diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js
--- a/lib/types/identity-service-types.js
+++ b/lib/types/identity-service-types.js
@@ -17,7 +17,7 @@
currentUserInfoValidator,
type CurrentUserInfo,
} from './user-types.js';
-import { tShape } from '../utils/validation-utils.js';
+import { tUserID, tShape } from '../utils/validation-utils.js';
export type UserAuthMetadata = {
+userID: string,
@@ -99,7 +99,7 @@
export const farcasterUserValidator: TInterface<FarcasterUser> =
tShape<FarcasterUser>({
- userID: t.String,
+ userID: tUserID,
username: t.String,
farcasterID: t.String,
});
@@ -188,7 +188,7 @@
};
export const identityAuthResultValidator: TInterface<IdentityAuthResult> =
tShape<IdentityAuthResult>({
- userID: t.String,
+ userID: tUserID,
accessToken: t.String,
username: t.String,
preRequestUserState: t.maybe(currentUserInfoValidator),
diff --git a/lib/types/relationship-types.js b/lib/types/relationship-types.js
--- a/lib/types/relationship-types.js
+++ b/lib/types/relationship-types.js
@@ -5,7 +5,12 @@
import type { AccountUserInfo } from './user-types.js';
import { values } from '../utils/objects.js';
-import { tNumEnum, tShape, tString } from '../utils/validation-utils.js';
+import {
+ tUserID,
+ tNumEnum,
+ tShape,
+ tString,
+} from '../utils/validation-utils.js';
export const undirectedStatus = Object.freeze({
KNOW_OF: 0,
@@ -86,7 +91,7 @@
export const farcasterRelationshipRequestValidator: TInterface<FarcasterRelationshipRequest> =
tShape<FarcasterRelationshipRequest>({
action: tString('farcaster'),
- userIDsToFID: t.dict(t.String, t.String),
+ userIDsToFID: t.dict(tUserID, t.String),
});
type SharedRelationshipRow = {
diff --git a/lib/types/report-types.js b/lib/types/report-types.js
--- a/lib/types/report-types.js
+++ b/lib/types/report-types.js
@@ -9,7 +9,11 @@
import type { AppState, BaseAction } from './redux-types.js';
import { type MixedRawThreadInfos } from './thread-types.js';
import type { UserInfo, UserInfos } from './user-types.js';
-import { tPlatformDetails, tShape } from '../utils/validation-utils.js';
+import {
+ tPlatformDetails,
+ tShape,
+ tUserID,
+} from '../utils/validation-utils.js';
export type EnabledReports = {
+crashReports: boolean,
@@ -218,7 +222,7 @@
export const reportInfoValidator: TInterface<ReportInfo> = tShape<ReportInfo>({
id: t.String,
- viewerID: t.String,
+ viewerID: tUserID,
platformDetails: tPlatformDetails,
creationTime: t.Number,
});
diff --git a/lib/types/request-types.js b/lib/types/request-types.js
--- a/lib/types/request-types.js
+++ b/lib/types/request-types.js
@@ -28,7 +28,7 @@
accountUserInfoValidator,
} from './user-types.js';
import { mixedRawThreadInfoValidator } from '../permissions/minimally-encoded-raw-thread-info-validators.js';
-import { tNumber, tShape, tID } from '../utils/validation-utils.js';
+import { tNumber, tShape, tID, tUserID } from '../utils/validation-utils.js';
// "Server requests" are requests for information that the server delivers to
// clients. Clients then respond to those requests with a "client response".
@@ -138,7 +138,7 @@
userInfos: t.maybe(t.list(accountUserInfoValidator)),
deleteThreadIDs: t.maybe(t.list(tID)),
deleteEntryIDs: t.maybe(t.list(tID)),
- deleteUserInfoIDs: t.maybe(t.list(t.String)),
+ deleteUserInfoIDs: t.maybe(t.list(tUserID)),
}),
),
});
diff --git a/lib/types/tunnelbroker/peer-to-peer-message-types.js b/lib/types/tunnelbroker/peer-to-peer-message-types.js
--- a/lib/types/tunnelbroker/peer-to-peer-message-types.js
+++ b/lib/types/tunnelbroker/peer-to-peer-message-types.js
@@ -3,7 +3,7 @@
import type { TInterface, TUnion } from 'tcomb';
import t from 'tcomb';
-import { tShape, tString } from '../../utils/validation-utils.js';
+import { tShape, tString, tUserID } from '../../utils/validation-utils.js';
import { type EncryptedData, encryptedDataValidator } from '../crypto-types.js';
import {
signedDeviceListValidator,
@@ -15,7 +15,7 @@
+deviceID: string,
};
const senderInfoValidator: TInterface<SenderInfo> = tShape<SenderInfo>({
- userID: t.String,
+ userID: tUserID,
deviceID: t.String,
});
@@ -84,7 +84,7 @@
export const deviceListUpdatedValidator: TInterface<DeviceListUpdated> =
tShape<DeviceListUpdated>({
type: tString(peerToPeerMessageTypes.DEVICE_LIST_UPDATED),
- userID: t.String,
+ userID: tUserID,
signedDeviceList: signedDeviceListValidator,
});
diff --git a/lib/types/tunnelbroker/qr-code-auth-message-types.js b/lib/types/tunnelbroker/qr-code-auth-message-types.js
--- a/lib/types/tunnelbroker/qr-code-auth-message-types.js
+++ b/lib/types/tunnelbroker/qr-code-auth-message-types.js
@@ -3,7 +3,7 @@
import type { TInterface, TUnion } from 'tcomb';
import t from 'tcomb';
-import { tShape, tString } from '../../utils/validation-utils.js';
+import { tShape, tString, tUserID } from '../../utils/validation-utils.js';
export const qrCodeAuthMessageTypes = Object.freeze({
DEVICE_LIST_UPDATE_SUCCESS: 'DeviceListUpdateSuccess',
@@ -19,7 +19,7 @@
export const deviceListUpdateSuccessValidator: TInterface<DeviceListUpdateSuccess> =
tShape<DeviceListUpdateSuccess>({
type: tString(qrCodeAuthMessageTypes.DEVICE_LIST_UPDATE_SUCCESS),
- userID: t.String,
+ userID: tUserID,
primaryDeviceID: t.String,
});
diff --git a/lib/types/tunnelbroker/session-types.js b/lib/types/tunnelbroker/session-types.js
--- a/lib/types/tunnelbroker/session-types.js
+++ b/lib/types/tunnelbroker/session-types.js
@@ -3,7 +3,7 @@
import type { TInterface } from 'tcomb';
import t from 'tcomb';
-import { tShape, tString } from '../../utils/validation-utils.js';
+import { tShape, tString, tUserID } from '../../utils/validation-utils.js';
export type TunnelbrokerDeviceTypes = 'mobile' | 'web' | 'keyserver';
@@ -35,7 +35,7 @@
type: tString('ConnectionInitializationMessage'),
deviceID: t.String,
accessToken: t.String,
- userID: t.String,
+ userID: tUserID,
notifyToken: t.maybe(t.String),
deviceType: t.enums.of(['mobile', 'web', 'keyserver']),
deviceAppVersion: t.maybe(t.String),
diff --git a/lib/utils/entity-text.js b/lib/utils/entity-text.js
--- a/lib/utils/entity-text.js
+++ b/lib/utils/entity-text.js
@@ -6,7 +6,7 @@
import type { GetENSNames } from './ens-helpers.js';
import type { GetFCNames } from './farcaster-helpers.js';
-import { tID, tShape, tString } from './validation-utils.js';
+import { tID, tShape, tString, tUserID } from './validation-utils.js';
import { useENSNames } from '../hooks/ens-cache.js';
import { useFCNames } from '../hooks/fc-cache.js';
import { threadNoun } from '../shared/thread-utils.js';
@@ -31,7 +31,7 @@
};
export const userEntityValidator: TInterface<UserEntity> = tShape<UserEntity>({
type: tString('user'),
- id: t.String,
+ id: tUserID,
username: t.maybe(t.String),
isViewer: t.maybe(t.Boolean),
possessive: t.maybe(t.Boolean),
diff --git a/lib/utils/url-utils.js b/lib/utils/url-utils.js
--- a/lib/utils/url-utils.js
+++ b/lib/utils/url-utils.js
@@ -7,6 +7,7 @@
tID,
tShape,
pendingThreadIDRegex,
+ tUserID,
} from './validation-utils.js';
type MutableURLInfo = {
@@ -50,7 +51,7 @@
]),
),
threadCreation: t.maybe(t.Boolean),
- selectedUserList: t.maybe(t.list(t.String)),
+ selectedUserList: t.maybe(t.list(tUserID)),
inviteSecret: t.maybe(t.String),
qrCode: t.maybe(t.Boolean),
});

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 5:29 AM (21 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2533980
Default Alt Text
D11971.diff (8 KB)

Event Timeline