1
1
// TODO: change all to_uid to to_member_id
2
2
import { MemberId , MemberUsername , OperationId } from "./identifiers" ;
3
3
import { VideoReference } from "./MediaReference" ;
4
- import { Omit } from "../helpers/Omit" ;
5
4
6
5
export enum OperationType {
7
6
CREATE_MEMBER = "CREATE_MEMBER" ,
@@ -22,6 +21,16 @@ export interface CreateMemberPayload {
22
21
username : MemberUsername ;
23
22
videoReference : VideoReference ;
24
23
}
24
+ // START [video-reference] legacy types
25
+ export interface LegacyCreateMemberPayload {
26
+ full_name : string ;
27
+ request_invite_from_member_id ?: MemberId ;
28
+ username : MemberUsername ;
29
+ video_url : string ;
30
+ }
31
+ export type LegacyCompatCreateMemberPayload = CreateMemberPayload &
32
+ LegacyCreateMemberPayload ;
33
+ // END [video-reference] legacy types
25
34
26
35
export interface EditMemberPayload {
27
36
full_name ?: string ;
@@ -44,12 +53,27 @@ export interface VerifyPayload {
44
53
to_uid : MemberId ;
45
54
videoReference : VideoReference ;
46
55
}
56
+ // START [video-reference] legacy types
57
+ export interface LegacyVerifyPayload {
58
+ to_uid : MemberId ;
59
+ video_url : string ;
60
+ }
61
+ export type LegacyCompatVerifyPayload = VerifyPayload & LegacyVerifyPayload ;
62
+ // END [video-reference] legacy types
47
63
48
64
export interface InvitePayload {
49
65
invite_token : string ;
50
66
is_joint_video : boolean ;
51
67
videoReference : VideoReference ;
52
68
}
69
+ // START [video-reference] legacy types
70
+ export interface LegacyInvitePayload {
71
+ invite_token : string ;
72
+ is_joint_video : boolean ;
73
+ video_token : string ;
74
+ }
75
+ export type LegacyCompatInvitePayload = InvitePayload & LegacyInvitePayload ;
76
+ // END [video-reference] legacy types
53
77
54
78
export interface TrustPayload {
55
79
to_uid : MemberId ;
@@ -90,7 +114,9 @@ export interface SavedOperationBase {
90
114
91
115
interface CreateMemberOperationMetadata {
92
116
op_code : OperationType . CREATE_MEMBER ;
93
- data : CreateMemberPayload ;
117
+ // TODO: [video-reference] legacy - once apps updated, use CreateMemberPayload
118
+ // data: CreateMemberPayload;
119
+ data : LegacyCompatCreateMemberPayload ;
94
120
}
95
121
96
122
export type CreateMemberOperation = SavedOperationBase &
@@ -136,7 +162,9 @@ export type RequestVerificationOperationToBeCreated = ToSaveOperationBase &
136
162
137
163
interface VerifyOperationMetadata {
138
164
op_code : OperationType . VERIFY ;
139
- data : VerifyPayload ;
165
+ // TODO: [video-reference] legacy - once apps updated, use VerifyPayload
166
+ // data: VerifyPayload;
167
+ data : LegacyCompatVerifyPayload ;
140
168
}
141
169
142
170
export type VerifyOperation = SavedOperationBase & VerifyOperationMetadata ;
@@ -145,7 +173,9 @@ export type VerifyOperationToBeCreated = ToSaveOperationBase &
145
173
146
174
interface InviteOperationMetadata {
147
175
op_code : OperationType . INVITE ;
148
- data : InvitePayload ;
176
+ // TODO: [video-reference] legacy - once apps updated, use InvitePayload
177
+ // data: InviteMemberPayload;
178
+ data : LegacyCompatInvitePayload ;
149
179
}
150
180
export type InviteOperation = SavedOperationBase & InviteOperationMetadata ;
151
181
export type InviteOperationToBeCreated = ToSaveOperationBase &
@@ -198,70 +228,3 @@ export type OperationToBeCreated =
198
228
| TrustOperationToBeCreated
199
229
| MintOperationToBeCreated
200
230
| GiveOperationToBeCreated ;
201
-
202
- // LEGACY TYPES START---------------------
203
- // TODO: remove legacy types
204
- // missing videoReference means video location is inferred from member ID
205
- export type LegacyCreateMemberPayload = Omit <
206
- CreateMemberPayload ,
207
- "videoReference"
208
- > ;
209
- interface LegacyCreateMemberOperationMetadata
210
- extends Omit < CreateMemberOperationMetadata , "data" > {
211
- data : LegacyCreateMemberPayload ;
212
- }
213
- export type LegacyCreateMemberOperation = SavedOperationBase &
214
- LegacyCreateMemberOperationMetadata ;
215
- export type LegacyCreateMemberOperationToBeCreated = ToSaveOperationBase &
216
- LegacyCreateMemberOperationMetadata ;
217
-
218
- // Presence of video_url instead of videoReference indicates legacy request
219
- export interface LegacyVerifyPayload
220
- extends Omit < VerifyPayload , "videoReference" > {
221
- video_url : string ;
222
- }
223
- export interface LegacyVerifyOperationMetadata
224
- extends Omit < VerifyOperationMetadata , "data" > {
225
- data : LegacyVerifyPayload ;
226
- }
227
- export type LegacyVerifyOperation = SavedOperationBase &
228
- LegacyVerifyOperationMetadata ;
229
- export type LegacyVerifyOperationToBeCreated = ToSaveOperationBase &
230
- LegacyVerifyOperationMetadata ;
231
-
232
- export interface LegacyInvitePayload
233
- extends Omit < InvitePayload , "videoReference" > {
234
- video_token : string ;
235
- }
236
- export interface LegacyInviteOperationMetadata
237
- extends Omit < InviteOperationMetadata , "data" > {
238
- data : LegacyInvitePayload ;
239
- }
240
- export type LegacyInviteOperation = SavedOperationBase &
241
- LegacyInviteOperationMetadata ;
242
- export type LegacyInviteOperationToBeCreated = ToSaveOperationBase &
243
- LegacyInviteOperationMetadata ;
244
-
245
- export type LegacyOperation =
246
- | LegacyCreateMemberOperation
247
- | LegacyVerifyOperation
248
- | LegacyInviteOperation
249
- | EditMemberOperation
250
- | FlagMemberOperation
251
- | ResolveFlagMemberOperation
252
- | RequestVerificationOperation
253
- | TrustOperation
254
- | MintOperation
255
- | GiveOperation ;
256
- export type LegacyOperationToBeCreated =
257
- | LegacyCreateMemberOperationToBeCreated
258
- | LegacyVerifyOperationToBeCreated
259
- | LegacyInviteOperationToBeCreated
260
- | EditMemberOperationToBeCreated
261
- | FlagMemberOperationToBeCreated
262
- | ResolveFlagMemberOperationToBeCreated
263
- | RequestVerificationOperationToBeCreated
264
- | TrustOperationToBeCreated
265
- | MintOperationToBeCreated
266
- | GiveOperationToBeCreated ;
267
- // LEGACY TYPES END---------------------
0 commit comments