@seedgrid/fe-security 2026.6.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.
@@ -0,0 +1,2 @@
1
+ export * from "./paths";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./paths";
@@ -0,0 +1,67 @@
1
+ export declare const SecurityPaths: {
2
+ /** AUTH (/public/auth) — não-autenticado. */
3
+ readonly auth: {
4
+ readonly login: "/public/auth/login";
5
+ readonly refresh: "/public/auth/refresh";
6
+ readonly confirmEmail: "/public/auth/confirm-email";
7
+ readonly forgotPassword: "/public/auth/forgot-password";
8
+ readonly resetPassword: "/public/auth/reset-password";
9
+ };
10
+ /** TWO-FACTOR (/2f autenticado, /public/2f não-autenticado). */
11
+ readonly twoFactor: {
12
+ readonly verify: "/public/2f/verify";
13
+ readonly resend: "/public/2f/resend";
14
+ readonly enable: "/2f/enable";
15
+ readonly status: "/2f/status";
16
+ readonly totpConfirm: "/2f/totp/confirm";
17
+ readonly setupConfirm: "/2f/setup/confirm";
18
+ readonly disable: "/2f/disable";
19
+ };
20
+ /** USERS (/users). */
21
+ readonly users: {
22
+ readonly base: "/users";
23
+ readonly changePassword: "/users/change-password";
24
+ readonly defaultAvatars: "/users/avatars/defaults";
25
+ readonly byPublicId: (publicId: string) => string;
26
+ readonly avatar: (publicId: string) => string;
27
+ readonly membership: (publicId: string, companyPublicId: string) => string;
28
+ };
29
+ /** ROLES (/roles). */
30
+ readonly roles: {
31
+ readonly base: "/roles";
32
+ readonly integration: "/roles/integration";
33
+ readonly byPublicId: (publicId: string) => string;
34
+ };
35
+ /** PERMISSIONS (/permissions). */
36
+ readonly permissions: {
37
+ readonly base: "/permissions";
38
+ readonly byPublicId: (publicId: string) => string;
39
+ };
40
+ /** ME (/me) — escopo do usuário corrente pelo token. */
41
+ readonly me: {
42
+ readonly permissions: "/me/permissions";
43
+ readonly selectCompany: "/me/select-company";
44
+ };
45
+ /** COMPANIES (/companies, /public/companies). */
46
+ readonly companies: {
47
+ readonly base: "/companies";
48
+ readonly public: "/public/companies";
49
+ readonly byPublicId: (publicId: string) => string;
50
+ };
51
+ /** SELF-ENTER (/self-enter autenticado, /public/self-enter não-autenticado). */
52
+ readonly selfEnter: {
53
+ readonly requests: "/public/self-enter/requests";
54
+ readonly requestsToApprove: "/self-enter/requests/to-approve";
55
+ readonly invitations: "/self-enter/invitations";
56
+ readonly requestById: (id: string) => string;
57
+ readonly confirmEmail: (id: string) => string;
58
+ readonly resendEmail: (id: string) => string;
59
+ readonly approve: (id: string) => string;
60
+ readonly reject: (id: string) => string;
61
+ readonly invitationByToken: (token: string) => string;
62
+ readonly invitationComplete: (token: string) => string;
63
+ readonly invitationResend: (id: string) => string;
64
+ };
65
+ };
66
+ export type SecurityPaths = typeof SecurityPaths;
67
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;IACxB,6CAA6C;;;;;;;;IAS7C,gEAAgE;;;;;;;;;;IAWhE,sBAAsB;;;;;wCAKG,MAAM;oCACV,MAAM;wCAEF,MAAM,mBAAmB,MAAM;;IAIxD,sBAAsB;;;;wCAIG,MAAM;;IAG/B,kCAAkC;;;wCAGT,MAAM;;IAG/B,wDAAwD;;;;;IAMxD,iDAAiD;;;;wCAIxB,MAAM;;IAG/B,gFAAgF;;;;;mCAK5D,MAAM;oCACL,MAAM;mCACP,MAAM;+BACV,MAAM;8BACP,MAAM;4CACQ,MAAM;6CACL,MAAM;wCAEX,MAAM;;CAEvB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC"}
package/dist/paths.js ADDED
@@ -0,0 +1,73 @@
1
+ // Espelho do RestControllerPath.java (seedgrid-quarkus-ext-security): contrato único
2
+ // dos paths REST do SeedGrid Security — front e back falam o MESMO. Mudou um path no
3
+ // backend? Atualize aqui também. Paths sob `/public/*` são não-autenticados.
4
+ //
5
+ // Convenção: endpoints estáticos são strings; endpoints com parâmetro são funções
6
+ // builder (já aplicam encodeURIComponent no segmento).
7
+ const seg = (value) => encodeURIComponent(value);
8
+ export const SecurityPaths = {
9
+ /** AUTH (/public/auth) — não-autenticado. */
10
+ auth: {
11
+ login: "/public/auth/login",
12
+ refresh: "/public/auth/refresh",
13
+ confirmEmail: "/public/auth/confirm-email",
14
+ forgotPassword: "/public/auth/forgot-password",
15
+ resetPassword: "/public/auth/reset-password",
16
+ },
17
+ /** TWO-FACTOR (/2f autenticado, /public/2f não-autenticado). */
18
+ twoFactor: {
19
+ verify: "/public/2f/verify",
20
+ resend: "/public/2f/resend",
21
+ enable: "/2f/enable",
22
+ status: "/2f/status",
23
+ totpConfirm: "/2f/totp/confirm",
24
+ setupConfirm: "/2f/setup/confirm",
25
+ disable: "/2f/disable",
26
+ },
27
+ /** USERS (/users). */
28
+ users: {
29
+ base: "/users",
30
+ changePassword: "/users/change-password",
31
+ defaultAvatars: "/users/avatars/defaults",
32
+ byPublicId: (publicId) => `/users/${seg(publicId)}`,
33
+ avatar: (publicId) => `/users/${seg(publicId)}/avatar`,
34
+ // Membership por conta (root + roles do usuário NAQUELA company).
35
+ membership: (publicId, companyPublicId) => `/users/${seg(publicId)}/memberships/${seg(companyPublicId)}`,
36
+ },
37
+ /** ROLES (/roles). */
38
+ roles: {
39
+ base: "/roles",
40
+ integration: "/roles/integration",
41
+ byPublicId: (publicId) => `/roles/${seg(publicId)}`,
42
+ },
43
+ /** PERMISSIONS (/permissions). */
44
+ permissions: {
45
+ base: "/permissions",
46
+ byPublicId: (publicId) => `/permissions/${seg(publicId)}`,
47
+ },
48
+ /** ME (/me) — escopo do usuário corrente pelo token. */
49
+ me: {
50
+ permissions: "/me/permissions",
51
+ selectCompany: "/me/select-company",
52
+ },
53
+ /** COMPANIES (/companies, /public/companies). */
54
+ companies: {
55
+ base: "/companies",
56
+ public: "/public/companies",
57
+ byPublicId: (publicId) => `/companies/${seg(publicId)}`,
58
+ },
59
+ /** SELF-ENTER (/self-enter autenticado, /public/self-enter não-autenticado). */
60
+ selfEnter: {
61
+ requests: "/public/self-enter/requests",
62
+ requestsToApprove: "/self-enter/requests/to-approve",
63
+ invitations: "/self-enter/invitations",
64
+ requestById: (id) => `/public/self-enter/requests/${seg(id)}`,
65
+ confirmEmail: (id) => `/public/self-enter/requests/${seg(id)}/confirm-email`,
66
+ resendEmail: (id) => `/public/self-enter/requests/${seg(id)}/resend-email`,
67
+ approve: (id) => `/self-enter/requests/${seg(id)}/approve`,
68
+ reject: (id) => `/self-enter/requests/${seg(id)}/reject`,
69
+ invitationByToken: (token) => `/public/self-enter/invitations/${seg(token)}`,
70
+ invitationComplete: (token) => `/public/self-enter/invitations/${seg(token)}/complete`,
71
+ invitationResend: (id) => `/self-enter/invitations/${seg(id)}/resend`,
72
+ },
73
+ };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@seedgrid/fe-security",
3
+ "version": "2026.6.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/SeedGrid/seedgrid-fe-components"
10
+ },
11
+ "homepage": "https://github.com/SeedGrid/seedgrid-fe-components",
12
+ "bugs": {
13
+ "url": "https://github.com/SeedGrid/seedgrid-fe-components/issues"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc -p tsconfig.json",
26
+ "typecheck": "tsc -p tsconfig.json --noEmit",
27
+ "test": "pnpm run build && node --test tests/paths.test.mjs"
28
+ }
29
+ }