feat: add responses package

This commit is contained in:
Karol Sójko
2022-07-06 11:59:04 +02:00
parent 67b0918ba8
commit 9d1f7043e5
73 changed files with 977 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
import { FeatureDescription } from '@standardnotes/features'
import { SubscriptionName } from '@standardnotes/common'
export type AvailableSubscriptions = {
[key in SubscriptionName]: {
name: string
pricing: {
price: number
period: string
}[]
features: FeatureDescription[]
}
}

View File

@@ -0,0 +1,3 @@
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
export type DeleteSettingResponse = MinimalHttpResponse

View File

@@ -0,0 +1,6 @@
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
import { AvailableSubscriptions } from './AvailableSubscriptions'
export type GetAvailableSubscriptionsResponse = MinimalHttpResponse & {
data?: AvailableSubscriptions
}

View File

@@ -0,0 +1,8 @@
import { FeatureDescription } from '@standardnotes/features'
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
export type GetOfflineFeaturesResponse = MinimalHttpResponse & {
data?: {
features: FeatureDescription[]
}
}

View File

@@ -0,0 +1,9 @@
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
import { SettingData } from './SettingData'
export type GetSettingResponse = MinimalHttpResponse & {
data?: {
success?: boolean
setting?: SettingData
}
}

View File

@@ -0,0 +1,8 @@
import { Subscription } from '@standardnotes/security'
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
export type GetSubscriptionResponse = MinimalHttpResponse & {
data?: {
subscription?: Subscription
}
}

View File

@@ -0,0 +1,8 @@
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
import { SettingData } from './SettingData'
export type ListSettingsResponse = MinimalHttpResponse & {
data?: {
settings?: SettingData[]
}
}

View File

@@ -0,0 +1,7 @@
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
export type PostSubscriptionTokensResponse = MinimalHttpResponse & {
data?: {
token: string
}
}

View File

@@ -0,0 +1,6 @@
export type SettingData = {
uuid: string
name: string
value: string
sensitive?: boolean
}

View File

@@ -0,0 +1,3 @@
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
export type UpdateSettingResponse = MinimalHttpResponse

View File

@@ -0,0 +1,5 @@
import { FeatureDescription } from '@standardnotes/features'
export type UserFeaturesData = {
features: FeatureDescription[]
}

View File

@@ -0,0 +1,6 @@
import { HttpResponse } from '../Http/HttpResponse'
import { UserFeaturesData } from './UserFeaturesData'
export type UserFeaturesResponse = HttpResponse & {
data: UserFeaturesData
}