@newgameplusinc/odyssey-sso 1.0.2 → 2.0.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/config.d.ts +27 -0
- package/dist/config.js +31 -0
- package/dist/{lib/database.d.ts → database.d.ts} +1 -1
- package/dist/{lib/database.js → database.js} +4 -2
- package/dist/main.d.ts +249 -0
- package/dist/main.js +948 -0
- package/dist/types.d.ts +466 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/package.json +7 -10
- package/README.md +0 -3
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -7
- package/dist/index.d.ts +0 -27
- package/dist/index.js +0 -158
- package/dist/lib/axios.d.ts +0 -6
- package/dist/lib/axios.js +0 -20
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
export interface DBRes {
|
|
2
|
+
id: string;
|
|
3
|
+
firstName: string;
|
|
4
|
+
lastName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
photoURL: string | null;
|
|
7
|
+
pending: boolean;
|
|
8
|
+
anonymous: boolean;
|
|
9
|
+
bodyHeight: string | null;
|
|
10
|
+
bodyShape: string | null;
|
|
11
|
+
clothingIdBottom: string | null;
|
|
12
|
+
clothingIdShoes: string | null;
|
|
13
|
+
clothingIdTop: string | null;
|
|
14
|
+
clothingIdMaterial: string | null;
|
|
15
|
+
skullId: string | null;
|
|
16
|
+
additionalInfo: Record<string, unknown> | null;
|
|
17
|
+
skull: string | null;
|
|
18
|
+
clothingTop: string | null;
|
|
19
|
+
clothingBottom: string | null;
|
|
20
|
+
clothingShoes: string | null;
|
|
21
|
+
clothingMaterial: string | null;
|
|
22
|
+
deviceId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
tokens: {
|
|
25
|
+
accessToken: string;
|
|
26
|
+
refreshToken: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface Config {
|
|
30
|
+
sdkKey: string;
|
|
31
|
+
debug?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ProfileRes {
|
|
34
|
+
statusCode: number;
|
|
35
|
+
success: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
data: {
|
|
38
|
+
id: string;
|
|
39
|
+
firstName: string;
|
|
40
|
+
lastName: string;
|
|
41
|
+
email: string;
|
|
42
|
+
photoURL: null;
|
|
43
|
+
pending: boolean;
|
|
44
|
+
anonymous: boolean;
|
|
45
|
+
bodyHeight: null;
|
|
46
|
+
bodyShape: null;
|
|
47
|
+
clothingIdBottom: null;
|
|
48
|
+
clothingIdShoes: null;
|
|
49
|
+
clothingIdTop: null;
|
|
50
|
+
clothingIdMaterial: null;
|
|
51
|
+
skullId: null;
|
|
52
|
+
additionalInfo: null;
|
|
53
|
+
skull: null;
|
|
54
|
+
clothingTop: null;
|
|
55
|
+
clothingBottom: null;
|
|
56
|
+
clothingShoes: null;
|
|
57
|
+
clothingMaterial: null;
|
|
58
|
+
deviceId: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export type Profile = ProfileRes["data"];
|
|
62
|
+
export interface RefTokenRes {
|
|
63
|
+
statusCode: number;
|
|
64
|
+
success: boolean;
|
|
65
|
+
message: string;
|
|
66
|
+
data: {
|
|
67
|
+
accessToken: string;
|
|
68
|
+
refreshToken: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
interface ActionLogin {
|
|
72
|
+
type: "login";
|
|
73
|
+
payload: Profile;
|
|
74
|
+
}
|
|
75
|
+
interface ActionLogout {
|
|
76
|
+
type: "logout";
|
|
77
|
+
payload: null;
|
|
78
|
+
}
|
|
79
|
+
interface ActionRefresh {
|
|
80
|
+
type: "refresh";
|
|
81
|
+
payload: null;
|
|
82
|
+
}
|
|
83
|
+
interface ActionProfileFetch {
|
|
84
|
+
type: "profile.fetch";
|
|
85
|
+
payload: Profile;
|
|
86
|
+
}
|
|
87
|
+
interface ActionProfileUpdate {
|
|
88
|
+
type: "profile.update";
|
|
89
|
+
payload: Profile;
|
|
90
|
+
}
|
|
91
|
+
interface ActionProfilePhotoUpdate {
|
|
92
|
+
type: "profile-photo.update";
|
|
93
|
+
payload: UpdateProfilePictureResponse["data"];
|
|
94
|
+
}
|
|
95
|
+
interface ActionAddClothUpdate {
|
|
96
|
+
type: "cloth.add";
|
|
97
|
+
payload: AddClothRes["data"];
|
|
98
|
+
}
|
|
99
|
+
interface ActionFetchAllCloths {
|
|
100
|
+
type: "cloth.fetch-all";
|
|
101
|
+
payload: GetClothsRes["data"];
|
|
102
|
+
}
|
|
103
|
+
interface ActionFetchCloth {
|
|
104
|
+
type: "cloth.fetch";
|
|
105
|
+
payload: GetClothByIdRes["data"];
|
|
106
|
+
}
|
|
107
|
+
interface ActionUpdateCloth {
|
|
108
|
+
type: "cloth.update";
|
|
109
|
+
payload: UpdateClothRes["data"];
|
|
110
|
+
}
|
|
111
|
+
interface ActionClothDelete {
|
|
112
|
+
type: "cloth.delete";
|
|
113
|
+
payload: {
|
|
114
|
+
id: string;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface ActionAddMaterial {
|
|
118
|
+
type: "material.add";
|
|
119
|
+
payload: AddMaterialRes["data"];
|
|
120
|
+
}
|
|
121
|
+
interface ActionGetMaterials {
|
|
122
|
+
type: "material.fetch-all";
|
|
123
|
+
payload: GetMaterialsRes["data"];
|
|
124
|
+
}
|
|
125
|
+
interface ActionGetMaterial {
|
|
126
|
+
type: "material.fetch";
|
|
127
|
+
payload: GetMaterialRes["data"];
|
|
128
|
+
}
|
|
129
|
+
interface ActionUpdateMaterial {
|
|
130
|
+
type: "material.update";
|
|
131
|
+
payload: UpdateMaterialRes["data"];
|
|
132
|
+
}
|
|
133
|
+
interface ActionDeleteMaterial {
|
|
134
|
+
type: "material.delete";
|
|
135
|
+
payload: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
interface ActionAddSkull {
|
|
140
|
+
type: "skull.add";
|
|
141
|
+
payload: AddSkullRes["data"];
|
|
142
|
+
}
|
|
143
|
+
interface ActionUpdateSkull {
|
|
144
|
+
type: "skull.update";
|
|
145
|
+
payload: UpdateSkullRes["data"];
|
|
146
|
+
}
|
|
147
|
+
interface ActionGetAllSkulls {
|
|
148
|
+
type: "skull.fetch-all";
|
|
149
|
+
payload: GetAllSkullsRes["data"];
|
|
150
|
+
}
|
|
151
|
+
interface ActionGetSkull {
|
|
152
|
+
type: "skull.fetch";
|
|
153
|
+
payload: GetSkullRes["data"];
|
|
154
|
+
}
|
|
155
|
+
interface ActionDeleteSkull {
|
|
156
|
+
type: "skull.delete";
|
|
157
|
+
payload: {
|
|
158
|
+
id: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export type Actions = ActionLogin | ActionLogout | ActionRefresh | ActionProfileFetch | ActionProfileUpdate | ActionProfilePhotoUpdate | ActionAddClothUpdate | ActionFetchAllCloths | ActionFetchCloth | ActionUpdateCloth | ActionClothDelete | ActionAddMaterial | ActionGetMaterials | ActionGetMaterial | ActionUpdateMaterial | ActionDeleteMaterial | ActionAddSkull | ActionUpdateSkull | ActionGetAllSkulls | ActionGetSkull | ActionDeleteSkull;
|
|
162
|
+
export type Cb = (action: Actions) => void;
|
|
163
|
+
export interface UpdateProfilePayload {
|
|
164
|
+
firstName?: string;
|
|
165
|
+
lastName?: string;
|
|
166
|
+
bodyHeight?: string;
|
|
167
|
+
bodyShape?: string;
|
|
168
|
+
clothingIdBottom?: string;
|
|
169
|
+
clothingIdShoes?: string;
|
|
170
|
+
clothingIdTop?: string;
|
|
171
|
+
clothingIdMaterial?: string;
|
|
172
|
+
anonymous?: boolean;
|
|
173
|
+
skullId?: string;
|
|
174
|
+
additionalInfo?: Record<string, unknown>;
|
|
175
|
+
}
|
|
176
|
+
export interface UpdateProfilePicturePayload {
|
|
177
|
+
photoURL: string;
|
|
178
|
+
}
|
|
179
|
+
export interface UpdateProfilePictureResponse {
|
|
180
|
+
statusCode: number;
|
|
181
|
+
success: boolean;
|
|
182
|
+
message: string;
|
|
183
|
+
data: {
|
|
184
|
+
id: string;
|
|
185
|
+
firstName: string;
|
|
186
|
+
lastName: string;
|
|
187
|
+
email: string;
|
|
188
|
+
photoURL: string;
|
|
189
|
+
pending: boolean;
|
|
190
|
+
anonymous: boolean;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
export interface AddClothPayload {
|
|
194
|
+
name: string;
|
|
195
|
+
bodyDefinition: "MALE" | "FEMALE";
|
|
196
|
+
description: string;
|
|
197
|
+
public: boolean;
|
|
198
|
+
thumb: string;
|
|
199
|
+
type: string;
|
|
200
|
+
}
|
|
201
|
+
export interface AddClothFilePayload {
|
|
202
|
+
name: string;
|
|
203
|
+
bodyDefinition: "MALE" | "FEMALE";
|
|
204
|
+
description: string;
|
|
205
|
+
public: boolean;
|
|
206
|
+
thumb: File;
|
|
207
|
+
type: string;
|
|
208
|
+
}
|
|
209
|
+
export interface AddClothRes {
|
|
210
|
+
statusCode: number;
|
|
211
|
+
success: boolean;
|
|
212
|
+
message: string;
|
|
213
|
+
data: {
|
|
214
|
+
id: string;
|
|
215
|
+
ownerId: string;
|
|
216
|
+
sdkKeyId: null;
|
|
217
|
+
name: string;
|
|
218
|
+
bodyDefinition: string;
|
|
219
|
+
description: string;
|
|
220
|
+
public: boolean;
|
|
221
|
+
thumb: string;
|
|
222
|
+
type: string;
|
|
223
|
+
updatedAt: Date;
|
|
224
|
+
createdAt: Date;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
export interface GetClothsOptions {
|
|
228
|
+
skip: number;
|
|
229
|
+
limit: number;
|
|
230
|
+
sort: "asc" | "desc";
|
|
231
|
+
}
|
|
232
|
+
export interface GetClothsRes {
|
|
233
|
+
statusCode: number;
|
|
234
|
+
success: boolean;
|
|
235
|
+
message: string;
|
|
236
|
+
data: {
|
|
237
|
+
id: string;
|
|
238
|
+
ownerId: string;
|
|
239
|
+
sdkKeyId: null;
|
|
240
|
+
name: string;
|
|
241
|
+
bodyDefinition: string;
|
|
242
|
+
description: string;
|
|
243
|
+
public: boolean;
|
|
244
|
+
thumb: string;
|
|
245
|
+
type: string;
|
|
246
|
+
updatedAt: Date;
|
|
247
|
+
createdAt: Date;
|
|
248
|
+
}[];
|
|
249
|
+
}
|
|
250
|
+
export interface GetClothByIdRes {
|
|
251
|
+
statusCode: number;
|
|
252
|
+
success: boolean;
|
|
253
|
+
message: string;
|
|
254
|
+
data: {
|
|
255
|
+
id: string;
|
|
256
|
+
ownerId: string;
|
|
257
|
+
sdkKeyId: null;
|
|
258
|
+
name: string;
|
|
259
|
+
bodyDefinition: string;
|
|
260
|
+
description: string;
|
|
261
|
+
public: boolean;
|
|
262
|
+
thumb: string;
|
|
263
|
+
type: string;
|
|
264
|
+
updatedAt: Date;
|
|
265
|
+
createdAt: Date;
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
export interface UpdateClothPayload {
|
|
269
|
+
name?: string;
|
|
270
|
+
bodyDefinition?: "MALE" | "FEMALE";
|
|
271
|
+
description?: string;
|
|
272
|
+
public?: boolean;
|
|
273
|
+
type?: string;
|
|
274
|
+
}
|
|
275
|
+
export interface UpdateClothRes {
|
|
276
|
+
statusCode: number;
|
|
277
|
+
success: boolean;
|
|
278
|
+
message: string;
|
|
279
|
+
data: {
|
|
280
|
+
id: string;
|
|
281
|
+
ownerId: string;
|
|
282
|
+
sdkKeyId: null;
|
|
283
|
+
name: string;
|
|
284
|
+
bodyDefinition: string;
|
|
285
|
+
description: string;
|
|
286
|
+
public: boolean;
|
|
287
|
+
thumb: string;
|
|
288
|
+
type: string;
|
|
289
|
+
updatedAt: Date;
|
|
290
|
+
createdAt: Date;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
export interface AddMaterialPayload {
|
|
294
|
+
name: string;
|
|
295
|
+
description: string;
|
|
296
|
+
public: boolean;
|
|
297
|
+
thumb: string;
|
|
298
|
+
type: string;
|
|
299
|
+
}
|
|
300
|
+
export interface AddMaterialFilePayload {
|
|
301
|
+
name: string;
|
|
302
|
+
description: string;
|
|
303
|
+
public: boolean;
|
|
304
|
+
thumb: File;
|
|
305
|
+
type: string;
|
|
306
|
+
}
|
|
307
|
+
export interface AddMaterialRes {
|
|
308
|
+
statusCode: number;
|
|
309
|
+
success: boolean;
|
|
310
|
+
message: string;
|
|
311
|
+
data: {
|
|
312
|
+
id: string;
|
|
313
|
+
ownerId: string;
|
|
314
|
+
sdkKeyId: null;
|
|
315
|
+
name: string;
|
|
316
|
+
description: string;
|
|
317
|
+
public: boolean;
|
|
318
|
+
thumb: string;
|
|
319
|
+
type: string;
|
|
320
|
+
updatedAt: Date;
|
|
321
|
+
createdAt: Date;
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
export interface GetMaterialsOptions {
|
|
325
|
+
skip: number;
|
|
326
|
+
limit: number;
|
|
327
|
+
sort: "asc" | "desc";
|
|
328
|
+
}
|
|
329
|
+
export interface GetMaterialsRes {
|
|
330
|
+
statusCode: number;
|
|
331
|
+
success: boolean;
|
|
332
|
+
message: string;
|
|
333
|
+
data: {
|
|
334
|
+
id: string;
|
|
335
|
+
ownerId: string;
|
|
336
|
+
sdkKeyId: null;
|
|
337
|
+
name: string;
|
|
338
|
+
description: string;
|
|
339
|
+
public: boolean;
|
|
340
|
+
thumb: string;
|
|
341
|
+
type: string;
|
|
342
|
+
updatedAt: Date;
|
|
343
|
+
createdAt: Date;
|
|
344
|
+
}[];
|
|
345
|
+
}
|
|
346
|
+
export interface GetMaterialRes {
|
|
347
|
+
statusCode: number;
|
|
348
|
+
success: boolean;
|
|
349
|
+
message: string;
|
|
350
|
+
data: {
|
|
351
|
+
id: string;
|
|
352
|
+
ownerId: string;
|
|
353
|
+
sdkKeyId: null;
|
|
354
|
+
name: string;
|
|
355
|
+
description: string;
|
|
356
|
+
public: boolean;
|
|
357
|
+
thumb: string;
|
|
358
|
+
type: string;
|
|
359
|
+
updatedAt: Date;
|
|
360
|
+
createdAt: Date;
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
export interface UpdateMaterialPayload {
|
|
364
|
+
name?: string;
|
|
365
|
+
description?: string;
|
|
366
|
+
public?: boolean;
|
|
367
|
+
type?: string;
|
|
368
|
+
}
|
|
369
|
+
export interface UpdateMaterialRes {
|
|
370
|
+
statusCode: number;
|
|
371
|
+
success: boolean;
|
|
372
|
+
message: string;
|
|
373
|
+
data: {
|
|
374
|
+
id: string;
|
|
375
|
+
ownerId: string;
|
|
376
|
+
sdkKeyId: null;
|
|
377
|
+
name: string;
|
|
378
|
+
description: string;
|
|
379
|
+
public: boolean;
|
|
380
|
+
thumb: string;
|
|
381
|
+
type: string;
|
|
382
|
+
updatedAt: Date;
|
|
383
|
+
createdAt: Date;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
export interface AddSkullPayload {
|
|
387
|
+
name: string;
|
|
388
|
+
previewUrl: string;
|
|
389
|
+
url3d: string;
|
|
390
|
+
public?: boolean;
|
|
391
|
+
}
|
|
392
|
+
export interface AddSkullFilePayload {
|
|
393
|
+
name: string;
|
|
394
|
+
filePreview: File;
|
|
395
|
+
file3d: File;
|
|
396
|
+
public?: boolean;
|
|
397
|
+
}
|
|
398
|
+
export interface AddSkullRes {
|
|
399
|
+
statusCode: number;
|
|
400
|
+
success: boolean;
|
|
401
|
+
message: string;
|
|
402
|
+
data: {
|
|
403
|
+
id: string;
|
|
404
|
+
ownerId: string;
|
|
405
|
+
sdkKeyId: null;
|
|
406
|
+
name: string;
|
|
407
|
+
previewUrl: string;
|
|
408
|
+
url3d: string;
|
|
409
|
+
public: boolean;
|
|
410
|
+
updatedAt: Date;
|
|
411
|
+
createdAt: Date;
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
export interface UpdateSkullPayload {
|
|
415
|
+
name?: string;
|
|
416
|
+
public?: boolean;
|
|
417
|
+
}
|
|
418
|
+
export interface UpdateSkullRes {
|
|
419
|
+
statusCode: number;
|
|
420
|
+
success: boolean;
|
|
421
|
+
message: string;
|
|
422
|
+
data: {
|
|
423
|
+
id: string;
|
|
424
|
+
ownerId: string;
|
|
425
|
+
sdkKeyId: null;
|
|
426
|
+
name: string;
|
|
427
|
+
previewUrl: string;
|
|
428
|
+
url3d: string;
|
|
429
|
+
public: boolean;
|
|
430
|
+
updatedAt: Date;
|
|
431
|
+
createdAt: Date;
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
export interface GetAllSkullsRes {
|
|
435
|
+
statusCode: number;
|
|
436
|
+
success: boolean;
|
|
437
|
+
message: string;
|
|
438
|
+
data: {
|
|
439
|
+
id: string;
|
|
440
|
+
ownerId: string;
|
|
441
|
+
sdkKeyId: null;
|
|
442
|
+
name: string;
|
|
443
|
+
previewUrl: string;
|
|
444
|
+
url3d: string;
|
|
445
|
+
public: boolean;
|
|
446
|
+
updatedAt: Date;
|
|
447
|
+
createdAt: Date;
|
|
448
|
+
}[];
|
|
449
|
+
}
|
|
450
|
+
export interface GetSkullRes {
|
|
451
|
+
statusCode: number;
|
|
452
|
+
success: boolean;
|
|
453
|
+
message: string;
|
|
454
|
+
data: {
|
|
455
|
+
id: string;
|
|
456
|
+
ownerId: string;
|
|
457
|
+
sdkKeyId: null;
|
|
458
|
+
name: string;
|
|
459
|
+
previewUrl: string;
|
|
460
|
+
url3d: string;
|
|
461
|
+
public: boolean;
|
|
462
|
+
updatedAt: Date;
|
|
463
|
+
createdAt: Date;
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
export {};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isBrowser: () => boolean;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isBrowser = () => typeof window !== "undefined";
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newgameplusinc/odyssey-sso",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "SDK for SSO Service.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/
|
|
7
|
-
"module": "./dist/
|
|
8
|
-
"types": "./dist/
|
|
6
|
+
"main": "./dist/main.js",
|
|
7
|
+
"module": "./dist/main.js",
|
|
8
|
+
"types": "./dist/main.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./dist/
|
|
12
|
-
"import": "./dist/
|
|
11
|
+
"types": "./dist/main.d.ts",
|
|
12
|
+
"import": "./dist/main.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
@@ -23,9 +23,6 @@
|
|
|
23
23
|
"pack": "npm run build && npm pack"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"typescript": "^5
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"axios": "^1.13.5"
|
|
26
|
+
"typescript": "^5"
|
|
30
27
|
}
|
|
31
28
|
}
|
package/README.md
DELETED
package/dist/config/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const SDK_NAME = "@newgameplusinc/odyssey-sso";
|
|
2
|
-
export declare const SDK_VERSION = "0.1.0";
|
|
3
|
-
export declare const SSO_SERVER_URL = "https://api-gateway.tenant-newgameproduction-ctrlpln.ord1.ingress.coreweave.cloud/sso";
|
|
4
|
-
export declare const SSO_CLIENT_URL = "https://odyssey-sso-client.vercel.app";
|
|
5
|
-
export declare const DB_NAME = "odyssey";
|
|
6
|
-
export declare const DB_VERSION = 1;
|
|
7
|
-
export declare const STORE_NAME = "users";
|
package/dist/config/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const SDK_NAME = "@newgameplusinc/odyssey-sso";
|
|
2
|
-
export const SDK_VERSION = "0.1.0";
|
|
3
|
-
export const SSO_SERVER_URL = "https://api-gateway.tenant-newgameproduction-ctrlpln.ord1.ingress.coreweave.cloud/sso";
|
|
4
|
-
export const SSO_CLIENT_URL = "https://odyssey-sso-client.vercel.app";
|
|
5
|
-
export const DB_NAME = "odyssey";
|
|
6
|
-
export const DB_VERSION = 1;
|
|
7
|
-
export const STORE_NAME = "users";
|
package/dist/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Axios from "./lib/axios";
|
|
2
|
-
export default class OdysseySSO extends Axios {
|
|
3
|
-
private readonly isBrowser;
|
|
4
|
-
private debug;
|
|
5
|
-
private clientId;
|
|
6
|
-
private apiKey;
|
|
7
|
-
private db;
|
|
8
|
-
constructor({ apiKey, clientId, debug, }: {
|
|
9
|
-
apiKey: string;
|
|
10
|
-
clientId: string;
|
|
11
|
-
debug?: boolean;
|
|
12
|
-
});
|
|
13
|
-
readonly triggerSignIn: (callbackUrl: string) => Promise<void>;
|
|
14
|
-
private readonly exchangeCall;
|
|
15
|
-
/**
|
|
16
|
-
* @param code - the token you got from the callback
|
|
17
|
-
* @param clientSecret - keep it empty for client side exchange, for better security use clientSecret from your server
|
|
18
|
-
*/
|
|
19
|
-
readonly exchangeCode: (redirectPath?: string) => Promise<{
|
|
20
|
-
readonly isSuccess: false;
|
|
21
|
-
readonly data: null;
|
|
22
|
-
} | undefined>;
|
|
23
|
-
readonly getProfileData: () => Promise<Record<string, any> | null>;
|
|
24
|
-
readonly logout: () => Promise<void>;
|
|
25
|
-
readonly refreshToken: () => Promise<void>;
|
|
26
|
-
readonly updateAvatar: (avatar: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
27
|
-
}
|