Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f9a4f98
Use enums from the console SDK whenever possible
stnguyen90 Feb 5, 2024
c6c8679
Remove unnecessary backup
stnguyen90 Feb 5, 2024
a1cd316
Fix listInvoices() queries type
stnguyen90 Feb 6, 2024
ac8a9a9
Add messaging service to sdkForProject
stnguyen90 Feb 6, 2024
ec7ebd3
Replace client.call() with the respective SDK methods
stnguyen90 Feb 6, 2024
6b44873
Add support for SMTP provider
stnguyen90 Feb 7, 2024
44f48ba
Make some provider fields optional
stnguyen90 Feb 7, 2024
9182a5b
Fixes from design review
stnguyen90 Feb 7, 2024
5d35185
Add support for bulk deleting messages
stnguyen90 Feb 7, 2024
79886b4
Don't allow deleting processing message
stnguyen90 Feb 7, 2024
c66f5e7
Show topics in message details
stnguyen90 Feb 7, 2024
4f81e48
Show targets in message details
stnguyen90 Feb 7, 2024
0f9e6bd
Update messaging related text
stnguyen90 Feb 8, 2024
ef5b08c
Merge pull request #780 from appwrite/feat-messaging-consistent-terms
TorstenDittmann Feb 8, 2024
7bda700
Merge pull request #774 from appwrite/feat-messaging-delete-messages
TorstenDittmann Feb 8, 2024
213bb2b
Merge pull request #779 from appwrite/feat-messaging-topics-targets-i…
TorstenDittmann Feb 8, 2024
63876f9
Merge pull request #773 from appwrite/feat-messaging-smtp-provider
TorstenDittmann Feb 8, 2024
4cf5d3d
Merge branch '1.5.x' into feat-messaging-sdk
TorstenDittmann Feb 8, 2024
04cb828
fix: link type for smtp provider store
TorstenDittmann Feb 8, 2024
d2ca2c3
fix: remove unused import
TorstenDittmann Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/components/creditCardBrandImage.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<script lang="ts">
import { isValueOfStringEnum } from '$lib/helpers/types';
import { sdk } from '$lib/stores/sdk';
import { CreditCard } from '@appwrite.io/console';
export let brand: string;
export let width = 23;
export let height = 16;
function getCreditCardImage(brand: string, width = 46, height = 32) {
if (!brand) return '';
if (!isValueOfStringEnum(CreditCard, brand)) return '';
return sdk.forConsole.avatars.getCreditCard(brand, width, height).toString();
}
</script>
Expand Down
15 changes: 8 additions & 7 deletions src/lib/components/labelCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@
{#if icon}
<span class={`icon-${icon} u-margin-inline-start-auto`} aria-hidden="true" />
{/if}
{/if}
{#if imageIcon}
<img
class="u-margin-inline-start-auto"
style:--p-text-size="1.25rem"
src={`${base}/icons/${$app.themeInUse}/color/${imageIcon}.svg`}
alt={imageIcon} />
{#if imageIcon}
<img
class="u-margin-inline-start-auto"
style:max-inline-size="1.25rem"
style:max-block-size="1.25rem"
src={`${base}/icons/${$app.themeInUse}/color/${imageIcon}.svg`}
alt={imageIcon} />
{/if}
{/if}
</div>
</label>
1 change: 1 addition & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export enum Dependencies {
CONSOLE_VARIABLES = 'dependency:console_variables',
MESSAGING_PROVIDERS = 'dependency:messaging_providers',
MESSAGING_PROVIDER = 'dependency:messaging_provider',
MESSAGING_MESSAGES = 'dependency:messaging_messages',
MESSAGING_MESSAGE = 'dependency:messaging_message',
MESSAGING_TOPICS = 'dependency:messaging_topics',
MESSAGING_TOPIC = 'dependency:messaging_topic',
Expand Down
3 changes: 3 additions & 0 deletions src/lib/elements/flag.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script lang="ts">
import { isValueOfStringEnum } from '$lib/helpers/types';
import { sdk } from '$lib/stores/sdk';
import { Flag } from '@appwrite.io/console';
export let flag: string;
export let name: string = flag;
export let width = 40;
Expand All @@ -9,6 +11,7 @@
export { classes as class };

export function getFlag(country: string, width: number, height: number, quality: number) {
if (!isValueOfStringEnum(Flag, country)) return '';
let flag = sdk.forProject.avatars
.getFlag(country, width * 2, height * 2, quality)
?.toString();
Expand Down
2 changes: 2 additions & 0 deletions src/lib/elements/table/cellCheck.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

export let id: string;
export let selectedIds: string[] = [];
export let disabled: boolean = false;
let el: HTMLInputElement;

const handleClick = (e: Event) => {
Expand Down Expand Up @@ -35,6 +36,7 @@
id="select-{id}"
wrapperTag="div"
checked={selectedIds.includes(id)}
{disabled}
on:click={handleClick} />
</TableCell>

Expand Down
6 changes: 3 additions & 3 deletions src/lib/layout/usage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export function periodToDates(period: UsagePeriods): {
start: string;
end: string;
period: '1h' | '1d';
period: ProjectUsageRange;
} {
const start = new Date();
switch (period) {
Expand All @@ -26,7 +26,7 @@
return {
start: start.toISOString(),
end: end.toISOString(),
period: period === '24h' ? '1h' : '1d'
period: period === '24h' ? ProjectUsageRange.OneHour : ProjectUsageRange.OneDay
};
}

Expand Down Expand Up @@ -62,7 +62,7 @@
import { BarChart } from '$lib/charts';
import { formatNumberWithCommas } from '$lib/helpers/numbers';
import { Card, SecondaryTabs, SecondaryTabsItem, Heading } from '$lib/components';
import type { Models } from '@appwrite.io/console';
import { ProjectUsageRange, type Models } from '@appwrite.io/console';
import { page } from '$app/stores';

type MetricMetadata = {
Expand Down
11 changes: 2 additions & 9 deletions src/lib/pages/domains/index.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<script context="module" lang="ts">
export enum ProxyTypes {
API = 'api',
FUNCTION = 'function'
}
</script>

<script lang="ts">
import { DropList, DropListItem, Empty, Heading, Modal, Trim } from '$lib/components';
import {
Expand All @@ -22,14 +15,14 @@
import { toLocaleDate } from '$lib/helpers/date';
import { wizard } from '$lib/stores/wizard';
import type { Dependencies } from '$lib/constants';
import type { Models } from '@appwrite.io/console';
import type { Models, ResourceType } from '@appwrite.io/console';
import Create from './create.svelte';
import Delete from './delete.svelte';
import Retry from './wizard/retry.svelte';
import { Pill } from '$lib/elements';

export let rules: Models.ProxyRuleList;
export let type: ProxyTypes;
export let type: ResourceType;
export let dependency: Dependencies;

let showDomainsDropdown = [];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/domains/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as ProxyRulesPage, ProxyTypes } from './index.svelte';
export { default as ProxyRulesPage } from './index.svelte';
export { default as Retry } from './wizard/retry.svelte';
4 changes: 2 additions & 2 deletions src/lib/pages/domains/wizard/step1.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { sdk } from '$lib/stores/sdk';
import { isSelfHosted } from '$lib/system';
import { func } from '$routes/console/project-[project]/functions/function-[function]/store';
import { ProxyTypes } from '../index.svelte';
import { domain, typeStore } from './store';
import { consoleVariables } from '$routes/console/store';
import { ResourceType } from '@appwrite.io/console';

let error = null;
const isDomainsEnabled = $consoleVariables?._APP_DOMAIN_ENABLED === true;
Expand All @@ -22,7 +22,7 @@
$domain = await sdk.forProject.proxy.createRule(
$domain.domain,
$typeStore,
$typeStore === ProxyTypes.FUNCTION ? $func.$id : undefined
$typeStore === ResourceType.Function ? $func.$id : undefined
);

trackEvent(Submit.DomainCreate);
Expand Down
5 changes: 2 additions & 3 deletions src/lib/pages/domains/wizard/store.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Models } from '@appwrite.io/console';
import type { Models, ResourceType } from '@appwrite.io/console';
import { writable } from 'svelte/store';
import type { ProxyTypes } from '../index.svelte';
import type { Dependencies } from '$lib/constants';

export const domain = writable<Partial<Models.ProxyRule>>({ $id: '', domain: '' });
export const typeStore = writable<ProxyTypes>();
export const typeStore = writable<ResourceType>();
export const dependencyStore = writable<Dependencies>();
2 changes: 1 addition & 1 deletion src/lib/sdk/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ export class Billing {
);
}

async listInvoices(organizationId: string, queries: Query[] = []): Promise<InvoiceList> {
async listInvoices(organizationId: string, queries: string[] = []): Promise<InvoiceList> {
const path = `/organizations/${organizationId}/invoices`;
const params = {
organizationId,
Expand Down
18 changes: 9 additions & 9 deletions src/lib/stores/auth-methods.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import { writable } from 'svelte/store';
import type { Models } from '@appwrite.io/console';
import { type Models, AuthMethod as AuthMethodEnum } from '@appwrite.io/console';

export type AuthMethod = {
label: string;
method: string;
method: AuthMethodEnum;
value: boolean | null;
};

const setAuthMethod = (project: Models.Project): AuthMethod[] => {
return [
{
label: 'Email/Password',
method: 'email-password',
method: AuthMethodEnum.Emailpassword,
value: project?.authEmailPassword
},
{
label: 'Phone',
method: 'phone',
method: AuthMethodEnum.Phone,
value: project?.authPhone
},
{
label: 'Magic URL',
method: 'magic-url',
method: AuthMethodEnum.Magicurl,
value: project?.authUsersAuthMagicURL
},
{
label: 'Email OTP',
method: 'email-otp',
method: AuthMethodEnum.Emailotp,
value: project?.authEmailOtp
},
{
label: 'Anonymous',
method: 'anonymous',
method: AuthMethodEnum.Anonymous,
value: project?.authAnonymous
},
{
label: 'Team Invites',
method: 'invites',
method: AuthMethodEnum.Invites,
value: project?.authInvites
},
{
label: 'JWT',
method: 'jwt',
method: AuthMethodEnum.Jwt,
value: project?.authJWT
}
];
Expand Down
52 changes: 21 additions & 31 deletions src/lib/stores/project-services.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { writable } from 'svelte/store';
import type { Models } from '@appwrite.io/console';
import { APIService, type Models } from '@appwrite.io/console';

export type Service = {
label: string;
method: string;
method: APIService;
value: boolean | null;
};

Expand All @@ -12,62 +12,52 @@ function createServices() {
list: [
{
label: 'Account',
method: 'account',
method: APIService.Account,
value: null
},
{
label: 'Avatars',
method: 'avatars',
method: APIService.Avatars,
value: null
},
{
label: 'Databases',
method: 'databases',
method: APIService.Databases,
value: null
},
{
label: 'Functions',
method: 'functions',
method: APIService.Functions,
value: null
},
{
label: 'Health',
method: 'health',
method: APIService.Health,
value: null
},
{
label: 'Locale',
method: 'locale',
method: APIService.Locale,
value: null
},
{
label: 'Storage',
method: 'storage',
method: APIService.Storage,
value: null
},
{
label: 'Teams',
method: 'teams',
method: APIService.Teams,
value: null
},
{
label: 'Users',
method: 'users',
method: APIService.Users,
value: null
},
{
label: 'GraphQL',
method: 'graphql',
value: null
},
{
label: 'VCS',
method: 'vcs',
value: null
},
{
label: 'Proxy',
method: 'proxy',
method: APIService.Graphql,
value: null
}
]
Expand All @@ -80,47 +70,47 @@ function createServices() {
const list = [
{
label: 'Account',
method: 'account',
method: APIService.Account,
value: project.serviceStatusForAccount
},
{
label: 'Avatars',
method: 'avatars',
method: APIService.Avatars,
value: project.serviceStatusForAvatars
},
{
label: 'Databases',
method: 'databases',
method: APIService.Databases,
value: project.serviceStatusForDatabases
},
{
label: 'Functions',
method: 'functions',
method: APIService.Functions,
value: project.serviceStatusForFunctions
},
{
label: 'Health',
method: 'health',
method: APIService.Health,
value: project.serviceStatusForHealth
},
{
label: 'Locale',
method: 'locale',
method: APIService.Locale,
value: project.serviceStatusForLocale
},
{
label: 'Storage',
method: 'storage',
method: APIService.Storage,
value: project.serviceStatusForStorage
},
{
label: 'Teams',
method: 'teams',
method: APIService.Teams,
value: project.serviceStatusForTeams
},
{
label: 'Users',
method: 'users',
method: APIService.Users,
value: project.serviceStatusForUsers
}
];
Expand Down
2 changes: 2 additions & 0 deletions src/lib/stores/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Functions,
Health,
Locale,
Messaging,
Migrations,
Project,
Project as ProjectApi,
Expand Down Expand Up @@ -38,6 +39,7 @@ const sdkForProject = {
functions: new Functions(clientProject),
health: new Health(clientProject),
locale: new Locale(clientProject),
messaging: new Messaging(clientProject),
project: new Project(clientProject),
projectApi: new ProjectApi(clientProject),
storage: new Storage(clientProject),
Expand Down
Loading