From d17b3ea56502b18c0a7d0919bcb77223186310f0 Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Fri, 23 Feb 2024 12:21:02 +0530 Subject: [PATCH 1/2] feat: Add delete bulk import users api --- .../bulkimport/BulkImportStorage.java | 9 ++++++--- .../pluginInterface/bulkimport/BulkImportUser.java | 12 ++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java b/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java index 9874712d..e61d38db 100644 --- a/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java +++ b/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java @@ -42,12 +42,15 @@ void addBulkImportUsers(AppIdentifier appIdentifier, List users) List getBulkImportUsers(AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status, @Nullable String bulkImportUserId, @Nullable Long createdAt) throws StorageQueryException; + /** + * Update the status of the users in the bulk_import_users table + */ + void updateBulkImportUserStatus(AppIdentifier appIdentifier, @Nonnull String bulkImportUserId, @Nonnull BulkImportUserStatus status) throws StorageQueryException; + /** * Delete users by id from the bulk_import_users table */ - // void deleteBulkImportUsers(AppIdentifier appIdentifier, @Nullable - // ArrayList bulkImportUserIds) - // throws StorageQueryException; + void deleteBulkImportUsers(AppIdentifier appIdentifier, @Nonnull String[] bulkImportUserIds) throws StorageQueryException; public enum BulkImportUserStatus { NEW, PROCESSING, FAILED diff --git a/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportUser.java b/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportUser.java index 7b65ee54..f3bb6d8d 100644 --- a/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportUser.java +++ b/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportUser.java @@ -53,11 +53,11 @@ public String toString() { public static class TotpDevice { public String secretKey; - public Integer period; - public Integer skew; + public int period; + public int skew; public String deviceName; - public TotpDevice(String secretKey, Integer period, Integer skew, String deviceName) { + public TotpDevice(String secretKey, int period, int skew, String deviceName) { this.secretKey = secretKey; this.period = period; this.skew = skew; @@ -67,8 +67,8 @@ public TotpDevice(String secretKey, Integer period, Integer skew, String deviceN public static class LoginMethod { public String tenantId; - public Boolean isVerified; - public Boolean isPrimary; + public boolean isVerified; + public boolean isPrimary; public long timeJoinedInMSSinceEpoch; public String recipeId; @@ -76,7 +76,7 @@ public static class LoginMethod { public ThirdPartyLoginMethod thirdPartyLoginMethod; public PasswordlessLoginMethod passwordlessLoginMethod; - public LoginMethod(String tenantId, String recipeId, Boolean isVerified, Boolean isPrimary, long timeJoinedInMSSinceEpoch, EmailPasswordLoginMethod emailPasswordLoginMethod, ThirdPartyLoginMethod thirdPartyLoginMethod, PasswordlessLoginMethod passwordlessLoginMethod) { + public LoginMethod(String tenantId, String recipeId, boolean isVerified, boolean isPrimary, long timeJoinedInMSSinceEpoch, EmailPasswordLoginMethod emailPasswordLoginMethod, ThirdPartyLoginMethod thirdPartyLoginMethod, PasswordlessLoginMethod passwordlessLoginMethod) { this.tenantId = tenantId; this.recipeId = recipeId; this.isVerified = isVerified; From 0c2f411e738b9a91e89248da5ce09611c36b7ca0 Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Tue, 27 Feb 2024 16:12:57 +0530 Subject: [PATCH 2/2] fix: PR changes --- .../pluginInterface/bulkimport/BulkImportStorage.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java b/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java index e61d38db..4bffef24 100644 --- a/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java +++ b/src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java @@ -42,15 +42,10 @@ void addBulkImportUsers(AppIdentifier appIdentifier, List users) List getBulkImportUsers(AppIdentifier appIdentifier, @Nonnull Integer limit, @Nullable BulkImportUserStatus status, @Nullable String bulkImportUserId, @Nullable Long createdAt) throws StorageQueryException; - /** - * Update the status of the users in the bulk_import_users table - */ - void updateBulkImportUserStatus(AppIdentifier appIdentifier, @Nonnull String bulkImportUserId, @Nonnull BulkImportUserStatus status) throws StorageQueryException; - /** * Delete users by id from the bulk_import_users table */ - void deleteBulkImportUsers(AppIdentifier appIdentifier, @Nonnull String[] bulkImportUserIds) throws StorageQueryException; + List deleteBulkImportUsers(AppIdentifier appIdentifier, @Nonnull String[] bulkImportUserIds) throws StorageQueryException; public enum BulkImportUserStatus { NEW, PROCESSING, FAILED