@pax2pay/client 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client/Accounts/index.ts +0 -5
- package/Client/CardTypes/index.ts +25 -2
- package/Client/Cards/index.ts +0 -178
- package/Client/Merchants/index.ts +2 -1
- package/dist/Client/Accounts/index.d.ts +0 -3
- package/dist/Client/Accounts/index.js +0 -3
- package/dist/Client/Accounts/index.js.map +1 -1
- package/dist/Client/CardTypes/index.d.ts +4 -2
- package/dist/Client/CardTypes/index.js +12 -2
- package/dist/Client/CardTypes/index.js.map +1 -1
- package/dist/Client/Cards/index.d.ts +0 -39
- package/dist/Client/Cards/index.js +0 -76
- package/dist/Client/Cards/index.js.map +1 -1
- package/dist/Client/Merchants/index.d.ts +1 -1
- package/dist/Client/Merchants/index.js +2 -1
- package/dist/Client/Merchants/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/model/OmnisetupResponse.d.ts +2 -2
- package/dist/model/index.d.ts +1 -6
- package/dist/model/index.js +1 -3
- package/dist/model/index.js.map +1 -1
- package/index.ts +0 -10
- package/model/OmnisetupResponse.ts +2 -2
- package/model/index.ts +0 -10
- package/package.json +1 -1
- package/dist/model/CardTypeProfileResponse.d.ts +0 -16
- package/dist/model/CardTypeProfileResponse.js +0 -18
- package/dist/model/CardTypeProfileResponse.js.map +0 -1
- package/dist/model/CardTypeProfileStatus.d.ts +0 -7
- package/dist/model/CardTypeProfileStatus.js +0 -8
- package/dist/model/CardTypeProfileStatus.js.map +0 -1
- package/dist/model/CreateCardTypeProfileRequest.d.ts +0 -13
- package/dist/model/CreateCardTypeProfileRequest.js +0 -2
- package/dist/model/CreateCardTypeProfileRequest.js.map +0 -1
- package/dist/model/OrganisationCardTypeProfileResponse.d.ts +0 -9
- package/dist/model/OrganisationCardTypeProfileResponse.js +0 -11
- package/dist/model/OrganisationCardTypeProfileResponse.js.map +0 -1
- package/dist/model/SearchCardTypeProfileRequest.d.ts +0 -15
- package/dist/model/SearchCardTypeProfileRequest.js +0 -2
- package/dist/model/SearchCardTypeProfileRequest.js.map +0 -1
- package/dist/model/UpdateCardTypeProfileRequest.d.ts +0 -12
- package/dist/model/UpdateCardTypeProfileRequest.js +0 -2
- package/dist/model/UpdateCardTypeProfileRequest.js.map +0 -1
- package/model/CardTypeProfileResponse.ts +0 -26
- package/model/CreateCardTypeProfileRequest.ts +0 -14
- package/model/OrganisationCardTypeProfileResponse.ts +0 -14
- package/model/SearchCardTypeProfileRequest.ts +0 -16
- package/model/UpdateCardTypeProfileRequest.ts +0 -13
package/Client/Accounts/index.ts
CHANGED
|
@@ -32,11 +32,6 @@ export class Accounts extends List<model.AccountResponse> {
|
|
|
32
32
|
request
|
|
33
33
|
)
|
|
34
34
|
}
|
|
35
|
-
async cancelLimitAlert(providerCode: model.ProviderCode, providerAccountId: string) {
|
|
36
|
-
return await this.connection.remove<Promise<model.ErrorResponse | model.AccountResponse>>(
|
|
37
|
-
`${this.folder}/${providerCode}/${providerAccountId}/limits`
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
35
|
|
|
41
36
|
async getAllFundingAccountsV2(
|
|
42
37
|
providerCode: model.ProviderCode[],
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
import * as model from "../../model"
|
|
2
2
|
import { Connection } from "../Connection"
|
|
3
|
+
import { List } from "../List"
|
|
3
4
|
|
|
4
|
-
export class CardTypes {
|
|
5
|
+
export class CardTypes extends List<model.CardTypeResponse> {
|
|
5
6
|
protected readonly folder = "cards/types"
|
|
6
|
-
constructor(
|
|
7
|
+
constructor(connection: Connection) {
|
|
8
|
+
super(connection)
|
|
9
|
+
}
|
|
7
10
|
|
|
8
11
|
static create(connection: Connection): CardTypes {
|
|
9
12
|
return new CardTypes(connection)
|
|
10
13
|
}
|
|
11
14
|
|
|
15
|
+
async get(
|
|
16
|
+
providerCode?: model.ProviderCode,
|
|
17
|
+
assumedOrg?: string
|
|
18
|
+
): Promise<model.ErrorResponse | model.CardTypeResponse[]> {
|
|
19
|
+
const header = assumedOrg ? { "x-assume": assumedOrg } : undefined
|
|
20
|
+
const response = await this.connection.get<{ list: model.CardTypeResponse[]; totalCount: number }>(
|
|
21
|
+
`v2/${this.folder}${providerCode ? `/${providerCode}` : ""}`,
|
|
22
|
+
undefined,
|
|
23
|
+
header
|
|
24
|
+
)
|
|
25
|
+
return this.extractResponse<model.CardTypeResponse>(response)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async getAll(providerCode: model.ProviderCode) {
|
|
29
|
+
const response = await this.connection.get<{ list: model.CardTypeResponse[]; totalCount: number }>(
|
|
30
|
+
`v2/${this.folder}/${providerCode}/all`
|
|
31
|
+
)
|
|
32
|
+
return this.extractResponse<model.CardTypeResponse>(response)
|
|
33
|
+
}
|
|
34
|
+
|
|
12
35
|
async getAvailable(
|
|
13
36
|
availabilityType?: model.CardTypeRequestAvailabilityType,
|
|
14
37
|
name?: string,
|
package/Client/Cards/index.ts
CHANGED
|
@@ -25,38 +25,7 @@ export class Cards extends List<model.CardResponseV2> {
|
|
|
25
25
|
static create(connection: Connection): Cards {
|
|
26
26
|
return new Cards(connection)
|
|
27
27
|
}
|
|
28
|
-
async getAllCardsPaginated(
|
|
29
|
-
previous?: Paginated<model.CardResponseV2>,
|
|
30
|
-
page?: number,
|
|
31
|
-
size?: number,
|
|
32
|
-
sort = "account.id,desc",
|
|
33
|
-
providerCode = "modulr",
|
|
34
|
-
includeCount = true
|
|
35
|
-
): Promise<model.ErrorResponse | Paginated<model.CardResponseV2>> {
|
|
36
|
-
return await this.getNextPaginated<model.CardResponseV2>(
|
|
37
|
-
previous,
|
|
38
|
-
(page, size, sort) =>
|
|
39
|
-
this.connection.get<{ list: model.CardResponseV2[]; totalCount: number } | model.CardResponseV2[]>(
|
|
40
|
-
`v2/${this.folder}`,
|
|
41
|
-
{
|
|
42
|
-
page: page,
|
|
43
|
-
size: size,
|
|
44
|
-
sort: sort,
|
|
45
|
-
provider: providerCode,
|
|
46
|
-
includeCount: includeCount,
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
undefined,
|
|
50
|
-
page,
|
|
51
|
-
size,
|
|
52
|
-
sort
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
28
|
|
|
56
|
-
async getCardV2(providerCardId: string, providerCode: model.ProviderCode) {
|
|
57
|
-
return await this.connection.get<model.CardResponseV2>(`v2/${this.folder}/virtual/${providerCode}/${providerCardId}
|
|
58
|
-
`)
|
|
59
|
-
}
|
|
60
29
|
async cancelCardV2(providerCardId: string, providerCode: model.ProviderCode) {
|
|
61
30
|
return await this.connection.remove<model.CardResponseV2>(
|
|
62
31
|
`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/cancel`
|
|
@@ -94,112 +63,6 @@ export class Cards extends List<model.CardResponseV2> {
|
|
|
94
63
|
`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/reverse/${transactionId}`
|
|
95
64
|
)
|
|
96
65
|
}
|
|
97
|
-
// TODO: move CardTypes to its own class
|
|
98
|
-
async getCardTypesV2(
|
|
99
|
-
providerCode?: model.ProviderCode,
|
|
100
|
-
assumedOrg?: string
|
|
101
|
-
): Promise<model.ErrorResponse | model.CardTypeResponse[]> {
|
|
102
|
-
const header = assumedOrg ? { "x-assume": assumedOrg } : undefined
|
|
103
|
-
const response = await this.connection.get<{ list: model.CardTypeResponse[]; totalCount: number }>(
|
|
104
|
-
`v2/${this.folder}/types${providerCode ? `/${providerCode}` : ""}`,
|
|
105
|
-
undefined,
|
|
106
|
-
header
|
|
107
|
-
)
|
|
108
|
-
return this.extractResponse<model.CardTypeResponse>(response)
|
|
109
|
-
}
|
|
110
|
-
async getAllCardTypesV2(providerCode: model.ProviderCode) {
|
|
111
|
-
const response = await this.connection.get<{ list: model.CardTypeResponse[]; totalCount: number }>(
|
|
112
|
-
`v2/${this.folder}/types/${providerCode}/all`
|
|
113
|
-
)
|
|
114
|
-
return this.extractResponse<model.CardTypeResponse>(response)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// TODO: Deprecate
|
|
118
|
-
async createCardTypeProfileV2(cardTypeProfileRequest: model.CreateCardTypeProfileRequest, organisationCode?: string) {
|
|
119
|
-
const header = organisationCode ? { "x-assume": organisationCode } : undefined
|
|
120
|
-
const response = await this.connection.post<model.CardTypeProfileResponse>(
|
|
121
|
-
`v2/${this.folder}/types/profiles`,
|
|
122
|
-
cardTypeProfileRequest,
|
|
123
|
-
undefined,
|
|
124
|
-
header
|
|
125
|
-
)
|
|
126
|
-
return response
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// TODO: Deprecate
|
|
130
|
-
async updateCardTypeProfileV2(
|
|
131
|
-
cardTypeProfileId: string,
|
|
132
|
-
cardTypeProfileRequest: model.UpdateCardTypeProfileRequest,
|
|
133
|
-
organisationCode?: string
|
|
134
|
-
) {
|
|
135
|
-
const header = organisationCode ? { "x-assume": organisationCode } : undefined
|
|
136
|
-
const response = await this.connection.put<model.CardTypeProfileResponse>(
|
|
137
|
-
`v2/${this.folder}/types/profiles/${cardTypeProfileId}`,
|
|
138
|
-
cardTypeProfileRequest,
|
|
139
|
-
undefined,
|
|
140
|
-
header
|
|
141
|
-
)
|
|
142
|
-
return response
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// TODO: Deprecate
|
|
146
|
-
async getActiveCardTypeProfileV2(organisationCode: string) {
|
|
147
|
-
const header = { "x-assume": organisationCode }
|
|
148
|
-
return await this.connection.get<model.OrganisationCardTypeProfileResponse>(
|
|
149
|
-
`v2/${this.folder}/types/profiles/current`,
|
|
150
|
-
undefined,
|
|
151
|
-
header
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// TODO: Deprecate
|
|
156
|
-
async searchCardTypeProfileV2(request: model.SearchCardTypeProfileRequest, organisationCode?: string) {
|
|
157
|
-
const header = organisationCode ? { "x-assume": organisationCode } : undefined
|
|
158
|
-
return await this.connection.post<model.CardTypeProfileResponse[]>(
|
|
159
|
-
`v2/cards/types/profiles/searches`,
|
|
160
|
-
request,
|
|
161
|
-
undefined,
|
|
162
|
-
header
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// TODO: Deprecate
|
|
167
|
-
async setCardTypeProfileV2(organisationCode: string, cardTypeProfileId: string) {
|
|
168
|
-
const header = { "x-assume": organisationCode }
|
|
169
|
-
return await this.connection.post<model.OrganisationCardTypeProfileResponse>(
|
|
170
|
-
`v2/${this.folder}/types/profiles/current/${cardTypeProfileId}`,
|
|
171
|
-
undefined,
|
|
172
|
-
undefined,
|
|
173
|
-
header
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// TODO: Deprecate
|
|
178
|
-
async assignCardTypeProfileV2(organisationCode: string, cardTypeProfileId: string) {
|
|
179
|
-
const header = { "x-assume": organisationCode }
|
|
180
|
-
return await this.connection.put<model.OrganisationCardTypeProfileResponse>(
|
|
181
|
-
`v2/${this.folder}/types/profiles/current/${cardTypeProfileId}`,
|
|
182
|
-
undefined,
|
|
183
|
-
undefined,
|
|
184
|
-
header
|
|
185
|
-
)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// TODO: Deprecate
|
|
189
|
-
async unassignCardTypeProfileV2(organisationCode: string, cardTypeProfileId: string) {
|
|
190
|
-
const header = { "x-assume": organisationCode }
|
|
191
|
-
return await this.connection.remove<model.OrganisationCardTypeProfileResponse>(
|
|
192
|
-
`v2/${this.folder}/types/profiles/current/${cardTypeProfileId}`,
|
|
193
|
-
undefined,
|
|
194
|
-
undefined,
|
|
195
|
-
header
|
|
196
|
-
)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// TODO move to CardTypes class
|
|
200
|
-
async getCardTypes(providerCode: model.ProviderCode) {
|
|
201
|
-
return await this.connection.get<model.CardTypesResponse>(`${this.folder}/types/${providerCode}`)
|
|
202
|
-
}
|
|
203
66
|
|
|
204
67
|
async searchCardsV2(
|
|
205
68
|
searchRequest: model.CardSearch,
|
|
@@ -239,33 +102,6 @@ export class Cards extends List<model.CardResponseV2> {
|
|
|
239
102
|
sort
|
|
240
103
|
)
|
|
241
104
|
}
|
|
242
|
-
// "Deprecated". This was added to the Accounts class so it can be removed from this when switched over wherever it's used
|
|
243
|
-
async getFundingAccounts(
|
|
244
|
-
searchRequest: model.FundingAccountSearchRequest
|
|
245
|
-
): Promise<model.ErrorResponse | model.AccountResponse[]> {
|
|
246
|
-
const response = await this.connection.post<{ list: model.AccountResponse[]; totalCount: number }>(
|
|
247
|
-
"funding-accounts/searches",
|
|
248
|
-
searchRequest
|
|
249
|
-
)
|
|
250
|
-
return this.extractResponse<model.AccountResponse>(response)
|
|
251
|
-
}
|
|
252
|
-
// "Deprecated". This was added to the Accounts class so it can be removed from this when switched over wherever it's used
|
|
253
|
-
async getAllFundingAccounts(
|
|
254
|
-
providerCode: model.ProviderCode,
|
|
255
|
-
size = 500,
|
|
256
|
-
sort = "friendlyName"
|
|
257
|
-
): Promise<model.ErrorResponse | model.AccountResponse[]> {
|
|
258
|
-
const response = await this.connection.get<{ list: model.AccountResponse[]; totalCount: number }>(
|
|
259
|
-
`funding-accounts`,
|
|
260
|
-
{ provider: providerCode, size: size, sort: sort }
|
|
261
|
-
)
|
|
262
|
-
return this.extractResponse<model.AccountResponse>(response)
|
|
263
|
-
}
|
|
264
|
-
//Possibly should be moved to its own class
|
|
265
|
-
async getCardBookingInfo(providerCardId: string, providerCode: model.ProviderCode) {
|
|
266
|
-
return await this.connection.get<model.MetadataResponse>(`booking-info/cards/${providerCode}/${providerCardId}
|
|
267
|
-
`)
|
|
268
|
-
}
|
|
269
105
|
//Possibly should be moved to its own class
|
|
270
106
|
async editCardBookingInfo(providerCardId: string, providerCode: model.ProviderCode, request: Record<string, any>) {
|
|
271
107
|
return await this.connection.put<model.MetadataResponse>(
|
|
@@ -302,16 +138,6 @@ export class Cards extends List<model.CardResponseV2> {
|
|
|
302
138
|
)
|
|
303
139
|
return this.extractResponse<model.CardTransaction>(response)
|
|
304
140
|
}
|
|
305
|
-
//Possibly should be moved to its own class
|
|
306
|
-
async searchTransaction(accountId: number): Promise<model.ErrorResponse | model.CardTransaction[]> {
|
|
307
|
-
const response = await this.connection.post<{ list: model.CardTransaction[]; totalCount: number }>(
|
|
308
|
-
`transactions/searches`,
|
|
309
|
-
{
|
|
310
|
-
accountId: accountId,
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
return this.extractResponse<model.CardTransaction>(response)
|
|
314
|
-
}
|
|
315
141
|
async editSchedule(providerCardId: string, providerCode: model.ProviderCode, request: model.ScheduleEntry[]) {
|
|
316
142
|
return await this.connection.put<model.CardResponseV2>(
|
|
317
143
|
`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/schedule`,
|
|
@@ -326,8 +152,4 @@ export class Cards extends List<model.CardResponseV2> {
|
|
|
326
152
|
request
|
|
327
153
|
)
|
|
328
154
|
}
|
|
329
|
-
// TODO move to CardTypes class
|
|
330
|
-
async getDisplayableCardTypesForProvider(provider: model.ProviderCode = "modulr") {
|
|
331
|
-
return await this.connection.get<Record<string, string>>(`v2/${this.folder}/types/displayable/${provider}`)
|
|
332
|
-
}
|
|
333
155
|
}
|
|
@@ -57,13 +57,14 @@ export class Merchants extends List<model.MerchantResponse> {
|
|
|
57
57
|
sort
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
|
-
async getAll(organisationCode?: string) {
|
|
60
|
+
async getAll(organisationCode?: string, sort = "name") {
|
|
61
61
|
const header = organisationCode ? { "x-assume": organisationCode } : undefined
|
|
62
62
|
const response = await this.connection.get<model.ErrorResponse | model.MerchantResponse[]>(
|
|
63
63
|
this.folder,
|
|
64
64
|
{
|
|
65
65
|
page: 0,
|
|
66
66
|
size: 5000,
|
|
67
|
+
sort,
|
|
67
68
|
},
|
|
68
69
|
header
|
|
69
70
|
)
|
|
@@ -14,9 +14,6 @@ export declare class Accounts extends List<model.AccountResponse> {
|
|
|
14
14
|
updateFundingAccount(providerCode: model.ProviderCode, providerAccountId: string, request: model.UpdateAccountRequest): Promise<model.AccountResponse | model.ErrorResponse | (model.ErrorResponse & {
|
|
15
15
|
status: 400 | 404 | 500 | 403 | 503;
|
|
16
16
|
})>;
|
|
17
|
-
cancelLimitAlert(providerCode: model.ProviderCode, providerAccountId: string): Promise<model.AccountResponse | model.ErrorResponse | (model.ErrorResponse & {
|
|
18
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
19
|
-
})>;
|
|
20
17
|
getAllFundingAccountsV2(providerCode: model.ProviderCode[], size?: number, sort?: string, organisationCode?: string): Promise<model.ErrorResponse | model.FundingAccountResponseV2Basic[]>;
|
|
21
18
|
getAllFundingAccountsV2Full(providerCode: model.ProviderCode[], size?: number, sort?: string): Promise<model.ErrorResponse | model.FundingAccountResponseV2Full[]>;
|
|
22
19
|
getFundingAccountV2(providerCode: model.ProviderCode, providerAccountId: string): Promise<model.FundingAccountResponseV2Basic | (model.ErrorResponse & {
|
|
@@ -16,9 +16,6 @@ export class Accounts extends List {
|
|
|
16
16
|
async updateFundingAccount(providerCode, providerAccountId, request) {
|
|
17
17
|
return await this.connection.put(`${this.folder}/${providerCode}/${providerAccountId}`, request);
|
|
18
18
|
}
|
|
19
|
-
async cancelLimitAlert(providerCode, providerAccountId) {
|
|
20
|
-
return await this.connection.remove(`${this.folder}/${providerCode}/${providerAccountId}/limits`);
|
|
21
|
-
}
|
|
22
19
|
async getAllFundingAccountsV2(providerCode, size = 500, sort = "friendlyName", organisationCode) {
|
|
23
20
|
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
24
21
|
const response = await this.connection.get(`v2/${this.folder}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,MAAM,OAAO,QAAS,SA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ACD,KAAK,CAAC,mBAAmB,CAAC,YAAgC,EAAE,iBAAyB;QACpF,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAC/B,MAAM,IAAI,CAAC,MAAM,IAAI,YAAY,IAAI,iBAAiB,EAAE,CACxD,CAAA;IACF,CAAC;IACD,KAAK,CAAC,uBAAuB,CAAC,YAAgC,EAAE,iBAAyB;QACxF,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAC/B,MAAM,IAAI,CAAC,MAAM,IAAI,YAAY,IAAI,iBAAiB,OAAO,CAC7D,CAAA;IACF,CAAC;IACD,KAAK,CAAC,kBAAkB,CACvB,aAAgD;QAEhD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAC1C,GAAG,IAAI,CAAC,MAAM,WAAW,EACzB,aAAa,CACb,CAAA;QACD,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;IACtC,CAAC;IACD,KAAK,CAAC,qBAAqB,CAC1B,YAAgC,EAChC,IAAI,GAAG,GAAG,EACV,IAAI,GAAG,cAAc;QAErB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAwD,IAAI,CAAC,MAAM,EAAE;YAC9G,QAAQ,EAAE,YAAY;YACtB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;SACV,CAAC,CAAA;QACF,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;IACtC,CAAC;CACD"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as model from "../../model";
|
|
2
2
|
import { Connection } from "../Connection";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { List } from "../List";
|
|
4
|
+
export declare class CardTypes extends List<model.CardTypeResponse> {
|
|
5
5
|
protected readonly folder = "cards/types";
|
|
6
6
|
constructor(connection: Connection);
|
|
7
7
|
static create(connection: Connection): CardTypes;
|
|
8
|
+
get(providerCode?: model.ProviderCode, assumedOrg?: string): Promise<model.ErrorResponse | model.CardTypeResponse[]>;
|
|
9
|
+
getAll(providerCode: model.ProviderCode): Promise<model.CardTypeResponse[] | model.ErrorResponse>;
|
|
8
10
|
getAvailable(availabilityType?: model.CardTypeRequestAvailabilityType, name?: string, organisationCode?: string): Promise<model.AvailableCardTypesResponse | (model.ErrorResponse & {
|
|
9
11
|
status: 400 | 404 | 500 | 403 | 503;
|
|
10
12
|
})>;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { List } from "../List";
|
|
2
|
+
export class CardTypes extends List {
|
|
2
3
|
constructor(connection) {
|
|
3
|
-
|
|
4
|
+
super(connection);
|
|
4
5
|
this.folder = "cards/types";
|
|
5
6
|
}
|
|
6
7
|
static create(connection) {
|
|
7
8
|
return new CardTypes(connection);
|
|
8
9
|
}
|
|
10
|
+
async get(providerCode, assumedOrg) {
|
|
11
|
+
const header = assumedOrg ? { "x-assume": assumedOrg } : undefined;
|
|
12
|
+
const response = await this.connection.get(`v2/${this.folder}${providerCode ? `/${providerCode}` : ""}`, undefined, header);
|
|
13
|
+
return this.extractResponse(response);
|
|
14
|
+
}
|
|
15
|
+
async getAll(providerCode) {
|
|
16
|
+
const response = await this.connection.get(`v2/${this.folder}/${providerCode}/all`);
|
|
17
|
+
return this.extractResponse(response);
|
|
18
|
+
}
|
|
9
19
|
async getAvailable(availabilityType, name, organisationCode) {
|
|
10
20
|
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
11
21
|
return await this.connection.get(`v2/${this.folder}/available/${availabilityType}${name ? `/${name}` : ""}`, undefined, header);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/CardTypes/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/CardTypes/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AA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AE,EAAE,EAC1E,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IAED,KAAK,CAAC,YAAY,CACjB,OAA2C,EAC3C,gBAAuD,EACvD,IAAa,EACb,gBAAyB;QAEzB,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QAC9E,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAChC,MAAM,IAAI,CAAC,MAAM,cAAc,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAC1E,OAAO,EACP,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IAED,KAAK,CAAC,eAAe,CACpB,gBAAuD,EACvD,IAAa,EACb,gBAAyB;QAEzB,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QAC9E,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,MAAM,cAAc,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAC1E,SAAS,EACT,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;CACD"}
|
|
@@ -12,10 +12,6 @@ export declare class Cards extends List<model.CardResponseV2> {
|
|
|
12
12
|
status: 400 | 404 | 500 | 403 | 503;
|
|
13
13
|
})>;
|
|
14
14
|
static create(connection: Connection): Cards;
|
|
15
|
-
getAllCardsPaginated(previous?: Paginated<model.CardResponseV2>, page?: number, size?: number, sort?: string, providerCode?: string, includeCount?: boolean): Promise<model.ErrorResponse | Paginated<model.CardResponseV2>>;
|
|
16
|
-
getCardV2(providerCardId: string, providerCode: model.ProviderCode): Promise<model.CardResponseV2 | (model.ErrorResponse & {
|
|
17
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
18
|
-
})>;
|
|
19
15
|
cancelCardV2(providerCardId: string, providerCode: model.ProviderCode): Promise<model.CardResponseV2 | (model.ErrorResponse & {
|
|
20
16
|
status: 400 | 404 | 500 | 403 | 503;
|
|
21
17
|
})>;
|
|
@@ -37,39 +33,8 @@ export declare class Cards extends List<model.CardResponseV2> {
|
|
|
37
33
|
reverseAuthorisationV2(providerCode: model.ProviderCode, providerCardId: string, transactionId: string): Promise<model.CardResponseV2 | (model.ErrorResponse & {
|
|
38
34
|
status: 400 | 404 | 500 | 403 | 503;
|
|
39
35
|
})>;
|
|
40
|
-
getCardTypesV2(providerCode?: model.ProviderCode, assumedOrg?: string): Promise<model.ErrorResponse | model.CardTypeResponse[]>;
|
|
41
|
-
getAllCardTypesV2(providerCode: model.ProviderCode): Promise<model.CardTypeResponse[] | model.ErrorResponse>;
|
|
42
|
-
createCardTypeProfileV2(cardTypeProfileRequest: model.CreateCardTypeProfileRequest, organisationCode?: string): Promise<model.CardTypeProfileResponse | (model.ErrorResponse & {
|
|
43
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
44
|
-
})>;
|
|
45
|
-
updateCardTypeProfileV2(cardTypeProfileId: string, cardTypeProfileRequest: model.UpdateCardTypeProfileRequest, organisationCode?: string): Promise<model.CardTypeProfileResponse | (model.ErrorResponse & {
|
|
46
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
47
|
-
})>;
|
|
48
|
-
getActiveCardTypeProfileV2(organisationCode: string): Promise<model.OrganisationCardTypeProfileResponse | (model.ErrorResponse & {
|
|
49
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
50
|
-
})>;
|
|
51
|
-
searchCardTypeProfileV2(request: model.SearchCardTypeProfileRequest, organisationCode?: string): Promise<model.CardTypeProfileResponse[] | (model.ErrorResponse & {
|
|
52
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
53
|
-
})>;
|
|
54
|
-
setCardTypeProfileV2(organisationCode: string, cardTypeProfileId: string): Promise<model.OrganisationCardTypeProfileResponse | (model.ErrorResponse & {
|
|
55
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
56
|
-
})>;
|
|
57
|
-
assignCardTypeProfileV2(organisationCode: string, cardTypeProfileId: string): Promise<model.OrganisationCardTypeProfileResponse | (model.ErrorResponse & {
|
|
58
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
59
|
-
})>;
|
|
60
|
-
unassignCardTypeProfileV2(organisationCode: string, cardTypeProfileId: string): Promise<model.OrganisationCardTypeProfileResponse | (model.ErrorResponse & {
|
|
61
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
62
|
-
})>;
|
|
63
|
-
getCardTypes(providerCode: model.ProviderCode): Promise<model.CardTypesResponse | (model.ErrorResponse & {
|
|
64
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
65
|
-
})>;
|
|
66
36
|
searchCardsV2(searchRequest: model.CardSearch, parameters?: Record<string, any>): Promise<model.ErrorResponse | model.CardResponseV2[]>;
|
|
67
37
|
searchCardsV2Paginated(request: model.CardSearch, previous?: Paginated<model.CardResponseV2>, page?: number, size?: number, sort?: string, includeCount?: boolean): Promise<model.ErrorResponse | Paginated<model.CardResponseV2>>;
|
|
68
|
-
getFundingAccounts(searchRequest: model.FundingAccountSearchRequest): Promise<model.ErrorResponse | model.AccountResponse[]>;
|
|
69
|
-
getAllFundingAccounts(providerCode: model.ProviderCode, size?: number, sort?: string): Promise<model.ErrorResponse | model.AccountResponse[]>;
|
|
70
|
-
getCardBookingInfo(providerCardId: string, providerCode: model.ProviderCode): Promise<model.MetadataResponse | (model.ErrorResponse & {
|
|
71
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
72
|
-
})>;
|
|
73
38
|
editCardBookingInfo(providerCardId: string, providerCode: model.ProviderCode, request: Record<string, any>): Promise<model.MetadataResponse | (model.ErrorResponse & {
|
|
74
39
|
status: 400 | 404 | 500 | 403 | 503;
|
|
75
40
|
})>;
|
|
@@ -81,14 +46,10 @@ export declare class Cards extends List<model.CardResponseV2> {
|
|
|
81
46
|
})>;
|
|
82
47
|
getCardStatements(providerCardId: string, providerCode: model.ProviderCode): Promise<model.ErrorResponse | model.CardStatement[]>;
|
|
83
48
|
getCardTransactions(providerCardId: string, providerCode: model.ProviderCode): Promise<model.ErrorResponse | model.CardTransaction[]>;
|
|
84
|
-
searchTransaction(accountId: number): Promise<model.ErrorResponse | model.CardTransaction[]>;
|
|
85
49
|
editSchedule(providerCardId: string, providerCode: model.ProviderCode, request: model.ScheduleEntry[]): Promise<model.CardResponseV2 | (model.ErrorResponse & {
|
|
86
50
|
status: 400 | 404 | 500 | 403 | 503;
|
|
87
51
|
})>;
|
|
88
52
|
amendExistingCardV2(providerCardId: string, providerCode: model.ProviderCode, request: model.AmendCardRequest): Promise<model.CardResponseV2 | (model.ErrorResponse & {
|
|
89
53
|
status: 400 | 404 | 500 | 403 | 503;
|
|
90
54
|
})>;
|
|
91
|
-
getDisplayableCardTypesForProvider(provider?: model.ProviderCode): Promise<Record<string, string> | (model.ErrorResponse & {
|
|
92
|
-
status: 400 | 404 | 500 | 403 | 503;
|
|
93
|
-
})>;
|
|
94
55
|
}
|
|
@@ -18,19 +18,6 @@ export class Cards extends List {
|
|
|
18
18
|
static create(connection) {
|
|
19
19
|
return new Cards(connection);
|
|
20
20
|
}
|
|
21
|
-
async getAllCardsPaginated(previous, page, size, sort = "account.id,desc", providerCode = "modulr", includeCount = true) {
|
|
22
|
-
return await this.getNextPaginated(previous, (page, size, sort) => this.connection.get(`v2/${this.folder}`, {
|
|
23
|
-
page: page,
|
|
24
|
-
size: size,
|
|
25
|
-
sort: sort,
|
|
26
|
-
provider: providerCode,
|
|
27
|
-
includeCount: includeCount,
|
|
28
|
-
}), undefined, page, size, sort);
|
|
29
|
-
}
|
|
30
|
-
async getCardV2(providerCardId, providerCode) {
|
|
31
|
-
return await this.connection.get(`v2/${this.folder}/virtual/${providerCode}/${providerCardId}
|
|
32
|
-
`);
|
|
33
|
-
}
|
|
34
21
|
async cancelCardV2(providerCardId, providerCode) {
|
|
35
22
|
return await this.connection.remove(`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/cancel`);
|
|
36
23
|
}
|
|
@@ -52,48 +39,6 @@ export class Cards extends List {
|
|
|
52
39
|
async reverseAuthorisationV2(providerCode, providerCardId, transactionId) {
|
|
53
40
|
return await this.connection.remove(`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/reverse/${transactionId}`);
|
|
54
41
|
}
|
|
55
|
-
async getCardTypesV2(providerCode, assumedOrg) {
|
|
56
|
-
const header = assumedOrg ? { "x-assume": assumedOrg } : undefined;
|
|
57
|
-
const response = await this.connection.get(`v2/${this.folder}/types${providerCode ? `/${providerCode}` : ""}`, undefined, header);
|
|
58
|
-
return this.extractResponse(response);
|
|
59
|
-
}
|
|
60
|
-
async getAllCardTypesV2(providerCode) {
|
|
61
|
-
const response = await this.connection.get(`v2/${this.folder}/types/${providerCode}/all`);
|
|
62
|
-
return this.extractResponse(response);
|
|
63
|
-
}
|
|
64
|
-
async createCardTypeProfileV2(cardTypeProfileRequest, organisationCode) {
|
|
65
|
-
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
66
|
-
const response = await this.connection.post(`v2/${this.folder}/types/profiles`, cardTypeProfileRequest, undefined, header);
|
|
67
|
-
return response;
|
|
68
|
-
}
|
|
69
|
-
async updateCardTypeProfileV2(cardTypeProfileId, cardTypeProfileRequest, organisationCode) {
|
|
70
|
-
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
71
|
-
const response = await this.connection.put(`v2/${this.folder}/types/profiles/${cardTypeProfileId}`, cardTypeProfileRequest, undefined, header);
|
|
72
|
-
return response;
|
|
73
|
-
}
|
|
74
|
-
async getActiveCardTypeProfileV2(organisationCode) {
|
|
75
|
-
const header = { "x-assume": organisationCode };
|
|
76
|
-
return await this.connection.get(`v2/${this.folder}/types/profiles/current`, undefined, header);
|
|
77
|
-
}
|
|
78
|
-
async searchCardTypeProfileV2(request, organisationCode) {
|
|
79
|
-
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
80
|
-
return await this.connection.post(`v2/cards/types/profiles/searches`, request, undefined, header);
|
|
81
|
-
}
|
|
82
|
-
async setCardTypeProfileV2(organisationCode, cardTypeProfileId) {
|
|
83
|
-
const header = { "x-assume": organisationCode };
|
|
84
|
-
return await this.connection.post(`v2/${this.folder}/types/profiles/current/${cardTypeProfileId}`, undefined, undefined, header);
|
|
85
|
-
}
|
|
86
|
-
async assignCardTypeProfileV2(organisationCode, cardTypeProfileId) {
|
|
87
|
-
const header = { "x-assume": organisationCode };
|
|
88
|
-
return await this.connection.put(`v2/${this.folder}/types/profiles/current/${cardTypeProfileId}`, undefined, undefined, header);
|
|
89
|
-
}
|
|
90
|
-
async unassignCardTypeProfileV2(organisationCode, cardTypeProfileId) {
|
|
91
|
-
const header = { "x-assume": organisationCode };
|
|
92
|
-
return await this.connection.remove(`v2/${this.folder}/types/profiles/current/${cardTypeProfileId}`, undefined, undefined, header);
|
|
93
|
-
}
|
|
94
|
-
async getCardTypes(providerCode) {
|
|
95
|
-
return await this.connection.get(`${this.folder}/types/${providerCode}`);
|
|
96
|
-
}
|
|
97
42
|
async searchCardsV2(searchRequest, parameters) {
|
|
98
43
|
const response = await this.connection.post(`v2/${this.folder}/searches`, searchRequest, parameters);
|
|
99
44
|
return this.extractResponse(response);
|
|
@@ -106,18 +51,6 @@ export class Cards extends List {
|
|
|
106
51
|
includeCount: includeCount,
|
|
107
52
|
}), request, page, size, sort);
|
|
108
53
|
}
|
|
109
|
-
async getFundingAccounts(searchRequest) {
|
|
110
|
-
const response = await this.connection.post("funding-accounts/searches", searchRequest);
|
|
111
|
-
return this.extractResponse(response);
|
|
112
|
-
}
|
|
113
|
-
async getAllFundingAccounts(providerCode, size = 500, sort = "friendlyName") {
|
|
114
|
-
const response = await this.connection.get(`funding-accounts`, { provider: providerCode, size: size, sort: sort });
|
|
115
|
-
return this.extractResponse(response);
|
|
116
|
-
}
|
|
117
|
-
async getCardBookingInfo(providerCardId, providerCode) {
|
|
118
|
-
return await this.connection.get(`booking-info/cards/${providerCode}/${providerCardId}
|
|
119
|
-
`);
|
|
120
|
-
}
|
|
121
54
|
async editCardBookingInfo(providerCardId, providerCode, request) {
|
|
122
55
|
return await this.connection.put(`booking-info/cards/${providerCode}/${providerCardId}`, request);
|
|
123
56
|
}
|
|
@@ -135,12 +68,6 @@ export class Cards extends List {
|
|
|
135
68
|
const response = await this.connection.get(`${this.folder}/virtual/${providerCode}/${providerCardId}/transactions`);
|
|
136
69
|
return this.extractResponse(response);
|
|
137
70
|
}
|
|
138
|
-
async searchTransaction(accountId) {
|
|
139
|
-
const response = await this.connection.post(`transactions/searches`, {
|
|
140
|
-
accountId: accountId,
|
|
141
|
-
});
|
|
142
|
-
return this.extractResponse(response);
|
|
143
|
-
}
|
|
144
71
|
async editSchedule(providerCardId, providerCode, request) {
|
|
145
72
|
return await this.connection.put(`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/schedule`, {
|
|
146
73
|
schedule: request,
|
|
@@ -149,8 +76,5 @@ export class Cards extends List {
|
|
|
149
76
|
async amendExistingCardV2(providerCardId, providerCode, request) {
|
|
150
77
|
return await this.connection.put(`v2/${this.folder}/virtual/${providerCode}/${providerCardId}/amend`, request);
|
|
151
78
|
}
|
|
152
|
-
async getDisplayableCardTypesForProvider(provider = "modulr") {
|
|
153
|
-
return await this.connection.get(`v2/${this.folder}/types/displayable/${provider}`);
|
|
154
|
-
}
|
|
155
79
|
}
|
|
156
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Cards/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,MAAM,OAAO,KAAM,SAAQ,IAA0B;IAEpD,YAAY,UAAsB;QACjC,KAAK,CAAC,UAAU,CAAC,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G,IAAI,CAAC,MAAM,YAAY,YAAY,IAAI,cAAc,eAAe,CACvE,CAAA;QACD,OAAO,IAAI,CAAC,eAAe,CAAwB,QAAQ,CAAC,CAAA;IAC7D,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,cAAsB,EAAE,YAAgC,EAAE,OAA8B;QAC1G,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAC/B,MAAM,IAAI,CAAC,MAAM,YAAY,YAAY,IAAI,cAAc,WAAW,EACtE;YACC,QAAQ,EAAE,OAAO;SACjB,CACD,CAAA;IACF,CAAC;IACD,KAAK,CAAC,mBAAmB,CAAC,cAAsB,EAAE,YAAgC,EAAE,OAA+B;QAClH,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAC/B,MAAM,IAAI,CAAC,MAAM,YAAY,YAAY,IAAI,cAAc,QAAQ,EACnE,OAAO,CACP,CAAA;IACF,CAAC;CACD"}
|
|
@@ -20,5 +20,5 @@ export declare class Merchants extends List<model.MerchantResponse> {
|
|
|
20
20
|
status: 400 | 404 | 500 | 403 | 503;
|
|
21
21
|
})>;
|
|
22
22
|
searchPaginated(request: model.MerchantSearchRequest, previous?: Paginated<model.MerchantResponse>, page?: number, size?: number, sort?: string, organisationCode?: string): Promise<model.ErrorResponse | Paginated<model.MerchantResponse>>;
|
|
23
|
-
getAll(organisationCode?: string): Promise<model.ErrorResponse | model.MerchantResponse[]>;
|
|
23
|
+
getAll(organisationCode?: string, sort?: string): Promise<model.ErrorResponse | model.MerchantResponse[]>;
|
|
24
24
|
}
|
|
@@ -30,11 +30,12 @@ export class Merchants extends List {
|
|
|
30
30
|
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
31
31
|
return await this.getNextPaginated(previous, (page, size, sort, request) => this.connection.post(`${this.folder}/searches`, request, { page, size, sort }, header), request, page, size, sort);
|
|
32
32
|
}
|
|
33
|
-
async getAll(organisationCode) {
|
|
33
|
+
async getAll(organisationCode, sort = "name") {
|
|
34
34
|
const header = organisationCode ? { "x-assume": organisationCode } : undefined;
|
|
35
35
|
const response = await this.connection.get(this.folder, {
|
|
36
36
|
page: 0,
|
|
37
37
|
size: 5000,
|
|
38
|
+
sort,
|
|
38
39
|
}, header);
|
|
39
40
|
return this.extractResponse(response);
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Merchants/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,MAAM,OAAO,SAAU,SAAQ,IAA4B;IAE1D,YAAY,UAAsB;QACjC,KAAK,CAAC,UAAU,CAAC,CAAA;QAFC,WAAM,GAAG,WAAW,CAAA;IAGvC,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,SAAS,CAAC,UAAU,CAAC,CAAA;IACjC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA8B;QAC1C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAyB,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC9B,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAyB,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC,CAAA;IAC5F,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,OAAoC;QACpE,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAyB,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA;IAClG,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,YAAoB;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CACzC,GAAG,IAAI,CAAC,MAAM,aAAa,YAAY,EAAE,EACzC;YACC,IAAI,EAAE,CAAC;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