Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Latest commit

 

History

History
491 lines (278 loc) · 12.1 KB

File metadata and controls

491 lines (278 loc) · 12.1 KB

QIWI SDK / Modules / apis/shared

Module: apis/shared

Table of contents

References

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

References

URL

Re-exports URL


URLSearchParameters

Re-exports URLSearchParameters

Type Aliases

AnyParameters

Ƭ AnyParameters: any[]

Defined in

apis/shared/types.ts:5


AnyRecord

Ƭ AnyRecord: ReadonlyRecord<string, unknown>

Defined in

apis/shared/types.ts:4


Collection

Ƭ Collection<T>: Iterable<T> | ArrayLike<T>

Type parameters

Name
T

Defined in

apis/shared/types.ts:1


Headers

Ƭ Headers: ReadonlyRecord<string, string>

Defined in

apis/shared/http.types.ts:4


HmacOptions

Ƭ HmacOptions: Object

Type declaration

Name Type
algorithm? string
data BinaryAlike
digest BinaryAlike
key BinaryAlike

Defined in

apis/shared/hmac.ts:4


ObjectKey

Ƭ ObjectKey: string | number

Defined in

apis/shared/types.ts:2


ReadonlyRecord

Ƭ ReadonlyRecord<K, V>: Readonly<Record<K, V>>

Type parameters

Name Type
K extends ObjectKey
V V

Defined in

apis/shared/types.ts:3


TimeSpanKeys

Ƭ TimeSpanKeys: keyof TimeSpanMapping

Defined in

apis/shared/time.ts:78


TimeSpanMapping

Ƭ TimeSpanMapping: typeof TimeSpanMapping

Defined in

apis/shared/time.ts:53

apis/shared/time.ts:77


URLResult

Ƭ URLResult: (queryParameters?: AnyRecord) => string

Type declaration

▸ (queryParameters?): string

Parameters
Name Type
queryParameters? AnyRecord
Returns

string

Defined in

apis/shared/url.ts:4

Variables

TimeSpanMapping

Const TimeSpanMapping: Readonly<{ d: TimeSpan = TimeSpan.Day; day: TimeSpan = TimeSpan.Day; h: TimeSpan = TimeSpan.Hour; hour: TimeSpan = TimeSpan.Hour; hr: TimeSpan = TimeSpan.Hour; m: TimeSpan = TimeSpan.Minute; millisecond: TimeSpan = TimeSpan.Millisecond; min: TimeSpan = TimeSpan.Minute; minute: TimeSpan = TimeSpan.Minute; mn: TimeSpan = TimeSpan.Month; mon: TimeSpan = TimeSpan.Month; month: TimeSpan = TimeSpan.Month; ms: TimeSpan = TimeSpan.Millisecond; msec: TimeSpan = TimeSpan.Millisecond; s: TimeSpan = TimeSpan.Second; sec: TimeSpan = TimeSpan.Second; second: TimeSpan = TimeSpan.Second; w: TimeSpan = TimeSpan.Week; week: TimeSpan = TimeSpan.Week; y: TimeSpan = TimeSpan.Year; year: TimeSpan = TimeSpan.Year; yr: TimeSpan = TimeSpan.Year }>

Defined in

apis/shared/time.ts:53

apis/shared/time.ts:77


USER_AGENT

Const USER_AGENT: string

Defined in

apis/shared/identity.ts:1


environment

Const environment: Readonly<Record<"QIWI_TOKEN" | "QIWI_WALLET" | "QIWI_SECRET_KEY" | "QIWI_PUBLIC_KEY", string>>

Defined in

apis/shared/environment.ts:32

Functions

collect

collect<T>(collection): T[]

Export

Type parameters

Name
T

Parameters

Name Type
collection Collection<T>

Returns

T[]

Defined in

apis/shared/collect.ts:11


compareHmac

compareHmac(options): boolean

Export

Parameters

Name Type
options HmacOptions

Returns

boolean

Defined in

apis/shared/hmac.ts:18


compareQiwiHmac

compareQiwiHmac(key, digest, data): boolean

Export

Parameters

Name Type
key BinaryAlike
digest BinaryAlike
data string[]

Returns

boolean

boolean

Defined in

apis/shared/hmac.ts:43


formatAltLifetimeDate

formatAltLifetimeDate(dateTime): string

Используется только для параметра lifetime при создании ссылки на форму оплаты

Форматирует дату в понятную для QIWI строку:

ГГГГ-ММ-ДДTччмм

Export

Parameters

Name Type
dateTime DateValue

Returns

string

string

Defined in

apis/shared/time.ts:31


formatDate

formatDate(dateTime): string

Форматирует дату в понятную для QIWI строку:

ГГГГ-ММ-ДДTЧЧ:ММ:СС+\-ЧЧ:ММ

Parameters

Name Type Description
dateTime DateValue Аргумент для конструктора

Returns

string

Defined in

apis/shared/time.ts:13


formatOffsetAltLifetimeDate

formatOffsetAltLifetimeDate(amount, unit?, currentDate?): string

Export

Parameters

Name Type Default value
amount number undefined
unit TimeUnit TimeSpan.Millisecond
currentDate? Date undefined

Returns

string

string

Defined in

apis/shared/time.ts:133


formatOffsetDate

formatOffsetDate(amount, unit?, currentDate?): string

Используется только для параметра lifetime при создании ссылки на форму оплаты

Форматирует дату в понятную для QIWI строку:

ГГГГ-ММ-ДДTччмм

Export

Parameters

Name Type Default value
amount number undefined
unit TimeUnit TimeSpan.Millisecond
currentDate? Date undefined

Returns

string

string

Defined in

apis/shared/time.ts:116


formatQuerystring

formatQuerystring(object): string

Создаёт строку запроса, в формате, который понимает QIWI

Parameters

Name Type Description
object Readonly<Record<string, unknown>> Объект для преобразования

Returns

string

Defined in

apis/shared/querystring.ts:27


generateUUID

generateUUID(): string

Генерирует UUID

Export

Returns

string

Defined in

apis/shared/uuid.ts:9


url

url(parts, ...insertions): URLResult

Export

Parameters

Name Type
parts TemplateStringsArray
...insertions unknown[]

Returns

URLResult

Defined in

apis/shared/url.ts:14