Showing the changes to apps/cloud/src/api (4 of 33 files). Show all
Unified · Split
| @@ -56,7 +56,9 @@ export const BootSharedServices = Layer.mergeAll( · 55 unmodified lines | ||
| 56 | 56 | // `AutumnService.Default` is provided HERE because the `createOrganization` |
| 57 | 57 | // handler reads it for the free-organizations-per-user limit gate — one of the |
| 58 | 58 | // few app-only billing touchpoints. (It is NOT on the neutral boot core.) |
| 59 | −export const makeNonProtectedApiLive = (rsLive: Layer.Layer<DbService | UserStoreService>) => | |
| 59 | +export const makeNonProtectedApiLive = ( | |
| 60 | + rsLive: Layer.Layer<DbService | UserStoreService | WorkOsMirror>, | |
| 61 | +) => | |
| 60 | 62 | HttpApiBuilder.layer(NonProtectedApi).pipe( |
| 61 | 63 | Layer.provide(Layer.mergeAll(CloudAuthPublicHandlers, CloudSessionAuthHandlers)), |
| 62 | 64 | Layer.provide(requestScopedMiddleware(rsLive).layer), |
| @@ -68,18 +68,27 @@ const stubUsers = Layer.succeed(UserStoreService)({ · 67 unmodified lines | ||
| 68 | 68 | upsertOrganization: async (org: { id: string; name: string }) => ({ |
| 69 | 69 | ...org, |
| 70 | 70 | slug: `org-slug-${org.id}`, |
| 71 | + backfilledAt: null, | |
| 72 | + deletedAt: null, | |
| 73 | + workosUpdatedAt: null, | |
| 71 | 74 | createdAt, |
| 72 | 75 | }), |
| 73 | 76 | getOrganization: async (id: string) => ({ |
| 74 | 77 | id, |
| 75 | 78 | name: `Org ${id}`, |
| 76 | 79 | slug: `org-slug-${id}`, |
| 80 | + backfilledAt: null, | |
| 81 | + deletedAt: null, | |
| 82 | + workosUpdatedAt: null, | |
| 77 | 83 | createdAt, |
| 78 | 84 | }), |
| 79 | 85 | getOrganizationBySlug: async (slug: string) => ({ |
| 80 | 86 | id: "org_by_slug", |
| 81 | 87 | name: `Org ${slug}`, |
| 82 | 88 | slug, |
| 89 | + backfilledAt: null, | |
| 90 | + deletedAt: null, | |
| 91 | + workosUpdatedAt: null, | |
| 83 | 92 | createdAt, |
| 84 | 93 | }), |
| 85 | 94 | deleteOrganizationCascade: async () => {}, |
| @@ -85,18 +85,27 @@ const stubUsers = Layer.succeed(UserStoreService)({ · 84 unmodified lines | ||
| 85 | 85 | upsertOrganization: async (org: { id: string; name: string }) => ({ |
| 86 | 86 | ...org, |
| 87 | 87 | slug: `org-slug-${org.id}`, |
| 88 | + backfilledAt: null, | |
| 89 | + deletedAt: null, | |
| 90 | + workosUpdatedAt: null, | |
| 88 | 91 | createdAt, |
| 89 | 92 | }), |
| 90 | 93 | getOrganization: async (id: string) => ({ |
| 91 | 94 | id, |
| 92 | 95 | name: `Org ${id}`, |
| 93 | 96 | slug: `org-slug-${id}`, |
| 97 | + backfilledAt: null, | |
| 98 | + deletedAt: null, | |
| 99 | + workosUpdatedAt: null, | |
| 94 | 100 | createdAt, |
| 95 | 101 | }), |
| 96 | 102 | getOrganizationBySlug: async (slug: string) => ({ |
| 97 | 103 | id: "org_by_slug", |
| 98 | 104 | name: `Org ${slug}`, |
| 99 | 105 | slug, |
| 106 | + backfilledAt: null, | |
| 107 | + deletedAt: null, | |
| 108 | + workosUpdatedAt: null, | |
| 100 | 109 | createdAt, |
| 101 | 110 | }), |
| 102 | 111 | deleteOrganizationCascade: async () => {}, |
| @@ -4,6 +4,7 @@ import { HttpRouter } from "effect/unstable/http"; · 3 unmodified lines | ||
| 4 | 4 | import { RouterConfigLive, requestScopedMiddleware } from "@executor-js/api/server"; |
| 5 | 5 | |
| 6 | 6 | import { UserStoreService } from "../auth/context"; |
| 7 | +import { WorkOsMirror } from "../auth/workos-mirror"; | |
| 7 | 8 | import { DbService } from "../db/db"; |
| 8 | 9 | import { makeAccountApiLive } from "../account/account-api"; |
| 9 | 10 | |
| @@ -29,7 +30,9 @@ import { makeProtectedApiLive } from "./protected"; · 19 unmodified lines | ||
| 29 | 30 | // so tests can substitute a counting fake for `DbService.Live` and |
| 30 | 31 | // assert per-request semantics — see |
| 31 | 32 | // `apps/cloud/src/api.request-scope.node.test.ts`. |
| 32 | −export const makeApiLive = (requestScopedLive: Layer.Layer<DbService | UserStoreService>) => { | |
| 33 | +export const makeApiLive = ( | |
| 34 | + requestScopedLive: Layer.Layer<DbService | UserStoreService | WorkOsMirror>, | |
| 35 | +) => { | |
| 33 | 36 | const BillingRoutesLive = AutumnRoutesLive.pipe( |
| 34 | 37 | Layer.provide(requestScopedMiddleware(requestScopedLive).layer), |
| 35 | 38 | ); |