{"version":3,"file":"getWorkspaceList.799ca6ec.js","sources":["../../../../../../src/grpc/Identification/logout.ts","../../../../../../src/grpc/profile/acceptInvitation.ts","../../../../../../src/grpc/profile/getMyPendingInvitationList.ts","../../../../../../src/grpc/workspace/getWorkspaceList.ts"],"sourcesContent":["import * as grpcWeb from '@improbable-eng/grpc-web';\nimport { type LogoutReply, LogoutRequest } from '@aymeric_henry_sr/svelte-proto/identification_pb';\nimport {\n\tIdentification,\n\ttype IdentificationLogout\n} from '@aymeric_henry_sr/svelte-proto/identification_pb_service';\n\nimport { GRPC_HOST } from '../../constants/env.constants';\nimport { unaryTransport } from '../transport';\nimport { grpcError } from '$lib/utils/grpcError';\n\nconst { grpc } = grpcWeb;\n\nexport async function logout(): Promise<{ status: grpcWeb.grpc.Code; message: LogoutReply }> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst req = new LogoutRequest();\n\t\tgrpc.unary(Identification.Logout, {\n\t\t\trequest: req,\n\t\t\thost: GRPC_HOST,\n\t\t\ttransport: unaryTransport,\n\t\t\tonEnd: (res) => {\n\t\t\t\tconst { status, message } = res;\n\t\t\t\tif (status === grpc.Code.OK && message !== null) {\n\t\t\t\t\tresolve({\n\t\t\t\t\t\tstatus,\n\t\t\t\t\t\tmessage\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treject(grpcError('Logout', arguments, res));\n\t\t\t}\n\t\t});\n\t});\n}\n","import * as grpcWeb from \"@improbable-eng/grpc-web\";\n\nimport { ProfileAcceptInvitationRequest, type ProfileAcceptInvitationReply } from \"@aymeric_henry_sr/svelte-proto/profile_pb\";\nimport { Profile, type ProfileAcceptInvitation } from \"@aymeric_henry_sr/svelte-proto/profile_pb_service\";\n\nimport { GRPC_HOST } from '../../constants/env.constants';\nimport { unaryTransport } from \"../transport\";\nimport { grpcError } from \"$lib/utils/grpcError\";\n\nconst { grpc } = grpcWeb;\n\nexport function acceptInvitation(invitationId: string) {\n return new Promise<{ status: grpc.Code, message: ProfileAcceptInvitationReply }>((resolve, reject) => {\n const req = new ProfileAcceptInvitationRequest()\n req.setInvitationid(invitationId)\n grpc.unary(Profile.AcceptInvitation, {\n request: req,\n host: GRPC_HOST,\n transport: unaryTransport,\n onEnd: res => {\n const { status, statusMessage, message } = res;\n if (status === grpc.Code.OK && message !== null) { resolve({ status, message, }) }\n reject(grpcError(\"Accept invitation\", arguments, res))\n },\n })\n })\n}\n","import * as grpcWeb from '@improbable-eng/grpc-web';\n\nimport {\n\ttype ProfileGetPendingInvitationReply,\n\tProfileGetPendingInvitationRequest\n} from '@aymeric_henry_sr/svelte-proto/profile_pb';\nimport {\n\tProfile,\n\ttype ProfileGetPendingInvitation\n} from '@aymeric_henry_sr/svelte-proto/profile_pb_service';\n\nimport { GRPC_HOST } from '../../constants/env.constants';\nimport { Observable } from 'rxjs';\nimport { unaryTransport } from '../transport';\nconst { grpc } = grpcWeb;\n\nexport function getMyPendingInvitationList() {\n\treturn new Observable((obs) => {\n\t\tconst req = new ProfileGetPendingInvitationRequest();\n\t\tconst client = grpc.client<\n\t\t\tProfileGetPendingInvitationRequest,\n\t\t\tProfileGetPendingInvitationReply,\n\t\t\tProfileGetPendingInvitation\n\t\t>(Profile.GetPendingInvitation, {\n\t\t\thost: GRPC_HOST,\n\t\t\ttransport: unaryTransport\n\t\t});\n\t\tclient.onMessage((data) => {\n\t\t\tobs.next(data);\n\t\t});\n\t\tclient.onEnd((status) => {\n\t\t\tif (status === 0) {\n\t\t\t\treturn obs.complete();\n\t\t\t}\n\t\t\treturn obs.error();\n\t\t});\n\t\tclient.start();\n\t\tclient.send(req);\n\t});\n}\n","import * as grpcWeb from '@improbable-eng/grpc-web';\n\nimport {\n\ttype WorkspaceListReply,\n\tWorkspaceListRequest\n} from '@aymeric_henry_sr/svelte-proto/workspace_pb';\nimport {\n\tWorkspaces,\n\ttype WorkspacesList\n} from '@aymeric_henry_sr/svelte-proto/workspace_pb_service';\n\nimport { GRPC_HOST } from '../../constants/env.constants';\nimport { Observable } from 'rxjs';\nimport { unaryTransport } from '../transport';\nconst { grpc } = grpcWeb;\n\nexport function getWorkspaceList() {\n\treturn new Observable((obs) => {\n\t\tconst req = new WorkspaceListRequest();\n\t\tconst client = grpc.client(\n\t\t\tWorkspaces.List,\n\t\t\t{\n\t\t\t\thost: GRPC_HOST,\n\t\t\t\ttransport: unaryTransport\n\t\t\t}\n\t\t);\n\t\tclient.onMessage((data) => {\n\t\t\tobs.next(data);\n\t\t});\n\t\tclient.onEnd((status) => {\n\t\t\tif (status === 0) {\n\t\t\t\treturn obs.complete();\n\t\t\t}\n\t\t\treturn obs.error();\n\t\t});\n\t\tclient.start();\n\t\tclient.send(req);\n\t});\n}\n"],"names":["grpc","grpcWeb","logout","resolve","reject","req","LogoutRequest","Identification","GRPC_HOST","unaryTransport","res","status","message","grpcError","acceptInvitation","invitationId","ProfileAcceptInvitationRequest","Profile","statusMessage","getMyPendingInvitationList","Observable","obs","ProfileGetPendingInvitationRequest","client","data","getWorkspaceList","WorkspaceListRequest","Workspaces"],"mappings":"+uBAWA,KAAM,CAAEA,KAAAA,CAAS,EAAAC,EAEjB,eAAsBC,GAAuE,CAC5F,OAAO,IAAI,QAAQ,CAACC,EAASC,IAAW,CACjC,MAAAC,EAAM,IAAIC,EAAAA,cACXN,EAAA,MAAwDO,EAAe,OAAQ,CACnF,QAASF,EACT,KAAMG,EACN,UAAWC,EACX,MAAQC,GAAQ,CACT,KAAA,CAAE,OAAAC,EAAQ,QAAAC,CAAY,EAAAF,EACxBC,IAAWX,EAAK,KAAK,IAAMY,IAAY,MAClCT,EAAA,CACP,OAAAQ,EACA,QAAAC,CAAA,CACA,EAGFR,EAAOS,EAAU,SAAU,UAAWH,CAAG,CAAC,CAC3C,CAAA,CACA,CAAA,CACD,CACF,CCxBA,KAAM,CAAEV,KAAAA,CAAS,EAAAC,EAEV,SAASa,EAAiBC,EAAsB,CACrD,OAAO,IAAI,QAAsE,CAACZ,EAASC,IAAW,CAC9F,MAAAC,EAAM,IAAIW,E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