@palmetto/users-sdk 1.7.0 → 1.7.2
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/__generated__/schema.d.ts +220 -20
- package/dist/client.d.ts +8 -0
- package/dist/client.js +25 -1
- package/package.json +5 -1
|
@@ -16,6 +16,46 @@ export interface paths {
|
|
|
16
16
|
patch?: never;
|
|
17
17
|
trace?: never;
|
|
18
18
|
};
|
|
19
|
+
"/api/auth/otp-channels": {
|
|
20
|
+
parameters: {
|
|
21
|
+
query?: never;
|
|
22
|
+
header?: never;
|
|
23
|
+
path?: never;
|
|
24
|
+
cookie?: never;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Get available OTP channels for user
|
|
28
|
+
* @description Returns masked contact options for OTP delivery. Returns empty array for unknown users to prevent enumeration.
|
|
29
|
+
*/
|
|
30
|
+
get: operations["AuthController_getOtpChannels"];
|
|
31
|
+
put?: never;
|
|
32
|
+
post?: never;
|
|
33
|
+
delete?: never;
|
|
34
|
+
options?: never;
|
|
35
|
+
head?: never;
|
|
36
|
+
patch?: never;
|
|
37
|
+
trace?: never;
|
|
38
|
+
};
|
|
39
|
+
"/api/auth/otp-challenge": {
|
|
40
|
+
parameters: {
|
|
41
|
+
query?: never;
|
|
42
|
+
header?: never;
|
|
43
|
+
path?: never;
|
|
44
|
+
cookie?: never;
|
|
45
|
+
};
|
|
46
|
+
get?: never;
|
|
47
|
+
put?: never;
|
|
48
|
+
/**
|
|
49
|
+
* Request OTP code
|
|
50
|
+
* @description Sends a 6-digit OTP code via the specified channel (email or SMS)
|
|
51
|
+
*/
|
|
52
|
+
post: operations["AuthController_requestOtpChallenge"];
|
|
53
|
+
delete?: never;
|
|
54
|
+
options?: never;
|
|
55
|
+
head?: never;
|
|
56
|
+
patch?: never;
|
|
57
|
+
trace?: never;
|
|
58
|
+
};
|
|
19
59
|
"/api/organizations/{id}": {
|
|
20
60
|
parameters: {
|
|
21
61
|
query?: never;
|
|
@@ -444,6 +484,25 @@ export interface components {
|
|
|
444
484
|
/** @enum {string} */
|
|
445
485
|
grant_type: "refresh_token";
|
|
446
486
|
refresh_token: string;
|
|
487
|
+
} | {
|
|
488
|
+
/** @enum {string} */
|
|
489
|
+
grant_type: "https://users.palmetto.com/oauth/grant-types/otp-challenge";
|
|
490
|
+
/**
|
|
491
|
+
* Format: email
|
|
492
|
+
* @description Email address used to request the OTP
|
|
493
|
+
* @example john.doe@palmetto.com
|
|
494
|
+
*/
|
|
495
|
+
identifier: string;
|
|
496
|
+
/**
|
|
497
|
+
* @description 6-digit OTP code received via email or SMS
|
|
498
|
+
* @example 123456
|
|
499
|
+
*/
|
|
500
|
+
otp: string;
|
|
501
|
+
/**
|
|
502
|
+
* @description Channel where the OTP was delivered
|
|
503
|
+
* @enum {string}
|
|
504
|
+
*/
|
|
505
|
+
channel: "EMAIL" | "SMS";
|
|
447
506
|
};
|
|
448
507
|
/** TokenResponse */
|
|
449
508
|
TokenResponseDto: {
|
|
@@ -480,6 +539,23 @@ export interface components {
|
|
|
480
539
|
[key: string]: string[];
|
|
481
540
|
};
|
|
482
541
|
};
|
|
542
|
+
/** UnauthorizedError */
|
|
543
|
+
UnauthorizedErrorDto: {
|
|
544
|
+
/**
|
|
545
|
+
* @example Unauthorized
|
|
546
|
+
* @enum {string}
|
|
547
|
+
*/
|
|
548
|
+
error: "Unauthorized";
|
|
549
|
+
/**
|
|
550
|
+
* @example 401
|
|
551
|
+
* @enum {number}
|
|
552
|
+
*/
|
|
553
|
+
statusCode: 401;
|
|
554
|
+
/** @example You must log in to perform that action */
|
|
555
|
+
message: string;
|
|
556
|
+
/** @example Technical error description */
|
|
557
|
+
reason: string;
|
|
558
|
+
};
|
|
483
559
|
/** NotFoundError */
|
|
484
560
|
NotFoundErrorDto: {
|
|
485
561
|
/**
|
|
@@ -497,22 +573,49 @@ export interface components {
|
|
|
497
573
|
/** @example Technical error description */
|
|
498
574
|
reason: string;
|
|
499
575
|
};
|
|
500
|
-
/**
|
|
501
|
-
|
|
576
|
+
/** List */
|
|
577
|
+
ListDto: {
|
|
578
|
+
data: unknown[];
|
|
579
|
+
};
|
|
580
|
+
/** OtpChannelOption */
|
|
581
|
+
OtpChannelOptionDto: {
|
|
502
582
|
/**
|
|
503
|
-
* @
|
|
583
|
+
* @description Available authentication channel
|
|
504
584
|
* @enum {string}
|
|
505
585
|
*/
|
|
506
|
-
|
|
586
|
+
channel: "EMAIL" | "SMS";
|
|
507
587
|
/**
|
|
508
|
-
* @
|
|
509
|
-
* @
|
|
588
|
+
* @description Privacy-masked contact information
|
|
589
|
+
* @example j******@palmetto.com
|
|
510
590
|
*/
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
591
|
+
maskedIdentifier: string;
|
|
592
|
+
};
|
|
593
|
+
/** OtpChallengeInput */
|
|
594
|
+
OtpChallengeInputDto: {
|
|
595
|
+
/**
|
|
596
|
+
* Format: email
|
|
597
|
+
* @description Email address for OTP delivery
|
|
598
|
+
* @example john.doe@palmetto.com
|
|
599
|
+
*/
|
|
600
|
+
identifier: string;
|
|
601
|
+
/**
|
|
602
|
+
* @description Delivery channel for OTP code
|
|
603
|
+
* @enum {string}
|
|
604
|
+
*/
|
|
605
|
+
channel: "EMAIL" | "SMS";
|
|
606
|
+
};
|
|
607
|
+
/** OtpChallenge */
|
|
608
|
+
OtpChallengeDto: {
|
|
609
|
+
/**
|
|
610
|
+
* @description Privacy-masked destination where OTP was sent
|
|
611
|
+
* @example j******@palmetto.com
|
|
612
|
+
*/
|
|
613
|
+
maskedIdentifier: string;
|
|
614
|
+
/**
|
|
615
|
+
* @description OTP validity period in seconds (typically 300 for 5 minutes)
|
|
616
|
+
* @example 300
|
|
617
|
+
*/
|
|
618
|
+
expiresIn: number;
|
|
516
619
|
};
|
|
517
620
|
/** Organization */
|
|
518
621
|
OrganizationDto: {
|
|
@@ -612,10 +715,6 @@ export interface components {
|
|
|
612
715
|
*/
|
|
613
716
|
name: string;
|
|
614
717
|
};
|
|
615
|
-
/** List */
|
|
616
|
-
ListDto: {
|
|
617
|
-
data: unknown[];
|
|
618
|
-
};
|
|
619
718
|
/** Grant */
|
|
620
719
|
GrantDto: {
|
|
621
720
|
/**
|
|
@@ -700,7 +799,7 @@ export interface components {
|
|
|
700
799
|
* @description Internal auth id
|
|
701
800
|
* @example auth0|1234567890
|
|
702
801
|
*/
|
|
703
|
-
auth0Id
|
|
802
|
+
auth0Id?: string | null;
|
|
704
803
|
/**
|
|
705
804
|
* Format: email
|
|
706
805
|
* @description Email
|
|
@@ -805,7 +904,7 @@ export interface components {
|
|
|
805
904
|
* @description Internal auth id
|
|
806
905
|
* @example auth0|1234567890
|
|
807
906
|
*/
|
|
808
|
-
auth0Id
|
|
907
|
+
auth0Id?: string | null;
|
|
809
908
|
/**
|
|
810
909
|
* Format: email
|
|
811
910
|
* @description Email
|
|
@@ -844,7 +943,7 @@ export interface components {
|
|
|
844
943
|
* @description Auth0 ID
|
|
845
944
|
* @example auth0|1234567890
|
|
846
945
|
*/
|
|
847
|
-
auth0Id
|
|
946
|
+
auth0Id?: string;
|
|
848
947
|
/**
|
|
849
948
|
* Format: email
|
|
850
949
|
* @description Email
|
|
@@ -865,7 +964,7 @@ export interface components {
|
|
|
865
964
|
* @description Phone number
|
|
866
965
|
* @example +18048675309
|
|
867
966
|
*/
|
|
868
|
-
phoneNumber
|
|
967
|
+
phoneNumber?: string;
|
|
869
968
|
/** @example 66e25e72d10dfef2f9f6cc60 */
|
|
870
969
|
organizationId: string;
|
|
871
970
|
/** @default [] */
|
|
@@ -1256,7 +1355,7 @@ export interface components {
|
|
|
1256
1355
|
* @description Internal auth id
|
|
1257
1356
|
* @example auth0|1234567890
|
|
1258
1357
|
*/
|
|
1259
|
-
auth0Id
|
|
1358
|
+
auth0Id?: string | null;
|
|
1260
1359
|
/**
|
|
1261
1360
|
* Format: email
|
|
1262
1361
|
* @description Email
|
|
@@ -1385,6 +1484,15 @@ export interface operations {
|
|
|
1385
1484
|
"application/json": components["schemas"]["BadRequestErrorDto"];
|
|
1386
1485
|
};
|
|
1387
1486
|
};
|
|
1487
|
+
/** @description When OTP code is invalid or expired */
|
|
1488
|
+
401: {
|
|
1489
|
+
headers: {
|
|
1490
|
+
[name: string]: unknown;
|
|
1491
|
+
};
|
|
1492
|
+
content: {
|
|
1493
|
+
"application/json": components["schemas"]["UnauthorizedErrorDto"];
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1388
1496
|
/** @description When the user does not exist for the exchange token */
|
|
1389
1497
|
404: {
|
|
1390
1498
|
headers: {
|
|
@@ -1396,6 +1504,98 @@ export interface operations {
|
|
|
1396
1504
|
};
|
|
1397
1505
|
};
|
|
1398
1506
|
};
|
|
1507
|
+
AuthController_getOtpChannels: {
|
|
1508
|
+
parameters: {
|
|
1509
|
+
query: {
|
|
1510
|
+
/** @description Email address to look up available OTP channels */
|
|
1511
|
+
identifier: string;
|
|
1512
|
+
};
|
|
1513
|
+
header?: never;
|
|
1514
|
+
path?: never;
|
|
1515
|
+
cookie?: never;
|
|
1516
|
+
};
|
|
1517
|
+
requestBody?: never;
|
|
1518
|
+
responses: {
|
|
1519
|
+
200: {
|
|
1520
|
+
headers: {
|
|
1521
|
+
[name: string]: unknown;
|
|
1522
|
+
};
|
|
1523
|
+
content: {
|
|
1524
|
+
"application/json": {
|
|
1525
|
+
data: components["schemas"]["OtpChannelOptionDto"][];
|
|
1526
|
+
};
|
|
1527
|
+
};
|
|
1528
|
+
};
|
|
1529
|
+
/** @description When the identifier is invalid */
|
|
1530
|
+
400: {
|
|
1531
|
+
headers: {
|
|
1532
|
+
[name: string]: unknown;
|
|
1533
|
+
};
|
|
1534
|
+
content: {
|
|
1535
|
+
"application/json": components["schemas"]["BadRequestErrorDto"];
|
|
1536
|
+
};
|
|
1537
|
+
};
|
|
1538
|
+
/** @description When authentication fails */
|
|
1539
|
+
401: {
|
|
1540
|
+
headers: {
|
|
1541
|
+
[name: string]: unknown;
|
|
1542
|
+
};
|
|
1543
|
+
content: {
|
|
1544
|
+
"application/json": components["schemas"]["UnauthorizedErrorDto"];
|
|
1545
|
+
};
|
|
1546
|
+
};
|
|
1547
|
+
};
|
|
1548
|
+
};
|
|
1549
|
+
AuthController_requestOtpChallenge: {
|
|
1550
|
+
parameters: {
|
|
1551
|
+
query?: never;
|
|
1552
|
+
header?: never;
|
|
1553
|
+
path?: never;
|
|
1554
|
+
cookie?: never;
|
|
1555
|
+
};
|
|
1556
|
+
requestBody: {
|
|
1557
|
+
content: {
|
|
1558
|
+
"application/json": components["schemas"]["OtpChallengeInputDto"];
|
|
1559
|
+
};
|
|
1560
|
+
};
|
|
1561
|
+
responses: {
|
|
1562
|
+
200: {
|
|
1563
|
+
headers: {
|
|
1564
|
+
[name: string]: unknown;
|
|
1565
|
+
};
|
|
1566
|
+
content: {
|
|
1567
|
+
"application/json": components["schemas"]["OtpChallengeDto"];
|
|
1568
|
+
};
|
|
1569
|
+
};
|
|
1570
|
+
/** @description When the request is invalid or channel is unavailable */
|
|
1571
|
+
400: {
|
|
1572
|
+
headers: {
|
|
1573
|
+
[name: string]: unknown;
|
|
1574
|
+
};
|
|
1575
|
+
content: {
|
|
1576
|
+
"application/json": components["schemas"]["BadRequestErrorDto"];
|
|
1577
|
+
};
|
|
1578
|
+
};
|
|
1579
|
+
/** @description When authentication fails */
|
|
1580
|
+
401: {
|
|
1581
|
+
headers: {
|
|
1582
|
+
[name: string]: unknown;
|
|
1583
|
+
};
|
|
1584
|
+
content: {
|
|
1585
|
+
"application/json": components["schemas"]["UnauthorizedErrorDto"];
|
|
1586
|
+
};
|
|
1587
|
+
};
|
|
1588
|
+
/** @description When the user does not exist */
|
|
1589
|
+
404: {
|
|
1590
|
+
headers: {
|
|
1591
|
+
[name: string]: unknown;
|
|
1592
|
+
};
|
|
1593
|
+
content: {
|
|
1594
|
+
"application/json": components["schemas"]["NotFoundErrorDto"];
|
|
1595
|
+
};
|
|
1596
|
+
};
|
|
1597
|
+
};
|
|
1598
|
+
};
|
|
1399
1599
|
OrganizationsController_getOrganization: {
|
|
1400
1600
|
parameters: {
|
|
1401
1601
|
query?: never;
|
package/dist/client.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export declare class UsersApiClient extends BaseSdkClient<paths> {
|
|
|
30
30
|
getAuthToken({ code, skipUserVerification }: GetAuthTokenInput, opts?: RequestOptions): Promise<GetTokenResult>;
|
|
31
31
|
refreshToken({ refreshToken }: RefreshTokenInput, opts?: RequestOptions): Promise<GetTokenResult>;
|
|
32
32
|
private getToken;
|
|
33
|
+
getOtpChannels(input: GetOtpChannelsInput, opts?: RequestOptions): Promise<GetOtpChannelsResult>;
|
|
34
|
+
requestOtpChallenge(input: RequestOtpChallengeInput, opts?: RequestOptions): Promise<RequestOtpChallengeResult>;
|
|
33
35
|
getServices(_input: GetServicesInput, opts?: RequestOptions): Promise<GetServicesResult>;
|
|
34
36
|
createService(input: CreateServiceInput, opts?: RequestOptions): Promise<CreateServiceResult>;
|
|
35
37
|
getService(input: GetServiceInput, opts?: RequestOptions): Promise<GetServiceResult>;
|
|
@@ -144,3 +146,9 @@ export interface GetTokenResponse {
|
|
|
144
146
|
expiresIn: number;
|
|
145
147
|
}
|
|
146
148
|
export type GetTokenResult = ResultOk<GetTokenResponse> | SdkError<ApiError<paths["/api/auth/token"]["post"]["responses"]>>;
|
|
149
|
+
export type GetOtpChannelsInput = ApiInput<paths["/api/auth/otp-channels"]["get"]>;
|
|
150
|
+
export type GetOtpChannelsResult = SdkResult<paths["/api/auth/otp-channels"]["get"]>;
|
|
151
|
+
export type GetOtpChannelsResponse = ExtractResultData<GetOtpChannelsResult>;
|
|
152
|
+
export type RequestOtpChallengeInput = ApiInput<paths["/api/auth/otp-challenge"]["post"]>;
|
|
153
|
+
export type RequestOtpChallengeResult = SdkResult<paths["/api/auth/otp-challenge"]["post"]>;
|
|
154
|
+
export type RequestOtpChallengeResponse = ExtractResultData<RequestOtpChallengeResult>;
|
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/1.7.
|
|
26
|
+
const SDK_VERSION_SLUG = "palmetto-users-sdk/1.7.2";
|
|
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 }));
|
|
@@ -366,6 +366,30 @@ class UsersApiClient extends base_sdk_client_1.BaseSdkClient {
|
|
|
366
366
|
return this.handleErrorResponse(error, response);
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
+
getOtpChannels(input, opts) {
|
|
370
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
371
|
+
const { data, error, response } = yield this.client.GET("/api/auth/otp-channels", {
|
|
372
|
+
params: { query: input },
|
|
373
|
+
headers: this.generateHeaders(opts),
|
|
374
|
+
});
|
|
375
|
+
if (data) {
|
|
376
|
+
return (0, result_1.Ok)(data);
|
|
377
|
+
}
|
|
378
|
+
return this.handleErrorResponse(error, response);
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
requestOtpChallenge(input, opts) {
|
|
382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
383
|
+
const { data, error, response } = yield this.client.POST("/api/auth/otp-challenge", {
|
|
384
|
+
body: input,
|
|
385
|
+
headers: this.generateHeaders(opts),
|
|
386
|
+
});
|
|
387
|
+
if (data) {
|
|
388
|
+
return (0, result_1.Ok)(data);
|
|
389
|
+
}
|
|
390
|
+
return this.handleErrorResponse(error, response);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
369
393
|
getServices(_input, opts) {
|
|
370
394
|
return __awaiter(this, void 0, void 0, function* () {
|
|
371
395
|
const { data, error, response } = yield this.client.GET("/api/services", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@palmetto/users-sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"main": "./dist/main.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*",
|
|
@@ -44,5 +44,9 @@
|
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/palmetto/users"
|
|
47
51
|
}
|
|
48
52
|
}
|