@colveor/admin 0.0.0-stage → 0.5.2
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.md +106 -0
- package/TAILWINDADMIN-LICENSE +21 -0
- package/dist/account/data.d.ts +1 -0
- package/dist/account/data.js +44 -0
- package/dist/account/profile.d.ts +6 -0
- package/dist/account/profile.js +118 -0
- package/dist/account/sessions.d.ts +1 -0
- package/dist/account/sessions.js +26 -0
- package/dist/account/shared.d.ts +26 -0
- package/dist/account/shared.js +44 -0
- package/dist/account/two-factor.d.ts +5 -0
- package/dist/account/two-factor.js +60 -0
- package/dist/actions.d.ts +39 -0
- package/dist/actions.js +81 -0
- package/dist/api/audit.gen.d.ts +80 -0
- package/dist/api/audit.gen.js +43 -0
- package/dist/api/auth.gen.d.ts +537 -0
- package/dist/api/auth.gen.js +313 -0
- package/dist/api/errors.gen.d.ts +16 -0
- package/dist/api/errors.gen.js +2 -0
- package/dist/api/gormx.gen.d.ts +60 -0
- package/dist/api/gormx.gen.js +16 -0
- package/dist/api/health.gen.d.ts +103 -0
- package/dist/api/health.gen.js +23 -0
- package/dist/api/index.gen.d.ts +21 -0
- package/dist/api/index.gen.js +22 -0
- package/dist/api/invitations.gen.d.ts +128 -0
- package/dist/api/invitations.gen.js +57 -0
- package/dist/api/ledger.gen.d.ts +269 -0
- package/dist/api/ledger.gen.js +113 -0
- package/dist/api/msgtemplate.gen.d.ts +31 -0
- package/dist/api/msgtemplate.gen.js +2 -0
- package/dist/api/notifications.gen.d.ts +66 -0
- package/dist/api/notifications.gen.js +28 -0
- package/dist/api/outbox.gen.d.ts +8 -0
- package/dist/api/outbox.gen.js +2 -0
- package/dist/api/queue.gen.d.ts +112 -0
- package/dist/api/queue.gen.js +15 -0
- package/dist/api/rbac.gen.d.ts +406 -0
- package/dist/api/rbac.gen.js +191 -0
- package/dist/api/reauth.gen.d.ts +289 -0
- package/dist/api/reauth.gen.js +122 -0
- package/dist/api/recorded_payments.gen.d.ts +171 -0
- package/dist/api/recorded_payments.gen.js +79 -0
- package/dist/api/sessions.gen.d.ts +64 -0
- package/dist/api/sessions.gen.js +48 -0
- package/dist/api/settings.gen.d.ts +147 -0
- package/dist/api/settings.gen.js +69 -0
- package/dist/api/storage.gen.d.ts +327 -0
- package/dist/api/storage.gen.js +208 -0
- package/dist/api/support_access.gen.d.ts +155 -0
- package/dist/api/support_access.gen.js +131 -0
- package/dist/api/users.gen.d.ts +407 -0
- package/dist/api/users.gen.js +159 -0
- package/dist/api/verification.gen.d.ts +427 -0
- package/dist/api/verification.gen.js +280 -0
- package/dist/api/webhooks.gen.d.ts +110 -0
- package/dist/api/webhooks.gen.js +45 -0
- package/dist/auth-layout.d.ts +9 -0
- package/dist/auth-layout.js +5 -0
- package/dist/client.d.ts +41 -0
- package/dist/client.js +72 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +82 -0
- package/dist/dates.d.ts +4 -0
- package/dist/dates.js +16 -0
- package/dist/header.d.ts +12 -0
- package/dist/header.js +105 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +15 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +42 -0
- package/dist/kit/avatar.d.ts +5 -0
- package/dist/kit/avatar.js +16 -0
- package/dist/kit/badge.d.ts +10 -0
- package/dist/kit/badge.js +31 -0
- package/dist/kit/card.d.ts +12 -0
- package/dist/kit/card.js +7 -0
- package/dist/kit/code-area.d.ts +15 -0
- package/dist/kit/code-area.js +69 -0
- package/dist/kit/dropdown.d.ts +26 -0
- package/dist/kit/dropdown.js +67 -0
- package/dist/kit/filter-tabs.d.ts +9 -0
- package/dist/kit/filter-tabs.js +7 -0
- package/dist/kit/modal.d.ts +8 -0
- package/dist/kit/modal.js +15 -0
- package/dist/kit/page-header.d.ts +13 -0
- package/dist/kit/page-header.js +13 -0
- package/dist/kit/search.d.ts +4 -0
- package/dist/kit/search.js +16 -0
- package/dist/kit/tooltip.d.ts +17 -0
- package/dist/kit/tooltip.js +52 -0
- package/dist/message-editor.d.ts +9 -0
- package/dist/message-editor.js +80 -0
- package/dist/money.d.ts +10 -0
- package/dist/money.js +17 -0
- package/dist/next.d.ts +6 -0
- package/dist/next.js +19 -0
- package/dist/pages/account.d.ts +1 -0
- package/dist/pages/account.js +47 -0
- package/dist/pages/audit.d.ts +1 -0
- package/dist/pages/audit.js +88 -0
- package/dist/pages/forgot-password.d.ts +1 -0
- package/dist/pages/forgot-password.js +73 -0
- package/dist/pages/ledger.d.ts +1 -0
- package/dist/pages/ledger.js +132 -0
- package/dist/pages/roles.d.ts +1 -0
- package/dist/pages/roles.js +102 -0
- package/dist/pages/settings.d.ts +1 -0
- package/dist/pages/settings.js +86 -0
- package/dist/pages/sign-in.d.ts +5 -0
- package/dist/pages/sign-in.js +117 -0
- package/dist/pages/status.d.ts +1 -0
- package/dist/pages/status.js +122 -0
- package/dist/pages/support.d.ts +1 -0
- package/dist/pages/support.js +90 -0
- package/dist/pages/teams.d.ts +1 -0
- package/dist/pages/teams.js +94 -0
- package/dist/pages/users.d.ts +1 -0
- package/dist/pages/users.js +158 -0
- package/dist/pages/webhooks.d.ts +1 -0
- package/dist/pages/webhooks.js +88 -0
- package/dist/permissions.d.ts +5 -0
- package/dist/permissions.js +31 -0
- package/dist/proof.d.ts +10 -0
- package/dist/proof.js +78 -0
- package/dist/proxy.d.ts +10 -0
- package/dist/proxy.js +166 -0
- package/dist/retry.d.ts +8 -0
- package/dist/retry.js +30 -0
- package/dist/router.d.ts +13 -0
- package/dist/router.js +14 -0
- package/dist/setting-fields.d.ts +12 -0
- package/dist/setting-fields.js +102 -0
- package/dist/setting-list.d.ts +22 -0
- package/dist/setting-list.js +78 -0
- package/dist/shell.d.ts +40 -0
- package/dist/shell.js +97 -0
- package/dist/support.d.ts +37 -0
- package/dist/support.js +76 -0
- package/dist/table.d.ts +40 -0
- package/dist/table.js +73 -0
- package/dist/ui.d.ts +39 -0
- package/dist/ui.js +56 -0
- package/dist/user-actions.d.ts +30 -0
- package/dist/user-actions.js +129 -0
- package/dist/user-roles.d.ts +4 -0
- package/dist/user-roles.js +51 -0
- package/dist/user-row-menu.d.ts +14 -0
- package/dist/user-row-menu.js +45 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/package.json +59 -4
- package/README.md +0 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions this module records about the log itself.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ActionLogViewed = "audit.LogViewed";
|
|
5
|
+
/**
|
|
6
|
+
* Actions this module records about the log itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ActionChainVerified = "audit.ChainVerified";
|
|
9
|
+
/**
|
|
10
|
+
* Actions this module records about the log itself.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ActionMonthArchived = "audit.MonthArchived";
|
|
13
|
+
/**
|
|
14
|
+
* JobArchive moves every month older than audit.keep_months to storage.
|
|
15
|
+
*/
|
|
16
|
+
export declare const JobArchive = "audit.archive";
|
|
17
|
+
/**
|
|
18
|
+
* JobVerify checks the hash chain since the last check (daily).
|
|
19
|
+
*/
|
|
20
|
+
export declare const JobVerify = "audit.verify";
|
|
21
|
+
/**
|
|
22
|
+
* JobVerifyFull checks the whole chain in the database (monthly).
|
|
23
|
+
*/
|
|
24
|
+
export declare const JobVerifyFull = "audit.verify_full";
|
|
25
|
+
/**
|
|
26
|
+
* EventResponse is one recorded event. Seq is its place in the hash chain,
|
|
27
|
+
* null for the second or so until it is sealed.
|
|
28
|
+
*/
|
|
29
|
+
export interface EventResponse {
|
|
30
|
+
id: string;
|
|
31
|
+
seq?: number;
|
|
32
|
+
occurred_at: string;
|
|
33
|
+
action: string;
|
|
34
|
+
outcome: string;
|
|
35
|
+
actor_id?: string;
|
|
36
|
+
target_type: string;
|
|
37
|
+
target_id: string;
|
|
38
|
+
reason: string;
|
|
39
|
+
metadata: {
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
ip: string;
|
|
43
|
+
user_agent: string;
|
|
44
|
+
request_id: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* ArchiveResponse is one month moved to storage.
|
|
48
|
+
*/
|
|
49
|
+
export interface ArchiveResponse {
|
|
50
|
+
id: string;
|
|
51
|
+
period_start: string;
|
|
52
|
+
period_end: string;
|
|
53
|
+
timezone: string;
|
|
54
|
+
first_seq: number;
|
|
55
|
+
last_seq: number;
|
|
56
|
+
record_count: number;
|
|
57
|
+
key: string;
|
|
58
|
+
size_bytes: number;
|
|
59
|
+
checksum: string;
|
|
60
|
+
status: string;
|
|
61
|
+
error: string;
|
|
62
|
+
created_at: string;
|
|
63
|
+
updated_at: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* PermissionRead lets an admin read the audit log.
|
|
67
|
+
*/
|
|
68
|
+
export declare const PermissionRead: string;
|
|
69
|
+
/**
|
|
70
|
+
* Service is the module's admin surface, used by its HTTP handlers.
|
|
71
|
+
*/
|
|
72
|
+
export type Service = unknown;
|
|
73
|
+
/**
|
|
74
|
+
* SettingTimezone is the timezone months are cut in.
|
|
75
|
+
*/
|
|
76
|
+
export declare const SettingTimezone: string;
|
|
77
|
+
/**
|
|
78
|
+
* SettingKeepMonths is how many whole months stay in the database.
|
|
79
|
+
*/
|
|
80
|
+
export declare const SettingKeepMonths: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Code generated by tygo. DO NOT EDIT.
|
|
2
|
+
//////////
|
|
3
|
+
// source: actions.go
|
|
4
|
+
/**
|
|
5
|
+
* Actions this module records about the log itself.
|
|
6
|
+
*/
|
|
7
|
+
export const ActionLogViewed = "audit.LogViewed";
|
|
8
|
+
/**
|
|
9
|
+
* Actions this module records about the log itself.
|
|
10
|
+
*/
|
|
11
|
+
export const ActionChainVerified = "audit.ChainVerified";
|
|
12
|
+
/**
|
|
13
|
+
* Actions this module records about the log itself.
|
|
14
|
+
*/
|
|
15
|
+
export const ActionMonthArchived = "audit.MonthArchived";
|
|
16
|
+
/**
|
|
17
|
+
* JobArchive moves every month older than audit.keep_months to storage.
|
|
18
|
+
*/
|
|
19
|
+
export const JobArchive = "audit.archive";
|
|
20
|
+
/**
|
|
21
|
+
* JobVerify checks the hash chain since the last check (daily).
|
|
22
|
+
*/
|
|
23
|
+
export const JobVerify = "audit.verify";
|
|
24
|
+
/**
|
|
25
|
+
* JobVerifyFull checks the whole chain in the database (monthly).
|
|
26
|
+
*/
|
|
27
|
+
export const JobVerifyFull = "audit.verify_full";
|
|
28
|
+
//////////
|
|
29
|
+
// source: permissions.go
|
|
30
|
+
/**
|
|
31
|
+
* PermissionRead lets an admin read the audit log.
|
|
32
|
+
*/
|
|
33
|
+
export const PermissionRead = "audit.read";
|
|
34
|
+
//////////
|
|
35
|
+
// source: settings.go
|
|
36
|
+
/**
|
|
37
|
+
* SettingTimezone is the timezone months are cut in.
|
|
38
|
+
*/
|
|
39
|
+
export const SettingTimezone = "audit.timezone";
|
|
40
|
+
/**
|
|
41
|
+
* SettingKeepMonths is how many whole months stay in the database.
|
|
42
|
+
*/
|
|
43
|
+
export const SettingKeepMonths = "audit.keep_months";
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import type * as users from "./users.gen";
|
|
2
|
+
import type * as verification from "./verification.gen";
|
|
3
|
+
/**
|
|
4
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
5
|
+
* the action name with outcome failure and the error code as reason.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ActionRegistered = "auth.Registered";
|
|
8
|
+
/**
|
|
9
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
10
|
+
* the action name with outcome failure and the error code as reason.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ActionSignedIn = "auth.SignedIn";
|
|
13
|
+
/**
|
|
14
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
15
|
+
* the action name with outcome failure and the error code as reason.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ActionSignedOut = "auth.SignedOut";
|
|
18
|
+
/**
|
|
19
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
20
|
+
* the action name with outcome failure and the error code as reason.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ActionSignedOutEverywhere = "auth.SignedOutEverywhere";
|
|
23
|
+
/**
|
|
24
|
+
* An admin's, on another user (docs/user-admin.md).
|
|
25
|
+
*/
|
|
26
|
+
export declare const ActionUserSignedOut = "auth.UserSignedOut";
|
|
27
|
+
/**
|
|
28
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
29
|
+
* the action name with outcome failure and the error code as reason.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ActionUserSuspended = "users.UserSuspended";
|
|
32
|
+
/**
|
|
33
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
34
|
+
* the action name with outcome failure and the error code as reason.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ActionUserReactivated = "users.UserReactivated";
|
|
37
|
+
/**
|
|
38
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
39
|
+
* the action name with outcome failure and the error code as reason.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ActionRefreshTokenReused = "auth.RefreshTokenReused";
|
|
42
|
+
/**
|
|
43
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
44
|
+
* the action name with outcome failure and the error code as reason.
|
|
45
|
+
*/
|
|
46
|
+
export declare const ActionPasswordChanged = "auth.PasswordChanged";
|
|
47
|
+
/**
|
|
48
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
49
|
+
* the action name with outcome failure and the error code as reason.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ActionPasswordReset = "auth.PasswordReset";
|
|
52
|
+
/**
|
|
53
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
54
|
+
* the action name with outcome failure and the error code as reason.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ActionPasswordResetRequested = "auth.PasswordResetRequested";
|
|
57
|
+
/**
|
|
58
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
59
|
+
* the action name with outcome failure and the error code as reason.
|
|
60
|
+
*/
|
|
61
|
+
export declare const ActionIdentifierChanged = "auth.IdentifierChanged";
|
|
62
|
+
/**
|
|
63
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
64
|
+
* the action name with outcome failure and the error code as reason.
|
|
65
|
+
*/
|
|
66
|
+
export declare const ActionIdentifierDetached = "auth.IdentifierDetached";
|
|
67
|
+
/**
|
|
68
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
69
|
+
* the action name with outcome failure and the error code as reason.
|
|
70
|
+
*/
|
|
71
|
+
export declare const ActionContactConfirmed = "auth.ContactConfirmed";
|
|
72
|
+
/**
|
|
73
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
74
|
+
* the action name with outcome failure and the error code as reason.
|
|
75
|
+
*/
|
|
76
|
+
export declare const ActionAccountClaimed = "auth.AccountClaimed";
|
|
77
|
+
/**
|
|
78
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
79
|
+
* the action name with outcome failure and the error code as reason.
|
|
80
|
+
*/
|
|
81
|
+
export declare const ActionIdentityLinked = "auth.IdentityLinked";
|
|
82
|
+
/**
|
|
83
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
84
|
+
* the action name with outcome failure and the error code as reason.
|
|
85
|
+
*/
|
|
86
|
+
export declare const ActionIdentityUnlinked = "auth.IdentityUnlinked";
|
|
87
|
+
/**
|
|
88
|
+
* SettingTermsVersion is the terms a new user accepts; empty: none.
|
|
89
|
+
*/
|
|
90
|
+
export declare const SettingTermsVersion: string;
|
|
91
|
+
/**
|
|
92
|
+
* Consent documents.
|
|
93
|
+
*/
|
|
94
|
+
export declare const DocumentTerms = "terms";
|
|
95
|
+
/**
|
|
96
|
+
* Consent documents.
|
|
97
|
+
*/
|
|
98
|
+
export declare const DocumentMarketing = "marketing";
|
|
99
|
+
/**
|
|
100
|
+
* ConsentRequest accepts the terms' version (the current one) and gives or
|
|
101
|
+
* withdraws marketing opt-in. At registration, terms_version is required
|
|
102
|
+
* when auth.terms_version is set; later, either field alone.
|
|
103
|
+
*/
|
|
104
|
+
export interface ConsentRequest {
|
|
105
|
+
terms_version?: string;
|
|
106
|
+
marketing?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* ConsentResponse is the signed-in user's consent.
|
|
110
|
+
*/
|
|
111
|
+
export interface ConsentResponse {
|
|
112
|
+
/**
|
|
113
|
+
* TermsVersion is the version they accepted last; "" for none.
|
|
114
|
+
*/
|
|
115
|
+
terms_version: string;
|
|
116
|
+
/**
|
|
117
|
+
* TermsCurrent is false when auth.terms_version has moved on: ask again.
|
|
118
|
+
*/
|
|
119
|
+
terms_current: boolean;
|
|
120
|
+
marketing: boolean;
|
|
121
|
+
}
|
|
122
|
+
export declare const ErrCodeTermsRequired = "auth.terms_required";
|
|
123
|
+
export declare const ErrCodeTermsOutdated = "auth.terms_outdated";
|
|
124
|
+
/**
|
|
125
|
+
* ActionConsentChanged records an accepted terms version or a marketing
|
|
126
|
+
* opt-in change.
|
|
127
|
+
*/
|
|
128
|
+
export declare const ActionConsentChanged = "auth.ConsentChanged";
|
|
129
|
+
/**
|
|
130
|
+
* RegisterWithVerificationRequest creates an account for the identifier proven by the
|
|
131
|
+
* verification token. That identifier (and its channel) always comes from the
|
|
132
|
+
* token. Email and Phone are optional extra contact details. They are stored
|
|
133
|
+
* unverified, and the one matching the token's channel, if sent, must equal
|
|
134
|
+
* the verified identifier.
|
|
135
|
+
*/
|
|
136
|
+
export interface RegisterWithVerificationRequest {
|
|
137
|
+
verification_token: string;
|
|
138
|
+
phone?: string;
|
|
139
|
+
country_code?: string;
|
|
140
|
+
email?: string;
|
|
141
|
+
profile: users.CreateProfileRequest;
|
|
142
|
+
/**
|
|
143
|
+
* Consent is required when auth.terms_version is set.
|
|
144
|
+
*/
|
|
145
|
+
consent?: ConsentRequest;
|
|
146
|
+
}
|
|
147
|
+
export interface RegisterWithPasswordRequest {
|
|
148
|
+
password: string;
|
|
149
|
+
email: string;
|
|
150
|
+
/**
|
|
151
|
+
* Phone is E.164 (+233201234567), the form code sign-in looks it up by.
|
|
152
|
+
*/
|
|
153
|
+
phone?: string;
|
|
154
|
+
country_code?: string;
|
|
155
|
+
profile: users.CreateProfileRequest;
|
|
156
|
+
/**
|
|
157
|
+
* Consent is required when auth.terms_version is set.
|
|
158
|
+
*/
|
|
159
|
+
consent?: ConsentRequest;
|
|
160
|
+
}
|
|
161
|
+
export interface LoginWithVerificationRequest {
|
|
162
|
+
verification_token: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* RefreshTokenRequest exchanges a refresh token for a new token pair.
|
|
166
|
+
*/
|
|
167
|
+
export interface RefreshTokenRequest {
|
|
168
|
+
refresh_token: string;
|
|
169
|
+
}
|
|
170
|
+
export interface LoginWithPasswordRequest {
|
|
171
|
+
email: string;
|
|
172
|
+
password: string;
|
|
173
|
+
/**
|
|
174
|
+
* VerificationToken finishes email verification when
|
|
175
|
+
* auth.require_verified_email is on: the token from verifying the code
|
|
176
|
+
* sent at registration (purpose verify_email). Giving it together with
|
|
177
|
+
* the password proves the same person owns both.
|
|
178
|
+
*/
|
|
179
|
+
verification_token?: string;
|
|
180
|
+
}
|
|
181
|
+
export interface TokenResponse {
|
|
182
|
+
access_token?: string;
|
|
183
|
+
refresh_token?: string;
|
|
184
|
+
user?: users.UserResponse;
|
|
185
|
+
roles?: string[];
|
|
186
|
+
expires_in?: number;
|
|
187
|
+
/**
|
|
188
|
+
* VerificationRequired is set instead of tokens when
|
|
189
|
+
* auth.require_verified_email is on and the email is not verified yet.
|
|
190
|
+
* Verification is the code sent to it; verify the code, then log in
|
|
191
|
+
* with email, password and the resulting verification_token.
|
|
192
|
+
*/
|
|
193
|
+
verification_required?: boolean;
|
|
194
|
+
verification?: verification.VerificationResponseData;
|
|
195
|
+
/**
|
|
196
|
+
* MFARequired is set instead of tokens when the account has two-factor
|
|
197
|
+
* sign-in on. Finish with a second factor at /v1/reauth/2fa/verify,
|
|
198
|
+
* sending MFAToken.
|
|
199
|
+
*/
|
|
200
|
+
mfa_required?: boolean;
|
|
201
|
+
mfa_token?: string;
|
|
202
|
+
}
|
|
203
|
+
export interface ForgotPasswordRequest {
|
|
204
|
+
email: string;
|
|
205
|
+
/**
|
|
206
|
+
* Mode selects how the reset instructions are delivered: "code" sends an
|
|
207
|
+
* code the client verifies via /verifications/verify; "link" emails a link that
|
|
208
|
+
* carries the reset token directly.
|
|
209
|
+
*/
|
|
210
|
+
mode: verification.DeliveryMode;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* ForgotPasswordResponse has the same shape whether or not the account
|
|
214
|
+
* exists (see ForgotPassword).
|
|
215
|
+
*/
|
|
216
|
+
export interface ForgotPasswordResponse {
|
|
217
|
+
message: string;
|
|
218
|
+
success: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* VerificationId is used with Verify (code mode) and Resend.
|
|
221
|
+
*/
|
|
222
|
+
verification_id: string;
|
|
223
|
+
mode: verification.DeliveryMode;
|
|
224
|
+
/**
|
|
225
|
+
* ExpiresAt is the code's or link's expiry as Unix milliseconds.
|
|
226
|
+
*/
|
|
227
|
+
expires_at: number;
|
|
228
|
+
/**
|
|
229
|
+
* ResendIn is the cooldown in seconds before the client may resend.
|
|
230
|
+
*/
|
|
231
|
+
resend_in: number;
|
|
232
|
+
}
|
|
233
|
+
export interface ResetPasswordRequest {
|
|
234
|
+
token: string;
|
|
235
|
+
password: string;
|
|
236
|
+
}
|
|
237
|
+
export interface ResetPasswordResponse {
|
|
238
|
+
message: string;
|
|
239
|
+
success: boolean;
|
|
240
|
+
}
|
|
241
|
+
export interface ChangePasswordRequest {
|
|
242
|
+
current_password: string;
|
|
243
|
+
new_password: string;
|
|
244
|
+
}
|
|
245
|
+
export interface ChangePasswordResponse {
|
|
246
|
+
message: string;
|
|
247
|
+
success: boolean;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* ActionChangeIdentifier is the re-authentication action that
|
|
251
|
+
* PUT /v1/auth/identifier requires (X-Reauth-Token).
|
|
252
|
+
*/
|
|
253
|
+
export declare const ActionChangeIdentifier = "change_identifier";
|
|
254
|
+
/**
|
|
255
|
+
* ActionLinkIdentity is the re-authentication action that
|
|
256
|
+
* POST /v1/auth/identities/{provider} requires: a connected provider can
|
|
257
|
+
* sign in to the account.
|
|
258
|
+
*/
|
|
259
|
+
export declare const ActionLinkIdentity = "link_identity";
|
|
260
|
+
/**
|
|
261
|
+
* ActionUnlinkIdentity is the re-authentication action that
|
|
262
|
+
* DELETE /v1/auth/identities/{provider} requires: disconnecting removes a
|
|
263
|
+
* way to sign in.
|
|
264
|
+
*/
|
|
265
|
+
export declare const ActionUnlinkIdentity = "unlink_identity";
|
|
266
|
+
/**
|
|
267
|
+
* SetIdentifierRequest sets the signed-in user's sign-in email or phone to
|
|
268
|
+
* the address the token proves (purpose update_email or update_phone, via
|
|
269
|
+
* /v1/auth/verifications). CountryCode is only used for a phone.
|
|
270
|
+
*/
|
|
271
|
+
export interface SetIdentifierRequest {
|
|
272
|
+
verification_token: string;
|
|
273
|
+
country_code?: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* ConfirmContactRequest confirms the signed-in user's contact email or
|
|
277
|
+
* phone with the token from verifying a code sent to it (purpose
|
|
278
|
+
* verify_email or verify_phone, via /v1/auth/verifications).
|
|
279
|
+
*/
|
|
280
|
+
export interface ConfirmContactRequest {
|
|
281
|
+
verification_token: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* ConfirmContactResponse says what happened to the contact.
|
|
285
|
+
*/
|
|
286
|
+
export interface ConfirmContactResponse {
|
|
287
|
+
/**
|
|
288
|
+
* Field is "email" or "phone".
|
|
289
|
+
*/
|
|
290
|
+
field: string;
|
|
291
|
+
/**
|
|
292
|
+
* Promoted is true when the contact became the sign-in email or phone.
|
|
293
|
+
* False means it is now verified but stays a contact: the account
|
|
294
|
+
* already has a sign-in address of that kind, or another account signs
|
|
295
|
+
* in with it.
|
|
296
|
+
*/
|
|
297
|
+
promoted: boolean;
|
|
298
|
+
user: users.UserResponse;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Credential & Account error codes
|
|
302
|
+
*/
|
|
303
|
+
export declare const ErrCodeInvalidCredentials = "auth.invalid_credentials";
|
|
304
|
+
/**
|
|
305
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
306
|
+
* These are part of the module's public contract: once released, a code must
|
|
307
|
+
* not change meaning.
|
|
308
|
+
*/
|
|
309
|
+
export declare const ErrCodeUserNotFound = "auth.user_not_found";
|
|
310
|
+
/**
|
|
311
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
312
|
+
* These are part of the module's public contract: once released, a code must
|
|
313
|
+
* not change meaning.
|
|
314
|
+
*/
|
|
315
|
+
export declare const ErrCodeUserAlreadyExists = "auth.user_already_exists";
|
|
316
|
+
/**
|
|
317
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
318
|
+
* These are part of the module's public contract: once released, a code must
|
|
319
|
+
* not change meaning.
|
|
320
|
+
*/
|
|
321
|
+
export declare const ErrCodeInvalidMFAToken = "auth.invalid_mfa_token";
|
|
322
|
+
/**
|
|
323
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
324
|
+
* These are part of the module's public contract: once released, a code must
|
|
325
|
+
* not change meaning.
|
|
326
|
+
*/
|
|
327
|
+
export declare const ErrCodeInvalidRefreshToken = "auth.invalid_refresh_token";
|
|
328
|
+
/**
|
|
329
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
330
|
+
* These are part of the module's public contract: once released, a code must
|
|
331
|
+
* not change meaning.
|
|
332
|
+
*/
|
|
333
|
+
export declare const ErrCodeUnauthenticated = "auth.unauthenticated";
|
|
334
|
+
/**
|
|
335
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
336
|
+
* These are part of the module's public contract: once released, a code must
|
|
337
|
+
* not change meaning.
|
|
338
|
+
*/
|
|
339
|
+
export declare const ErrCodeAccountSuspended = "auth.account_suspended";
|
|
340
|
+
/**
|
|
341
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
342
|
+
* These are part of the module's public contract: once released, a code must
|
|
343
|
+
* not change meaning.
|
|
344
|
+
*/
|
|
345
|
+
export declare const ErrCodeAccountLocked = "auth.account_locked";
|
|
346
|
+
/**
|
|
347
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
348
|
+
* These are part of the module's public contract: once released, a code must
|
|
349
|
+
* not change meaning.
|
|
350
|
+
*/
|
|
351
|
+
export declare const ErrCodeAccountRevoked = "auth.account_revoked";
|
|
352
|
+
/**
|
|
353
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
354
|
+
* These are part of the module's public contract: once released, a code must
|
|
355
|
+
* not change meaning.
|
|
356
|
+
*/
|
|
357
|
+
export declare const ErrCodeAccountPending = "auth.account_pending";
|
|
358
|
+
/**
|
|
359
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
360
|
+
* These are part of the module's public contract: once released, a code must
|
|
361
|
+
* not change meaning.
|
|
362
|
+
*/
|
|
363
|
+
export declare const ErrCodeInvalidCurrentPassword = "auth.invalid_current_password";
|
|
364
|
+
/**
|
|
365
|
+
* Social sign-in error codes
|
|
366
|
+
*/
|
|
367
|
+
export declare const ErrCodeProviderUnavailable = "auth.provider_unavailable";
|
|
368
|
+
/**
|
|
369
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
370
|
+
* These are part of the module's public contract: once released, a code must
|
|
371
|
+
* not change meaning.
|
|
372
|
+
*/
|
|
373
|
+
export declare const ErrCodeInvalidIdentityToken = "auth.invalid_identity_token";
|
|
374
|
+
/**
|
|
375
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
376
|
+
* These are part of the module's public contract: once released, a code must
|
|
377
|
+
* not change meaning.
|
|
378
|
+
*/
|
|
379
|
+
export declare const ErrCodeAccountExists = "auth.account_exists";
|
|
380
|
+
/**
|
|
381
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
382
|
+
* These are part of the module's public contract: once released, a code must
|
|
383
|
+
* not change meaning.
|
|
384
|
+
*/
|
|
385
|
+
export declare const ErrCodeIdentityInUse = "auth.identity_in_use";
|
|
386
|
+
/**
|
|
387
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
388
|
+
* These are part of the module's public contract: once released, a code must
|
|
389
|
+
* not change meaning.
|
|
390
|
+
*/
|
|
391
|
+
export declare const ErrCodeProviderLinked = "auth.provider_already_linked";
|
|
392
|
+
/**
|
|
393
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
394
|
+
* These are part of the module's public contract: once released, a code must
|
|
395
|
+
* not change meaning.
|
|
396
|
+
*/
|
|
397
|
+
export declare const ErrCodeIdentityNotFound = "auth.identity_not_found";
|
|
398
|
+
/**
|
|
399
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
400
|
+
* These are part of the module's public contract: once released, a code must
|
|
401
|
+
* not change meaning.
|
|
402
|
+
*/
|
|
403
|
+
export declare const ErrCodeLastSignInMethod = "auth.last_sign_in_method";
|
|
404
|
+
/**
|
|
405
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
406
|
+
* These are part of the module's public contract: once released, a code must
|
|
407
|
+
* not change meaning.
|
|
408
|
+
*/
|
|
409
|
+
export declare const ErrCodeInvalidNonce = "auth.invalid_nonce";
|
|
410
|
+
/**
|
|
411
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
412
|
+
* These are part of the module's public contract: once released, a code must
|
|
413
|
+
* not change meaning.
|
|
414
|
+
*/
|
|
415
|
+
export declare const ErrCodeEmailNotVerified = "auth.email_not_verified";
|
|
416
|
+
/**
|
|
417
|
+
* Stable error codes for this module (section 42.5: <module>.<error>).
|
|
418
|
+
* These are part of the module's public contract: once released, a code must
|
|
419
|
+
* not change meaning.
|
|
420
|
+
*/
|
|
421
|
+
export declare const ErrCodeUnverifiedAccount = "auth.unverified_account";
|
|
422
|
+
/**
|
|
423
|
+
* An admin's actions on another user (docs/user-admin.md). Keys name the
|
|
424
|
+
* users they act on, though this module guards them: it owns sign-in and
|
|
425
|
+
* sessions.
|
|
426
|
+
*/
|
|
427
|
+
export declare const PermissionSuspendUsers: string;
|
|
428
|
+
/**
|
|
429
|
+
* An admin's actions on another user (docs/user-admin.md). Keys name the
|
|
430
|
+
* users they act on, though this module guards them: it owns sign-in and
|
|
431
|
+
* sessions.
|
|
432
|
+
*/
|
|
433
|
+
export declare const PermissionSignOutUsers: string;
|
|
434
|
+
/**
|
|
435
|
+
* Rate limit policies (each tunable through its two settings,
|
|
436
|
+
* auth.rate_limit.<name>.limit and .per_seconds).
|
|
437
|
+
*/
|
|
438
|
+
export declare const RateLimitLogin = "auth.login";
|
|
439
|
+
/**
|
|
440
|
+
* RateLimitLoginAccount is per email signed in to, on top of the per-IP
|
|
441
|
+
* auth.login: attempts spread across many IPs (credential stuffing)
|
|
442
|
+
* still hit it.
|
|
443
|
+
*/
|
|
444
|
+
export declare const RateLimitLoginAccount = "auth.login_account";
|
|
445
|
+
/**
|
|
446
|
+
* Rate limit policies (each tunable through its two settings,
|
|
447
|
+
* auth.rate_limit.<name>.limit and .per_seconds).
|
|
448
|
+
*/
|
|
449
|
+
export declare const RateLimitRegister = "auth.register";
|
|
450
|
+
/**
|
|
451
|
+
* Rate limit policies (each tunable through its two settings,
|
|
452
|
+
* auth.rate_limit.<name>.limit and .per_seconds).
|
|
453
|
+
*/
|
|
454
|
+
export declare const RateLimitPasswordReset = "auth.password_reset";
|
|
455
|
+
/**
|
|
456
|
+
* RateLimitChangePassword is per user: the current password is checked
|
|
457
|
+
* on every attempt, so it must not be guessable from a signed-in
|
|
458
|
+
* session.
|
|
459
|
+
*/
|
|
460
|
+
export declare const RateLimitChangePassword = "auth.change_password";
|
|
461
|
+
/**
|
|
462
|
+
* Rate limit policies (each tunable through its two settings,
|
|
463
|
+
* auth.rate_limit.<name>.limit and .per_seconds).
|
|
464
|
+
*/
|
|
465
|
+
export declare const RateLimitOAuth = "auth.oauth";
|
|
466
|
+
/**
|
|
467
|
+
* Rate limit policies (each tunable through its two settings,
|
|
468
|
+
* auth.rate_limit.<name>.limit and .per_seconds).
|
|
469
|
+
*/
|
|
470
|
+
export declare const RateLimitRefresh = "auth.refresh";
|
|
471
|
+
/**
|
|
472
|
+
* AuthService is what the auth module publishes. Verification is its own
|
|
473
|
+
* module (pkg/modules/verification).
|
|
474
|
+
*/
|
|
475
|
+
export type AuthService = unknown;
|
|
476
|
+
/**
|
|
477
|
+
* SettingRequireVerifiedEmail: when on, password accounts get no tokens
|
|
478
|
+
* until their email is verified.
|
|
479
|
+
*/
|
|
480
|
+
export declare const SettingRequireVerifiedEmail: string;
|
|
481
|
+
/**
|
|
482
|
+
* SettingMFATokenTTLSeconds is how long a sign-in waits for its second
|
|
483
|
+
* factor.
|
|
484
|
+
*/
|
|
485
|
+
export declare const SettingMFATokenTTLSeconds: string;
|
|
486
|
+
/**
|
|
487
|
+
* OAuthNonceResponse is a single-use nonce for one social sign-in.
|
|
488
|
+
*/
|
|
489
|
+
export interface OAuthNonceResponse {
|
|
490
|
+
/**
|
|
491
|
+
* Nonce goes to the provider's SDK (Apple: its SHA-256 hex) and back
|
|
492
|
+
* to the API with the ID token. It works once.
|
|
493
|
+
*/
|
|
494
|
+
nonce: string;
|
|
495
|
+
/**
|
|
496
|
+
* ExpiresAt is Unix milliseconds.
|
|
497
|
+
*/
|
|
498
|
+
expires_at: number;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* SocialSignInRequest signs in, or signs up, with a provider ID token.
|
|
502
|
+
*/
|
|
503
|
+
export interface SocialSignInRequest {
|
|
504
|
+
/**
|
|
505
|
+
* IDToken is the JWT the provider's SDK returned to the client.
|
|
506
|
+
*/
|
|
507
|
+
id_token: string;
|
|
508
|
+
/**
|
|
509
|
+
* Nonce is the one issued by POST /v1/auth/oauth/nonce for this sign-in.
|
|
510
|
+
* The token must carry it, and it is spent on use, which is what stops a
|
|
511
|
+
* captured token being replayed.
|
|
512
|
+
*/
|
|
513
|
+
nonce: string;
|
|
514
|
+
/**
|
|
515
|
+
* FirstName and LastName are for Apple, which sends the user's name to
|
|
516
|
+
* the client only on their very first sign-in, never in the token.
|
|
517
|
+
* Google's are read from the token; these are used if it has none.
|
|
518
|
+
*/
|
|
519
|
+
first_name: string;
|
|
520
|
+
last_name: string;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* LinkIdentityRequest connects a provider to the signed-in account.
|
|
524
|
+
*/
|
|
525
|
+
export interface LinkIdentityRequest {
|
|
526
|
+
id_token: string;
|
|
527
|
+
nonce: string;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* IdentityResponse is one provider connected to the account.
|
|
531
|
+
*/
|
|
532
|
+
export interface IdentityResponse {
|
|
533
|
+
provider: string;
|
|
534
|
+
email?: string;
|
|
535
|
+
linked_at: string;
|
|
536
|
+
last_used_at: string;
|
|
537
|
+
}
|