@sudobility/types 1.9.42 → 1.9.44
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 +8 -5
- package/dist/types/entity/entity.d.ts +15 -9
- package/dist/types/entity/entity.d.ts.map +1 -1
- package/dist/types/entity/entity.js +8 -5
- package/dist/types/entity/entity.js.map +1 -1
- package/dist/types/entity/permissions.cjs +14 -12
- package/dist/types/entity/permissions.d.ts.map +1 -1
- package/dist/types/entity/permissions.js +14 -12
- package/dist/types/entity/permissions.js.map +1 -1
- 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
|
|
@@ -21,15 +21,18 @@ var EntityType;
|
|
|
21
21
|
/**
|
|
22
22
|
* Role of a user within an entity.
|
|
23
23
|
* Determines permissions for various operations.
|
|
24
|
+
* - OWNER: Only for organizations. Full access including user management.
|
|
25
|
+
* - ADMIN: Can manage projects and endpoints. Used for personal entities.
|
|
26
|
+
* - MEMBER: Read-only access to projects and endpoints.
|
|
24
27
|
*/
|
|
25
28
|
var EntityRole;
|
|
26
29
|
(function (EntityRole) {
|
|
27
|
-
/**
|
|
30
|
+
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
31
|
+
EntityRole["OWNER"] = "owner";
|
|
32
|
+
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
28
33
|
EntityRole["ADMIN"] = "admin";
|
|
29
|
-
/**
|
|
30
|
-
EntityRole["
|
|
31
|
-
/** Read-only access to projects and API keys */
|
|
32
|
-
EntityRole["VIEWER"] = "viewer";
|
|
34
|
+
/** Read-only access to projects and endpoints */
|
|
35
|
+
EntityRole["MEMBER"] = "member";
|
|
33
36
|
})(EntityRole || (exports.EntityRole = EntityRole = {}));
|
|
34
37
|
/**
|
|
35
38
|
* Status of an entity invitation.
|
|
@@ -14,14 +14,17 @@ export declare enum EntityType {
|
|
|
14
14
|
/**
|
|
15
15
|
* Role of a user within an entity.
|
|
16
16
|
* Determines permissions for various operations.
|
|
17
|
+
* - OWNER: Only for organizations. Full access including user management.
|
|
18
|
+
* - ADMIN: Can manage projects and endpoints. Used for personal entities.
|
|
19
|
+
* - MEMBER: Read-only access to projects and endpoints.
|
|
17
20
|
*/
|
|
18
21
|
export declare enum EntityRole {
|
|
19
|
-
/**
|
|
22
|
+
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
23
|
+
OWNER = "owner",
|
|
24
|
+
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
20
25
|
ADMIN = "admin",
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/** Read-only access to projects and API keys */
|
|
24
|
-
VIEWER = "viewer"
|
|
26
|
+
/** Read-only access to projects and endpoints */
|
|
27
|
+
MEMBER = "member"
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
27
30
|
* Status of an entity invitation.
|
|
@@ -39,6 +42,8 @@ export declare enum InvitationStatus {
|
|
|
39
42
|
/**
|
|
40
43
|
* An entity represents a workspace that can own projects and API keys.
|
|
41
44
|
* Can be either a personal workspace (one per user) or an organization (shared).
|
|
45
|
+
* - Personal entities: User has 'admin' role (no user management needed).
|
|
46
|
+
* - Organizations: Creator has 'owner' role (can manage users, projects, endpoints).
|
|
42
47
|
*/
|
|
43
48
|
export interface Entity {
|
|
44
49
|
/** Unique identifier (UUID) */
|
|
@@ -53,8 +58,6 @@ export interface Entity {
|
|
|
53
58
|
description: string | null;
|
|
54
59
|
/** Optional avatar URL */
|
|
55
60
|
avatarUrl: string | null;
|
|
56
|
-
/** User ID of the entity owner/creator */
|
|
57
|
-
ownerUserId: string;
|
|
58
61
|
/** ISO 8601 timestamp of creation */
|
|
59
62
|
createdAt: string;
|
|
60
63
|
/** ISO 8601 timestamp of last update */
|
|
@@ -81,16 +84,19 @@ export interface EntityMemberUser {
|
|
|
81
84
|
}
|
|
82
85
|
/**
|
|
83
86
|
* A membership record linking a user to an entity with a specific role.
|
|
87
|
+
* This table manages all user-entity roles including organization ownership.
|
|
84
88
|
*/
|
|
85
89
|
export interface EntityMember {
|
|
86
90
|
/** Unique identifier (UUID) */
|
|
87
91
|
id: string;
|
|
88
92
|
/** Entity this membership belongs to */
|
|
89
93
|
entityId: string;
|
|
90
|
-
/** User who is a member */
|
|
94
|
+
/** User who is a member (firebase_uid) */
|
|
91
95
|
userId: string;
|
|
92
|
-
/** User's role in the entity */
|
|
96
|
+
/** User's role in the entity (owner, admin, member) */
|
|
93
97
|
role: EntityRole;
|
|
98
|
+
/** Whether this membership is active (false = soft deleted) */
|
|
99
|
+
isActive: boolean;
|
|
94
100
|
/** ISO 8601 timestamp when user joined */
|
|
95
101
|
joinedAt: string;
|
|
96
102
|
/** ISO 8601 timestamp of record creation */
|
|
@@ -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
|
|
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,KAAK,UAAU;IACf,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,GAAG,IAAI,CAAC;IACrB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,IAAI,EAAE,UAAU,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,EAAE,UAAU,CAAC;IACjB,uCAAuC;IACvC,MAAM,EAAE,gBAAgB,CAAC;IACzB,yCAAyC;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B"}
|
|
@@ -21,15 +21,18 @@ var EntityType;
|
|
|
21
21
|
/**
|
|
22
22
|
* Role of a user within an entity.
|
|
23
23
|
* Determines permissions for various operations.
|
|
24
|
+
* - OWNER: Only for organizations. Full access including user management.
|
|
25
|
+
* - ADMIN: Can manage projects and endpoints. Used for personal entities.
|
|
26
|
+
* - MEMBER: Read-only access to projects and endpoints.
|
|
24
27
|
*/
|
|
25
28
|
var EntityRole;
|
|
26
29
|
(function (EntityRole) {
|
|
27
|
-
/**
|
|
30
|
+
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
31
|
+
EntityRole["OWNER"] = "owner";
|
|
32
|
+
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
28
33
|
EntityRole["ADMIN"] = "admin";
|
|
29
|
-
/**
|
|
30
|
-
EntityRole["
|
|
31
|
-
/** Read-only access to projects and API keys */
|
|
32
|
-
EntityRole["VIEWER"] = "viewer";
|
|
34
|
+
/** Read-only access to projects and endpoints */
|
|
35
|
+
EntityRole["MEMBER"] = "member";
|
|
33
36
|
})(EntityRole || (exports.EntityRole = EntityRole = {}));
|
|
34
37
|
/**
|
|
35
38
|
* Status of an entity invitation.
|
|
@@ -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
|
|
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,6BAAe,CAAA;IACf,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"}
|
|
@@ -12,10 +12,11 @@ const entity_1 = require("./entity");
|
|
|
12
12
|
// ROLE PERMISSION MAPPINGS
|
|
13
13
|
// ========================================
|
|
14
14
|
/**
|
|
15
|
-
* Permission set for the
|
|
16
|
-
* Full access
|
|
15
|
+
* Permission set for the Owner role (organizations only).
|
|
16
|
+
* Full access including user management, project and endpoint management.
|
|
17
|
+
* Organizations have exactly one owner; personal entities don't use this role.
|
|
17
18
|
*/
|
|
18
|
-
const
|
|
19
|
+
const OWNER_PERMISSIONS = {
|
|
19
20
|
canViewEntity: true,
|
|
20
21
|
canEditEntity: true,
|
|
21
22
|
canDeleteEntity: true,
|
|
@@ -28,12 +29,13 @@ const ADMIN_PERMISSIONS = {
|
|
|
28
29
|
canViewApiKeys: true,
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
|
-
* Permission set for the
|
|
32
|
-
* Can manage projects and
|
|
32
|
+
* Permission set for the Admin role.
|
|
33
|
+
* Can manage projects and endpoints, but cannot manage users.
|
|
34
|
+
* This is the default role for personal entities.
|
|
33
35
|
*/
|
|
34
|
-
const
|
|
36
|
+
const ADMIN_PERMISSIONS = {
|
|
35
37
|
canViewEntity: true,
|
|
36
|
-
canEditEntity:
|
|
38
|
+
canEditEntity: true,
|
|
37
39
|
canDeleteEntity: false,
|
|
38
40
|
canManageMembers: false,
|
|
39
41
|
canInviteMembers: false,
|
|
@@ -44,10 +46,10 @@ const MANAGER_PERMISSIONS = {
|
|
|
44
46
|
canViewApiKeys: true,
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
47
|
-
* Permission set for the
|
|
48
|
-
* Read-only access to projects and
|
|
49
|
+
* Permission set for the Member role.
|
|
50
|
+
* Read-only access to projects and endpoints.
|
|
49
51
|
*/
|
|
50
|
-
const
|
|
52
|
+
const MEMBER_PERMISSIONS = {
|
|
51
53
|
canViewEntity: true,
|
|
52
54
|
canEditEntity: false,
|
|
53
55
|
canDeleteEntity: false,
|
|
@@ -64,9 +66,9 @@ const VIEWER_PERMISSIONS = {
|
|
|
64
66
|
* Used by permission checking utilities.
|
|
65
67
|
*/
|
|
66
68
|
exports.ROLE_PERMISSIONS = {
|
|
69
|
+
[entity_1.EntityRole.OWNER]: OWNER_PERMISSIONS,
|
|
67
70
|
[entity_1.EntityRole.ADMIN]: ADMIN_PERMISSIONS,
|
|
68
|
-
[entity_1.EntityRole.
|
|
69
|
-
[entity_1.EntityRole.VIEWER]: VIEWER_PERMISSIONS,
|
|
71
|
+
[entity_1.EntityRole.MEMBER]: MEMBER_PERMISSIONS,
|
|
70
72
|
};
|
|
71
73
|
// ========================================
|
|
72
74
|
// UTILITY FUNCTIONS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/types/entity/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMtC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,aAAa,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,aAAa,EAAE,OAAO,CAAC;IACvB,iDAAiD;IACjD,eAAe,EAAE,OAAO,CAAC;IACzB,mDAAmD;IACnD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0CAA0C;IAC1C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4CAA4C;IAC5C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,8BAA8B;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0CAA0C;IAC1C,eAAe,EAAE,OAAO,CAAC;IACzB,4CAA4C;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,cAAc,EAAE,OAAO,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../src/types/entity/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMtC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,aAAa,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,aAAa,EAAE,OAAO,CAAC;IACvB,iDAAiD;IACjD,eAAe,EAAE,OAAO,CAAC;IACzB,mDAAmD;IACnD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,0CAA0C;IAC1C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4CAA4C;IAC5C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,8BAA8B;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,0CAA0C;IAC1C,eAAe,EAAE,OAAO,CAAC;IACzB,4CAA4C;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,cAAc,EAAE,OAAO,CAAC;CACzB;AA2DD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,iBAAiB,CAIlE,CAAC;AAMF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,iBAAiB,GAClC,OAAO,CAET"}
|
|
@@ -12,10 +12,11 @@ const entity_1 = require("./entity");
|
|
|
12
12
|
// ROLE PERMISSION MAPPINGS
|
|
13
13
|
// ========================================
|
|
14
14
|
/**
|
|
15
|
-
* Permission set for the
|
|
16
|
-
* Full access
|
|
15
|
+
* Permission set for the Owner role (organizations only).
|
|
16
|
+
* Full access including user management, project and endpoint management.
|
|
17
|
+
* Organizations have exactly one owner; personal entities don't use this role.
|
|
17
18
|
*/
|
|
18
|
-
const
|
|
19
|
+
const OWNER_PERMISSIONS = {
|
|
19
20
|
canViewEntity: true,
|
|
20
21
|
canEditEntity: true,
|
|
21
22
|
canDeleteEntity: true,
|
|
@@ -28,12 +29,13 @@ const ADMIN_PERMISSIONS = {
|
|
|
28
29
|
canViewApiKeys: true,
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
|
-
* Permission set for the
|
|
32
|
-
* Can manage projects and
|
|
32
|
+
* Permission set for the Admin role.
|
|
33
|
+
* Can manage projects and endpoints, but cannot manage users.
|
|
34
|
+
* This is the default role for personal entities.
|
|
33
35
|
*/
|
|
34
|
-
const
|
|
36
|
+
const ADMIN_PERMISSIONS = {
|
|
35
37
|
canViewEntity: true,
|
|
36
|
-
canEditEntity:
|
|
38
|
+
canEditEntity: true,
|
|
37
39
|
canDeleteEntity: false,
|
|
38
40
|
canManageMembers: false,
|
|
39
41
|
canInviteMembers: false,
|
|
@@ -44,10 +46,10 @@ const MANAGER_PERMISSIONS = {
|
|
|
44
46
|
canViewApiKeys: true,
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
47
|
-
* Permission set for the
|
|
48
|
-
* Read-only access to projects and
|
|
49
|
+
* Permission set for the Member role.
|
|
50
|
+
* Read-only access to projects and endpoints.
|
|
49
51
|
*/
|
|
50
|
-
const
|
|
52
|
+
const MEMBER_PERMISSIONS = {
|
|
51
53
|
canViewEntity: true,
|
|
52
54
|
canEditEntity: false,
|
|
53
55
|
canDeleteEntity: false,
|
|
@@ -64,9 +66,9 @@ const VIEWER_PERMISSIONS = {
|
|
|
64
66
|
* Used by permission checking utilities.
|
|
65
67
|
*/
|
|
66
68
|
exports.ROLE_PERMISSIONS = {
|
|
69
|
+
[entity_1.EntityRole.OWNER]: OWNER_PERMISSIONS,
|
|
67
70
|
[entity_1.EntityRole.ADMIN]: ADMIN_PERMISSIONS,
|
|
68
|
-
[entity_1.EntityRole.
|
|
69
|
-
[entity_1.EntityRole.VIEWER]: VIEWER_PERMISSIONS,
|
|
71
|
+
[entity_1.EntityRole.MEMBER]: MEMBER_PERMISSIONS,
|
|
70
72
|
};
|
|
71
73
|
// ========================================
|
|
72
74
|
// UTILITY FUNCTIONS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/types/entity/permissions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
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,iBAAiB,GAAsB;IAC3C,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,KAAK;IACtB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF;;;GAGG;AACH,MAAM,kBAAkB,GAAsB;IAC5C,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,KAAK;IACpB,eAAe,EAAE,KAAK;IACtB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,KAAK;IACxB,iBAAiB,EAAE,KAAK;IACxB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF;;;GAGG;AACU,QAAA,gBAAgB,GAA0C;IACrE,CAAC,mBAAU,CAAC,KAAK,CAAC,EAAE,iBAAiB;IACrC,CAAC,mBAAU,CAAC,KAAK,CAAC,EAAE,iBAAiB;IACrC,CAAC,mBAAU,CAAC,MAAM,CAAC,EAAE,kBAAkB;CACxC,CAAC;AAEF,2CAA2C;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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/types",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.44",
|
|
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",
|