@uniswap/client-platform-service 0.0.6 → 0.0.7

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.
@@ -1,5 +1,5 @@
1
1
  import { MethodKind } from "@bufbuild/protobuf";
2
- import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
2
+ import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, GetChallengeTypesRequest, GetChallengeTypesResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, SignoutRequest, SignoutResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
3
3
  /**
4
4
  * typically utilized by Entry Gateway for inspecting the validity of a session
5
5
  *
@@ -30,6 +30,21 @@ export declare const initSession: {
30
30
  readonly typeName: "uniswap.platformservice.v1.SessionService";
31
31
  };
32
32
  };
33
+ /**
34
+ * return a list of possible challenge types
35
+ *
36
+ * @generated from rpc uniswap.platformservice.v1.SessionService.GetChallengeTypes
37
+ */
38
+ export declare const getChallengeTypes: {
39
+ readonly localName: "getChallengeTypes";
40
+ readonly name: "GetChallengeTypes";
41
+ readonly kind: MethodKind.Unary;
42
+ readonly I: typeof GetChallengeTypesRequest;
43
+ readonly O: typeof GetChallengeTypesResponse;
44
+ readonly service: {
45
+ readonly typeName: "uniswap.platformservice.v1.SessionService";
46
+ };
47
+ };
33
48
  /**
34
49
  * used by client to request a challenge
35
50
  *
@@ -46,7 +61,8 @@ export declare const challenge: {
46
61
  };
47
62
  };
48
63
  /**
49
- * a universal method for all types of bot detection mechanism
64
+ * a universal method for all challenge types (auth and bot detection)
65
+ * OauthVerify is implemented separately as a pure GET endpoint, which proxy request to Verify POST locally.
50
66
  *
51
67
  * @generated from rpc uniswap.platformservice.v1.SessionService.Verify
52
68
  */
@@ -90,3 +106,19 @@ export declare const updateSession: {
90
106
  readonly typeName: "uniswap.platformservice.v1.SessionService";
91
107
  };
92
108
  };
109
+ /**
110
+ * 1. Sign out user and clear authenticated session,
111
+ * 2. Rotate with a brand new session
112
+ *
113
+ * @generated from rpc uniswap.platformservice.v1.SessionService.Signout
114
+ */
115
+ export declare const signout: {
116
+ readonly localName: "signout";
117
+ readonly name: "Signout";
118
+ readonly kind: MethodKind.Unary;
119
+ readonly I: typeof SignoutRequest;
120
+ readonly O: typeof SignoutResponse;
121
+ readonly service: {
122
+ readonly typeName: "uniswap.platformservice.v1.SessionService";
123
+ };
124
+ };
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
5
  import { MethodKind } from "@bufbuild/protobuf";
6
- import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
6
+ import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, GetChallengeTypesRequest, GetChallengeTypesResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, SignoutRequest, SignoutResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
7
7
  /**
8
8
  * typically utilized by Entry Gateway for inspecting the validity of a session
9
9
  *
@@ -34,6 +34,21 @@ export const initSession = {
34
34
  typeName: "uniswap.platformservice.v1.SessionService"
35
35
  }
36
36
  };
37
+ /**
38
+ * return a list of possible challenge types
39
+ *
40
+ * @generated from rpc uniswap.platformservice.v1.SessionService.GetChallengeTypes
41
+ */
42
+ export const getChallengeTypes = {
43
+ localName: "getChallengeTypes",
44
+ name: "GetChallengeTypes",
45
+ kind: MethodKind.Unary,
46
+ I: GetChallengeTypesRequest,
47
+ O: GetChallengeTypesResponse,
48
+ service: {
49
+ typeName: "uniswap.platformservice.v1.SessionService"
50
+ }
51
+ };
37
52
  /**
38
53
  * used by client to request a challenge
39
54
  *
@@ -50,7 +65,8 @@ export const challenge = {
50
65
  }
51
66
  };
52
67
  /**
53
- * a universal method for all types of bot detection mechanism
68
+ * a universal method for all challenge types (auth and bot detection)
69
+ * OauthVerify is implemented separately as a pure GET endpoint, which proxy request to Verify POST locally.
54
70
  *
55
71
  * @generated from rpc uniswap.platformservice.v1.SessionService.Verify
56
72
  */
@@ -94,3 +110,19 @@ export const updateSession = {
94
110
  typeName: "uniswap.platformservice.v1.SessionService"
95
111
  }
96
112
  };
113
+ /**
114
+ * 1. Sign out user and clear authenticated session,
115
+ * 2. Rotate with a brand new session
116
+ *
117
+ * @generated from rpc uniswap.platformservice.v1.SessionService.Signout
118
+ */
119
+ export const signout = {
120
+ localName: "signout",
121
+ name: "Signout",
122
+ kind: MethodKind.Unary,
123
+ I: SignoutRequest,
124
+ O: SignoutResponse,
125
+ service: {
126
+ typeName: "uniswap.platformservice.v1.SessionService"
127
+ }
128
+ };
@@ -1,4 +1,4 @@
1
- import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
1
+ import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, GetChallengeTypesRequest, GetChallengeTypesResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, SignoutRequest, SignoutResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
2
2
  import { MethodKind } from "@bufbuild/protobuf";
3
3
  /**
4
4
  * @generated from service uniswap.platformservice.v1.SessionService
@@ -28,6 +28,17 @@ export declare const SessionService: {
28
28
  readonly O: typeof InitSessionResponse;
29
29
  readonly kind: MethodKind.Unary;
30
30
  };
31
+ /**
32
+ * return a list of possible challenge types
33
+ *
34
+ * @generated from rpc uniswap.platformservice.v1.SessionService.GetChallengeTypes
35
+ */
36
+ readonly getChallengeTypes: {
37
+ readonly name: "GetChallengeTypes";
38
+ readonly I: typeof GetChallengeTypesRequest;
39
+ readonly O: typeof GetChallengeTypesResponse;
40
+ readonly kind: MethodKind.Unary;
41
+ };
31
42
  /**
32
43
  * used by client to request a challenge
33
44
  *
@@ -40,7 +51,8 @@ export declare const SessionService: {
40
51
  readonly kind: MethodKind.Unary;
41
52
  };
42
53
  /**
43
- * a universal method for all types of bot detection mechanism
54
+ * a universal method for all challenge types (auth and bot detection)
55
+ * OauthVerify is implemented separately as a pure GET endpoint, which proxy request to Verify POST locally.
44
56
  *
45
57
  * @generated from rpc uniswap.platformservice.v1.SessionService.Verify
46
58
  */
@@ -72,5 +84,17 @@ export declare const SessionService: {
72
84
  readonly O: typeof UpdateSessionResponse;
73
85
  readonly kind: MethodKind.Unary;
74
86
  };
87
+ /**
88
+ * 1. Sign out user and clear authenticated session,
89
+ * 2. Rotate with a brand new session
90
+ *
91
+ * @generated from rpc uniswap.platformservice.v1.SessionService.Signout
92
+ */
93
+ readonly signout: {
94
+ readonly name: "Signout";
95
+ readonly I: typeof SignoutRequest;
96
+ readonly O: typeof SignoutResponse;
97
+ readonly kind: MethodKind.Unary;
98
+ };
75
99
  };
76
100
  };
@@ -2,7 +2,7 @@
2
2
  // @generated from file uniswap/platformservice/v1/sessionService.proto (package uniswap.platformservice.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
- import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
5
+ import { ChallengeRequest, ChallengeResponse, DeleteSessionRequest, DeleteSessionResponse, GetChallengeTypesRequest, GetChallengeTypesResponse, InitSessionRequest, InitSessionResponse, IntrospectSessionRequest, IntrospectSessionResponse, SignoutRequest, SignoutResponse, UpdateSessionRequest, UpdateSessionResponse, VerifyRequest, VerifyResponse } from "./sessionService_pb.js";
6
6
  import { MethodKind } from "@bufbuild/protobuf";
7
7
  /**
8
8
  * @generated from service uniswap.platformservice.v1.SessionService
@@ -32,6 +32,17 @@ export const SessionService = {
32
32
  O: InitSessionResponse,
33
33
  kind: MethodKind.Unary,
34
34
  },
35
+ /**
36
+ * return a list of possible challenge types
37
+ *
38
+ * @generated from rpc uniswap.platformservice.v1.SessionService.GetChallengeTypes
39
+ */
40
+ getChallengeTypes: {
41
+ name: "GetChallengeTypes",
42
+ I: GetChallengeTypesRequest,
43
+ O: GetChallengeTypesResponse,
44
+ kind: MethodKind.Unary,
45
+ },
35
46
  /**
36
47
  * used by client to request a challenge
37
48
  *
@@ -44,7 +55,8 @@ export const SessionService = {
44
55
  kind: MethodKind.Unary,
45
56
  },
46
57
  /**
47
- * a universal method for all types of bot detection mechanism
58
+ * a universal method for all challenge types (auth and bot detection)
59
+ * OauthVerify is implemented separately as a pure GET endpoint, which proxy request to Verify POST locally.
48
60
  *
49
61
  * @generated from rpc uniswap.platformservice.v1.SessionService.Verify
50
62
  */
@@ -76,5 +88,17 @@ export const SessionService = {
76
88
  O: UpdateSessionResponse,
77
89
  kind: MethodKind.Unary,
78
90
  },
91
+ /**
92
+ * 1. Sign out user and clear authenticated session,
93
+ * 2. Rotate with a brand new session
94
+ *
95
+ * @generated from rpc uniswap.platformservice.v1.SessionService.Signout
96
+ */
97
+ signout: {
98
+ name: "Signout",
99
+ I: SignoutRequest,
100
+ O: SignoutResponse,
101
+ kind: MethodKind.Unary,
102
+ },
79
103
  }
80
104
  };
@@ -1,23 +1,41 @@
1
1
  import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
2
2
  import { Message, proto3 } from "@bufbuild/protobuf";
3
3
  /**
4
- * @generated from enum uniswap.platformservice.v1.BotDetectionType
4
+ * @generated from enum uniswap.platformservice.v1.ChallengeType
5
5
  */
6
- export declare enum BotDetectionType {
6
+ export declare enum ChallengeType {
7
7
  /**
8
- * @generated from enum value: BOT_DETECTION_NONE = 0;
8
+ * Bot detection mechanisms
9
+ *
10
+ * @generated from enum value: CHALLENGE_TYPE_UNSPECIFIED = 0;
11
+ */
12
+ UNSPECIFIED = 0,
13
+ /**
14
+ * @generated from enum value: CHALLENGE_TYPE_TURNSTILE = 1;
9
15
  */
10
- BOT_DETECTION_NONE = 0,
16
+ TURNSTILE = 1,
11
17
  /**
12
- * @generated from enum value: BOT_DETECTION_TURNSTILE = 1;
18
+ * @generated from enum value: CHALLENGE_TYPE_HASHCASH = 2;
13
19
  */
14
- BOT_DETECTION_TURNSTILE = 1,
20
+ HASHCASH = 2,
15
21
  /**
16
- * client should receive challenge in the format of json
22
+ * Login Authentication
17
23
  *
18
- * @generated from enum value: BOT_DETECTION_HASHCASH = 2;
24
+ * @generated from enum value: CHALLENGE_TYPE_GOOGLE = 3;
25
+ */
26
+ GOOGLE = 3,
27
+ /**
28
+ * @generated from enum value: CHALLENGE_TYPE_SLACK = 4;
29
+ */
30
+ SLACK = 4,
31
+ /**
32
+ * @generated from enum value: CHALLENGE_TYPE_GITHUB = 5;
19
33
  */
20
- BOT_DETECTION_HASHCASH = 2
34
+ GITHUB = 5,
35
+ /**
36
+ * @generated from enum value: CHALLENGE_TYPE_MAIL = 6;
37
+ */
38
+ MAIL = 6
21
39
  }
22
40
  /**
23
41
  * @generated from message uniswap.platformservice.v1.IntrospectSessionRequest
@@ -119,10 +137,58 @@ export declare class InitSessionResponse extends Message<InitSessionResponse> {
119
137
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): InitSessionResponse;
120
138
  static equals(a: InitSessionResponse | PlainMessage<InitSessionResponse> | undefined, b: InitSessionResponse | PlainMessage<InitSessionResponse> | undefined): boolean;
121
139
  }
140
+ /**
141
+ * @generated from message uniswap.platformservice.v1.GetChallengeTypesRequest
142
+ */
143
+ export declare class GetChallengeTypesRequest extends Message<GetChallengeTypesRequest> {
144
+ constructor(data?: PartialMessage<GetChallengeTypesRequest>);
145
+ static readonly runtime: typeof proto3;
146
+ static readonly typeName = "uniswap.platformservice.v1.GetChallengeTypesRequest";
147
+ static readonly fields: FieldList;
148
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetChallengeTypesRequest;
149
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetChallengeTypesRequest;
150
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetChallengeTypesRequest;
151
+ static equals(a: GetChallengeTypesRequest | PlainMessage<GetChallengeTypesRequest> | undefined, b: GetChallengeTypesRequest | PlainMessage<GetChallengeTypesRequest> | undefined): boolean;
152
+ }
153
+ /**
154
+ * @generated from message uniswap.platformservice.v1.GetChallengeTypesResponse
155
+ */
156
+ export declare class GetChallengeTypesResponse extends Message<GetChallengeTypesResponse> {
157
+ /**
158
+ * @generated from field: repeated uniswap.platformservice.v1.ChallengeType challenge_types = 1;
159
+ */
160
+ challengeTypes: ChallengeType[];
161
+ constructor(data?: PartialMessage<GetChallengeTypesResponse>);
162
+ static readonly runtime: typeof proto3;
163
+ static readonly typeName = "uniswap.platformservice.v1.GetChallengeTypesResponse";
164
+ static readonly fields: FieldList;
165
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetChallengeTypesResponse;
166
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetChallengeTypesResponse;
167
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetChallengeTypesResponse;
168
+ static equals(a: GetChallengeTypesResponse | PlainMessage<GetChallengeTypesResponse> | undefined, b: GetChallengeTypesResponse | PlainMessage<GetChallengeTypesResponse> | undefined): boolean;
169
+ }
122
170
  /**
123
171
  * @generated from message uniswap.platformservice.v1.ChallengeRequest
124
172
  */
125
173
  export declare class ChallengeRequest extends Message<ChallengeRequest> {
174
+ /**
175
+ * Challenge type (auth provider or bot detection). If not set, server decides
176
+ *
177
+ * @generated from field: optional uniswap.platformservice.v1.ChallengeType challenge_type = 1;
178
+ */
179
+ challengeType?: ChallengeType;
180
+ /**
181
+ * Email address (required when type=PROVIDER_EMAIL)
182
+ *
183
+ * @generated from field: optional string identifier = 2;
184
+ */
185
+ identifier?: string;
186
+ /**
187
+ * Post login redirect URL
188
+ *
189
+ * @generated from field: optional string redirect_url = 3;
190
+ */
191
+ redirectUrl?: string;
126
192
  constructor(data?: PartialMessage<ChallengeRequest>);
127
193
  static readonly runtime: typeof proto3;
128
194
  static readonly typeName = "uniswap.platformservice.v1.ChallengeRequest";
@@ -141,19 +207,25 @@ export declare class ChallengeResponse extends Message<ChallengeResponse> {
141
207
  */
142
208
  challengeId: string;
143
209
  /**
144
- * the bot detection mechanism client should use
210
+ * The challenge type being enforced for
145
211
  *
146
- * @generated from field: uniswap.platformservice.v1.BotDetectionType bot_detection_type = 2;
212
+ * @generated from field: uniswap.platformservice.v1.ChallengeType challenge_type = 2;
147
213
  */
148
- botDetectionType: BotDetectionType;
214
+ challengeType: ChallengeType;
149
215
  /**
150
- * contains extra data for challenge data
216
+ * Extra data for challenge (e.g., hashcash difficulty, turnstile site key)
151
217
  *
152
218
  * @generated from field: map<string, string> extra = 3;
153
219
  */
154
220
  extra: {
155
221
  [key: string]: string;
156
222
  };
223
+ /**
224
+ * OAuth authorization URL (for OAuth)
225
+ *
226
+ * @generated from field: optional string authorize_url = 4;
227
+ */
228
+ authorizeUrl?: string;
157
229
  constructor(data?: PartialMessage<ChallengeResponse>);
158
230
  static readonly runtime: typeof proto3;
159
231
  static readonly typeName = "uniswap.platformservice.v1.ChallengeResponse";
@@ -168,15 +240,23 @@ export declare class ChallengeResponse extends Message<ChallengeResponse> {
168
240
  */
169
241
  export declare class VerifyRequest extends Message<VerifyRequest> {
170
242
  /**
171
- * e.g., bot detection token or hashcash solution
243
+ * Bot detection token, hashcash solution, or OTP code. Oauth code == solution.
172
244
  *
173
245
  * @generated from field: string solution = 1;
174
246
  */
175
247
  solution: string;
176
248
  /**
249
+ * Oauth state = challenge_id
250
+ *
177
251
  * @generated from field: string challenge_id = 2;
178
252
  */
179
253
  challengeId: string;
254
+ /**
255
+ * Challenge type (must match the one used in Challenge). If not set, server infers from challenge_id
256
+ *
257
+ * @generated from field: uniswap.platformservice.v1.ChallengeType type = 3;
258
+ */
259
+ type: ChallengeType;
180
260
  constructor(data?: PartialMessage<VerifyRequest>);
181
261
  static readonly runtime: typeof proto3;
182
262
  static readonly typeName = "uniswap.platformservice.v1.VerifyRequest";
@@ -194,6 +274,18 @@ export declare class VerifyResponse extends Message<VerifyResponse> {
194
274
  * @generated from field: bool retry = 1;
195
275
  */
196
276
  retry: boolean;
277
+ /**
278
+ * seconds to wait before resend (for email+OTP)
279
+ *
280
+ * @generated from field: optional int32 wait_seconds = 2;
281
+ */
282
+ waitSeconds?: number;
283
+ /**
284
+ * OAuth redirect URL (for OAuth login flow)
285
+ *
286
+ * @generated from field: optional string redirect_url = 3;
287
+ */
288
+ redirectUrl?: string;
197
289
  constructor(data?: PartialMessage<VerifyResponse>);
198
290
  static readonly runtime: typeof proto3;
199
291
  static readonly typeName = "uniswap.platformservice.v1.VerifyResponse";
@@ -259,3 +351,29 @@ export declare class UpdateSessionResponse extends Message<UpdateSessionResponse
259
351
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UpdateSessionResponse;
260
352
  static equals(a: UpdateSessionResponse | PlainMessage<UpdateSessionResponse> | undefined, b: UpdateSessionResponse | PlainMessage<UpdateSessionResponse> | undefined): boolean;
261
353
  }
354
+ /**
355
+ * @generated from message uniswap.platformservice.v1.SignoutRequest
356
+ */
357
+ export declare class SignoutRequest extends Message<SignoutRequest> {
358
+ constructor(data?: PartialMessage<SignoutRequest>);
359
+ static readonly runtime: typeof proto3;
360
+ static readonly typeName = "uniswap.platformservice.v1.SignoutRequest";
361
+ static readonly fields: FieldList;
362
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SignoutRequest;
363
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SignoutRequest;
364
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SignoutRequest;
365
+ static equals(a: SignoutRequest | PlainMessage<SignoutRequest> | undefined, b: SignoutRequest | PlainMessage<SignoutRequest> | undefined): boolean;
366
+ }
367
+ /**
368
+ * @generated from message uniswap.platformservice.v1.SignoutResponse
369
+ */
370
+ export declare class SignoutResponse extends Message<SignoutResponse> {
371
+ constructor(data?: PartialMessage<SignoutResponse>);
372
+ static readonly runtime: typeof proto3;
373
+ static readonly typeName = "uniswap.platformservice.v1.SignoutResponse";
374
+ static readonly fields: FieldList;
375
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SignoutResponse;
376
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SignoutResponse;
377
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SignoutResponse;
378
+ static equals(a: SignoutResponse | PlainMessage<SignoutResponse> | undefined, b: SignoutResponse | PlainMessage<SignoutResponse> | undefined): boolean;
379
+ }
@@ -4,30 +4,52 @@
4
4
  // @ts-nocheck
5
5
  import { Message, proto3 } from "@bufbuild/protobuf";
6
6
  /**
7
- * @generated from enum uniswap.platformservice.v1.BotDetectionType
7
+ * @generated from enum uniswap.platformservice.v1.ChallengeType
8
8
  */
9
- export var BotDetectionType;
10
- (function (BotDetectionType) {
9
+ export var ChallengeType;
10
+ (function (ChallengeType) {
11
11
  /**
12
- * @generated from enum value: BOT_DETECTION_NONE = 0;
12
+ * Bot detection mechanisms
13
+ *
14
+ * @generated from enum value: CHALLENGE_TYPE_UNSPECIFIED = 0;
15
+ */
16
+ ChallengeType[ChallengeType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
17
+ /**
18
+ * @generated from enum value: CHALLENGE_TYPE_TURNSTILE = 1;
13
19
  */
14
- BotDetectionType[BotDetectionType["BOT_DETECTION_NONE"] = 0] = "BOT_DETECTION_NONE";
20
+ ChallengeType[ChallengeType["TURNSTILE"] = 1] = "TURNSTILE";
15
21
  /**
16
- * @generated from enum value: BOT_DETECTION_TURNSTILE = 1;
22
+ * @generated from enum value: CHALLENGE_TYPE_HASHCASH = 2;
17
23
  */
18
- BotDetectionType[BotDetectionType["BOT_DETECTION_TURNSTILE"] = 1] = "BOT_DETECTION_TURNSTILE";
24
+ ChallengeType[ChallengeType["HASHCASH"] = 2] = "HASHCASH";
19
25
  /**
20
- * client should receive challenge in the format of json
26
+ * Login Authentication
21
27
  *
22
- * @generated from enum value: BOT_DETECTION_HASHCASH = 2;
28
+ * @generated from enum value: CHALLENGE_TYPE_GOOGLE = 3;
29
+ */
30
+ ChallengeType[ChallengeType["GOOGLE"] = 3] = "GOOGLE";
31
+ /**
32
+ * @generated from enum value: CHALLENGE_TYPE_SLACK = 4;
23
33
  */
24
- BotDetectionType[BotDetectionType["BOT_DETECTION_HASHCASH"] = 2] = "BOT_DETECTION_HASHCASH";
25
- })(BotDetectionType || (BotDetectionType = {}));
26
- // Retrieve enum metadata with: proto3.getEnumType(BotDetectionType)
27
- proto3.util.setEnumType(BotDetectionType, "uniswap.platformservice.v1.BotDetectionType", [
28
- { no: 0, name: "BOT_DETECTION_NONE" },
29
- { no: 1, name: "BOT_DETECTION_TURNSTILE" },
30
- { no: 2, name: "BOT_DETECTION_HASHCASH" },
34
+ ChallengeType[ChallengeType["SLACK"] = 4] = "SLACK";
35
+ /**
36
+ * @generated from enum value: CHALLENGE_TYPE_GITHUB = 5;
37
+ */
38
+ ChallengeType[ChallengeType["GITHUB"] = 5] = "GITHUB";
39
+ /**
40
+ * @generated from enum value: CHALLENGE_TYPE_MAIL = 6;
41
+ */
42
+ ChallengeType[ChallengeType["MAIL"] = 6] = "MAIL";
43
+ })(ChallengeType || (ChallengeType = {}));
44
+ // Retrieve enum metadata with: proto3.getEnumType(ChallengeType)
45
+ proto3.util.setEnumType(ChallengeType, "uniswap.platformservice.v1.ChallengeType", [
46
+ { no: 0, name: "CHALLENGE_TYPE_UNSPECIFIED" },
47
+ { no: 1, name: "CHALLENGE_TYPE_TURNSTILE" },
48
+ { no: 2, name: "CHALLENGE_TYPE_HASHCASH" },
49
+ { no: 3, name: "CHALLENGE_TYPE_GOOGLE" },
50
+ { no: 4, name: "CHALLENGE_TYPE_SLACK" },
51
+ { no: 5, name: "CHALLENGE_TYPE_GITHUB" },
52
+ { no: 6, name: "CHALLENGE_TYPE_MAIL" },
31
53
  ]);
32
54
  /**
33
55
  * @generated from message uniswap.platformservice.v1.IntrospectSessionRequest
@@ -171,6 +193,60 @@ InitSessionResponse.fields = proto3.util.newFieldList(() => [
171
193
  { no: 3, name: "need_challenge", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
172
194
  { no: 4, name: "extra", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "scalar", T: 9 /* ScalarType.STRING */ } },
173
195
  ]);
196
+ /**
197
+ * @generated from message uniswap.platformservice.v1.GetChallengeTypesRequest
198
+ */
199
+ export class GetChallengeTypesRequest extends Message {
200
+ constructor(data) {
201
+ super();
202
+ proto3.util.initPartial(data, this);
203
+ }
204
+ static fromBinary(bytes, options) {
205
+ return new GetChallengeTypesRequest().fromBinary(bytes, options);
206
+ }
207
+ static fromJson(jsonValue, options) {
208
+ return new GetChallengeTypesRequest().fromJson(jsonValue, options);
209
+ }
210
+ static fromJsonString(jsonString, options) {
211
+ return new GetChallengeTypesRequest().fromJsonString(jsonString, options);
212
+ }
213
+ static equals(a, b) {
214
+ return proto3.util.equals(GetChallengeTypesRequest, a, b);
215
+ }
216
+ }
217
+ GetChallengeTypesRequest.runtime = proto3;
218
+ GetChallengeTypesRequest.typeName = "uniswap.platformservice.v1.GetChallengeTypesRequest";
219
+ GetChallengeTypesRequest.fields = proto3.util.newFieldList(() => []);
220
+ /**
221
+ * @generated from message uniswap.platformservice.v1.GetChallengeTypesResponse
222
+ */
223
+ export class GetChallengeTypesResponse extends Message {
224
+ constructor(data) {
225
+ super();
226
+ /**
227
+ * @generated from field: repeated uniswap.platformservice.v1.ChallengeType challenge_types = 1;
228
+ */
229
+ this.challengeTypes = [];
230
+ proto3.util.initPartial(data, this);
231
+ }
232
+ static fromBinary(bytes, options) {
233
+ return new GetChallengeTypesResponse().fromBinary(bytes, options);
234
+ }
235
+ static fromJson(jsonValue, options) {
236
+ return new GetChallengeTypesResponse().fromJson(jsonValue, options);
237
+ }
238
+ static fromJsonString(jsonString, options) {
239
+ return new GetChallengeTypesResponse().fromJsonString(jsonString, options);
240
+ }
241
+ static equals(a, b) {
242
+ return proto3.util.equals(GetChallengeTypesResponse, a, b);
243
+ }
244
+ }
245
+ GetChallengeTypesResponse.runtime = proto3;
246
+ GetChallengeTypesResponse.typeName = "uniswap.platformservice.v1.GetChallengeTypesResponse";
247
+ GetChallengeTypesResponse.fields = proto3.util.newFieldList(() => [
248
+ { no: 1, name: "challenge_types", kind: "enum", T: proto3.getEnumType(ChallengeType), repeated: true },
249
+ ]);
174
250
  /**
175
251
  * @generated from message uniswap.platformservice.v1.ChallengeRequest
176
252
  */
@@ -194,7 +270,11 @@ export class ChallengeRequest extends Message {
194
270
  }
195
271
  ChallengeRequest.runtime = proto3;
196
272
  ChallengeRequest.typeName = "uniswap.platformservice.v1.ChallengeRequest";
197
- ChallengeRequest.fields = proto3.util.newFieldList(() => []);
273
+ ChallengeRequest.fields = proto3.util.newFieldList(() => [
274
+ { no: 1, name: "challenge_type", kind: "enum", T: proto3.getEnumType(ChallengeType), opt: true },
275
+ { no: 2, name: "identifier", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
276
+ { no: 3, name: "redirect_url", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
277
+ ]);
198
278
  /**
199
279
  * @generated from message uniswap.platformservice.v1.ChallengeResponse
200
280
  */
@@ -206,13 +286,13 @@ export class ChallengeResponse extends Message {
206
286
  */
207
287
  this.challengeId = "";
208
288
  /**
209
- * the bot detection mechanism client should use
289
+ * The challenge type being enforced for
210
290
  *
211
- * @generated from field: uniswap.platformservice.v1.BotDetectionType bot_detection_type = 2;
291
+ * @generated from field: uniswap.platformservice.v1.ChallengeType challenge_type = 2;
212
292
  */
213
- this.botDetectionType = BotDetectionType.BOT_DETECTION_NONE;
293
+ this.challengeType = ChallengeType.UNSPECIFIED;
214
294
  /**
215
- * contains extra data for challenge data
295
+ * Extra data for challenge (e.g., hashcash difficulty, turnstile site key)
216
296
  *
217
297
  * @generated from field: map<string, string> extra = 3;
218
298
  */
@@ -236,8 +316,9 @@ ChallengeResponse.runtime = proto3;
236
316
  ChallengeResponse.typeName = "uniswap.platformservice.v1.ChallengeResponse";
237
317
  ChallengeResponse.fields = proto3.util.newFieldList(() => [
238
318
  { no: 1, name: "challenge_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
239
- { no: 2, name: "bot_detection_type", kind: "enum", T: proto3.getEnumType(BotDetectionType) },
319
+ { no: 2, name: "challenge_type", kind: "enum", T: proto3.getEnumType(ChallengeType) },
240
320
  { no: 3, name: "extra", kind: "map", K: 9 /* ScalarType.STRING */, V: { kind: "scalar", T: 9 /* ScalarType.STRING */ } },
321
+ { no: 4, name: "authorize_url", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
241
322
  ]);
242
323
  /**
243
324
  * @generated from message uniswap.platformservice.v1.VerifyRequest
@@ -246,15 +327,23 @@ export class VerifyRequest extends Message {
246
327
  constructor(data) {
247
328
  super();
248
329
  /**
249
- * e.g., bot detection token or hashcash solution
330
+ * Bot detection token, hashcash solution, or OTP code. Oauth code == solution.
250
331
  *
251
332
  * @generated from field: string solution = 1;
252
333
  */
253
334
  this.solution = "";
254
335
  /**
336
+ * Oauth state = challenge_id
337
+ *
255
338
  * @generated from field: string challenge_id = 2;
256
339
  */
257
340
  this.challengeId = "";
341
+ /**
342
+ * Challenge type (must match the one used in Challenge). If not set, server infers from challenge_id
343
+ *
344
+ * @generated from field: uniswap.platformservice.v1.ChallengeType type = 3;
345
+ */
346
+ this.type = ChallengeType.UNSPECIFIED;
258
347
  proto3.util.initPartial(data, this);
259
348
  }
260
349
  static fromBinary(bytes, options) {
@@ -275,6 +364,7 @@ VerifyRequest.typeName = "uniswap.platformservice.v1.VerifyRequest";
275
364
  VerifyRequest.fields = proto3.util.newFieldList(() => [
276
365
  { no: 1, name: "solution", kind: "scalar", T: 9 /* ScalarType.STRING */ },
277
366
  { no: 2, name: "challenge_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
367
+ { no: 3, name: "type", kind: "enum", T: proto3.getEnumType(ChallengeType) },
278
368
  ]);
279
369
  /**
280
370
  * @generated from message uniswap.platformservice.v1.VerifyResponse
@@ -305,6 +395,8 @@ VerifyResponse.runtime = proto3;
305
395
  VerifyResponse.typeName = "uniswap.platformservice.v1.VerifyResponse";
306
396
  VerifyResponse.fields = proto3.util.newFieldList(() => [
307
397
  { no: 1, name: "retry", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
398
+ { no: 2, name: "wait_seconds", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
399
+ { no: 3, name: "redirect_url", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
308
400
  ]);
309
401
  /**
310
402
  * @generated from message uniswap.platformservice.v1.DeleteSessionRequest
@@ -408,3 +500,51 @@ export class UpdateSessionResponse extends Message {
408
500
  UpdateSessionResponse.runtime = proto3;
409
501
  UpdateSessionResponse.typeName = "uniswap.platformservice.v1.UpdateSessionResponse";
410
502
  UpdateSessionResponse.fields = proto3.util.newFieldList(() => []);
503
+ /**
504
+ * @generated from message uniswap.platformservice.v1.SignoutRequest
505
+ */
506
+ export class SignoutRequest extends Message {
507
+ constructor(data) {
508
+ super();
509
+ proto3.util.initPartial(data, this);
510
+ }
511
+ static fromBinary(bytes, options) {
512
+ return new SignoutRequest().fromBinary(bytes, options);
513
+ }
514
+ static fromJson(jsonValue, options) {
515
+ return new SignoutRequest().fromJson(jsonValue, options);
516
+ }
517
+ static fromJsonString(jsonString, options) {
518
+ return new SignoutRequest().fromJsonString(jsonString, options);
519
+ }
520
+ static equals(a, b) {
521
+ return proto3.util.equals(SignoutRequest, a, b);
522
+ }
523
+ }
524
+ SignoutRequest.runtime = proto3;
525
+ SignoutRequest.typeName = "uniswap.platformservice.v1.SignoutRequest";
526
+ SignoutRequest.fields = proto3.util.newFieldList(() => []);
527
+ /**
528
+ * @generated from message uniswap.platformservice.v1.SignoutResponse
529
+ */
530
+ export class SignoutResponse extends Message {
531
+ constructor(data) {
532
+ super();
533
+ proto3.util.initPartial(data, this);
534
+ }
535
+ static fromBinary(bytes, options) {
536
+ return new SignoutResponse().fromBinary(bytes, options);
537
+ }
538
+ static fromJson(jsonValue, options) {
539
+ return new SignoutResponse().fromJson(jsonValue, options);
540
+ }
541
+ static fromJsonString(jsonString, options) {
542
+ return new SignoutResponse().fromJsonString(jsonString, options);
543
+ }
544
+ static equals(a, b) {
545
+ return proto3.util.equals(SignoutResponse, a, b);
546
+ }
547
+ }
548
+ SignoutResponse.runtime = proto3;
549
+ SignoutResponse.typeName = "uniswap.platformservice.v1.SignoutResponse";
550
+ SignoutResponse.fields = proto3.util.newFieldList(() => []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniswap/client-platform-service",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },