@fengsoft/auth-organizations 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package will be documented in this file.
4
+
5
+ ## 0.1.0
6
+
7
+ - Initial public release.
package/LICENSE ADDED
@@ -0,0 +1,100 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
13
+ owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities
16
+ that control, are controlled by, or are under common control with that entity.
17
+ For the purposes of this definition, "control" means (i) the power, direct or
18
+ indirect, to cause the direction or management of such entity, whether by
19
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
23
+ permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications, including
26
+ but not limited to software source code, documentation source, and configuration
27
+ files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or
30
+ translation of a Source form, including but not limited to compiled object code,
31
+ generated documentation, and conversions to other media types.
32
+
33
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
34
+ available under the License, as indicated by a copyright notice that is included
35
+ in or attached to the work.
36
+
37
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
38
+ is based on (or derived from) the Work and for which the editorial revisions,
39
+ annotations, elaborations, or other modifications represent, as a whole, an
40
+ original work of authorship.
41
+
42
+ "Contribution" shall mean any work of authorship, including the original version
43
+ of the Work and any modifications or additions to that Work or Derivative Works,
44
+ that is intentionally submitted to Licensor for inclusion in the Work by the
45
+ copyright owner or by an individual or Legal Entity authorized to submit on
46
+ behalf of the copyright owner.
47
+
48
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
49
+ of whom a Contribution has been received by Licensor and subsequently
50
+ incorporated within the Work.
51
+
52
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
53
+ License, each Contributor hereby grants to You a perpetual, worldwide,
54
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
55
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
56
+ sublicense, and distribute the Work and such Derivative Works in Source or
57
+ Object form.
58
+
59
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
60
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
61
+ no-charge, royalty-free, irrevocable patent license to make, have made, use,
62
+ offer to sell, sell, import, and otherwise transfer the Work.
63
+
64
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
65
+ Derivative Works thereof in any medium, with or without modifications, and in
66
+ Source or Object form, provided that You meet the following conditions:
67
+
68
+ You must give any other recipients of the Work or Derivative Works a copy of
69
+ this License; and
70
+
71
+ You must cause any modified files to carry prominent notices stating that You
72
+ changed the files; and
73
+
74
+ You must retain, in the Source form of any Derivative Works that You distribute,
75
+ all copyright, patent, trademark, and attribution notices from the Source form
76
+ of the Work; and
77
+
78
+ If the Work includes a "NOTICE" text file as part of its distribution, then any
79
+ Derivative Works that You distribute must include a readable copy of the
80
+ attribution notices contained within such NOTICE file.
81
+
82
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
83
+ Contribution intentionally submitted for inclusion in the Work by You to the
84
+ Licensor shall be under the terms and conditions of this License.
85
+
86
+ 6. Trademarks. This License does not grant permission to use the trade names,
87
+ trademarks, service marks, or product names of the Licensor.
88
+
89
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
90
+ writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR
91
+ CONDITIONS OF ANY KIND, either express or implied.
92
+
93
+ 8. Limitation of Liability. In no event and under no legal theory shall any
94
+ Contributor be liable to You for damages arising as a result of this License or
95
+ out of the use or inability to use the Work.
96
+
97
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
98
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
99
+ acceptance of support, warranty, indemnity, or other liability obligations.
100
+
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @fengsoft/auth-organizations
2
+
3
+ Organization, invitation, membership, and active-organization workflows built on Better Auth.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @fengsoft/auth-organizations better-auth
9
+ ```
10
+
11
+ ## Use When
12
+
13
+ - your product is multi-tenant and needs organization-aware auth behavior
14
+ - you need reusable invite and membership flows before product-specific workspace rules
15
+
16
+ ## Related Packages
17
+
18
+ - `@fengsoft/auth-core`
19
+ - `@fengsoft/auth-contracts`
20
+
21
+ ## Source
22
+
23
+ - Repo: `fengsoft/auth-core`
24
+ - Docs: see the root repository README and docs app for architecture and adoption guides
@@ -0,0 +1,89 @@
1
+ import type { Id, Timestamp } from "@fengsoft/foundation-contracts";
2
+ export declare const AUTH_ROLES: readonly ["owner", "admin", "member", "viewer"];
3
+ export type AuthRole = (typeof AUTH_ROLES)[number];
4
+ export type AuthPermission = string;
5
+ export type AuthUser = {
6
+ id: Id;
7
+ email: string;
8
+ name: string | null;
9
+ emailVerified: boolean;
10
+ createdAt: Timestamp;
11
+ updatedAt: Timestamp;
12
+ };
13
+ export type AuthSession = {
14
+ id: Id;
15
+ user: AuthUser;
16
+ activeOrganizationId: Id | null;
17
+ expiresAt: Timestamp;
18
+ createdAt: Timestamp;
19
+ };
20
+ export type AuthOrganization = {
21
+ id: Id;
22
+ name: string;
23
+ slug: string;
24
+ createdAt: Timestamp;
25
+ updatedAt: Timestamp;
26
+ };
27
+ export type AuthMembership = {
28
+ id: Id;
29
+ organizationId: Id;
30
+ userId: Id;
31
+ role: AuthRole;
32
+ permissions: AuthPermission[];
33
+ createdAt: Timestamp;
34
+ };
35
+ export type AuthInvite = {
36
+ id: Id;
37
+ email: string;
38
+ organizationId: Id;
39
+ role: AuthRole;
40
+ status: "pending" | "accepted" | "revoked";
41
+ expiresAt: Timestamp;
42
+ createdAt: Timestamp;
43
+ };
44
+ export type AuthApiKeyOwnerType = "user" | "organization";
45
+ export type AuthApiKeyPermissions = Record<string, string[]>;
46
+ export type AuthApiKey = {
47
+ id: Id;
48
+ configId: string;
49
+ label: string | null;
50
+ start: string | null;
51
+ prefix: string | null;
52
+ ownerType: AuthApiKeyOwnerType;
53
+ ownerId: Id;
54
+ enabled: boolean;
55
+ permissions: AuthApiKeyPermissions | null;
56
+ metadata: Record<string, unknown> | null;
57
+ rateLimitEnabled: boolean;
58
+ rateLimitTimeWindow: number | null;
59
+ rateLimitMax: number | null;
60
+ requestCount: number;
61
+ remaining: number | null;
62
+ refillAmount: number | null;
63
+ refillInterval: number | null;
64
+ lastRefillAt: Timestamp | null;
65
+ lastUsedAt: Timestamp | null;
66
+ expiresAt: Timestamp | null;
67
+ createdAt: Timestamp;
68
+ updatedAt: Timestamp;
69
+ };
70
+ export type CreatedAuthApiKey = {
71
+ apiKey: AuthApiKey;
72
+ secret: string;
73
+ };
74
+ export type AuthApiKeyVerificationResult = {
75
+ valid: boolean;
76
+ apiKey: AuthApiKey | null;
77
+ errorCode: string | null;
78
+ errorMessage: string | null;
79
+ };
80
+ export type AuthAuditEvent = {
81
+ id: Id;
82
+ action: string;
83
+ actorId: Id | null;
84
+ organizationId: Id | null;
85
+ resourceType: string;
86
+ resourceId: Id | null;
87
+ createdAt: Timestamp;
88
+ };
89
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../auth-contracts/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,UAAU,iDA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C,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,EAAE,CAAC;IACP,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;IACnB,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const AUTH_ROLES = ["owner", "admin", "member", "viewer"];
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../auth-contracts/src/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC"}
@@ -0,0 +1,77 @@
1
+ import type { AuthInvite, AuthMembership, AuthOrganization, AuthRole } from "@fengsoft/auth-contracts";
2
+ type AuthHeaders = Headers | Array<[string, string]> | Record<string, string>;
3
+ export type OrganizationRequestContext = {
4
+ headers: AuthHeaders;
5
+ };
6
+ export type OrganizationLookupInput = {
7
+ organizationId?: string;
8
+ organizationSlug?: string;
9
+ };
10
+ export type CreateOrganizationInput = {
11
+ name: string;
12
+ slug: string;
13
+ ownerUserId?: string;
14
+ logo?: string;
15
+ metadata?: Record<string, unknown>;
16
+ keepCurrentActiveOrganization?: boolean;
17
+ };
18
+ export type InviteMemberInput = OrganizationLookupInput & {
19
+ email: string;
20
+ role: AuthRole;
21
+ resend?: boolean;
22
+ };
23
+ export type AcceptInviteInput = {
24
+ invitationId: string;
25
+ };
26
+ export type RevokeInviteInput = {
27
+ invitationId: string;
28
+ };
29
+ export type GetOrganizationInput = OrganizationLookupInput & {
30
+ membersLimit?: number;
31
+ };
32
+ export type ListMembershipsInput = OrganizationLookupInput & {
33
+ limit?: number;
34
+ offset?: number;
35
+ sortBy?: string;
36
+ sortDirection?: "asc" | "desc";
37
+ };
38
+ export type SwitchActiveOrganizationInput = {
39
+ organizationId?: string | null;
40
+ organizationSlug?: string;
41
+ };
42
+ export type UpdateMemberRoleInput = {
43
+ memberId: string;
44
+ role: AuthRole;
45
+ organizationId?: string;
46
+ };
47
+ export type RemoveMemberInput = {
48
+ memberIdOrEmail: string;
49
+ organizationId?: string;
50
+ };
51
+ export type AuthOrganizationDetails = {
52
+ organization: AuthOrganization;
53
+ invitations: AuthInvite[];
54
+ memberships: AuthMembership[];
55
+ };
56
+ export type AcceptInviteResult = {
57
+ invitation: AuthInvite;
58
+ membership: AuthMembership | null;
59
+ };
60
+ export type OrganizationService = {
61
+ createOrganization: (context: OrganizationRequestContext, input: CreateOrganizationInput) => Promise<AuthOrganization>;
62
+ getOrganization: (context: OrganizationRequestContext, input: GetOrganizationInput) => Promise<AuthOrganizationDetails | null>;
63
+ listOrganizations: (context: OrganizationRequestContext) => Promise<AuthOrganization[]>;
64
+ inviteMember: (context: OrganizationRequestContext, input: InviteMemberInput) => Promise<AuthInvite>;
65
+ acceptInvite: (context: OrganizationRequestContext, input: AcceptInviteInput) => Promise<AcceptInviteResult>;
66
+ revokeInvite: (context: OrganizationRequestContext, input: RevokeInviteInput) => Promise<AuthInvite | null>;
67
+ listMemberships: (context: OrganizationRequestContext, input: ListMembershipsInput) => Promise<AuthMembership[]>;
68
+ switchActiveOrganization: (context: OrganizationRequestContext, input: SwitchActiveOrganizationInput) => Promise<AuthOrganization | null>;
69
+ updateMemberRole: (context: OrganizationRequestContext, input: UpdateMemberRoleInput) => Promise<AuthMembership>;
70
+ removeMember: (context: OrganizationRequestContext, input: RemoveMemberInput) => Promise<AuthMembership>;
71
+ };
72
+ export declare function createOrganizationService(service: OrganizationService): OrganizationService;
73
+ export declare function createBetterAuthOrganizationService(auth: {
74
+ api: unknown;
75
+ }): OrganizationService;
76
+ export {};
77
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,MAAM,0BAA0B,CAAC;AAGlC,KAAK,WAAW,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAiI9E,MAAM,MAAM,0BAA0B,GAAG;IACxC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAA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AG,IAAI,CAAC,CAAC;IAC7C,iBAAiB,EAAE,CAClB,OAAO,EAAE,0BAA0B,KAC/B,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACjC,YAAY,EAAE,CACb,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,iBAAiB,KACpB,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,YAAY,EAAE,CACb,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,iBAAiB,KACpB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,YAAY,EAAE,CACb,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,iBAAiB,KACpB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAChC,eAAe,EAAE,CAChB,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,oBAAoB,KACvB,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC/B,wBAAwB,EAAE,CACzB,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,6BAA6B,KAChC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACtC,gBAAgB,EAAE,CACjB,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,qBAAqB,KACxB,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,YAAY,EAAE,CACb,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,iBAAiB,KACpB,OAAO,CAAC,cAAc,CAAC,CAAC;CAC7B,CAAC;AAkFF,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,mBAAmB,GAC1B,mBAAmB,CAErB;AAED,wBAAgB,mCAAmC,CAAC,IAAI,EAAE;IACzD,GAAG,EAAE,OAAO,CAAC;CACb,GAAG,mBAAmB,CA4HtB"}
@@ -0,0 +1,179 @@
1
+ function normalizeTimestamp(value) {
2
+ return value instanceof Date
3
+ ? value.toISOString()
4
+ : new Date(value).toISOString();
5
+ }
6
+ function toHeaders(headers) {
7
+ return new Headers(headers);
8
+ }
9
+ function normalizeRole(role) {
10
+ return role;
11
+ }
12
+ function normalizeInvitationStatus(status) {
13
+ switch (status) {
14
+ case "accepted":
15
+ return "accepted";
16
+ case "pending":
17
+ return "pending";
18
+ default:
19
+ return "revoked";
20
+ }
21
+ }
22
+ function normalizeOrganization(organization) {
23
+ return {
24
+ id: organization.id,
25
+ name: organization.name,
26
+ slug: organization.slug,
27
+ createdAt: normalizeTimestamp(organization.createdAt),
28
+ updatedAt: normalizeTimestamp(organization.updatedAt ?? organization.createdAt),
29
+ };
30
+ }
31
+ function normalizeMembership(membership) {
32
+ return {
33
+ id: membership.id,
34
+ organizationId: membership.organizationId,
35
+ userId: membership.userId,
36
+ role: normalizeRole(membership.role),
37
+ permissions: [],
38
+ createdAt: normalizeTimestamp(membership.createdAt),
39
+ };
40
+ }
41
+ function normalizeInvite(invitation) {
42
+ return {
43
+ id: invitation.id,
44
+ email: invitation.email,
45
+ organizationId: invitation.organizationId,
46
+ role: normalizeRole(invitation.role),
47
+ status: normalizeInvitationStatus(invitation.status),
48
+ expiresAt: normalizeTimestamp(invitation.expiresAt),
49
+ createdAt: normalizeTimestamp(invitation.createdAt),
50
+ };
51
+ }
52
+ function normalizeOrganizationDetails(details) {
53
+ return {
54
+ organization: normalizeOrganization(details),
55
+ invitations: details.invitations.map(normalizeInvite),
56
+ memberships: details.members.map(normalizeMembership),
57
+ };
58
+ }
59
+ function toOrganizationAuthClient(auth) {
60
+ return auth;
61
+ }
62
+ export function createOrganizationService(service) {
63
+ return service;
64
+ }
65
+ export function createBetterAuthOrganizationService(auth) {
66
+ const authClient = toOrganizationAuthClient(auth);
67
+ return createOrganizationService({
68
+ createOrganization: async (context, input) => {
69
+ const created = await authClient.api.createOrganization({
70
+ headers: toHeaders(context.headers),
71
+ body: {
72
+ keepCurrentActiveOrganization: input.keepCurrentActiveOrganization,
73
+ logo: input.logo,
74
+ metadata: input.metadata,
75
+ name: input.name,
76
+ slug: input.slug,
77
+ userId: input.ownerUserId,
78
+ },
79
+ });
80
+ return normalizeOrganization(created);
81
+ },
82
+ getOrganization: async (context, input) => {
83
+ const details = await authClient.api.getFullOrganization({
84
+ headers: toHeaders(context.headers),
85
+ query: {
86
+ membersLimit: input.membersLimit,
87
+ organizationId: input.organizationId,
88
+ organizationSlug: input.organizationSlug,
89
+ },
90
+ });
91
+ return details ? normalizeOrganizationDetails(details) : null;
92
+ },
93
+ listOrganizations: async (context) => {
94
+ const organizations = await authClient.api.listOrganizations({
95
+ headers: toHeaders(context.headers),
96
+ });
97
+ return organizations.map(normalizeOrganization);
98
+ },
99
+ inviteMember: async (context, input) => {
100
+ const invitation = await authClient.api.createInvitation({
101
+ headers: toHeaders(context.headers),
102
+ body: {
103
+ email: input.email,
104
+ organizationId: input.organizationId,
105
+ resend: input.resend,
106
+ role: input.role,
107
+ },
108
+ });
109
+ return normalizeInvite(invitation);
110
+ },
111
+ acceptInvite: async (context, input) => {
112
+ const result = await authClient.api.acceptInvitation({
113
+ headers: toHeaders(context.headers),
114
+ body: {
115
+ invitationId: input.invitationId,
116
+ },
117
+ });
118
+ return {
119
+ invitation: normalizeInvite(result.invitation),
120
+ membership: result.member ? normalizeMembership(result.member) : null,
121
+ };
122
+ },
123
+ revokeInvite: async (context, input) => {
124
+ const result = await authClient.api.cancelInvitation({
125
+ headers: toHeaders(context.headers),
126
+ body: {
127
+ invitationId: input.invitationId,
128
+ },
129
+ });
130
+ return result.invitation ? normalizeInvite(result.invitation) : null;
131
+ },
132
+ listMemberships: async (context, input) => {
133
+ const result = await authClient.api.listMembers({
134
+ headers: toHeaders(context.headers),
135
+ query: {
136
+ limit: input.limit,
137
+ offset: input.offset,
138
+ organizationId: input.organizationId,
139
+ organizationSlug: input.organizationSlug,
140
+ sortBy: input.sortBy,
141
+ sortDirection: input.sortDirection,
142
+ },
143
+ });
144
+ return result.members.map(normalizeMembership);
145
+ },
146
+ switchActiveOrganization: async (context, input) => {
147
+ const organization = await authClient.api.setActiveOrganization({
148
+ headers: toHeaders(context.headers),
149
+ body: {
150
+ organizationId: input.organizationId,
151
+ organizationSlug: input.organizationSlug,
152
+ },
153
+ });
154
+ return organization ? normalizeOrganization(organization) : null;
155
+ },
156
+ updateMemberRole: async (context, input) => {
157
+ const member = await authClient.api.updateMemberRole({
158
+ headers: toHeaders(context.headers),
159
+ body: {
160
+ memberId: input.memberId,
161
+ organizationId: input.organizationId,
162
+ role: input.role,
163
+ },
164
+ });
165
+ return normalizeMembership(member);
166
+ },
167
+ removeMember: async (context, input) => {
168
+ const result = await authClient.api.removeMember({
169
+ headers: toHeaders(context.headers),
170
+ body: {
171
+ memberIdOrEmail: input.memberIdOrEmail,
172
+ organizationId: input.organizationId,
173
+ },
174
+ });
175
+ return normalizeMembership(result.member);
176
+ },
177
+ });
178
+ }
179
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAyPA,SAAS,kBAAkB,CAAC,KAAoB;IAC/C,OAAO,KAAK,YAAY,IAAI;QAC3B,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE;QACrB,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,SAAS,CAAC,OAAoB;IACtC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IAClC,OAAO,IAAgB,CAAC;AACzB,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAc;IAChD,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,UAAU;YACd,OAAO,UAAU,CAAC;QACnB,KAAK,SAAS;YACb,OAAO,SAAS,CAAC;QAClB;YACC,OAAO,SAAS,CAAC;IACnB,CAAC;AACF,CAAC;AAED,SAAS,qBAAqB,CAC7B,YAA2C;IAE3C,OAAO;QACN,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,IAAI,EAAE,YA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EAAE,KAAK,EAAE,EAAE;YAC1C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC;gBACpD,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;gBACnC,IAAI,EAAE;oBACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,cAAc,EAAE,KAAK,CAAC,cAAc;oBACpC,IAAI,EAAE,KAAK,CAAC,IAAI;iBAChB;aACD,CAAC,CAAC;YAEH,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;YACtC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;gBAChD,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;gBACnC,IAAI,EAAE;oBACL,eAAe,EAAE,KAAK,CAAC,eAAe;oBACtC,cAAc,EAAE,KAAK,CAAC,cAAc;iBACpC;aACD,CAAC,CAAC;YAEH,OAAO,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ export type Id = string;
2
+ export type Timestamp = string;
3
+ export type MetadataValue = string | number | boolean | null | MetadataValue[] | {
4
+ [key: string]: MetadataValue;
5
+ };
6
+ export type Metadata = Record<string, MetadataValue>;
7
+ export type ErrorEnvelope = {
8
+ code: string;
9
+ message: string;
10
+ status: number;
11
+ requestId?: string;
12
+ details?: Metadata;
13
+ };
14
+ export type PageRequest = {
15
+ cursor?: string | null;
16
+ limit?: number;
17
+ };
18
+ export type PageResult<TItem> = {
19
+ items: TItem[];
20
+ nextCursor: string | null;
21
+ totalCount?: number;
22
+ };
23
+ export declare function createErrorEnvelope(input: ErrorEnvelope): ErrorEnvelope;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../foundation-contracts/src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;AACxB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,aAAa,GACtB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,aAAa,EAAE,GACf;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAEpC,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,KAAK,IAAI;IAC/B,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAEvE"}
@@ -0,0 +1,4 @@
1
+ export function createErrorEnvelope(input) {
2
+ return input;
3
+ }
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../foundation-contracts/src/index.ts"],"names":[],"mappings":"AA+BA,MAAM,UAAU,mBAAmB,CAAC,KAAoB;IACvD,OAAO,KAAK,CAAC;AACd,CAAC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@fengsoft/auth-organizations",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "README.md",
16
+ "CHANGELOG.md",
17
+ "LICENSE"
18
+ ],
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "better-auth": "^1.5.6",
24
+ "@fengsoft/auth-contracts": "0.1.0"
25
+ },
26
+ "scripts": {
27
+ "build": "tsc -p tsconfig.json",
28
+ "typecheck": "tsc --noEmit -p tsconfig.json",
29
+ "lint": "biome check src package.json tsconfig.json"
30
+ }
31
+ }