@fonoster/identity 0.9.20 → 0.9.22
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/apikeys/createCreateApiKey.d.ts +18 -0
- package/dist/apikeys/createCreateApiKey.js +1 -1
- package/dist/apikeys/createDeleteApiKey.d.ts +18 -0
- package/dist/apikeys/createDeleteApiKey.js +1 -1
- package/dist/apikeys/createListApiKeys.d.ts +18 -0
- package/dist/apikeys/createListApiKeys.js +1 -1
- package/dist/apikeys/createRegenerateApiKey.d.ts +18 -0
- package/dist/apikeys/createRegenerateApiKey.js +1 -1
- package/dist/apikeys/index.d.ts +18 -0
- package/dist/apikeys/index.js +1 -1
- package/dist/constants.d.ts +18 -0
- package/dist/constants.js +1 -1
- package/dist/db.js +2 -2
- package/dist/exchanges/createExchangeApiKey.d.ts +19 -1
- package/dist/exchanges/createExchangeApiKey.js +2 -2
- package/dist/exchanges/createExchangeCredentials.d.ts +19 -1
- package/dist/exchanges/createExchangeCredentials.js +3 -3
- package/dist/exchanges/createExchangeOauth2Code.d.ts +19 -1
- package/dist/exchanges/createExchangeOauth2Code.js +2 -2
- package/dist/exchanges/createExchangeRefreshToken.d.ts +19 -1
- package/dist/exchanges/createExchangeRefreshToken.js +2 -2
- package/dist/exchanges/exchangeTokens.d.ts +1 -1
- package/dist/exchanges/exchangeTokens.js +1 -1
- package/dist/exchanges/index.d.ts +18 -0
- package/dist/exchanges/index.js +1 -1
- package/dist/exchanges/payloads/apikeys/createGetAccessTokenPayload.d.ts +19 -1
- package/dist/exchanges/payloads/apikeys/createGetAccessTokenPayload.js +18 -0
- package/dist/exchanges/payloads/apikeys/createGetRefreshTokenPayload.d.ts +19 -1
- package/dist/exchanges/payloads/apikeys/index.d.ts +18 -0
- package/dist/exchanges/payloads/apikeys/index.js +1 -1
- package/dist/exchanges/payloads/buildRefreshTokenPayload.d.ts +18 -0
- package/dist/exchanges/payloads/buildRefreshTokenPayload.js +1 -1
- package/dist/exchanges/payloads/users/createGetAccessTokenPayload.d.ts +19 -1
- package/dist/exchanges/payloads/users/createGetAccessTokenPayload.js +2 -2
- package/dist/exchanges/payloads/users/createGetIdTokenPayload.d.ts +19 -1
- package/dist/exchanges/payloads/users/createGetIdTokenPayload.js +18 -0
- package/dist/exchanges/payloads/users/createGetRefreshTokenPayload.d.ts +19 -1
- package/dist/exchanges/payloads/users/createGetRefreshTokenPayload.js +18 -0
- package/dist/exchanges/payloads/users/index.d.ts +18 -0
- package/dist/exchanges/payloads/users/index.js +1 -1
- package/dist/exchanges/types.d.ts +18 -0
- package/dist/getPublicKey.d.ts +18 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +1 -2
- package/dist/invites/createInviteBody.js +1 -1
- package/dist/invites/index.d.ts +18 -0
- package/dist/invites/index.js +1 -1
- package/dist/invites/sendInvite.d.ts +18 -0
- package/dist/invites/types.d.ts +18 -0
- package/dist/service.js +1 -1
- package/dist/templates/TemplatesEnum.d.ts +18 -0
- package/dist/templates/TemplatesEnum.js +1 -1
- package/dist/users/createCreateUser.d.ts +18 -0
- package/dist/users/createCreateUser.js +1 -1
- package/dist/users/createCreateUserWithOauth2Code.d.ts +18 -0
- package/dist/users/createCreateUserWithOauth2Code.js +4 -4
- package/dist/users/createDeleteUser.d.ts +18 -0
- package/dist/users/createDeleteUser.js +1 -1
- package/dist/users/createGetUser.d.ts +18 -0
- package/dist/users/createGetUser.js +1 -1
- package/dist/users/createResetPassword.d.ts +18 -0
- package/dist/users/createResetPassword.js +2 -2
- package/dist/users/createResetPasswordBody.js +1 -1
- package/dist/users/createSendResetPasswordCode.d.ts +18 -0
- package/dist/users/createSendResetPasswordCode.js +10 -2
- package/dist/users/createUpdateUser.d.ts +18 -0
- package/dist/users/createUpdateUser.js +1 -1
- package/dist/users/index.d.ts +18 -0
- package/dist/users/index.js +1 -1
- package/dist/users/sendResetPasswordEmail.d.ts +18 -0
- package/dist/users/types.d.ts +18 -0
- package/dist/users/upsertDefaultUser.js +1 -1
- package/dist/utils/createGenerateCallAccessToken.js +2 -2
- package/dist/utils/createGenerateVerificationCode.d.ts +1 -1
- package/dist/utils/createGenerateVerificationCode.js +18 -0
- package/dist/utils/createGenerateWorkspaceInviteToken.js +1 -1
- package/dist/utils/createGetAccessKeyIdFromEmail.d.ts +18 -0
- package/dist/utils/createGetAccessKeyIdFromEmail.js +0 -18
- package/dist/utils/createGetApiKeyByAccessKeyId.d.ts +18 -0
- package/dist/utils/createGetUserByAccessKeyId.d.ts +18 -0
- package/dist/utils/createGetUserByEmail.d.ts +18 -0
- package/dist/utils/createGetUserByWorkspaceAccessKeyId.d.ts +18 -0
- package/dist/utils/createIsUserContactVerified.d.ts +18 -0
- package/dist/utils/createIsValidVerificationCode.d.ts +1 -1
- package/dist/utils/createIsValidVerificationCode.js +18 -0
- package/dist/utils/createSendEmail.js +1 -1
- package/dist/utils/createUpdateMembershipStatus.js +2 -2
- package/dist/utils/generateAccessKeyId.js +1 -1
- package/dist/utils/generateAccessKeySecret.js +1 -1
- package/dist/utils/getAccessKeyIdFromToken.js +1 -1
- package/dist/utils/getGitHubUserWithOauth2Code.js +1 -1
- package/dist/utils/getUserRefFromToken.js +1 -1
- package/dist/utils/hasAccessToResource.js +2 -2
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/withAccess.d.ts +18 -0
- package/dist/verification/createBodyForVerificationEmail.js +1 -1
- package/dist/verification/createBodyForVerificationMessage.js +1 -1
- package/dist/verification/createSendVerificationCode.d.ts +18 -0
- package/dist/verification/createSendVerificationCode.js +2 -2
- package/dist/verification/createVerifyCode.d.ts +18 -0
- package/dist/verification/createVerifyCode.js +1 -1
- package/dist/verification/index.d.ts +18 -0
- package/dist/verification/index.js +1 -1
- package/dist/verification/sendVerificationEmail.d.ts +18 -0
- package/dist/verification/sendVerificationMessage.d.ts +18 -0
- package/dist/verification/types.d.ts +18 -0
- package/dist/workspaces/createCreateWorkspace.d.ts +18 -0
- package/dist/workspaces/createCreateWorkspace.js +1 -1
- package/dist/workspaces/createDeleteWorkspace.d.ts +18 -0
- package/dist/workspaces/createDeleteWorkspace.js +1 -1
- package/dist/workspaces/createGetWorkspace.d.ts +18 -0
- package/dist/workspaces/createGetWorkspace.js +1 -1
- package/dist/workspaces/createInviteUserToWorkspace.d.ts +18 -0
- package/dist/workspaces/createInviteUserToWorkspace.js +3 -3
- package/dist/workspaces/createIsAdminMember.js +1 -1
- package/dist/workspaces/createIsWorkspaceMember.d.ts +18 -0
- package/dist/workspaces/createListWorkspaceMembers.d.ts +18 -0
- package/dist/workspaces/createListWorkspaceMembers.js +1 -1
- package/dist/workspaces/createListWorkspaces.d.ts +18 -0
- package/dist/workspaces/createListWorkspaces.js +1 -1
- package/dist/workspaces/createRemoveUserFromWorkspace.d.ts +18 -0
- package/dist/workspaces/createRemoveUserFromWorkspace.js +2 -2
- package/dist/workspaces/createResendWorkspaceMembershipInvitation.d.ts +18 -0
- package/dist/workspaces/createResendWorkspaceMembershipInvitation.js +2 -2
- package/dist/workspaces/createUpdateWorkspace.d.ts +18 -0
- package/dist/workspaces/createUpdateWorkspace.js +2 -2
- package/dist/workspaces/index.d.ts +18 -0
- package/dist/workspaces/index.js +1 -1
- package/package.json +5 -5
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
20
|
import { CreateApiKeyRequest, CreateApiKeyResponse } from "@fonoster/types";
|
|
3
21
|
import { Prisma } from "../db";
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createCreateApiKey = createCreateApiKey;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
14
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
15
|
* http://github.com/fonoster/fonoster
|
|
16
16
|
*
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
20
|
import { Prisma } from "../db";
|
|
3
21
|
declare function createDeleteApiKey(prisma: Prisma): (call: {
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createDeleteApiKey = createDeleteApiKey;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
14
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
15
|
* http://github.com/fonoster/fonoster
|
|
16
16
|
*
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
20
|
import { Prisma } from "../db";
|
|
3
21
|
declare function createListApiKeys(prisma: Prisma): (call: {
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createListApiKeys = createListApiKeys;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
14
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
15
|
* http://github.com/fonoster/fonoster
|
|
16
16
|
*
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
20
|
import { Prisma } from "../db";
|
|
3
21
|
declare function createRegenerateApiKey(prisma: Prisma): (call: {
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createRegenerateApiKey = createRegenerateApiKey;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
14
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
15
|
* http://github.com/fonoster/fonoster
|
|
16
16
|
*
|
package/dist/apikeys/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
export * from "./createCreateApiKey";
|
|
2
20
|
export * from "./createDeleteApiKey";
|
|
3
21
|
export * from "./createListApiKeys";
|
package/dist/apikeys/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster/fonoster
|
|
20
20
|
*
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
export declare const SIGN_ALGORITHM = "RS256";
|
|
2
20
|
export declare const VERIFICATION_CODE_EXPIRATION: number;
|
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERIFICATION_CODE_EXPIRATION = exports.SIGN_ALGORITHM = void 0;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
5
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
7
7
|
*
|
package/dist/db.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPrismaClient = void 0;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
5
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
7
7
|
*
|
|
@@ -19,8 +19,8 @@ exports.createPrismaClient = void 0;
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
const client_1 = require("./generated/@prisma/client");
|
|
23
22
|
const prisma_field_encryption_1 = require("prisma-field-encryption");
|
|
23
|
+
const client_1 = require("./generated/@prisma/client");
|
|
24
24
|
const createPrismaClient = (dbUrl, cloakEncryptionKey) => {
|
|
25
25
|
return new client_1.PrismaClient({
|
|
26
26
|
datasources: { db: { url: dbUrl } }
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
|
-
import { IdentityConfig } from "./types";
|
|
3
20
|
import { Prisma } from "../db";
|
|
21
|
+
import { IdentityConfig } from "./types";
|
|
4
22
|
declare function createExchangeApiKey(prisma: Prisma, identityConfig: IdentityConfig): (call: {
|
|
5
23
|
request: unknown;
|
|
6
24
|
}, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.createExchangeApiKey = createExchangeApiKey;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
47
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
48
48
|
* http://github.com/fonoster/fonoster
|
|
49
49
|
*
|
|
@@ -64,8 +64,8 @@ exports.createExchangeApiKey = createExchangeApiKey;
|
|
|
64
64
|
const common_1 = require("@fonoster/common");
|
|
65
65
|
const logger_1 = require("@fonoster/logger");
|
|
66
66
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
67
|
-
const exchangeTokens_1 = require("./exchangeTokens");
|
|
68
67
|
const createGetApiKeyByAccessKeyId_1 = require("../utils/createGetApiKeyByAccessKeyId");
|
|
68
|
+
const exchangeTokens_1 = require("./exchangeTokens");
|
|
69
69
|
const logger = (0, logger_1.getLogger)({ service: "identity", filePath: __filename });
|
|
70
70
|
function createExchangeApiKey(prisma, identityConfig) {
|
|
71
71
|
const exchangeApiKey = (call, callback) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
|
-
import { IdentityConfig } from "./types";
|
|
3
20
|
import { Prisma } from "../db";
|
|
21
|
+
import { IdentityConfig } from "./types";
|
|
4
22
|
declare function createExchangeCredentials(prisma: Prisma, identityConfig: IdentityConfig): (call: {
|
|
5
23
|
request: unknown;
|
|
6
24
|
}, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.createExchangeCredentials = createExchangeCredentials;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
47
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
48
48
|
* http://github.com/fonoster/fonoster
|
|
49
49
|
*
|
|
@@ -64,10 +64,10 @@ exports.createExchangeCredentials = createExchangeCredentials;
|
|
|
64
64
|
const common_1 = require("@fonoster/common");
|
|
65
65
|
const logger_1 = require("@fonoster/logger");
|
|
66
66
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
67
|
-
const exchangeTokens_1 = require("./exchangeTokens");
|
|
68
|
-
const createIsValidVerificationCode_1 = require("../utils/createIsValidVerificationCode");
|
|
69
67
|
const createGetUserByEmail_1 = require("../utils/createGetUserByEmail");
|
|
68
|
+
const createIsValidVerificationCode_1 = require("../utils/createIsValidVerificationCode");
|
|
70
69
|
const verification_1 = require("../verification");
|
|
70
|
+
const exchangeTokens_1 = require("./exchangeTokens");
|
|
71
71
|
const logger = (0, logger_1.getLogger)({ service: "identity", filePath: __filename });
|
|
72
72
|
const verificationRequiredButNotProvided = (identityConfig, user) => identityConfig.userVerificationRequired &&
|
|
73
73
|
(!user.emailVerified || !user.phoneNumberVerified);
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
|
-
import { IdentityConfig } from "./types";
|
|
3
20
|
import { Prisma } from "../db";
|
|
21
|
+
import { IdentityConfig } from "./types";
|
|
4
22
|
declare function createExchangeOauth2Code(prisma: Prisma, identityConfig: IdentityConfig): (call: {
|
|
5
23
|
request: unknown;
|
|
6
24
|
}, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.createExchangeOauth2Code = createExchangeOauth2Code;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
47
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
48
48
|
* http://github.com/fonoster/fonoster
|
|
49
49
|
*
|
|
@@ -64,9 +64,9 @@ exports.createExchangeOauth2Code = createExchangeOauth2Code;
|
|
|
64
64
|
const common_1 = require("@fonoster/common");
|
|
65
65
|
const logger_1 = require("@fonoster/logger");
|
|
66
66
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
67
|
-
const exchangeTokens_1 = require("./exchangeTokens");
|
|
68
67
|
const createGetUserByEmail_1 = require("../utils/createGetUserByEmail");
|
|
69
68
|
const getGitHubUserWithOauth2Code_1 = require("../utils/getGitHubUserWithOauth2Code");
|
|
69
|
+
const exchangeTokens_1 = require("./exchangeTokens");
|
|
70
70
|
const logger = (0, logger_1.getLogger)({ service: "identity", filePath: __filename });
|
|
71
71
|
function createExchangeOauth2Code(prisma, identityConfig) {
|
|
72
72
|
const exchangeOauth2Code = (call, callback) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { GrpcErrorMessage } from "@fonoster/common";
|
|
2
|
-
import { IdentityConfig } from "./types";
|
|
3
20
|
import { Prisma } from "../db";
|
|
21
|
+
import { IdentityConfig } from "./types";
|
|
4
22
|
declare function createExchangeRefreshToken(prisma: Prisma, identityConfig: IdentityConfig): (call: {
|
|
5
23
|
request: unknown;
|
|
6
24
|
}, callback: (error?: import("@fonoster/common").GrpcErrorMessage, response?: unknown) => void) => Promise<void>;
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.createExchangeRefreshToken = createExchangeRefreshToken;
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
17
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
18
18
|
* http://github.com/fonoster/fonoster
|
|
19
19
|
*
|
|
@@ -34,8 +34,8 @@ exports.createExchangeRefreshToken = createExchangeRefreshToken;
|
|
|
34
34
|
const common_1 = require("@fonoster/common");
|
|
35
35
|
const logger_1 = require("@fonoster/logger");
|
|
36
36
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
37
|
-
const exchangeTokens_1 = require("./exchangeTokens");
|
|
38
37
|
const constants_1 = require("../constants");
|
|
38
|
+
const exchangeTokens_1 = require("./exchangeTokens");
|
|
39
39
|
const logger = (0, logger_1.getLogger)({ service: "identity", filePath: __filename });
|
|
40
40
|
function createExchangeRefreshToken(prisma, identityConfig) {
|
|
41
41
|
const exchangeRefreshToken = (call, callback) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IdentityConfig } from "./types";
|
|
2
1
|
import { Prisma } from "../db";
|
|
2
|
+
import { IdentityConfig } from "./types";
|
|
3
3
|
declare function exchangeTokens(prisma: Prisma, identityConfig: IdentityConfig): (accessKeyId: string) => Promise<{
|
|
4
4
|
idToken: any;
|
|
5
5
|
accessToken: any;
|
|
@@ -46,7 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.exchangeTokens = exchangeTokens;
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
50
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
51
51
|
* http://github.com/fonoster/fonoster
|
|
52
52
|
*
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
export * from "./createExchangeApiKey";
|
|
2
20
|
export * from "./createExchangeCredentials";
|
|
3
21
|
export * from "./createExchangeOauth2Code";
|
package/dist/exchanges/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster/fonoster
|
|
20
20
|
*
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
import { AccessToken } from "@fonoster/common/";
|
|
20
|
+
import { Prisma } from "../../../db";
|
|
3
21
|
import { IdentityConfig } from "../../types";
|
|
4
22
|
declare function createGetAccessTokenPayload(prisma: Prisma, identityConfig: IdentityConfig): (accessKeyId: string) => Promise<AccessToken>;
|
|
5
23
|
export { createGetAccessTokenPayload };
|
|
@@ -10,6 +10,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createGetAccessTokenPayload = createGetAccessTokenPayload;
|
|
13
|
+
/**
|
|
14
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
|
+
* http://github.com/fonoster/fonoster
|
|
16
|
+
*
|
|
17
|
+
* This file is part of Fonoster
|
|
18
|
+
*
|
|
19
|
+
* Licensed under the MIT License (the "License");
|
|
20
|
+
* you may not use this file except in compliance with
|
|
21
|
+
* the License. You may obtain a copy of the License at
|
|
22
|
+
*
|
|
23
|
+
* https://opensource.org/licenses/MIT
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
+
* See the License for the specific language governing permissions and
|
|
29
|
+
* limitations under the License.
|
|
30
|
+
*/
|
|
13
31
|
const common_1 = require("@fonoster/common/");
|
|
14
32
|
function createGetAccessTokenPayload(prisma, identityConfig) {
|
|
15
33
|
return function getAccessTokenPayload(accessKeyId) {
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { RefreshToken } from "@fonoster/common";
|
|
1
20
|
import { Prisma } from "../../../db";
|
|
2
21
|
import { IdentityConfig } from "../../types";
|
|
3
|
-
import { RefreshToken } from "@fonoster/common";
|
|
4
22
|
declare function createGetRefreshTokenPayload(prisma: Prisma, identityConfig: IdentityConfig): (accessKeyId: string) => Promise<RefreshToken>;
|
|
5
23
|
export { createGetRefreshTokenPayload };
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
export * from "./createGetAccessTokenPayload";
|
|
2
20
|
export * from "./createGetRefreshTokenPayload";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster/fonoster
|
|
20
20
|
*
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
1
19
|
import { RefreshToken } from "@fonoster/common";
|
|
2
20
|
import { IdentityConfig } from "../types";
|
|
3
21
|
declare function buildRefreshTokenPayload(params: {
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
3
|
+
* http://github.com/fonoster/fonoster
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Fonoster
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the MIT License (the "License");
|
|
8
|
+
* you may not use this file except in compliance with
|
|
9
|
+
* the License. You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* https://opensource.org/licenses/MIT
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
2
19
|
import { AccessToken } from "@fonoster/common";
|
|
20
|
+
import { Prisma } from "../../../db";
|
|
3
21
|
import { IdentityConfig } from "../../types";
|
|
4
22
|
declare function createGetAccessTokenPayload(prisma: Prisma, identityConfig: IdentityConfig): (accessKeyId: string) => Promise<AccessToken>;
|
|
5
23
|
export { createGetAccessTokenPayload };
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createGetAccessTokenPayload = createGetAccessTokenPayload;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
14
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
15
15
|
* http://github.com/fonoster/fonoster
|
|
16
16
|
*
|
|
@@ -28,8 +28,8 @@ exports.createGetAccessTokenPayload = createGetAccessTokenPayload;
|
|
|
28
28
|
* See the License for the specific language governing permissions and
|
|
29
29
|
* limitations under the License.
|
|
30
30
|
*/
|
|
31
|
-
const types_1 = require("@fonoster/types");
|
|
32
31
|
const common_1 = require("@fonoster/common");
|
|
32
|
+
const types_1 = require("@fonoster/types");
|
|
33
33
|
function createGetAccessTokenPayload(prisma, identityConfig) {
|
|
34
34
|
return function createGetAccessTokenPayload(accessKeyId) {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|