mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
chore: sync with main and update console SDK to 1fb0624
Update @appwrite.io/console SDK from a1b2dc2 to 1fb0624. The new SDK includes both BAA addon methods and the previously missing Webhooks class and TablesDBIndexType enum, so the local compat shims (src/lib/sdk/webhooks.ts, src/lib/sdk/compat.ts) are removed and imports updated to use the official SDK exports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3665c85095
commit
deb54b0df4
@@ -6,7 +6,7 @@
|
||||
"name": "@appwrite/console",
|
||||
"dependencies": {
|
||||
"@ai-sdk/svelte": "^1.1.24",
|
||||
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@a1b2dc2",
|
||||
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@1fb0624",
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bfe7ce3",
|
||||
"@appwrite.io/pink-legacy": "^1.0.3",
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
"@analytics/type-utils": ["@analytics/type-utils@0.6.4", "", {}, "sha512-Ou1gQxFakOWLcPnbFVsrPb8g1wLLUZYYJXDPjHkG07+5mustGs5yqACx42UAu4A6NszNN6Z5gGxhyH45zPWRxw=="],
|
||||
|
||||
"@appwrite.io/console": ["@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@a1b2dc2", { "dependencies": { "json-bigint": "1.0.0" } }],
|
||||
"@appwrite.io/console": ["@appwrite.io/console@https://pkg.vc/-/@appwrite/@appwrite.io/console@1fb0624", { "dependencies": { "json-bigint": "1.0.0" } }],
|
||||
|
||||
"@appwrite.io/pink-icons": ["@appwrite.io/pink-icons@0.25.0", "", {}, "sha512-0O3i2oEuh5mWvjO80i+X6rbzrWLJ1m5wmv2/M3a1p2PyBJsFxN8xQMTEmTn3Wl/D26SsM7SpzbdW6gmfgoVU9Q=="],
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ai-sdk/svelte": "^1.1.24",
|
||||
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@a1b2dc2",
|
||||
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@1fb0624",
|
||||
"@appwrite.io/pink-icons": "0.25.0",
|
||||
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bfe7ce3",
|
||||
"@appwrite.io/pink-legacy": "^1.0.3",
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* SDK compatibility shims for exports missing from the current
|
||||
* @appwrite.io/console SDK version (a1b2dc2).
|
||||
*
|
||||
* @todo Remove once the SDK is updated to include both BAA addon
|
||||
* methods and the newer TablesDB types.
|
||||
*/
|
||||
|
||||
export enum TablesDBIndexType {
|
||||
Key = 'key',
|
||||
Fulltext = 'fulltext',
|
||||
Unique = 'unique',
|
||||
Spatial = 'spatial'
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/**
|
||||
* Webhooks SDK compatibility shim.
|
||||
*
|
||||
* @todo Remove once @appwrite.io/console is updated to include both BAA addon
|
||||
* methods and the Webhooks class (currently split across two SDK commits).
|
||||
*/
|
||||
import type { Client, Models } from '@appwrite.io/console';
|
||||
|
||||
export class Webhooks {
|
||||
private client: Client;
|
||||
|
||||
constructor(client: Client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async list(params?: { queries?: string[]; total?: boolean }): Promise<Models.WebhookList> {
|
||||
const payload: Record<string, unknown> = {};
|
||||
if (params?.queries !== undefined) payload['queries'] = params.queries;
|
||||
if (params?.total !== undefined) payload['total'] = params.total;
|
||||
const uri = new URL(this.client.config.endpoint + '/webhooks');
|
||||
return this.client.call('get', uri, {}, payload);
|
||||
}
|
||||
|
||||
async create(params: {
|
||||
webhookId: string;
|
||||
url: string;
|
||||
name: string;
|
||||
events: string[];
|
||||
enabled?: boolean;
|
||||
security?: boolean;
|
||||
httpUser?: string;
|
||||
httpPass?: string;
|
||||
}): Promise<Models.Webhook> {
|
||||
const payload: Record<string, unknown> = {};
|
||||
for (const [key, value] of Object.entries(params)) {
|
||||
if (value !== undefined) payload[key] = value;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + '/webhooks');
|
||||
return this.client.call('post', uri, { 'content-type': 'application/json' }, payload);
|
||||
}
|
||||
|
||||
async get(params: { webhookId: string }): Promise<Models.Webhook> {
|
||||
const uri = new URL(this.client.config.endpoint + `/webhooks/${params.webhookId}`);
|
||||
return this.client.call('get', uri, {}, {});
|
||||
}
|
||||
|
||||
async update(params: {
|
||||
webhookId: string;
|
||||
name: string;
|
||||
url: string;
|
||||
events: string[];
|
||||
enabled?: boolean;
|
||||
security?: boolean;
|
||||
httpUser?: string;
|
||||
httpPass?: string;
|
||||
}): Promise<Models.Webhook> {
|
||||
const { webhookId, ...rest } = params;
|
||||
const payload: Record<string, unknown> = {};
|
||||
for (const [key, value] of Object.entries(rest)) {
|
||||
if (value !== undefined) payload[key] = value;
|
||||
}
|
||||
const uri = new URL(this.client.config.endpoint + `/webhooks/${webhookId}`);
|
||||
return this.client.call('put', uri, { 'content-type': 'application/json' }, payload);
|
||||
}
|
||||
|
||||
async delete(params: { webhookId: string }): Promise<void> {
|
||||
const uri = new URL(this.client.config.endpoint + `/webhooks/${params.webhookId}`);
|
||||
return this.client.call('delete', uri, { 'content-type': 'application/json' }, {});
|
||||
}
|
||||
|
||||
async updateSignature(params: { webhookId: string }): Promise<Models.Webhook> {
|
||||
const uri = new URL(
|
||||
this.client.config.endpoint + `/webhooks/${params.webhookId}/signature`
|
||||
);
|
||||
return this.client.call('patch', uri, { 'content-type': 'application/json' }, {});
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,10 @@ import {
|
||||
Domains,
|
||||
/*DocumentsDB,*/
|
||||
Realtime,
|
||||
// @todo: import Webhooks from '@appwrite.io/console' once SDK includes both BAA + Webhooks
|
||||
Webhooks,
|
||||
Organizations
|
||||
} from '@appwrite.io/console';
|
||||
import { Sources } from '$lib/sdk/sources';
|
||||
import { Webhooks } from '$lib/sdk/webhooks';
|
||||
import {
|
||||
REGION_FRA,
|
||||
REGION_NYC,
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script module lang="ts">
|
||||
import { OrderBy } from '@appwrite.io/console';
|
||||
import { TablesDBIndexType } from '$lib/sdk/compat';
|
||||
import { TablesDBIndexType } from '@appwrite.io/console';
|
||||
export type CreateIndexesCallbackType = {
|
||||
key: string;
|
||||
type: TablesDBIndexType;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
import { type Entity, SideSheet } from '$database/(entity)';
|
||||
import { isSmallViewport } from '$lib/stores/viewport';
|
||||
import { OrderBy } from '@appwrite.io/console';
|
||||
import { TablesDBIndexType } from '$lib/sdk/compat';
|
||||
import { TablesDBIndexType } from '@appwrite.io/console';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import { type Columns } from '../table-[table]/store';
|
||||
import { isRelationship } from '../table-[table]/rows/store';
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { writable } from 'svelte/store';
|
||||
import { OrderBy } from '@appwrite.io/console';
|
||||
import { TablesDBIndexType } from '$lib/sdk/compat';
|
||||
import { TablesDBIndexType } from '@appwrite.io/console';
|
||||
import { columnOptions } from '../table-[table]/columns/store';
|
||||
|
||||
export type TableColumnSuggestions = {
|
||||
|
||||
Reference in New Issue
Block a user