@palmetto/users-sdk 0.2.0 → 0.2.1

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.
@@ -22,12 +22,14 @@ export interface paths {
22
22
  path?: never;
23
23
  cookie?: never;
24
24
  };
25
+ /** Get Current User */
25
26
  get: operations["UsersController_getMe"];
26
27
  put?: never;
27
28
  post?: never;
28
29
  delete?: never;
29
30
  options?: never;
30
31
  head?: never;
32
+ /** Update Current User */
31
33
  patch: operations["UsersController_updateMe"];
32
34
  trace?: never;
33
35
  };
@@ -38,8 +40,10 @@ export interface paths {
38
40
  path?: never;
39
41
  cookie?: never;
40
42
  };
43
+ /** Find Users */
41
44
  get: operations["UsersController_findAll"];
42
45
  put?: never;
46
+ /** Create User */
43
47
  post: operations["UsersController_create"];
44
48
  delete?: never;
45
49
  options?: never;
@@ -54,12 +58,15 @@ export interface paths {
54
58
  path?: never;
55
59
  cookie?: never;
56
60
  };
61
+ /** Find User By ID */
57
62
  get: operations["UsersController_get"];
58
63
  put?: never;
59
64
  post?: never;
65
+ /** Deactivate user */
60
66
  delete: operations["UsersController_delete"];
61
67
  options?: never;
62
68
  head?: never;
69
+ /** Update User */
63
70
  patch: operations["UsersController_update"];
64
71
  trace?: never;
65
72
  };
@@ -72,6 +79,7 @@ export interface paths {
72
79
  };
73
80
  get?: never;
74
81
  put?: never;
82
+ /** Create Personal Access Token */
75
83
  post: operations["UsersController_getPersonalAccessToken"];
76
84
  delete?: never;
77
85
  options?: never;
@@ -88,7 +96,9 @@ export interface paths {
88
96
  };
89
97
  get?: never;
90
98
  put?: never;
99
+ /** Create Grant For User */
91
100
  post: operations["UsersController_addGrant"];
101
+ /** Remove Grant From User */
92
102
  delete: operations["UsersController_removeGrant"];
93
103
  options?: never;
94
104
  head?: never;
@@ -102,12 +112,14 @@ export interface paths {
102
112
  path?: never;
103
113
  cookie?: never;
104
114
  };
115
+ /** Get Organization By ID */
105
116
  get: operations["OrganizationsController_getOrganization"];
106
117
  put?: never;
107
118
  post?: never;
108
119
  delete?: never;
109
120
  options?: never;
110
121
  head?: never;
122
+ /** Update Organization By ID */
111
123
  patch: operations["OrganizationsController_update"];
112
124
  trace?: never;
113
125
  };
@@ -120,6 +132,7 @@ export interface paths {
120
132
  };
121
133
  get?: never;
122
134
  put?: never;
135
+ /** Create Organization */
123
136
  post: operations["OrganizationsController_create"];
124
137
  delete?: never;
125
138
  options?: never;
@@ -136,6 +149,7 @@ export interface paths {
136
149
  };
137
150
  get?: never;
138
151
  put?: never;
152
+ /** Get Auth Token */
139
153
  post: operations["AuthController_generateToken"];
140
154
  delete?: never;
141
155
  options?: never;
@@ -234,6 +248,23 @@ export interface paths {
234
248
  export type webhooks = Record<string, never>;
235
249
  export interface components {
236
250
  schemas: {
251
+ /** UnauthorizedError */
252
+ UnauthorizedErrorDto: {
253
+ /**
254
+ * @example Unauthorized
255
+ * @enum {string}
256
+ */
257
+ error: "Unauthorized";
258
+ /**
259
+ * @example 401
260
+ * @enum {number}
261
+ */
262
+ statusCode: 401;
263
+ /** @example You must log in to perform that action */
264
+ message: string;
265
+ /** @example Technical error description */
266
+ reason: string;
267
+ };
237
268
  /** User */
238
269
  UserDto: {
239
270
  /** @example 66e25e72d10dfef2f9f6cc60 */
@@ -256,7 +287,7 @@ export interface components {
256
287
  * @description Auth0 ID
257
288
  * @example auth0|1234567890
258
289
  */
259
- auth0Id: null;
290
+ auth0Id: string | null;
260
291
  /**
261
292
  * Format: email
262
293
  * @description Email
@@ -301,6 +332,23 @@ export interface components {
301
332
  */
302
333
  hasPAT: boolean;
303
334
  };
335
+ /** ForbiddenError */
336
+ ForbiddenErrorDto: {
337
+ /**
338
+ * @example Forbidden
339
+ * @enum {string}
340
+ */
341
+ error: "Forbidden";
342
+ /**
343
+ * @example 403
344
+ * @enum {number}
345
+ */
346
+ statusCode: 403;
347
+ /** @example You are not allowed to perform that action */
348
+ message: string;
349
+ /** @example Technical error description */
350
+ reason: string;
351
+ };
304
352
  /** UpdateUser */
305
353
  UpdateUserDto: {
306
354
  /**
@@ -319,6 +367,52 @@ export interface components {
319
367
  */
320
368
  phoneNumber?: string;
321
369
  };
370
+ /** BadRequestError */
371
+ BadRequestErrorDto: {
372
+ /**
373
+ * @example InternalServerError
374
+ * @enum {string}
375
+ */
376
+ error: "InternalServerError";
377
+ /**
378
+ * @example 500
379
+ * @enum {number}
380
+ */
381
+ statusCode: 500;
382
+ /** @example An unexpected service error occurred */
383
+ message: string;
384
+ /** @example Technical error description */
385
+ reason: string;
386
+ /** @example {
387
+ * "name": [
388
+ * "is required"
389
+ * ],
390
+ * "postalCode": [
391
+ * "must be a string of 5 numbers"
392
+ * ]
393
+ * } */
394
+ validations: {
395
+ [key: string]: string[];
396
+ };
397
+ };
398
+ /** PaginatedList */
399
+ PaginatedListDto: {
400
+ data: unknown[];
401
+ paging: {
402
+ /** @description Limit of records per page */
403
+ limit: number;
404
+ /** @description Current page */
405
+ page: number;
406
+ /** @description Record count this page starts on */
407
+ pageStart: number;
408
+ /** @description Record count this page ends on */
409
+ pageEnd: number;
410
+ /** @description The count of records in total */
411
+ totalRecords: number;
412
+ /** @description The count of pages in total */
413
+ totalPages: number;
414
+ };
415
+ };
322
416
  /** CreateUser */
323
417
  CreateUserDto: {
324
418
  /**
@@ -367,6 +461,40 @@ export interface components {
367
461
  deny?: boolean;
368
462
  }[];
369
463
  };
464
+ /** NotFoundError */
465
+ NotFoundErrorDto: {
466
+ /**
467
+ * @example NotFound
468
+ * @enum {string}
469
+ */
470
+ error: "NotFound";
471
+ /**
472
+ * @example 404
473
+ * @enum {number}
474
+ */
475
+ statusCode: 404;
476
+ /** @example The requested entity was not found */
477
+ message: string;
478
+ /** @example Technical error description */
479
+ reason: string;
480
+ };
481
+ /** ConflictError */
482
+ ConflictErrorDto: {
483
+ /**
484
+ * @example Conflict
485
+ * @enum {string}
486
+ */
487
+ error: "Conflict";
488
+ /**
489
+ * @example 409
490
+ * @enum {number}
491
+ */
492
+ statusCode: 409;
493
+ /** @example That action cannot be performed at this time */
494
+ message: string;
495
+ /** @example Technical error description */
496
+ reason: string;
497
+ };
370
498
  /** User Personal Access Token */
371
499
  UserPersonalAccessTokenDto: {
372
500
  /**
@@ -553,7 +681,7 @@ export interface components {
553
681
  * @description Auth0 ID
554
682
  * @example auth0|1234567890
555
683
  */
556
- auth0Id: null;
684
+ auth0Id: string | null;
557
685
  /**
558
686
  * Format: email
559
687
  * @description Email
@@ -655,46 +783,6 @@ export interface components {
655
783
  };
656
784
  })[];
657
785
  };
658
- /** PaginatedList */
659
- PaginatedListDto: {
660
- data: unknown[];
661
- paging: {
662
- /** @description Limit of records per page */
663
- limit: number;
664
- /** @description Current page */
665
- page: number;
666
- /** @description Record count this page starts on */
667
- pageStart: number;
668
- /** @description Record count this page ends on */
669
- pageEnd: number;
670
- /** @description The count of records in total */
671
- totalRecords: number;
672
- /** @description The count of pages in total */
673
- totalPages: number;
674
- };
675
- };
676
- /** List */
677
- ListDto: {
678
- data: unknown[];
679
- };
680
- /** Grant */
681
- GrantDto: {
682
- /**
683
- * @description Grant entity
684
- * @example photon:tasks
685
- */
686
- entity: string;
687
- /**
688
- * @description Grant operation
689
- * @example read
690
- */
691
- operation: string;
692
- /**
693
- * @description Deny grant
694
- * @example false
695
- */
696
- deny?: boolean;
697
- };
698
786
  };
699
787
  responses: never;
700
788
  parameters: never;
@@ -738,6 +826,24 @@ export interface operations {
738
826
  "application/json": components["schemas"]["UserDto"];
739
827
  };
740
828
  };
829
+ /** @description When authentication fails */
830
+ 401: {
831
+ headers: {
832
+ [name: string]: unknown;
833
+ };
834
+ content: {
835
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
836
+ };
837
+ };
838
+ /** @description When the user does not have permission to access this resource */
839
+ 403: {
840
+ headers: {
841
+ [name: string]: unknown;
842
+ };
843
+ content: {
844
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
845
+ };
846
+ };
741
847
  };
742
848
  };
743
849
  UsersController_updateMe: {
@@ -761,6 +867,33 @@ export interface operations {
761
867
  "application/json": components["schemas"]["UserDto"];
762
868
  };
763
869
  };
870
+ /** @description When the body request is invalid */
871
+ 400: {
872
+ headers: {
873
+ [name: string]: unknown;
874
+ };
875
+ content: {
876
+ "application/json": components["schemas"]["BadRequestErrorDto"];
877
+ };
878
+ };
879
+ /** @description When authentication fails */
880
+ 401: {
881
+ headers: {
882
+ [name: string]: unknown;
883
+ };
884
+ content: {
885
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
886
+ };
887
+ };
888
+ /** @description When the user does not have permission to access this resource */
889
+ 403: {
890
+ headers: {
891
+ [name: string]: unknown;
892
+ };
893
+ content: {
894
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
895
+ };
896
+ };
764
897
  };
765
898
  };
766
899
  UsersController_findAll: {
@@ -787,6 +920,33 @@ export interface operations {
787
920
  } & components["schemas"]["PaginatedListDto"];
788
921
  };
789
922
  };
923
+ /** @description When the query request is invalid */
924
+ 400: {
925
+ headers: {
926
+ [name: string]: unknown;
927
+ };
928
+ content: {
929
+ "application/json": components["schemas"]["BadRequestErrorDto"];
930
+ };
931
+ };
932
+ /** @description When authentication fails */
933
+ 401: {
934
+ headers: {
935
+ [name: string]: unknown;
936
+ };
937
+ content: {
938
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
939
+ };
940
+ };
941
+ /** @description When the requesting user is not allowed to perform this action */
942
+ 403: {
943
+ headers: {
944
+ [name: string]: unknown;
945
+ };
946
+ content: {
947
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
948
+ };
949
+ };
790
950
  };
791
951
  };
792
952
  UsersController_create: {
@@ -810,6 +970,42 @@ export interface operations {
810
970
  "application/json": components["schemas"]["UserDto"];
811
971
  };
812
972
  };
973
+ /** @description When the request is invalid */
974
+ 400: {
975
+ headers: {
976
+ [name: string]: unknown;
977
+ };
978
+ content: {
979
+ "application/json": components["schemas"]["BadRequestErrorDto"];
980
+ };
981
+ };
982
+ /** @description When authentication fails */
983
+ 401: {
984
+ headers: {
985
+ [name: string]: unknown;
986
+ };
987
+ content: {
988
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
989
+ };
990
+ };
991
+ /** @description When the requesting user is not allowed to perform this action */
992
+ 403: {
993
+ headers: {
994
+ [name: string]: unknown;
995
+ };
996
+ content: {
997
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
998
+ };
999
+ };
1000
+ /** @description When the organization is not found */
1001
+ 404: {
1002
+ headers: {
1003
+ [name: string]: unknown;
1004
+ };
1005
+ content: {
1006
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1007
+ };
1008
+ };
813
1009
  };
814
1010
  };
815
1011
  UsersController_get: {
@@ -831,6 +1027,42 @@ export interface operations {
831
1027
  "application/json": components["schemas"]["UserDto"];
832
1028
  };
833
1029
  };
1030
+ /** @description When the ID is invalid */
1031
+ 400: {
1032
+ headers: {
1033
+ [name: string]: unknown;
1034
+ };
1035
+ content: {
1036
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1037
+ };
1038
+ };
1039
+ /** @description When authentication fails */
1040
+ 401: {
1041
+ headers: {
1042
+ [name: string]: unknown;
1043
+ };
1044
+ content: {
1045
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1046
+ };
1047
+ };
1048
+ /** @description When the requesting user is not allowed to perform this action */
1049
+ 403: {
1050
+ headers: {
1051
+ [name: string]: unknown;
1052
+ };
1053
+ content: {
1054
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1055
+ };
1056
+ };
1057
+ /** @description When the user is not found */
1058
+ 404: {
1059
+ headers: {
1060
+ [name: string]: unknown;
1061
+ };
1062
+ content: {
1063
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1064
+ };
1065
+ };
834
1066
  };
835
1067
  };
836
1068
  UsersController_delete: {
@@ -850,6 +1082,51 @@ export interface operations {
850
1082
  };
851
1083
  content?: never;
852
1084
  };
1085
+ /** @description When the ID is invalid */
1086
+ 400: {
1087
+ headers: {
1088
+ [name: string]: unknown;
1089
+ };
1090
+ content: {
1091
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1092
+ };
1093
+ };
1094
+ /** @description When authentication fails */
1095
+ 401: {
1096
+ headers: {
1097
+ [name: string]: unknown;
1098
+ };
1099
+ content: {
1100
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1101
+ };
1102
+ };
1103
+ /** @description When the requesting user is not allowed to perform this action */
1104
+ 403: {
1105
+ headers: {
1106
+ [name: string]: unknown;
1107
+ };
1108
+ content: {
1109
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1110
+ };
1111
+ };
1112
+ /** @description When the user is not found */
1113
+ 404: {
1114
+ headers: {
1115
+ [name: string]: unknown;
1116
+ };
1117
+ content: {
1118
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1119
+ };
1120
+ };
1121
+ /** @description When the user is not allowed to be deactivated */
1122
+ 409: {
1123
+ headers: {
1124
+ [name: string]: unknown;
1125
+ };
1126
+ content: {
1127
+ "application/json": components["schemas"]["ConflictErrorDto"];
1128
+ };
1129
+ };
853
1130
  };
854
1131
  };
855
1132
  UsersController_update: {
@@ -875,6 +1152,42 @@ export interface operations {
875
1152
  "application/json": components["schemas"]["UserDto"];
876
1153
  };
877
1154
  };
1155
+ /** @description When the ID or body request is invalid */
1156
+ 400: {
1157
+ headers: {
1158
+ [name: string]: unknown;
1159
+ };
1160
+ content: {
1161
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1162
+ };
1163
+ };
1164
+ /** @description When authentication fails */
1165
+ 401: {
1166
+ headers: {
1167
+ [name: string]: unknown;
1168
+ };
1169
+ content: {
1170
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1171
+ };
1172
+ };
1173
+ /** @description When the requesting user is not allowed to perform this action */
1174
+ 403: {
1175
+ headers: {
1176
+ [name: string]: unknown;
1177
+ };
1178
+ content: {
1179
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1180
+ };
1181
+ };
1182
+ /** @description When the user is not found */
1183
+ 404: {
1184
+ headers: {
1185
+ [name: string]: unknown;
1186
+ };
1187
+ content: {
1188
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1189
+ };
1190
+ };
878
1191
  };
879
1192
  };
880
1193
  UsersController_getPersonalAccessToken: {
@@ -896,6 +1209,42 @@ export interface operations {
896
1209
  "application/json": components["schemas"]["UserPersonalAccessTokenDto"];
897
1210
  };
898
1211
  };
1212
+ /** @description When the ID is invalid */
1213
+ 400: {
1214
+ headers: {
1215
+ [name: string]: unknown;
1216
+ };
1217
+ content: {
1218
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1219
+ };
1220
+ };
1221
+ /** @description When authentication fails */
1222
+ 401: {
1223
+ headers: {
1224
+ [name: string]: unknown;
1225
+ };
1226
+ content: {
1227
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1228
+ };
1229
+ };
1230
+ /** @description When the requesting user is not allowed to perform this action */
1231
+ 403: {
1232
+ headers: {
1233
+ [name: string]: unknown;
1234
+ };
1235
+ content: {
1236
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1237
+ };
1238
+ };
1239
+ /** @description When the user is not found */
1240
+ 404: {
1241
+ headers: {
1242
+ [name: string]: unknown;
1243
+ };
1244
+ content: {
1245
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1246
+ };
1247
+ };
899
1248
  };
900
1249
  };
901
1250
  UsersController_addGrant: {
@@ -921,6 +1270,42 @@ export interface operations {
921
1270
  "application/json": components["schemas"]["UserDto"];
922
1271
  };
923
1272
  };
1273
+ /** @description When the ID or body request is invalid */
1274
+ 400: {
1275
+ headers: {
1276
+ [name: string]: unknown;
1277
+ };
1278
+ content: {
1279
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1280
+ };
1281
+ };
1282
+ /** @description When authentication fails */
1283
+ 401: {
1284
+ headers: {
1285
+ [name: string]: unknown;
1286
+ };
1287
+ content: {
1288
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1289
+ };
1290
+ };
1291
+ /** @description When the requesting user is not allowed to perform this action */
1292
+ 403: {
1293
+ headers: {
1294
+ [name: string]: unknown;
1295
+ };
1296
+ content: {
1297
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1298
+ };
1299
+ };
1300
+ /** @description When the user is not found */
1301
+ 404: {
1302
+ headers: {
1303
+ [name: string]: unknown;
1304
+ };
1305
+ content: {
1306
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1307
+ };
1308
+ };
924
1309
  };
925
1310
  };
926
1311
  UsersController_removeGrant: {
@@ -946,6 +1331,42 @@ export interface operations {
946
1331
  "application/json": components["schemas"]["UserDto"];
947
1332
  };
948
1333
  };
1334
+ /** @description When the ID or body request is invalid */
1335
+ 400: {
1336
+ headers: {
1337
+ [name: string]: unknown;
1338
+ };
1339
+ content: {
1340
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1341
+ };
1342
+ };
1343
+ /** @description When authentication fails */
1344
+ 401: {
1345
+ headers: {
1346
+ [name: string]: unknown;
1347
+ };
1348
+ content: {
1349
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1350
+ };
1351
+ };
1352
+ /** @description When the requesting user is not allowed to perform this action */
1353
+ 403: {
1354
+ headers: {
1355
+ [name: string]: unknown;
1356
+ };
1357
+ content: {
1358
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1359
+ };
1360
+ };
1361
+ /** @description When the user is not found */
1362
+ 404: {
1363
+ headers: {
1364
+ [name: string]: unknown;
1365
+ };
1366
+ content: {
1367
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1368
+ };
1369
+ };
949
1370
  };
950
1371
  };
951
1372
  OrganizationsController_getOrganization: {
@@ -967,6 +1388,42 @@ export interface operations {
967
1388
  "application/json": components["schemas"]["OrganizationDto"];
968
1389
  };
969
1390
  };
1391
+ /** @description When the provided ID is invalid */
1392
+ 400: {
1393
+ headers: {
1394
+ [name: string]: unknown;
1395
+ };
1396
+ content: {
1397
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1398
+ };
1399
+ };
1400
+ /** @description When authentication fails */
1401
+ 401: {
1402
+ headers: {
1403
+ [name: string]: unknown;
1404
+ };
1405
+ content: {
1406
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1407
+ };
1408
+ };
1409
+ /** @description When the requesting user is not allowed to perform this action */
1410
+ 403: {
1411
+ headers: {
1412
+ [name: string]: unknown;
1413
+ };
1414
+ content: {
1415
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1416
+ };
1417
+ };
1418
+ /** @description When the organization is not found */
1419
+ 404: {
1420
+ headers: {
1421
+ [name: string]: unknown;
1422
+ };
1423
+ content: {
1424
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1425
+ };
1426
+ };
970
1427
  };
971
1428
  };
972
1429
  OrganizationsController_update: {
@@ -992,6 +1449,42 @@ export interface operations {
992
1449
  "application/json": components["schemas"]["OrganizationDto"];
993
1450
  };
994
1451
  };
1452
+ /** @description When the provided ID or body is invalid */
1453
+ 400: {
1454
+ headers: {
1455
+ [name: string]: unknown;
1456
+ };
1457
+ content: {
1458
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1459
+ };
1460
+ };
1461
+ /** @description When authentication fails */
1462
+ 401: {
1463
+ headers: {
1464
+ [name: string]: unknown;
1465
+ };
1466
+ content: {
1467
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1468
+ };
1469
+ };
1470
+ /** @description When the requesting user is not allowed to perform this action */
1471
+ 403: {
1472
+ headers: {
1473
+ [name: string]: unknown;
1474
+ };
1475
+ content: {
1476
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1477
+ };
1478
+ };
1479
+ /** @description When the organization is not found */
1480
+ 404: {
1481
+ headers: {
1482
+ [name: string]: unknown;
1483
+ };
1484
+ content: {
1485
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1486
+ };
1487
+ };
995
1488
  };
996
1489
  };
997
1490
  OrganizationsController_create: {
@@ -1015,6 +1508,33 @@ export interface operations {
1015
1508
  "application/json": components["schemas"]["OrganizationDto"];
1016
1509
  };
1017
1510
  };
1511
+ /** @description When the provided body is invalid */
1512
+ 400: {
1513
+ headers: {
1514
+ [name: string]: unknown;
1515
+ };
1516
+ content: {
1517
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1518
+ };
1519
+ };
1520
+ /** @description When authentication fails */
1521
+ 401: {
1522
+ headers: {
1523
+ [name: string]: unknown;
1524
+ };
1525
+ content: {
1526
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1527
+ };
1528
+ };
1529
+ /** @description When the requesting user is not allowed to perform this action */
1530
+ 403: {
1531
+ headers: {
1532
+ [name: string]: unknown;
1533
+ };
1534
+ content: {
1535
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1536
+ };
1537
+ };
1018
1538
  };
1019
1539
  };
1020
1540
  AuthController_generateToken: {
@@ -1038,6 +1558,15 @@ export interface operations {
1038
1558
  "application/json": components["schemas"]["TokenResponseDto"];
1039
1559
  };
1040
1560
  };
1561
+ /** @description When the provided body is invalid */
1562
+ 400: {
1563
+ headers: {
1564
+ [name: string]: unknown;
1565
+ };
1566
+ content: {
1567
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1568
+ };
1569
+ };
1041
1570
  };
1042
1571
  };
1043
1572
  SignUpsController_findAll: {
@@ -1064,6 +1593,33 @@ export interface operations {
1064
1593
  } & components["schemas"]["PaginatedListDto"];
1065
1594
  };
1066
1595
  };
1596
+ /** @description When the sign up query is invalid */
1597
+ 400: {
1598
+ headers: {
1599
+ [name: string]: unknown;
1600
+ };
1601
+ content: {
1602
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1603
+ };
1604
+ };
1605
+ /** @description When authentication fails */
1606
+ 401: {
1607
+ headers: {
1608
+ [name: string]: unknown;
1609
+ };
1610
+ content: {
1611
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1612
+ };
1613
+ };
1614
+ /** @description When the requesting user is not allowed to perform this action */
1615
+ 403: {
1616
+ headers: {
1617
+ [name: string]: unknown;
1618
+ };
1619
+ content: {
1620
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1621
+ };
1622
+ };
1067
1623
  };
1068
1624
  };
1069
1625
  SignUpsController_create: {
@@ -1087,6 +1643,24 @@ export interface operations {
1087
1643
  "application/json": components["schemas"]["SignUpTokenDto"];
1088
1644
  };
1089
1645
  };
1646
+ /** @description When the sign up request is invalid */
1647
+ 400: {
1648
+ headers: {
1649
+ [name: string]: unknown;
1650
+ };
1651
+ content: {
1652
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1653
+ };
1654
+ };
1655
+ /** @description When authentication fails */
1656
+ 401: {
1657
+ headers: {
1658
+ [name: string]: unknown;
1659
+ };
1660
+ content: {
1661
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1662
+ };
1663
+ };
1090
1664
  };
1091
1665
  };
1092
1666
  SignUpsController_findOne: {
@@ -1108,6 +1682,24 @@ export interface operations {
1108
1682
  "application/json": components["schemas"]["SignUpDto"];
1109
1683
  };
1110
1684
  };
1685
+ /** @description When the sign up token is invalid */
1686
+ 400: {
1687
+ headers: {
1688
+ [name: string]: unknown;
1689
+ };
1690
+ content: {
1691
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1692
+ };
1693
+ };
1694
+ /** @description When the sign up is not found */
1695
+ 404: {
1696
+ headers: {
1697
+ [name: string]: unknown;
1698
+ };
1699
+ content: {
1700
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1701
+ };
1702
+ };
1111
1703
  };
1112
1704
  };
1113
1705
  SignUpsController_update: {
@@ -1133,6 +1725,33 @@ export interface operations {
1133
1725
  "application/json": components["schemas"]["SignUpDto"];
1134
1726
  };
1135
1727
  };
1728
+ /** @description When the sign up token or body is invalid */
1729
+ 400: {
1730
+ headers: {
1731
+ [name: string]: unknown;
1732
+ };
1733
+ content: {
1734
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1735
+ };
1736
+ };
1737
+ /** @description When the sign up is not found */
1738
+ 404: {
1739
+ headers: {
1740
+ [name: string]: unknown;
1741
+ };
1742
+ content: {
1743
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1744
+ };
1745
+ };
1746
+ /** @description When the sign up token already has an auth0Id */
1747
+ 409: {
1748
+ headers: {
1749
+ [name: string]: unknown;
1750
+ };
1751
+ content: {
1752
+ "application/json": components["schemas"]["ConflictErrorDto"];
1753
+ };
1754
+ };
1136
1755
  };
1137
1756
  };
1138
1757
  SignUpsController_createUser: {
@@ -1158,6 +1777,33 @@ export interface operations {
1158
1777
  "application/json": components["schemas"]["SignUpDto"];
1159
1778
  };
1160
1779
  };
1780
+ /** @description When the sign up token or body is invalid */
1781
+ 400: {
1782
+ headers: {
1783
+ [name: string]: unknown;
1784
+ };
1785
+ content: {
1786
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1787
+ };
1788
+ };
1789
+ /** @description When the sign up is not found */
1790
+ 404: {
1791
+ headers: {
1792
+ [name: string]: unknown;
1793
+ };
1794
+ content: {
1795
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1796
+ };
1797
+ };
1798
+ /** @description When the sign up already has an userId or does not have an auth0Id, email, or organizationId */
1799
+ 409: {
1800
+ headers: {
1801
+ [name: string]: unknown;
1802
+ };
1803
+ content: {
1804
+ "application/json": components["schemas"]["ConflictErrorDto"];
1805
+ };
1806
+ };
1161
1807
  };
1162
1808
  };
1163
1809
  SignUpsController_delete: {
@@ -1178,6 +1824,42 @@ export interface operations {
1178
1824
  };
1179
1825
  content?: never;
1180
1826
  };
1827
+ /** @description When the sign up ID is invalid */
1828
+ 400: {
1829
+ headers: {
1830
+ [name: string]: unknown;
1831
+ };
1832
+ content: {
1833
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1834
+ };
1835
+ };
1836
+ /** @description When authentication fails */
1837
+ 401: {
1838
+ headers: {
1839
+ [name: string]: unknown;
1840
+ };
1841
+ content: {
1842
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1843
+ };
1844
+ };
1845
+ /** @description When the requesting user is not allowed to perform this action */
1846
+ 403: {
1847
+ headers: {
1848
+ [name: string]: unknown;
1849
+ };
1850
+ content: {
1851
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1852
+ };
1853
+ };
1854
+ /** @description When the sign up is not found */
1855
+ 404: {
1856
+ headers: {
1857
+ [name: string]: unknown;
1858
+ };
1859
+ content: {
1860
+ "application/json": components["schemas"]["NotFoundErrorDto"];
1861
+ };
1862
+ };
1181
1863
  };
1182
1864
  };
1183
1865
  SearchUsersController_search: {
@@ -1203,6 +1885,33 @@ export interface operations {
1203
1885
  } & components["schemas"]["PaginatedListDto"];
1204
1886
  };
1205
1887
  };
1888
+ /** @description When the search request is invalid */
1889
+ 400: {
1890
+ headers: {
1891
+ [name: string]: unknown;
1892
+ };
1893
+ content: {
1894
+ "application/json": components["schemas"]["BadRequestErrorDto"];
1895
+ };
1896
+ };
1897
+ /** @description When authentication fails */
1898
+ 401: {
1899
+ headers: {
1900
+ [name: string]: unknown;
1901
+ };
1902
+ content: {
1903
+ "application/json": components["schemas"]["UnauthorizedErrorDto"];
1904
+ };
1905
+ };
1906
+ /** @description When the requesting user is not allowed to perform this action */
1907
+ 403: {
1908
+ headers: {
1909
+ [name: string]: unknown;
1910
+ };
1911
+ content: {
1912
+ "application/json": components["schemas"]["ForbiddenErrorDto"];
1913
+ };
1914
+ };
1206
1915
  };
1207
1916
  };
1208
1917
  }
package/dist/client.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  import { BaseSdkClient, CreateSdkClientInput, RequestOptions } from "@palmetto/base-sdk-client";
2
2
  import { paths } from "./__generated__/schema";
3
+ export type MeResponse = paths["/api/users/me"]["get"]["responses"]["200"]["content"]["application/json"];
3
4
  export type UpdateMeInput = paths["/api/users/me"]["patch"]["requestBody"]["content"]["application/json"];
4
5
  export type UpdateMeResponse = paths["/api/users/me"]["patch"]["responses"]["200"]["content"]["application/json"];
6
+ export type UpdateUserByIdInput = paths["/api/users/{id}"]["patch"]["parameters"]["path"] & paths["/api/users/{id}"]["patch"]["requestBody"]["content"]["application/json"];
7
+ export type UpdateUserByIdResponse = paths["/api/users/{id}"]["patch"]["responses"]["200"]["content"]["application/json"];
5
8
  export type GetUsersInput = NonNullable<paths["/api/users"]["get"]["parameters"]["query"]>;
6
9
  export type GetUsersResponse = paths["/api/users"]["get"]["responses"]["200"]["content"]["application/json"];
10
+ export type GetUserByIdInput = paths["/api/users/{id}"]["get"]["parameters"]["path"];
11
+ export type GetUserByIdResponse = paths["/api/users/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
7
12
  export type GetOrganizationInput = paths["/api/organizations/{id}"]["get"]["parameters"]["path"];
8
13
  export type GetOrganizationResponse = paths["/api/organizations/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
9
14
  export type UpdateOrganizationInput = paths["/api/organizations/{id}"]["patch"]["parameters"]["path"] & paths["/api/organizations/{id}"]["patch"]["requestBody"]["content"]["application/json"];
@@ -27,7 +32,7 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
27
32
  createdAt: string;
28
33
  updatedAt?: string;
29
34
  };
30
- auth0Id: null;
35
+ auth0Id: string | null;
31
36
  email: string;
32
37
  firstName: string;
33
38
  lastName: string;
@@ -48,7 +53,30 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
48
53
  createdAt: string;
49
54
  updatedAt?: string;
50
55
  };
51
- auth0Id: null;
56
+ auth0Id: string | null;
57
+ email: string;
58
+ firstName: string;
59
+ lastName: string;
60
+ permissions: {
61
+ [key: string]: string[];
62
+ };
63
+ phoneNumber: string;
64
+ organizationId: string;
65
+ hasPAT: boolean;
66
+ }> | import("@palmetto/result").ResultErr<{
67
+ code: "UNKNOWN_ERROR";
68
+ }> | import("@palmetto/result").ResultErr<{
69
+ code: "BAD_REQUEST";
70
+ }> | import("@palmetto/result").ResultErr<{
71
+ code: "NOT_FOUND";
72
+ }>>;
73
+ updateUserById({ id, ...input }: UpdateUserByIdInput, opts?: RequestOptions): Promise<import("@palmetto/result").ResultOk<{
74
+ id: string;
75
+ meta: {
76
+ createdAt: string;
77
+ updatedAt?: string;
78
+ };
79
+ auth0Id: string | null;
52
80
  email: string;
53
81
  firstName: string;
54
82
  lastName: string;
@@ -82,6 +110,29 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
82
110
  totalPages: number;
83
111
  };
84
112
  }>>;
113
+ getUserById({ id }: GetUserByIdInput, opts?: RequestOptions): Promise<import("@palmetto/result").ResultOk<{
114
+ id: string;
115
+ meta: {
116
+ createdAt: string;
117
+ updatedAt?: string;
118
+ };
119
+ auth0Id: string | null;
120
+ email: string;
121
+ firstName: string;
122
+ lastName: string;
123
+ permissions: {
124
+ [key: string]: string[];
125
+ };
126
+ phoneNumber: string;
127
+ organizationId: string;
128
+ hasPAT: boolean;
129
+ }> | import("@palmetto/result").ResultErr<{
130
+ code: "UNKNOWN_ERROR";
131
+ }> | import("@palmetto/result").ResultErr<{
132
+ code: "BAD_REQUEST";
133
+ }> | import("@palmetto/result").ResultErr<{
134
+ code: "NOT_FOUND";
135
+ }>>;
85
136
  getOrganizationById({ id }: GetOrganizationInput, opts?: RequestOptions): Promise<import("@palmetto/result").ResultErr<{
86
137
  code: "UNKNOWN_ERROR";
87
138
  }> | import("@palmetto/result").ResultErr<{
package/dist/client.js CHANGED
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.UsersApiClient = void 0;
24
24
  const base_sdk_client_1 = require("@palmetto/base-sdk-client");
25
25
  const result_1 = require("@palmetto/result");
26
- const SDK_VERSION_SLUG = "palmetto-users-sdk/0.2.0";
26
+ const SDK_VERSION_SLUG = "palmetto-users-sdk/0.2.1";
27
27
  class UsersApiClient extends base_sdk_client_1.BaseSdkClient {
28
28
  constructor(input) {
29
29
  super(Object.assign(Object.assign({}, input), { sdkVersion: SDK_VERSION_SLUG }));
@@ -64,6 +64,27 @@ class UsersApiClient extends base_sdk_client_1.BaseSdkClient {
64
64
  }
65
65
  });
66
66
  }
67
+ updateUserById(_a, opts) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ var { id } = _a, input = __rest(_a, ["id"]);
70
+ const { data, response } = yield this.client.PATCH("/api/users/{id}", {
71
+ params: { path: { id } },
72
+ body: input,
73
+ headers: this.generateHeaders(opts),
74
+ });
75
+ if (data) {
76
+ return (0, result_1.Ok)(data);
77
+ }
78
+ switch (response.status) {
79
+ case 400:
80
+ return (0, result_1.Err)("BAD_REQUEST");
81
+ case 404:
82
+ return (0, result_1.Err)("NOT_FOUND");
83
+ default:
84
+ return (0, result_1.Err)("UNKNOWN_ERROR");
85
+ }
86
+ });
87
+ }
67
88
  getUsers(input, opts) {
68
89
  return __awaiter(this, void 0, void 0, function* () {
69
90
  const { data, response } = yield this.client.GET("/api/users", {
@@ -81,6 +102,25 @@ class UsersApiClient extends base_sdk_client_1.BaseSdkClient {
81
102
  }
82
103
  });
83
104
  }
105
+ getUserById(_a, opts_1) {
106
+ return __awaiter(this, arguments, void 0, function* ({ id }, opts) {
107
+ const { data, response } = yield this.client.GET("/api/users/{id}", {
108
+ params: { path: { id } },
109
+ headers: this.generateHeaders(opts),
110
+ });
111
+ if (data) {
112
+ return (0, result_1.Ok)(data);
113
+ }
114
+ switch (response.status) {
115
+ case 400:
116
+ return (0, result_1.Err)("BAD_REQUEST");
117
+ case 404:
118
+ return (0, result_1.Err)("NOT_FOUND");
119
+ default:
120
+ return (0, result_1.Err)("UNKNOWN_ERROR");
121
+ }
122
+ });
123
+ }
84
124
  getOrganizationById(_a, opts_1) {
85
125
  return __awaiter(this, arguments, void 0, function* ({ id }, opts) {
86
126
  const { data, response } = yield this.client.GET("/api/organizations/{id}", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palmetto/users-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/main.js",
5
5
  "files": [
6
6
  "dist/**/*",