@sudobility/entity_client 0.0.2

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.
Files changed (41) hide show
  1. package/dist/hooks/index.cjs +30 -0
  2. package/dist/hooks/index.d.ts +8 -0
  3. package/dist/hooks/index.d.ts.map +1 -0
  4. package/dist/hooks/index.js +8 -0
  5. package/dist/hooks/index.js.map +1 -0
  6. package/dist/hooks/useCurrentEntity.cjs +69 -0
  7. package/dist/hooks/useCurrentEntity.d.ts +44 -0
  8. package/dist/hooks/useCurrentEntity.d.ts.map +1 -0
  9. package/dist/hooks/useCurrentEntity.js +65 -0
  10. package/dist/hooks/useCurrentEntity.js.map +1 -0
  11. package/dist/hooks/useEntities.cjs +113 -0
  12. package/dist/hooks/useEntities.d.ts +40 -0
  13. package/dist/hooks/useEntities.d.ts.map +1 -0
  14. package/dist/hooks/useEntities.js +105 -0
  15. package/dist/hooks/useEntities.js.map +1 -0
  16. package/dist/hooks/useEntityMembers.cjs +77 -0
  17. package/dist/hooks/useEntityMembers.d.ts +33 -0
  18. package/dist/hooks/useEntityMembers.d.ts.map +1 -0
  19. package/dist/hooks/useEntityMembers.js +71 -0
  20. package/dist/hooks/useEntityMembers.js.map +1 -0
  21. package/dist/hooks/useInvitations.cjs +132 -0
  22. package/dist/hooks/useInvitations.d.ts +45 -0
  23. package/dist/hooks/useInvitations.d.ts.map +1 -0
  24. package/dist/hooks/useInvitations.js +123 -0
  25. package/dist/hooks/useInvitations.js.map +1 -0
  26. package/dist/index.cjs +58 -0
  27. package/dist/index.d.ts +30 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +39 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/network/EntityClient.cjs +158 -0
  32. package/dist/network/EntityClient.d.ts +90 -0
  33. package/dist/network/EntityClient.d.ts.map +1 -0
  34. package/dist/network/EntityClient.js +154 -0
  35. package/dist/network/EntityClient.js.map +1 -0
  36. package/dist/network/index.cjs +9 -0
  37. package/dist/network/index.d.ts +5 -0
  38. package/dist/network/index.d.ts.map +1 -0
  39. package/dist/network/index.js +5 -0
  40. package/dist/network/index.js.map +1 -0
  41. package/package.json +62 -0
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Entity API Client
4
+ * @description HTTP client for entity/organization API endpoints
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EntityClient = void 0;
8
+ /**
9
+ * HTTP client for entity management APIs.
10
+ */
11
+ class EntityClient {
12
+ constructor(config) {
13
+ this.config = config;
14
+ }
15
+ /**
16
+ * Make an authenticated API request.
17
+ */
18
+ async request(path, options = {}) {
19
+ const token = await this.config.getAuthToken();
20
+ if (!token) {
21
+ return { success: false, error: 'Not authenticated' };
22
+ }
23
+ const url = `${this.config.baseUrl}${path}`;
24
+ const headers = {
25
+ 'Content-Type': 'application/json',
26
+ Authorization: `Bearer ${token}`,
27
+ ...options.headers,
28
+ };
29
+ try {
30
+ const response = await fetch(url, {
31
+ ...options,
32
+ headers,
33
+ });
34
+ const data = await response.json();
35
+ return data;
36
+ }
37
+ catch (error) {
38
+ return { success: false, error: error.message };
39
+ }
40
+ }
41
+ // =============================================================================
42
+ // Entity CRUD
43
+ // =============================================================================
44
+ /**
45
+ * List all entities for the current user.
46
+ */
47
+ async listEntities() {
48
+ return this.request('/entities');
49
+ }
50
+ /**
51
+ * Create a new organization entity.
52
+ */
53
+ async createEntity(request) {
54
+ return this.request('/entities', {
55
+ method: 'POST',
56
+ body: JSON.stringify(request),
57
+ });
58
+ }
59
+ /**
60
+ * Get entity by slug.
61
+ */
62
+ async getEntity(entitySlug) {
63
+ return this.request(`/entities/${entitySlug}`);
64
+ }
65
+ /**
66
+ * Update entity.
67
+ */
68
+ async updateEntity(entitySlug, request) {
69
+ return this.request(`/entities/${entitySlug}`, {
70
+ method: 'PUT',
71
+ body: JSON.stringify(request),
72
+ });
73
+ }
74
+ /**
75
+ * Delete entity (organizations only).
76
+ */
77
+ async deleteEntity(entitySlug) {
78
+ return this.request(`/entities/${entitySlug}`, {
79
+ method: 'DELETE',
80
+ });
81
+ }
82
+ // =============================================================================
83
+ // Member Management
84
+ // =============================================================================
85
+ /**
86
+ * List members of an entity.
87
+ */
88
+ async listMembers(entitySlug) {
89
+ return this.request(`/entities/${entitySlug}/members`);
90
+ }
91
+ /**
92
+ * Update a member's role.
93
+ */
94
+ async updateMemberRole(entitySlug, memberId, role) {
95
+ return this.request(`/entities/${entitySlug}/members/${memberId}`, {
96
+ method: 'PUT',
97
+ body: JSON.stringify({ role }),
98
+ });
99
+ }
100
+ /**
101
+ * Remove a member from the entity.
102
+ */
103
+ async removeMember(entitySlug, memberId) {
104
+ return this.request(`/entities/${entitySlug}/members/${memberId}`, {
105
+ method: 'DELETE',
106
+ });
107
+ }
108
+ // =============================================================================
109
+ // Invitation Management
110
+ // =============================================================================
111
+ /**
112
+ * List invitations for an entity.
113
+ */
114
+ async listEntityInvitations(entitySlug) {
115
+ return this.request(`/entities/${entitySlug}/invitations`);
116
+ }
117
+ /**
118
+ * Create an invitation.
119
+ */
120
+ async createInvitation(entitySlug, request) {
121
+ return this.request(`/entities/${entitySlug}/invitations`, {
122
+ method: 'POST',
123
+ body: JSON.stringify(request),
124
+ });
125
+ }
126
+ /**
127
+ * Cancel an invitation.
128
+ */
129
+ async cancelInvitation(entitySlug, invitationId) {
130
+ return this.request(`/entities/${entitySlug}/invitations/${invitationId}`, {
131
+ method: 'DELETE',
132
+ });
133
+ }
134
+ /**
135
+ * List pending invitations for the current user.
136
+ */
137
+ async listMyInvitations() {
138
+ return this.request('/invitations');
139
+ }
140
+ /**
141
+ * Accept an invitation.
142
+ */
143
+ async acceptInvitation(token) {
144
+ return this.request(`/invitations/${token}/accept`, {
145
+ method: 'POST',
146
+ });
147
+ }
148
+ /**
149
+ * Decline an invitation.
150
+ */
151
+ async declineInvitation(token) {
152
+ return this.request(`/invitations/${token}/decline`, {
153
+ method: 'POST',
154
+ });
155
+ }
156
+ }
157
+ exports.EntityClient = EntityClient;
158
+ //# sourceMappingURL=EntityClient.js.map
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @fileoverview Entity API Client
3
+ * @description HTTP client for entity/organization API endpoints
4
+ */
5
+ import type { CreateEntityRequest, Entity, EntityInvitation, EntityMember, EntityRole, EntityWithRole, InviteMemberRequest, UpdateEntityRequest } from '@sudobility/types';
6
+ /**
7
+ * Configuration for the Entity client.
8
+ */
9
+ export interface EntityClientConfig {
10
+ /** Base URL for the API (e.g., 'https://api.example.com/api/v1') */
11
+ baseUrl: string;
12
+ /** Function to get the current auth token */
13
+ getAuthToken: () => Promise<string | null>;
14
+ }
15
+ /**
16
+ * Standard API response wrapper.
17
+ */
18
+ export interface ApiResponse<T> {
19
+ success: boolean;
20
+ data?: T;
21
+ error?: string;
22
+ }
23
+ /**
24
+ * HTTP client for entity management APIs.
25
+ */
26
+ export declare class EntityClient {
27
+ private readonly config;
28
+ constructor(config: EntityClientConfig);
29
+ /**
30
+ * Make an authenticated API request.
31
+ */
32
+ private request;
33
+ /**
34
+ * List all entities for the current user.
35
+ */
36
+ listEntities(): Promise<ApiResponse<EntityWithRole[]>>;
37
+ /**
38
+ * Create a new organization entity.
39
+ */
40
+ createEntity(request: CreateEntityRequest): Promise<ApiResponse<Entity>>;
41
+ /**
42
+ * Get entity by slug.
43
+ */
44
+ getEntity(entitySlug: string): Promise<ApiResponse<EntityWithRole>>;
45
+ /**
46
+ * Update entity.
47
+ */
48
+ updateEntity(entitySlug: string, request: UpdateEntityRequest): Promise<ApiResponse<Entity>>;
49
+ /**
50
+ * Delete entity (organizations only).
51
+ */
52
+ deleteEntity(entitySlug: string): Promise<ApiResponse<void>>;
53
+ /**
54
+ * List members of an entity.
55
+ */
56
+ listMembers(entitySlug: string): Promise<ApiResponse<EntityMember[]>>;
57
+ /**
58
+ * Update a member's role.
59
+ */
60
+ updateMemberRole(entitySlug: string, memberId: string, role: EntityRole): Promise<ApiResponse<EntityMember>>;
61
+ /**
62
+ * Remove a member from the entity.
63
+ */
64
+ removeMember(entitySlug: string, memberId: string): Promise<ApiResponse<void>>;
65
+ /**
66
+ * List invitations for an entity.
67
+ */
68
+ listEntityInvitations(entitySlug: string): Promise<ApiResponse<EntityInvitation[]>>;
69
+ /**
70
+ * Create an invitation.
71
+ */
72
+ createInvitation(entitySlug: string, request: InviteMemberRequest): Promise<ApiResponse<EntityInvitation>>;
73
+ /**
74
+ * Cancel an invitation.
75
+ */
76
+ cancelInvitation(entitySlug: string, invitationId: string): Promise<ApiResponse<void>>;
77
+ /**
78
+ * List pending invitations for the current user.
79
+ */
80
+ listMyInvitations(): Promise<ApiResponse<EntityInvitation[]>>;
81
+ /**
82
+ * Accept an invitation.
83
+ */
84
+ acceptInvitation(token: string): Promise<ApiResponse<void>>;
85
+ /**
86
+ * Decline an invitation.
87
+ */
88
+ declineInvitation(token: string): Promise<ApiResponse<void>>;
89
+ }
90
+ //# sourceMappingURL=EntityClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityClient.d.ts","sourceRoot":"","sources":["../../src/network/EntityClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,YAAY;IACX,OA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U,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAS7B;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAInE;;OAEG;IACG,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAMjE;;OAEG;IACG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CAKnE"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * @fileoverview Entity API Client
3
+ * @description HTTP client for entity/organization API endpoints
4
+ */
5
+ /**
6
+ * HTTP client for entity management APIs.
7
+ */
8
+ export class EntityClient {
9
+ constructor(config) {
10
+ this.config = config;
11
+ }
12
+ /**
13
+ * Make an authenticated API request.
14
+ */
15
+ async request(path, options = {}) {
16
+ const token = await this.config.getAuthToken();
17
+ if (!token) {
18
+ return { success: false, error: 'Not authenticated' };
19
+ }
20
+ const url = `${this.config.baseUrl}${path}`;
21
+ const headers = {
22
+ 'Content-Type': 'application/json',
23
+ Authorization: `Bearer ${token}`,
24
+ ...options.headers,
25
+ };
26
+ try {
27
+ const response = await fetch(url, {
28
+ ...options,
29
+ headers,
30
+ });
31
+ const data = await response.json();
32
+ return data;
33
+ }
34
+ catch (error) {
35
+ return { success: false, error: error.message };
36
+ }
37
+ }
38
+ // =============================================================================
39
+ // Entity CRUD
40
+ // =============================================================================
41
+ /**
42
+ * List all entities for the current user.
43
+ */
44
+ async listEntities() {
45
+ return this.request('/entities');
46
+ }
47
+ /**
48
+ * Create a new organization entity.
49
+ */
50
+ async createEntity(request) {
51
+ return this.request('/entities', {
52
+ method: 'POST',
53
+ body: JSON.stringify(request),
54
+ });
55
+ }
56
+ /**
57
+ * Get entity by slug.
58
+ */
59
+ async getEntity(entitySlug) {
60
+ return this.request(`/entities/${entitySlug}`);
61
+ }
62
+ /**
63
+ * Update entity.
64
+ */
65
+ async updateEntity(entitySlug, request) {
66
+ return this.request(`/entities/${entitySlug}`, {
67
+ method: 'PUT',
68
+ body: JSON.stringify(request),
69
+ });
70
+ }
71
+ /**
72
+ * Delete entity (organizations only).
73
+ */
74
+ async deleteEntity(entitySlug) {
75
+ return this.request(`/entities/${entitySlug}`, {
76
+ method: 'DELETE',
77
+ });
78
+ }
79
+ // =============================================================================
80
+ // Member Management
81
+ // =============================================================================
82
+ /**
83
+ * List members of an entity.
84
+ */
85
+ async listMembers(entitySlug) {
86
+ return this.request(`/entities/${entitySlug}/members`);
87
+ }
88
+ /**
89
+ * Update a member's role.
90
+ */
91
+ async updateMemberRole(entitySlug, memberId, role) {
92
+ return this.request(`/entities/${entitySlug}/members/${memberId}`, {
93
+ method: 'PUT',
94
+ body: JSON.stringify({ role }),
95
+ });
96
+ }
97
+ /**
98
+ * Remove a member from the entity.
99
+ */
100
+ async removeMember(entitySlug, memberId) {
101
+ return this.request(`/entities/${entitySlug}/members/${memberId}`, {
102
+ method: 'DELETE',
103
+ });
104
+ }
105
+ // =============================================================================
106
+ // Invitation Management
107
+ // =============================================================================
108
+ /**
109
+ * List invitations for an entity.
110
+ */
111
+ async listEntityInvitations(entitySlug) {
112
+ return this.request(`/entities/${entitySlug}/invitations`);
113
+ }
114
+ /**
115
+ * Create an invitation.
116
+ */
117
+ async createInvitation(entitySlug, request) {
118
+ return this.request(`/entities/${entitySlug}/invitations`, {
119
+ method: 'POST',
120
+ body: JSON.stringify(request),
121
+ });
122
+ }
123
+ /**
124
+ * Cancel an invitation.
125
+ */
126
+ async cancelInvitation(entitySlug, invitationId) {
127
+ return this.request(`/entities/${entitySlug}/invitations/${invitationId}`, {
128
+ method: 'DELETE',
129
+ });
130
+ }
131
+ /**
132
+ * List pending invitations for the current user.
133
+ */
134
+ async listMyInvitations() {
135
+ return this.request('/invitations');
136
+ }
137
+ /**
138
+ * Accept an invitation.
139
+ */
140
+ async acceptInvitation(token) {
141
+ return this.request(`/invitations/${token}/accept`, {
142
+ method: 'POST',
143
+ });
144
+ }
145
+ /**
146
+ * Decline an invitation.
147
+ */
148
+ async declineInvitation(token) {
149
+ return this.request(`/invitations/${token}/decline`, {
150
+ method: 'POST',
151
+ });
152
+ }
153
+ }
154
+ //# sourceMappingURL=EntityClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityClient.js","sourceRoot":"","sources":["../../src/network/EntityClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgCH;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB,YAA6B,MAA0B;QAA1B,WAAM,GAAN,MAAM,CAAoB;IAAG,CAAC;IAE3D;;OAEG;IACK,KAAK,CAAC,OAAO,CACnB,IAAY,EACZ,UAAuB,EAAE;QAEzB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;QACxD,CAAC;QAED,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC;QAC5C,MAAM,OAAO,GAAgB;YAC3B,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,KAAK,EAAE;YAChC,GAAG,OAAO,CAAC,OAAO;SACnB,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;gBAChC,GAAG,OAAO;gBACV,OAAO;aACR,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAsB,CAAC;QAChC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC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OAAO,IAAI,CAAC,OAAO,CAAO,gBAAgB,KAAK,UAAU,EAAE;YACzD,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Network Exports
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EntityClient = void 0;
7
+ var EntityClient_1 = require("./EntityClient");
8
+ Object.defineProperty(exports, "EntityClient", { enumerable: true, get: function () { return EntityClient_1.EntityClient; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @fileoverview Network Exports
3
+ */
4
+ export { EntityClient, type EntityClientConfig, type ApiResponse, } from './EntityClient';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @fileoverview Network Exports
3
+ */
4
+ export { EntityClient, } from './EntityClient';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,YAAY,GAGb,MAAM,gBAAgB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@sudobility/entity_client",
3
+ "version": "0.0.2",
4
+ "type": "module",
5
+ "description": "Frontend client library for entity/organization management",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "bun run build:esm && bun run build:cjs",
18
+ "build:esm": "bunx tsc -p tsconfig.esm.json",
19
+ "build:cjs": "bunx tsc -p tsconfig.cjs.json && bun run build:cjs-copy",
20
+ "build:cjs-copy": "find dist-cjs -name '*.js' | while read f; do cp \"$f\" \"dist/$(echo \"$f\" | sed 's|dist-cjs/||' | sed 's/.js$/.cjs/')\"; done && rm -rf dist-cjs",
21
+ "clean": "rm -rf dist dist-cjs",
22
+ "typecheck": "bunx tsc --noEmit",
23
+ "lint": "bunx eslint src",
24
+ "lint:fix": "bunx eslint src --fix",
25
+ "format": "bunx prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"",
26
+ "test": "bun test"
27
+ },
28
+ "peerDependencies": {
29
+ "react": "^18.0.0 || ^19.0.0",
30
+ "@tanstack/react-query": "^5.0.0"
31
+ },
32
+ "dependencies": {
33
+ "@sudobility/types": "^1.9.40"
34
+ },
35
+ "devDependencies": {
36
+ "@eslint/js": "^9.0.0",
37
+ "@tanstack/react-query": "^5.0.0",
38
+ "@types/bun": "^1.2.8",
39
+ "@types/node": "^24.0.0",
40
+ "@types/react": "^19.0.0",
41
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
42
+ "@typescript-eslint/parser": "^8.0.0",
43
+ "eslint": "^9.0.0",
44
+ "eslint-config-prettier": "^10.0.0",
45
+ "eslint-plugin-prettier": "^5.0.0",
46
+ "prettier": "^3.0.0",
47
+ "react": "^19.0.0",
48
+ "typescript": "^5.9.3"
49
+ },
50
+ "files": [
51
+ "dist/**/*"
52
+ ],
53
+ "keywords": [
54
+ "entity",
55
+ "organization",
56
+ "react",
57
+ "hooks",
58
+ "client"
59
+ ],
60
+ "author": "Sudobility",
61
+ "license": "MIT"
62
+ }