@inflector/aura 0.4.5 → 0.5.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/auth.d.ts CHANGED
@@ -1208,5 +1208,279 @@ export declare const AuraAuth: (url: string, workspace: string) => {
1208
1208
  message?: string | undefined;
1209
1209
  }, FetchOptions["throw"] extends true ? true : false>>;
1210
1210
  };
1211
+ RequestOauthScope: {
1212
+ Google: (scopes: string[]) => Promise<{
1213
+ data: {
1214
+ url: string;
1215
+ redirect: boolean;
1216
+ };
1217
+ error: null;
1218
+ } | {
1219
+ data: null;
1220
+ error: {
1221
+ code?: string | undefined | undefined;
1222
+ message?: string | undefined | undefined;
1223
+ status: number;
1224
+ statusText: string;
1225
+ };
1226
+ }>;
1227
+ Apple: (scopes: string[]) => Promise<{
1228
+ data: {
1229
+ url: string;
1230
+ redirect: boolean;
1231
+ };
1232
+ error: null;
1233
+ } | {
1234
+ data: null;
1235
+ error: {
1236
+ code?: string | undefined | undefined;
1237
+ message?: string | undefined | undefined;
1238
+ status: number;
1239
+ statusText: string;
1240
+ };
1241
+ }>;
1242
+ Discord: (scopes: string[]) => Promise<{
1243
+ data: {
1244
+ url: string;
1245
+ redirect: boolean;
1246
+ };
1247
+ error: null;
1248
+ } | {
1249
+ data: null;
1250
+ error: {
1251
+ code?: string | undefined | undefined;
1252
+ message?: string | undefined | undefined;
1253
+ status: number;
1254
+ statusText: string;
1255
+ };
1256
+ }>;
1257
+ Facebook: (scopes: string[]) => Promise<{
1258
+ data: {
1259
+ url: string;
1260
+ redirect: boolean;
1261
+ };
1262
+ error: null;
1263
+ } | {
1264
+ data: null;
1265
+ error: {
1266
+ code?: string | undefined | undefined;
1267
+ message?: string | undefined | undefined;
1268
+ status: number;
1269
+ statusText: string;
1270
+ };
1271
+ }>;
1272
+ Github: (scopes: string[]) => Promise<{
1273
+ data: {
1274
+ url: string;
1275
+ redirect: boolean;
1276
+ };
1277
+ error: null;
1278
+ } | {
1279
+ data: null;
1280
+ error: {
1281
+ code?: string | undefined | undefined;
1282
+ message?: string | undefined | undefined;
1283
+ status: number;
1284
+ statusText: string;
1285
+ };
1286
+ }>;
1287
+ Gitlab: (scopes: string[]) => Promise<{
1288
+ data: {
1289
+ url: string;
1290
+ redirect: boolean;
1291
+ };
1292
+ error: null;
1293
+ } | {
1294
+ data: null;
1295
+ error: {
1296
+ code?: string | undefined | undefined;
1297
+ message?: string | undefined | undefined;
1298
+ status: number;
1299
+ statusText: string;
1300
+ };
1301
+ }>;
1302
+ HuggingFace: (scopes: string[]) => Promise<{
1303
+ data: {
1304
+ url: string;
1305
+ redirect: boolean;
1306
+ };
1307
+ error: null;
1308
+ } | {
1309
+ data: null;
1310
+ error: {
1311
+ code?: string | undefined | undefined;
1312
+ message?: string | undefined | undefined;
1313
+ status: number;
1314
+ statusText: string;
1315
+ };
1316
+ }>;
1317
+ Linkedin: (scopes: string[]) => Promise<{
1318
+ data: {
1319
+ url: string;
1320
+ redirect: boolean;
1321
+ };
1322
+ error: null;
1323
+ } | {
1324
+ data: null;
1325
+ error: {
1326
+ code?: string | undefined | undefined;
1327
+ message?: string | undefined | undefined;
1328
+ status: number;
1329
+ statusText: string;
1330
+ };
1331
+ }>;
1332
+ Microsoft: (scopes: string[]) => Promise<{
1333
+ data: {
1334
+ url: string;
1335
+ redirect: boolean;
1336
+ };
1337
+ error: null;
1338
+ } | {
1339
+ data: null;
1340
+ error: {
1341
+ code?: string | undefined | undefined;
1342
+ message?: string | undefined | undefined;
1343
+ status: number;
1344
+ statusText: string;
1345
+ };
1346
+ }>;
1347
+ Reddit: (scopes: string[]) => Promise<{
1348
+ data: {
1349
+ url: string;
1350
+ redirect: boolean;
1351
+ };
1352
+ error: null;
1353
+ } | {
1354
+ data: null;
1355
+ error: {
1356
+ code?: string | undefined | undefined;
1357
+ message?: string | undefined | undefined;
1358
+ status: number;
1359
+ statusText: string;
1360
+ };
1361
+ }>;
1362
+ Polar: (scopes: string[]) => Promise<{
1363
+ data: {
1364
+ url: string;
1365
+ redirect: boolean;
1366
+ };
1367
+ error: null;
1368
+ } | {
1369
+ data: null;
1370
+ error: {
1371
+ code?: string | undefined | undefined;
1372
+ message?: string | undefined | undefined;
1373
+ status: number;
1374
+ statusText: string;
1375
+ };
1376
+ }>;
1377
+ Spotify: (scopes: string[]) => Promise<{
1378
+ data: {
1379
+ url: string;
1380
+ redirect: boolean;
1381
+ };
1382
+ error: null;
1383
+ } | {
1384
+ data: null;
1385
+ error: {
1386
+ code?: string | undefined | undefined;
1387
+ message?: string | undefined | undefined;
1388
+ status: number;
1389
+ statusText: string;
1390
+ };
1391
+ }>;
1392
+ Tiktok: (scopes: string[]) => Promise<{
1393
+ data: {
1394
+ url: string;
1395
+ redirect: boolean;
1396
+ };
1397
+ error: null;
1398
+ } | {
1399
+ data: null;
1400
+ error: {
1401
+ code?: string | undefined | undefined;
1402
+ message?: string | undefined | undefined;
1403
+ status: number;
1404
+ statusText: string;
1405
+ };
1406
+ }>;
1407
+ Twitch: (scopes: string[]) => Promise<{
1408
+ data: {
1409
+ url: string;
1410
+ redirect: boolean;
1411
+ };
1412
+ error: null;
1413
+ } | {
1414
+ data: null;
1415
+ error: {
1416
+ code?: string | undefined | undefined;
1417
+ message?: string | undefined | undefined;
1418
+ status: number;
1419
+ statusText: string;
1420
+ };
1421
+ }>;
1422
+ X: (scopes: string[]) => Promise<{
1423
+ data: {
1424
+ url: string;
1425
+ redirect: boolean;
1426
+ };
1427
+ error: null;
1428
+ } | {
1429
+ data: null;
1430
+ error: {
1431
+ code?: string | undefined | undefined;
1432
+ message?: string | undefined | undefined;
1433
+ status: number;
1434
+ statusText: string;
1435
+ };
1436
+ }>;
1437
+ VK: (scopes: string[]) => Promise<{
1438
+ data: {
1439
+ url: string;
1440
+ redirect: boolean;
1441
+ };
1442
+ error: null;
1443
+ } | {
1444
+ data: null;
1445
+ error: {
1446
+ code?: string | undefined | undefined;
1447
+ message?: string | undefined | undefined;
1448
+ status: number;
1449
+ statusText: string;
1450
+ };
1451
+ }>;
1452
+ Zoom: (scopes: string[]) => Promise<{
1453
+ data: {
1454
+ url: string;
1455
+ redirect: boolean;
1456
+ };
1457
+ error: null;
1458
+ } | {
1459
+ data: null;
1460
+ error: {
1461
+ code?: string | undefined | undefined;
1462
+ message?: string | undefined | undefined;
1463
+ status: number;
1464
+ statusText: string;
1465
+ };
1466
+ }>;
1467
+ };
1468
+ GetAccessToken: (provider: string) => Promise<{
1469
+ data: {
1470
+ accessToken: string;
1471
+ accessTokenExpiresAt: Date | undefined;
1472
+ scopes: string[];
1473
+ idToken: string | undefined;
1474
+ };
1475
+ error: null;
1476
+ } | {
1477
+ data: null;
1478
+ error: {
1479
+ code?: string | undefined | undefined;
1480
+ message?: string | undefined | undefined;
1481
+ status: number;
1482
+ statusText: string;
1483
+ };
1484
+ }>;
1211
1485
  };
1212
1486
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAmG3B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;yBAQxB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA5F9C,GAAG;eACF,GAAG;mBACC,OAAO;sBACJ,OAAO;iBACZ,MAAM,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;qBAoB5B,CADiD;;;;;;;;;;;;;;;;;yBAoJ5B,MAAM,EAAE;;;;;;;;;;;;;;;wBACT,MAAM,EAAE;;;;;;;;;;;;;;;0BACN,MAAM,EAAE;;;;;;;;;;;;;;;2BACP,MAAM,EAAE;;;;;;;;;;;;;;;yBACV,MAAM,EAAE;;;;;;;;;;;;;;;yBACR,MAAM,EAAE;;;;;;;;;;;;;;;8BACH,MAAM,EAAE;;;;;;;;;;;;;;;2BACX,MAAM,EAAE;;;;;;;;;;;;;;;4BACP,MAAM,EAAE;;;;;;;;;;;;;;;yBACX,MAAM,EAAE;;;;;;;;;;;;;;;wBACT,MAAM,EAAE;;;;;;;;;;;;;;;0BACN,MAAM,EAAE;;;;;;;;;;;;;;;yBACT,MAAM,EAAE;;;;;;;;;;;;;;;yBACR,MAAM,EAAE;;;;;;;;;;;;;;;oBACb,MAAM,EAAE;;;;;;;;;;;;;;;qBACP,MAAM,EAAE;;;;;;;;;;;;;;;uBACN,MAAM,EAAE;;;;;;;;;;;;;;;;+BAIA,MAAM;;;;;;;;;;;;;;;;;CAGpC,CAAC"}
package/dist/auth.js CHANGED
@@ -146,5 +146,32 @@ export const AuraAuth = (url, workspace) => {
146
146
  SignUp: authClient.signIn.anonymous,
147
147
  Delete: authClient.deleteAnonymousUser,
148
148
  },
149
+ RequestOauthScope: (() => {
150
+ const withScope = (provider, scopes) => authClient.linkSocial({
151
+ provider,
152
+ scopes,
153
+ callbackURL: window.location.href,
154
+ });
155
+ return {
156
+ Google: (scopes) => withScope("google", scopes),
157
+ Apple: (scopes) => withScope("apple", scopes),
158
+ Discord: (scopes) => withScope("discord", scopes),
159
+ Facebook: (scopes) => withScope("facebook", scopes),
160
+ Github: (scopes) => withScope("github", scopes),
161
+ Gitlab: (scopes) => withScope("gitlab", scopes),
162
+ HuggingFace: (scopes) => withScope("hf", scopes),
163
+ Linkedin: (scopes) => withScope("linkedin", scopes),
164
+ Microsoft: (scopes) => withScope("microsoft", scopes),
165
+ Reddit: (scopes) => withScope("reddit", scopes),
166
+ Polar: (scopes) => withScope("polar", scopes),
167
+ Spotify: (scopes) => withScope("spotify", scopes),
168
+ Tiktok: (scopes) => withScope("tiktok", scopes),
169
+ Twitch: (scopes) => withScope("twitch", scopes),
170
+ X: (scopes) => withScope("x", scopes),
171
+ VK: (scopes) => withScope("vk", scopes),
172
+ Zoom: (scopes) => withScope("zoom", scopes),
173
+ };
174
+ })(),
175
+ GetAccessToken: (provider) => authClient.getAccessToken({ providerId: provider }),
149
176
  };
150
177
  };