@sudobility/types 1.9.43 → 1.9.45
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/CLAUDE.md +12 -5
- package/dist/types/entity/entity.cjs +2 -2
- package/dist/types/entity/entity.d.ts +4 -4
- package/dist/types/entity/entity.d.ts.map +1 -1
- package/dist/types/entity/entity.js +2 -2
- package/dist/types/entity/entity.js.map +1 -1
- package/dist/types/entity/permissions.cjs +3 -3
- package/dist/types/entity/permissions.js +3 -3
- package/dist/types/entity/permissions.js.map +1 -1
- package/dist/types/entity/requests.d.ts +3 -3
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Claude AI Assistant Configuration
|
|
2
2
|
|
|
3
|
+
This file provides comprehensive guidance for AI assistants (Claude Code, GitHub Copilot, Cursor, etc.) working with this codebase.
|
|
4
|
+
|
|
3
5
|
## Project Overview
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**Package**: `@sudobility/types`
|
|
8
|
+
**Version**: 1.9.43
|
|
9
|
+
**Type**: ES Module + CommonJS (dual output)
|
|
10
|
+
**Test Coverage**: 107 tests across 7 test files
|
|
11
|
+
|
|
12
|
+
A comprehensive TypeScript types library for Web3 email applications. It provides shared type definitions, interfaces, enums, and utility functions used across multiple Web3 email platform projects.
|
|
6
13
|
|
|
7
14
|
## Key Architecture
|
|
8
15
|
|
|
@@ -78,7 +85,7 @@ bun run build
|
|
|
78
85
|
# Watch mode for development
|
|
79
86
|
bun run dev
|
|
80
87
|
|
|
81
|
-
# Run all
|
|
88
|
+
# Run all 107 tests
|
|
82
89
|
bun test
|
|
83
90
|
|
|
84
91
|
# Type checking
|
|
@@ -111,7 +118,7 @@ bun run ai:docs # Generate AI documentation
|
|
|
111
118
|
## Testing Strategy
|
|
112
119
|
|
|
113
120
|
- **Framework**: Vitest for fast unit testing
|
|
114
|
-
- **Coverage**:
|
|
121
|
+
- **Coverage**: 107 comprehensive tests covering all utilities and type guards
|
|
115
122
|
- **Structure**: Tests mirror source structure in `test/` directory
|
|
116
123
|
- **Focus**: Type guards, validation functions, utility functions, and API contracts
|
|
117
124
|
|
|
@@ -225,13 +232,13 @@ bun run test:coverage
|
|
|
225
232
|
4. **Verification**: Comprehensive quality pipeline
|
|
226
233
|
|
|
227
234
|
### Quality Standards:
|
|
228
|
-
- **
|
|
235
|
+
- **107 tests passing**: Complete test coverage maintained
|
|
229
236
|
- **Zero lint errors**: ESLint v9 with strict TypeScript rules
|
|
230
237
|
- **Perfect formatting**: Prettier integration
|
|
231
238
|
- **Type safety**: Strict TypeScript with comprehensive checking
|
|
232
239
|
- **Documentation**: JSDoc comments on all public APIs
|
|
233
240
|
|
|
234
|
-
## Recent Changes (v1.
|
|
241
|
+
## Recent Changes (v1.9.43)
|
|
235
242
|
|
|
236
243
|
### Type System Improvements
|
|
237
244
|
- **Enum Conversion**: Converted 11 string literal types to enums for better type safety
|
|
@@ -22,7 +22,7 @@ var EntityType;
|
|
|
22
22
|
* Role of a user within an entity.
|
|
23
23
|
* Determines permissions for various operations.
|
|
24
24
|
* - OWNER: Only for organizations. Full access including user management.
|
|
25
|
-
* -
|
|
25
|
+
* - MANAGER: Can manage projects and endpoints. Used for personal entities.
|
|
26
26
|
* - MEMBER: Read-only access to projects and endpoints.
|
|
27
27
|
*/
|
|
28
28
|
var EntityRole;
|
|
@@ -30,7 +30,7 @@ var EntityRole;
|
|
|
30
30
|
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
31
31
|
EntityRole["OWNER"] = "owner";
|
|
32
32
|
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
33
|
-
EntityRole["
|
|
33
|
+
EntityRole["MANAGER"] = "manager";
|
|
34
34
|
/** Read-only access to projects and endpoints */
|
|
35
35
|
EntityRole["MEMBER"] = "member";
|
|
36
36
|
})(EntityRole || (exports.EntityRole = EntityRole = {}));
|
|
@@ -15,14 +15,14 @@ export declare enum EntityType {
|
|
|
15
15
|
* Role of a user within an entity.
|
|
16
16
|
* Determines permissions for various operations.
|
|
17
17
|
* - OWNER: Only for organizations. Full access including user management.
|
|
18
|
-
* -
|
|
18
|
+
* - MANAGER: Can manage projects and endpoints. Used for personal entities.
|
|
19
19
|
* - MEMBER: Read-only access to projects and endpoints.
|
|
20
20
|
*/
|
|
21
21
|
export declare enum EntityRole {
|
|
22
22
|
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
23
23
|
OWNER = "owner",
|
|
24
24
|
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
25
|
-
|
|
25
|
+
MANAGER = "manager",
|
|
26
26
|
/** Read-only access to projects and endpoints */
|
|
27
27
|
MEMBER = "member"
|
|
28
28
|
}
|
|
@@ -42,7 +42,7 @@ export declare enum InvitationStatus {
|
|
|
42
42
|
/**
|
|
43
43
|
* An entity represents a workspace that can own projects and API keys.
|
|
44
44
|
* Can be either a personal workspace (one per user) or an organization (shared).
|
|
45
|
-
* - Personal entities: User has '
|
|
45
|
+
* - Personal entities: User has 'manager' role (no user management needed).
|
|
46
46
|
* - Organizations: Creator has 'owner' role (can manage users, projects, endpoints).
|
|
47
47
|
*/
|
|
48
48
|
export interface Entity {
|
|
@@ -93,7 +93,7 @@ export interface EntityMember {
|
|
|
93
93
|
entityId: string;
|
|
94
94
|
/** User who is a member (firebase_uid) */
|
|
95
95
|
userId: string;
|
|
96
|
-
/** User's role in the entity (owner,
|
|
96
|
+
/** User's role in the entity (owner, manager, member) */
|
|
97
97
|
role: EntityRole;
|
|
98
98
|
/** Whether this membership is active (false = soft deleted) */
|
|
99
99
|
isActive: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/types/entity/entity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;GAIG;AACH,oBAAY,UAAU;IACpB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,oBAAY,UAAU;IACpB,sGAAsG;IACtG,KAAK,UAAU;IACf,sGAAsG;IACtG,
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/types/entity/entity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;GAIG;AACH,oBAAY,UAAU;IACpB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,oBAAY,UAAU;IACpB,sGAAsG;IACtG,KAAK,UAAU;IACf,sGAAsG;IACtG,OAAO,YAAY;IACnB,iDAAiD;IACjD,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,yCAAyC;IACzC,OAAO,YAAY;IACnB,gDAAgD;IAChD,QAAQ,aAAa;IACrB,yCAAyC;IACzC,QAAQ,aAAa;IACrB,0DAA0D;IAC1D,OAAO,YAAY;CACpB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,UAAU,EAAE,UAAU,CAAC;IACvB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0BAA0B;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC5C,yCAAyC;IACzC,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,KAAK,EAAE,MAAM,G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;
|
|
|
22
22
|
* Role of a user within an entity.
|
|
23
23
|
* Determines permissions for various operations.
|
|
24
24
|
* - OWNER: Only for organizations. Full access including user management.
|
|
25
|
-
* -
|
|
25
|
+
* - MANAGER: Can manage projects and endpoints. Used for personal entities.
|
|
26
26
|
* - MEMBER: Read-only access to projects and endpoints.
|
|
27
27
|
*/
|
|
28
28
|
var EntityRole;
|
|
@@ -30,7 +30,7 @@ var EntityRole;
|
|
|
30
30
|
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
31
31
|
EntityRole["OWNER"] = "owner";
|
|
32
32
|
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
33
|
-
EntityRole["
|
|
33
|
+
EntityRole["MANAGER"] = "manager";
|
|
34
34
|
/** Read-only access to projects and endpoints */
|
|
35
35
|
EntityRole["MEMBER"] = "member";
|
|
36
36
|
})(EntityRole || (exports.EntityRole = EntityRole = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/types/entity/entity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAA2C;AAC3C,QAAQ;AACR,2CAA2C;AAE3C;;;;GAIG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,2CAA6B,CAAA;AAC/B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED;;;;;;GAMG;AACH,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,sGAAsG;IACtG,6BAAe,CAAA;IACf,sGAAsG;IACtG,
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/types/entity/entity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAA2C;AAC3C,QAAQ;AACR,2CAA2C;AAE3C;;;;GAIG;AACH,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,2CAA6B,CAAA;AAC/B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED;;;;;;GAMG;AACH,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,sGAAsG;IACtG,6BAAe,CAAA;IACf,sGAAsG;IACtG,iCAAmB,CAAA;IACnB,iDAAiD;IACjD,+BAAiB,CAAA;AACnB,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB;AAED;;GAEG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,yCAAyC;IACzC,uCAAmB,CAAA;IACnB,gDAAgD;IAChD,yCAAqB,CAAA;IACrB,yCAAyC;IACzC,yCAAqB,CAAA;IACrB,0DAA0D;IAC1D,uCAAmB,CAAA;AACrB,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B"}
|
|
@@ -29,11 +29,11 @@ const OWNER_PERMISSIONS = {
|
|
|
29
29
|
canViewApiKeys: true,
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
* Permission set for the
|
|
32
|
+
* Permission set for the Manager role.
|
|
33
33
|
* Can manage projects and endpoints, but cannot manage users.
|
|
34
34
|
* This is the default role for personal entities.
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const MANAGER_PERMISSIONS = {
|
|
37
37
|
canViewEntity: true,
|
|
38
38
|
canEditEntity: true,
|
|
39
39
|
canDeleteEntity: false,
|
|
@@ -67,7 +67,7 @@ const MEMBER_PERMISSIONS = {
|
|
|
67
67
|
*/
|
|
68
68
|
exports.ROLE_PERMISSIONS = {
|
|
69
69
|
[entity_1.EntityRole.OWNER]: OWNER_PERMISSIONS,
|
|
70
|
-
[entity_1.EntityRole.
|
|
70
|
+
[entity_1.EntityRole.MANAGER]: MANAGER_PERMISSIONS,
|
|
71
71
|
[entity_1.EntityRole.MEMBER]: MEMBER_PERMISSIONS,
|
|
72
72
|
};
|
|
73
73
|
// ========================================
|
|
@@ -29,11 +29,11 @@ const OWNER_PERMISSIONS = {
|
|
|
29
29
|
canViewApiKeys: true,
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
* Permission set for the
|
|
32
|
+
* Permission set for the Manager role.
|
|
33
33
|
* Can manage projects and endpoints, but cannot manage users.
|
|
34
34
|
* This is the default role for personal entities.
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const MANAGER_PERMISSIONS = {
|
|
37
37
|
canViewEntity: true,
|
|
38
38
|
canEditEntity: true,
|
|
39
39
|
canDeleteEntity: false,
|
|
@@ -67,7 +67,7 @@ const MEMBER_PERMISSIONS = {
|
|
|
67
67
|
*/
|
|
68
68
|
exports.ROLE_PERMISSIONS = {
|
|
69
69
|
[entity_1.EntityRole.OWNER]: OWNER_PERMISSIONS,
|
|
70
|
-
[entity_1.EntityRole.
|
|
70
|
+
[entity_1.EntityRole.MANAGER]: MANAGER_PERMISSIONS,
|
|
71
71
|
[entity_1.EntityRole.MEMBER]: MEMBER_PERMISSIONS,
|
|
72
72
|
};
|
|
73
73
|
// ========================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/types/entity/permissions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+GH,sDAEC;AAQD,sCAKC;AA5HD,qCAAsC;AAiCtC,2CAA2C;AAC3C,2BAA2B;AAC3B,2CAA2C;AAE3C;;;;GAIG;AACH,MAAM,iBAAiB,GAAsB;IAC3C,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/types/entity/permissions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;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CAA2C;AAC3C,oBAAoB;AACpB,2CAA2C;AAE3C;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,IAAgB;IACpD,OAAO,wBAAgB,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAC3B,IAAgB,EAChB,UAAmC;IAEnC,OAAO,wBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -17,7 +17,7 @@ export interface CreateEntityRequest {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Request to update an entity's details.
|
|
20
|
-
* Only
|
|
20
|
+
* Only owners and managers can update entity settings.
|
|
21
21
|
*/
|
|
22
22
|
export interface UpdateEntityRequest {
|
|
23
23
|
/** New display name */
|
|
@@ -31,7 +31,7 @@ export interface UpdateEntityRequest {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Request to update a member's role.
|
|
34
|
-
* Only
|
|
34
|
+
* Only owners can update member roles.
|
|
35
35
|
*/
|
|
36
36
|
export interface UpdateMemberRoleRequest {
|
|
37
37
|
/** New role for the member */
|
|
@@ -39,7 +39,7 @@ export interface UpdateMemberRoleRequest {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Request to invite a user to join an entity.
|
|
42
|
-
* Only
|
|
42
|
+
* Only owners can send invitations.
|
|
43
43
|
*/
|
|
44
44
|
export interface InviteMemberRequest {
|
|
45
45
|
/** Email address of the user to invite */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/types",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.45",
|
|
4
4
|
"description": "Comprehensive TypeScript types, interfaces, and utilities for Web3 email applications - optimized for AI-assisted development",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|