@autional-cn/shared 0.1.0-rc
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/LICENSE +661 -0
- package/package.json +47 -0
- package/src/api/__tests__/entry-plane.test.ts +119 -0
- package/src/api/bff-client.ts +94 -0
- package/src/api/client.ts +174 -0
- package/src/api/entry-plane.ts +61 -0
- package/src/api/trace.ts +21 -0
- package/src/auth/__tests__/ac007-role-source.test.ts +124 -0
- package/src/auth/__tests__/auth-machine.test.ts +157 -0
- package/src/auth/__tests__/build-login-url.test.ts +219 -0
- package/src/auth/__tests__/get-current-role.test.ts +61 -0
- package/src/auth/__tests__/oauth-client-from-slug.test.ts +132 -0
- package/src/auth/__tests__/pkce-uniformity.test.ts +48 -0
- package/src/auth/__tests__/session-client-id.test.ts +124 -0
- package/src/auth/__tests__/slug-from-url.test.ts +112 -0
- package/src/auth/auth-machine.ts +151 -0
- package/src/auth/auth-queries.ts +118 -0
- package/src/auth/build-tenant-urls.ts +48 -0
- package/src/auth/oauth-client-from-slug.ts +119 -0
- package/src/auth/oauth-client-id-store.ts +41 -0
- package/src/auth/oauth-login.ts +291 -0
- package/src/auth/pkce.ts +141 -0
- package/src/auth/portal-config.ts +68 -0
- package/src/auth/roles.ts +102 -0
- package/src/auth/service.ts +368 -0
- package/src/auth/slug-from-url.ts +92 -0
- package/src/auth/store.ts +226 -0
- package/src/auth/tenant-route-middleware.ts +113 -0
- package/src/auth/tenant-slug-context.tsx +9 -0
- package/src/branding/BrandingInitializer.tsx +60 -0
- package/src/branding/brand-color.ts +155 -0
- package/src/branding/branding-cache.ts +71 -0
- package/src/branding/extract-branding.ts +27 -0
- package/src/branding/index.ts +15 -0
- package/src/branding/tenant-store.ts +13 -0
- package/src/branding/types.ts +14 -0
- package/src/branding/useBranding.ts +85 -0
- package/src/components/AuditStatsOnly.tsx +65 -0
- package/src/components/OAuthCallbackPage.tsx +56 -0
- package/src/components/PortalGuard.tsx +105 -0
- package/src/components/RequireAuth.tsx +142 -0
- package/src/components/TenantIndexGuard.tsx +131 -0
- package/src/components/__tests__/RequireAuth.test.tsx +244 -0
- package/src/components/__tests__/TenantIndexGuard.test.tsx +218 -0
- package/src/config/__tests__/portal-resolver.test.ts +247 -0
- package/src/config/__tests__/valid-redirect.test.ts +47 -0
- package/src/config/constants.ts +27 -0
- package/src/config/index.ts +411 -0
- package/src/config/resolve-basename.ts +57 -0
- package/src/constants/api-paths.ts +450 -0
- package/src/generated/api.ts +12566 -0
- package/src/generated/queries.ts +12623 -0
- package/src/generated/types.ts +13888 -0
- package/src/hooks/__tests__/useBootstrap.test.tsx +91 -0
- package/src/hooks/__tests__/useCurrentRole.test.tsx +122 -0
- package/src/hooks/useAuth.ts +239 -0
- package/src/hooks/useBootstrap.ts +74 -0
- package/src/hooks/useCurrentRole.ts +18 -0
- package/src/hooks/useLogout.ts +33 -0
- package/src/hooks/usePermission.ts +116 -0
- package/src/hooks/useSodMode.ts +73 -0
- package/src/index.ts +209 -0
- package/src/lib/push.ts +41 -0
- package/src/seo/dom-utils.ts +94 -0
- package/src/seo/index.ts +6 -0
- package/src/seo/jsonld.ts +29 -0
- package/src/seo/types.ts +29 -0
- package/src/seo/usePageMeta.ts +17 -0
- package/src/seo/usePageTitle.ts +14 -0
- package/src/seo/useSEO.ts +80 -0
- package/src/types/index.ts +185 -0
- package/src/utils/__tests__/mock-test.ts +15 -0
- package/src/utils/browser.ts +6 -0
- package/src/utils/case.ts +44 -0
- package/src/utils/error.ts +26 -0
- package/src/utils/format.ts +63 -0
- package/src/utils/password-transmission.test.ts +145 -0
- package/src/utils/password-transmission.ts +253 -0
- package/src/utils/response.ts +62 -0
- package/src/utils/vite.ts +4 -0
- package/src/vite-env.d.ts +18 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
// API endpoint constants — single source of truth for all API paths
|
|
2
|
+
// Matches generated API (web/packages/shared/src/generated/api.ts) — derived from swagger.json
|
|
3
|
+
// Path format: /{service-name}/api/v1/{resource} (BFF gateway routing)
|
|
4
|
+
// Do NOT modify manually — paths must match backend route registrations
|
|
5
|
+
|
|
6
|
+
// ──────────────────────────────── Identity Service ────────────────────────────────
|
|
7
|
+
|
|
8
|
+
export const IDENTITY = {
|
|
9
|
+
// Auth (public)
|
|
10
|
+
AUTH_LOGIN: '/identity/api/v1/auth/login',
|
|
11
|
+
AUTH_LOGIN_EMAIL_CODE: '/identity/api/v1/auth/login/email-code',
|
|
12
|
+
AUTH_LOGIN_PHONE_CODE: '/identity/api/v1/auth/login/phone-code',
|
|
13
|
+
AUTH_REGISTER: '/identity/api/v1/auth/register',
|
|
14
|
+
AUTH_REGISTER_EMAIL_CODE: '/identity/api/v1/auth/register/email-code',
|
|
15
|
+
AUTH_REGISTER_PHONE_CODE: '/identity/api/v1/auth/register/phone-code',
|
|
16
|
+
AUTH_REGISTER_INVITATION: '/identity/api/v1/auth/register/invitation',
|
|
17
|
+
AUTH_REGISTER_OAUTH: '/identity/api/v1/auth/register/oauth',
|
|
18
|
+
AUTH_REGISTER_REAPPLY: '/identity/api/v1/auth/register/reapply',
|
|
19
|
+
AUTH_CHECK_EMAIL: '/identity/api/v1/auth/register/check-email',
|
|
20
|
+
AUTH_CHECK_USERNAME: '/identity/api/v1/auth/register/check-username',
|
|
21
|
+
AUTH_REFRESH: '/identity/api/v1/auth/refresh',
|
|
22
|
+
|
|
23
|
+
// Auth /me (authenticated user)
|
|
24
|
+
ME: '/identity/api/v1/auth/me',
|
|
25
|
+
ME_DELETE: '/identity/api/v1/auth/me', // DELETE
|
|
26
|
+
ME_PUT: '/identity/api/v1/auth/me', // PUT
|
|
27
|
+
ME_PASSWORD: '/identity/api/v1/auth/me/password',
|
|
28
|
+
ME_PASSWORD_STRENGTH: '/identity/api/v1/auth/me/password-strength',
|
|
29
|
+
ME_SESSIONS: '/identity/api/v1/auth/me/sessions',
|
|
30
|
+
ME_SESSIONS_DELETE_ALL: '/identity/api/v1/auth/me/sessions', // DELETE
|
|
31
|
+
ME_SESSION: (id: string) => `/identity/api/v1/auth/me/sessions/${id}`,
|
|
32
|
+
ME_DEVICES: '/identity/api/v1/auth/me/devices',
|
|
33
|
+
ME_DEVICE: (id: string) => `/identity/api/v1/auth/me/devices/${id}`,
|
|
34
|
+
ME_DEVICE_TRUST: (id: string) => `/identity/api/v1/auth/me/devices/${id}/trust`,
|
|
35
|
+
ME_AUDIT: '/identity/api/v1/auth/me/audit-logs',
|
|
36
|
+
ME_TENANTS: '/identity/api/v1/auth/me/tenants',
|
|
37
|
+
ME_PERMISSIONS: '/identity/api/v1/auth/me/permissions',
|
|
38
|
+
ME_SWITCH_TENANT: '/identity/api/v1/auth/me/switch-tenant',
|
|
39
|
+
ME_ROLE_ACTIVATIONS: '/identity/api/v1/auth/me/role-activations',
|
|
40
|
+
ME_MEMBERSHIPS: '/identity/api/v1/auth/me/memberships',
|
|
41
|
+
ME_CONSENT: '/identity/api/v1/auth/me/consent',
|
|
42
|
+
ME_CONSENT_HISTORY: '/identity/api/v1/auth/me/consent-history',
|
|
43
|
+
ME_CHILDREN_CONSENT: '/identity/api/v1/auth/me/children-consent',
|
|
44
|
+
ME_DELETE_ACCOUNT: '/identity/api/v1/auth/me/delete-account',
|
|
45
|
+
ME_EXPORT_DATA: '/identity/api/v1/auth/me/export-data',
|
|
46
|
+
ME_EMAIL_CHANGE: '/identity/api/v1/auth/me/email/change',
|
|
47
|
+
ME_EMAIL_VERIFY: '/identity/api/v1/auth/me/email/verify',
|
|
48
|
+
ME_EMAIL_CHANGE_CANCEL: '/identity/api/v1/auth/me/email/change/cancel',
|
|
49
|
+
ME_REAUTHENTICATE: '/identity/api/v1/auth/me/reauthenticate',
|
|
50
|
+
ME_EMAIL_VERIFICATION_STATUS: '/identity/api/v1/auth/me/email-verification-status',
|
|
51
|
+
ME_PHONE_CHANGE: '/identity/api/v1/auth/me/phone/change',
|
|
52
|
+
ME_PHONE_VERIFY: '/identity/api/v1/auth/me/phone/verify',
|
|
53
|
+
ME_PHONE_CHANGE_CANCEL: '/identity/api/v1/auth/me/phone/change/cancel',
|
|
54
|
+
ME_PHONE_VERIFICATION_STATUS: '/identity/api/v1/auth/me/phone-verification-status',
|
|
55
|
+
ME_RECOVERY_CONTACTS: '/identity/api/v1/auth/me/recovery-contacts',
|
|
56
|
+
ME_RECOVERY_CONTACT: (id: string) => `/identity/api/v1/auth/me/recovery-contacts/${id}`,
|
|
57
|
+
ME_SECURITY_EVENTS: '/identity/api/v1/auth/me/security-events',
|
|
58
|
+
ME_SECURITY_EVENT_DISMISS: (id: string) =>
|
|
59
|
+
`/identity/api/v1/auth/me/security-events/${id}/dismiss`,
|
|
60
|
+
ME_SAML_LINKS: '/identity/api/v1/auth/me/saml-links',
|
|
61
|
+
ME_SAML_LINK: (id: string) => `/identity/api/v1/auth/me/saml-links/${id}`,
|
|
62
|
+
ME_WEBAUTHN_CREDENTIALS: '/identity/api/v1/auth/me/webauthn-credentials',
|
|
63
|
+
ME_WEBAUTHN_CREDENTIAL: (id: string) => `/identity/api/v1/auth/me/webauthn-credentials/${id}`,
|
|
64
|
+
ME_AUTHENTICATOR_DEVICES: '/identity/api/v1/auth/me/authenticator/devices',
|
|
65
|
+
ME_AUTHENTICATOR_DEVICE: (id: string) => `/identity/api/v1/auth/me/authenticator/devices/${id}`,
|
|
66
|
+
ME_AUTHENTICATOR_BACKUP: '/identity/api/v1/auth/me/authenticator/backup',
|
|
67
|
+
ME_AUTHENTICATOR_BACKUP_ID: (id: string) => `/identity/api/v1/auth/me/authenticator/backup/${id}`,
|
|
68
|
+
ME_STOP_IMPERSONATION: '/identity/api/v1/auth/me/stop-impersonation',
|
|
69
|
+
|
|
70
|
+
// Admin
|
|
71
|
+
ADMIN_AGENTS: '/identity/api/v1/admin/agents',
|
|
72
|
+
ADMIN_AGENT: (id: string) => `/identity/api/v1/admin/agents/${id}`,
|
|
73
|
+
ADMIN_AGENTS_CREDENTIALS: (id: string) => `/identity/api/v1/admin/agents/${id}/credentials`,
|
|
74
|
+
ADMIN_AGENTS_ACTIVITY: (id: string) => `/identity/api/v1/admin/agents/${id}/activity`,
|
|
75
|
+
ADMIN_AGENTS_PERMISSIONS: (id: string) => `/identity/api/v1/admin/agents/${id}/permissions`,
|
|
76
|
+
ADMIN_ROBOTS: '/identity/api/v1/admin/robots',
|
|
77
|
+
ADMIN_ROBOT: (id: string) => `/identity/api/v1/admin/robots/${id}`,
|
|
78
|
+
ADMIN_DEVICES: '/identity/api/v1/admin/iots',
|
|
79
|
+
ADMIN_DEVICE: (id: string) => `/identity/api/v1/admin/iots/${id}`,
|
|
80
|
+
ADMIN_USERS: '/identity/api/v1/admin/users',
|
|
81
|
+
ADMIN_USER: (id: string) => `/identity/api/v1/admin/users/${id}`,
|
|
82
|
+
ADMIN_CONSENTS: '/identity/api/v1/admin/consents',
|
|
83
|
+
ADMIN_ROLES: '/identity/api/v1/admin/roles',
|
|
84
|
+
ADMIN_ROLE: (id: string) => `/identity/api/v1/admin/roles/${id}`,
|
|
85
|
+
ADMIN_PERMISSIONS: '/identity/api/v1/admin/permissions',
|
|
86
|
+
ADMIN_SESSIONS: '/identity/api/v1/admin/sessions',
|
|
87
|
+
ADMIN_POLICIES_NHI: '/identity/api/v1/admin/policies/nhi',
|
|
88
|
+
ADMIN_SECURITY_AUTH_CONFIG: '/identity/api/v1/admin/security/auth-config',
|
|
89
|
+
ADMIN_MEMBERS_PENDING: '/identity/api/v1/admin/members/pending',
|
|
90
|
+
ADMIN_MEMBER_APPROVE: (id: string) => `/identity/api/v1/admin/members/${id}/approve`,
|
|
91
|
+
ADMIN_MEMBER_REJECT: (id: string) => `/identity/api/v1/admin/members/${id}/reject`,
|
|
92
|
+
ADMIN_MEMBERS_BATCH_APPROVE: '/identity/api/v1/admin/members/batch-approve',
|
|
93
|
+
ADMIN_USER_PASSWORD_STATUS: (userId: string) =>
|
|
94
|
+
`/identity/api/v1/admin/users/${userId}/password-status`,
|
|
95
|
+
ADMIN_ABAC_POLICIES: '/identity/api/v1/admin/abac-policies',
|
|
96
|
+
ADMIN_ABAC_POLICY: (id: string) => `/identity/api/v1/admin/abac-policies/${id}`,
|
|
97
|
+
ADMIN_ROLE_ACTIVATIONS: '/identity/api/v1/admin/role-activations',
|
|
98
|
+
ADMIN_ROLE_ACTIVATION_APPROVE: (id: string) =>
|
|
99
|
+
`/identity/api/v1/admin/role-activations/${id}/approve`,
|
|
100
|
+
ADMIN_ROLE_ACTIVATION_REVOKE: (id: string) =>
|
|
101
|
+
`/identity/api/v1/admin/role-activations/${id}/revoke`,
|
|
102
|
+
ADMIN_IOT: (id: string) => `/identity/api/v1/admin/iots/${id}`,
|
|
103
|
+
ADMIN_ROBOT_COMMISSION: (id: string) => `/identity/api/v1/admin/robots/${id}/commission`,
|
|
104
|
+
ADMIN_ROBOT_DECOMMISSION: (id: string) => `/identity/api/v1/admin/robots/${id}/decommission`,
|
|
105
|
+
ADMIN_ROBOT_INTENT: (id: string) => `/identity/api/v1/admin/robots/${id}/intent`,
|
|
106
|
+
} as const;
|
|
107
|
+
|
|
108
|
+
// ──────────────────────────────── MFA Service ─────────────────────────────────────
|
|
109
|
+
|
|
110
|
+
export const MFA = {
|
|
111
|
+
STATUS: (userId: string) => `/mfa/api/v1/mfa/status/${userId}`,
|
|
112
|
+
TOTP_ENABLE: '/mfa/api/v1/mfa/totp/enable',
|
|
113
|
+
TOTP_VERIFY: '/mfa/api/v1/mfa/totp/verify',
|
|
114
|
+
TOTP_DISABLE: '/mfa/api/v1/mfa/totp/disable',
|
|
115
|
+
TOTP_SETUP: '/mfa/api/v1/mfa/totp/setup',
|
|
116
|
+
TOTP_VALIDATE: '/mfa/api/v1/mfa/totp/validate',
|
|
117
|
+
TOTP_DEVICES: '/mfa/api/v1/mfa/totp/devices',
|
|
118
|
+
TOTP_DEVICE: (id: string) => `/mfa/api/v1/mfa/totp/devices/${id}`,
|
|
119
|
+
TOTP_DEVICE_ENABLE: (id: string) => `/mfa/api/v1/mfa/totp/devices/${id}/enable`,
|
|
120
|
+
TOTP_DEVICE_DISABLE: (id: string) => `/mfa/api/v1/mfa/totp/devices/${id}/disable`,
|
|
121
|
+
BACKUP_CODES_GENERATE: '/mfa/api/v1/mfa/backup-codes/generate',
|
|
122
|
+
BACKUP_CODES_VERIFY: '/mfa/api/v1/mfa/backup-codes/verify',
|
|
123
|
+
BACKUP_CODES: '/mfa/api/v1/mfa/backup-codes',
|
|
124
|
+
BACKUP_CODES_COUNT: '/mfa/api/v1/mfa/backup-codes/count',
|
|
125
|
+
METHODS: '/mfa/api/v1/mfa/methods',
|
|
126
|
+
METHOD_DELETE: (methodType: string) => `/mfa/api/v1/mfa/methods/${methodType}`,
|
|
127
|
+
CHALLENGE: '/mfa/api/v1/mfa/challenge',
|
|
128
|
+
STEP_UP: '/mfa/api/v1/mfa/step-up',
|
|
129
|
+
CREDENTIAL_PRIMARY: (id: string) => `/mfa/api/v1/mfa/credentials/${id}/primary`,
|
|
130
|
+
PUSH_CHALLENGE: '/mfa/api/v1/mfa/push/challenge',
|
|
131
|
+
PUSH_APPROVE: '/mfa/api/v1/mfa/push/approve',
|
|
132
|
+
PUSH_DENY: '/mfa/api/v1/mfa/push/deny',
|
|
133
|
+
PUSH_SUBSCRIPTIONS: '/mfa/api/v1/mfa/push/subscriptions',
|
|
134
|
+
PUSH_HISTORY: '/mfa/api/v1/mfa/push/history',
|
|
135
|
+
EMAIL_SEND: '/mfa/api/v1/mfa/email/send',
|
|
136
|
+
EMAIL_VERIFY: '/mfa/api/v1/mfa/email/verify',
|
|
137
|
+
EMAIL_ENROLL: '/mfa/api/v1/mfa/email/enroll',
|
|
138
|
+
EMAIL_DISABLE: '/mfa/api/v1/mfa/email/disable',
|
|
139
|
+
SMS_SEND: '/mfa/api/v1/mfa/sms/send',
|
|
140
|
+
SMS_VERIFY: '/mfa/api/v1/mfa/sms/verify',
|
|
141
|
+
SMS_ENROLL: '/mfa/api/v1/mfa/sms/enroll',
|
|
142
|
+
SMS_DISABLE: '/mfa/api/v1/mfa/sms/disable',
|
|
143
|
+
WEBAUTHN_CREDENTIALS: '/mfa/api/v1/mfa/webauthn/credentials',
|
|
144
|
+
WEBAUTHN_CREDENTIAL: (id: string) => `/mfa/api/v1/mfa/webauthn/credentials/${id}`,
|
|
145
|
+
TRUSTED_DEVICES: '/mfa/api/v1/mfa/trusted-devices',
|
|
146
|
+
TRUSTED_DEVICE: (id: string) => `/mfa/api/v1/mfa/trusted-devices/${id}`,
|
|
147
|
+
DEVICES_SYNC: '/mfa/api/v1/mfa/devices/sync',
|
|
148
|
+
// Admin
|
|
149
|
+
ADMIN_IP_WHITELIST: '/mfa/api/v1/admin/mfa/ip-whitelist',
|
|
150
|
+
ADMIN_RISK_POLICIES: '/mfa/api/v1/admin/mfa/risk-policies',
|
|
151
|
+
ADMIN_PUSH_CHALLENGES: '/mfa/api/v1/admin/mfa/push/challenges',
|
|
152
|
+
ADMIN_PUSH_STATS: '/mfa/api/v1/admin/mfa/push/stats',
|
|
153
|
+
ADMIN_RESET: (userId: string) => `/mfa/api/v1/admin/mfa/reset/${userId}`,
|
|
154
|
+
} as const;
|
|
155
|
+
|
|
156
|
+
// ──────────────────────────────── OAuth Service ───────────────────────────────────
|
|
157
|
+
|
|
158
|
+
export const OAUTH = {
|
|
159
|
+
CLIENTS: '/oauth/api/v1/admin/oauth/clients',
|
|
160
|
+
CLIENT: (id: string) => `/oauth/api/v1/admin/oauth/clients/${id}`,
|
|
161
|
+
CLIENT_SECRETS: (id: string) => `/oauth/api/v1/admin/oauth/clients/${id}/secrets`,
|
|
162
|
+
TOKEN: '/oauth/api/v1/oauth/token',
|
|
163
|
+
REFRESH: '/oauth/api/v1/oauth/refresh',
|
|
164
|
+
} as const;
|
|
165
|
+
|
|
166
|
+
// ──────────────────────────────── Tenant Service ──────────────────────────────────
|
|
167
|
+
|
|
168
|
+
export const TENANT = {
|
|
169
|
+
ADMIN_TENANTS: '/tenant/api/v1/admin/tenants',
|
|
170
|
+
ADMIN_TENANT: (id: string) => `/tenant/api/v1/admin/tenants/${id}`,
|
|
171
|
+
ADMIN_APPLICATIONS: (tid: string) => `/tenant/api/v1/admin/tenants/${tid}/applications`,
|
|
172
|
+
ADMIN_APPLICATION: (tid: string, aid: string) =>
|
|
173
|
+
`/tenant/api/v1/admin/tenants/${tid}/applications/${aid}`,
|
|
174
|
+
ADMIN_MEMBERS: (tid: string) => `/tenant/api/v1/admin/tenants/${tid}/members`,
|
|
175
|
+
ADMIN_INVITATIONS: (tid: string) => `/tenant/api/v1/admin/tenants/${tid}/members/invite`,
|
|
176
|
+
ADMIN_WEBHOOKS: (tid: string) => `/tenant/api/v1/admin/tenants/${tid}/webhooks`,
|
|
177
|
+
ADMIN_WEBHOOK: (tid: string, hid: string) =>
|
|
178
|
+
`/tenant/api/v1/admin/tenants/${tid}/webhooks/${hid}`,
|
|
179
|
+
ADMIN_INVITATION_CONFIG: (id: string) => `/tenant/api/v1/admin/tenants/${id}/invitation-config`,
|
|
180
|
+
MINORS_PROTECTION: (tid: string) => `/tenant/api/v1/admin/tenants/${tid}/minors-protection`,
|
|
181
|
+
SOD_CONFIG: (tid: string) => `/tenant/api/v1/admin/tenants/${tid}/sod-config`,
|
|
182
|
+
} as const;
|
|
183
|
+
|
|
184
|
+
// ──────────────────────────────── Billing Service ─────────────────────────────────
|
|
185
|
+
|
|
186
|
+
export const BILLING = {
|
|
187
|
+
ADMIN_PLANS: '/billing/api/v1/admin/billing/plans',
|
|
188
|
+
ADMIN_PLAN: (id: string) => `/billing/api/v1/admin/billing/plans/${id}`,
|
|
189
|
+
ADMIN_PLAN_FEATURE_GATES: (id: string) =>
|
|
190
|
+
`/billing/api/v1/admin/billing/plans/${id}/feature-gates`,
|
|
191
|
+
ADMIN_FEATURE_GATES: '/billing/api/v1/admin/billing/feature-gates',
|
|
192
|
+
ADMIN_FEATURE_GATE_OVERRIDES: '/billing/api/v1/admin/billing/feature-gates/overrides',
|
|
193
|
+
ADMIN_SUBSCRIPTION_APPS: (tid: string) =>
|
|
194
|
+
`/billing/api/v1/admin/billing/subscription/apps/${tid}`,
|
|
195
|
+
ADMIN_RECORDS: '/billing/api/v1/admin/billing/records',
|
|
196
|
+
ADMIN_RECORD: (id: string) => `/billing/api/v1/admin/billing/records/${id}`,
|
|
197
|
+
ADMIN_PAYMENT_GATEWAYS: '/billing/api/v1/admin/billing/payment-gateways',
|
|
198
|
+
ADMIN_PAYMENT_GATEWAY: (id: string) => `/billing/api/v1/admin/billing/payment-gateways/${id}`,
|
|
199
|
+
ADMIN_REFUND_APPROVALS: '/billing/api/v1/admin/billing/refund-approval',
|
|
200
|
+
ADMIN_REFUND_APPROVAL: (id: string) => `/billing/api/v1/admin/billing/refund-approval/${id}`,
|
|
201
|
+
ADMIN_CREDIT_NOTE: (number: string) => `/billing/api/v1/admin/billing/credit-note/${number}`,
|
|
202
|
+
ADMIN_INVOICE_CREDIT_NOTE: (invoiceNumber: string) =>
|
|
203
|
+
`/billing/api/v1/admin/billing/invoice/${invoiceNumber}/credit-note`,
|
|
204
|
+
ADMIN_DUNNING_SETTINGS: (tid: string) => `/billing/api/v1/admin/billing/dunning-settings/${tid}`,
|
|
205
|
+
ADMIN_METERED_USAGE: (tid: string) => `/billing/api/v1/admin/billing/metered-usage/${tid}`,
|
|
206
|
+
ADMIN_REVENUE_AMORTIZATION: '/billing/api/v1/admin/billing/revenue-amortization',
|
|
207
|
+
ADMIN_TAX_EXPORT: '/billing/api/v1/admin/billing/tax-export',
|
|
208
|
+
ADMIN_ALERTS: '/billing/api/v1/admin/billing/alerts',
|
|
209
|
+
// User
|
|
210
|
+
SUBSCRIPTION: (tid: string) => `/billing/api/v1/billing/subscription/${tid}`,
|
|
211
|
+
RECORDS: (tid: string) => `/billing/api/v1/billing/records/${tid}`,
|
|
212
|
+
USAGE_CURRENT: (tid: string) => `/billing/api/v1/billing/usage/${tid}/current`,
|
|
213
|
+
USAGE_TIMELINE: (tid: string) => `/billing/api/v1/billing/usage/${tid}/timeline`,
|
|
214
|
+
USAGE_ENDPOINTS: (tid: string) => `/billing/api/v1/billing/usage/${tid}/endpoints`,
|
|
215
|
+
} as const;
|
|
216
|
+
|
|
217
|
+
// ──────────────────────────────── Audit Service ───────────────────────────────────
|
|
218
|
+
|
|
219
|
+
export const AUDIT = {
|
|
220
|
+
ADMIN_LOGS: '/audit/api/v1/admin/audit/logs',
|
|
221
|
+
ADMIN_LOG: (id: string) => `/audit/api/v1/admin/audit/logs/${id}`,
|
|
222
|
+
ADMIN_ALERTS: '/audit/api/v1/admin/audit/alerts',
|
|
223
|
+
ADMIN_ALERT: (id: string) => `/audit/api/v1/admin/audit/alerts/${id}`,
|
|
224
|
+
ADMIN_ANOMALIES: '/audit/api/v1/admin/audit/anomalies',
|
|
225
|
+
ADMIN_ANOMALY: (id: string) => `/audit/api/v1/admin/audit/anomalies/${id}`,
|
|
226
|
+
ADMIN_SIEM_CONNECTORS: '/audit/api/v1/admin/audit/siem/connectors',
|
|
227
|
+
ADMIN_SIEM_CONNECTOR: (id: string) => `/audit/api/v1/admin/audit/siem/connectors/${id}`,
|
|
228
|
+
ADMIN_RETENTION: '/audit/api/v1/admin/audit/retention-policy',
|
|
229
|
+
ADMIN_ARCHIVE: '/audit/api/v1/admin/audit/archive',
|
|
230
|
+
ADMIN_ARCHIVE_STATUS: '/audit/api/v1/admin/audit/archive/status',
|
|
231
|
+
ADMIN_EXPORT: '/audit/api/v1/admin/audit/export',
|
|
232
|
+
ADMIN_EXPORT_JOBS: '/audit/api/v1/admin/audit/export/jobs',
|
|
233
|
+
ADMIN_EXPORT_DOWNLOAD: (jobId: string) => `/audit/api/v1/admin/audit/export/${jobId}/download`,
|
|
234
|
+
ADMIN_STATS: '/audit/api/v1/admin/audit/stats',
|
|
235
|
+
ADMIN_SERVER_LOGS: '/audit/api/v1/admin/audit/server-logs',
|
|
236
|
+
ADMIN_SERVER_LOG_SERVICES: '/audit/api/v1/admin/audit/server-logs/services',
|
|
237
|
+
ADMIN_TENANT_CONFIG: '/audit/api/v1/admin/audit/tenant-config',
|
|
238
|
+
ADMIN_INCIDENTS: '/audit/api/v1/admin/audit/incidents',
|
|
239
|
+
ADMIN_STREAM: '/audit/api/v1/admin/audit/stream',
|
|
240
|
+
ADMIN_HASHCHAIN: (tid: string) => `/audit/api/v1/admin/audit/hashchain/${tid}`,
|
|
241
|
+
ADMIN_MERKLE_PROOF: '/audit/api/v1/admin/audit/merkle-proof',
|
|
242
|
+
ADMIN_VERIFICATIONS: '/audit/api/v1/admin/audit/verifications',
|
|
243
|
+
// Reports
|
|
244
|
+
ADMIN_REPORT_SECURITY: '/audit/api/v1/admin/audit/reports/security',
|
|
245
|
+
ADMIN_REPORT_COMPLIANCE: '/audit/api/v1/admin/audit/reports/compliance',
|
|
246
|
+
// Compliance sub-resources
|
|
247
|
+
ADMIN_COMPLIANCE_PIAS: '/audit/api/v1/admin/audit/compliance/pias',
|
|
248
|
+
ADMIN_COMPLIANCE_BREACHES: '/audit/api/v1/admin/audit/compliance/breaches',
|
|
249
|
+
ADMIN_COMPLIANCE_DATA_CLASS: '/audit/api/v1/admin/audit/compliance/data-classifications',
|
|
250
|
+
ADMIN_COMPLIANCE_CROSS_BORDER: '/audit/api/v1/admin/audit/compliance/cross-border-transfers',
|
|
251
|
+
ADMIN_COMPLIANCE_AI_DECISIONS: '/audit/api/v1/admin/audit/compliance/ai-decisions',
|
|
252
|
+
ADMIN_COMPLIANCE_CLEANUP: '/audit/api/v1/admin/audit/compliance/cleanup-records',
|
|
253
|
+
ADMIN_COMPLIANCE_SOD_RULES: '/audit/api/v1/admin/audit/compliance/sod-rules',
|
|
254
|
+
ADMIN_COMPLIANCE_ROLE_ACTIONS: '/audit/api/v1/admin/audit/compliance/role-action-mappings',
|
|
255
|
+
ADMIN_BILLING_EVENTS: '/audit/api/v1/admin/audit/billing-events',
|
|
256
|
+
ADMIN_PAYMENT_EVENTS: '/audit/api/v1/admin/audit/payment-events',
|
|
257
|
+
ADMIN_WALLET_EVENTS: '/audit/api/v1/admin/audit/wallet-events',
|
|
258
|
+
// Public
|
|
259
|
+
PUBLIC_HASHCHAIN: '/audit/api/v1/audit/public/hashchain',
|
|
260
|
+
PUBLIC_LOGS_SUMMARY: '/audit/api/v1/audit/public/logs-summary',
|
|
261
|
+
PUBLIC_STATS: '/audit/api/v1/audit/public/stats',
|
|
262
|
+
} as const;
|
|
263
|
+
|
|
264
|
+
// ──────────────────────────────── Profile Service ─────────────────────────────────
|
|
265
|
+
|
|
266
|
+
export const PROFILE = {
|
|
267
|
+
PROFILE: (uid: string) => `/profile/api/v1/profiles/${uid}`,
|
|
268
|
+
AVATAR_UPLOAD: (uid: string) => `/profile/api/v1/profiles/${uid}/avatar/upload`,
|
|
269
|
+
ADMIN_APPROVAL_REQUESTS: '/profile/api/v1/admin/profiles/approval-requests',
|
|
270
|
+
ADMIN_APPROVAL_APPROVE: (id: string) =>
|
|
271
|
+
`/profile/api/v1/admin/profiles/approval-requests/${id}/approve`,
|
|
272
|
+
ADMIN_APPROVAL_REJECT: (id: string) =>
|
|
273
|
+
`/profile/api/v1/admin/profiles/approval-requests/${id}/reject`,
|
|
274
|
+
ADMIN_POLICY: '/profile/api/v1/admin/profiles/policy',
|
|
275
|
+
ADMIN_FIELD_SCHEMAS: '/profile/api/v1/admin/profiles/field-schemas',
|
|
276
|
+
ADMIN_FIELD_SCHEMA: (fieldKey: string) =>
|
|
277
|
+
`/profile/api/v1/admin/profiles/field-schemas/${fieldKey}`,
|
|
278
|
+
ADMIN_WEBHOOK: '/profile/api/v1/admin/profiles/webhook',
|
|
279
|
+
PROFILE_VERSIONS: (userId: string) => `/profile/api/v1/admin/profiles/${userId}/versions`,
|
|
280
|
+
} as const;
|
|
281
|
+
|
|
282
|
+
// ──────────────────────────────── Notification Service ────────────────────────────
|
|
283
|
+
|
|
284
|
+
export const NOTIFICATION = {
|
|
285
|
+
NOTIFICATIONS: '/notifications/api/v1/notifications',
|
|
286
|
+
UNREAD: '/notifications/api/v1/notifications/unread',
|
|
287
|
+
UNREAD_COUNT: '/notifications/api/v1/notifications/unread-count',
|
|
288
|
+
READ_ALL: '/notifications/api/v1/notifications/read-all',
|
|
289
|
+
READ_REPORT: '/notifications/api/v1/notifications/read-report',
|
|
290
|
+
STATS: '/notifications/api/v1/notifications/stats',
|
|
291
|
+
STREAM: '/notifications/api/v1/notifications/stream',
|
|
292
|
+
TREND: '/notifications/api/v1/notifications/trend',
|
|
293
|
+
TEMPLATES: '/notifications/api/v1/notifications/templates',
|
|
294
|
+
TEMPLATE: (id: string) => `/notifications/api/v1/notifications/templates/${id}`,
|
|
295
|
+
TEMPLATES_AVAILABLE: '/notifications/api/v1/notifications/templates/available',
|
|
296
|
+
PREFERENCES: (uid: string) => `/notifications/api/v1/notifications/preferences/${uid}`,
|
|
297
|
+
EVENT_MAPPINGS: '/notifications/api/v1/notifications/event-mappings',
|
|
298
|
+
GLOBAL_VARIABLES: '/notifications/api/v1/notifications/global-variables',
|
|
299
|
+
SEND: '/notifications/api/v1/notifications/send',
|
|
300
|
+
SEND_BATCH: '/notifications/api/v1/notifications/send-batch',
|
|
301
|
+
SEND_FROM_TEMPLATE: '/notifications/api/v1/notifications/send-from-template',
|
|
302
|
+
TEST: '/notifications/api/v1/notifications/test',
|
|
303
|
+
ANNOUNCEMENTS: '/notifications/api/v1/announcements',
|
|
304
|
+
// Admin
|
|
305
|
+
ADMIN_TEMPLATES: '/notifications/api/v1/admin/notifications/templates',
|
|
306
|
+
ADMIN_TEMPLATE: (id: string) => `/notifications/api/v1/admin/notifications/templates/${id}`,
|
|
307
|
+
ADMIN_TEMPLATE_CLONE_LOCALE: (id: string) =>
|
|
308
|
+
`/notifications/api/v1/admin/notifications/templates/${id}/clone-to-locale`,
|
|
309
|
+
ADMIN_ANNOUNCEMENTS: '/notifications/api/v1/admin/announcements',
|
|
310
|
+
ADMIN_ANNOUNCEMENT: (id: string) => `/notifications/api/v1/admin/announcements/${id}`,
|
|
311
|
+
ADMIN_ANNOUNCEMENT_PUBLISH: (id: string) =>
|
|
312
|
+
`/notifications/api/v1/admin/announcements/${id}/publish`,
|
|
313
|
+
ADMIN_ANNOUNCEMENT_UNPUBLISH: (id: string) =>
|
|
314
|
+
`/notifications/api/v1/admin/announcements/${id}/unpublish`,
|
|
315
|
+
ADMIN_BROADCAST: '/notifications/api/v1/admin/notifications/broadcast',
|
|
316
|
+
ADMIN_EVENT_MAPPINGS: '/notifications/api/v1/admin/notifications/event-mappings',
|
|
317
|
+
ADMIN_GLOBAL_VARIABLES: '/notifications/api/v1/admin/notifications/global-variables',
|
|
318
|
+
ADMIN_PLATFORM_STATS: '/notifications/api/v1/admin/notifications/platform-stats',
|
|
319
|
+
} as const;
|
|
320
|
+
|
|
321
|
+
// ──────────────────────────────── Secret Service ──────────────────────────────────
|
|
322
|
+
|
|
323
|
+
export const SECRET = {
|
|
324
|
+
ADMIN_SECRETS: '/secret/api/v1/admin/secrets',
|
|
325
|
+
ADMIN_POLICY: '/secret/api/v1/admin/secrets/policy',
|
|
326
|
+
ADMIN_ENCRYPTION_KEYS: '/secret/api/v1/admin/secrets/encryption-keys',
|
|
327
|
+
ADMIN_JWT_KEYS: '/secret/api/v1/admin/secrets/jwt/keys',
|
|
328
|
+
ADMIN_BATCH_REVOKE: '/secret/api/v1/admin/secrets/batch-revoke',
|
|
329
|
+
ADMIN_BATCH_DELETE: '/secret/api/v1/admin/secrets/batch-delete',
|
|
330
|
+
ADMIN_SECRET_BY_KEY: (key: string) => `/secret/api/v1/admin/secrets/${key}`,
|
|
331
|
+
} as const;
|
|
332
|
+
|
|
333
|
+
// ──────────────────────────────── Compliance Service ──────────────────────────────
|
|
334
|
+
|
|
335
|
+
export const COMPLIANCE = {
|
|
336
|
+
ADMIN_COMPLIANCE: '/compliance/api/v1/admin/compliance',
|
|
337
|
+
ADMIN_POLICY: '/compliance/api/v1/admin/compliance/policy',
|
|
338
|
+
ADMIN_MINORS: '/compliance/api/v1/admin/compliance/minors',
|
|
339
|
+
ADMIN_STANDARDS: '/compliance/api/v1/admin/compliance/standards',
|
|
340
|
+
ADMIN_TENANT_SELF_SCORE: '/compliance/api/v1/admin/compliance/tenants/self/score',
|
|
341
|
+
ADMIN_TENANT_SELF_POLICY: '/compliance/api/v1/admin/compliance/tenants/self/policy',
|
|
342
|
+
ADMIN_TENANT_SELF_OVERRIDES: '/compliance/api/v1/admin/compliance/tenants/self/overrides',
|
|
343
|
+
ADMIN_TENANT_SELF_STANDARDS: '/compliance/api/v1/admin/compliance/tenants/self/standards',
|
|
344
|
+
ADMIN_TENANT_SELF_GAP_ANALYSIS: '/compliance/api/v1/admin/compliance/tenants/self/gap-analysis',
|
|
345
|
+
ADMIN_TENANT_SELF_READINESS: (stdId: string) =>
|
|
346
|
+
`/compliance/api/v1/admin/compliance/tenants/self/readiness/${stdId}`,
|
|
347
|
+
ADMIN_TENANT_SELF_OVERRIDE: (param: string) =>
|
|
348
|
+
`/compliance/api/v1/admin/compliance/tenants/self/overrides/${param}`,
|
|
349
|
+
ADMIN_BREACH_NOTIFICATIONS: '/compliance/api/v1/admin/compliance/breach-notifications',
|
|
350
|
+
ADMIN_LEGAL_DOCUMENTS: '/compliance/api/v1/admin/compliance/legal-documents',
|
|
351
|
+
ADMIN_LEGAL_DOCUMENT: (id: string) => `/compliance/api/v1/admin/compliance/legal-documents/${id}`,
|
|
352
|
+
ADMIN_LEGAL_DOCUMENT_PUBLISH: (id: string) =>
|
|
353
|
+
`/compliance/api/v1/admin/compliance/legal-documents/${id}/publish`,
|
|
354
|
+
ADMIN_LEGAL_DOCUMENT_ARCHIVE: (id: string) =>
|
|
355
|
+
`/compliance/api/v1/admin/compliance/legal-documents/${id}/archive`,
|
|
356
|
+
} as const;
|
|
357
|
+
|
|
358
|
+
// ──────────────────────────────── Wallet Service ──────────────────────────────────
|
|
359
|
+
|
|
360
|
+
export const WALLET = {
|
|
361
|
+
ADMIN_WALLETS: '/wallet/api/v1/admin/wallets',
|
|
362
|
+
ADMIN_TRANSACTIONS: '/wallet/api/v1/admin/wallets/tenant/default/transactions',
|
|
363
|
+
ADMIN_COUPONS: '/wallet/api/v1/admin/wallets/coupons',
|
|
364
|
+
ADMIN_FRAUD_RULES: '/wallet/api/v1/admin/wallets/fraud-rules',
|
|
365
|
+
ADMIN_BATCH_FREEZE: '/wallet/api/v1/admin/wallets/batch-freeze',
|
|
366
|
+
ADMIN_BATCH_UNFREEZE: '/wallet/api/v1/admin/wallets/batch-unfreeze',
|
|
367
|
+
ADMIN_WALLET_INTEGRITY: (walletId: string) =>
|
|
368
|
+
`/wallet/api/v1/admin/wallets/${walletId}/integrity`,
|
|
369
|
+
} as const;
|
|
370
|
+
|
|
371
|
+
// ──────────────────────────────── Point Service ───────────────────────────────────
|
|
372
|
+
|
|
373
|
+
export const POINT = {
|
|
374
|
+
ADMIN_CONFIG: '/point/api/v1/admin/points/config',
|
|
375
|
+
} as const;
|
|
376
|
+
|
|
377
|
+
// ──────────────────────────────── Storage Service ─────────────────────────────────
|
|
378
|
+
|
|
379
|
+
export const STORAGE = {
|
|
380
|
+
ADMIN_FILES: '/storage/api/v1/admin/storage/files',
|
|
381
|
+
ADMIN_STATS: '/storage/api/v1/admin/storage/stats',
|
|
382
|
+
FILE_DOWNLOAD: (id: string) => `/storage/api/v1/storage/files/${id}/download`,
|
|
383
|
+
} as const;
|
|
384
|
+
|
|
385
|
+
// ──────────────────────────────── Communication Service ───────────────────────────
|
|
386
|
+
|
|
387
|
+
export const COMMUNICATION = {
|
|
388
|
+
ADMIN_PROVIDERS: '/communication/api/v1/admin/communication/providers',
|
|
389
|
+
} as const;
|
|
390
|
+
|
|
391
|
+
// ──────────────────────────────── Status Service ─────────────────────────────────
|
|
392
|
+
|
|
393
|
+
export const STATUS = {
|
|
394
|
+
INCIDENT: (id: string) => `/status/api/v1/status/incidents/${id}`,
|
|
395
|
+
MAINTENANCE: (id: string) => `/status/api/v1/status/maintenances/${id}`,
|
|
396
|
+
SUBSCRIBERS: '/status/api/v1/status/subscriptions',
|
|
397
|
+
} as const;
|
|
398
|
+
|
|
399
|
+
// ──────────────────────────────── RBAC Service ────────────────────────────────────
|
|
400
|
+
|
|
401
|
+
export const RBAC = {
|
|
402
|
+
ADMIN_APPROVAL_REQUESTS: '/rbac/api/v1/admin/approval-requests',
|
|
403
|
+
ADMIN_APPROVAL_REQUESTS_APPROVE: (requestId: string) =>
|
|
404
|
+
`/rbac/api/v1/admin/approval-requests/${requestId}/approve`,
|
|
405
|
+
ADMIN_APPROVAL_REQUESTS_REJECT: (requestId: string) =>
|
|
406
|
+
`/rbac/api/v1/admin/approval-requests/${requestId}/reject`,
|
|
407
|
+
ADMIN_ROLE_APPROVAL_REQUESTS: (roleId: string) =>
|
|
408
|
+
`/rbac/api/v1/admin/roles/${roleId}/approval-requests`,
|
|
409
|
+
} as const;
|
|
410
|
+
|
|
411
|
+
// ──────────────────────────────── Verification Service ────────────────────────────
|
|
412
|
+
|
|
413
|
+
export const VERIFICATION = {
|
|
414
|
+
ADMIN_VERIFICATION: (id: string) => `/verification/api/v1/admin/verifications/${id}`,
|
|
415
|
+
ADMIN_VERIFICATION_OVERRIDE: (id: string) =>
|
|
416
|
+
`/verification/api/v1/admin/verifications/${id}/override`,
|
|
417
|
+
ADMIN_VERIFICATION_RESET_RETRY: (id: string) =>
|
|
418
|
+
`/verification/api/v1/admin/verifications/${id}/reset`,
|
|
419
|
+
} as const;
|
|
420
|
+
|
|
421
|
+
// ──────────────────────────────── Session Service ─────────────────────────────────
|
|
422
|
+
|
|
423
|
+
export const SESSION = {
|
|
424
|
+
ADMIN_SESSIONS: '/session/api/v1/admin/sessions',
|
|
425
|
+
} as const;
|
|
426
|
+
|
|
427
|
+
// ──────────────────────────────── Aggregated ──────────────────────────────────────
|
|
428
|
+
|
|
429
|
+
export const API = {
|
|
430
|
+
IDENTITY,
|
|
431
|
+
MFA,
|
|
432
|
+
OAUTH,
|
|
433
|
+
TENANT,
|
|
434
|
+
BILLING,
|
|
435
|
+
AUDIT,
|
|
436
|
+
PROFILE,
|
|
437
|
+
NOTIFICATION,
|
|
438
|
+
SECRET,
|
|
439
|
+
COMPLIANCE,
|
|
440
|
+
WALLET,
|
|
441
|
+
POINT,
|
|
442
|
+
STORAGE,
|
|
443
|
+
COMMUNICATION,
|
|
444
|
+
STATUS,
|
|
445
|
+
RBAC,
|
|
446
|
+
SESSION,
|
|
447
|
+
VERIFICATION,
|
|
448
|
+
} as const;
|
|
449
|
+
|
|
450
|
+
export type ApiPaths = typeof API;
|