@namera-ai/api 0.0.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.
- package/README.md +58 -0
- package/dist/common.js +13 -0
- package/dist/common.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/middlewares/admin.d.ts +25 -0
- package/dist/middlewares/admin.d.ts.map +1 -0
- package/dist/middlewares/admin.js +18 -0
- package/dist/middlewares/admin.js.map +1 -0
- package/dist/middlewares/auth.d.ts +640 -0
- package/dist/middlewares/auth.d.ts.map +1 -0
- package/dist/middlewares/auth.js +26 -0
- package/dist/middlewares/auth.js.map +1 -0
- package/dist/middlewares/index.d.ts +3 -0
- package/dist/routes/address-metadata.d.ts +147 -0
- package/dist/routes/address-metadata.d.ts.map +1 -0
- package/dist/routes/address-metadata.js +24 -0
- package/dist/routes/address-metadata.js.map +1 -0
- package/dist/routes/api-key.d.ts +864 -0
- package/dist/routes/api-key.d.ts.map +1 -0
- package/dist/routes/api-key.js +31 -0
- package/dist/routes/api-key.js.map +1 -0
- package/dist/routes/auth/core/index.d.ts +4 -0
- package/dist/routes/auth/core/magic-link.d.ts +34 -0
- package/dist/routes/auth/core/magic-link.d.ts.map +1 -0
- package/dist/routes/auth/core/magic-link.js +25 -0
- package/dist/routes/auth/core/magic-link.js.map +1 -0
- package/dist/routes/auth/core/session.d.ts +805 -0
- package/dist/routes/auth/core/session.d.ts.map +1 -0
- package/dist/routes/auth/core/session.js +31 -0
- package/dist/routes/auth/core/session.js.map +1 -0
- package/dist/routes/auth/core/user.d.ts +45 -0
- package/dist/routes/auth/core/user.d.ts.map +1 -0
- package/dist/routes/auth/core/user.js +15 -0
- package/dist/routes/auth/core/user.js.map +1 -0
- package/dist/routes/auth/index.d.ts +11 -0
- package/dist/routes/auth/notification.d.ts +392 -0
- package/dist/routes/auth/notification.d.ts.map +1 -0
- package/dist/routes/auth/notification.js +40 -0
- package/dist/routes/auth/notification.js.map +1 -0
- package/dist/routes/auth/oauth.d.ts +1347 -0
- package/dist/routes/auth/oauth.d.ts.map +1 -0
- package/dist/routes/auth/oauth.js +62 -0
- package/dist/routes/auth/oauth.js.map +1 -0
- package/dist/routes/auth/organization/index.d.ts +4 -0
- package/dist/routes/auth/organization/invitation.d.ts +400 -0
- package/dist/routes/auth/organization/invitation.d.ts.map +1 -0
- package/dist/routes/auth/organization/invitation.js +55 -0
- package/dist/routes/auth/organization/invitation.js.map +1 -0
- package/dist/routes/auth/organization/members.d.ts +250 -0
- package/dist/routes/auth/organization/members.d.ts.map +1 -0
- package/dist/routes/auth/organization/members.js +37 -0
- package/dist/routes/auth/organization/members.js.map +1 -0
- package/dist/routes/auth/organization/organization.d.ts +196 -0
- package/dist/routes/auth/organization/organization.d.ts.map +1 -0
- package/dist/routes/auth/organization/organization.js +31 -0
- package/dist/routes/auth/organization/organization.js.map +1 -0
- package/dist/routes/beta-invite.d.ts +24 -0
- package/dist/routes/beta-invite.d.ts.map +1 -0
- package/dist/routes/beta-invite.js +20 -0
- package/dist/routes/beta-invite.js.map +1 -0
- package/dist/routes/billing.d.ts +34 -0
- package/dist/routes/billing.d.ts.map +1 -0
- package/dist/routes/billing.js +14 -0
- package/dist/routes/billing.js.map +1 -0
- package/dist/routes/dashboard.d.ts +58 -0
- package/dist/routes/dashboard.d.ts.map +1 -0
- package/dist/routes/dashboard.js +14 -0
- package/dist/routes/dashboard.js.map +1 -0
- package/dist/routes/ens.d.ts +14 -0
- package/dist/routes/ens.d.ts.map +1 -0
- package/dist/routes/ens.js +15 -0
- package/dist/routes/ens.js.map +1 -0
- package/dist/routes/execution.d.ts +816 -0
- package/dist/routes/execution.d.ts.map +1 -0
- package/dist/routes/execution.js +50 -0
- package/dist/routes/execution.js.map +1 -0
- package/dist/routes/health.d.ts +10 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +10 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/index.d.ts +23 -0
- package/dist/routes/portfolio.d.ts +94 -0
- package/dist/routes/portfolio.d.ts.map +1 -0
- package/dist/routes/portfolio.js +16 -0
- package/dist/routes/portfolio.js.map +1 -0
- package/dist/routes/session-key.d.ts +1844 -0
- package/dist/routes/session-key.d.ts.map +1 -0
- package/dist/routes/session-key.js +55 -0
- package/dist/routes/session-key.js.map +1 -0
- package/dist/routes/signature.d.ts +195 -0
- package/dist/routes/signature.d.ts.map +1 -0
- package/dist/routes/signature.js +38 -0
- package/dist/routes/signature.js.map +1 -0
- package/dist/routes/waitlist.d.ts +42 -0
- package/dist/routes/waitlist.d.ts.map +1 -0
- package/dist/routes/waitlist.js +27 -0
- package/dist/routes/waitlist.js.map +1 -0
- package/dist/routes/wallet.d.ts +547 -0
- package/dist/routes/wallet.d.ts.map +1 -0
- package/dist/routes/wallet.js +50 -0
- package/dist/routes/wallet.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","names":[],"sources":["../../../src/routes/auth/oauth.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4Ba,mBAAmB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CommonErrors } from "../../common.js";
|
|
2
|
+
import { Authorization } from "../../middlewares/auth.js";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
+
import { OAuthAuthorizationError, OAuthAuthorizationRequestError, OAuthDeviceAuthorizationError } from "@namera-ai/protocol";
|
|
5
|
+
import { ApproveOAuthAuthorizationRequest, ApproveOAuthDeviceAuthorizationRequest, DenyOAuthAuthorizationRequest, DenyOAuthDeviceAuthorizationRequest, GetOAuthAuthorizationRequest, GetOAuthAuthorizationRequestRequest, GetOAuthAuthorizationRequestResponse, GetOAuthAuthorizationResponse, GetOAuthDeviceAuthorizationRequest, ListOAuthAuthorizationsResponse, OAuthAuthorizationRedirectResponse, OAuthDeviceAuthorizationDecisionResponse, OAuthDeviceAuthorizationResponse, RevokeOAuthAuthorizationRequest, RevokeOAuthAuthorizationResponse } from "@namera-ai/protocol/dto";
|
|
6
|
+
|
|
7
|
+
//#region src/routes/auth/oauth.ts
|
|
8
|
+
var OAuthGroup = class extends HttpApiGroup.make("oauth").add(HttpApiEndpoint.get("getOAuthAuthorizationRequest", "/authorization-requests/:requestId", {
|
|
9
|
+
params: GetOAuthAuthorizationRequestRequest,
|
|
10
|
+
error: [OAuthAuthorizationRequestError, ...CommonErrors],
|
|
11
|
+
success: GetOAuthAuthorizationRequestResponse
|
|
12
|
+
}).annotate(OpenApi.Summary, "Get a pending OAuth authorization request"), HttpApiEndpoint.post("approveOAuthAuthorizationRequest", "/authorization-requests/approve", {
|
|
13
|
+
payload: ApproveOAuthAuthorizationRequest,
|
|
14
|
+
error: [
|
|
15
|
+
OAuthAuthorizationRequestError,
|
|
16
|
+
OAuthAuthorizationError,
|
|
17
|
+
...CommonErrors
|
|
18
|
+
],
|
|
19
|
+
success: OAuthAuthorizationRedirectResponse
|
|
20
|
+
}).annotate(OpenApi.Summary, "Approve an OAuth authorization request"), HttpApiEndpoint.post("denyOAuthAuthorizationRequest", "/authorization-requests/deny", {
|
|
21
|
+
payload: DenyOAuthAuthorizationRequest,
|
|
22
|
+
error: [OAuthAuthorizationRequestError, ...CommonErrors],
|
|
23
|
+
success: OAuthAuthorizationRedirectResponse
|
|
24
|
+
}).annotate(OpenApi.Summary, "Deny an OAuth authorization request"), HttpApiEndpoint.get("getOAuthDeviceAuthorization", "/device-authorizations", {
|
|
25
|
+
query: GetOAuthDeviceAuthorizationRequest,
|
|
26
|
+
error: [OAuthDeviceAuthorizationError, ...CommonErrors],
|
|
27
|
+
success: OAuthDeviceAuthorizationResponse
|
|
28
|
+
}).annotate(OpenApi.Summary, "Get and claim a CLI device authorization request"), HttpApiEndpoint.post("approveOAuthDeviceAuthorization", "/device-authorizations/approve", {
|
|
29
|
+
payload: ApproveOAuthDeviceAuthorizationRequest,
|
|
30
|
+
error: [OAuthDeviceAuthorizationError, ...CommonErrors],
|
|
31
|
+
success: OAuthDeviceAuthorizationDecisionResponse
|
|
32
|
+
}).annotate(OpenApi.Summary, "Approve a CLI device authorization request"), HttpApiEndpoint.post("denyOAuthDeviceAuthorization", "/device-authorizations/deny", {
|
|
33
|
+
payload: DenyOAuthDeviceAuthorizationRequest,
|
|
34
|
+
error: [OAuthDeviceAuthorizationError, ...CommonErrors],
|
|
35
|
+
success: OAuthDeviceAuthorizationDecisionResponse
|
|
36
|
+
}).annotate(OpenApi.Summary, "Deny a CLI device authorization request"), HttpApiEndpoint.get("listMcpAuthorizations", "/authorizations", {
|
|
37
|
+
error: CommonErrors,
|
|
38
|
+
success: ListOAuthAuthorizationsResponse
|
|
39
|
+
}).annotate(OpenApi.Summary, "List MCP authorizations for the active organization"), HttpApiEndpoint.get("getMcpAuthorization", "/authorizations/:authorizationId", {
|
|
40
|
+
params: GetOAuthAuthorizationRequest,
|
|
41
|
+
error: [OAuthAuthorizationError, ...CommonErrors],
|
|
42
|
+
success: GetOAuthAuthorizationResponse
|
|
43
|
+
}).annotate(OpenApi.Summary, "Get an MCP authorization"), HttpApiEndpoint.post("revokeMcpAuthorization", "/authorizations/revoke", {
|
|
44
|
+
payload: RevokeOAuthAuthorizationRequest,
|
|
45
|
+
error: [OAuthAuthorizationError, ...CommonErrors],
|
|
46
|
+
success: RevokeOAuthAuthorizationResponse
|
|
47
|
+
}).annotate(OpenApi.Summary, "Revoke an MCP authorization"), HttpApiEndpoint.get("listCliAuthorizations", "/cli-authorizations", {
|
|
48
|
+
error: CommonErrors,
|
|
49
|
+
success: ListOAuthAuthorizationsResponse
|
|
50
|
+
}).annotate(OpenApi.Summary, "List CLI authorizations for the active organization"), HttpApiEndpoint.get("getCliAuthorization", "/cli-authorizations/:authorizationId", {
|
|
51
|
+
params: GetOAuthAuthorizationRequest,
|
|
52
|
+
error: [OAuthAuthorizationError, ...CommonErrors],
|
|
53
|
+
success: GetOAuthAuthorizationResponse
|
|
54
|
+
}).annotate(OpenApi.Summary, "Get a CLI authorization"), HttpApiEndpoint.post("revokeCliAuthorization", "/cli-authorizations/revoke", {
|
|
55
|
+
payload: RevokeOAuthAuthorizationRequest,
|
|
56
|
+
error: [OAuthAuthorizationError, ...CommonErrors],
|
|
57
|
+
success: RevokeOAuthAuthorizationResponse
|
|
58
|
+
}).annotate(OpenApi.Summary, "Revoke a CLI authorization")).annotate(OpenApi.Description, "OAuth consent and delegated authorization management").middleware(Authorization).prefix("/oauth") {};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { OAuthGroup };
|
|
62
|
+
//# sourceMappingURL=oauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.js","names":[],"sources":["../../../src/routes/auth/oauth.ts"],"sourcesContent":["import { HttpApiEndpoint, HttpApiGroup, OpenApi } from \"effect/unstable/httpapi\";\n\nimport {\n OAuthAuthorizationError,\n OAuthAuthorizationRequestError,\n OAuthDeviceAuthorizationError,\n} from \"@namera-ai/protocol\";\nimport {\n ApproveOAuthDeviceAuthorizationRequest,\n ApproveOAuthAuthorizationRequest,\n DenyOAuthDeviceAuthorizationRequest,\n DenyOAuthAuthorizationRequest,\n GetOAuthDeviceAuthorizationRequest,\n OAuthDeviceAuthorizationDecisionResponse,\n OAuthDeviceAuthorizationResponse,\n GetOAuthAuthorizationRequest,\n GetOAuthAuthorizationResponse,\n GetOAuthAuthorizationRequestRequest,\n GetOAuthAuthorizationRequestResponse,\n ListOAuthAuthorizationsResponse,\n OAuthAuthorizationRedirectResponse,\n RevokeOAuthAuthorizationRequest,\n RevokeOAuthAuthorizationResponse,\n} from \"@namera-ai/protocol/dto\";\n\nimport { CommonErrors } from \"#/common\";\nimport { Authorization } from \"#/middlewares/index\";\n\nexport class OAuthGroup extends HttpApiGroup.make(\"oauth\")\n .add(\n HttpApiEndpoint.get(\"getOAuthAuthorizationRequest\", \"/authorization-requests/:requestId\", {\n params: GetOAuthAuthorizationRequestRequest,\n error: [OAuthAuthorizationRequestError, ...CommonErrors],\n success: GetOAuthAuthorizationRequestResponse,\n }).annotate(OpenApi.Summary, \"Get a pending OAuth authorization request\"),\n HttpApiEndpoint.post(\"approveOAuthAuthorizationRequest\", \"/authorization-requests/approve\", {\n payload: ApproveOAuthAuthorizationRequest,\n error: [OAuthAuthorizationRequestError, OAuthAuthorizationError, ...CommonErrors],\n success: OAuthAuthorizationRedirectResponse,\n }).annotate(OpenApi.Summary, \"Approve an OAuth authorization request\"),\n HttpApiEndpoint.post(\"denyOAuthAuthorizationRequest\", \"/authorization-requests/deny\", {\n payload: DenyOAuthAuthorizationRequest,\n error: [OAuthAuthorizationRequestError, ...CommonErrors],\n success: OAuthAuthorizationRedirectResponse,\n }).annotate(OpenApi.Summary, \"Deny an OAuth authorization request\"),\n HttpApiEndpoint.get(\"getOAuthDeviceAuthorization\", \"/device-authorizations\", {\n query: GetOAuthDeviceAuthorizationRequest,\n error: [OAuthDeviceAuthorizationError, ...CommonErrors],\n success: OAuthDeviceAuthorizationResponse,\n }).annotate(OpenApi.Summary, \"Get and claim a CLI device authorization request\"),\n HttpApiEndpoint.post(\"approveOAuthDeviceAuthorization\", \"/device-authorizations/approve\", {\n payload: ApproveOAuthDeviceAuthorizationRequest,\n error: [OAuthDeviceAuthorizationError, ...CommonErrors],\n success: OAuthDeviceAuthorizationDecisionResponse,\n }).annotate(OpenApi.Summary, \"Approve a CLI device authorization request\"),\n HttpApiEndpoint.post(\"denyOAuthDeviceAuthorization\", \"/device-authorizations/deny\", {\n payload: DenyOAuthDeviceAuthorizationRequest,\n error: [OAuthDeviceAuthorizationError, ...CommonErrors],\n success: OAuthDeviceAuthorizationDecisionResponse,\n }).annotate(OpenApi.Summary, \"Deny a CLI device authorization request\"),\n HttpApiEndpoint.get(\"listMcpAuthorizations\", \"/authorizations\", {\n error: CommonErrors,\n success: ListOAuthAuthorizationsResponse,\n }).annotate(OpenApi.Summary, \"List MCP authorizations for the active organization\"),\n HttpApiEndpoint.get(\"getMcpAuthorization\", \"/authorizations/:authorizationId\", {\n params: GetOAuthAuthorizationRequest,\n error: [OAuthAuthorizationError, ...CommonErrors],\n success: GetOAuthAuthorizationResponse,\n }).annotate(OpenApi.Summary, \"Get an MCP authorization\"),\n HttpApiEndpoint.post(\"revokeMcpAuthorization\", \"/authorizations/revoke\", {\n payload: RevokeOAuthAuthorizationRequest,\n error: [OAuthAuthorizationError, ...CommonErrors],\n success: RevokeOAuthAuthorizationResponse,\n }).annotate(OpenApi.Summary, \"Revoke an MCP authorization\"),\n HttpApiEndpoint.get(\"listCliAuthorizations\", \"/cli-authorizations\", {\n error: CommonErrors,\n success: ListOAuthAuthorizationsResponse,\n }).annotate(OpenApi.Summary, \"List CLI authorizations for the active organization\"),\n HttpApiEndpoint.get(\"getCliAuthorization\", \"/cli-authorizations/:authorizationId\", {\n params: GetOAuthAuthorizationRequest,\n error: [OAuthAuthorizationError, ...CommonErrors],\n success: GetOAuthAuthorizationResponse,\n }).annotate(OpenApi.Summary, \"Get a CLI authorization\"),\n HttpApiEndpoint.post(\"revokeCliAuthorization\", \"/cli-authorizations/revoke\", {\n payload: RevokeOAuthAuthorizationRequest,\n error: [OAuthAuthorizationError, ...CommonErrors],\n success: RevokeOAuthAuthorizationResponse,\n }).annotate(OpenApi.Summary, \"Revoke a CLI authorization\"),\n )\n .annotate(OpenApi.Description, \"OAuth consent and delegated authorization management\")\n .middleware(Authorization)\n .prefix(\"/oauth\") {}\n"],"mappings":";;;;;;;AA4BA,IAAa,aAAb,cAAgC,aAAa,KAAK,OAAO,CAAC,CACvD,IACC,gBAAgB,IAAI,gCAAgC,sCAAsC;CACxF,QAAQ;CACR,OAAO,CAAC,gCAAgC,GAAG,YAAY;CACvD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,2CAA2C,GACxE,gBAAgB,KAAK,oCAAoC,mCAAmC;CAC1F,SAAS;CACT,OAAO;EAAC;EAAgC;EAAyB,GAAG;CAAY;CAChF,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,wCAAwC,GACrE,gBAAgB,KAAK,iCAAiC,gCAAgC;CACpF,SAAS;CACT,OAAO,CAAC,gCAAgC,GAAG,YAAY;CACvD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,qCAAqC,GAClE,gBAAgB,IAAI,+BAA+B,0BAA0B;CAC3E,OAAO;CACP,OAAO,CAAC,+BAA+B,GAAG,YAAY;CACtD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,kDAAkD,GAC/E,gBAAgB,KAAK,mCAAmC,kCAAkC;CACxF,SAAS;CACT,OAAO,CAAC,+BAA+B,GAAG,YAAY;CACtD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,4CAA4C,GACzE,gBAAgB,KAAK,gCAAgC,+BAA+B;CAClF,SAAS;CACT,OAAO,CAAC,+BAA+B,GAAG,YAAY;CACtD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,yCAAyC,GACtE,gBAAgB,IAAI,yBAAyB,mBAAmB;CAC9D,OAAO;CACP,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,qDAAqD,GAClF,gBAAgB,IAAI,uBAAuB,oCAAoC;CAC7E,QAAQ;CACR,OAAO,CAAC,yBAAyB,GAAG,YAAY;CAChD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,0BAA0B,GACvD,gBAAgB,KAAK,0BAA0B,0BAA0B;CACvE,SAAS;CACT,OAAO,CAAC,yBAAyB,GAAG,YAAY;CAChD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,6BAA6B,GAC1D,gBAAgB,IAAI,yBAAyB,uBAAuB;CAClE,OAAO;CACP,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,qDAAqD,GAClF,gBAAgB,IAAI,uBAAuB,wCAAwC;CACjF,QAAQ;CACR,OAAO,CAAC,yBAAyB,GAAG,YAAY;CAChD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,yBAAyB,GACtD,gBAAgB,KAAK,0BAA0B,8BAA8B;CAC3E,SAAS;CACT,OAAO,CAAC,yBAAyB,GAAG,YAAY;CAChD,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,4BAA4B,CAC3D,CAAC,CACA,SAAS,QAAQ,aAAa,sDAAsD,CAAC,CACrF,WAAW,aAAa,CAAC,CACzB,OAAO,QAAQ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { Authorization } from "../../../middlewares/auth.js";
|
|
2
|
+
import "../../../middlewares/index.js";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
//#region src/routes/auth/organization/invitation.d.ts
|
|
5
|
+
declare const InvitationGroup_base: HttpApiGroup.HttpApiGroup<"invitation", HttpApiEndpoint.HttpApiEndpoint<"getInvitation", "GET", "/auth/invitation/get-invitation", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
|
|
6
|
+
readonly invitationId: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
7
|
+
}>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
8
|
+
readonly invitation: import("effect/Schema").Struct<{
|
|
9
|
+
readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
|
|
10
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
11
|
+
readonly organizationId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
12
|
+
readonly status: import("effect/Schema").Literals<readonly ["pending", "accepted", "rejected", "canceled", "expired"]>;
|
|
13
|
+
readonly organizationRoleId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
14
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
15
|
+
readonly inviterId: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
16
|
+
}>;
|
|
17
|
+
readonly inviter: import("effect/Schema").Struct<{
|
|
18
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
19
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
20
|
+
readonly name: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
21
|
+
readonly image: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
22
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
23
|
+
readonly value: import("effect/Schema").String;
|
|
24
|
+
readonly color: import("effect/Schema").String;
|
|
25
|
+
}>, import("effect/Schema").Struct<{
|
|
26
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
27
|
+
readonly value: import("effect/Schema").String;
|
|
28
|
+
}>, import("effect/Schema").Struct<{
|
|
29
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
30
|
+
readonly value: import("effect/Schema").String;
|
|
31
|
+
}>]>>;
|
|
32
|
+
}>;
|
|
33
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
34
|
+
readonly lastLoginAt: import("effect/Schema").NullOr<import("effect/Schema").DateTimeUtcFromDate>;
|
|
35
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
36
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
37
|
+
}>;
|
|
38
|
+
readonly organization: import("effect/Schema").Struct<{
|
|
39
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
40
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
41
|
+
readonly name: import("effect/Schema").String;
|
|
42
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
43
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
44
|
+
readonly value: import("effect/Schema").String;
|
|
45
|
+
readonly color: import("effect/Schema").String;
|
|
46
|
+
}>, import("effect/Schema").Struct<{
|
|
47
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
48
|
+
readonly value: import("effect/Schema").String;
|
|
49
|
+
}>, import("effect/Schema").Struct<{
|
|
50
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
51
|
+
readonly value: import("effect/Schema").String;
|
|
52
|
+
}>]>>;
|
|
53
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
54
|
+
}>;
|
|
55
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
56
|
+
}>;
|
|
57
|
+
readonly organizationRole: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
58
|
+
readonly type: import("effect/Schema").Literal<"system">;
|
|
59
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
60
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
61
|
+
readonly name: import("effect/Schema").String;
|
|
62
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
63
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
64
|
+
readonly value: import("effect/Schema").String;
|
|
65
|
+
readonly color: import("effect/Schema").String;
|
|
66
|
+
}>, import("effect/Schema").Struct<{
|
|
67
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
68
|
+
readonly value: import("effect/Schema").String;
|
|
69
|
+
}>, import("effect/Schema").Struct<{
|
|
70
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
71
|
+
readonly value: import("effect/Schema").String;
|
|
72
|
+
}>]>>;
|
|
73
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
74
|
+
}>;
|
|
75
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
76
|
+
readonly systemRoleId: import("effect/Schema").brand<import("effect/Schema").String, "SystemRoleId">;
|
|
77
|
+
readonly key: import("effect/Schema").String;
|
|
78
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
79
|
+
}>, import("effect/Schema").Struct<{
|
|
80
|
+
readonly type: import("effect/Schema").Literal<"custom">;
|
|
81
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
82
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
83
|
+
readonly name: import("effect/Schema").String;
|
|
84
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
85
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
86
|
+
readonly value: import("effect/Schema").String;
|
|
87
|
+
readonly color: import("effect/Schema").String;
|
|
88
|
+
}>, import("effect/Schema").Struct<{
|
|
89
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
90
|
+
readonly value: import("effect/Schema").String;
|
|
91
|
+
}>, import("effect/Schema").Struct<{
|
|
92
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
93
|
+
readonly value: import("effect/Schema").String;
|
|
94
|
+
}>]>>;
|
|
95
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
96
|
+
}>;
|
|
97
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
98
|
+
readonly systemRoleId: import("effect/Schema").Null;
|
|
99
|
+
readonly key: import("effect/Schema").String;
|
|
100
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
101
|
+
}>]>;
|
|
102
|
+
}>>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError>, Authorization, never> | HttpApiEndpoint.HttpApiEndpoint<"listInvitations", "GET", "/auth/invitation/list-invitations", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
103
|
+
readonly invitation: import("effect/Schema").Struct<{
|
|
104
|
+
readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
|
|
105
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
106
|
+
readonly organizationId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
107
|
+
readonly status: import("effect/Schema").Literals<readonly ["pending", "accepted", "rejected", "canceled", "expired"]>;
|
|
108
|
+
readonly organizationRoleId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
109
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
110
|
+
readonly inviterId: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
111
|
+
}>;
|
|
112
|
+
readonly inviter: import("effect/Schema").Struct<{
|
|
113
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
114
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
115
|
+
readonly name: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
116
|
+
readonly image: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
117
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
118
|
+
readonly value: import("effect/Schema").String;
|
|
119
|
+
readonly color: import("effect/Schema").String;
|
|
120
|
+
}>, import("effect/Schema").Struct<{
|
|
121
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
122
|
+
readonly value: import("effect/Schema").String;
|
|
123
|
+
}>, import("effect/Schema").Struct<{
|
|
124
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
125
|
+
readonly value: import("effect/Schema").String;
|
|
126
|
+
}>]>>;
|
|
127
|
+
}>;
|
|
128
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
129
|
+
readonly lastLoginAt: import("effect/Schema").NullOr<import("effect/Schema").DateTimeUtcFromDate>;
|
|
130
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
131
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
132
|
+
}>;
|
|
133
|
+
readonly organization: import("effect/Schema").Struct<{
|
|
134
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
135
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
136
|
+
readonly name: import("effect/Schema").String;
|
|
137
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
138
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
139
|
+
readonly value: import("effect/Schema").String;
|
|
140
|
+
readonly color: import("effect/Schema").String;
|
|
141
|
+
}>, import("effect/Schema").Struct<{
|
|
142
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
143
|
+
readonly value: import("effect/Schema").String;
|
|
144
|
+
}>, import("effect/Schema").Struct<{
|
|
145
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
146
|
+
readonly value: import("effect/Schema").String;
|
|
147
|
+
}>]>>;
|
|
148
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
149
|
+
}>;
|
|
150
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
151
|
+
}>;
|
|
152
|
+
readonly organizationRole: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
153
|
+
readonly type: import("effect/Schema").Literal<"system">;
|
|
154
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
155
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
156
|
+
readonly name: import("effect/Schema").String;
|
|
157
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
158
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
159
|
+
readonly value: import("effect/Schema").String;
|
|
160
|
+
readonly color: import("effect/Schema").String;
|
|
161
|
+
}>, import("effect/Schema").Struct<{
|
|
162
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
163
|
+
readonly value: import("effect/Schema").String;
|
|
164
|
+
}>, import("effect/Schema").Struct<{
|
|
165
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
166
|
+
readonly value: import("effect/Schema").String;
|
|
167
|
+
}>]>>;
|
|
168
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
169
|
+
}>;
|
|
170
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
171
|
+
readonly systemRoleId: import("effect/Schema").brand<import("effect/Schema").String, "SystemRoleId">;
|
|
172
|
+
readonly key: import("effect/Schema").String;
|
|
173
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
174
|
+
}>, import("effect/Schema").Struct<{
|
|
175
|
+
readonly type: import("effect/Schema").Literal<"custom">;
|
|
176
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
177
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
178
|
+
readonly name: import("effect/Schema").String;
|
|
179
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
180
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
181
|
+
readonly value: import("effect/Schema").String;
|
|
182
|
+
readonly color: import("effect/Schema").String;
|
|
183
|
+
}>, import("effect/Schema").Struct<{
|
|
184
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
185
|
+
readonly value: import("effect/Schema").String;
|
|
186
|
+
}>, import("effect/Schema").Struct<{
|
|
187
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
188
|
+
readonly value: import("effect/Schema").String;
|
|
189
|
+
}>]>>;
|
|
190
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
191
|
+
}>;
|
|
192
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
193
|
+
readonly systemRoleId: import("effect/Schema").Null;
|
|
194
|
+
readonly key: import("effect/Schema").String;
|
|
195
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
196
|
+
}>]>;
|
|
197
|
+
}>>>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError>, Authorization, never> | HttpApiEndpoint.HttpApiEndpoint<"listUserInvitations", "GET", "/auth/invitation/list-user-invitations", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
198
|
+
readonly invitation: import("effect/Schema").Struct<{
|
|
199
|
+
readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
|
|
200
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
201
|
+
readonly organizationId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
202
|
+
readonly status: import("effect/Schema").Literals<readonly ["pending", "accepted", "rejected", "canceled", "expired"]>;
|
|
203
|
+
readonly organizationRoleId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
204
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
205
|
+
readonly inviterId: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
206
|
+
}>;
|
|
207
|
+
readonly inviter: import("effect/Schema").Struct<{
|
|
208
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
209
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
210
|
+
readonly name: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
211
|
+
readonly image: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
212
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
213
|
+
readonly value: import("effect/Schema").String;
|
|
214
|
+
readonly color: import("effect/Schema").String;
|
|
215
|
+
}>, import("effect/Schema").Struct<{
|
|
216
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
217
|
+
readonly value: import("effect/Schema").String;
|
|
218
|
+
}>, import("effect/Schema").Struct<{
|
|
219
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
220
|
+
readonly value: import("effect/Schema").String;
|
|
221
|
+
}>]>>;
|
|
222
|
+
}>;
|
|
223
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
224
|
+
readonly lastLoginAt: import("effect/Schema").NullOr<import("effect/Schema").DateTimeUtcFromDate>;
|
|
225
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
226
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
227
|
+
}>;
|
|
228
|
+
readonly organization: import("effect/Schema").Struct<{
|
|
229
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
230
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
231
|
+
readonly name: import("effect/Schema").String;
|
|
232
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
233
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
234
|
+
readonly value: import("effect/Schema").String;
|
|
235
|
+
readonly color: import("effect/Schema").String;
|
|
236
|
+
}>, import("effect/Schema").Struct<{
|
|
237
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
238
|
+
readonly value: import("effect/Schema").String;
|
|
239
|
+
}>, import("effect/Schema").Struct<{
|
|
240
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
241
|
+
readonly value: import("effect/Schema").String;
|
|
242
|
+
}>]>>;
|
|
243
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
244
|
+
}>;
|
|
245
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
246
|
+
}>;
|
|
247
|
+
readonly organizationRole: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
248
|
+
readonly type: import("effect/Schema").Literal<"system">;
|
|
249
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
250
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
251
|
+
readonly name: import("effect/Schema").String;
|
|
252
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
253
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
254
|
+
readonly value: import("effect/Schema").String;
|
|
255
|
+
readonly color: import("effect/Schema").String;
|
|
256
|
+
}>, import("effect/Schema").Struct<{
|
|
257
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
258
|
+
readonly value: import("effect/Schema").String;
|
|
259
|
+
}>, import("effect/Schema").Struct<{
|
|
260
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
261
|
+
readonly value: import("effect/Schema").String;
|
|
262
|
+
}>]>>;
|
|
263
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
264
|
+
}>;
|
|
265
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
266
|
+
readonly systemRoleId: import("effect/Schema").brand<import("effect/Schema").String, "SystemRoleId">;
|
|
267
|
+
readonly key: import("effect/Schema").String;
|
|
268
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
269
|
+
}>, import("effect/Schema").Struct<{
|
|
270
|
+
readonly type: import("effect/Schema").Literal<"custom">;
|
|
271
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
272
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
273
|
+
readonly name: import("effect/Schema").String;
|
|
274
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
275
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
276
|
+
readonly value: import("effect/Schema").String;
|
|
277
|
+
readonly color: import("effect/Schema").String;
|
|
278
|
+
}>, import("effect/Schema").Struct<{
|
|
279
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
280
|
+
readonly value: import("effect/Schema").String;
|
|
281
|
+
}>, import("effect/Schema").Struct<{
|
|
282
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
283
|
+
readonly value: import("effect/Schema").String;
|
|
284
|
+
}>]>>;
|
|
285
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
286
|
+
}>;
|
|
287
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
288
|
+
readonly systemRoleId: import("effect/Schema").Null;
|
|
289
|
+
readonly key: import("effect/Schema").String;
|
|
290
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
291
|
+
}>]>;
|
|
292
|
+
}>>>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError>, Authorization, never> | HttpApiEndpoint.HttpApiEndpoint<"inviteMember", "POST", "/auth/invitation/invite-member", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
293
|
+
readonly organizationRoleId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
294
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
295
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
296
|
+
readonly invitation: import("effect/Schema").Struct<{
|
|
297
|
+
readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
|
|
298
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
299
|
+
readonly organizationId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
300
|
+
readonly status: import("effect/Schema").Literals<readonly ["pending", "accepted", "rejected", "canceled", "expired"]>;
|
|
301
|
+
readonly organizationRoleId: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
302
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
303
|
+
readonly inviterId: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
304
|
+
}>;
|
|
305
|
+
readonly inviter: import("effect/Schema").Struct<{
|
|
306
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
307
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
308
|
+
readonly name: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
309
|
+
readonly image: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
310
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
311
|
+
readonly value: import("effect/Schema").String;
|
|
312
|
+
readonly color: import("effect/Schema").String;
|
|
313
|
+
}>, import("effect/Schema").Struct<{
|
|
314
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
315
|
+
readonly value: import("effect/Schema").String;
|
|
316
|
+
}>, import("effect/Schema").Struct<{
|
|
317
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
318
|
+
readonly value: import("effect/Schema").String;
|
|
319
|
+
}>]>>;
|
|
320
|
+
}>;
|
|
321
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "UserId">;
|
|
322
|
+
readonly lastLoginAt: import("effect/Schema").NullOr<import("effect/Schema").DateTimeUtcFromDate>;
|
|
323
|
+
readonly email: import("effect/Schema").brand<import("effect/Schema").decodeTo<import("effect/Schema").toType<import("effect/Schema").String>, import("effect/Schema").String, never, never>, "Email">;
|
|
324
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
325
|
+
}>;
|
|
326
|
+
readonly organization: import("effect/Schema").Struct<{
|
|
327
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
328
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
329
|
+
readonly name: import("effect/Schema").String;
|
|
330
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
331
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
332
|
+
readonly value: import("effect/Schema").String;
|
|
333
|
+
readonly color: import("effect/Schema").String;
|
|
334
|
+
}>, import("effect/Schema").Struct<{
|
|
335
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
336
|
+
readonly value: import("effect/Schema").String;
|
|
337
|
+
}>, import("effect/Schema").Struct<{
|
|
338
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
339
|
+
readonly value: import("effect/Schema").String;
|
|
340
|
+
}>]>>;
|
|
341
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
342
|
+
}>;
|
|
343
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationId">;
|
|
344
|
+
}>;
|
|
345
|
+
readonly organizationRole: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
346
|
+
readonly type: import("effect/Schema").Literal<"system">;
|
|
347
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
348
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
349
|
+
readonly name: import("effect/Schema").String;
|
|
350
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
351
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
352
|
+
readonly value: import("effect/Schema").String;
|
|
353
|
+
readonly color: import("effect/Schema").String;
|
|
354
|
+
}>, import("effect/Schema").Struct<{
|
|
355
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
356
|
+
readonly value: import("effect/Schema").String;
|
|
357
|
+
}>, import("effect/Schema").Struct<{
|
|
358
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
359
|
+
readonly value: import("effect/Schema").String;
|
|
360
|
+
}>]>>;
|
|
361
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
362
|
+
}>;
|
|
363
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
364
|
+
readonly systemRoleId: import("effect/Schema").brand<import("effect/Schema").String, "SystemRoleId">;
|
|
365
|
+
readonly key: import("effect/Schema").String;
|
|
366
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
367
|
+
}>, import("effect/Schema").Struct<{
|
|
368
|
+
readonly type: import("effect/Schema").Literal<"custom">;
|
|
369
|
+
readonly metadata: import("effect/Schema").Struct<{
|
|
370
|
+
readonly version: import("effect/Schema").Literal<1>;
|
|
371
|
+
readonly name: import("effect/Schema").String;
|
|
372
|
+
readonly logo: import("effect/Schema").optionalKey<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
373
|
+
readonly type: import("effect/Schema").Literal<"icon">;
|
|
374
|
+
readonly value: import("effect/Schema").String;
|
|
375
|
+
readonly color: import("effect/Schema").String;
|
|
376
|
+
}>, import("effect/Schema").Struct<{
|
|
377
|
+
readonly type: import("effect/Schema").Literal<"emoji">;
|
|
378
|
+
readonly value: import("effect/Schema").String;
|
|
379
|
+
}>, import("effect/Schema").Struct<{
|
|
380
|
+
readonly type: import("effect/Schema").Literal<"image">;
|
|
381
|
+
readonly value: import("effect/Schema").String;
|
|
382
|
+
}>]>>;
|
|
383
|
+
readonly description: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
384
|
+
}>;
|
|
385
|
+
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "OrganizationRoleId">;
|
|
386
|
+
readonly systemRoleId: import("effect/Schema").Null;
|
|
387
|
+
readonly key: import("effect/Schema").String;
|
|
388
|
+
readonly permissions: import("effect/Schema").$Array<import("effect/Schema").Literals<readonly ["organization:read", "organization:update", "member:read", "member:update", "member:remove", "invitation:read", "invitation:create", "invitation:cancel", "role:read", "role:create", "role:update", "role:delete", "billing:read", "billing:update", "billing:cancel", "wallet:read", "wallet:create", "wallet:update", "session-key:read", "session-key:create", "session-key:revoke", "api-key:read", "api-key:create", "api-key:revoke", "execution:read", "mcp-authorization:read", "mcp-authorization:create", "mcp-authorization:revoke", "cli-authorization:read", "cli-authorization:create", "cli-authorization:revoke"]>>;
|
|
389
|
+
}>]>;
|
|
390
|
+
}>>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").BillingLimitExceededError | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError | typeof import("@namera-ai/protocol").OrganizationNotFoundError | typeof import("@namera-ai/protocol").OrganizationPermissionError>, Authorization, never> | HttpApiEndpoint.HttpApiEndpoint<"acceptInvitation", "POST", "/auth/invitation/accept-invitation", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
391
|
+
readonly invitationId: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
392
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Void>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError | typeof import("@namera-ai/protocol").OrganizationNotFoundError | typeof import("@namera-ai/protocol").OrganizationPermissionError>, Authorization, never> | HttpApiEndpoint.HttpApiEndpoint<"rejectInvitation", "POST", "/auth/invitation/reject-invitation", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
393
|
+
readonly invitationId: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
394
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Void>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError | typeof import("@namera-ai/protocol").OrganizationNotFoundError | typeof import("@namera-ai/protocol").OrganizationPermissionError>, Authorization, never> | HttpApiEndpoint.HttpApiEndpoint<"cancelInvitation", "POST", "/auth/invitation/cancel-invitation", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
|
|
395
|
+
readonly invitationId: import("effect/Schema").brand<import("effect/Schema").String, "InvitationId">;
|
|
396
|
+
}>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Void>, import("effect/Schema").toCodecJson<import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").Forbidden> | import("effect/unstable/httpapi/HttpApiSchema").asNoContent<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError> | typeof import("@namera-ai/protocol").RateLimitExceeded | typeof import("@namera-ai/protocol").InvitationNotFoundError | typeof import("@namera-ai/protocol").InvitationConflictError | typeof import("@namera-ai/protocol").InvitationRecipientMismatchError | typeof import("@namera-ai/protocol").OrganizationNotFoundError | typeof import("@namera-ai/protocol").OrganizationPermissionError>, Authorization, never>, false>;
|
|
397
|
+
declare class InvitationGroup extends InvitationGroup_base {}
|
|
398
|
+
//#endregion
|
|
399
|
+
export { InvitationGroup };
|
|
400
|
+
//# sourceMappingURL=invitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.d.ts","names":[],"sources":["../../../../src/routes/auth/organization/invitation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqBa,wBAAwB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CommonErrors } from "../../../common.js";
|
|
2
|
+
import { Authorization } from "../../../middlewares/auth.js";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
+
import { BillingErrors, InvitationErrors, OrganizationErrors } from "@namera-ai/protocol";
|
|
5
|
+
import { AcceptInvitationRequest, AcceptInvitationResponse, CancelInvitationRequest, CancelInvitationResponse, GetInvitationRequest, GetInvitationResponse, InviteMemberRequest, InviteMemberResponse, ListOrganizationInvitationsResponse, ListUserInvitationsResponse, RejectInvitationRequest, RejectInvitationResponse } from "@namera-ai/protocol/dto";
|
|
6
|
+
|
|
7
|
+
//#region src/routes/auth/organization/invitation.ts
|
|
8
|
+
var InvitationGroup = class extends HttpApiGroup.make("invitation").add(HttpApiEndpoint.get("getInvitation", "/get-invitation", {
|
|
9
|
+
query: GetInvitationRequest,
|
|
10
|
+
error: [...InvitationErrors, ...CommonErrors],
|
|
11
|
+
success: GetInvitationResponse
|
|
12
|
+
}).annotate(OpenApi.Summary, "Get an invitation for the current user"), HttpApiEndpoint.get("listInvitations", "/list-invitations", {
|
|
13
|
+
error: [...InvitationErrors, ...CommonErrors],
|
|
14
|
+
success: ListOrganizationInvitationsResponse
|
|
15
|
+
}).annotate(OpenApi.Summary, "List invitations for the active organization"), HttpApiEndpoint.get("listUserInvitations", "/list-user-invitations", {
|
|
16
|
+
error: [...InvitationErrors, ...CommonErrors],
|
|
17
|
+
success: ListUserInvitationsResponse
|
|
18
|
+
}).annotate(OpenApi.Summary, "List invitations received by the current user"), HttpApiEndpoint.post("inviteMember", "/invite-member", {
|
|
19
|
+
payload: InviteMemberRequest,
|
|
20
|
+
error: [
|
|
21
|
+
...BillingErrors,
|
|
22
|
+
...InvitationErrors,
|
|
23
|
+
...OrganizationErrors,
|
|
24
|
+
...CommonErrors
|
|
25
|
+
],
|
|
26
|
+
success: InviteMemberResponse
|
|
27
|
+
}).annotate(OpenApi.Summary, "Invite a member to the active organization"), HttpApiEndpoint.post("acceptInvitation", "/accept-invitation", {
|
|
28
|
+
payload: AcceptInvitationRequest,
|
|
29
|
+
error: [
|
|
30
|
+
...InvitationErrors,
|
|
31
|
+
...OrganizationErrors,
|
|
32
|
+
...CommonErrors
|
|
33
|
+
],
|
|
34
|
+
success: AcceptInvitationResponse
|
|
35
|
+
}).annotate(OpenApi.Summary, "Accept an organization invitation"), HttpApiEndpoint.post("rejectInvitation", "/reject-invitation", {
|
|
36
|
+
payload: RejectInvitationRequest,
|
|
37
|
+
error: [
|
|
38
|
+
...InvitationErrors,
|
|
39
|
+
...OrganizationErrors,
|
|
40
|
+
...CommonErrors
|
|
41
|
+
],
|
|
42
|
+
success: RejectInvitationResponse
|
|
43
|
+
}).annotate(OpenApi.Summary, "Reject an organization invitation"), HttpApiEndpoint.post("cancelInvitation", "/cancel-invitation", {
|
|
44
|
+
payload: CancelInvitationRequest,
|
|
45
|
+
error: [
|
|
46
|
+
...InvitationErrors,
|
|
47
|
+
...OrganizationErrors,
|
|
48
|
+
...CommonErrors
|
|
49
|
+
],
|
|
50
|
+
success: CancelInvitationResponse
|
|
51
|
+
}).annotate(OpenApi.Summary, "Cancel an organization invitation")).annotate(OpenApi.Description, "Organization invitations").middleware(Authorization).prefix("/auth/invitation") {};
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { InvitationGroup };
|
|
55
|
+
//# sourceMappingURL=invitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitation.js","names":[],"sources":["../../../../src/routes/auth/organization/invitation.ts"],"sourcesContent":["import { HttpApiEndpoint, HttpApiGroup, OpenApi } from \"effect/unstable/httpapi\";\n\nimport { BillingErrors, InvitationErrors, OrganizationErrors } from \"@namera-ai/protocol\";\nimport {\n AcceptInvitationRequest,\n AcceptInvitationResponse,\n CancelInvitationRequest,\n CancelInvitationResponse,\n GetInvitationRequest,\n GetInvitationResponse,\n InviteMemberRequest,\n InviteMemberResponse,\n ListOrganizationInvitationsResponse,\n ListUserInvitationsResponse,\n RejectInvitationRequest,\n RejectInvitationResponse,\n} from \"@namera-ai/protocol/dto\";\n\nimport { CommonErrors } from \"#/common\";\nimport { Authorization } from \"#/middlewares/index\";\n\nexport class InvitationGroup extends HttpApiGroup.make(\"invitation\")\n .add(\n HttpApiEndpoint.get(\"getInvitation\", \"/get-invitation\", {\n query: GetInvitationRequest,\n error: [...InvitationErrors, ...CommonErrors],\n success: GetInvitationResponse,\n }).annotate(OpenApi.Summary, \"Get an invitation for the current user\"),\n HttpApiEndpoint.get(\"listInvitations\", \"/list-invitations\", {\n error: [...InvitationErrors, ...CommonErrors],\n success: ListOrganizationInvitationsResponse,\n }).annotate(OpenApi.Summary, \"List invitations for the active organization\"),\n HttpApiEndpoint.get(\"listUserInvitations\", \"/list-user-invitations\", {\n error: [...InvitationErrors, ...CommonErrors],\n success: ListUserInvitationsResponse,\n }).annotate(OpenApi.Summary, \"List invitations received by the current user\"),\n HttpApiEndpoint.post(\"inviteMember\", \"/invite-member\", {\n payload: InviteMemberRequest,\n error: [...BillingErrors, ...InvitationErrors, ...OrganizationErrors, ...CommonErrors],\n success: InviteMemberResponse,\n }).annotate(OpenApi.Summary, \"Invite a member to the active organization\"),\n HttpApiEndpoint.post(\"acceptInvitation\", \"/accept-invitation\", {\n payload: AcceptInvitationRequest,\n error: [...InvitationErrors, ...OrganizationErrors, ...CommonErrors],\n success: AcceptInvitationResponse,\n }).annotate(OpenApi.Summary, \"Accept an organization invitation\"),\n HttpApiEndpoint.post(\"rejectInvitation\", \"/reject-invitation\", {\n payload: RejectInvitationRequest,\n error: [...InvitationErrors, ...OrganizationErrors, ...CommonErrors],\n success: RejectInvitationResponse,\n }).annotate(OpenApi.Summary, \"Reject an organization invitation\"),\n HttpApiEndpoint.post(\"cancelInvitation\", \"/cancel-invitation\", {\n payload: CancelInvitationRequest,\n error: [...InvitationErrors, ...OrganizationErrors, ...CommonErrors],\n success: CancelInvitationResponse,\n }).annotate(OpenApi.Summary, \"Cancel an organization invitation\"),\n )\n .annotate(OpenApi.Description, \"Organization invitations\")\n .middleware(Authorization)\n .prefix(\"/auth/invitation\") {}\n"],"mappings":";;;;;;;AAqBA,IAAa,kBAAb,cAAqC,aAAa,KAAK,YAAY,CAAC,CACjE,IACC,gBAAgB,IAAI,iBAAiB,mBAAmB;CACtD,OAAO;CACP,OAAO,CAAC,GAAG,kBAAkB,GAAG,YAAY;CAC5C,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,wCAAwC,GACrE,gBAAgB,IAAI,mBAAmB,qBAAqB;CAC1D,OAAO,CAAC,GAAG,kBAAkB,GAAG,YAAY;CAC5C,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,8CAA8C,GAC3E,gBAAgB,IAAI,uBAAuB,0BAA0B;CACnE,OAAO,CAAC,GAAG,kBAAkB,GAAG,YAAY;CAC5C,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,+CAA+C,GAC5E,gBAAgB,KAAK,gBAAgB,kBAAkB;CACrD,SAAS;CACT,OAAO;EAAC,GAAG;EAAe,GAAG;EAAkB,GAAG;EAAoB,GAAG;CAAY;CACrF,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,4CAA4C,GACzE,gBAAgB,KAAK,oBAAoB,sBAAsB;CAC7D,SAAS;CACT,OAAO;EAAC,GAAG;EAAkB,GAAG;EAAoB,GAAG;CAAY;CACnE,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,mCAAmC,GAChE,gBAAgB,KAAK,oBAAoB,sBAAsB;CAC7D,SAAS;CACT,OAAO;EAAC,GAAG;EAAkB,GAAG;EAAoB,GAAG;CAAY;CACnE,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,mCAAmC,GAChE,gBAAgB,KAAK,oBAAoB,sBAAsB;CAC7D,SAAS;CACT,OAAO;EAAC,GAAG;EAAkB,GAAG;EAAoB,GAAG;CAAY;CACnE,SAAS;AACX,CAAC,CAAC,CAAC,SAAS,QAAQ,SAAS,mCAAmC,CAClE,CAAC,CACA,SAAS,QAAQ,aAAa,0BAA0B,CAAC,CACzD,WAAW,aAAa,CAAC,CACzB,OAAO,kBAAkB,CAAC,CAAC,CAAC"}
|