@stackframe/stack-shared 2.4.28 → 2.5.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/CHANGELOG.md +17 -0
- package/dist/crud.d.ts +26 -15
- package/dist/crud.js +16 -0
- package/dist/interface/clientInterface.d.ts +4 -4
- package/dist/interface/clientInterface.js +4 -4
- package/dist/interface/crud/current-user.d.ts +98 -85
- package/dist/interface/crud/current-user.js +35 -17
- package/dist/interface/crud/oauth.d.ts +4 -4
- package/dist/interface/crud/oauth.js +1 -1
- package/dist/interface/crud/users.d.ts +144 -80
- package/dist/interface/crud/users.js +56 -24
- package/dist/known-errors.d.ts +139 -77
- package/dist/known-errors.js +116 -84
- package/dist/schema-fields.d.ts +43 -0
- package/dist/schema-fields.js +68 -0
- package/dist/utils/env.d.ts +3 -2
- package/dist/utils/env.js +6 -3
- package/dist/utils/errors.js +1 -1
- package/dist/utils/jwt.js +3 -3
- package/dist/utils/objects.d.ts +4 -1
- package/dist/utils/objects.js +32 -1
- package/dist/utils/strings.d.ts +5 -1
- package/dist/utils/strings.js +29 -17
- package/dist/utils/yup.d.ts +1 -0
- package/dist/utils/yup.js +11 -0
- package/package.json +2 -2
- package/dist/hooks/use-trigger.d.ts +0 -1
- package/dist/hooks/use-trigger.js +0 -10
- package/dist/interface/crud/fields.d.ts +0 -11
- package/dist/interface/crud/fields.js +0 -12
package/dist/known-errors.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ export type KnownErrorJson = {
|
|
|
9
9
|
export type AbstractKnownErrorConstructor<Args extends any[]> = (abstract new (...args: Args) => KnownError) & {
|
|
10
10
|
constructorArgsFromJson: (json: KnownErrorJson) => Args;
|
|
11
11
|
};
|
|
12
|
-
export type KnownErrorConstructor<
|
|
13
|
-
new (...args: Args):
|
|
12
|
+
export type KnownErrorConstructor<SuperInstance extends KnownError, Args extends any[]> = {
|
|
13
|
+
new (...args: Args): SuperInstance & {
|
|
14
|
+
constructorArgs: Args;
|
|
15
|
+
};
|
|
14
16
|
errorCode: string;
|
|
15
17
|
constructorArgsFromJson: (json: KnownErrorJson) => Args;
|
|
16
18
|
};
|
|
@@ -59,97 +61,183 @@ export declare const KnownErrors: {
|
|
|
59
61
|
ProjectAuthenticationError: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
60
62
|
errorCode: "PROJECT_AUTHENTICATION_ERROR";
|
|
61
63
|
};
|
|
62
|
-
InvalidProjectAuthentication: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
64
|
+
InvalidProjectAuthentication: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
65
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
66
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
63
67
|
errorCode: "INVALID_PROJECT_AUTHENTICATION";
|
|
64
68
|
};
|
|
65
|
-
ProjectKeyWithoutRequestType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
69
|
+
ProjectKeyWithoutRequestType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
70
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
71
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"PROJECT_KEY_WITHOUT_REQUEST_TYPE">, []> & {
|
|
66
72
|
errorCode: "PROJECT_KEY_WITHOUT_REQUEST_TYPE";
|
|
67
73
|
};
|
|
68
|
-
InvalidRequestType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
74
|
+
InvalidRequestType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
75
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
76
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_REQUEST_TYPE">, [requestType: string]> & {
|
|
69
77
|
errorCode: "INVALID_REQUEST_TYPE";
|
|
70
78
|
};
|
|
71
|
-
RequestTypeWithoutProjectId: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
79
|
+
RequestTypeWithoutProjectId: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
80
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
81
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"REQUEST_TYPE_WITHOUT_PROJECT_ID">, [requestType: "client" | "server" | "admin"]> & {
|
|
72
82
|
errorCode: "REQUEST_TYPE_WITHOUT_PROJECT_ID";
|
|
73
83
|
};
|
|
74
|
-
|
|
84
|
+
ProjectKeyWithoutAccessType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
85
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
86
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"PROJECT_KEY_WITHOUT_ACCESS_TYPE">, []> & {
|
|
87
|
+
errorCode: "PROJECT_KEY_WITHOUT_ACCESS_TYPE";
|
|
88
|
+
};
|
|
89
|
+
InvalidAccessType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
90
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
91
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TYPE">, [requestType: string]> & {
|
|
92
|
+
errorCode: "INVALID_ACCESS_TYPE";
|
|
93
|
+
};
|
|
94
|
+
AccessTypeWithoutProjectId: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
95
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
96
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_WITHOUT_PROJECT_ID">, [requestType: "client" | "server" | "admin"]> & {
|
|
97
|
+
errorCode: "ACCESS_TYPE_WITHOUT_PROJECT_ID";
|
|
98
|
+
};
|
|
99
|
+
AccessTypeRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
100
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
101
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_REQUIRED">, []> & {
|
|
102
|
+
errorCode: "ACCESS_TYPE_REQUIRED";
|
|
103
|
+
};
|
|
104
|
+
CannotGetOwnUserWithoutUser: KnownErrorConstructor<KnownError & KnownErrorBrand<"CANNOT_GET_OWN_USER_WITHOUT_USER">, []> & {
|
|
105
|
+
errorCode: "CANNOT_GET_OWN_USER_WITHOUT_USER";
|
|
106
|
+
};
|
|
107
|
+
InsufficientAccessType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
108
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
109
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INSUFFICIENT_ACCESS_TYPE">, [actualAccessType: "client" | "server" | "admin", allowedAccessTypes: ("client" | "server" | "admin")[]]> & {
|
|
110
|
+
errorCode: "INSUFFICIENT_ACCESS_TYPE";
|
|
111
|
+
};
|
|
112
|
+
InvalidPublishableClientKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
113
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
114
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_PUBLISHABLE_CLIENT_KEY">, [projectId: string]> & {
|
|
75
115
|
errorCode: "INVALID_PUBLISHABLE_CLIENT_KEY";
|
|
76
116
|
};
|
|
77
|
-
InvalidSecretServerKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
117
|
+
InvalidSecretServerKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
118
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
119
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_SECRET_SERVER_KEY">, [projectId: string]> & {
|
|
78
120
|
errorCode: "INVALID_SECRET_SERVER_KEY";
|
|
79
121
|
};
|
|
80
|
-
InvalidSuperSecretAdminKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
122
|
+
InvalidSuperSecretAdminKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
123
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
124
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_SUPER_SECRET_ADMIN_KEY">, [projectId: string]> & {
|
|
81
125
|
errorCode: "INVALID_SUPER_SECRET_ADMIN_KEY";
|
|
82
126
|
};
|
|
83
|
-
InvalidAdminAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
127
|
+
InvalidAdminAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
128
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
129
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
84
130
|
errorCode: "INVALID_ADMIN_ACCESS_TOKEN";
|
|
85
131
|
};
|
|
86
|
-
UnparsableAdminAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
132
|
+
UnparsableAdminAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
133
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
134
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"UNPARSABLE_ADMIN_ACCESS_TOKEN">, []> & {
|
|
87
135
|
errorCode: "UNPARSABLE_ADMIN_ACCESS_TOKEN";
|
|
88
136
|
};
|
|
89
|
-
AdminAccessTokenExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
137
|
+
AdminAccessTokenExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
138
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
139
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"ADMIN_ACCESS_TOKEN_EXPIRED">, []> & {
|
|
90
140
|
errorCode: "ADMIN_ACCESS_TOKEN_EXPIRED";
|
|
91
141
|
};
|
|
92
|
-
InvalidProjectForAdminAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
142
|
+
InvalidProjectForAdminAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
143
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
144
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN">, []> & {
|
|
93
145
|
errorCode: "INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN";
|
|
94
146
|
};
|
|
95
|
-
AdminAccessTokenIsNotAdmin: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
147
|
+
AdminAccessTokenIsNotAdmin: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
148
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
149
|
+
} & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN">, []> & {
|
|
96
150
|
errorCode: "ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN";
|
|
97
151
|
};
|
|
98
|
-
ProjectAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
152
|
+
ProjectAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
153
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
154
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
99
155
|
errorCode: "PROJECT_AUTHENTICATION_REQUIRED";
|
|
100
156
|
};
|
|
101
|
-
ClientAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
157
|
+
ClientAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
158
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
159
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_AUTHENTICATION_REQUIRED">, []> & {
|
|
102
160
|
errorCode: "CLIENT_AUTHENTICATION_REQUIRED";
|
|
103
161
|
};
|
|
104
|
-
ServerAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
162
|
+
ServerAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
163
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
164
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"SERVER_AUTHENTICATION_REQUIRED">, []> & {
|
|
105
165
|
errorCode: "SERVER_AUTHENTICATION_REQUIRED";
|
|
106
166
|
};
|
|
107
|
-
ClientOrServerAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
167
|
+
ClientOrServerAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
168
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
169
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED">, []> & {
|
|
108
170
|
errorCode: "CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED";
|
|
109
171
|
};
|
|
110
|
-
ClientOrAdminAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
172
|
+
ClientOrAdminAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
173
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
174
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED">, []> & {
|
|
111
175
|
errorCode: "CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED";
|
|
112
176
|
};
|
|
113
|
-
ClientOrServerOrAdminAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
177
|
+
ClientOrServerOrAdminAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
178
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
179
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED">, []> & {
|
|
114
180
|
errorCode: "CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED";
|
|
115
181
|
};
|
|
116
|
-
AdminAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
182
|
+
AdminAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
183
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
184
|
+
} & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"ADMIN_AUTHENTICATION_REQUIRED">, []> & {
|
|
117
185
|
errorCode: "ADMIN_AUTHENTICATION_REQUIRED";
|
|
118
186
|
};
|
|
119
|
-
ExpectedInternalProject: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> &
|
|
187
|
+
ExpectedInternalProject: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
|
|
188
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
189
|
+
} & KnownErrorBrand<"EXPECTED_INTERNAL_PROJECT">, []> & {
|
|
120
190
|
errorCode: "EXPECTED_INTERNAL_PROJECT";
|
|
121
191
|
};
|
|
122
192
|
SessionAuthenticationError: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
123
193
|
errorCode: "SESSION_AUTHENTICATION_ERROR";
|
|
124
194
|
};
|
|
125
|
-
InvalidSessionAuthentication: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
195
|
+
InvalidSessionAuthentication: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
196
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
197
|
+
} & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
126
198
|
errorCode: "INVALID_SESSION_AUTHENTICATION";
|
|
127
199
|
};
|
|
128
|
-
InvalidAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
200
|
+
InvalidAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
201
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
202
|
+
} & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
129
203
|
errorCode: "INVALID_ACCESS_TOKEN";
|
|
130
204
|
};
|
|
131
|
-
UnparsableAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
205
|
+
UnparsableAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
206
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
207
|
+
} & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN"> & KnownErrorBrand<"UNPARSABLE_ACCESS_TOKEN">, []> & {
|
|
132
208
|
errorCode: "UNPARSABLE_ACCESS_TOKEN";
|
|
133
209
|
};
|
|
134
|
-
AccessTokenExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
210
|
+
AccessTokenExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
211
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
212
|
+
} & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN"> & KnownErrorBrand<"ACCESS_TOKEN_EXPIRED">, []> & {
|
|
135
213
|
errorCode: "ACCESS_TOKEN_EXPIRED";
|
|
136
214
|
};
|
|
137
|
-
InvalidProjectForAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
215
|
+
InvalidProjectForAccessToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
216
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
217
|
+
} & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN"> & KnownErrorBrand<"INVALID_PROJECT_FOR_ACCESS_TOKEN">, []> & {
|
|
138
218
|
errorCode: "INVALID_PROJECT_FOR_ACCESS_TOKEN";
|
|
139
219
|
};
|
|
140
|
-
SessionUserEmailNotVerified: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
220
|
+
SessionUserEmailNotVerified: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
221
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
222
|
+
} & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"SESSION_USER_EMAIL_NOT_VERIFIED">, []> & {
|
|
141
223
|
errorCode: "SESSION_USER_EMAIL_NOT_VERIFIED";
|
|
142
224
|
};
|
|
143
|
-
SessionAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> &
|
|
225
|
+
SessionAuthenticationRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"SESSION_AUTHENTICATION_ERROR"> & {
|
|
226
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
227
|
+
} & KnownErrorBrand<"SESSION_AUTHENTICATION_REQUIRED">, []> & {
|
|
144
228
|
errorCode: "SESSION_AUTHENTICATION_REQUIRED";
|
|
145
229
|
};
|
|
146
230
|
RefreshTokenError: KnownErrorConstructor<KnownError & KnownErrorBrand<"INVALID_REFRESH_TOKEN">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
147
231
|
errorCode: "INVALID_REFRESH_TOKEN";
|
|
148
232
|
};
|
|
149
|
-
ProviderRejected: KnownErrorConstructor<KnownError & KnownErrorBrand<"INVALID_REFRESH_TOKEN"> &
|
|
233
|
+
ProviderRejected: KnownErrorConstructor<KnownError & KnownErrorBrand<"INVALID_REFRESH_TOKEN"> & {
|
|
234
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
235
|
+
} & KnownErrorBrand<"PROVIDER_REJECTED">, []> & {
|
|
150
236
|
errorCode: "PROVIDER_REJECTED";
|
|
151
237
|
};
|
|
152
|
-
InvalidRefreshToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"INVALID_REFRESH_TOKEN"> &
|
|
238
|
+
InvalidRefreshToken: KnownErrorConstructor<KnownError & KnownErrorBrand<"INVALID_REFRESH_TOKEN"> & {
|
|
239
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
240
|
+
} & KnownErrorBrand<"REFRESH_TOKEN_EXPIRED">, []> & {
|
|
153
241
|
errorCode: "REFRESH_TOKEN_EXPIRED";
|
|
154
242
|
};
|
|
155
243
|
UserEmailAlreadyExists: KnownErrorConstructor<KnownError & KnownErrorBrand<"USER_EMAIL_ALREADY_EXISTS">, []> & {
|
|
@@ -173,56 +261,33 @@ export declare const KnownErrors: {
|
|
|
173
261
|
PasswordRequirementsNotMet: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_REQUIREMENTS_NOT_MET">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
174
262
|
errorCode: "PASSWORD_REQUIREMENTS_NOT_MET";
|
|
175
263
|
};
|
|
176
|
-
PasswordTooShort: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_REQUIREMENTS_NOT_MET"> &
|
|
264
|
+
PasswordTooShort: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_REQUIREMENTS_NOT_MET"> & {
|
|
265
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
266
|
+
} & KnownErrorBrand<"PASSWORD_TOO_SHORT">, [minLength: number]> & {
|
|
177
267
|
errorCode: "PASSWORD_TOO_SHORT";
|
|
178
268
|
};
|
|
179
|
-
PasswordTooLong: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_REQUIREMENTS_NOT_MET"> &
|
|
269
|
+
PasswordTooLong: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_REQUIREMENTS_NOT_MET"> & {
|
|
270
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
271
|
+
} & KnownErrorBrand<"PASSWORD_TOO_LONG">, [maxLength: number]> & {
|
|
180
272
|
errorCode: "PASSWORD_TOO_LONG";
|
|
181
273
|
};
|
|
182
|
-
|
|
183
|
-
errorCode: "
|
|
184
|
-
};
|
|
185
|
-
EmailVerificationCodeError: KnownErrorConstructor<KnownError & KnownErrorBrand<"EMAIL_VERIFICATION_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
186
|
-
errorCode: "EMAIL_VERIFICATION_CODE_ERROR";
|
|
187
|
-
};
|
|
188
|
-
EmailVerificationCodeNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"EMAIL_VERIFICATION_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_NOT_FOUND">, []> & {
|
|
189
|
-
errorCode: "EMAIL_VERIFICATION_CODE_NOT_FOUND";
|
|
190
|
-
};
|
|
191
|
-
EmailVerificationCodeExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"EMAIL_VERIFICATION_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_EXPIRED">, []> & {
|
|
192
|
-
errorCode: "EMAIL_VERIFICATION_CODE_EXPIRED";
|
|
193
|
-
};
|
|
194
|
-
EmailVerificationCodeAlreadyUsed: KnownErrorConstructor<KnownError & KnownErrorBrand<"EMAIL_VERIFICATION_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_ERROR"> & KnownErrorBrand<"EMAIL_VERIFICATION_CODE_ALREADY_USED">, []> & {
|
|
195
|
-
errorCode: "EMAIL_VERIFICATION_CODE_ALREADY_USED";
|
|
196
|
-
};
|
|
197
|
-
MagicLinkError: KnownErrorConstructor<KnownError & KnownErrorBrand<"MAGIC_LINK_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
198
|
-
errorCode: "MAGIC_LINK_ERROR";
|
|
199
|
-
};
|
|
200
|
-
MagicLinkCodeError: KnownErrorConstructor<KnownError & KnownErrorBrand<"MAGIC_LINK_ERROR"> & KnownErrorBrand<"MAGIC_LINK_CODE_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
201
|
-
errorCode: "MAGIC_LINK_CODE_ERROR";
|
|
274
|
+
VerificationCodeError: KnownErrorConstructor<KnownError & KnownErrorBrand<"VERIFICATION_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
275
|
+
errorCode: "VERIFICATION_ERROR";
|
|
202
276
|
};
|
|
203
|
-
|
|
204
|
-
|
|
277
|
+
VerificationCodeNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"VERIFICATION_ERROR"> & {
|
|
278
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
279
|
+
} & KnownErrorBrand<"VERIFICATION_CODE_NOT_FOUND">, []> & {
|
|
280
|
+
errorCode: "VERIFICATION_CODE_NOT_FOUND";
|
|
205
281
|
};
|
|
206
|
-
|
|
207
|
-
|
|
282
|
+
VerificationCodeExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"VERIFICATION_ERROR"> & {
|
|
283
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
284
|
+
} & KnownErrorBrand<"VERIFICATION_CODE_EXPIRED">, []> & {
|
|
285
|
+
errorCode: "VERIFICATION_CODE_EXPIRED";
|
|
208
286
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
errorCode: "PASSWORD_RESET_ERROR";
|
|
214
|
-
};
|
|
215
|
-
PasswordResetCodeError: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_RESET_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_ERROR">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & {
|
|
216
|
-
errorCode: "PASSWORD_RESET_CODE_ERROR";
|
|
217
|
-
};
|
|
218
|
-
PasswordResetCodeNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_RESET_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_NOT_FOUND">, []> & {
|
|
219
|
-
errorCode: "PASSWORD_RESET_CODE_NOT_FOUND";
|
|
220
|
-
};
|
|
221
|
-
PasswordResetCodeExpired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_RESET_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_EXPIRED">, []> & {
|
|
222
|
-
errorCode: "PASSWORD_RESET_CODE_EXPIRED";
|
|
223
|
-
};
|
|
224
|
-
PasswordResetCodeAlreadyUsed: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_RESET_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_ERROR"> & KnownErrorBrand<"PASSWORD_RESET_CODE_ALREADY_USED">, []> & {
|
|
225
|
-
errorCode: "PASSWORD_RESET_CODE_ALREADY_USED";
|
|
287
|
+
VerificationCodeAlreadyUsed: KnownErrorConstructor<KnownError & KnownErrorBrand<"VERIFICATION_ERROR"> & {
|
|
288
|
+
constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
|
|
289
|
+
} & KnownErrorBrand<"VERIFICATION_CODE_ALREADY_USED">, []> & {
|
|
290
|
+
errorCode: "VERIFICATION_CODE_ALREADY_USED";
|
|
226
291
|
};
|
|
227
292
|
PasswordMismatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"PASSWORD_MISMATCH">, []> & {
|
|
228
293
|
errorCode: "PASSWORD_MISMATCH";
|
|
@@ -236,9 +301,6 @@ export declare const KnownErrors: {
|
|
|
236
301
|
PermissionScopeMismatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"PERMISSION_SCOPE_MISMATCH">, [permissionId: string, permissionScope: PermissionDefinitionScopeJson, testScope: PermissionDefinitionScopeJson]> & {
|
|
237
302
|
errorCode: "PERMISSION_SCOPE_MISMATCH";
|
|
238
303
|
};
|
|
239
|
-
UserNotInTeam: KnownErrorConstructor<KnownError & KnownErrorBrand<"USER_NOT_IN_TEAM">, [userId: string, teamId: string]> & {
|
|
240
|
-
errorCode: "USER_NOT_IN_TEAM";
|
|
241
|
-
};
|
|
242
304
|
TeamNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"TEAM_NOT_FOUND">, [teamId: string]> & {
|
|
243
305
|
errorCode: "TEAM_NOT_FOUND";
|
|
244
306
|
};
|