diff --git a/src/apis/subscriptions/index.ts b/src/apis/subscriptions/index.ts index 0a2b84b..002afc3 100644 --- a/src/apis/subscriptions/index.ts +++ b/src/apis/subscriptions/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts export * from './schemas.gen'; export * from './services.gen'; -export * from './types.gen'; \ No newline at end of file +export * from './types.gen'; diff --git a/src/apis/subscriptions/schemas.gen.ts b/src/apis/subscriptions/schemas.gen.ts index 7ed80b5..a8b38c3 100644 --- a/src/apis/subscriptions/schemas.gen.ts +++ b/src/apis/subscriptions/schemas.gen.ts @@ -1,381 +1,381 @@ // This file is auto-generated by @hey-api/openapi-ts export const BaseSubscriptionSchema = { - properties: { - id: { - type: 'string', - title: 'Id' - }, - type: { - '$ref': '#/components/schemas/SubscriptionType' - }, - provider: { - '$ref': '#/components/schemas/SubscriptionProvider' - }, - started_at: { - type: 'integer', - title: 'Started At' - }, - ended_at: { - type: 'integer', - title: 'Ended At' - }, - is_active: { - type: 'boolean', - title: 'Is Active' - } - }, - type: 'object', - required: ['id', 'type', 'provider', 'started_at', 'is_active'], - title: 'BaseSubscription' + properties: { + id: { + type: 'string', + title: 'Id', + }, + type: { + $ref: '#/components/schemas/SubscriptionType', + }, + provider: { + $ref: '#/components/schemas/SubscriptionProvider', + }, + started_at: { + type: 'integer', + title: 'Started At', + }, + ended_at: { + type: 'integer', + title: 'Ended At', + }, + is_active: { + type: 'boolean', + title: 'Is Active', + }, + }, + type: 'object', + required: ['id', 'type', 'provider', 'started_at', 'is_active'], + title: 'BaseSubscription', } as const; export const GetUserSubscriptionsResponseSchema = { - properties: { - subscriptions: { - items: { - '$ref': '#/components/schemas/BaseSubscription' - }, - type: 'array', - title: 'Subscriptions' - } - }, - type: 'object', - required: ['subscriptions'], - title: 'GetUserSubscriptionsResponse' + properties: { + subscriptions: { + items: { + $ref: '#/components/schemas/BaseSubscription', + }, + type: 'array', + title: 'Subscriptions', + }, + }, + type: 'object', + required: ['subscriptions'], + title: 'GetUserSubscriptionsResponse', } as const; export const HTTPValidationErrorSchema = { - properties: { - detail: { - items: { - '$ref': '#/components/schemas/ValidationError' - }, - type: 'array', - title: 'Detail' - } - }, - type: 'object', - title: 'HTTPValidationError' + properties: { + detail: { + items: { + $ref: '#/components/schemas/ValidationError', + }, + type: 'array', + title: 'Detail', + }, + }, + type: 'object', + title: 'HTTPValidationError', } as const; export const HoldDeleteSubscriptionBodySchema = { - properties: { - account: { - '$ref': '#/components/schemas/SubscriptionAccount' - }, - signature: { - type: 'string', - title: 'Signature' - }, - type: { - '$ref': '#/components/schemas/SubscriptionType' - }, - subscription_id: { - type: 'string', - title: 'Subscription Id' - } + properties: { + account: { + $ref: '#/components/schemas/SubscriptionAccount', + }, + signature: { + type: 'string', + title: 'Signature', }, - type: 'object', - required: ['account', 'signature', 'type', 'subscription_id'], - title: 'HoldDeleteSubscriptionBody' + type: { + $ref: '#/components/schemas/SubscriptionType', + }, + subscription_id: { + type: 'string', + title: 'Subscription Id', + }, + }, + type: 'object', + required: ['account', 'signature', 'type', 'subscription_id'], + title: 'HoldDeleteSubscriptionBody', } as const; export const HoldDeleteSubscriptionResponseSchema = { - properties: { - success: { - type: 'boolean', - title: 'Success' - } - }, - type: 'object', - required: ['success'], - title: 'HoldDeleteSubscriptionResponse' + properties: { + success: { + type: 'boolean', + title: 'Success', + }, + }, + type: 'object', + required: ['success'], + title: 'HoldDeleteSubscriptionResponse', } as const; export const HoldGetMessagesResponseSchema = { - properties: { - subscribe_message: { - type: 'string', - title: 'Subscribe Message' - }, - unsubscribe_message: { - type: 'string', - title: 'Unsubscribe Message' - } + properties: { + subscribe_message: { + type: 'string', + title: 'Subscribe Message', + }, + unsubscribe_message: { + type: 'string', + title: 'Unsubscribe Message', }, - type: 'object', - required: ['subscribe_message', 'unsubscribe_message'], - title: 'HoldGetMessagesResponse' + }, + type: 'object', + required: ['subscribe_message', 'unsubscribe_message'], + title: 'HoldGetMessagesResponse', } as const; export const HoldPostRefreshSubscriptionsResponseSchema = { - properties: { - cancelled_subscriptions: { - items: { - type: 'string' - }, - type: 'array', - title: 'Cancelled Subscriptions' - } - }, - type: 'object', - required: ['cancelled_subscriptions'], - title: 'HoldPostRefreshSubscriptionsResponse' + properties: { + cancelled_subscriptions: { + items: { + type: 'string', + }, + type: 'array', + title: 'Cancelled Subscriptions', + }, + }, + type: 'object', + required: ['cancelled_subscriptions'], + title: 'HoldPostRefreshSubscriptionsResponse', } as const; export const HoldPostSubscriptionBodySchema = { - properties: { - account: { - '$ref': '#/components/schemas/SubscriptionAccount' - }, - signature: { - type: 'string', - title: 'Signature' - }, - type: { - '$ref': '#/components/schemas/SubscriptionType' - } - }, - type: 'object', - required: ['account', 'signature', 'type'], - title: 'HoldPostSubscriptionBody' + properties: { + account: { + $ref: '#/components/schemas/SubscriptionAccount', + }, + signature: { + type: 'string', + title: 'Signature', + }, + type: { + $ref: '#/components/schemas/SubscriptionType', + }, + }, + type: 'object', + required: ['account', 'signature', 'type'], + title: 'HoldPostSubscriptionBody', } as const; export const HoldPostSubscriptionResponseSchema = { - properties: { - post_hash: { - type: 'string', - title: 'Post Hash' - }, - subscription_id: { - type: 'string', - title: 'Subscription Id' - } + properties: { + post_hash: { + type: 'string', + title: 'Post Hash', + }, + subscription_id: { + type: 'string', + title: 'Subscription Id', }, - type: 'object', - required: ['post_hash', 'subscription_id'], - title: 'HoldPostSubscriptionResponse' + }, + type: 'object', + required: ['post_hash', 'subscription_id'], + title: 'HoldPostSubscriptionResponse', } as const; export const SubsPostRefreshSubscriptionsResponseSchema = { - properties: { - created_subscriptions: { - items: { - type: 'string' - }, - type: 'array', - title: 'Created Subscriptions' - }, - cancelled_subscriptions: { - items: { - type: 'string' - }, - type: 'array', - title: 'Cancelled Subscriptions' - } - }, - type: 'object', - required: ['created_subscriptions', 'cancelled_subscriptions'], - title: 'SubsPostRefreshSubscriptionsResponse' + properties: { + created_subscriptions: { + items: { + type: 'string', + }, + type: 'array', + title: 'Created Subscriptions', + }, + cancelled_subscriptions: { + items: { + type: 'string', + }, + type: 'array', + title: 'Cancelled Subscriptions', + }, + }, + type: 'object', + required: ['created_subscriptions', 'cancelled_subscriptions'], + title: 'SubsPostRefreshSubscriptionsResponse', } as const; export const SubscriptionAccountSchema = { - properties: { - address: { - type: 'string', - title: 'Address' - }, - chain: { - '$ref': '#/components/schemas/SubscriptionChain' - } - }, - type: 'object', - required: ['address', 'chain'], - title: 'SubscriptionAccount', - example: { - address: '0x0000000000000000000000000000000000000000', - chain: 'base' - } + properties: { + address: { + type: 'string', + title: 'Address', + }, + chain: { + $ref: '#/components/schemas/SubscriptionChain', + }, + }, + type: 'object', + required: ['address', 'chain'], + title: 'SubscriptionAccount', + example: { + address: '0x0000000000000000000000000000000000000000', + chain: 'base', + }, } as const; export const SubscriptionChainSchema = { - type: 'string', - enum: ['base'], - title: 'SubscriptionChain', - description: 'An enumeration.' + type: 'string', + enum: ['base'], + title: 'SubscriptionChain', + description: 'An enumeration.', } as const; export const SubscriptionProviderSchema = { - type: 'string', - enum: ['hold', 'subs', 'vouchers'], - title: 'SubscriptionProvider', - description: 'An enumeration.' + type: 'string', + enum: ['hold', 'subs', 'vouchers'], + title: 'SubscriptionProvider', + description: 'An enumeration.', } as const; export const SubscriptionTypeSchema = { - type: 'string', - enum: ['pro', 'advanced', 'agent'], - title: 'SubscriptionType', - description: 'An enumeration.' + type: 'string', + enum: ['pro', 'advanced', 'agent'], + title: 'SubscriptionType', + description: 'An enumeration.', } as const; export const ValidationErrorSchema = { - properties: { - loc: { - items: { - anyOf: [ - { - type: 'string' - }, - { - type: 'integer' - } - ] - }, - type: 'array', - title: 'Location' - }, - msg: { - type: 'string', - title: 'Message' - }, - type: { + properties: { + loc: { + items: { + anyOf: [ + { type: 'string', - title: 'Error Type' - } + }, + { + type: 'integer', + }, + ], + }, + type: 'array', + title: 'Location', }, - type: 'object', - required: ['loc', 'msg', 'type'], - title: 'ValidationError' + msg: { + type: 'string', + title: 'Message', + }, + type: { + type: 'string', + title: 'Error Type', + }, + }, + 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' - } + 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', 'post_hash', 'subscription_id'], - title: 'VouchersCreatedSubscription' + 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' + 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' + 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' + 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' - } + properties: { + subscriptions: { + items: { + $ref: '#/components/schemas/VouchersSubscription', + }, + type: 'array', + title: 'Subscriptions', }, - type: 'object', - required: ['subscriptions', 'password'], - title: 'VouchersPostSubscribeBody' + 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' + 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' - } + properties: { + account: { + $ref: '#/components/schemas/SubscriptionAccount', }, - type: 'object', - required: ['account', 'type', 'end_time'], - title: 'VouchersSubscription' -} as const; \ No newline at end of file + type: { + $ref: '#/components/schemas/SubscriptionType', + }, + end_time: { + type: 'integer', + title: 'End Time', + }, + }, + type: 'object', + required: ['account', 'type', 'end_time'], + title: 'VouchersSubscription', +} as const; diff --git a/src/apis/subscriptions/services.gen.ts b/src/apis/subscriptions/services.gen.ts index 3715c5e..640c389 100644 --- a/src/apis/subscriptions/services.gen.ts +++ b/src/apis/subscriptions/services.gen.ts @@ -1,86 +1,179 @@ // 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, SubscribeVouchersSubscriptionPostData, SubscribeVouchersSubscriptionPostError, SubscribeVouchersSubscriptionPostResponse, CancelVouchersSubscriptionsVouchersSubscriptionDeleteData, CancelVouchersSubscriptionsVouchersSubscriptionDeleteError, CancelVouchersSubscriptionsVouchersSubscriptionDeleteResponse, RefreshActiveVouchersSubscriptionsVouchersRefreshPostError, RefreshActiveVouchersSubscriptionsVouchersRefreshPostResponse } 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()); /** * Get User Subscriptions */ -export const getUserSubscriptionsSubscriptionsGet = (options: Options) => { return (options?.client ?? client).get({ +export const getUserSubscriptionsSubscriptionsGet = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetUserSubscriptionsSubscriptionsGetResponse, + GetUserSubscriptionsSubscriptionsGetError, + ThrowOnError + >({ ...options, - url: '/subscriptions' -}); }; + url: '/subscriptions', + }); +}; /** * Subscribe * Subscribe to a plan */ -export const subscribeHoldSubscriptionPost = (options: Options) => { return (options?.client ?? client).post({ +export const subscribeHoldSubscriptionPost = ( + options: Options, +) => { + return (options?.client ?? client).post< + SubscribeHoldSubscriptionPostResponse, + SubscribeHoldSubscriptionPostError, + ThrowOnError + >({ ...options, - url: '/hold/subscription' -}); }; + url: '/hold/subscription', + }); +}; /** * Unsubscribe * Unsubscribe of an existing subscription */ -export const unsubscribeHoldSubscriptionDelete = (options: Options) => { return (options?.client ?? client).delete({ +export const unsubscribeHoldSubscriptionDelete = ( + options: Options, +) => { + return (options?.client ?? client).delete< + UnsubscribeHoldSubscriptionDeleteResponse, + UnsubscribeHoldSubscriptionDeleteError, + ThrowOnError + >({ ...options, - url: '/hold/subscription' -}); }; + url: '/hold/subscription', + }); +}; /** * Refresh Active Hold Subscriptions * Delete existing active hold subscriptions if not enough tokens held in the wallet */ -export const refreshActiveHoldSubscriptionsHoldRefreshPost = (options?: Options) => { return (options?.client ?? client).post({ +export const refreshActiveHoldSubscriptionsHoldRefreshPost = ( + options?: Options, +) => { + return (options?.client ?? client).post< + RefreshActiveHoldSubscriptionsHoldRefreshPostResponse, + RefreshActiveHoldSubscriptionsHoldRefreshPostError, + ThrowOnError + >({ ...options, - url: '/hold/refresh' -}); }; + url: '/hold/refresh', + }); +}; /** * Hold Subscription Messages * Returns the messages to sign to authenticate other actions */ -export const holdSubscriptionMessagesHoldMessageGet = (options: Options) => { return (options?.client ?? client).get({ +export const holdSubscriptionMessagesHoldMessageGet = ( + options: Options, +) => { + return (options?.client ?? client).get< + HoldSubscriptionMessagesHoldMessageGetResponse, + HoldSubscriptionMessagesHoldMessageGetError, + ThrowOnError + >({ ...options, - url: '/hold/message' -}); }; + url: '/hold/message', + }); +}; /** * Refresh * Cancel existing unpaid subscriptions and creating newly paid ones */ -export const refreshSubsRefreshPost = (options?: Options) => { return (options?.client ?? client).post({ +export const refreshSubsRefreshPost = ( + options?: Options, +) => { + return (options?.client ?? client).post({ ...options, - url: '/subs/refresh' -}); }; + url: '/subs/refresh', + }); +}; /** * Subscribe * Create one or multiple vouchers subscriptions */ -export const subscribeVouchersSubscriptionPost = (options: Options) => { return (options?.client ?? client).post({ +export const subscribeVouchersSubscriptionPost = ( + options: Options, +) => { + return (options?.client ?? client).post< + SubscribeVouchersSubscriptionPostResponse, + SubscribeVouchersSubscriptionPostError, + ThrowOnError + >({ ...options, - url: '/vouchers/subscription' -}); }; + url: '/vouchers/subscription', + }); +}; /** * Cancel Vouchers Subscriptions * Stop some vouchers subscriptions */ -export const cancelVouchersSubscriptionsVouchersSubscriptionDelete = (options: Options) => { return (options?.client ?? client).delete({ +export const cancelVouchersSubscriptionsVouchersSubscriptionDelete = ( + options: Options, +) => { + return (options?.client ?? client).delete< + CancelVouchersSubscriptionsVouchersSubscriptionDeleteResponse, + CancelVouchersSubscriptionsVouchersSubscriptionDeleteError, + ThrowOnError + >({ ...options, - url: '/vouchers/subscription' -}); }; + 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({ +export const refreshActiveVouchersSubscriptionsVouchersRefreshPost = ( + options?: Options, +) => { + return (options?.client ?? client).post< + RefreshActiveVouchersSubscriptionsVouchersRefreshPostResponse, + RefreshActiveVouchersSubscriptionsVouchersRefreshPostError, + ThrowOnError + >({ ...options, - url: '/vouchers/refresh' -}); }; \ No newline at end of file + url: '/vouchers/refresh', + }); +}; diff --git a/src/apis/subscriptions/types.gen.ts b/src/apis/subscriptions/types.gen.ts index 984d509..1cf71ce 100644 --- a/src/apis/subscriptions/types.gen.ts +++ b/src/apis/subscriptions/types.gen.ts @@ -1,61 +1,61 @@ // This file is auto-generated by @hey-api/openapi-ts export type BaseSubscription = { - id: string; - type: SubscriptionType; - provider: SubscriptionProvider; - started_at: number; - ended_at?: number; - is_active: boolean; + id: string; + type: SubscriptionType; + provider: SubscriptionProvider; + started_at: number; + ended_at?: number; + is_active: boolean; }; export type GetUserSubscriptionsResponse = { - subscriptions: Array; + subscriptions: Array; }; export type HTTPValidationError = { - detail?: Array; + detail?: Array; }; export type HoldDeleteSubscriptionBody = { - account: SubscriptionAccount; - signature: string; - type: SubscriptionType; - subscription_id: string; + account: SubscriptionAccount; + signature: string; + type: SubscriptionType; + subscription_id: string; }; export type HoldDeleteSubscriptionResponse = { - success: boolean; + success: boolean; }; export type HoldGetMessagesResponse = { - subscribe_message: string; - unsubscribe_message: string; + subscribe_message: string; + unsubscribe_message: string; }; export type HoldPostRefreshSubscriptionsResponse = { - cancelled_subscriptions: Array<(string)>; + cancelled_subscriptions: Array; }; export type HoldPostSubscriptionBody = { - account: SubscriptionAccount; - signature: string; - type: SubscriptionType; + account: SubscriptionAccount; + signature: string; + type: SubscriptionType; }; export type HoldPostSubscriptionResponse = { - post_hash: string; - subscription_id: string; + post_hash: string; + subscription_id: string; }; export type SubsPostRefreshSubscriptionsResponse = { - created_subscriptions: Array<(string)>; - cancelled_subscriptions: Array<(string)>; + created_subscriptions: Array; + cancelled_subscriptions: Array; }; export type SubscriptionAccount = { - address: string; - chain: SubscriptionChain; + address: string; + chain: SubscriptionChain; }; /** @@ -74,107 +74,107 @@ export type SubscriptionProvider = 'hold' | 'subs' | 'vouchers'; export type SubscriptionType = 'pro' | 'advanced' | 'agent'; export type ValidationError = { - loc: Array<(string | number)>; - msg: string; - type: string; + loc: Array; + msg: string; + type: string; }; export type VouchersCreatedSubscription = { - account: SubscriptionAccount; - type: SubscriptionType; - end_time: number; - post_hash: string; - subscription_id: string; + account: SubscriptionAccount; + type: SubscriptionType; + end_time: number; + post_hash: string; + subscription_id: string; }; export type VouchersDeleteSubscribeBody = { - subscription_ids: Array<(string)>; + subscription_ids: Array; }; export type VouchersDeleteSubscriptionResponse = { - cancelled_subscriptions: Array<(string)>; - not_found_subscriptions: Array<(string)>; + cancelled_subscriptions: Array; + not_found_subscriptions: Array; }; export type VouchersPostRefreshSubscriptionsResponse = { - cancelled_subscriptions: Array<(string)>; + cancelled_subscriptions: Array; }; export type VouchersPostSubscribeBody = { - subscriptions: Array; - password: string; + subscriptions: Array; + password: string; }; export type VouchersPostSubscriptionResponse = { - created_subscriptions: Array; + created_subscriptions: Array; }; export type VouchersSubscription = { - account: SubscriptionAccount; - type: SubscriptionType; - end_time: number; + account: SubscriptionAccount; + type: SubscriptionType; + end_time: number; }; export type GetUserSubscriptionsSubscriptionsGetData = { - query: { - address: string; - }; + query: { + address: string; + }; }; -export type GetUserSubscriptionsSubscriptionsGetResponse = (GetUserSubscriptionsResponse); +export type GetUserSubscriptionsSubscriptionsGetResponse = GetUserSubscriptionsResponse; -export type GetUserSubscriptionsSubscriptionsGetError = (HTTPValidationError); +export type GetUserSubscriptionsSubscriptionsGetError = HTTPValidationError; export type SubscribeHoldSubscriptionPostData = { - body: HoldPostSubscriptionBody; + body: HoldPostSubscriptionBody; }; -export type SubscribeHoldSubscriptionPostResponse = (HoldPostSubscriptionResponse); +export type SubscribeHoldSubscriptionPostResponse = HoldPostSubscriptionResponse; -export type SubscribeHoldSubscriptionPostError = (HTTPValidationError); +export type SubscribeHoldSubscriptionPostError = HTTPValidationError; export type UnsubscribeHoldSubscriptionDeleteData = { - body: HoldDeleteSubscriptionBody; + body: HoldDeleteSubscriptionBody; }; -export type UnsubscribeHoldSubscriptionDeleteResponse = (HoldDeleteSubscriptionResponse); +export type UnsubscribeHoldSubscriptionDeleteResponse = HoldDeleteSubscriptionResponse; -export type UnsubscribeHoldSubscriptionDeleteError = (HTTPValidationError); +export type UnsubscribeHoldSubscriptionDeleteError = HTTPValidationError; -export type RefreshActiveHoldSubscriptionsHoldRefreshPostResponse = (HoldPostRefreshSubscriptionsResponse); +export type RefreshActiveHoldSubscriptionsHoldRefreshPostResponse = HoldPostRefreshSubscriptionsResponse; export type RefreshActiveHoldSubscriptionsHoldRefreshPostError = unknown; export type HoldSubscriptionMessagesHoldMessageGetData = { - query: { - subscription_type: SubscriptionType; - }; + query: { + subscription_type: SubscriptionType; + }; }; -export type HoldSubscriptionMessagesHoldMessageGetResponse = (HoldGetMessagesResponse); +export type HoldSubscriptionMessagesHoldMessageGetResponse = HoldGetMessagesResponse; -export type HoldSubscriptionMessagesHoldMessageGetError = (HTTPValidationError); +export type HoldSubscriptionMessagesHoldMessageGetError = HTTPValidationError; -export type RefreshSubsRefreshPostResponse = (SubsPostRefreshSubscriptionsResponse); +export type RefreshSubsRefreshPostResponse = SubsPostRefreshSubscriptionsResponse; export type RefreshSubsRefreshPostError = unknown; export type SubscribeVouchersSubscriptionPostData = { - body: VouchersPostSubscribeBody; + body: VouchersPostSubscribeBody; }; -export type SubscribeVouchersSubscriptionPostResponse = (VouchersPostSubscriptionResponse); +export type SubscribeVouchersSubscriptionPostResponse = VouchersPostSubscriptionResponse; -export type SubscribeVouchersSubscriptionPostError = (HTTPValidationError); +export type SubscribeVouchersSubscriptionPostError = HTTPValidationError; export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteData = { - body: VouchersDeleteSubscribeBody; + body: VouchersDeleteSubscribeBody; }; -export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteResponse = (VouchersDeleteSubscriptionResponse); +export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteResponse = VouchersDeleteSubscriptionResponse; -export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteError = (HTTPValidationError); +export type CancelVouchersSubscriptionsVouchersSubscriptionDeleteError = HTTPValidationError; -export type RefreshActiveVouchersSubscriptionsVouchersRefreshPostResponse = (VouchersPostRefreshSubscriptionsResponse); +export type RefreshActiveVouchersSubscriptionsVouchersRefreshPostResponse = VouchersPostRefreshSubscriptionsResponse; -export type RefreshActiveVouchersSubscriptionsVouchersRefreshPostError = unknown; \ No newline at end of file +export type RefreshActiveVouchersSubscriptionsVouchersRefreshPostError = unknown; diff --git a/src/boot/axios.ts b/src/boot/axios.ts index e9f10dc..c1a6ff4 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -1,8 +1,9 @@ import { boot } from 'quasar/wrappers'; import { client } from 'src/apis/subscriptions/services.gen'; +import env from 'src/config/env'; export default boot(() => { client.setConfig({ - baseURL: process.env.LTAI_SUBSCRIPTIONS_API_URL, + baseURL: env.LTAI_SUBSCRIPTIONS_API_URL, }); }); diff --git a/src/layouts/Authenticated.vue b/src/layouts/Authenticated.vue new file mode 100644 index 0000000..4ae9351 --- /dev/null +++ b/src/layouts/Authenticated.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/pages/AccountSettings.vue b/src/pages/AccountSettings.vue index 87d7f68..1c2b2ba 100644 --- a/src/pages/AccountSettings.vue +++ b/src/pages/AccountSettings.vue @@ -1,21 +1,9 @@ diff --git a/src/pages/KnowledgeBase.vue b/src/pages/KnowledgeBase.vue index 3b96974..996c40d 100644 --- a/src/pages/KnowledgeBase.vue +++ b/src/pages/KnowledgeBase.vue @@ -1,106 +1,17 @@ diff --git a/src/utils/aleph-persistent-storage.ts b/src/utils/aleph-persistent-storage.ts index f681d8e..7ad82c3 100644 --- a/src/utils/aleph-persistent-storage.ts +++ b/src/utils/aleph-persistent-storage.ts @@ -14,6 +14,7 @@ import { import { decrypt, encrypt, generateIv, generateKey } from 'src/utils/encryption'; import { PrivateKey } from 'eciesjs'; import { decryptKnowledgeBaseIdentifiers, encryptKnowledgeBaseIdentifiers } from 'src/utils/knowledge/encryption'; +import env from 'src/config/env'; // Aleph keys and channels settings const SECURITY_AGGREGATE_KEY = 'security'; @@ -49,8 +50,8 @@ export class AlephPersistentStorage { const subAccount = importAccountFromPrivateKey(privateKey); const account = await getAccountFromProvider(window.ethereum); - const accountClient = new AuthenticatedAlephHttpClient(account, process.env.ALEPH_API_URL); - const subAccountClient = new AuthenticatedAlephHttpClient(subAccount, process.env.ALEPH_API_URL); + const accountClient = new AuthenticatedAlephHttpClient(account, env.ALEPH_API_URL); + const subAccountClient = new AuthenticatedAlephHttpClient(subAccount, env.ALEPH_API_URL); await AlephPersistentStorage.getSecurityPermission(account, subAccount, accountClient);