@fonoster/identity 0.7.28 → 0.7.29
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/service.d.ts +3 -6
- package/dist/service.js +10 -4
- package/package.json +5 -5
package/dist/service.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IdentityConfig } from "./exchanges/types";
|
|
2
|
+
import { createSendVerificationCode, createVerifyCode } from "./verification";
|
|
2
3
|
declare const serviceDefinitionParams: {
|
|
3
4
|
serviceName: string;
|
|
4
5
|
pckg: string;
|
|
@@ -76,12 +77,8 @@ declare function buildIdentityService(identityConfig: IdentityConfig): {
|
|
|
76
77
|
getPublicKey: (_: unknown, callback: (error: import("@fonoster/common").GrpcErrorMessage, response?: {
|
|
77
78
|
publicKey: string;
|
|
78
79
|
}) => void) => Promise<void>;
|
|
79
|
-
sendVerificationCode:
|
|
80
|
-
|
|
81
|
-
}, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
82
|
-
verifyCode: (call: {
|
|
83
|
-
request: unknown;
|
|
84
|
-
}, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
80
|
+
sendVerificationCode: ReturnType<typeof createSendVerificationCode>;
|
|
81
|
+
verifyCode: ReturnType<typeof createVerifyCode>;
|
|
85
82
|
};
|
|
86
83
|
};
|
|
87
84
|
export { buildIdentityService, serviceDefinitionParams };
|
package/dist/service.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.buildIdentityService = buildIdentityService;
|
|
|
21
21
|
* limitations under the License.
|
|
22
22
|
*/
|
|
23
23
|
const db_1 = require("./db");
|
|
24
|
+
const envs_1 = require("./envs");
|
|
24
25
|
const exchangeOauth2Code_1 = require("./exchanges/exchangeOauth2Code");
|
|
25
26
|
const getPublicKey_1 = require("./getPublicKey");
|
|
26
27
|
const verification_1 = require("./verification");
|
|
@@ -33,7 +34,7 @@ const serviceDefinitionParams = {
|
|
|
33
34
|
};
|
|
34
35
|
exports.serviceDefinitionParams = serviceDefinitionParams;
|
|
35
36
|
function buildIdentityService(identityConfig) {
|
|
36
|
-
|
|
37
|
+
const service = {
|
|
37
38
|
definition: serviceDefinitionParams,
|
|
38
39
|
handlers: {
|
|
39
40
|
// Workspace operations
|
|
@@ -61,9 +62,14 @@ function buildIdentityService(identityConfig) {
|
|
|
61
62
|
exchangeOauth2Code: (0, exchangeOauth2Code_1.exchangeOauth2Code)(db_1.prisma, identityConfig),
|
|
62
63
|
exchangeRefreshToken: (0, _1.exchangeRefreshToken)(db_1.prisma, identityConfig),
|
|
63
64
|
getPublicKey: (0, getPublicKey_1.getPublicKey)(identityConfig.publicKey),
|
|
64
|
-
//
|
|
65
|
-
sendVerificationCode:
|
|
66
|
-
verifyCode:
|
|
65
|
+
// Placeholders for conditional handlers
|
|
66
|
+
sendVerificationCode: undefined,
|
|
67
|
+
verifyCode: undefined
|
|
67
68
|
}
|
|
68
69
|
};
|
|
70
|
+
if (envs_1.IDENTITY_USER_VERIFICATION_REQUIRED) {
|
|
71
|
+
service.handlers.sendVerificationCode = (0, verification_1.createSendVerificationCode)(db_1.prisma, identityConfig);
|
|
72
|
+
service.handlers.verifyCode = (0, verification_1.createVerifyCode)(db_1.prisma);
|
|
73
|
+
}
|
|
74
|
+
return service;
|
|
69
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/identity",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.29",
|
|
4
4
|
"description": "Identity service for Fonoster",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"fonoster": "./dist/index.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@fonoster/common": "^0.7.
|
|
24
|
-
"@fonoster/logger": "^0.7.
|
|
25
|
-
"@fonoster/types": "^0.7.
|
|
23
|
+
"@fonoster/common": "^0.7.29",
|
|
24
|
+
"@fonoster/logger": "^0.7.29",
|
|
25
|
+
"@fonoster/types": "^0.7.29",
|
|
26
26
|
"@grpc/grpc-js": "~1.10.6",
|
|
27
27
|
"@prisma/client": "^5.14.0",
|
|
28
28
|
"jsonwebtoken": "^9.0.2",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/jsonwebtoken": "^9.0.6"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "9e147ecc7a4a96641dac70e1ce39af4bae40f396"
|
|
52
52
|
}
|