diff --git a/apps/server-new/src/http/api.ts b/apps/server-new/src/http/api.ts index 63320ce9..7186ce42 100644 --- a/apps/server-new/src/http/api.ts +++ b/apps/server-new/src/http/api.ts @@ -108,7 +108,7 @@ export const postConnectAddAppIdentityToSpacesEndpoint = HttpApiEndpoint.post( }), ) .setPayload(Messages.RequestConnectAddAppIdentityToSpaces) - .addSuccess(Schema.Void) + .addSuccess(Schema.Void, { status: 200 }) .addError(Errors.AuthenticationError, { status: 401 }) .addError(Errors.AuthorizationError, { status: 401 }) .addError(Errors.ValidationError, { status: 400 }) @@ -169,7 +169,7 @@ export const postConnectAppIdentityEndpoint = HttpApiEndpoint.post('postConnectA }), ) .setPayload(Messages.RequestConnectCreateAppIdentity) - .addSuccess(Schema.Void) + .addSuccess(AppIdentityResponse) .addError(Errors.AuthenticationError, { status: 401 }) .addError(Errors.AuthorizationError, { status: 401 }) .addError(Errors.ResourceAlreadyExistsError, { status: 400 }) @@ -230,7 +230,7 @@ export const postSpaceInboxMessageEndpoint = HttpApiEndpoint.post( 'postSpaceInboxMessage', )`/spaces/${spaceId}/inboxes/${inboxId}/messages` .setPayload(Messages.RequestCreateSpaceInboxMessage) - .addSuccess(Schema.Void) + .addSuccess(Schema.Void, { status: 200 }) .addError(Errors.ValidationError, { status: 400 }) .addError(Errors.AuthorizationError, { status: 403 }) .addError(Errors.ResourceNotFoundError, { status: 404 }) @@ -251,7 +251,7 @@ export const postAccountInboxMessageEndpoint = HttpApiEndpoint.post( 'postAccountInboxMessage', )`/accounts/${accountAddress}/inboxes/${inboxId}/messages` .setPayload(Messages.RequestCreateAccountInboxMessage) - .addSuccess(Schema.Void) + .addSuccess(Schema.Void, { status: 200 }) .addError(Errors.ValidationError, { status: 400 }) .addError(Errors.AuthorizationError, { status: 403 }) .addError(Errors.ResourceNotFoundError, { status: 404 }) diff --git a/apps/server-new/src/http/handlers.ts b/apps/server-new/src/http/handlers.ts index d882c06b..4a382b8b 100644 --- a/apps/server-new/src/http/handlers.ts +++ b/apps/server-new/src/http/handlers.ts @@ -271,7 +271,7 @@ const ConnectGroupLive = HttpApiBuilder.group(Api.hypergraphApi, 'Connect', (han const sessionTokenExpires = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30); // 30 days // Create the app identity - yield* appIdentityService + const appIdentity = yield* appIdentityService .createAppIdentity({ accountAddress, appId: payload.appId, @@ -285,6 +285,8 @@ const ConnectGroupLive = HttpApiBuilder.group(Api.hypergraphApi, 'Connect', (han sessionTokenExpires, }) .pipe(Effect.orDie); + + return { appIdentity }; }), ); }).pipe( diff --git a/apps/server-new/src/services/app-identity.ts b/apps/server-new/src/services/app-identity.ts index 8326b579..1fcc72f4 100644 --- a/apps/server-new/src/services/app-identity.ts +++ b/apps/server-new/src/services/app-identity.ts @@ -20,10 +20,7 @@ export interface AppIdentityResult { accountProof: string; keyProof: string; sessionToken: string | null; - sessionNonce: string | null; sessionTokenExpires: Date | null; - createdAt: Date; - updatedAt: Date; } export interface CreateAppIdentityParams { @@ -54,7 +51,7 @@ export class AppIdentityService extends Context.Tag('AppIdentityService')< }) => Effect.Effect; readonly createAppIdentity: ( params: CreateAppIdentityParams, - ) => Effect.Effect; + ) => Effect.Effect; } >() {}