UNPKG

@vincentt-sdks/campaign-sdk

Version:

Campaign SDK by Vincentt

32 lines (31 loc) 3.05 kB
import { ApiKey, Auth, CreateUserParams, CreateUserResponse, CustomFetchParams, User, CreateEntryParams, Entry, FetchEntryParams, CreateFormEntryParams, UploadImageParams, UploadImageResponse, FormEntry, Coupon, DrawCouponParams, Session, ClaimCouponParams, UpdateUserParams, PrizeItem, FetchResponse, ClaimCouponByPrizeItemParams, UserJourneyLog, CreateUserJourneyLogParams, CreateSessionParams } from '../types'; export declare const createNewUser: ({ apiKey, ...params }: CreateUserParams & ApiKey) => Promise<CreateUserResponse>; export declare const refreshAuthToken: ({ refreshToken, apiKey, }: { refreshToken: string; apiKey: string; }) => Promise<Auth | null>; export declare const customFetch: ({ url, options, auth, apiKey, }: CustomFetchParams) => Promise<Response>; export declare const getCurrentUser: (accessToken: string, refreshToken: string, apiKey: string) => Promise<User | null>; export declare const updateUser: (accessToken: string, refreshToken: string, apiKey: string, params: UpdateUserParams) => Promise<User | null>; export declare const createNewEntry: (accessToken: string, refreshToken: string, apiKey: string, body: CreateEntryParams & { sessionId: string; }) => Promise<Entry | null>; export declare const updateEntry: (accessToken: string, refreshToken: string, apiKey: string, id: string, body: CreateEntryParams & { sessionId: string; }) => Promise<Entry | null>; export declare const getAllEntries: (accessToken: string, refreshToken: string, apiKey: string, query: FetchEntryParams) => Promise<Entry[] | null>; export declare const createNewFormEntry: (accessToken: string, refreshToken: string, apiKey: string, params: CreateFormEntryParams) => Promise<FormEntry | null>; export declare const uploadNewImage: (accessToken: string, refreshToken: string, apiKey: string, params: UploadImageParams) => Promise<UploadImageResponse | null>; export declare const drawNewCoupon: (accessToken: string, refreshToken: string, apiKey: string, body: DrawCouponParams) => Promise<Coupon | null>; export declare const fetchPrizeItemsByCampaign: (accessToken: string, refreshToken: string, apiKey: string, campaignId: string) => Promise<FetchResponse<Partial<PrizeItem>[]>>; export declare const createSession: (accessToken: string, refreshToken: string, apiKey: string, params?: CreateSessionParams) => Promise<Session>; export declare const getSession: (accessToken: string, refreshToken: string, apiKey: string, sessionId: string) => Promise<Session | null>; export declare const claimCoupon: (accessToken: string, refreshToken: string, apiKey: string, query: ClaimCouponParams & { sessionId: string; }) => Promise<{ success: boolean; }>; export declare const claimCouponByPrizeItem: (accessToken: string, refreshToken: string, apiKey: string, body: ClaimCouponByPrizeItemParams & { sessionId: string; }) => Promise<Coupon>; export declare const createUserJourneyLogService: (accessToken: string, refreshToken: string, apiKey: string, body: CreateUserJourneyLogParams) => Promise<UserJourneyLog>;