diff --git a/api.ts b/api.ts index a092085..c89dc8d 100644 --- a/api.ts +++ b/api.ts @@ -57,6 +57,10 @@ export * from './api/other/internalError/response'; export * from './api/other/lang'; export * from './api/other/unit'; +export * from './api/user/subscription/key'; +export * from './api/user/subscription/update/payload'; +export * from './api/user/subscription/update/response'; + export * from './api/endpoints'; export * from './api/responseCode'; export * from './api/utils'; diff --git a/api/endpoints.ts b/api/endpoints.ts index 62eb6be..7a7c81d 100644 --- a/api/endpoints.ts +++ b/api/endpoints.ts @@ -46,6 +46,8 @@ export enum ApiEndPoints { PRESET_ATK_SKILL_INPUT = '/preset/atk-skill', + USER_SUBSCRIPTIONS = '/user/subscriptions', + // These shouldn't be used in any cases besides CI NOT_EXISTS = '/404', ERROR_TEST = '/500', diff --git a/api/user/subscription/key.ts b/api/user/subscription/key.ts new file mode 100644 index 0000000..d7fb5ae --- /dev/null +++ b/api/user/subscription/key.ts @@ -0,0 +1,22 @@ +import {PostType} from '../../post/types'; + + +export type SubscriptionKeyConstName = + 'ALL_QUEST' | + 'ALL_ANALYSIS' | + 'ALL_MISC' | + 'ALL_TIER' | + 'SITE_FEATURE'; + +export type SubscriptionKeyConst = { + type: 'const', + name: SubscriptionKeyConstName, +}; + +export type SubscriptionKeyPost = { + type: 'post', + postType: PostType, + id: number, +}; + +export type SubscriptionKey = SubscriptionKeyConst | SubscriptionKeyPost; diff --git a/api/user/subscription/update/payload.ts b/api/user/subscription/update/payload.ts new file mode 100644 index 0000000..ad62bb1 --- /dev/null +++ b/api/user/subscription/update/payload.ts @@ -0,0 +1,6 @@ +import {RequestPayloadBase} from '../../../base/payload'; + + +export type SubscriptionUpdatePayload = RequestPayloadBase & { + subKeysBase64: string, +}; diff --git a/api/user/subscription/update/response.ts b/api/user/subscription/update/response.ts new file mode 100644 index 0000000..f62bf14 --- /dev/null +++ b/api/user/subscription/update/response.ts @@ -0,0 +1,4 @@ +import {BaseResponse} from '../../../base/response'; + + +export type SubscriptionUpdateResponse = BaseResponse;