@pax2pay/client 0.10.21 → 0.10.22
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/.eslintrc +19 -13
- package/Client/Auth/Session/Item.ts +3 -2
- package/Client/Auth/Session/index.ts +1 -1
- package/Client/Cards/actions/pax2pay.spec.ignore.ts +4 -2
- package/Client/Cards/create/fake.spec.ignore.ts +7 -5
- package/Client/Cards/create/ixaris.spec.ignore.ts +4 -2
- package/Client/Cards/create/modulr.spec.ignore.ts +4 -2
- package/Client/Cards/create/pax2pay.spec.ignore.ts +7 -5
- package/Client/Cards/list.spec.ignore.ts +6 -3
- package/Client/Connection.ts +24 -11
- package/Client/Credentials/index.ts +3 -2
- package/Client/List.ts +3 -2
- package/Client/Organisations/list.spec.ignore.ts +2 -1
- package/Client/Reports/index.ts +2 -1
- package/Client/Transfers/index.ts +3 -2
- package/Client/Transfers/list.spec.ignore.ts +4 -2
- package/Client/Users/index.ts +4 -2
- package/Client/Users/list.spec.ignore.ts +6 -3
- package/Client/index.ts +4 -1
- package/dist/Client/Auth/Session/Item.js +4 -2
- package/dist/Client/Auth/Session/Item.js.map +1 -1
- package/dist/Client/Auth/Session/index.js.map +1 -1
- package/dist/Client/Connection.js +20 -10
- package/dist/Client/Connection.js.map +1 -1
- package/dist/Client/Credentials/index.js +4 -2
- package/dist/Client/Credentials/index.js.map +1 -1
- package/dist/Client/List.js +4 -2
- package/dist/Client/List.js.map +1 -1
- package/dist/Client/Reports/index.js +2 -1
- package/dist/Client/Reports/index.js.map +1 -1
- package/dist/Client/Transfers/index.js +4 -2
- package/dist/Client/Transfers/index.js.map +1 -1
- package/dist/Client/Users/index.js +4 -2
- package/dist/Client/Users/index.js.map +1 -1
- package/dist/Client/index.js.map +1 -1
- package/dist/model/AccountState.d.ts +1 -1
- package/dist/model/AccountType.d.ts +1 -1
- package/dist/model/Batch/Item/Status.d.ts +1 -1
- package/dist/model/Batch/Status.d.ts +1 -1
- package/dist/model/Batch/Type.d.ts +1 -1
- package/dist/model/BeneficiaryRequestStatus.d.ts +1 -1
- package/dist/model/BeneficiaryStatus.d.ts +1 -1
- package/dist/model/BeneficiarySubType.d.ts +1 -1
- package/dist/model/BeneficiarySubTypeSearch.d.ts +1 -1
- package/dist/model/BookingInfoType.d.ts +1 -1
- package/dist/model/CardForm.d.ts +1 -1
- package/dist/model/CardScheduleTaskType.d.ts +1 -1
- package/dist/model/CardState.d.ts +1 -1
- package/dist/model/CardState.js +14 -7
- package/dist/model/CardState.js.map +1 -1
- package/dist/model/CardStateChangeDesiredState.d.ts +1 -1
- package/dist/model/CardTypeRequestAvailabilityType.d.ts +1 -1
- package/dist/model/CardTypeSpecificationFlag.d.ts +1 -1
- package/dist/model/CardUsage.d.ts +1 -1
- package/dist/model/Config/Notice/FundingLimit/NoticeTriggerType.d.ts +1 -1
- package/dist/model/Config/Notice/Target/Type.d.ts +1 -1
- package/dist/model/Config/Notice/Type.d.ts +1 -1
- package/dist/model/Config/SsoProvider/Type.d.ts +1 -1
- package/dist/model/ConfirmationOfPayeeAccountType.d.ts +1 -1
- package/dist/model/ConfirmationOfPayeeResponseStatus.d.ts +1 -1
- package/dist/model/DayOfWeek.d.ts +1 -1
- package/dist/model/DeliveryStatus.d.ts +1 -1
- package/dist/model/DestinationType.d.ts +1 -1
- package/dist/model/DownloadFileFormat.d.ts +1 -1
- package/dist/model/FundingAccountIdentifierType.d.ts +1 -1
- package/dist/model/FundingType.d.ts +1 -1
- package/dist/model/Inclusion.d.ts +1 -1
- package/dist/model/InvokingSystem.d.ts +1 -1
- package/dist/model/MerchantResponseStatus.d.ts +1 -1
- package/dist/model/MerchantType.d.ts +1 -1
- package/dist/model/MetadataFormat/Field/ValueCategory.d.ts +1 -1
- package/dist/model/MetadataFormat/Field/ValueType.d.ts +1 -1
- package/dist/model/MetadataFormat/SubFormatType.d.ts +1 -1
- package/dist/model/Notification/CreatableType.d.ts +1 -1
- package/dist/model/Notification/Format.d.ts +1 -1
- package/dist/model/Notification/Tag.d.ts +1 -1
- package/dist/model/Notification/Type.d.ts +1 -1
- package/dist/model/OmnisetupFlags.d.ts +1 -1
- package/dist/model/OrganisationFlag.d.ts +1 -1
- package/dist/model/OrganisationFlag.js +4 -2
- package/dist/model/OrganisationFlag.js.map +1 -1
- package/dist/model/OrganisationRealm.d.ts +1 -1
- package/dist/model/OrganisationStatus.d.ts +1 -1
- package/dist/model/OrganisationStatusV2.d.ts +1 -1
- package/dist/model/PaxpayFeature.d.ts +1 -1
- package/dist/model/PaymentDeliveryStatus.d.ts +1 -1
- package/dist/model/PaymentMethodType.d.ts +1 -1
- package/dist/model/PaymentOperationType.d.ts +1 -1
- package/dist/model/PaymentOperationType.js +16 -8
- package/dist/model/PaymentOperationType.js.map +1 -1
- package/dist/model/PaymentStatus.d.ts +1 -1
- package/dist/model/ProductType.d.ts +1 -1
- package/dist/model/ProviderCode.d.ts +1 -1
- package/dist/model/Report/ReportSubscriptionFrequencyType.d.ts +1 -1
- package/dist/model/Report/ReportSubscriptionInvocationOutcome.d.ts +1 -1
- package/dist/model/Report/ReportSubscriptionStatus.d.ts +1 -1
- package/dist/model/Report/ReportType.d.ts +1 -1
- package/dist/model/Role.d.ts +1 -1
- package/dist/model/Scheme.d.ts +1 -1
- package/dist/model/StatementReportRowActionType.d.ts +1 -1
- package/dist/model/StatementReportRowActionType.js +6 -3
- package/dist/model/StatementReportRowActionType.js.map +1 -1
- package/dist/model/StatementReportSubType.d.ts +1 -1
- package/dist/model/StatementTransferSpecificType.d.ts +1 -1
- package/dist/model/TaskStatus.d.ts +1 -1
- package/dist/model/TierID.d.ts +1 -1
- package/dist/model/TransactionType.d.ts +1 -1
- package/dist/model/TransferDestinationAddressType.d.ts +1 -1
- package/dist/model/TransferDirection.d.ts +1 -1
- package/dist/model/TransferStatus.d.ts +1 -1
- package/dist/model/Usage.d.ts +1 -1
- package/dist/model/UserStatus.d.ts +1 -1
- package/model/AccountState.ts +1 -1
- package/model/AccountType.ts +1 -1
- package/model/Batch/Item/Status.ts +1 -1
- package/model/Batch/Status.ts +1 -1
- package/model/Batch/Type.ts +1 -1
- package/model/BeneficiaryRequestStatus.ts +1 -1
- package/model/BeneficiaryResponse.ts +1 -1
- package/model/BeneficiaryStatus.ts +1 -1
- package/model/BeneficiarySubType.ts +1 -1
- package/model/BeneficiarySubTypeSearch.ts +1 -1
- package/model/BookingInfoType.ts +1 -1
- package/model/CardForm.ts +1 -1
- package/model/CardScheduleTaskType.ts +1 -1
- package/model/CardState.ts +15 -8
- package/model/CardStateChangeDesiredState.ts +1 -1
- package/model/CardTypeRequestAvailabilityType.ts +1 -1
- package/model/CardTypeSpecificationFlag.ts +1 -1
- package/model/CardUsage.ts +1 -1
- package/model/Config/Notice/FundingLimit/NoticeTriggerType.ts +1 -1
- package/model/Config/Notice/Target/Type.ts +1 -1
- package/model/Config/Notice/Type.ts +1 -1
- package/model/Config/SsoProvider/Type.ts +1 -1
- package/model/ConfirmationOfPayeeAccountType.ts +1 -1
- package/model/ConfirmationOfPayeeResponseStatus.ts +1 -1
- package/model/DayOfWeek.ts +1 -1
- package/model/DeliveryStatus.ts +1 -1
- package/model/DestinationType.ts +1 -1
- package/model/DownloadFileFormat.ts +1 -1
- package/model/FundingAccountIdentifierType.ts +1 -1
- package/model/FundingType.ts +1 -1
- package/model/Inclusion.ts +1 -1
- package/model/InvokingSystem.ts +1 -1
- package/model/MerchantResponseStatus.ts +1 -1
- package/model/MerchantType.ts +1 -1
- package/model/MetadataFormat/Field/ValueCategory.ts +1 -1
- package/model/MetadataFormat/Field/ValueType.ts +1 -1
- package/model/MetadataFormat/SubFormatType.ts +1 -1
- package/model/Notification/CreatableType.ts +1 -1
- package/model/Notification/Format.ts +1 -1
- package/model/Notification/Tag.ts +1 -1
- package/model/Notification/Type.ts +1 -1
- package/model/OmnisetupFlags.ts +1 -1
- package/model/OrganisationFlag.ts +5 -3
- package/model/OrganisationRealm.ts +1 -1
- package/model/OrganisationStatus.ts +1 -1
- package/model/OrganisationStatusV2.ts +1 -1
- package/model/PaxpayFeature.ts +1 -1
- package/model/PaymentDeliveryStatus.ts +1 -1
- package/model/PaymentMethodType.ts +1 -1
- package/model/PaymentOperationType.ts +17 -9
- package/model/PaymentStatus.ts +1 -1
- package/model/ProductType.ts +1 -1
- package/model/ProviderCode.ts +1 -1
- package/model/Report/ReportSubscriptionFrequencyType.ts +1 -1
- package/model/Report/ReportSubscriptionInvocationOutcome.ts +1 -1
- package/model/Report/ReportSubscriptionStatus.ts +1 -1
- package/model/Report/ReportType.ts +1 -1
- package/model/Role.ts +1 -1
- package/model/Scheme.ts +1 -1
- package/model/StatementReportRowActionType.ts +7 -4
- package/model/StatementReportSubType.ts +1 -1
- package/model/StatementTransferSpecificType.ts +1 -1
- package/model/TaskStatus.ts +1 -1
- package/model/TierID.ts +1 -1
- package/model/TransactionStatus.ts +1 -1
- package/model/TransactionType.ts +1 -1
- package/model/TransferDestinationAddressType.ts +1 -1
- package/model/TransferDirection.ts +1 -1
- package/model/TransferStatus.ts +1 -1
- package/model/Usage.ts +1 -1
- package/model/UserStatus.ts +1 -1
- package/package.json +6 -5
package/.eslintrc
CHANGED
|
@@ -3,27 +3,34 @@
|
|
|
3
3
|
"parser": "@typescript-eslint/parser",
|
|
4
4
|
"plugins": [
|
|
5
5
|
"@typescript-eslint",
|
|
6
|
-
"
|
|
6
|
+
"prettier",
|
|
7
7
|
"simple-import-sort"
|
|
8
8
|
],
|
|
9
9
|
"extends": [
|
|
10
10
|
"eslint:recommended",
|
|
11
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
12
11
|
"plugin:@typescript-eslint/recommended",
|
|
13
|
-
"plugin:
|
|
12
|
+
"plugin:prettier/recommended"
|
|
14
13
|
],
|
|
15
14
|
"rules": {
|
|
16
|
-
"
|
|
17
|
-
|
|
15
|
+
"curly": [
|
|
16
|
+
"error",
|
|
17
|
+
"all"
|
|
18
|
+
],
|
|
19
|
+
// Prettier formatting rules
|
|
20
|
+
"prettier/prettier": [
|
|
21
|
+
"warn",
|
|
18
22
|
{
|
|
19
|
-
"
|
|
23
|
+
"semi": false,
|
|
24
|
+
"singleQuote": false,
|
|
25
|
+
"tabWidth": 2,
|
|
26
|
+
"trailingComma": "es5"
|
|
20
27
|
}
|
|
21
28
|
],
|
|
29
|
+
// TypeScript rules
|
|
22
30
|
"@typescript-eslint/no-explicit-any": "off",
|
|
23
31
|
"@typescript-eslint/no-namespace": "off",
|
|
24
|
-
"prefer-const": 1,
|
|
25
32
|
"@typescript-eslint/no-unused-vars": [
|
|
26
|
-
|
|
33
|
+
"warn",
|
|
27
34
|
{
|
|
28
35
|
"vars": "all",
|
|
29
36
|
"args": "none",
|
|
@@ -31,8 +38,11 @@
|
|
|
31
38
|
}
|
|
32
39
|
],
|
|
33
40
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
41
|
+
// JS rules
|
|
42
|
+
"prefer-const": "warn",
|
|
34
43
|
"no-case-declarations": "off",
|
|
35
44
|
"no-inner-declarations": "off",
|
|
45
|
+
// Import sorting
|
|
36
46
|
"sort-imports": "off",
|
|
37
47
|
"simple-import-sort/imports": [
|
|
38
48
|
"error",
|
|
@@ -63,9 +73,5 @@
|
|
|
63
73
|
}
|
|
64
74
|
]
|
|
65
75
|
},
|
|
66
|
-
"settings": {
|
|
67
|
-
"prettierx": {
|
|
68
|
-
"usePrettierrc": true
|
|
69
|
-
}
|
|
70
|
-
}
|
|
76
|
+
"settings": {}
|
|
71
77
|
}
|
|
@@ -9,10 +9,11 @@ export class Item<K extends string, V> {
|
|
|
9
9
|
return this.fromString(this.storage.getItem(this.key) ?? undefined)
|
|
10
10
|
}
|
|
11
11
|
set(value: V | undefined): V | undefined {
|
|
12
|
-
if (value != undefined && value != null)
|
|
12
|
+
if (value != undefined && value != null) {
|
|
13
13
|
this.storage.setItem(this.key, this.toString(value))
|
|
14
|
-
else
|
|
14
|
+
} else {
|
|
15
15
|
this.storage.removeItem(this.key)
|
|
16
|
+
}
|
|
16
17
|
return value
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -17,8 +17,8 @@ describe("pax2pay.cards.actions pax2pay", () => {
|
|
|
17
17
|
password: process.env.password ?? "password",
|
|
18
18
|
})
|
|
19
19
|
)
|
|
20
|
-
for (const currency of ["GBP"])
|
|
21
|
-
for (const cardType of ["jittest"])
|
|
20
|
+
for (const currency of ["GBP"]) {
|
|
21
|
+
for (const cardType of ["jittest"]) {
|
|
22
22
|
it(`card ${currency} ${cardType}`, async () => {
|
|
23
23
|
const request = factory({
|
|
24
24
|
cardType: {
|
|
@@ -37,4 +37,6 @@ describe("pax2pay.cards.actions pax2pay", () => {
|
|
|
37
37
|
|
|
38
38
|
await actionTest(cardLegacy, client)
|
|
39
39
|
})
|
|
40
|
+
}
|
|
41
|
+
}
|
|
40
42
|
})
|
|
@@ -15,8 +15,8 @@ describe("pax2pay.cards.create fake", () => {
|
|
|
15
15
|
password: process.env.password ?? "password",
|
|
16
16
|
})
|
|
17
17
|
)
|
|
18
|
-
for (const currency of ["EUR", "GBP", "SEK", "JPY", "BRL"])
|
|
19
|
-
for (const cardType of ["VISA_CREDIT", "MASTERCARD"])
|
|
18
|
+
for (const currency of ["EUR", "GBP", "SEK", "JPY", "BRL"]) {
|
|
19
|
+
for (const cardType of ["VISA_CREDIT", "MASTERCARD"]) {
|
|
20
20
|
it(`card ${currency} ${cardType}`, async () => {
|
|
21
21
|
const [request, expectedV2, expectedLegacy] = factory({
|
|
22
22
|
cardType: {
|
|
@@ -29,11 +29,11 @@ describe("pax2pay.cards.create fake", () => {
|
|
|
29
29
|
const cardV2 = await client?.cards.create(request)
|
|
30
30
|
const cardLegacy = await client?.cards.createLegacy(request)
|
|
31
31
|
|
|
32
|
-
if (ErrorResponse.is(cardV2))
|
|
32
|
+
if (ErrorResponse.is(cardV2)) {
|
|
33
33
|
throw Error(cardV2.errors?.[0].message)
|
|
34
|
-
else if (ErrorResponse.is(cardLegacy))
|
|
34
|
+
} else if (ErrorResponse.is(cardLegacy)) {
|
|
35
35
|
throw Error(cardLegacy.errors?.[0].message)
|
|
36
|
-
else {
|
|
36
|
+
} else {
|
|
37
37
|
expect(cardV2).toBeTruthy()
|
|
38
38
|
expect(cardLegacy).toBeTruthy()
|
|
39
39
|
|
|
@@ -41,4 +41,6 @@ describe("pax2pay.cards.create fake", () => {
|
|
|
41
41
|
expect(cardLegacy).toMatchObject(expectedLegacy)
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
|
+
}
|
|
45
|
+
}
|
|
44
46
|
})
|
|
@@ -15,8 +15,8 @@ describe("pax2pay.cards.create ixaris", () => {
|
|
|
15
15
|
})
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
-
for (const currency of ["EUR", "GBP", "USD"])
|
|
19
|
-
for (const cardType of ["VISA_DEBIT", "VISA_CREDIT", "MASTERCARD"])
|
|
18
|
+
for (const currency of ["EUR", "GBP", "USD"]) {
|
|
19
|
+
for (const cardType of ["VISA_DEBIT", "VISA_CREDIT", "MASTERCARD"]) {
|
|
20
20
|
it(`card ${currency} ${cardType}`, async () => {
|
|
21
21
|
const [request, expectedV2, expectedLegacy] = factory({
|
|
22
22
|
cardType: {
|
|
@@ -39,4 +39,6 @@ describe("pax2pay.cards.create ixaris", () => {
|
|
|
39
39
|
expect(cardV2).toMatchObject(expectedV2)
|
|
40
40
|
expect(cardLegacy).toMatchObject(expectedLegacy)
|
|
41
41
|
})
|
|
42
|
+
}
|
|
43
|
+
}
|
|
42
44
|
})
|
|
@@ -15,8 +15,8 @@ describe("pax2pay.cards.create modulr", () => {
|
|
|
15
15
|
password: process.env.password ?? "password",
|
|
16
16
|
})
|
|
17
17
|
)
|
|
18
|
-
for (const currency of ["EUR", "GBP", "PLN", "USD"])
|
|
19
|
-
for (const cardType of ["VISA_DEBIT_CORPORATE", "VISA", "VISA_CREDIT_CORPORATE", "VISA_DEBIT"])
|
|
18
|
+
for (const currency of ["EUR", "GBP", "PLN", "USD"]) {
|
|
19
|
+
for (const cardType of ["VISA_DEBIT_CORPORATE", "VISA", "VISA_CREDIT_CORPORATE", "VISA_DEBIT"]) {
|
|
20
20
|
it(`card ${currency} ${cardType}`, async () => {
|
|
21
21
|
const [request, expectedV2, expectedLegacy] = factory({
|
|
22
22
|
cardType: {
|
|
@@ -39,4 +39,6 @@ describe("pax2pay.cards.create modulr", () => {
|
|
|
39
39
|
expect(cardV2).toMatchObject(expectedV2)
|
|
40
40
|
expect(cardLegacy).toMatchObject(expectedLegacy)
|
|
41
41
|
})
|
|
42
|
+
}
|
|
43
|
+
}
|
|
42
44
|
})
|
|
@@ -14,8 +14,8 @@ describe("pax2pay.cards.create pax2pay", () => {
|
|
|
14
14
|
password: process.env.password ?? "password",
|
|
15
15
|
})
|
|
16
16
|
})
|
|
17
|
-
for (const currency of ["GBP"])
|
|
18
|
-
for (const cardType of ["jittest"])
|
|
17
|
+
for (const currency of ["GBP"]) {
|
|
18
|
+
for (const cardType of ["jittest"]) {
|
|
19
19
|
it(`card ${currency} ${cardType}`, async () => {
|
|
20
20
|
const [request, expectedV2, expectedLegacy] = factory({
|
|
21
21
|
cardType: {
|
|
@@ -28,11 +28,11 @@ describe("pax2pay.cards.create pax2pay", () => {
|
|
|
28
28
|
const cardV2 = await client?.cards.create(request)
|
|
29
29
|
const cardLegacy = await client?.cards.createLegacy(request)
|
|
30
30
|
|
|
31
|
-
if (ErrorResponse.is(cardV2))
|
|
31
|
+
if (ErrorResponse.is(cardV2)) {
|
|
32
32
|
throw Error(cardV2.errors?.[0].message)
|
|
33
|
-
else if (ErrorResponse.is(cardLegacy))
|
|
33
|
+
} else if (ErrorResponse.is(cardLegacy)) {
|
|
34
34
|
throw Error(cardLegacy.errors?.[0].message)
|
|
35
|
-
else {
|
|
35
|
+
} else {
|
|
36
36
|
expect(cardV2).toBeTruthy()
|
|
37
37
|
expect(cardLegacy).toBeTruthy()
|
|
38
38
|
|
|
@@ -40,4 +40,6 @@ describe("pax2pay.cards.create pax2pay", () => {
|
|
|
40
40
|
expect(cardLegacy).toMatchObject(expectedLegacy)
|
|
41
41
|
}
|
|
42
42
|
})
|
|
43
|
+
}
|
|
44
|
+
}
|
|
43
45
|
})
|
|
@@ -55,11 +55,14 @@ describe("pax2pay.cards.list", () => {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const list = await client?.cards.list()
|
|
58
|
-
if (Array.isArray(list))
|
|
59
|
-
for (const card of list)
|
|
58
|
+
if (Array.isArray(list)) {
|
|
59
|
+
for (const card of list) {
|
|
60
60
|
expect(card).toMatchObject(expected)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
61
63
|
//if list only returns one card.
|
|
62
|
-
else
|
|
64
|
+
else {
|
|
63
65
|
expect(list).toMatchObject(expected)
|
|
66
|
+
}
|
|
64
67
|
})
|
|
65
68
|
})
|
package/Client/Connection.ts
CHANGED
|
@@ -17,7 +17,10 @@ export class Connection {
|
|
|
17
17
|
set token(value: string | undefined) {
|
|
18
18
|
this.#token = value
|
|
19
19
|
}
|
|
20
|
-
private constructor(
|
|
20
|
+
private constructor(
|
|
21
|
+
readonly url: string,
|
|
22
|
+
token?: string
|
|
23
|
+
) {
|
|
21
24
|
this.#token = token
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -59,8 +62,9 @@ export class Connection {
|
|
|
59
62
|
const url = new URL(`${this.url}/${path}`)
|
|
60
63
|
if (parameters) {
|
|
61
64
|
Object.entries(parameters).forEach(([key, value]) => {
|
|
62
|
-
if (value === undefined)
|
|
65
|
+
if (value === undefined) {
|
|
63
66
|
return
|
|
67
|
+
}
|
|
64
68
|
// Handles arrays as comma-separated strings
|
|
65
69
|
url.searchParams.append(key, Array.isArray(value) ? value.join(",") : String(value))
|
|
66
70
|
})
|
|
@@ -68,10 +72,12 @@ export class Connection {
|
|
|
68
72
|
return url.toString()
|
|
69
73
|
}
|
|
70
74
|
private prepareBody(request: any): BodyInit | undefined {
|
|
71
|
-
if (!request)
|
|
75
|
+
if (!request) {
|
|
72
76
|
return undefined
|
|
73
|
-
|
|
77
|
+
}
|
|
78
|
+
if (request instanceof FormData || request instanceof Blob) {
|
|
74
79
|
return request
|
|
80
|
+
}
|
|
75
81
|
|
|
76
82
|
// Clean strings by trimming before stringifying
|
|
77
83
|
return JSON.stringify(request, (_, v) => (typeof v === "string" ? v.trim() : v))
|
|
@@ -91,28 +97,34 @@ export class Connection {
|
|
|
91
97
|
|
|
92
98
|
// Session & Auth
|
|
93
99
|
const token = Session.authentication.get()?.token || this.token
|
|
94
|
-
if (token)
|
|
100
|
+
if (token) {
|
|
95
101
|
headers["X-Auth-Token"] = token
|
|
96
|
-
|
|
102
|
+
}
|
|
103
|
+
if (this.#pax2payPortalLanguage) {
|
|
97
104
|
headers["Pax2pay-Portal-Language"] = this.#pax2payPortalLanguage
|
|
98
|
-
|
|
105
|
+
}
|
|
106
|
+
if (this.assumedOrg) {
|
|
99
107
|
headers["x-assume"] = this.assumedOrg
|
|
108
|
+
}
|
|
100
109
|
|
|
101
110
|
const cookie = window.localStorage.getItem("cookie")
|
|
102
|
-
if (cookie)
|
|
111
|
+
if (cookie) {
|
|
103
112
|
headers["x-otp-cookie"] = cookie
|
|
113
|
+
}
|
|
104
114
|
|
|
105
115
|
const publicKey = Session.publicKey.get()
|
|
106
|
-
if (publicKey)
|
|
116
|
+
if (publicKey) {
|
|
107
117
|
headers["cde-public-key"] = publicKey
|
|
118
|
+
}
|
|
108
119
|
|
|
109
120
|
return headers
|
|
110
121
|
}
|
|
111
122
|
|
|
112
123
|
private handleSessionSideEffects(response: Response): void {
|
|
113
124
|
const otpCookie = response.headers.get("x-otp-cookie")
|
|
114
|
-
if (otpCookie)
|
|
125
|
+
if (otpCookie) {
|
|
115
126
|
window.localStorage.setItem("cookie", otpCookie)
|
|
127
|
+
}
|
|
116
128
|
|
|
117
129
|
const isLoginPath = response.url.includes("login") || response.url.includes("sso/google")
|
|
118
130
|
if (response.status === 403 && isLoginPath && response.headers.has("X-Auth-Token")) {
|
|
@@ -128,8 +140,9 @@ export class Connection {
|
|
|
128
140
|
|
|
129
141
|
if (contentType.includes("application/json")) {
|
|
130
142
|
const json = await response.json()
|
|
131
|
-
if (!response.ok)
|
|
143
|
+
if (!response.ok) {
|
|
132
144
|
return { status: response.status, ...json }
|
|
145
|
+
}
|
|
133
146
|
|
|
134
147
|
const totalCount = response.headers.get("x-total-count")
|
|
135
148
|
return totalCount ? { list: json, totalCount } : json
|
package/Client/List.ts
CHANGED
|
@@ -60,9 +60,10 @@ export abstract class List<Response extends { [key: string]: any }> {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
extractResponse<R = Response>(value: R[] | { list: R[]; totalCount: number } | model.ErrorResponse) {
|
|
63
|
-
if (!model.ErrorResponse.is(value) && "list" in value)
|
|
63
|
+
if (!model.ErrorResponse.is(value) && "list" in value) {
|
|
64
64
|
return value.list
|
|
65
|
-
else
|
|
65
|
+
} else {
|
|
66
66
|
return value
|
|
67
|
+
}
|
|
67
68
|
}
|
|
68
69
|
}
|
|
@@ -15,7 +15,7 @@ describe("pax2pay.organisations.list", () => {
|
|
|
15
15
|
it("all orgs", async () => {
|
|
16
16
|
const organizations = await client?.organisations.list()
|
|
17
17
|
expect(Array.isArray(organizations)).toEqual(true)
|
|
18
|
-
if (Array.isArray(organizations))
|
|
18
|
+
if (Array.isArray(organizations)) {
|
|
19
19
|
for (const organization of organizations) {
|
|
20
20
|
expect(organization).toMatchObject({
|
|
21
21
|
code: expect.stringContaining(""),
|
|
@@ -24,5 +24,6 @@ describe("pax2pay.organisations.list", () => {
|
|
|
24
24
|
status: expect.stringMatching(/(ACTIVE)|(INACTIVE)/),
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
|
+
}
|
|
27
28
|
})
|
|
28
29
|
})
|
package/Client/Reports/index.ts
CHANGED
|
@@ -52,8 +52,9 @@ export class Reports {
|
|
|
52
52
|
size: pageSize,
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
|
-
if (!model.ErrorResponse.is(result) && "list" in result)
|
|
55
|
+
if (!model.ErrorResponse.is(result) && "list" in result) {
|
|
56
56
|
result = result.list
|
|
57
|
+
}
|
|
57
58
|
return result
|
|
58
59
|
}
|
|
59
60
|
async getStatementSummaryReport(
|
|
@@ -58,12 +58,13 @@ export class Transfers extends List<model.TransferResponseV2> {
|
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
async donloadReceipt(transferId: string, providerCode?: ProviderCode) {
|
|
61
|
-
if (providerCode)
|
|
61
|
+
if (providerCode) {
|
|
62
62
|
return await this.connection.get<model.DownloadableResponse>(
|
|
63
63
|
`v2/${this.folder}/${providerCode}/${transferId}/download`
|
|
64
64
|
)
|
|
65
|
-
else
|
|
65
|
+
} else {
|
|
66
66
|
return await this.connection.get<model.DownloadableResponse>(`v2/${this.folder}/${transferId}/download`)
|
|
67
|
+
}
|
|
67
68
|
}
|
|
68
69
|
async getFxQuote(request: model.FxQuoteRequest) {
|
|
69
70
|
return await this.connection.post<model.FxQuoteResponse>(`v2/${this.folder}/fx/quote`, request)
|
|
@@ -26,8 +26,9 @@ describe("pax2pay.transfers.list", () => {
|
|
|
26
26
|
assert(Array.isArray(transfers))
|
|
27
27
|
|
|
28
28
|
expect(transfers).toHaveLength(20)
|
|
29
|
-
for (const transfer of transfers)
|
|
29
|
+
for (const transfer of transfers) {
|
|
30
30
|
expect(transfer).toMatchObject(expected)
|
|
31
|
+
}
|
|
31
32
|
|
|
32
33
|
const transfers100 = await client?.transfers.list(1, 100)
|
|
33
34
|
|
|
@@ -36,7 +37,8 @@ describe("pax2pay.transfers.list", () => {
|
|
|
36
37
|
assert(Array.isArray(transfers100))
|
|
37
38
|
|
|
38
39
|
expect(transfers100).toHaveLength(100)
|
|
39
|
-
for (const transfer of transfers100)
|
|
40
|
+
for (const transfer of transfers100) {
|
|
40
41
|
expect(transfer).toMatchObject(expected)
|
|
42
|
+
}
|
|
41
43
|
})
|
|
42
44
|
})
|
package/Client/Users/index.ts
CHANGED
|
@@ -88,10 +88,12 @@ export class Users extends List<model.UserResponse> {
|
|
|
88
88
|
tempToken?: string
|
|
89
89
|
): Promise<model.TwoFactorAuthenticationRegistrationResponse | model.ErrorResponse> {
|
|
90
90
|
let header = {}
|
|
91
|
-
if (otp)
|
|
91
|
+
if (otp) {
|
|
92
92
|
header = { ...header, "x-otp": otp }
|
|
93
|
-
|
|
93
|
+
}
|
|
94
|
+
if (tempToken) {
|
|
94
95
|
header = { ...header, "X-Auth-Token": tempToken }
|
|
96
|
+
}
|
|
95
97
|
return await this.connection.post<model.TwoFactorAuthenticationRegistrationResponse>(
|
|
96
98
|
`${this.folder}/${username}/two-factor`,
|
|
97
99
|
{},
|
|
@@ -15,8 +15,8 @@ describe("pax2pay.users.list", () => {
|
|
|
15
15
|
it("first page", async () => {
|
|
16
16
|
const users = await client?.users.list()
|
|
17
17
|
expect(Array.isArray(users)).toEqual(true)
|
|
18
|
-
if (Array.isArray(users))
|
|
19
|
-
for (const user of users)
|
|
18
|
+
if (Array.isArray(users)) {
|
|
19
|
+
for (const user of users) {
|
|
20
20
|
expect(user).toMatchObject({
|
|
21
21
|
"2fa": {
|
|
22
22
|
enabled: expect.any(Boolean),
|
|
@@ -31,11 +31,14 @@ describe("pax2pay.users.list", () => {
|
|
|
31
31
|
status: expect.stringMatching(/(ACTIVE)|(INACTIVE)/),
|
|
32
32
|
},
|
|
33
33
|
})
|
|
34
|
+
}
|
|
35
|
+
}
|
|
34
36
|
})
|
|
35
37
|
it.skip("username asc, email desc", async () => {
|
|
36
38
|
const users = await client?.users.list(0, 20, ["username", { property: "email", direction: "descending" }])
|
|
37
39
|
expect(Array.isArray(users)).toEqual(true)
|
|
38
|
-
if (Array.isArray(users))
|
|
40
|
+
if (Array.isArray(users)) {
|
|
39
41
|
expect(users).toHaveLength(20)
|
|
42
|
+
}
|
|
40
43
|
})
|
|
41
44
|
})
|
package/Client/index.ts
CHANGED
|
@@ -57,7 +57,10 @@ export class Client {
|
|
|
57
57
|
rolesets = ClientRolesets.create(this.connection)
|
|
58
58
|
apiKeys = ClientApiKeys.create(this.connection)
|
|
59
59
|
|
|
60
|
-
constructor(
|
|
60
|
+
constructor(
|
|
61
|
+
private connection: Connection,
|
|
62
|
+
private $authenticate?: Authenticate
|
|
63
|
+
) {
|
|
61
64
|
connection.unauthorized = async () => (await this.$authenticate?.(this)) ?? false
|
|
62
65
|
}
|
|
63
66
|
static create(url: string, token?: string | Authenticate) {
|
|
@@ -9,10 +9,12 @@ export class Item {
|
|
|
9
9
|
return this.fromString(this.storage.getItem(this.key) ?? undefined);
|
|
10
10
|
}
|
|
11
11
|
set(value) {
|
|
12
|
-
if (value != undefined && value != null)
|
|
12
|
+
if (value != undefined && value != null) {
|
|
13
13
|
this.storage.setItem(this.key, this.toString(value));
|
|
14
|
-
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
15
16
|
this.storage.removeItem(this.key);
|
|
17
|
+
}
|
|
16
18
|
return value;
|
|
17
19
|
}
|
|
18
20
|
static create(key, setup) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"../","sources":["Client/Auth/Session/Item.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,IAAI;IAChB,YACS,GAAM,EACN,UAAoD,EACpD,QAA0B,EAC1B,OAA4D;QAH5D,QAAG,GAAH,GAAG,CAAG;QACN,eAAU,GAAV,UAAU,CAA0C;QACpD,aAAQ,GAAR,QAAQ,CAAkB;QAC1B,YAAO,GAAP,OAAO,CAAqD;IAClE,CAAC;IACJ,GAAG;QACF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,CAAA;IACpE,CAAC;IACD,GAAG,CAAC,KAAoB;QACvB,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"../","sources":["Client/Auth/Session/Item.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO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C,CAAC,IAAI,CAAC,GAAG,CAAC;QAC1B,OAAO;KACP,CAAC,CAAA;IACW,gBAAQ,GAAG,IAAI,CAAC,MAAM,CAAoC,UAAU,EAAE;QAClF,UAAU,EAAE,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAA0B;QAC7E,QAAQ,EAAE,CAAC,CAAwB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACnD,OAAO;KACP,CAAC,CAAA;IACW,sBAAc,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE;QAC3D,UAAU,EAAE,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAkC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxG,QAAQ,EAAE,CAAC,CAA+B,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAChE,OAAO;KACP,CAAC,CAAA;IACW,iBAAS,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QAClD,UAAU,EAAE,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC;QACxC,QAAQ,EAAE,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;QAC5C,OAAO;KACP,CAAC,CAAA;AACH,CAAC,EAvCgB,OAAO,KAAP,OAAO,QAuCvB"}
|
|
@@ -56,18 +56,21 @@ export class Connection {
|
|
|
56
56
|
const url = new URL(`${this.url}/${path}`);
|
|
57
57
|
if (parameters) {
|
|
58
58
|
Object.entries(parameters).forEach(([key, value]) => {
|
|
59
|
-
if (value === undefined)
|
|
59
|
+
if (value === undefined) {
|
|
60
60
|
return;
|
|
61
|
+
}
|
|
61
62
|
url.searchParams.append(key, Array.isArray(value) ? value.join(",") : String(value));
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
return url.toString();
|
|
65
66
|
}
|
|
66
67
|
prepareBody(request) {
|
|
67
|
-
if (!request)
|
|
68
|
+
if (!request) {
|
|
68
69
|
return undefined;
|
|
69
|
-
|
|
70
|
+
}
|
|
71
|
+
if (request instanceof FormData || request instanceof Blob) {
|
|
70
72
|
return request;
|
|
73
|
+
}
|
|
71
74
|
return JSON.stringify(request, (_, v) => (typeof v === "string" ? v.trim() : v));
|
|
72
75
|
}
|
|
73
76
|
prepareHeaders(request, overrides) {
|
|
@@ -82,24 +85,30 @@ export class Connection {
|
|
|
82
85
|
headers["Content-Type"] = "application/json";
|
|
83
86
|
}
|
|
84
87
|
const token = Session.authentication.get()?.token || this.token;
|
|
85
|
-
if (token)
|
|
88
|
+
if (token) {
|
|
86
89
|
headers["X-Auth-Token"] = token;
|
|
87
|
-
|
|
90
|
+
}
|
|
91
|
+
if (__classPrivateFieldGet(this, _Connection_pax2payPortalLanguage, "f")) {
|
|
88
92
|
headers["Pax2pay-Portal-Language"] = __classPrivateFieldGet(this, _Connection_pax2payPortalLanguage, "f");
|
|
89
|
-
|
|
93
|
+
}
|
|
94
|
+
if (this.assumedOrg) {
|
|
90
95
|
headers["x-assume"] = this.assumedOrg;
|
|
96
|
+
}
|
|
91
97
|
const cookie = window.localStorage.getItem("cookie");
|
|
92
|
-
if (cookie)
|
|
98
|
+
if (cookie) {
|
|
93
99
|
headers["x-otp-cookie"] = cookie;
|
|
100
|
+
}
|
|
94
101
|
const publicKey = Session.publicKey.get();
|
|
95
|
-
if (publicKey)
|
|
102
|
+
if (publicKey) {
|
|
96
103
|
headers["cde-public-key"] = publicKey;
|
|
104
|
+
}
|
|
97
105
|
return headers;
|
|
98
106
|
}
|
|
99
107
|
handleSessionSideEffects(response) {
|
|
100
108
|
const otpCookie = response.headers.get("x-otp-cookie");
|
|
101
|
-
if (otpCookie)
|
|
109
|
+
if (otpCookie) {
|
|
102
110
|
window.localStorage.setItem("cookie", otpCookie);
|
|
111
|
+
}
|
|
103
112
|
const isLoginPath = response.url.includes("login") || response.url.includes("sso/google");
|
|
104
113
|
if (response.status === 403 && isLoginPath && response.headers.has("X-Auth-Token")) {
|
|
105
114
|
Session.authentication.set({ token: response.headers.get("X-Auth-Token") ?? undefined });
|
|
@@ -112,8 +121,9 @@ export class Connection {
|
|
|
112
121
|
const contentType = response.headers.get("Content-Type") ?? "";
|
|
113
122
|
if (contentType.includes("application/json")) {
|
|
114
123
|
const json = await response.json();
|
|
115
|
-
if (!response.ok)
|
|
124
|
+
if (!response.ok) {
|
|
116
125
|
return { status: response.status, ...json };
|
|
126
|
+
}
|
|
117
127
|
const totalCount = response.headers.get("x-total-count");
|
|
118
128
|
return totalCount ? { list: json, totalCount } : json;
|
|
119
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connection.js","sourceRoot":"../","sources":["Client/Connection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,OAAO,UAAU;IAGtB,IAAI,qBAAqB,CAAC,KAAa;QACtC,uBAAA,IAAI,qCAA0B,KAAK,MAAA,CAAA;IACpC,CAAC;IAID,IAAI,KAAK;QACR,OAAO,uBAAA,IAAI,yBAAO,CAAA;IACnB,CAAC;IACD,IAAI,KAAK,CAAC,KAAyB;QAClC,uBAAA,IAAI,qBAAU,KAAK,MAAA,CAAA;IACpB,CAAC;IACD,
|
|
1
|
+
{"version":3,"file":"Connection.js","sourceRoot":"../","sources":["Client/Connection.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,MAAM,OAAO,UAAU;IAGtB,IAAI,qBAAqB,CAAC,KAAa;QACtC,uBAAA,IAAI,qCAA0B,KAAK,MAAA,CAAA;IACpC,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AAC;IACD,MAAM,CAAC,OAAO,CACb,KAAuD;QAEvD,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,CAAA;IAC1F,CAAC;CACD"}
|
|
@@ -15,10 +15,12 @@ export class Credentials {
|
|
|
15
15
|
const header = { "x-assume": organisationCode };
|
|
16
16
|
const parameters = { totalCount: false };
|
|
17
17
|
const response = await this.connection.get(`${this.folder}`, parameters, header);
|
|
18
|
-
if (model.ErrorResponse.is(response))
|
|
18
|
+
if (model.ErrorResponse.is(response)) {
|
|
19
19
|
return response;
|
|
20
|
-
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
21
22
|
return response.list;
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
async update(organisationCode, providerCode, request) {
|
|
24
26
|
const header = { "x-assume": organisationCode };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Credentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC,MAAM,OAAO,WAAW;IAEvB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QADhC,WAAM,GAAG,aAAa,CAAA;IACa,CAAC;IACvD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,CAAA;IACnC,CAAC;IACD,KAAK,CAAC,KAAK,CACV,gBAAwB,EACxB,YAA0B,EAC1B,OAAgC;QAEhC,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;QAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAChC,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,QAAQ,EACtC,OAAO,EACP,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC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A;QACD,IAAI,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtC,OAAO,QAAQ,CAAA;QAChB,CAAC;aAAM,CAAC;YACP,OAAO,QAAQ,CAAC,IAAI,CAAA;QACrB,CAAC;IACF,CAAC;IAED,KAAK,CAAC,MAAM,CACX,gBAAwB,EACxB,YAA0B,EAC1B,OAAgC;QAEhC,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;QAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAC/B,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,EAAE,EAChC,OAAO,EACP,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IACD,KAAK,CAAC,IAAI,CACT,gBAAwB,EACxB,YAA0B,EAC1B,OAAgC;QAEhC,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;QAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAChC,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,EAAE,EAChC,OAAO,EACP,SAAS,EACT,MAAM,CACN,CAAA;IACF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,gBAAwB,EAAE,YAA0B;QAChE,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;QAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAY,GAAG,IAAI,CAAC,MAAM,IAAI,YAAY,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IAC/G,CAAC;CACD"}
|
package/dist/Client/List.js
CHANGED
|
@@ -56,10 +56,12 @@ export class List {
|
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
58
58
|
extractResponse(value) {
|
|
59
|
-
if (!model.ErrorResponse.is(value) && "list" in value)
|
|
59
|
+
if (!model.ErrorResponse.is(value) && "list" in value) {
|
|
60
60
|
return value.list;
|
|
61
|
-
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
62
63
|
return value;
|
|
64
|
+
}
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
_List_connection = new WeakMap();
|