diff --git a/package-lock.json b/package-lock.json
index 2074604..57a4f0b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -25,7 +25,6 @@
"filesize": "^10.1.4",
"highlight.js": "^11.10.0",
"langchain": "^0.2.13",
- "localforage": "^1.10.0",
"marked": "^14.0.0",
"marked-highlight": "^2.1.4",
"mime": "^4.0.4",
@@ -11522,10 +11521,6 @@
"node": ">=16.x"
}
},
- "node_modules/immediate": {
- "version": "3.0.6",
- "license": "MIT"
- },
"node_modules/immutable": {
"version": "4.3.7",
"dev": true,
@@ -12794,13 +12789,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/lie": {
- "version": "3.1.1",
- "license": "MIT",
- "dependencies": {
- "immediate": "~3.0.5"
- }
- },
"node_modules/lighthouse-logger": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz",
@@ -12903,13 +12891,6 @@
"@types/trusted-types": "^2.0.2"
}
},
- "node_modules/localforage": {
- "version": "1.10.0",
- "license": "Apache-2.0",
- "dependencies": {
- "lie": "3.1.1"
- }
- },
"node_modules/locate-path": {
"version": "6.0.0",
"license": "MIT",
diff --git a/package.json b/package.json
index 4a6556b..2ed1a21 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,6 @@
"filesize": "^10.1.4",
"highlight.js": "^11.10.0",
"langchain": "^0.2.13",
- "localforage": "^1.10.0",
"marked": "^14.0.0",
"marked-highlight": "^2.1.4",
"mime": "^4.0.4",
diff --git a/public/icons.svg b/public/icons.svg
index 0984cf1..74b6e52 100644
--- a/public/icons.svg
+++ b/public/icons.svg
@@ -129,4 +129,27 @@
d="M4.29128 10L0.896987 1.27183C0.660757 0.664364 1.2531 0.0834234 1.83906 0.289923L1.93141 0.329184L19.9314 9.32913C20.4497 9.58833 20.4821 10.2978 20.0286 10.6132L19.9314 10.6708L1.93141 19.6708C1.34843 19.9623 0.715117 19.4263 0.866457 18.8237L0.896987 18.7281L4.29128 10ZM2.99976 2.5404L5.60875 9.24943L12.2364 9.25003C12.6161 9.25003 12.9299 9.53213 12.9795 9.89823L12.9864 10C12.9864 10.3797 12.7042 10.6935 12.3381 10.7431L12.2364 10.75L5.60875 10.7494L2.99976 17.4596L17.919 10L2.99976 2.5404Z"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/icons/aleph.svg b/public/icons/aleph.svg
deleted file mode 100644
index 5905721..0000000
--- a/public/icons/aleph.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/public/icons/powered-by.svg b/public/icons/powered-by.svg
deleted file mode 100644
index 2d117c7..0000000
--- a/public/icons/powered-by.svg
+++ /dev/null
@@ -1,51 +0,0 @@
-
diff --git a/public/icons/powered-by_lighten.svg b/public/icons/powered-by_lighten.svg
deleted file mode 100644
index 092142c..0000000
--- a/public/icons/powered-by_lighten.svg
+++ /dev/null
@@ -1,51 +0,0 @@
-
diff --git a/public/icons/telegram.svg b/public/icons/telegram.svg
deleted file mode 100644
index 9e9fa8c..0000000
--- a/public/icons/telegram.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
diff --git a/public/icons/twitter-x.svg b/public/icons/twitter-x.svg
deleted file mode 100644
index 4ceac77..0000000
--- a/public/icons/twitter-x.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/src/apis/subscriptions/schemas.gen.ts b/src/apis/subscriptions/schemas.gen.ts
index ef39543..7ed80b5 100644
--- a/src/apis/subscriptions/schemas.gen.ts
+++ b/src/apis/subscriptions/schemas.gen.ts
@@ -192,7 +192,11 @@ export const SubscriptionAccountSchema = {
},
type: 'object',
required: ['address', 'chain'],
- title: 'SubscriptionAccount'
+ title: 'SubscriptionAccount',
+ example: {
+ address: '0x0000000000000000000000000000000000000000',
+ chain: 'base'
+ }
} as const;
export const SubscriptionChainSchema = {
@@ -204,14 +208,14 @@ export const SubscriptionChainSchema = {
export const SubscriptionProviderSchema = {
type: 'string',
- enum: ['hold', 'subs'],
+ enum: ['hold', 'subs', 'vouchers'],
title: 'SubscriptionProvider',
description: 'An enumeration.'
} as const;
export const SubscriptionTypeSchema = {
type: 'string',
- enum: ['standard'],
+ enum: ['pro', 'advanced', 'agent'],
title: 'SubscriptionType',
description: 'An enumeration.'
} as const;
@@ -244,4 +248,134 @@ export const ValidationErrorSchema = {
type: 'object',
required: ['loc', 'msg', 'type'],
title: 'ValidationError'
+} as const;
+
+export const VouchersCreatedSubscriptionSchema = {
+ properties: {
+ account: {
+ '$ref': '#/components/schemas/SubscriptionAccount'
+ },
+ type: {
+ '$ref': '#/components/schemas/SubscriptionType'
+ },
+ end_time: {
+ type: 'integer',
+ title: 'End Time'
+ },
+ post_hash: {
+ type: 'string',
+ title: 'Post Hash'
+ },
+ subscription_id: {
+ type: 'string',
+ title: 'Subscription Id'
+ }
+ },
+ type: 'object',
+ required: ['account', 'type', 'end_time', 'post_hash', 'subscription_id'],
+ title: 'VouchersCreatedSubscription'
+} as const;
+
+export const VouchersDeleteSubscribeBodySchema = {
+ properties: {
+ subscription_ids: {
+ items: {
+ type: 'string'
+ },
+ type: 'array',
+ title: 'Subscription Ids'
+ }
+ },
+ type: 'object',
+ required: ['subscription_ids'],
+ title: 'VouchersDeleteSubscribeBody'
+} as const;
+
+export const VouchersDeleteSubscriptionResponseSchema = {
+ properties: {
+ cancelled_subscriptions: {
+ items: {
+ type: 'string'
+ },
+ type: 'array',
+ title: 'Cancelled Subscriptions'
+ },
+ not_found_subscriptions: {
+ items: {
+ type: 'string'
+ },
+ type: 'array',
+ title: 'Not Found Subscriptions'
+ }
+ },
+ type: 'object',
+ required: ['cancelled_subscriptions', 'not_found_subscriptions'],
+ title: 'VouchersDeleteSubscriptionResponse'
+} as const;
+
+export const VouchersPostRefreshSubscriptionsResponseSchema = {
+ properties: {
+ cancelled_subscriptions: {
+ items: {
+ type: 'string'
+ },
+ type: 'array',
+ title: 'Cancelled Subscriptions'
+ }
+ },
+ type: 'object',
+ required: ['cancelled_subscriptions'],
+ title: 'VouchersPostRefreshSubscriptionsResponse'
+} as const;
+
+export const VouchersPostSubscribeBodySchema = {
+ properties: {
+ subscriptions: {
+ items: {
+ '$ref': '#/components/schemas/VouchersSubscription'
+ },
+ type: 'array',
+ title: 'Subscriptions'
+ },
+ password: {
+ type: 'string',
+ title: 'Password'
+ }
+ },
+ type: 'object',
+ required: ['subscriptions', 'password'],
+ title: 'VouchersPostSubscribeBody'
+} as const;
+
+export const VouchersPostSubscriptionResponseSchema = {
+ properties: {
+ created_subscriptions: {
+ items: {
+ '$ref': '#/components/schemas/VouchersCreatedSubscription'
+ },
+ type: 'array',
+ title: 'Created Subscriptions'
+ }
+ },
+ type: 'object',
+ required: ['created_subscriptions'],
+ title: 'VouchersPostSubscriptionResponse'
+} as const;
+
+export const VouchersSubscriptionSchema = {
+ properties: {
+ account: {
+ '$ref': '#/components/schemas/SubscriptionAccount'
+ },
+ type: {
+ '$ref': '#/components/schemas/SubscriptionType'
+ },
+ end_time: {
+ type: 'integer',
+ title: 'End Time'
+ }
+ },
+ type: 'object',
+ required: ['account', 'type', 'end_time'],
+ title: 'VouchersSubscription'
} as const;
\ No newline at end of file
diff --git a/src/apis/subscriptions/services.gen.ts b/src/apis/subscriptions/services.gen.ts
index e8e1ad0..3715c5e 100644
--- a/src/apis/subscriptions/services.gen.ts
+++ b/src/apis/subscriptions/services.gen.ts
@@ -1,7 +1,7 @@
// This file is auto-generated by @hey-api/openapi-ts
import { createClient, createConfig, type Options } from '@hey-api/client-axios';
-import type { GetUserSubscriptionsSubscriptionsGetData, GetUserSubscriptionsSubscriptionsGetError, GetUserSubscriptionsSubscriptionsGetResponse, SubscribeHoldSubscriptionPostData, SubscribeHoldSubscriptionPostError, SubscribeHoldSubscriptionPostResponse, UnsubscribeHoldSubscriptionDeleteData, UnsubscribeHoldSubscriptionDeleteError, UnsubscribeHoldSubscriptionDeleteResponse, RefreshActiveHoldSubscriptionsHoldRefreshPostError, RefreshActiveHoldSubscriptionsHoldRefreshPostResponse, HoldSubscriptionMessagesHoldMessageGetData, HoldSubscriptionMessagesHoldMessageGetError, HoldSubscriptionMessagesHoldMessageGetResponse, RefreshSubsRefreshPostError, RefreshSubsRefreshPostResponse } from './types.gen';
+import type { GetUserSubscriptionsSubscriptionsGetData, GetUserSubscriptionsSubscriptionsGetError, GetUserSubscriptionsSubscriptionsGetResponse, SubscribeHoldSubscriptionPostData, SubscribeHoldSubscriptionPostError, SubscribeHoldSubscriptionPostResponse, UnsubscribeHoldSubscriptionDeleteData, UnsubscribeHoldSubscriptionDeleteError, UnsubscribeHoldSubscriptionDeleteResponse, RefreshActiveHoldSubscriptionsHoldRefreshPostError, RefreshActiveHoldSubscriptionsHoldRefreshPostResponse, HoldSubscriptionMessagesHoldMessageGetData, HoldSubscriptionMessagesHoldMessageGetError, HoldSubscriptionMessagesHoldMessageGetResponse, RefreshSubsRefreshPostError, RefreshSubsRefreshPostResponse, SubscribeVouchersSubscriptionPostData, SubscribeVouchersSubscriptionPostError, SubscribeVouchersSubscriptionPostResponse, CancelVouchersSubscriptionsVouchersSubscriptionDeleteData, CancelVouchersSubscriptionsVouchersSubscriptionDeleteError, CancelVouchersSubscriptionsVouchersSubscriptionDeleteResponse, RefreshActiveVouchersSubscriptionsVouchersRefreshPostError, RefreshActiveVouchersSubscriptionsVouchersRefreshPostResponse } from './types.gen';
export const client = createClient(createConfig());
@@ -15,6 +15,7 @@ export const getUserSubscriptionsSubscriptionsGet = (options: Options) => { return (options?.client ?? client).post({
...options,
@@ -23,6 +24,7 @@ export const subscribeHoldSubscriptionPost = (options: Options) => { return (options?.client ?? client).delete({
...options,
@@ -31,6 +33,7 @@ export const unsubscribeHoldSubscriptionDelete = (options?: Options) => { return (options?.client ?? client).post({
...options,
@@ -53,4 +56,31 @@ export const holdSubscriptionMessagesHoldMessageGet = (options?: Options) => { return (options?.client ?? client).post({
...options,
url: '/subs/refresh'
+}); };
+
+/**
+ * Subscribe
+ * Create one or multiple vouchers subscriptions
+ */
+export const subscribeVouchersSubscriptionPost = (options: Options) => { return (options?.client ?? client).post({
+ ...options,
+ url: '/vouchers/subscription'
+}); };
+
+/**
+ * Cancel Vouchers Subscriptions
+ * Stop some vouchers subscriptions
+ */
+export const cancelVouchersSubscriptionsVouchersSubscriptionDelete = (options: Options) => { return (options?.client ?? client).delete({
+ ...options,
+ url: '/vouchers/subscription'
+}); };
+
+/**
+ * Refresh Active Vouchers Subscriptions
+ * Check existing vouchers subscriptions to stop if the end_date is passed
+ */
+export const refreshActiveVouchersSubscriptionsVouchersRefreshPost = (options?: Options) => { return (options?.client ?? client).post({
+ ...options,
+ url: '/vouchers/refresh'
}); };
\ No newline at end of file
diff --git a/src/apis/subscriptions/types.gen.ts b/src/apis/subscriptions/types.gen.ts
index ab029a9..984d509 100644
--- a/src/apis/subscriptions/types.gen.ts
+++ b/src/apis/subscriptions/types.gen.ts
@@ -66,12 +66,12 @@ export type SubscriptionChain = 'base';
/**
* An enumeration.
*/
-export type SubscriptionProvider = 'hold' | 'subs';
+export type SubscriptionProvider = 'hold' | 'subs' | 'vouchers';
/**
* An enumeration.
*/
-export type SubscriptionType = 'standard';
+export type SubscriptionType = 'pro' | 'advanced' | 'agent';
export type ValidationError = {
loc: Array<(string | number)>;
@@ -79,6 +79,42 @@ export type ValidationError = {
type: string;
};
+export type VouchersCreatedSubscription = {
+ account: SubscriptionAccount;
+ type: SubscriptionType;
+ end_time: number;
+ post_hash: string;
+ subscription_id: string;
+};
+
+export type VouchersDeleteSubscribeBody = {
+ subscription_ids: Array<(string)>;
+};
+
+export type VouchersDeleteSubscriptionResponse = {
+ cancelled_subscriptions: Array<(string)>;
+ not_found_subscriptions: Array<(string)>;
+};
+
+export type VouchersPostRefreshSubscriptionsResponse = {
+ cancelled_subscriptions: Array<(string)>;
+};
+
+export type VouchersPostSubscribeBody = {
+ subscriptions: Array;
+ password: string;
+};
+
+export type VouchersPostSubscriptionResponse = {
+ created_subscriptions: Array;
+};
+
+export type VouchersSubscription = {
+ account: SubscriptionAccount;
+ type: SubscriptionType;
+ end_time: number;
+};
+
export type GetUserSubscriptionsSubscriptionsGetData = {
query: {
address: string;
@@ -121,4 +157,24 @@ export type HoldSubscriptionMessagesHoldMessageGetError = (HTTPValidationError);
export type RefreshSubsRefreshPostResponse = (SubsPostRefreshSubscriptionsResponse);
-export type RefreshSubsRefreshPostError = unknown;
\ No newline at end of file
+export type RefreshSubsRefreshPostError = unknown;
+
+export type SubscribeVouchersSubscriptionPostData = {
+ body: VouchersPostSubscribeBody;
+};
+
+export type SubscribeVouchersSubscriptionPostResponse = (VouchersPostSubscriptionResponse);
+
+export type SubscribeVouchersSubscriptionPostError = (HTTPValidationError);
+
+export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteData = {
+ body: VouchersDeleteSubscribeBody;
+};
+
+export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteResponse = (VouchersDeleteSubscriptionResponse);
+
+export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteError = (HTTPValidationError);
+
+export type RefreshActiveVouchersSubscriptionsVouchersRefreshPostResponse = (VouchersPostRefreshSubscriptionsResponse);
+
+export type RefreshActiveVouchersSubscriptionsVouchersRefreshPostError = unknown;
\ No newline at end of file
diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue
index f37b2e0..58d022e 100644
--- a/src/layouts/MainLayout.vue
+++ b/src/layouts/MainLayout.vue
@@ -60,35 +60,14 @@
-
-
-
- {{ item.title }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{ item.title }}
-
-
-
-
-
+
@@ -119,6 +98,11 @@ function toggleLeftDrawer() {
}
const sidebarItems = [
+ {
+ link: '/subscriptions',
+ icon: 'svguse:icons.svg#subscription-star',
+ title: 'Subscriptions',
+ },
{
link: '/knowledge-base',
icon: 'svguse:icons.svg#book',
@@ -129,5 +113,10 @@ const sidebarItems = [
icon: 'svguse:icons.svg#robot',
title: 'Persona management',
},
+ {
+ link: '/account',
+ icon: 'svguse:icons.svg#account',
+ title: 'Account settings',
+ },
];
diff --git a/src/pages/Subscriptions.vue b/src/pages/Subscriptions.vue
index 9c18174..ae3dcaf 100644
--- a/src/pages/Subscriptions.vue
+++ b/src/pages/Subscriptions.vue
@@ -12,7 +12,7 @@
rounded
text-color="dark-mode-text"
unelevated
- @click="subscriptionsStore.holdSubscribe('standard')"
+ @click="subscriptionsStore.holdSubscribe('pro')"
>
New standard hold subscription
diff --git a/src/stores/chats.ts b/src/stores/chats.ts
index 34847d3..1c20320 100644
--- a/src/stores/chats.ts
+++ b/src/stores/chats.ts
@@ -3,9 +3,7 @@ import { defineStore } from 'pinia';
import { chatsMigrations } from 'src/migrations/chats';
import { Chat, MessageAttachment, UIMessage } from 'src/types/chats';
import { UIPersona } from 'src/types/personas';
-import localforage from 'localforage';
-const CHATS_STORE_NAME = 'chats-store';
const CHATS_STORE_PINIA_KEY = 'chats-store-pinia-key';
type ChatsStoreState = {
@@ -23,7 +21,7 @@ export const useChatsStore = defineStore(CHATS_STORE_PINIA_KEY, {
persist: {
paths: ['version', 'chats'],
afterRestore: (ctx) => {
- ctx.store.loadAndMigrateChats();
+ ctx.store.migrateChats();
},
},
getters: {
@@ -37,22 +35,8 @@ export const useChatsStore = defineStore(CHATS_STORE_PINIA_KEY, {
},
},
actions: {
- async loadAndMigrateChats() {
+ async migrateChats() {
try {
- // Legacy: Fetch chats stored with LocalForage
- const localForageStore = localforage.createInstance({ name: CHATS_STORE_NAME });
-
- const oldChats: Chat[] = [];
- await localForageStore.iterate((chat: Chat) => {
- oldChats.push(chat);
- });
- if (oldChats.length > 0) {
- const oldIds = oldChats.map((c) => c.id);
- this.chats = this.chats.filter((c) => !oldIds.includes(c.id)).concat(oldChats);
- }
- // Remove all the data now that we are done migrating it
- await localForageStore.dropInstance({ name: CHATS_STORE_NAME });
-
// Running migrations if needed
if (this.version < chatsMigrations.length) {
// Removing migrations already ran
diff --git a/src/stores/subscription.ts b/src/stores/subscription.ts
index 8c9c9d9..cdb7f66 100644
--- a/src/stores/subscription.ts
+++ b/src/stores/subscription.ts
@@ -58,11 +58,11 @@ export const useSubscriptionStore = defineStore('subscriptions', {
const subscriptionResponse = await subscribeHoldSubscriptionPost({
body: {
signature: hash,
- type: 'standard',
+ type: subscriptionType,
account: { chain: 'base', address },
},
});
- // TODO: handle errors and success
+ console.log(subscriptionResponse);
},
},
});