@faable/auth-sdk 1.1.3 → 1.3.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.
@@ -40,7 +40,7 @@ export declare class FaableAuthApi extends FaableApi {
40
40
  phone_verified: boolean;
41
41
  country_iso?: string | null | undefined;
42
42
  birth_date?: string | null | undefined;
43
- locale: string;
43
+ locale?: string | undefined;
44
44
  region?: string | null | undefined;
45
45
  picture?: string | null | undefined;
46
46
  logins_count: number;
@@ -71,7 +71,7 @@ export declare class FaableAuthApi extends FaableApi {
71
71
  phone_verified: boolean;
72
72
  country_iso?: string | null | undefined;
73
73
  birth_date?: string | null | undefined;
74
- locale: string;
74
+ locale?: string | undefined;
75
75
  region?: string | null | undefined;
76
76
  picture?: string | null | undefined;
77
77
  logins_count: number;
@@ -105,7 +105,7 @@ export declare class FaableAuthApi extends FaableApi {
105
105
  phone_verified: boolean;
106
106
  country_iso?: string | null | undefined;
107
107
  birth_date?: string | null | undefined;
108
- locale: string;
108
+ locale?: string | undefined;
109
109
  region?: string | null | undefined;
110
110
  picture?: string | null | undefined;
111
111
  logins_count: number;
@@ -137,7 +137,7 @@ export declare class FaableAuthApi extends FaableApi {
137
137
  phone_verified: boolean;
138
138
  country_iso?: string | null | undefined;
139
139
  birth_date?: string | null | undefined;
140
- locale: string;
140
+ locale?: string | undefined;
141
141
  region?: string | null | undefined;
142
142
  picture?: string | null | undefined;
143
143
  logins_count: number;
@@ -168,7 +168,7 @@ export declare class FaableAuthApi extends FaableApi {
168
168
  phone_verified: boolean;
169
169
  country_iso?: string | null | undefined;
170
170
  birth_date?: string | null | undefined;
171
- locale: string;
171
+ locale?: string | undefined;
172
172
  region?: string | null | undefined;
173
173
  picture?: string | null | undefined;
174
174
  logins_count: number;
@@ -199,7 +199,7 @@ export declare class FaableAuthApi extends FaableApi {
199
199
  phone_verified: boolean;
200
200
  country_iso?: string | null | undefined;
201
201
  birth_date?: string | null | undefined;
202
- locale: string;
202
+ locale?: string | undefined;
203
203
  region?: string | null | undefined;
204
204
  picture?: string | null | undefined;
205
205
  logins_count: number;
@@ -231,6 +231,7 @@ export declare class FaableAuthApi extends FaableApi {
231
231
  createdAt: string;
232
232
  updatedAt?: string | undefined;
233
233
  }>;
234
+ deleteTeam(team_id: string): Promise<any>;
234
235
  createTeam(data: TeamCreate): Promise<{
235
236
  id: string;
236
237
  name: string;
@@ -334,5 +335,165 @@ export declare class FaableAuthApi extends FaableApi {
334
335
  }>>;
335
336
  };
336
337
  isUserMemberOfTeam(user_id: string, team_id: string): Promise<boolean>;
338
+ listConections(): {
339
+ all: () => Promise<{
340
+ id: string;
341
+ connection_name: string;
342
+ connection_type: string;
343
+ authorize_url?: string | null | undefined;
344
+ client_id: string;
345
+ client_secret: string;
346
+ scope: string[];
347
+ authorize_params: {
348
+ [key: string]: string;
349
+ };
350
+ account: string;
351
+ metadata: {
352
+ [key: string]: unknown;
353
+ };
354
+ createdAt: string;
355
+ updatedAt?: string | undefined;
356
+ }[]>;
357
+ first: () => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
358
+ id: string;
359
+ connection_name: string;
360
+ connection_type: string;
361
+ authorize_url?: string | null | undefined;
362
+ client_id: string;
363
+ client_secret: string;
364
+ scope: string[];
365
+ authorize_params: {
366
+ [key: string]: string;
367
+ };
368
+ account: string;
369
+ metadata: {
370
+ [key: string]: unknown;
371
+ };
372
+ createdAt: string;
373
+ updatedAt?: string | undefined;
374
+ }>>;
375
+ pass: (params?: {
376
+ cursor?: string | undefined;
377
+ pageSize?: string | undefined;
378
+ } | undefined) => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
379
+ id: string;
380
+ connection_name: string;
381
+ connection_type: string;
382
+ authorize_url?: string | null | undefined;
383
+ client_id: string;
384
+ client_secret: string;
385
+ scope: string[];
386
+ authorize_params: {
387
+ [key: string]: string;
388
+ };
389
+ account: string;
390
+ metadata: {
391
+ [key: string]: unknown;
392
+ };
393
+ createdAt: string;
394
+ updatedAt?: string | undefined;
395
+ }>>;
396
+ };
397
+ getConection(connection_id: string): Promise<{
398
+ id: string;
399
+ connection_name: string;
400
+ connection_type: string;
401
+ authorize_url?: string | null | undefined;
402
+ client_id: string;
403
+ client_secret: string;
404
+ scope: string[];
405
+ authorize_params: {
406
+ [key: string]: string;
407
+ };
408
+ account: string;
409
+ metadata: {
410
+ [key: string]: unknown;
411
+ };
412
+ createdAt: string;
413
+ updatedAt?: string | undefined;
414
+ }>;
415
+ listClients(): {
416
+ all: () => Promise<{
417
+ id: string;
418
+ name: string;
419
+ description: string;
420
+ client_id: string;
421
+ client_secret: string;
422
+ callbacks: string[];
423
+ logout_urls: string[];
424
+ refresh_token: {
425
+ expiration_mode: "expire" | "not-expire";
426
+ infinite_token_lifetime: boolean;
427
+ token_lifetime: number;
428
+ };
429
+ account: string;
430
+ metadata: {
431
+ [key: string]: unknown;
432
+ };
433
+ createdAt: string;
434
+ updatedAt?: string | undefined;
435
+ }[]>;
436
+ first: () => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
437
+ id: string;
438
+ name: string;
439
+ description: string;
440
+ client_id: string;
441
+ client_secret: string;
442
+ callbacks: string[];
443
+ logout_urls: string[];
444
+ refresh_token: {
445
+ expiration_mode: "expire" | "not-expire";
446
+ infinite_token_lifetime: boolean;
447
+ token_lifetime: number;
448
+ };
449
+ account: string;
450
+ metadata: {
451
+ [key: string]: unknown;
452
+ };
453
+ createdAt: string;
454
+ updatedAt?: string | undefined;
455
+ }>>;
456
+ pass: (params?: {
457
+ cursor?: string | undefined;
458
+ pageSize?: string | undefined;
459
+ } | undefined) => Promise<import("@faable/sdk-base/dist/helpers/paginator.js").Page<{
460
+ id: string;
461
+ name: string;
462
+ description: string;
463
+ client_id: string;
464
+ client_secret: string;
465
+ callbacks: string[];
466
+ logout_urls: string[];
467
+ refresh_token: {
468
+ expiration_mode: "expire" | "not-expire";
469
+ infinite_token_lifetime: boolean;
470
+ token_lifetime: number;
471
+ };
472
+ account: string;
473
+ metadata: {
474
+ [key: string]: unknown;
475
+ };
476
+ createdAt: string;
477
+ updatedAt?: string | undefined;
478
+ }>>;
479
+ };
480
+ getClient(client_id: string): Promise<{
481
+ id: string;
482
+ connection_name: string;
483
+ connection_type: string;
484
+ authorize_url?: string | null | undefined;
485
+ client_id: string;
486
+ client_secret: string;
487
+ scope: string[];
488
+ authorize_params: {
489
+ [key: string]: string;
490
+ };
491
+ account: string;
492
+ metadata: {
493
+ [key: string]: unknown;
494
+ };
495
+ createdAt: string;
496
+ updatedAt?: string | undefined;
497
+ }>;
337
498
  }
338
499
  export {};
@@ -41,6 +41,9 @@ export class FaableAuthApi extends FaableApi {
41
41
  getTeam(team_id) {
42
42
  return this.fetcher.get(`/team/${team_id}`);
43
43
  }
44
+ deleteTeam(team_id) {
45
+ return this.fetcher.delete(`/team/${team_id}`);
46
+ }
44
47
  createTeam(data) {
45
48
  return this.fetcher.post(`/team`, data);
46
49
  }
@@ -56,4 +59,16 @@ export class FaableAuthApi extends FaableApi {
56
59
  isUserMemberOfTeam(user_id, team_id) {
57
60
  return this.fetcher.check(`/team/${team_id}/member/check/${user_id}`);
58
61
  }
62
+ listConections() {
63
+ return this.paginator({ url: "/connection" });
64
+ }
65
+ getConection(connection_id) {
66
+ return this.fetcher.get(`/connection/${connection_id}`);
67
+ }
68
+ listClients() {
69
+ return this.paginator({ url: "/client" });
70
+ }
71
+ getClient(client_id) {
72
+ return this.fetcher.get(`/client/${client_id}`);
73
+ }
59
74
  }
@@ -3,6 +3,16 @@
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
  export interface paths {
6
+ "/metrics": {
7
+ get: {
8
+ responses: {
9
+ /** @description Default Response */
10
+ 200: {
11
+ content: never;
12
+ };
13
+ };
14
+ };
15
+ };
6
16
  "/account/current": {
7
17
  /**
8
18
  * Get current Account
@@ -10,7 +20,7 @@ export interface paths {
10
20
  */
11
21
  get: {
12
22
  responses: {
13
- /** @description Default Response */
23
+ /** @description AuthAccount */
14
24
  200: {
15
25
  content: {
16
26
  "application/json": components["schemas"]["AuthAccount"];
@@ -60,7 +70,7 @@ export interface paths {
60
70
  };
61
71
  };
62
72
  responses: {
63
- /** @description Default Response */
73
+ /** @description AuthAccount */
64
74
  201: {
65
75
  content: {
66
76
  "application/json": components["schemas"]["AuthAccount"];
@@ -105,6 +115,18 @@ export interface paths {
105
115
  };
106
116
  };
107
117
  };
118
+ /**
119
+ * Delete an Account
120
+ * @description Delete an Account
121
+ */
122
+ delete: {
123
+ parameters: {
124
+ path: {
125
+ account_id: string;
126
+ };
127
+ };
128
+ responses: {};
129
+ };
108
130
  };
109
131
  "/account/host/{host}": {
110
132
  /**
@@ -401,7 +423,7 @@ export interface paths {
401
423
  };
402
424
  };
403
425
  responses: {
404
- /** @description Default Response */
426
+ /** @description TeamMember */
405
427
  201: {
406
428
  content: {
407
429
  "application/json": components["schemas"]["TeamMember"];
@@ -431,7 +453,7 @@ export interface paths {
431
453
  };
432
454
  };
433
455
  responses: {
434
- /** @description Default Response */
456
+ /** @description TeamMember */
435
457
  200: {
436
458
  content: {
437
459
  "application/json": components["schemas"]["TeamMember"];
@@ -525,7 +547,7 @@ export interface paths {
525
547
  */
526
548
  get: {
527
549
  responses: {
528
- /** @description Default Response */
550
+ /** @description User */
529
551
  200: {
530
552
  content: {
531
553
  "application/json": components["schemas"]["User"];
@@ -582,7 +604,16 @@ export interface paths {
582
604
  responses: {
583
605
  /** @description Default Response */
584
606
  200: {
585
- content: never;
607
+ content: {
608
+ "application/json": {
609
+ token_type: string;
610
+ expires_in: number;
611
+ access_token: string;
612
+ refresh_token?: string;
613
+ id_token?: string;
614
+ scope?: string;
615
+ };
616
+ };
586
617
  };
587
618
  };
588
619
  };
@@ -611,7 +642,16 @@ export interface paths {
611
642
  responses: {
612
643
  /** @description Default Response */
613
644
  200: {
614
- content: never;
645
+ content: {
646
+ "application/json": {
647
+ token_type: string;
648
+ expires_in: number;
649
+ access_token: string;
650
+ refresh_token?: string;
651
+ id_token?: string;
652
+ scope?: string;
653
+ };
654
+ };
615
655
  };
616
656
  };
617
657
  };
@@ -830,7 +870,10 @@ export interface components {
830
870
  family_name?: string | null;
831
871
  /** @description User email */
832
872
  email?: string | null;
833
- /** @description true if email is verified */
873
+ /**
874
+ * @description true if email is verified
875
+ * @default false
876
+ */
834
877
  email_verified: boolean;
835
878
  /** @description contact phone number */
836
879
  phone?: string | null;
@@ -841,7 +884,7 @@ export interface components {
841
884
  /** @description user birth_date */
842
885
  birth_date?: string | null;
843
886
  /** @description user main language */
844
- locale: string;
887
+ locale?: string;
845
888
  /** @description customer region */
846
889
  region?: string | null;
847
890
  /** @description User picture url */
@@ -1349,7 +1392,7 @@ export interface operations {
1349
1392
  };
1350
1393
  };
1351
1394
  responses: {
1352
- /** @description Default Response */
1395
+ /** @description Connection */
1353
1396
  200: {
1354
1397
  content: {
1355
1398
  "application/json": components["schemas"]["Connection"];
@@ -1368,7 +1411,7 @@ export interface operations {
1368
1411
  };
1369
1412
  };
1370
1413
  responses: {
1371
- /** @description Default Response */
1414
+ /** @description Connection */
1372
1415
  200: {
1373
1416
  content: {
1374
1417
  "application/json": components["schemas"]["Connection"];
@@ -1436,7 +1479,7 @@ export interface operations {
1436
1479
  };
1437
1480
  };
1438
1481
  responses: {
1439
- /** @description Default Response */
1482
+ /** @description Client */
1440
1483
  200: {
1441
1484
  content: {
1442
1485
  "application/json": components["schemas"]["Client"];
@@ -1455,7 +1498,7 @@ export interface operations {
1455
1498
  };
1456
1499
  };
1457
1500
  responses: {
1458
- /** @description Default Response */
1501
+ /** @description Client */
1459
1502
  200: {
1460
1503
  content: {
1461
1504
  "application/json": components["schemas"]["Client"];
@@ -1523,7 +1566,7 @@ export interface operations {
1523
1566
  };
1524
1567
  };
1525
1568
  responses: {
1526
- /** @description Default Response */
1569
+ /** @description User */
1527
1570
  200: {
1528
1571
  content: {
1529
1572
  "application/json": components["schemas"]["User"];
@@ -1542,7 +1585,7 @@ export interface operations {
1542
1585
  };
1543
1586
  };
1544
1587
  responses: {
1545
- /** @description Default Response */
1588
+ /** @description User */
1546
1589
  200: {
1547
1590
  content: {
1548
1591
  "application/json": components["schemas"]["User"];
@@ -1566,7 +1609,7 @@ export interface operations {
1566
1609
  };
1567
1610
  };
1568
1611
  responses: {
1569
- /** @description Default Response */
1612
+ /** @description User */
1570
1613
  200: {
1571
1614
  content: {
1572
1615
  "application/json": components["schemas"]["User"];
@@ -1634,7 +1677,7 @@ export interface operations {
1634
1677
  };
1635
1678
  };
1636
1679
  responses: {
1637
- /** @description Default Response */
1680
+ /** @description Identity */
1638
1681
  200: {
1639
1682
  content: {
1640
1683
  "application/json": components["schemas"]["Identity"];
@@ -1653,7 +1696,7 @@ export interface operations {
1653
1696
  };
1654
1697
  };
1655
1698
  responses: {
1656
- /** @description Default Response */
1699
+ /** @description Identity */
1657
1700
  200: {
1658
1701
  content: {
1659
1702
  "application/json": components["schemas"]["Identity"];
@@ -1721,7 +1764,7 @@ export interface operations {
1721
1764
  };
1722
1765
  };
1723
1766
  responses: {
1724
- /** @description Default Response */
1767
+ /** @description Role */
1725
1768
  200: {
1726
1769
  content: {
1727
1770
  "application/json": components["schemas"]["Role"];
@@ -1740,7 +1783,7 @@ export interface operations {
1740
1783
  };
1741
1784
  };
1742
1785
  responses: {
1743
- /** @description Default Response */
1786
+ /** @description Role */
1744
1787
  200: {
1745
1788
  content: {
1746
1789
  "application/json": components["schemas"]["Role"];
@@ -1862,7 +1905,7 @@ export interface operations {
1862
1905
  };
1863
1906
  };
1864
1907
  responses: {
1865
- /** @description Default Response */
1908
+ /** @description RoleMember */
1866
1909
  200: {
1867
1910
  content: {
1868
1911
  "application/json": components["schemas"]["RoleMember"];
@@ -1881,7 +1924,7 @@ export interface operations {
1881
1924
  };
1882
1925
  };
1883
1926
  responses: {
1884
- /** @description Default Response */
1927
+ /** @description RoleMember */
1885
1928
  200: {
1886
1929
  content: {
1887
1930
  "application/json": components["schemas"]["RoleMember"];
@@ -1949,7 +1992,7 @@ export interface operations {
1949
1992
  };
1950
1993
  };
1951
1994
  responses: {
1952
- /** @description Default Response */
1995
+ /** @description Team */
1953
1996
  200: {
1954
1997
  content: {
1955
1998
  "application/json": components["schemas"]["Team"];
@@ -1968,7 +2011,7 @@ export interface operations {
1968
2011
  };
1969
2012
  };
1970
2013
  responses: {
1971
- /** @description Default Response */
2014
+ /** @description Team */
1972
2015
  200: {
1973
2016
  content: {
1974
2017
  "application/json": components["schemas"]["Team"];
@@ -2036,7 +2079,7 @@ export interface operations {
2036
2079
  };
2037
2080
  };
2038
2081
  responses: {
2039
- /** @description Default Response */
2082
+ /** @description TeamMember */
2040
2083
  200: {
2041
2084
  content: {
2042
2085
  "application/json": components["schemas"]["TeamMember"];
@@ -2055,7 +2098,7 @@ export interface operations {
2055
2098
  };
2056
2099
  };
2057
2100
  responses: {
2058
- /** @description Default Response */
2101
+ /** @description TeamMember */
2059
2102
  200: {
2060
2103
  content: {
2061
2104
  "application/json": components["schemas"]["TeamMember"];
@@ -2123,7 +2166,7 @@ export interface operations {
2123
2166
  };
2124
2167
  };
2125
2168
  responses: {
2126
- /** @description Default Response */
2169
+ /** @description Webhook */
2127
2170
  200: {
2128
2171
  content: {
2129
2172
  "application/json": components["schemas"]["Webhook"];
@@ -2142,7 +2185,7 @@ export interface operations {
2142
2185
  };
2143
2186
  };
2144
2187
  responses: {
2145
- /** @description Default Response */
2188
+ /** @description Webhook */
2146
2189
  200: {
2147
2190
  content: {
2148
2191
  "application/json": components["schemas"]["Webhook"];
@@ -2210,7 +2253,7 @@ export interface operations {
2210
2253
  };
2211
2254
  };
2212
2255
  responses: {
2213
- /** @description Default Response */
2256
+ /** @description Api */
2214
2257
  200: {
2215
2258
  content: {
2216
2259
  "application/json": components["schemas"]["Api"];
@@ -2229,7 +2272,7 @@ export interface operations {
2229
2272
  };
2230
2273
  };
2231
2274
  responses: {
2232
- /** @description Default Response */
2275
+ /** @description Api */
2233
2276
  200: {
2234
2277
  content: {
2235
2278
  "application/json": components["schemas"]["Api"];
@@ -6,3 +6,5 @@ export type Team = components["schemas"]["Team"];
6
6
  export type TeamMember = components["schemas"]["TeamMember"];
7
7
  export type TeamCreate = components["schemas"]["TeamCreate"];
8
8
  export type AuthAccount = components["schemas"]["AuthAccount"];
9
+ export type Connection = components["schemas"]["Connection"];
10
+ export type Client = components["schemas"]["Client"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "type": "module",
12
12
  "dependencies": {
13
- "@faable/sdk-base": "^1.0.7"
13
+ "@faable/sdk-base": "^1.1.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@ava/typescript": "^5.0.0",