feat: sharepoint for storing files #1

Merged
Stevan merged 2 commits from stevanfreeborn/feat/sharepoint-integration into main 2026-07-31 19:00:22 +00:00
25 changed files with 42 additions and 42 deletions
Showing only changes of commit a52a7debab - Show all commits
@@ -110,4 +110,4 @@ internal static class AuthEndpoints
});
}
}
}
@@ -14,4 +14,4 @@ internal static class TokenHelper
{
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 ProxyBaseUrl { get; set; } = "https://proxy.useparagon.com";
}
}
@@ -8,4 +8,4 @@ public class CreateFolderRequest
/// <summary>Optional parent folder ID (null for root).</summary>
public string? ParentId { get; set; }
}
}
@@ -8,4 +8,4 @@ public class CredentialRequest
/// <summary>Integration type (e.g. "sharepoint").</summary>
public string IntegrationType { get; set; } = string.Empty;
}
}
@@ -14,4 +14,4 @@ public class CredentialResponse
/// <summary>Timestamp when the credential was connected.</summary>
public DateTime ConnectedAt { get; set; }
}
}
@@ -8,4 +8,4 @@ public class DownloadResponse
/// <summary>App-proxied download URL (streams through the backend via Paragon).</summary>
public string? ProxyUrl { get; set; }
}
}
@@ -11,4 +11,4 @@ public class IntegrationConfigRequest
/// <summary>Target folder path within the SharePoint site.</summary>
public string? SharePointFolderPath { get; set; }
}
}
@@ -23,4 +23,4 @@ public class IntegrationConfigResponse
/// <summary>Timestamp of last update.</summary>
public DateTime UpdatedAt { get; set; }
}
}
@@ -8,4 +8,4 @@ public class ParagonTokenResponse
/// <summary>Paragon project ID for SDK initialization.</summary>
public string ProjectId { get; set; } = string.Empty;
}
}
@@ -32,4 +32,4 @@ public class StorageItemResponse
/// <summary>Timestamp when the item was created.</summary>
public DateTime CreatedAt { get; set; }
}
}
@@ -23,4 +23,4 @@ public class OrganizationIntegration
/// <summary>Timestamp of the last configuration update.</summary>
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
}
@@ -38,4 +38,4 @@ public class StorageItem
/// <summary>Timestamp when the item was created.</summary>
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}
@@ -20,4 +20,4 @@ public class UserCredential
/// <summary>Timestamp when the credential was connected.</summary>
public DateTime ConnectedAt { get; set; } = DateTime.UtcNow;
}
}
@@ -35,4 +35,4 @@ public class OrganizationIntegrationRepository(MongoDbContext context)
.ReplaceOneAsync(filter, config, options, ct)
.ConfigureAwait(false);
}
}
}
@@ -48,4 +48,4 @@ public class StorageItemRepository(MongoDbContext context)
.DeleteOneAsync(i => i.Id == id, ct)
.ConfigureAwait(false);
}
}
}
@@ -61,4 +61,4 @@ public class UserCredentialRepository(MongoDbContext context)
return result.DeletedCount > 0;
}
}
}
@@ -91,4 +91,4 @@ public class CookieService
&& string.IsNullOrEmpty(headerToken) is false
&& cookieToken == headerToken;
}
}
}
@@ -14,4 +14,4 @@ public class PasswordService
{
return BCrypt.Net.BCrypt.Verify(password, hash);
}
}
}
@@ -1,13 +1,5 @@
<script setup lang="ts">
type IconName =
| 'folder'
| 'file'
| 'upload'
| 'download'
| 'external'
| 'trash'
| 'x'
| 'plus';
type IconName = 'folder' | 'file' | 'upload' | 'download' | 'external' | 'trash' | 'x' | 'plus';
const props = withDefaults(defineProps<{ name: IconName; size?: number }>(), {
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'],
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'],
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: [
'M3 6h18',
'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6',
@@ -11,7 +11,12 @@ body {
margin: 0;
background: var(--color-bg);
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);
line-height: var(--leading-normal);
}
@@ -15,4 +15,3 @@ export function formatLocaleDateWithTime(iso: string): string {
minute: '2-digit',
});
}
@@ -10,7 +10,7 @@
getDownloadUrls,
type StorageItem,
} from '../services/storage';
import { formatLocaleDate } from '../utils/utils';
import { formatLocaleDate } from '../utils/utils';
const route = useRoute();
const router = useRouter();
@@ -12,7 +12,7 @@
type IntegrationConfigRequest,
type CredentialResponse,
} from '../services/integration';
import { formatLocaleDateWithTime } from '../utils/utils';
import { formatLocaleDateWithTime } from '../utils/utils';
const config = ref<IntegrationConfig | null>(null);
const credentials = ref<CredentialResponse[]>([]);
@@ -11,7 +11,7 @@
type IntegrationConfig,
type CredentialResponse,
} from '../services/integration';
import { formatLocaleDateWithTime } from '../utils/utils';
import { formatLocaleDateWithTime } from '../utils/utils';
const config = ref<IntegrationConfig | null>(null);
const credentials = ref<CredentialResponse[]>([]);
@@ -141,7 +141,6 @@ import { formatLocaleDateWithTime } from '../utils/utils';
disconnecting.value = false;
}
}
</script>
<template>
@@ -177,9 +176,10 @@ import { formatLocaleDateWithTime } from '../utils/utils';
<template v-if="integrationConfigured">
<div class="integration-row">
<div class="integration-info">
<span class="integration-icon"><AppIcon
name="folder"
:size="20"
<span class="integration-icon"
><AppIcon
name="folder"
:size="20"
/></span>
<div>
<h3 class="integration-name">SharePoint</h3>
@@ -217,9 +217,7 @@ import { formatLocaleDateWithTime } from '../utils/utils';
class="btn btn-primary"
:disabled="connecting"
@click="
connectAccount(
connectionMode === 'byo' ? ['user-configured-oauth'] : undefined,
)
connectAccount(connectionMode === 'byo' ? ['user-configured-oauth'] : undefined)
"
>
{{ connecting ? 'Connecting...' : 'Connect Account' }}
@@ -238,7 +236,9 @@ import { formatLocaleDateWithTime } from '../utils/utils';
class="credential-row"
>
<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>
</div>
</div>