feat: add responses package
This commit is contained in:
13
packages/responses/src/Domain/User/AvailableSubscriptions.ts
Normal file
13
packages/responses/src/Domain/User/AvailableSubscriptions.ts
Normal 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[]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type DeleteSettingResponse = MinimalHttpResponse
|
||||
@@ -0,0 +1,6 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
import { AvailableSubscriptions } from './AvailableSubscriptions'
|
||||
|
||||
export type GetAvailableSubscriptionsResponse = MinimalHttpResponse & {
|
||||
data?: AvailableSubscriptions
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { FeatureDescription } from '@standardnotes/features'
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type GetOfflineFeaturesResponse = MinimalHttpResponse & {
|
||||
data?: {
|
||||
features: FeatureDescription[]
|
||||
}
|
||||
}
|
||||
9
packages/responses/src/Domain/User/GetSettingResponse.ts
Normal file
9
packages/responses/src/Domain/User/GetSettingResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
import { SettingData } from './SettingData'
|
||||
|
||||
export type GetSettingResponse = MinimalHttpResponse & {
|
||||
data?: {
|
||||
success?: boolean
|
||||
setting?: SettingData
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Subscription } from '@standardnotes/security'
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type GetSubscriptionResponse = MinimalHttpResponse & {
|
||||
data?: {
|
||||
subscription?: Subscription
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
import { SettingData } from './SettingData'
|
||||
|
||||
export type ListSettingsResponse = MinimalHttpResponse & {
|
||||
data?: {
|
||||
settings?: SettingData[]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type PostSubscriptionTokensResponse = MinimalHttpResponse & {
|
||||
data?: {
|
||||
token: string
|
||||
}
|
||||
}
|
||||
6
packages/responses/src/Domain/User/SettingData.ts
Normal file
6
packages/responses/src/Domain/User/SettingData.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type SettingData = {
|
||||
uuid: string
|
||||
name: string
|
||||
value: string
|
||||
sensitive?: boolean
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||
|
||||
export type UpdateSettingResponse = MinimalHttpResponse
|
||||
5
packages/responses/src/Domain/User/UserFeaturesData.ts
Normal file
5
packages/responses/src/Domain/User/UserFeaturesData.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { FeatureDescription } from '@standardnotes/features'
|
||||
|
||||
export type UserFeaturesData = {
|
||||
features: FeatureDescription[]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { HttpResponse } from '../Http/HttpResponse'
|
||||
import { UserFeaturesData } from './UserFeaturesData'
|
||||
|
||||
export type UserFeaturesResponse = HttpResponse & {
|
||||
data: UserFeaturesData
|
||||
}
|
||||
Reference in New Issue
Block a user