feat: sharepoint for storing files #1
@@ -110,4 +110,4 @@ internal static class AuthEndpoints
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -14,4 +14,4 @@ internal static class TokenHelper
|
|||||||
{
|
{
|
||||||
return Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(token)));
|
return Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(token)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,4 +9,4 @@ internal class ParagonOptions
|
|||||||
public string SigningKey { get; set; } = string.Empty;
|
public string SigningKey { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string ProxyBaseUrl { get; set; } = "https://proxy.useparagon.com";
|
public string ProxyBaseUrl { get; set; } = "https://proxy.useparagon.com";
|
||||||
}
|
}
|
||||||
+1
-1
@@ -8,4 +8,4 @@ public class CreateFolderRequest
|
|||||||
|
|
||||||
/// <summary>Optional parent folder ID (null for root).</summary>
|
/// <summary>Optional parent folder ID (null for root).</summary>
|
||||||
public string? ParentId { get; set; }
|
public string? ParentId { get; set; }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -8,4 +8,4 @@ public class CredentialRequest
|
|||||||
|
|
||||||
/// <summary>Integration type (e.g. "sharepoint").</summary>
|
/// <summary>Integration type (e.g. "sharepoint").</summary>
|
||||||
public string IntegrationType { get; set; } = string.Empty;
|
public string IntegrationType { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -14,4 +14,4 @@ public class CredentialResponse
|
|||||||
|
|
||||||
/// <summary>Timestamp when the credential was connected.</summary>
|
/// <summary>Timestamp when the credential was connected.</summary>
|
||||||
public DateTime ConnectedAt { get; set; }
|
public DateTime ConnectedAt { get; set; }
|
||||||
}
|
}
|
||||||
@@ -8,4 +8,4 @@ public class DownloadResponse
|
|||||||
|
|
||||||
/// <summary>App-proxied download URL (streams through the backend via Paragon).</summary>
|
/// <summary>App-proxied download URL (streams through the backend via Paragon).</summary>
|
||||||
public string? ProxyUrl { get; set; }
|
public string? ProxyUrl { get; set; }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -11,4 +11,4 @@ public class IntegrationConfigRequest
|
|||||||
|
|
||||||
/// <summary>Target folder path within the SharePoint site.</summary>
|
/// <summary>Target folder path within the SharePoint site.</summary>
|
||||||
public string? SharePointFolderPath { get; set; }
|
public string? SharePointFolderPath { get; set; }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -23,4 +23,4 @@ public class IntegrationConfigResponse
|
|||||||
|
|
||||||
/// <summary>Timestamp of last update.</summary>
|
/// <summary>Timestamp of last update.</summary>
|
||||||
public DateTime UpdatedAt { get; set; }
|
public DateTime UpdatedAt { get; set; }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -8,4 +8,4 @@ public class ParagonTokenResponse
|
|||||||
|
|
||||||
/// <summary>Paragon project ID for SDK initialization.</summary>
|
/// <summary>Paragon project ID for SDK initialization.</summary>
|
||||||
public string ProjectId { get; set; } = string.Empty;
|
public string ProjectId { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -32,4 +32,4 @@ public class StorageItemResponse
|
|||||||
|
|
||||||
/// <summary>Timestamp when the item was created.</summary>
|
/// <summary>Timestamp when the item was created.</summary>
|
||||||
public DateTime CreatedAt { get; set; }
|
public DateTime CreatedAt { get; set; }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -23,4 +23,4 @@ public class OrganizationIntegration
|
|||||||
|
|
||||||
/// <summary>Timestamp of the last configuration update.</summary>
|
/// <summary>Timestamp of the last configuration update.</summary>
|
||||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
@@ -38,4 +38,4 @@ public class StorageItem
|
|||||||
|
|
||||||
/// <summary>Timestamp when the item was created.</summary>
|
/// <summary>Timestamp when the item was created.</summary>
|
||||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -20,4 +20,4 @@ public class UserCredential
|
|||||||
|
|
||||||
/// <summary>Timestamp when the credential was connected.</summary>
|
/// <summary>Timestamp when the credential was connected.</summary>
|
||||||
public DateTime ConnectedAt { get; set; } = DateTime.UtcNow;
|
public DateTime ConnectedAt { get; set; } = DateTime.UtcNow;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -35,4 +35,4 @@ public class OrganizationIntegrationRepository(MongoDbContext context)
|
|||||||
.ReplaceOneAsync(filter, config, options, ct)
|
.ReplaceOneAsync(filter, config, options, ct)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -48,4 +48,4 @@ public class StorageItemRepository(MongoDbContext context)
|
|||||||
.DeleteOneAsync(i => i.Id == id, ct)
|
.DeleteOneAsync(i => i.Id == id, ct)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -61,4 +61,4 @@ public class UserCredentialRepository(MongoDbContext context)
|
|||||||
|
|
||||||
return result.DeletedCount > 0;
|
return result.DeletedCount > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -91,4 +91,4 @@ public class CookieService
|
|||||||
&& string.IsNullOrEmpty(headerToken) is false
|
&& string.IsNullOrEmpty(headerToken) is false
|
||||||
&& cookieToken == headerToken;
|
&& cookieToken == headerToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -14,4 +14,4 @@ public class PasswordService
|
|||||||
{
|
{
|
||||||
return BCrypt.Net.BCrypt.Verify(password, hash);
|
return BCrypt.Net.BCrypt.Verify(password, hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
type IconName =
|
type IconName = 'folder' | 'file' | 'upload' | 'download' | 'external' | 'trash' | 'x' | 'plus';
|
||||||
| 'folder'
|
|
||||||
| 'file'
|
|
||||||
| 'upload'
|
|
||||||
| 'download'
|
|
||||||
| 'external'
|
|
||||||
| 'trash'
|
|
||||||
| 'x'
|
|
||||||
| 'plus';
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{ name: IconName; size?: number }>(), {
|
const props = withDefaults(defineProps<{ name: IconName; size?: number }>(), {
|
||||||
size: 16,
|
size: 16,
|
||||||
@@ -20,7 +12,11 @@
|
|||||||
file: ['M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', 'M14 2v4a2 2 0 0 0 2 2h4'],
|
file: ['M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', 'M14 2v4a2 2 0 0 0 2 2h4'],
|
||||||
upload: ['M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', 'M17 8l-5-5-5 5', 'M12 3v12'],
|
upload: ['M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', 'M17 8l-5-5-5 5', 'M12 3v12'],
|
||||||
download: ['M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', 'M7 10l5 5 5-5', 'M12 15V3'],
|
download: ['M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', 'M7 10l5 5 5-5', 'M12 15V3'],
|
||||||
external: ['M15 3h6v6', 'M10 14 21 3', 'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'],
|
external: [
|
||||||
|
'M15 3h6v6',
|
||||||
|
'M10 14 21 3',
|
||||||
|
'M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6',
|
||||||
|
],
|
||||||
trash: [
|
trash: [
|
||||||
'M3 6h18',
|
'M3 6h18',
|
||||||
'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6',
|
'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6',
|
||||||
|
|||||||
@@ -11,7 +11,12 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
background: var(--color-bg);
|
background: var(--color-bg);
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
font-family:
|
||||||
|
system-ui,
|
||||||
|
-apple-system,
|
||||||
|
'Segoe UI',
|
||||||
|
Roboto,
|
||||||
|
sans-serif;
|
||||||
font-size: var(--text-base);
|
font-size: var(--text-base);
|
||||||
line-height: var(--leading-normal);
|
line-height: var(--leading-normal);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,3 @@ export function formatLocaleDateWithTime(iso: string): string {
|
|||||||
minute: '2-digit',
|
minute: '2-digit',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
getDownloadUrls,
|
getDownloadUrls,
|
||||||
type StorageItem,
|
type StorageItem,
|
||||||
} from '../services/storage';
|
} from '../services/storage';
|
||||||
import { formatLocaleDate } from '../utils/utils';
|
import { formatLocaleDate } from '../utils/utils';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
type IntegrationConfigRequest,
|
type IntegrationConfigRequest,
|
||||||
type CredentialResponse,
|
type CredentialResponse,
|
||||||
} from '../services/integration';
|
} from '../services/integration';
|
||||||
import { formatLocaleDateWithTime } from '../utils/utils';
|
import { formatLocaleDateWithTime } from '../utils/utils';
|
||||||
|
|
||||||
const config = ref<IntegrationConfig | null>(null);
|
const config = ref<IntegrationConfig | null>(null);
|
||||||
const credentials = ref<CredentialResponse[]>([]);
|
const credentials = ref<CredentialResponse[]>([]);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
type IntegrationConfig,
|
type IntegrationConfig,
|
||||||
type CredentialResponse,
|
type CredentialResponse,
|
||||||
} from '../services/integration';
|
} from '../services/integration';
|
||||||
import { formatLocaleDateWithTime } from '../utils/utils';
|
import { formatLocaleDateWithTime } from '../utils/utils';
|
||||||
|
|
||||||
const config = ref<IntegrationConfig | null>(null);
|
const config = ref<IntegrationConfig | null>(null);
|
||||||
const credentials = ref<CredentialResponse[]>([]);
|
const credentials = ref<CredentialResponse[]>([]);
|
||||||
@@ -141,7 +141,6 @@ import { formatLocaleDateWithTime } from '../utils/utils';
|
|||||||
disconnecting.value = false;
|
disconnecting.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -177,9 +176,10 @@ import { formatLocaleDateWithTime } from '../utils/utils';
|
|||||||
<template v-if="integrationConfigured">
|
<template v-if="integrationConfigured">
|
||||||
<div class="integration-row">
|
<div class="integration-row">
|
||||||
<div class="integration-info">
|
<div class="integration-info">
|
||||||
<span class="integration-icon"><AppIcon
|
<span class="integration-icon"
|
||||||
name="folder"
|
><AppIcon
|
||||||
:size="20"
|
name="folder"
|
||||||
|
:size="20"
|
||||||
/></span>
|
/></span>
|
||||||
<div>
|
<div>
|
||||||
<h3 class="integration-name">SharePoint</h3>
|
<h3 class="integration-name">SharePoint</h3>
|
||||||
@@ -217,9 +217,7 @@ import { formatLocaleDateWithTime } from '../utils/utils';
|
|||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
:disabled="connecting"
|
:disabled="connecting"
|
||||||
@click="
|
@click="
|
||||||
connectAccount(
|
connectAccount(connectionMode === 'byo' ? ['user-configured-oauth'] : undefined)
|
||||||
connectionMode === 'byo' ? ['user-configured-oauth'] : undefined,
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ connecting ? 'Connecting...' : 'Connect Account' }}
|
{{ connecting ? 'Connecting...' : 'Connect Account' }}
|
||||||
@@ -238,7 +236,9 @@ import { formatLocaleDateWithTime } from '../utils/utils';
|
|||||||
class="credential-row"
|
class="credential-row"
|
||||||
>
|
>
|
||||||
<span class="cred-type">{{ cred.integrationType }}</span>
|
<span class="cred-type">{{ cred.integrationType }}</span>
|
||||||
<span class="cred-date">Connected {{ formatLocaleDateWithTime(cred.connectedAt) }}</span>
|
<span class="cred-date"
|
||||||
|
>Connected {{ formatLocaleDateWithTime(cred.connectedAt) }}</span
|
||||||
|
>
|
||||||
<span class="cred-id">{{ cred.credentialId.slice(0, 12) }}...</span>
|
<span class="cred-id">{{ cred.credentialId.slice(0, 12) }}...</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user