@djangocfg/api 2.1.97 → 2.1.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-server.cjs +333 -313
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +333 -313
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +441 -383
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +36 -1
- package/dist/auth.d.ts +36 -1
- package/dist/auth.mjs +441 -383
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +458 -383
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +55 -1
- package/dist/clients.d.ts +55 -1
- package/dist/clients.mjs +458 -383
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +184 -111
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +48 -1
- package/dist/hooks.d.ts +48 -1
- package/dist/hooks.mjs +184 -111
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +382 -313
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.mjs +382 -313
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/auth/hooks/index.ts +7 -0
- package/src/auth/hooks/useDeleteAccount.ts +90 -0
- package/src/generated/cfg_accounts/CLAUDE.md +4 -3
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +58 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +19 -0
- package/src/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts +20 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +14 -0
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +12 -0
- package/src/generated/cfg_accounts/schema.json +69 -0
package/dist/hooks.d.cts
CHANGED
|
@@ -215,6 +215,17 @@ interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
|
215
215
|
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
216
216
|
avatar: File | Blob;
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Response serializer for account deletion.
|
|
220
|
+
*
|
|
221
|
+
* Response model (includes read-only fields).
|
|
222
|
+
*/
|
|
223
|
+
interface AccountDeleteResponse$1 {
|
|
224
|
+
/** Whether the account was successfully deleted */
|
|
225
|
+
success: boolean;
|
|
226
|
+
/** Human-readable message about the deletion */
|
|
227
|
+
message: string;
|
|
228
|
+
}
|
|
218
229
|
/**
|
|
219
230
|
* Serializer for updating user profile.
|
|
220
231
|
*
|
|
@@ -274,6 +285,16 @@ declare class UserProfile {
|
|
|
274
285
|
* multipart/form-data with 'avatar' field.
|
|
275
286
|
*/
|
|
276
287
|
accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
|
|
288
|
+
/**
|
|
289
|
+
* Delete user account
|
|
290
|
+
*
|
|
291
|
+
* Permanently delete the current user's account. This operation: -
|
|
292
|
+
* Deactivates the account (user cannot log in) - Anonymizes personal data
|
|
293
|
+
* (GDPR compliance) - Frees up the email address for re-registration -
|
|
294
|
+
* Preserves audit trail The account can be restored by an administrator if
|
|
295
|
+
* needed.
|
|
296
|
+
*/
|
|
297
|
+
accountsProfileDeleteCreate(): Promise<AccountDeleteResponse$1>;
|
|
277
298
|
/**
|
|
278
299
|
* Partial update user profile
|
|
279
300
|
*
|
|
@@ -530,6 +551,25 @@ interface StorageAdapter {
|
|
|
530
551
|
removeItem(key: string): void;
|
|
531
552
|
}
|
|
532
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Zod schema for AccountDeleteResponse
|
|
556
|
+
*
|
|
557
|
+
* This schema provides runtime validation and type inference.
|
|
558
|
+
* * Response serializer for account deletion.
|
|
559
|
+
* */
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Response serializer for account deletion.
|
|
563
|
+
*/
|
|
564
|
+
declare const AccountDeleteResponseSchema: z.ZodObject<{
|
|
565
|
+
success: z.ZodBoolean;
|
|
566
|
+
message: z.ZodString;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
/**
|
|
569
|
+
* Infer TypeScript type from Zod schema
|
|
570
|
+
*/
|
|
571
|
+
type AccountDeleteResponse = z.infer<typeof AccountDeleteResponseSchema>;
|
|
572
|
+
|
|
533
573
|
/**
|
|
534
574
|
* Zod schema for CfgAccountsProfileAvatarCreateRequest
|
|
535
575
|
*
|
|
@@ -1097,6 +1137,13 @@ declare function useAccountsProfileRetrieve(client?: API): ReturnType<typeof use
|
|
|
1097
1137
|
* @path /cfg/accounts/profile/avatar/
|
|
1098
1138
|
*/
|
|
1099
1139
|
declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API) => Promise<User>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Delete user account
|
|
1142
|
+
*
|
|
1143
|
+
* @method POST
|
|
1144
|
+
* @path /cfg/accounts/profile/delete/
|
|
1145
|
+
*/
|
|
1146
|
+
declare function useCreateAccountsProfileDeleteCreate(): (client?: API) => Promise<AccountDeleteResponse>;
|
|
1100
1147
|
/**
|
|
1101
1148
|
* Partial update user profile
|
|
1102
1149
|
*
|
|
@@ -1141,4 +1188,4 @@ declare function useCreateAccountsOtpRequestCreate(): (data: OTPRequestRequest,
|
|
|
1141
1188
|
*/
|
|
1142
1189
|
declare function useCreateAccountsOtpVerifyCreate(): (data: OTPVerifyRequest, client?: API) => Promise<OTPVerifyResponse>;
|
|
1143
1190
|
|
|
1144
|
-
export { useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
|
|
1191
|
+
export { useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsProfileDeleteCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
|
package/dist/hooks.d.ts
CHANGED
|
@@ -215,6 +215,17 @@ interface CfgAccountsProfileAvatarCreateRequest$1 {
|
|
|
215
215
|
/** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
|
|
216
216
|
avatar: File | Blob;
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Response serializer for account deletion.
|
|
220
|
+
*
|
|
221
|
+
* Response model (includes read-only fields).
|
|
222
|
+
*/
|
|
223
|
+
interface AccountDeleteResponse$1 {
|
|
224
|
+
/** Whether the account was successfully deleted */
|
|
225
|
+
success: boolean;
|
|
226
|
+
/** Human-readable message about the deletion */
|
|
227
|
+
message: string;
|
|
228
|
+
}
|
|
218
229
|
/**
|
|
219
230
|
* Serializer for updating user profile.
|
|
220
231
|
*
|
|
@@ -274,6 +285,16 @@ declare class UserProfile {
|
|
|
274
285
|
* multipart/form-data with 'avatar' field.
|
|
275
286
|
*/
|
|
276
287
|
accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
|
|
288
|
+
/**
|
|
289
|
+
* Delete user account
|
|
290
|
+
*
|
|
291
|
+
* Permanently delete the current user's account. This operation: -
|
|
292
|
+
* Deactivates the account (user cannot log in) - Anonymizes personal data
|
|
293
|
+
* (GDPR compliance) - Frees up the email address for re-registration -
|
|
294
|
+
* Preserves audit trail The account can be restored by an administrator if
|
|
295
|
+
* needed.
|
|
296
|
+
*/
|
|
297
|
+
accountsProfileDeleteCreate(): Promise<AccountDeleteResponse$1>;
|
|
277
298
|
/**
|
|
278
299
|
* Partial update user profile
|
|
279
300
|
*
|
|
@@ -530,6 +551,25 @@ interface StorageAdapter {
|
|
|
530
551
|
removeItem(key: string): void;
|
|
531
552
|
}
|
|
532
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Zod schema for AccountDeleteResponse
|
|
556
|
+
*
|
|
557
|
+
* This schema provides runtime validation and type inference.
|
|
558
|
+
* * Response serializer for account deletion.
|
|
559
|
+
* */
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Response serializer for account deletion.
|
|
563
|
+
*/
|
|
564
|
+
declare const AccountDeleteResponseSchema: z.ZodObject<{
|
|
565
|
+
success: z.ZodBoolean;
|
|
566
|
+
message: z.ZodString;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
/**
|
|
569
|
+
* Infer TypeScript type from Zod schema
|
|
570
|
+
*/
|
|
571
|
+
type AccountDeleteResponse = z.infer<typeof AccountDeleteResponseSchema>;
|
|
572
|
+
|
|
533
573
|
/**
|
|
534
574
|
* Zod schema for CfgAccountsProfileAvatarCreateRequest
|
|
535
575
|
*
|
|
@@ -1097,6 +1137,13 @@ declare function useAccountsProfileRetrieve(client?: API): ReturnType<typeof use
|
|
|
1097
1137
|
* @path /cfg/accounts/profile/avatar/
|
|
1098
1138
|
*/
|
|
1099
1139
|
declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API) => Promise<User>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Delete user account
|
|
1142
|
+
*
|
|
1143
|
+
* @method POST
|
|
1144
|
+
* @path /cfg/accounts/profile/delete/
|
|
1145
|
+
*/
|
|
1146
|
+
declare function useCreateAccountsProfileDeleteCreate(): (client?: API) => Promise<AccountDeleteResponse>;
|
|
1100
1147
|
/**
|
|
1101
1148
|
* Partial update user profile
|
|
1102
1149
|
*
|
|
@@ -1141,4 +1188,4 @@ declare function useCreateAccountsOtpRequestCreate(): (data: OTPRequestRequest,
|
|
|
1141
1188
|
*/
|
|
1142
1189
|
declare function useCreateAccountsOtpVerifyCreate(): (data: OTPVerifyRequest, client?: API) => Promise<OTPVerifyResponse>;
|
|
1143
1190
|
|
|
1144
|
-
export { useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
|
|
1191
|
+
export { useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsProfileDeleteCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
|
package/dist/hooks.mjs
CHANGED
|
@@ -118,6 +118,19 @@ var UserProfile = class {
|
|
|
118
118
|
const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData });
|
|
119
119
|
return response;
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Delete user account
|
|
123
|
+
*
|
|
124
|
+
* Permanently delete the current user's account. This operation: -
|
|
125
|
+
* Deactivates the account (user cannot log in) - Anonymizes personal data
|
|
126
|
+
* (GDPR compliance) - Frees up the email address for re-registration -
|
|
127
|
+
* Preserves audit trail The account can be restored by an administrator if
|
|
128
|
+
* needed.
|
|
129
|
+
*/
|
|
130
|
+
async accountsProfileDeleteCreate() {
|
|
131
|
+
const response = await this.client.request("POST", "/cfg/accounts/profile/delete/");
|
|
132
|
+
return response;
|
|
133
|
+
}
|
|
121
134
|
/**
|
|
122
135
|
* Partial update user profile
|
|
123
136
|
*
|
|
@@ -827,176 +840,183 @@ var OTPVerifyRequestChannel = /* @__PURE__ */ ((OTPVerifyRequestChannel2) => {
|
|
|
827
840
|
return OTPVerifyRequestChannel2;
|
|
828
841
|
})(OTPVerifyRequestChannel || {});
|
|
829
842
|
|
|
830
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
843
|
+
// src/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts
|
|
831
844
|
import { z as z2 } from "zod";
|
|
832
|
-
var
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
expires_at: z2.iso.datetime(),
|
|
836
|
-
channels: z2.array(z2.string())
|
|
845
|
+
var AccountDeleteResponseSchema = z2.object({
|
|
846
|
+
success: z2.boolean(),
|
|
847
|
+
message: z2.string()
|
|
837
848
|
});
|
|
838
849
|
|
|
839
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
850
|
+
// src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts
|
|
840
851
|
import { z as z3 } from "zod";
|
|
841
|
-
var
|
|
842
|
-
|
|
852
|
+
var CentrifugoTokenSchema = z3.object({
|
|
853
|
+
token: z3.string(),
|
|
854
|
+
centrifugo_url: z3.union([z3.url(), z3.literal("")]),
|
|
855
|
+
expires_at: z3.iso.datetime(),
|
|
856
|
+
channels: z3.array(z3.string())
|
|
843
857
|
});
|
|
844
858
|
|
|
845
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
859
|
+
// src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts
|
|
846
860
|
import { z as z4 } from "zod";
|
|
847
|
-
var
|
|
848
|
-
|
|
849
|
-
source_url: z4.union([z4.url(), z4.literal("")]).optional()
|
|
861
|
+
var CfgAccountsProfileAvatarCreateRequestSchema = z4.object({
|
|
862
|
+
avatar: z4.union([z4.instanceof(File), z4.instanceof(Blob)])
|
|
850
863
|
});
|
|
851
864
|
|
|
852
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
865
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
|
|
853
866
|
import { z as z5 } from "zod";
|
|
854
|
-
var
|
|
855
|
-
|
|
856
|
-
|
|
867
|
+
var OAuthAuthorizeRequestRequestSchema = z5.object({
|
|
868
|
+
redirect_uri: z5.union([z5.url(), z5.literal("")]).optional(),
|
|
869
|
+
source_url: z5.union([z5.url(), z5.literal("")]).optional()
|
|
857
870
|
});
|
|
858
871
|
|
|
859
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
872
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
|
|
860
873
|
import { z as z6 } from "zod";
|
|
861
|
-
var
|
|
862
|
-
|
|
863
|
-
state: z6.string()
|
|
864
|
-
redirect_uri: z6.union([z6.url(), z6.literal("")]).optional()
|
|
874
|
+
var OAuthAuthorizeResponseSchema = z6.object({
|
|
875
|
+
authorization_url: z6.union([z6.url(), z6.literal("")]),
|
|
876
|
+
state: z6.string()
|
|
865
877
|
});
|
|
866
878
|
|
|
867
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
879
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
|
|
868
880
|
import { z as z7 } from "zod";
|
|
869
|
-
var
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
provider_username: z7.string(),
|
|
874
|
-
provider_email: z7.email(),
|
|
875
|
-
provider_avatar_url: z7.union([z7.url(), z7.literal("")]),
|
|
876
|
-
connected_at: z7.iso.datetime(),
|
|
877
|
-
last_login_at: z7.iso.datetime()
|
|
881
|
+
var OAuthCallbackRequestRequestSchema = z7.object({
|
|
882
|
+
code: z7.string().min(10).max(500),
|
|
883
|
+
state: z7.string().min(20).max(100),
|
|
884
|
+
redirect_uri: z7.union([z7.url(), z7.literal("")]).optional()
|
|
878
885
|
});
|
|
879
886
|
|
|
880
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
887
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
|
|
881
888
|
import { z as z8 } from "zod";
|
|
882
|
-
var
|
|
883
|
-
|
|
889
|
+
var OAuthConnectionSchema = z8.object({
|
|
890
|
+
id: z8.int(),
|
|
891
|
+
provider: z8.nativeEnum(OAuthConnectionProvider),
|
|
892
|
+
provider_display: z8.string(),
|
|
893
|
+
provider_username: z8.string(),
|
|
894
|
+
provider_email: z8.email(),
|
|
895
|
+
provider_avatar_url: z8.union([z8.url(), z8.literal("")]),
|
|
896
|
+
connected_at: z8.iso.datetime(),
|
|
897
|
+
last_login_at: z8.iso.datetime()
|
|
884
898
|
});
|
|
885
899
|
|
|
886
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
900
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
|
|
887
901
|
import { z as z9 } from "zod";
|
|
888
|
-
var
|
|
889
|
-
|
|
890
|
-
error_description: z9.string().optional()
|
|
902
|
+
var OAuthDisconnectRequestRequestSchema = z9.object({
|
|
903
|
+
provider: z9.nativeEnum(OAuthDisconnectRequestRequestProvider)
|
|
891
904
|
});
|
|
892
905
|
|
|
893
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
906
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
|
|
894
907
|
import { z as z10 } from "zod";
|
|
895
|
-
var
|
|
896
|
-
|
|
908
|
+
var OAuthErrorSchema = z10.object({
|
|
909
|
+
error: z10.string(),
|
|
910
|
+
error_description: z10.string().optional()
|
|
897
911
|
});
|
|
898
912
|
|
|
899
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
913
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
|
|
900
914
|
import { z as z11 } from "zod";
|
|
901
|
-
var
|
|
902
|
-
|
|
903
|
-
session_id: z11.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
904
|
-
access: z11.string().nullable().optional(),
|
|
905
|
-
refresh: z11.string().nullable().optional(),
|
|
906
|
-
user: z11.record(z11.string(), z11.any()).nullable().optional(),
|
|
907
|
-
is_new_user: z11.boolean(),
|
|
908
|
-
is_new_connection: z11.boolean(),
|
|
909
|
-
should_prompt_2fa: z11.boolean().optional()
|
|
915
|
+
var OAuthProvidersResponseSchema = z11.object({
|
|
916
|
+
providers: z11.array(z11.record(z11.string(), z11.any()))
|
|
910
917
|
});
|
|
911
918
|
|
|
912
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
919
|
+
// src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
|
|
913
920
|
import { z as z12 } from "zod";
|
|
914
|
-
var
|
|
915
|
-
|
|
921
|
+
var OAuthTokenResponseSchema = z12.object({
|
|
922
|
+
requires_2fa: z12.boolean().optional(),
|
|
923
|
+
session_id: z12.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
924
|
+
access: z12.string().nullable().optional(),
|
|
925
|
+
refresh: z12.string().nullable().optional(),
|
|
926
|
+
user: z12.record(z12.string(), z12.any()).nullable().optional(),
|
|
927
|
+
is_new_user: z12.boolean(),
|
|
928
|
+
is_new_connection: z12.boolean(),
|
|
929
|
+
should_prompt_2fa: z12.boolean().optional()
|
|
916
930
|
});
|
|
917
931
|
|
|
918
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
932
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
|
|
919
933
|
import { z as z13 } from "zod";
|
|
920
|
-
var
|
|
921
|
-
|
|
922
|
-
channel: z13.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
923
|
-
source_url: z13.union([z13.url(), z13.literal("")]).optional()
|
|
934
|
+
var OTPErrorResponseSchema = z13.object({
|
|
935
|
+
error: z13.string()
|
|
924
936
|
});
|
|
925
937
|
|
|
926
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
938
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
|
|
927
939
|
import { z as z14 } from "zod";
|
|
928
|
-
var
|
|
929
|
-
|
|
940
|
+
var OTPRequestRequestSchema = z14.object({
|
|
941
|
+
identifier: z14.string().min(1),
|
|
942
|
+
channel: z14.nativeEnum(OTPRequestRequestChannel).optional(),
|
|
943
|
+
source_url: z14.union([z14.url(), z14.literal("")]).optional()
|
|
930
944
|
});
|
|
931
945
|
|
|
932
|
-
// src/generated/cfg_accounts/_utils/schemas/
|
|
946
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
|
|
933
947
|
import { z as z15 } from "zod";
|
|
934
|
-
var
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
948
|
+
var OTPRequestResponseSchema = z15.object({
|
|
949
|
+
message: z15.string()
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
|
|
953
|
+
import { z as z16 } from "zod";
|
|
954
|
+
var OTPVerifyRequestSchema = z16.object({
|
|
955
|
+
identifier: z16.string().min(1),
|
|
956
|
+
otp: z16.string().min(6).max(6),
|
|
957
|
+
channel: z16.nativeEnum(OTPVerifyRequestChannel).optional(),
|
|
958
|
+
source_url: z16.union([z16.url(), z16.literal("")]).optional()
|
|
939
959
|
});
|
|
940
960
|
|
|
941
961
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
942
|
-
import { z as
|
|
962
|
+
import { z as z18 } from "zod";
|
|
943
963
|
|
|
944
964
|
// src/generated/cfg_accounts/_utils/schemas/User.schema.ts
|
|
945
|
-
import { z as
|
|
946
|
-
var UserSchema =
|
|
947
|
-
id:
|
|
948
|
-
email:
|
|
949
|
-
first_name:
|
|
950
|
-
last_name:
|
|
951
|
-
full_name:
|
|
952
|
-
initials:
|
|
953
|
-
display_username:
|
|
954
|
-
company:
|
|
955
|
-
phone:
|
|
956
|
-
position:
|
|
957
|
-
avatar:
|
|
958
|
-
is_staff:
|
|
959
|
-
is_superuser:
|
|
960
|
-
date_joined:
|
|
961
|
-
last_login:
|
|
962
|
-
unanswered_messages_count:
|
|
965
|
+
import { z as z17 } from "zod";
|
|
966
|
+
var UserSchema = z17.object({
|
|
967
|
+
id: z17.int(),
|
|
968
|
+
email: z17.email(),
|
|
969
|
+
first_name: z17.string().max(50).optional(),
|
|
970
|
+
last_name: z17.string().max(50).optional(),
|
|
971
|
+
full_name: z17.string(),
|
|
972
|
+
initials: z17.string(),
|
|
973
|
+
display_username: z17.string(),
|
|
974
|
+
company: z17.string().max(100).optional(),
|
|
975
|
+
phone: z17.string().max(20).optional(),
|
|
976
|
+
position: z17.string().max(100).optional(),
|
|
977
|
+
avatar: z17.union([z17.url(), z17.literal("")]).nullable(),
|
|
978
|
+
is_staff: z17.boolean(),
|
|
979
|
+
is_superuser: z17.boolean(),
|
|
980
|
+
date_joined: z17.iso.datetime(),
|
|
981
|
+
last_login: z17.iso.datetime().nullable(),
|
|
982
|
+
unanswered_messages_count: z17.int(),
|
|
963
983
|
centrifugo: CentrifugoTokenSchema.nullable()
|
|
964
984
|
});
|
|
965
985
|
|
|
966
986
|
// src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
|
|
967
|
-
var OTPVerifyResponseSchema =
|
|
968
|
-
requires_2fa:
|
|
969
|
-
session_id:
|
|
970
|
-
refresh:
|
|
971
|
-
access:
|
|
987
|
+
var OTPVerifyResponseSchema = z18.object({
|
|
988
|
+
requires_2fa: z18.boolean().optional(),
|
|
989
|
+
session_id: z18.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i).nullable().optional(),
|
|
990
|
+
refresh: z18.string().nullable().optional(),
|
|
991
|
+
access: z18.string().nullable().optional(),
|
|
972
992
|
user: UserSchema.nullable().optional(),
|
|
973
|
-
should_prompt_2fa:
|
|
993
|
+
should_prompt_2fa: z18.boolean().optional()
|
|
974
994
|
});
|
|
975
995
|
|
|
976
996
|
// src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
|
|
977
|
-
import { z as
|
|
978
|
-
var PatchedUserProfileUpdateRequestSchema =
|
|
979
|
-
first_name:
|
|
980
|
-
last_name:
|
|
981
|
-
company:
|
|
982
|
-
phone:
|
|
983
|
-
position:
|
|
997
|
+
import { z as z19 } from "zod";
|
|
998
|
+
var PatchedUserProfileUpdateRequestSchema = z19.object({
|
|
999
|
+
first_name: z19.string().max(50).optional(),
|
|
1000
|
+
last_name: z19.string().max(50).optional(),
|
|
1001
|
+
company: z19.string().max(100).optional(),
|
|
1002
|
+
phone: z19.string().max(20).optional(),
|
|
1003
|
+
position: z19.string().max(100).optional()
|
|
984
1004
|
});
|
|
985
1005
|
|
|
986
1006
|
// src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
|
|
987
|
-
import { z as
|
|
988
|
-
var TokenRefreshRequestSchema =
|
|
989
|
-
refresh:
|
|
1007
|
+
import { z as z20 } from "zod";
|
|
1008
|
+
var TokenRefreshRequestSchema = z20.object({
|
|
1009
|
+
refresh: z20.string().min(1)
|
|
990
1010
|
});
|
|
991
1011
|
|
|
992
1012
|
// src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
|
|
993
|
-
import { z as
|
|
994
|
-
var UserProfileUpdateRequestSchema =
|
|
995
|
-
first_name:
|
|
996
|
-
last_name:
|
|
997
|
-
company:
|
|
998
|
-
phone:
|
|
999
|
-
position:
|
|
1013
|
+
import { z as z21 } from "zod";
|
|
1014
|
+
var UserProfileUpdateRequestSchema = z21.object({
|
|
1015
|
+
first_name: z21.string().max(50).optional(),
|
|
1016
|
+
last_name: z21.string().max(50).optional(),
|
|
1017
|
+
company: z21.string().max(100).optional(),
|
|
1018
|
+
phone: z21.string().max(20).optional(),
|
|
1019
|
+
position: z21.string().max(100).optional()
|
|
1000
1020
|
});
|
|
1001
1021
|
|
|
1002
1022
|
// src/generated/cfg_accounts/_utils/fetchers/accounts.ts
|
|
@@ -1320,6 +1340,49 @@ Method: POST`);
|
|
|
1320
1340
|
}
|
|
1321
1341
|
}
|
|
1322
1342
|
__name(createAccountsProfileAvatarCreate, "createAccountsProfileAvatarCreate");
|
|
1343
|
+
async function createAccountsProfileDeleteCreate(client) {
|
|
1344
|
+
const api = client || getAPIInstance();
|
|
1345
|
+
const response = await api.user_profile.accountsProfileDeleteCreate();
|
|
1346
|
+
try {
|
|
1347
|
+
return AccountDeleteResponseSchema.parse(response);
|
|
1348
|
+
} catch (error) {
|
|
1349
|
+
consola3.error("\u274C Zod Validation Failed");
|
|
1350
|
+
consola3.box(`createAccountsProfileDeleteCreate
|
|
1351
|
+
Path: /cfg/accounts/profile/delete/
|
|
1352
|
+
Method: POST`);
|
|
1353
|
+
if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
|
|
1354
|
+
consola3.error("Validation Issues:");
|
|
1355
|
+
error.issues.forEach((issue, index) => {
|
|
1356
|
+
consola3.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
|
|
1357
|
+
consola3.error(` \u251C\u2500 Message: ${issue.message}`);
|
|
1358
|
+
if (issue.expected) consola3.error(` \u251C\u2500 Expected: ${issue.expected}`);
|
|
1359
|
+
if (issue.received) consola3.error(` \u2514\u2500 Received: ${issue.received}`);
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
consola3.error("Response data:", response);
|
|
1363
|
+
if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
|
|
1364
|
+
try {
|
|
1365
|
+
const event = new CustomEvent("zod-validation-error", {
|
|
1366
|
+
detail: {
|
|
1367
|
+
operation: "createAccountsProfileDeleteCreate",
|
|
1368
|
+
path: "/cfg/accounts/profile/delete/",
|
|
1369
|
+
method: "POST",
|
|
1370
|
+
error,
|
|
1371
|
+
response,
|
|
1372
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
1373
|
+
},
|
|
1374
|
+
bubbles: true,
|
|
1375
|
+
cancelable: false
|
|
1376
|
+
});
|
|
1377
|
+
window.dispatchEvent(event);
|
|
1378
|
+
} catch (eventError) {
|
|
1379
|
+
consola3.warn("Failed to dispatch validation error event:", eventError);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
throw error;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
__name(createAccountsProfileDeleteCreate, "createAccountsProfileDeleteCreate");
|
|
1323
1386
|
async function partialUpdateAccountsProfilePartialUpdate(data, client) {
|
|
1324
1387
|
const api = client || getAPIInstance();
|
|
1325
1388
|
const response = await api.user_profile.accountsProfilePartialUpdate(data);
|
|
@@ -1767,6 +1830,15 @@ function useCreateAccountsProfileAvatarCreate() {
|
|
|
1767
1830
|
};
|
|
1768
1831
|
}
|
|
1769
1832
|
__name(useCreateAccountsProfileAvatarCreate, "useCreateAccountsProfileAvatarCreate");
|
|
1833
|
+
function useCreateAccountsProfileDeleteCreate() {
|
|
1834
|
+
const { mutate } = useSWRConfig3();
|
|
1835
|
+
return async (client) => {
|
|
1836
|
+
const result = await createAccountsProfileDeleteCreate(client);
|
|
1837
|
+
mutate("cfg-accounts-profile-delete");
|
|
1838
|
+
return result;
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
__name(useCreateAccountsProfileDeleteCreate, "useCreateAccountsProfileDeleteCreate");
|
|
1770
1842
|
function usePartialUpdateAccountsProfilePartialUpdate() {
|
|
1771
1843
|
const { mutate } = useSWRConfig3();
|
|
1772
1844
|
return async (data, client) => {
|
|
@@ -1834,6 +1906,7 @@ export {
|
|
|
1834
1906
|
useCreateAccountsOtpRequestCreate,
|
|
1835
1907
|
useCreateAccountsOtpVerifyCreate,
|
|
1836
1908
|
useCreateAccountsProfileAvatarCreate,
|
|
1909
|
+
useCreateAccountsProfileDeleteCreate,
|
|
1837
1910
|
useCreateAccountsTokenRefreshCreate,
|
|
1838
1911
|
usePartialUpdateAccountsProfilePartialPartialUpdate,
|
|
1839
1912
|
usePartialUpdateAccountsProfilePartialUpdate,
|