@wopr-network/platform-core 1.56.1 → 1.57.0
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.
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Social Router — exposes which OAuth providers are configured.
|
|
3
|
+
*
|
|
4
|
+
* Returns a list of provider IDs (e.g., ["github", "google"]) based on
|
|
5
|
+
* which env vars are set. Used by platform-ui-core's OAuthButtons component.
|
|
6
|
+
*/
|
|
7
|
+
export declare const authSocialRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
8
|
+
ctx: import("./init.js").TRPCContext;
|
|
9
|
+
meta: object;
|
|
10
|
+
errorShape: import("@trpc/server").TRPCDefaultErrorShape;
|
|
11
|
+
transformer: false;
|
|
12
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
13
|
+
enabledSocialProviders: import("@trpc/server").TRPCQueryProcedure<{
|
|
14
|
+
input: void;
|
|
15
|
+
output: ("github" | "discord" | "google")[];
|
|
16
|
+
meta: object;
|
|
17
|
+
}>;
|
|
18
|
+
}>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Social Router — exposes which OAuth providers are configured.
|
|
3
|
+
*
|
|
4
|
+
* Returns a list of provider IDs (e.g., ["github", "google"]) based on
|
|
5
|
+
* which env vars are set. Used by platform-ui-core's OAuthButtons component.
|
|
6
|
+
*/
|
|
7
|
+
import { publicProcedure, router } from "./init.js";
|
|
8
|
+
const PROVIDERS = [
|
|
9
|
+
{ id: "github", envKey: "GITHUB_CLIENT_ID" },
|
|
10
|
+
{ id: "google", envKey: "GOOGLE_CLIENT_ID" },
|
|
11
|
+
{ id: "discord", envKey: "DISCORD_CLIENT_ID" },
|
|
12
|
+
];
|
|
13
|
+
export const authSocialRouter = router({
|
|
14
|
+
enabledSocialProviders: publicProcedure.query(() => {
|
|
15
|
+
return PROVIDERS.filter((p) => process.env[p.envKey]).map((p) => p.id);
|
|
16
|
+
}),
|
|
17
|
+
});
|
package/dist/trpc/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createAdminFleetUpdateRouter } from "./admin-fleet-update-router.js";
|
|
2
|
+
export { authSocialRouter } from "./auth-social-router.js";
|
|
2
3
|
export { createFleetUpdateConfigRouter } from "./fleet-update-config-router.js";
|
|
3
4
|
export { adminProcedure, createCallerFactory, orgAdminProcedure, orgMemberProcedure, protectedProcedure, publicProcedure, router, setTrpcOrgMemberRepo, type TRPCContext, tenantProcedure, } from "./init.js";
|
|
4
5
|
export { createNotificationTemplateRouter } from "./notification-template-router.js";
|
package/dist/trpc/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createAdminFleetUpdateRouter } from "./admin-fleet-update-router.js";
|
|
2
|
+
export { authSocialRouter } from "./auth-social-router.js";
|
|
2
3
|
export { createFleetUpdateConfigRouter } from "./fleet-update-config-router.js";
|
|
3
4
|
export { adminProcedure, createCallerFactory, orgAdminProcedure, orgMemberProcedure, protectedProcedure, publicProcedure, router, setTrpcOrgMemberRepo, tenantProcedure, } from "./init.js";
|
|
4
5
|
export { createNotificationTemplateRouter } from "./notification-template-router.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Social Router — exposes which OAuth providers are configured.
|
|
3
|
+
*
|
|
4
|
+
* Returns a list of provider IDs (e.g., ["github", "google"]) based on
|
|
5
|
+
* which env vars are set. Used by platform-ui-core's OAuthButtons component.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { publicProcedure, router } from "./init.js";
|
|
9
|
+
|
|
10
|
+
const PROVIDERS = [
|
|
11
|
+
{ id: "github", envKey: "GITHUB_CLIENT_ID" },
|
|
12
|
+
{ id: "google", envKey: "GOOGLE_CLIENT_ID" },
|
|
13
|
+
{ id: "discord", envKey: "DISCORD_CLIENT_ID" },
|
|
14
|
+
] as const;
|
|
15
|
+
|
|
16
|
+
export const authSocialRouter = router({
|
|
17
|
+
enabledSocialProviders: publicProcedure.query(() => {
|
|
18
|
+
return PROVIDERS.filter((p) => process.env[p.envKey]).map((p) => p.id);
|
|
19
|
+
}),
|
|
20
|
+
});
|
package/src/trpc/index.ts
CHANGED