@axinom/mosaic-user-auth 0.4.1 → 0.4.2-rc.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/UserServiceClient/UserServiceClient.d.ts +18 -18
- package/dist/UserServiceClient/UserServiceClient.d.ts.map +1 -1
- package/dist/common/types.d.ts +3 -3
- package/dist/common/types.d.ts.map +1 -1
- package/dist/generated/ax-auth-management-graphql.types.d.ts +90 -90
- package/dist/generated/ax-auth-management-graphql.types.d.ts.map +1 -1
- package/dist/generated/{user-service-consumer-graphql.types.d.ts → user-service-end-user-graphql.types.d.ts} +1 -1
- package/dist/generated/{user-service-consumer-graphql.types.d.ts.map → user-service-end-user-graphql.types.d.ts.map} +1 -1
- package/dist/generated/user-service-management-graphql.types.d.ts +40 -40
- package/dist/generated/user-service-management-graphql.types.d.ts.map +1 -1
- package/dist/index.es.js +37 -37
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +37 -37
- package/dist/index.js.map +1 -1
- package/dist/util/endUserApplication.d.ts +11 -0
- package/dist/util/endUserApplication.d.ts.map +1 -0
- package/dist/util/endUserApplication.spec.d.ts +2 -0
- package/dist/util/endUserApplication.spec.d.ts.map +1 -0
- package/dist/util/userAuth.d.ts +6 -6
- package/dist/util/userAuth.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/util/consumerApplication.d.ts +0 -11
- package/dist/util/consumerApplication.d.ts.map +0 -1
- package/dist/util/consumerApplication.spec.d.ts +0 -2
- package/dist/util/consumerApplication.spec.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1465,21 +1465,21 @@ var UsersOrderBy;
|
|
|
1465
1465
|
UsersOrderBy["UPDATED_USER_ASC"] = "UPDATED_USER_ASC";
|
|
1466
1466
|
UsersOrderBy["UPDATED_USER_DESC"] = "UPDATED_USER_DESC";
|
|
1467
1467
|
})(UsersOrderBy || (UsersOrderBy = {}));
|
|
1468
|
-
const
|
|
1468
|
+
const AuthenticateEndUserApplicationDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "AuthenticateEndUserApplication" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "AuthenticateEndUserApplicationInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "authenticateEndUserApplication" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "accessToken" }, "arguments": [], "directives": [] }, { "kind": "Field", "name": { "kind": "Name", "value": "expiresInSeconds" }, "arguments": [], "directives": [] }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenType" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1469
1469
|
const DecryptNativeCookieDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DecryptNativeCookie" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "DecryptWithKeyAesInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "decryptWithKeyAes" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "decryptedValue" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1470
1470
|
|
|
1471
1471
|
/**
|
|
1472
|
-
* Authenticate
|
|
1472
|
+
* Authenticate an End-User Application and receive a token.
|
|
1473
1473
|
*
|
|
1474
|
-
* @param
|
|
1474
|
+
* @param authenticateEndUserApplicationInput An object containing the required info for End-User Application authentication.
|
|
1475
1475
|
* @param userServiceManagementBaseUrl Base URL of AX_AUTH management GQL schema.
|
|
1476
|
-
* @returns
|
|
1476
|
+
* @returns AuthenticateEndUserApplicationResponse
|
|
1477
1477
|
*/
|
|
1478
|
-
const
|
|
1478
|
+
const authenticateEndUserApplication = (authenticateEndUserApplicationInput, userServiceManagementBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1479
1479
|
const variables = {
|
|
1480
|
-
input: Object.assign({},
|
|
1480
|
+
input: Object.assign({}, authenticateEndUserApplicationInput),
|
|
1481
1481
|
};
|
|
1482
|
-
const
|
|
1482
|
+
const authenticateEndUserApplicationResponse = yield (yield fetch(`${userServiceManagementBaseUrl}/graphql-management`, {
|
|
1483
1483
|
method: 'POST',
|
|
1484
1484
|
cache: 'no-cache',
|
|
1485
1485
|
redirect: 'follow',
|
|
@@ -1487,23 +1487,23 @@ const authenticateConsumerApplication = (authenticateConsumerApplicationInput, u
|
|
|
1487
1487
|
headers: {
|
|
1488
1488
|
'content-type': 'application/json',
|
|
1489
1489
|
},
|
|
1490
|
-
body: stringifyGqlQuery(
|
|
1490
|
+
body: stringifyGqlQuery(AuthenticateEndUserApplicationDocument, variables),
|
|
1491
1491
|
})).json();
|
|
1492
|
-
if (
|
|
1492
|
+
if (authenticateEndUserApplicationResponse.errors !== undefined) {
|
|
1493
1493
|
return {
|
|
1494
1494
|
code: 'ERROR',
|
|
1495
|
-
message:
|
|
1495
|
+
message: authenticateEndUserApplicationResponse.errors[0].message,
|
|
1496
1496
|
};
|
|
1497
1497
|
}
|
|
1498
1498
|
return {
|
|
1499
1499
|
code: 'SUCCESS',
|
|
1500
|
-
|
|
1501
|
-
accessToken:
|
|
1502
|
-
.
|
|
1503
|
-
expiresInSeconds:
|
|
1504
|
-
.
|
|
1505
|
-
tokenType:
|
|
1506
|
-
.
|
|
1500
|
+
endUserApplicationToken: {
|
|
1501
|
+
accessToken: authenticateEndUserApplicationResponse.data
|
|
1502
|
+
.authenticateEndUserApplication.accessToken,
|
|
1503
|
+
expiresInSeconds: authenticateEndUserApplicationResponse.data
|
|
1504
|
+
.authenticateEndUserApplication.expiresInSeconds,
|
|
1505
|
+
tokenType: authenticateEndUserApplicationResponse.data
|
|
1506
|
+
.authenticateEndUserApplication.tokenType,
|
|
1507
1507
|
},
|
|
1508
1508
|
};
|
|
1509
1509
|
});
|
|
@@ -1625,17 +1625,17 @@ var UserStatus;
|
|
|
1625
1625
|
})(UserStatus || (UserStatus = {}));
|
|
1626
1626
|
var UserStoreCategory;
|
|
1627
1627
|
(function (UserStoreCategory) {
|
|
1628
|
-
/**
|
|
1629
|
-
UserStoreCategory["
|
|
1628
|
+
/** End User */
|
|
1629
|
+
UserStoreCategory["END_USER"] = "END_USER";
|
|
1630
1630
|
/** Management */
|
|
1631
1631
|
UserStoreCategory["MANAGEMENT"] = "MANAGEMENT";
|
|
1632
1632
|
})(UserStoreCategory || (UserStoreCategory = {}));
|
|
1633
|
-
const
|
|
1634
|
-
const
|
|
1635
|
-
const
|
|
1636
|
-
const
|
|
1637
|
-
const CheckPasswordResetOtpDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CheckPasswordResetOtp" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "
|
|
1638
|
-
const
|
|
1633
|
+
const InitiateEndUserSignUpDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "InitiateEndUserSignUp" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "InitiateEndUserSignUpInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "initiateEndUserSignUp" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "idpUserId" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1634
|
+
const CheckEndUserSignUpOtpDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CheckEndUserSignUpOtp" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CheckEndUserSignUpOtpInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "checkEndUserSignUpOtp" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "isOtpValid" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1635
|
+
const CompleteEndUserSignUpDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CompleteEndUserSignUp" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CompleteEndUserSignUpInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "completeEndUserSignUp" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "idpUserId" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1636
|
+
const InitiateEndUserPasswordResetDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "InitiateEndUserPasswordReset" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "InitiateEndUserPasswordResetInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "initiateEndUserPasswordReset" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "idpUserId" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1637
|
+
const CheckPasswordResetOtpDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CheckPasswordResetOtp" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CheckEndUserPasswordResetOtpInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "checkEndUserPasswordResetOtp" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "isOtpValid" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1638
|
+
const CompleteEndUserPasswordResetDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CompleteEndUserPasswordReset" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CompleteEndUserPasswordResetInput" } } }, "directives": [] }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "completeEndUserPasswordReset" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "input" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } } }], "directives": [], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "idpUserId" }, "arguments": [], "directives": [] }] } }] } }] };
|
|
1639
1639
|
|
|
1640
1640
|
function invokeUserAuthMethod(method, userAuthConfig, isRootLevel = false) {
|
|
1641
1641
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1702,7 +1702,7 @@ const initiateUserSignUp = (userSignUpRequest, axAuthManagementEndpoint) => __aw
|
|
|
1702
1702
|
headers: {
|
|
1703
1703
|
'content-type': 'application/json',
|
|
1704
1704
|
},
|
|
1705
|
-
body: stringifyGqlQuery(
|
|
1705
|
+
body: stringifyGqlQuery(InitiateEndUserSignUpDocument, variables),
|
|
1706
1706
|
})).json();
|
|
1707
1707
|
if (userSignUpResponse.errors !== undefined) {
|
|
1708
1708
|
return {
|
|
@@ -1734,7 +1734,7 @@ const checkUserSignUpOtp = (checkUserSignUpOtpRequest, axAuthManagementEndpoint)
|
|
|
1734
1734
|
headers: {
|
|
1735
1735
|
'content-type': 'application/json',
|
|
1736
1736
|
},
|
|
1737
|
-
body: stringifyGqlQuery(
|
|
1737
|
+
body: stringifyGqlQuery(CheckEndUserSignUpOtpDocument, variables),
|
|
1738
1738
|
})).json();
|
|
1739
1739
|
if (checkSignUpOtpResponse.errors !== undefined) {
|
|
1740
1740
|
return {
|
|
@@ -1744,7 +1744,7 @@ const checkUserSignUpOtp = (checkUserSignUpOtpRequest, axAuthManagementEndpoint)
|
|
|
1744
1744
|
}
|
|
1745
1745
|
return {
|
|
1746
1746
|
code: dist.CheckOtpResponseCode.SUCCESS,
|
|
1747
|
-
isOtpValid: checkSignUpOtpResponse.data.
|
|
1747
|
+
isOtpValid: checkSignUpOtpResponse.data.checkEndUserSignUpOtp.isOtpValid,
|
|
1748
1748
|
};
|
|
1749
1749
|
});
|
|
1750
1750
|
/**
|
|
@@ -1767,7 +1767,7 @@ const completeUserSignUp = (completeUserSignUpRequest, axAuthManagementEndpoint)
|
|
|
1767
1767
|
headers: {
|
|
1768
1768
|
'content-type': 'application/json',
|
|
1769
1769
|
},
|
|
1770
|
-
body: stringifyGqlQuery(
|
|
1770
|
+
body: stringifyGqlQuery(CompleteEndUserSignUpDocument, variables),
|
|
1771
1771
|
})).json();
|
|
1772
1772
|
if (completeUserSignUpResponse.errors !== undefined) {
|
|
1773
1773
|
return {
|
|
@@ -1802,7 +1802,7 @@ const initiatePasswordReset = (email, axAuthClientId, axAuthManagementEndpoint)
|
|
|
1802
1802
|
headers: {
|
|
1803
1803
|
'content-type': 'application/json',
|
|
1804
1804
|
},
|
|
1805
|
-
body: stringifyGqlQuery(
|
|
1805
|
+
body: stringifyGqlQuery(InitiateEndUserPasswordResetDocument, variables),
|
|
1806
1806
|
})).json();
|
|
1807
1807
|
if (initiateResetPasswordResponse.errors !== undefined) {
|
|
1808
1808
|
return {
|
|
@@ -1844,7 +1844,7 @@ const checkPasswordResetOtp = (checkPasswordResetOtpRequest, axAuthManagementEnd
|
|
|
1844
1844
|
}
|
|
1845
1845
|
return {
|
|
1846
1846
|
code: dist.CheckOtpResponseCode.SUCCESS,
|
|
1847
|
-
isOtpValid: checkPasswordResetOtpResponse.data.
|
|
1847
|
+
isOtpValid: checkPasswordResetOtpResponse.data.checkEndUserPasswordResetOtp
|
|
1848
1848
|
.isOtpValid,
|
|
1849
1849
|
};
|
|
1850
1850
|
});
|
|
@@ -1868,7 +1868,7 @@ const completePasswordReset = (completePasswordResetRequest, axAuthManagementEnd
|
|
|
1868
1868
|
headers: {
|
|
1869
1869
|
'content-type': 'application/json',
|
|
1870
1870
|
},
|
|
1871
|
-
body: stringifyGqlQuery(
|
|
1871
|
+
body: stringifyGqlQuery(CompleteEndUserPasswordResetDocument, variables),
|
|
1872
1872
|
})).json();
|
|
1873
1873
|
if (completePasswordResetResponse.errors !== undefined) {
|
|
1874
1874
|
return {
|
|
@@ -2658,12 +2658,12 @@ class UserServiceClient {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
});
|
|
2660
2660
|
/**
|
|
2661
|
-
* Authenticate
|
|
2662
|
-
* @param
|
|
2663
|
-
* @returns
|
|
2661
|
+
* Authenticate an end-user application and receive an Application Token
|
|
2662
|
+
* @param authenticateEndUserApplicationRequest an object containing the tenantId/environmentId/applicationId/applicationKey info.
|
|
2663
|
+
* @returns AuthenticateEndUserApplicationResponse
|
|
2664
2664
|
*/
|
|
2665
|
-
this.
|
|
2666
|
-
return
|
|
2665
|
+
this.authenticateEndUserApplication = (authenticateEndUserApplicationRequest) => __awaiter(this, void 0, void 0, function* () {
|
|
2666
|
+
return authenticateEndUserApplication(authenticateEndUserApplicationRequest, this.userServiceConfig.userServiceBaseUrl);
|
|
2667
2667
|
});
|
|
2668
2668
|
/**
|
|
2669
2669
|
* Decrypt an User Token Cookie used in Native Apps.
|