@shipfox/client-shell 9.0.0 → 10.0.1
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/dist/core/session.d.ts +2 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/hooks/api/session-mapper.d.ts.map +1 -1
- package/dist/hooks/api/session-mapper.js +6 -1
- package/dist/hooks/api/session-mapper.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/core/session.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export type AdminRole = 'admin-observer' | 'admin-operator' | 'admin-owner';
|
|
1
2
|
export interface UserIdentity {
|
|
2
3
|
id: string;
|
|
3
4
|
email: string;
|
|
4
5
|
name?: string;
|
|
5
6
|
emailVerifiedAt?: string;
|
|
7
|
+
adminRole?: AdminRole;
|
|
6
8
|
}
|
|
7
9
|
export interface AuthenticatedSession {
|
|
8
10
|
accessToken: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAE5E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/core/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/session.ts"],"sourcesContent":["export interface UserIdentity {\n id: string;\n email: string;\n name?: string;\n emailVerifiedAt?: string;\n}\n\nexport interface AuthenticatedSession {\n accessToken: string;\n user: UserIdentity;\n}\n\nexport interface WorkspaceMembership {\n id: string;\n workspaceId: string;\n}\n\nexport interface WorkspaceSummary {\n id: string;\n name: string;\n membershipId: string;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/core/session.ts"],"sourcesContent":["export type AdminRole = 'admin-observer' | 'admin-operator' | 'admin-owner';\n\nexport interface UserIdentity {\n id: string;\n email: string;\n name?: string;\n emailVerifiedAt?: string;\n adminRole?: AdminRole;\n}\n\nexport interface AuthenticatedSession {\n accessToken: string;\n user: UserIdentity;\n}\n\nexport interface WorkspaceMembership {\n id: string;\n workspaceId: string;\n}\n\nexport interface WorkspaceSummary {\n id: string;\n name: string;\n membershipId: string;\n}\n"],"names":[],"mappings":"AAoBA,WAIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/session-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,OAAO,EAAC,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAC,oBAAoB,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEzE,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAOzD;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"session-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/session-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,OAAO,EAAC,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAC,oBAAoB,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEzE,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAOzD;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,oBAAoB,CAQlF"}
|
|
@@ -13,7 +13,12 @@ export function toUserIdentity(dto) {
|
|
|
13
13
|
export function toAuthenticatedSession(dto) {
|
|
14
14
|
return {
|
|
15
15
|
accessToken: dto.token,
|
|
16
|
-
user:
|
|
16
|
+
user: {
|
|
17
|
+
...toUserIdentity(dto.user),
|
|
18
|
+
...dto.admin_role ? {
|
|
19
|
+
adminRole: dto.admin_role
|
|
20
|
+
} : {}
|
|
21
|
+
}
|
|
17
22
|
};
|
|
18
23
|
}
|
|
19
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/session-mapper.ts"],"sourcesContent":["import type {LoginResponseDto, UserDto} from '@shipfox/api-auth-dto';\nimport type {AuthenticatedSession, UserIdentity} from '#core/session.js';\n\nexport function toUserIdentity(dto: UserDto): UserIdentity {\n return {\n id: dto.id,\n email: dto.email,\n ...(dto.name ? {name: dto.name} : {}),\n ...(dto.email_verified_at ? {emailVerifiedAt: dto.email_verified_at} : {}),\n };\n}\n\nexport function toAuthenticatedSession(dto: LoginResponseDto): AuthenticatedSession {\n return {accessToken: dto.token
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/session-mapper.ts"],"sourcesContent":["import type {LoginResponseDto, UserDto} from '@shipfox/api-auth-dto';\nimport type {AuthenticatedSession, UserIdentity} from '#core/session.js';\n\nexport function toUserIdentity(dto: UserDto): UserIdentity {\n return {\n id: dto.id,\n email: dto.email,\n ...(dto.name ? {name: dto.name} : {}),\n ...(dto.email_verified_at ? {emailVerifiedAt: dto.email_verified_at} : {}),\n };\n}\n\nexport function toAuthenticatedSession(dto: LoginResponseDto): AuthenticatedSession {\n return {\n accessToken: dto.token,\n user: {\n ...toUserIdentity(dto.user),\n ...(dto.admin_role ? {adminRole: dto.admin_role} : {}),\n },\n };\n}\n"],"names":["toUserIdentity","dto","id","email","name","email_verified_at","emailVerifiedAt","toAuthenticatedSession","accessToken","token","user","admin_role","adminRole"],"mappings":"AAGA,OAAO,SAASA,eAAeC,GAAY;IACzC,OAAO;QACLC,IAAID,IAAIC,EAAE;QACVC,OAAOF,IAAIE,KAAK;QAChB,GAAIF,IAAIG,IAAI,GAAG;YAACA,MAAMH,IAAIG,IAAI;QAAA,IAAI,CAAC,CAAC;QACpC,GAAIH,IAAII,iBAAiB,GAAG;YAACC,iBAAiBL,IAAII,iBAAiB;QAAA,IAAI,CAAC,CAAC;IAC3E;AACF;AAEA,OAAO,SAASE,uBAAuBN,GAAqB;IAC1D,OAAO;QACLO,aAAaP,IAAIQ,KAAK;QACtBC,MAAM;YACJ,GAAGV,eAAeC,IAAIS,IAAI,CAAC;YAC3B,GAAIT,IAAIU,UAAU,GAAG;gBAACC,WAAWX,IAAIU,UAAU;YAAA,IAAI,CAAC,CAAC;QACvD;IACF;AACF"}
|