@pax2pay/model-banking 0.1.613 → 0.1.614
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/Amount.ts +0 -6
- package/Card/Changeable.ts +0 -13
- package/Card/Creatable.ts +0 -28
- package/Card/Expiry.ts +0 -14
- package/Card/Operation/Authorization.ts +1 -13
- package/Card/Operation/Card.ts +0 -14
- package/Card/Operation/index.ts +0 -5
- package/Card/Preset.ts +0 -5
- package/Card/Restriction/Merchant.ts +0 -2
- package/Card/Restriction/index.ts +0 -8
- package/Card/Restriction/merchants/Merchant.ts +2 -2
- package/Card/Scheme.ts +0 -5
- package/Card/index.ts +0 -37
- package/Client/Transactions/index.ts +0 -21
- package/Rail/index.ts +0 -2
- package/Realm.ts +0 -5
- package/Rule/Base.ts +0 -26
- package/Rule/Other.ts +0 -6
- package/Rule/type.ts +0 -5
- package/dist/cjs/Amount.d.ts +0 -2
- package/dist/cjs/Amount.js +0 -3
- package/dist/cjs/Amount.js.map +1 -1
- package/dist/cjs/Card/Changeable.d.ts +0 -2
- package/dist/cjs/Card/Changeable.js +0 -13
- package/dist/cjs/Card/Changeable.js.map +1 -1
- package/dist/cjs/Card/Creatable.d.ts +0 -2
- package/dist/cjs/Card/Creatable.js +0 -28
- package/dist/cjs/Card/Creatable.js.map +1 -1
- package/dist/cjs/Card/Expiry.d.ts +0 -2
- package/dist/cjs/Card/Expiry.js +0 -11
- package/dist/cjs/Card/Expiry.js.map +1 -1
- package/dist/cjs/Card/Operation/Authorization.d.ts +0 -2
- package/dist/cjs/Card/Operation/Authorization.js +0 -12
- package/dist/cjs/Card/Operation/Authorization.js.map +1 -1
- package/dist/cjs/Card/Operation/Card.d.ts +0 -2
- package/dist/cjs/Card/Operation/Card.js +0 -14
- package/dist/cjs/Card/Operation/Card.js.map +1 -1
- package/dist/cjs/Card/Operation/index.d.ts +0 -2
- package/dist/cjs/Card/Operation/index.js +0 -5
- package/dist/cjs/Card/Operation/index.js.map +1 -1
- package/dist/cjs/Card/Preset.d.ts +0 -2
- package/dist/cjs/Card/Preset.js +0 -5
- package/dist/cjs/Card/Preset.js.map +1 -1
- package/dist/cjs/Card/Restriction/Merchant.d.ts +0 -2
- package/dist/cjs/Card/Restriction/Merchant.js +0 -2
- package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/cjs/Card/Restriction/index.d.ts +0 -2
- package/dist/cjs/Card/Restriction/index.js +0 -8
- package/dist/cjs/Card/Restriction/index.js.map +1 -1
- package/dist/cjs/Card/Restriction/merchants/Merchant.d.ts +1 -2
- package/dist/cjs/Card/Restriction/merchants/Merchant.js +8 -8
- package/dist/cjs/Card/Restriction/merchants/Merchant.js.map +1 -1
- package/dist/cjs/Card/Scheme.d.ts +0 -2
- package/dist/cjs/Card/Scheme.js +0 -5
- package/dist/cjs/Card/Scheme.js.map +1 -1
- package/dist/cjs/Card/index.d.ts +0 -2
- package/dist/cjs/Card/index.js +0 -38
- package/dist/cjs/Card/index.js.map +1 -1
- package/dist/cjs/Client/Transactions/index.d.ts +0 -16
- package/dist/cjs/Client/Transactions/index.js +0 -27
- package/dist/cjs/Client/Transactions/index.js.map +1 -1
- package/dist/cjs/Rail/index.d.ts +0 -2
- package/dist/cjs/Rail/index.js +0 -2
- package/dist/cjs/Rail/index.js.map +1 -1
- package/dist/cjs/Realm.d.ts +0 -2
- package/dist/cjs/Realm.js +0 -5
- package/dist/cjs/Realm.js.map +1 -1
- package/dist/cjs/Rule/Base.d.ts +0 -4
- package/dist/cjs/Rule/Base.js +0 -26
- package/dist/cjs/Rule/Base.js.map +1 -1
- package/dist/cjs/Rule/Other.d.ts +0 -3
- package/dist/cjs/Rule/Other.js +0 -6
- package/dist/cjs/Rule/Other.js.map +1 -1
- package/dist/cjs/Rule/type.js.map +1 -1
- package/dist/mjs/Amount.d.ts +0 -2
- package/dist/mjs/Amount.js +0 -3
- package/dist/mjs/Amount.js.map +1 -1
- package/dist/mjs/Card/Changeable.d.ts +0 -2
- package/dist/mjs/Card/Changeable.js +0 -13
- package/dist/mjs/Card/Changeable.js.map +1 -1
- package/dist/mjs/Card/Creatable.d.ts +0 -2
- package/dist/mjs/Card/Creatable.js +0 -28
- package/dist/mjs/Card/Creatable.js.map +1 -1
- package/dist/mjs/Card/Expiry.d.ts +0 -2
- package/dist/mjs/Card/Expiry.js +0 -11
- package/dist/mjs/Card/Expiry.js.map +1 -1
- package/dist/mjs/Card/Operation/Authorization.d.ts +0 -2
- package/dist/mjs/Card/Operation/Authorization.js +0 -12
- package/dist/mjs/Card/Operation/Authorization.js.map +1 -1
- package/dist/mjs/Card/Operation/Card.d.ts +0 -2
- package/dist/mjs/Card/Operation/Card.js +0 -14
- package/dist/mjs/Card/Operation/Card.js.map +1 -1
- package/dist/mjs/Card/Operation/index.d.ts +0 -2
- package/dist/mjs/Card/Operation/index.js +0 -5
- package/dist/mjs/Card/Operation/index.js.map +1 -1
- package/dist/mjs/Card/Preset.d.ts +0 -2
- package/dist/mjs/Card/Preset.js +0 -5
- package/dist/mjs/Card/Preset.js.map +1 -1
- package/dist/mjs/Card/Restriction/Merchant.d.ts +0 -2
- package/dist/mjs/Card/Restriction/Merchant.js +0 -2
- package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/mjs/Card/Restriction/index.d.ts +0 -2
- package/dist/mjs/Card/Restriction/index.js +0 -8
- package/dist/mjs/Card/Restriction/index.js.map +1 -1
- package/dist/mjs/Card/Restriction/merchants/Merchant.d.ts +1 -2
- package/dist/mjs/Card/Restriction/merchants/Merchant.js +2 -2
- package/dist/mjs/Card/Restriction/merchants/Merchant.js.map +1 -1
- package/dist/mjs/Card/Scheme.d.ts +0 -2
- package/dist/mjs/Card/Scheme.js +0 -5
- package/dist/mjs/Card/Scheme.js.map +1 -1
- package/dist/mjs/Card/index.d.ts +0 -2
- package/dist/mjs/Card/index.js +0 -38
- package/dist/mjs/Card/index.js.map +1 -1
- package/dist/mjs/Client/Transactions/index.d.ts +0 -16
- package/dist/mjs/Client/Transactions/index.js +0 -27
- package/dist/mjs/Client/Transactions/index.js.map +1 -1
- package/dist/mjs/Rail/index.d.ts +0 -2
- package/dist/mjs/Rail/index.js +0 -2
- package/dist/mjs/Rail/index.js.map +1 -1
- package/dist/mjs/Realm.d.ts +0 -2
- package/dist/mjs/Realm.js +0 -5
- package/dist/mjs/Realm.js.map +1 -1
- package/dist/mjs/Rule/Base.d.ts +0 -4
- package/dist/mjs/Rule/Base.js +0 -26
- package/dist/mjs/Rule/Base.js.map +1 -1
- package/dist/mjs/Rule/Other.d.ts +0 -3
- package/dist/mjs/Rule/Other.js +0 -6
- package/dist/mjs/Rule/Other.js.map +1 -1
- package/dist/mjs/Rule/type.js.map +1 -1
- package/package.json +1 -6
package/Amount.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
-
import { isoly as isoly2 } from "isoly2"
|
|
3
2
|
import { isly } from "isly"
|
|
4
|
-
import { isly as isly2 } from "isly2"
|
|
5
3
|
import { Amounts } from "./Amounts"
|
|
6
4
|
|
|
7
5
|
export type Amount = [isoly.Currency, number]
|
|
@@ -11,8 +9,4 @@ export namespace Amount {
|
|
|
11
9
|
return !amount ? {} : Object.fromEntries<number>([amount])
|
|
12
10
|
}
|
|
13
11
|
export const type = isly.tuple<Amount>(isly.string(isoly.Currency.values), isly.number())
|
|
14
|
-
export const type2 = isly2.tuple<Amount>(
|
|
15
|
-
isoly2.Currency.type,
|
|
16
|
-
isly2.number().rename("Amount").describe("Amount in a specified currency.")
|
|
17
|
-
)
|
|
18
12
|
}
|
package/Card/Changeable.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
-
import { isoly as isoly2 } from "isoly2"
|
|
3
2
|
import { isly } from "isly"
|
|
4
|
-
import { isly as isly2 } from "isly2"
|
|
5
3
|
import { Amount } from "../Amount"
|
|
6
4
|
import { Meta } from "./Meta"
|
|
7
5
|
|
|
@@ -15,15 +13,4 @@ export namespace Changeable {
|
|
|
15
13
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
|
|
16
14
|
meta: isly.fromIs("Card.Meta", Meta.is).optional(),
|
|
17
15
|
})
|
|
18
|
-
export const type2: isly2.Object<Changeable> = isly2
|
|
19
|
-
.object<Changeable>({
|
|
20
|
-
limit: isly2
|
|
21
|
-
.tuple(isoly2.Currency.type, isly2.number())
|
|
22
|
-
.optional()
|
|
23
|
-
.rename("Limit")
|
|
24
|
-
.describe("The new limit of the card."),
|
|
25
|
-
meta: isly2.from("Card.Meta", Meta.is).optional().rename("Meta").describe("The new meta data of the card."),
|
|
26
|
-
})
|
|
27
|
-
.rename("Changeable")
|
|
28
|
-
.describe("Changeable card properties.")
|
|
29
16
|
}
|
package/Card/Creatable.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
-
import { isoly as isoly2 } from "isoly2"
|
|
3
2
|
import { isly } from "isly"
|
|
4
|
-
import { isly as isly2 } from "isly2"
|
|
5
3
|
import { Amount } from "../Amount"
|
|
6
4
|
import type { Rule } from "../Rule"
|
|
7
5
|
import { type as ruleType } from "../Rule/type"
|
|
@@ -37,30 +35,4 @@ export namespace Creatable {
|
|
|
37
35
|
key: isly.string().optional(),
|
|
38
36
|
restricted: isly.object<Required<Creatable>["restricted"]>({ to: Restriction.type.optional() }).optional(),
|
|
39
37
|
})
|
|
40
|
-
export const type2 = isly2.object<Creatable>({
|
|
41
|
-
account: isly2.string().rename("Account").describe("The account id the card was created on."),
|
|
42
|
-
number: isly2.string().optional().rename("Number").describe("The card identifier of the user of the api."),
|
|
43
|
-
preset: Preset.type2,
|
|
44
|
-
details: isly2
|
|
45
|
-
.object({ expiry: Expiry.type2, holder: isly2.string() })
|
|
46
|
-
.rename("Details")
|
|
47
|
-
.describe("The card details, the information that will be displayed on the card."),
|
|
48
|
-
limit: isly2
|
|
49
|
-
.tuple(isoly2.Currency.type, isly2.number().rename("Amount").describe("Amount in a specified currency."))
|
|
50
|
-
.rename("Limit")
|
|
51
|
-
.describe("Maximum amount that can be spent on the card."),
|
|
52
|
-
rules: isly2
|
|
53
|
-
.from("Rule", ruleType.is)
|
|
54
|
-
.array()
|
|
55
|
-
.optional()
|
|
56
|
-
.rename("Rules")
|
|
57
|
-
.describe("Card rules that applies to authorizations made with the card."),
|
|
58
|
-
meta: isly2.from("Meta", Meta.is).optional(),
|
|
59
|
-
key: isly2.string().optional(),
|
|
60
|
-
restricted: isly2
|
|
61
|
-
.object<Required<Creatable>["restricted"]>({ to: Restriction.type2.optional() })
|
|
62
|
-
.optional()
|
|
63
|
-
.rename("Restrictions")
|
|
64
|
-
.describe("Set of restrictions that apply to the card."),
|
|
65
|
-
})
|
|
66
38
|
}
|
package/Card/Expiry.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { isly as isly2 } from "isly2"
|
|
4
3
|
|
|
5
4
|
const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] as const
|
|
6
5
|
type Year = (typeof year)[number]
|
|
@@ -11,19 +10,6 @@ type Month = (typeof month)[number]
|
|
|
11
10
|
export type Expiry = [Year, Month]
|
|
12
11
|
export namespace Expiry {
|
|
13
12
|
export const type = isly.tuple<Expiry>(isly.number([...year]), isly.number([...month])) // Deconstructing to remove readonly.
|
|
14
|
-
export const type2: isly2.Tuple<Expiry> = isly2
|
|
15
|
-
.tuple<Expiry>(
|
|
16
|
-
isly2
|
|
17
|
-
.number("value", ...year)
|
|
18
|
-
.rename("Year")
|
|
19
|
-
.describe("Year of expiry."),
|
|
20
|
-
isly2
|
|
21
|
-
.number("value", ...month)
|
|
22
|
-
.rename("Month")
|
|
23
|
-
.describe("Month of expiry.")
|
|
24
|
-
)
|
|
25
|
-
.rename("Expiry")
|
|
26
|
-
.describe("The year and month the card is valid ([yy, mm]).")
|
|
27
13
|
export function toDateTime(expiry: Expiry): isoly.DateTime {
|
|
28
14
|
return isoly.DateTime.nextMonth(
|
|
29
15
|
"20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
-
import { isoly as isoly2 } from "isoly2"
|
|
3
2
|
import { isly } from "isly"
|
|
4
|
-
|
|
3
|
+
|
|
5
4
|
export interface Authorization {
|
|
6
5
|
type: "authorization"
|
|
7
6
|
id: string
|
|
@@ -9,7 +8,6 @@ export interface Authorization {
|
|
|
9
8
|
reason?: string
|
|
10
9
|
created: isoly.DateTime
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
export namespace Authorization {
|
|
14
12
|
export const statuses = ["created", "confirmed", "refunded", "captured", "cancelled"] as const
|
|
15
13
|
export type Status = (typeof statuses)[number]
|
|
@@ -20,14 +18,4 @@ export namespace Authorization {
|
|
|
20
18
|
reason: isly.string().optional(),
|
|
21
19
|
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
22
20
|
})
|
|
23
|
-
export const type2 = isly2.object<Authorization>({
|
|
24
|
-
type: isly2.string("value", "authorization").rename("Operation.Type").describe("Type of operation."),
|
|
25
|
-
id: isly2.string().rename("Id").describe("The id of the operation."),
|
|
26
|
-
status: isly2
|
|
27
|
-
.string("value", ...statuses)
|
|
28
|
-
.rename("Status")
|
|
29
|
-
.describe("The updated status of the operation."),
|
|
30
|
-
reason: isly2.string().optional().rename("Reason").describe("The reason for the status change."),
|
|
31
|
-
created: isoly2.DateTime.type.describe("The time of the operation."),
|
|
32
|
-
})
|
|
33
21
|
}
|
package/Card/Operation/Card.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
|
-
import { isoly as isoly2 } from "isoly2"
|
|
3
2
|
import { isly } from "isly"
|
|
4
|
-
import { isly as isly2 } from "isly2"
|
|
5
3
|
import { Changeable } from "../Changeable"
|
|
6
4
|
|
|
7
5
|
export interface Card {
|
|
@@ -20,16 +18,4 @@ export namespace Card {
|
|
|
20
18
|
from: Changeable.type.optional(),
|
|
21
19
|
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
22
20
|
})
|
|
23
|
-
export const type2: isly2.Object<Card> = isly2
|
|
24
|
-
.object<Card>({
|
|
25
|
-
type: isly2.string("value", "card").rename("Type").describe("Type of operation."),
|
|
26
|
-
status: isly2
|
|
27
|
-
.string("value", ...statuses)
|
|
28
|
-
.rename("Status")
|
|
29
|
-
.describe("The updated status of the card."),
|
|
30
|
-
from: Changeable.type2.optional(),
|
|
31
|
-
created: isoly2.DateTime.type.rename("Created").describe("The time of the operation."),
|
|
32
|
-
})
|
|
33
|
-
.describe("A card operation.")
|
|
34
|
-
.rename("Operation.Card")
|
|
35
21
|
}
|
package/Card/Operation/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { isly as isly2 } from "isly2"
|
|
4
3
|
import { Authorization } from "../../Authorization"
|
|
5
4
|
import { Entry } from "../../Settlement/Entry"
|
|
6
5
|
import { Authorization as OperationAuthorization } from "./Authorization"
|
|
@@ -28,8 +27,4 @@ export namespace Operation {
|
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
export const type = isly.union(Card.type, OperationAuthorization.type)
|
|
31
|
-
export const type2: isly2.Union<Operation> = isly2
|
|
32
|
-
.union<Operation>(Card.type2, OperationAuthorization.type2)
|
|
33
|
-
.rename("Operation")
|
|
34
|
-
.describe("An operation performed on a card.")
|
|
35
30
|
}
|
package/Card/Preset.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { isly as isly2 } from "isly2"
|
|
3
2
|
import { Realm } from "../Realm"
|
|
4
3
|
import { Stack } from "./Stack"
|
|
5
4
|
|
|
@@ -25,10 +24,6 @@ export namespace Preset {
|
|
|
25
24
|
"test-diners-175",
|
|
26
25
|
] as const
|
|
27
26
|
export const type = isly.string<Preset>(names)
|
|
28
|
-
export const type2 = isly2
|
|
29
|
-
.string<Preset>("value", ...names)
|
|
30
|
-
.rename("Preset")
|
|
31
|
-
.describe("Card configuration (iin/scheme/interchange).")
|
|
32
27
|
export const forRealm: Record<Realm, Preset[]> = {
|
|
33
28
|
test: ["test-pg-150", "test-pg-200", "test-ta-mc-200", "test-ta-pg-200", "test-ta-pg-bc-200", "test-diners-175"],
|
|
34
29
|
uk: [
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { isly as isly2 } from "isly2"
|
|
3
2
|
import { typedly } from "typedly"
|
|
4
3
|
import { Rail } from "../../Rail"
|
|
5
4
|
import { merchants } from "./merchants"
|
|
@@ -9,7 +8,6 @@ export type Merchant = (typeof Merchant.values)[number]
|
|
|
9
8
|
export namespace Merchant {
|
|
10
9
|
export const values = typedly.Object.keys(merchants)
|
|
11
10
|
export const type = isly.string<Merchant>(values)
|
|
12
|
-
export const type2 = isly2.string<Merchant>("value", ...values)
|
|
13
11
|
export function check(merchant: Merchant, counterpart: Rail.Address.Card.Counterpart): boolean {
|
|
14
12
|
const attribute: Attribute = merchants[merchant]
|
|
15
13
|
let result: boolean
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { isly as isly2 } from "isly2"
|
|
3
2
|
import type { Transaction } from "../../Transaction"
|
|
4
3
|
import { Merchant as RestrictionsMerchant } from "./Merchant"
|
|
5
4
|
|
|
@@ -9,13 +8,6 @@ export interface Restriction {
|
|
|
9
8
|
export namespace Restriction {
|
|
10
9
|
export import Merchant = RestrictionsMerchant
|
|
11
10
|
export const type = isly.object<Restriction>({ merchants: Merchant.type.array().optional() })
|
|
12
|
-
export const type2 = isly2.object<Restriction>({
|
|
13
|
-
merchants: Merchant.type2
|
|
14
|
-
.array()
|
|
15
|
-
.optional()
|
|
16
|
-
.rename("Merchants")
|
|
17
|
-
.describe("List of merchants that the card can be used with."),
|
|
18
|
-
})
|
|
19
11
|
export function check(
|
|
20
12
|
restrictions: Restriction,
|
|
21
13
|
transaction: Transaction.Creatable.CardTransaction | Transaction.PreTransaction.Authorization
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isly } from "
|
|
1
|
+
import { isly } from "isly"
|
|
2
2
|
|
|
3
3
|
export interface Merchant {
|
|
4
4
|
name: string
|
|
@@ -23,6 +23,6 @@ export namespace Merchant {
|
|
|
23
23
|
startsWith: value.startsWith && (Array.isArray(value.startsWith) ? value.startsWith : [value.startsWith]),
|
|
24
24
|
contains: value.contains && (Array.isArray(value.contains) ? value.contains : [value.contains]),
|
|
25
25
|
}
|
|
26
|
-
return type.
|
|
26
|
+
return type.get(result)
|
|
27
27
|
}
|
|
28
28
|
}
|
package/Card/Scheme.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { isly as isly2 } from "isly2"
|
|
3
2
|
|
|
4
3
|
export type Scheme = (typeof Scheme.schemes)[number]
|
|
5
4
|
export namespace Scheme {
|
|
6
5
|
export const schemes = ["mastercard", "diners", "visa"] as const
|
|
7
6
|
export const type = isly.string<Scheme>(schemes)
|
|
8
|
-
export const type2 = isly2
|
|
9
|
-
.string<Scheme>("value", ...schemes)
|
|
10
|
-
.rename("Scheme")
|
|
11
|
-
.describe("Card scheme.")
|
|
12
7
|
}
|
package/Card/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { isly as isly2 } from "isly2"
|
|
4
3
|
import { Amount } from "../Amount"
|
|
5
4
|
import { Realm } from "../Realm"
|
|
6
5
|
import { Report } from "../Report"
|
|
@@ -76,42 +75,6 @@ export namespace Card {
|
|
|
76
75
|
meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
|
|
77
76
|
restricted: isly.object<Required<Card>["restricted"]>({ to: CardRestriction.type.optional() }).optional(),
|
|
78
77
|
})
|
|
79
|
-
export const type2: isly2.Object<Card> = isly2
|
|
80
|
-
.object<Card>({
|
|
81
|
-
id: isly2.string().rename("Id").describe("Unique 16 character base 64 identifier."),
|
|
82
|
-
number: isly2.string().optional().rename("Number").describe("Api users identifier."),
|
|
83
|
-
created: isly2.string().rename("Created").describe("Date and time of creation."),
|
|
84
|
-
organization: isly2.string().rename("Organization").describe("Organization code."),
|
|
85
|
-
realm: Realm.type2,
|
|
86
|
-
account: isly2.string().rename("Account").describe("Account identifier."),
|
|
87
|
-
preset: CardPreset.type2,
|
|
88
|
-
scheme: CardScheme.type2,
|
|
89
|
-
reference: isly2.string().rename("Reference").describe("Reference to external system."),
|
|
90
|
-
details: isly2.object<Card["details"]>({
|
|
91
|
-
iin: isly2.string().rename("Iin").describe("First 6-8 numbers of the pan."),
|
|
92
|
-
last4: isly2.string().rename("Last4").describe("Last four digits of pan."),
|
|
93
|
-
expiry: CardExpiry.type2,
|
|
94
|
-
holder: isly2.string().rename("Holder").describe("Card holder name."),
|
|
95
|
-
token: isly2.string().optional().rename("Token").describe("Encrypted token of the card."),
|
|
96
|
-
}),
|
|
97
|
-
limit: Amount.type2.rename("Limit").describe("Maximum amount that can be spent on the card."),
|
|
98
|
-
spent: Amount.type2.rename("Spent").describe("Amount spent on the card."),
|
|
99
|
-
status: isly2.string("value", ["active", "cancelled"]).rename("Status").describe("Current card status."),
|
|
100
|
-
history: CardOperation.type2.array().rename("History").describe("Card operation history."),
|
|
101
|
-
rules: isly2
|
|
102
|
-
.from("Rule", ruleType.is)
|
|
103
|
-
.array()
|
|
104
|
-
.rename("Rules")
|
|
105
|
-
.describe("Card rules that applies to authorizations made with the card."),
|
|
106
|
-
meta: isly2.from("Card.Meta", CardMeta.is).optional().rename("Meta").describe("Additional card information."),
|
|
107
|
-
restricted: isly2
|
|
108
|
-
.object<Required<Card>["restricted"]>({ to: CardRestriction.type2.optional() })
|
|
109
|
-
.optional()
|
|
110
|
-
.rename("Restrictions")
|
|
111
|
-
.describe("Set of restrictions that apply to the card."),
|
|
112
|
-
})
|
|
113
|
-
.rename("Card")
|
|
114
|
-
.describe("Card information.")
|
|
115
78
|
const csvMap: Record<string, (card: Card) => string | number | undefined> = {
|
|
116
79
|
id: card => card.id,
|
|
117
80
|
created: card => readableDate(card.created),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
3
|
import { http } from "cloudly-http"
|
|
4
|
-
import { isly } from "isly2"
|
|
5
4
|
import { Card } from "../../Card"
|
|
6
5
|
import { Operation } from "../../Operation"
|
|
7
6
|
import { Rail } from "../../Rail"
|
|
@@ -62,24 +61,4 @@ export namespace Transactions {
|
|
|
62
61
|
rail?: Rail
|
|
63
62
|
type?: Transaction.Types
|
|
64
63
|
}
|
|
65
|
-
export namespace Query {
|
|
66
|
-
export const type = isly.object({
|
|
67
|
-
id: isly.string().optional(),
|
|
68
|
-
account: isly.string().optional(),
|
|
69
|
-
limit: isly.number().optional(),
|
|
70
|
-
cursor: isly.string().optional(),
|
|
71
|
-
start: isly.string().optional(),
|
|
72
|
-
end: isly.string().optional(),
|
|
73
|
-
currency: isly.string().optional(),
|
|
74
|
-
organization: isly.string().optional(),
|
|
75
|
-
rail: Rail.type2.optional(),
|
|
76
|
-
type: isly.string("value", ...Transaction.types).optional(),
|
|
77
|
-
})
|
|
78
|
-
export function parse(query: string | http.Request["search"]): Query {
|
|
79
|
-
if (typeof query == "string") {
|
|
80
|
-
query = query ? http.Search.parse(query.replace("?", "")) : {}
|
|
81
|
-
} // search.parse does not support empty string
|
|
82
|
-
return type.prune(query) ?? {}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
64
|
}
|
package/Rail/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { isly as isly2 } from "isly2"
|
|
3
2
|
import { Address as RailAddress } from "./Address"
|
|
4
3
|
|
|
5
4
|
export type Rail = (typeof Rail.rails)[number]
|
|
@@ -18,6 +17,5 @@ export namespace Rail {
|
|
|
18
17
|
"credit",
|
|
19
18
|
] as const
|
|
20
19
|
export const type = isly.string<Rail>(rails)
|
|
21
|
-
export const type2 = isly2.string<Rail>("value", ...rails)
|
|
22
20
|
export import Address = RailAddress
|
|
23
21
|
}
|
package/Realm.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { isly as isly2 } from "isly2"
|
|
4
3
|
import { Supplier as modelSupplier } from "./Supplier"
|
|
5
4
|
import { zod } from "./zod"
|
|
6
5
|
|
|
@@ -10,10 +9,6 @@ export namespace Realm {
|
|
|
10
9
|
export const realms = ["test", "uk", "eea"] as const
|
|
11
10
|
export const type = isly.string<Realm>(realms)
|
|
12
11
|
export const typeZod = zod.enum(realms)
|
|
13
|
-
export const type2 = isly2
|
|
14
|
-
.string<Realm>("value", ...realms)
|
|
15
|
-
.rename("Realm")
|
|
16
|
-
.describe("Financial jurisdiction.")
|
|
17
12
|
export function toString(): string {
|
|
18
13
|
return realms.toString().replaceAll(",", ", ") + "."
|
|
19
14
|
}
|
package/Rule/Base.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import { isly as isly2 } from "isly2"
|
|
3
2
|
import { Preset } from "../Card/Preset"
|
|
4
3
|
|
|
5
4
|
export interface Base {
|
|
@@ -18,10 +17,6 @@ export namespace Base {
|
|
|
18
17
|
export namespace Kind {
|
|
19
18
|
export const values = ["authorization", "outbound", "inbound", "capture", "refund"] as const
|
|
20
19
|
export const type = isly.string<Kind>(values)
|
|
21
|
-
export const type2 = isly2
|
|
22
|
-
.string<Kind>("value", ...values)
|
|
23
|
-
.rename("Kind")
|
|
24
|
-
.describe("The type of the rule.")
|
|
25
20
|
export function is(kind: Kind, rule: Base, groups: string[] | undefined, preset: Preset | undefined): boolean {
|
|
26
21
|
const applyRuleForGroup =
|
|
27
22
|
!rule.groups || rule.groups.some(ruleGroup => groups?.some(organizationGroup => organizationGroup == ruleGroup))
|
|
@@ -33,10 +28,6 @@ export namespace Base {
|
|
|
33
28
|
export namespace Category {
|
|
34
29
|
export const values = ["fincrime", "product", "customer"] as const
|
|
35
30
|
export const type = isly.string<Category>(values)
|
|
36
|
-
export const type2 = isly2
|
|
37
|
-
.string<Category>("value", ...values)
|
|
38
|
-
.rename("Category")
|
|
39
|
-
.describe("The category of the rule.")
|
|
40
31
|
}
|
|
41
32
|
export const type = isly.object<Base>({
|
|
42
33
|
code: isly.string(/^[a-z0-9\-_]+$/),
|
|
@@ -49,21 +40,4 @@ export namespace Base {
|
|
|
49
40
|
groups: isly.string().array().optional(),
|
|
50
41
|
presets: Preset.type.array().optional(),
|
|
51
42
|
})
|
|
52
|
-
export const type2 = isly2.object<Base>({
|
|
53
|
-
code: isly2
|
|
54
|
-
.string("value", /^[a-z0-9\-_]+$/)
|
|
55
|
-
.rename("Code")
|
|
56
|
-
.describe("The unique identifier of the rule."),
|
|
57
|
-
name: isly2.string().rename("Name").describe("The name of the rule."),
|
|
58
|
-
description: isly2.string().rename("Description").describe("The description of the rule."),
|
|
59
|
-
type: Kind.type2,
|
|
60
|
-
category: Category.type2,
|
|
61
|
-
condition: isly2
|
|
62
|
-
.string()
|
|
63
|
-
.rename("Condition")
|
|
64
|
-
.describe("The condition to evaluate, determines if the action is applied or not."),
|
|
65
|
-
flags: isly2.string().array().rename("Flags").describe("The flags to set when the rule is applied."),
|
|
66
|
-
groups: isly2.string().array().optional().rename("Groups").describe("The groups the rule applies to."),
|
|
67
|
-
presets: Preset.type2.array().optional().rename("Presets").describe("The presets the rule applies to."),
|
|
68
|
-
})
|
|
69
43
|
}
|
package/Rule/Other.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { isly as isly2 } from "isly2"
|
|
4
3
|
import type { Note } from "../Transaction/Note"
|
|
5
4
|
import { Base } from "./Base"
|
|
6
5
|
import { control } from "./control"
|
|
@@ -14,13 +13,8 @@ export namespace Other {
|
|
|
14
13
|
export namespace Action {
|
|
15
14
|
export const values = ["review", "reject", "flag"] as const
|
|
16
15
|
export const type = isly.string<Action>(values)
|
|
17
|
-
export const type2 = isly2
|
|
18
|
-
.string<Action>("value", ...values)
|
|
19
|
-
.rename("Action")
|
|
20
|
-
.describe("The action to take when the rule is applied.")
|
|
21
16
|
}
|
|
22
17
|
export const type = Base.type.extend<Other>({ action: Action.type })
|
|
23
|
-
export const type2: isly2.Object<Other> = Base.type2.extend<Other>({ action: Action.type2 })
|
|
24
18
|
export function evaluate(
|
|
25
19
|
rules: Other[],
|
|
26
20
|
state: State
|
package/Rule/type.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// import { isly as isly2 } from "isly2"
|
|
2
1
|
import { Other } from "./Other"
|
|
3
2
|
|
|
4
3
|
export const type = Other.type
|
|
5
|
-
// TODO: Implement type2
|
|
6
|
-
// export const type2 = isly2
|
|
7
|
-
// .union<Rule, Other, Score, Charge.Api, Reserve>(Other.type2, Score.type2, Charge.Api.type2, Reserve.type2)
|
|
8
|
-
// .describe("Changes what how the rules is applied.")
|
package/dist/cjs/Amount.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
-
import { isly as isly2 } from "isly2";
|
|
4
3
|
import { Amounts } from "./Amounts";
|
|
5
4
|
export type Amount = [isoly.Currency, number];
|
|
6
5
|
export declare namespace Amount {
|
|
7
6
|
function toAmounts(amount?: Amount): Amounts;
|
|
8
7
|
const type: isly.Type<Amount>;
|
|
9
|
-
const type2: isly2.Tuple<Amount>;
|
|
10
8
|
}
|
package/dist/cjs/Amount.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Amount = void 0;
|
|
4
4
|
const isoly_1 = require("isoly");
|
|
5
|
-
const isoly2_1 = require("isoly2");
|
|
6
5
|
const isly_1 = require("isly");
|
|
7
|
-
const isly2_1 = require("isly2");
|
|
8
6
|
var Amount;
|
|
9
7
|
(function (Amount) {
|
|
10
8
|
function toAmounts(amount) {
|
|
@@ -12,6 +10,5 @@ var Amount;
|
|
|
12
10
|
}
|
|
13
11
|
Amount.toAmounts = toAmounts;
|
|
14
12
|
Amount.type = isly_1.isly.tuple(isly_1.isly.string(isoly_1.isoly.Currency.values), isly_1.isly.number());
|
|
15
|
-
Amount.type2 = isly2_1.isly.tuple(isoly2_1.isoly.Currency.type, isly2_1.isly.number().rename("Amount").describe("Amount in a specified currency."));
|
|
16
13
|
})(Amount || (exports.Amount = Amount = {}));
|
|
17
14
|
//# sourceMappingURL=Amount.js.map
|
package/dist/cjs/Amount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B
|
|
1
|
+
{"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAK3B,IAAiB,MAAM,CAKtB;AALD,WAAiB,MAAM;IACtB,SAAgB,SAAS,CAAC,MAAe;QACxC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3D,CAAC;IAFe,gBAAS,YAExB,CAAA;IACY,WAAI,GAAG,WAAI,CAAC,KAAK,CAAS,WAAI,CAAC,MAAM,CAAC,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAA;AAC1F,CAAC,EALgB,MAAM,sBAAN,MAAM,QAKtB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isly as isly2 } from "isly2";
|
|
2
1
|
import { Amount } from "../Amount";
|
|
3
2
|
import { Meta } from "./Meta";
|
|
4
3
|
export type Changeable = {
|
|
@@ -7,5 +6,4 @@ export type Changeable = {
|
|
|
7
6
|
};
|
|
8
7
|
export declare namespace Changeable {
|
|
9
8
|
const type: import("isly/dist/cjs/object").IslyObject<Changeable, object>;
|
|
10
|
-
const type2: isly2.Object<Changeable>;
|
|
11
9
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Changeable = void 0;
|
|
4
4
|
const isoly_1 = require("isoly");
|
|
5
|
-
const isoly2_1 = require("isoly2");
|
|
6
5
|
const isly_1 = require("isly");
|
|
7
|
-
const isly2_1 = require("isly2");
|
|
8
6
|
const Meta_1 = require("./Meta");
|
|
9
7
|
var Changeable;
|
|
10
8
|
(function (Changeable) {
|
|
@@ -12,16 +10,5 @@ var Changeable;
|
|
|
12
10
|
limit: isly_1.isly.tuple(isly_1.isly.fromIs("isoly.Currency", isoly_1.isoly.Currency.is), isly_1.isly.number()).optional(),
|
|
13
11
|
meta: isly_1.isly.fromIs("Card.Meta", Meta_1.Meta.is).optional(),
|
|
14
12
|
});
|
|
15
|
-
Changeable.type2 = isly2_1.isly
|
|
16
|
-
.object({
|
|
17
|
-
limit: isly2_1.isly
|
|
18
|
-
.tuple(isoly2_1.isoly.Currency.type, isly2_1.isly.number())
|
|
19
|
-
.optional()
|
|
20
|
-
.rename("Limit")
|
|
21
|
-
.describe("The new limit of the card."),
|
|
22
|
-
meta: isly2_1.isly.from("Card.Meta", Meta_1.Meta.is).optional().rename("Meta").describe("The new meta data of the card."),
|
|
23
|
-
})
|
|
24
|
-
.rename("Changeable")
|
|
25
|
-
.describe("Changeable card properties.");
|
|
26
13
|
})(Changeable || (exports.Changeable = Changeable = {}));
|
|
27
14
|
//# sourceMappingURL=Changeable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changeable.js","sourceRoot":"","sources":["../../../Card/Changeable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B
|
|
1
|
+
{"version":3,"file":"Changeable.js","sourceRoot":"","sources":["../../../Card/Changeable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAE3B,iCAA6B;AAO7B,IAAiB,UAAU,CAK1B;AALD,WAAiB,UAAU;IACb,eAAI,GAAG,WAAI,CAAC,MAAM,CAAa;QAC3C,KAAK,EAAE,WAAI,CAAC,KAAK,CAAC,WAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC7F,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,WAAW,EAAE,WAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAClD,CAAC,CAAA;AACH,CAAC,EALgB,UAAU,0BAAV,UAAU,QAK1B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
|
-
import { isly as isly2 } from "isly2";
|
|
3
2
|
import { Amount } from "../Amount";
|
|
4
3
|
import type { Rule } from "../Rule";
|
|
5
4
|
import { Expiry } from "./Expiry";
|
|
@@ -24,5 +23,4 @@ export interface Creatable {
|
|
|
24
23
|
}
|
|
25
24
|
export declare namespace Creatable {
|
|
26
25
|
const type: import("isly/dist/cjs/object").IslyObject<Creatable, object>;
|
|
27
|
-
const type2: isly2.Object<Creatable>;
|
|
28
26
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Creatable = void 0;
|
|
4
4
|
const isoly_1 = require("isoly");
|
|
5
|
-
const isoly2_1 = require("isoly2");
|
|
6
5
|
const isly_1 = require("isly");
|
|
7
|
-
const isly2_1 = require("isly2");
|
|
8
6
|
const type_1 = require("../Rule/type");
|
|
9
7
|
const Expiry_1 = require("./Expiry");
|
|
10
8
|
const Meta_1 = require("./Meta");
|
|
@@ -23,31 +21,5 @@ var Creatable;
|
|
|
23
21
|
key: isly_1.isly.string().optional(),
|
|
24
22
|
restricted: isly_1.isly.object({ to: Restriction_1.Restriction.type.optional() }).optional(),
|
|
25
23
|
});
|
|
26
|
-
Creatable.type2 = isly2_1.isly.object({
|
|
27
|
-
account: isly2_1.isly.string().rename("Account").describe("The account id the card was created on."),
|
|
28
|
-
number: isly2_1.isly.string().optional().rename("Number").describe("The card identifier of the user of the api."),
|
|
29
|
-
preset: Preset_1.Preset.type2,
|
|
30
|
-
details: isly2_1.isly
|
|
31
|
-
.object({ expiry: Expiry_1.Expiry.type2, holder: isly2_1.isly.string() })
|
|
32
|
-
.rename("Details")
|
|
33
|
-
.describe("The card details, the information that will be displayed on the card."),
|
|
34
|
-
limit: isly2_1.isly
|
|
35
|
-
.tuple(isoly2_1.isoly.Currency.type, isly2_1.isly.number().rename("Amount").describe("Amount in a specified currency."))
|
|
36
|
-
.rename("Limit")
|
|
37
|
-
.describe("Maximum amount that can be spent on the card."),
|
|
38
|
-
rules: isly2_1.isly
|
|
39
|
-
.from("Rule", type_1.type.is)
|
|
40
|
-
.array()
|
|
41
|
-
.optional()
|
|
42
|
-
.rename("Rules")
|
|
43
|
-
.describe("Card rules that applies to authorizations made with the card."),
|
|
44
|
-
meta: isly2_1.isly.from("Meta", Meta_1.Meta.is).optional(),
|
|
45
|
-
key: isly2_1.isly.string().optional(),
|
|
46
|
-
restricted: isly2_1.isly
|
|
47
|
-
.object({ to: Restriction_1.Restriction.type2.optional() })
|
|
48
|
-
.optional()
|
|
49
|
-
.rename("Restrictions")
|
|
50
|
-
.describe("Set of restrictions that apply to the card."),
|
|
51
|
-
});
|
|
52
24
|
})(Creatable || (exports.Creatable = Creatable = {}));
|
|
53
25
|
//# sourceMappingURL=Creatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"","sources":["../../../Card/Creatable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"","sources":["../../../Card/Creatable.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAG3B,uCAA+C;AAC/C,qCAAiC;AACjC,iCAA6B;AAC7B,qCAAiC;AACjC,+CAA2C;AAiB3C,IAAiB,SAAS,CAYzB;AAZD,WAAiB,SAAS;IACZ,cAAI,GAAG,WAAI,CAAC,MAAM,CAAY;QAC1C,OAAO,EAAE,WAAI,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,MAAM,EAAE,eAAM,CAAC,IAAI;QACnB,OAAO,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,eAAM,CAAC,IAAI,EAAE,MAAM,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QACpE,KAAK,EAAE,WAAI,CAAC,KAAK,CAAC,WAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC;QAClF,KAAK,EAAE,WAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QAClC,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC,WAAW,EAAE,WAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;QAClD,GAAG,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,UAAU,EAAE,WAAI,CAAC,MAAM,CAAoC,EAAE,EAAE,EAAE,yBAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC1G,CAAC,CAAA;AACH,CAAC,EAZgB,SAAS,yBAAT,SAAS,QAYzB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
-
import { isly as isly2 } from "isly2";
|
|
4
3
|
declare const year: readonly [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
|
|
5
4
|
type Year = (typeof year)[number];
|
|
6
5
|
declare const month: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
@@ -8,7 +7,6 @@ type Month = (typeof month)[number];
|
|
|
8
7
|
export type Expiry = [Year, Month];
|
|
9
8
|
export declare namespace Expiry {
|
|
10
9
|
const type: isly.Type<Expiry>;
|
|
11
|
-
const type2: isly2.Tuple<Expiry>;
|
|
12
10
|
function toDateTime(expiry: Expiry): isoly.DateTime;
|
|
13
11
|
function isExpired(expiry: Expiry): boolean;
|
|
14
12
|
}
|
package/dist/cjs/Card/Expiry.js
CHANGED
|
@@ -3,22 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Expiry = void 0;
|
|
4
4
|
const isoly_1 = require("isoly");
|
|
5
5
|
const isly_1 = require("isly");
|
|
6
|
-
const isly2_1 = require("isly2");
|
|
7
6
|
const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
|
|
8
7
|
const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
9
8
|
var Expiry;
|
|
10
9
|
(function (Expiry) {
|
|
11
10
|
Expiry.type = isly_1.isly.tuple(isly_1.isly.number([...year]), isly_1.isly.number([...month]));
|
|
12
|
-
Expiry.type2 = isly2_1.isly
|
|
13
|
-
.tuple(isly2_1.isly
|
|
14
|
-
.number("value", ...year)
|
|
15
|
-
.rename("Year")
|
|
16
|
-
.describe("Year of expiry."), isly2_1.isly
|
|
17
|
-
.number("value", ...month)
|
|
18
|
-
.rename("Month")
|
|
19
|
-
.describe("Month of expiry."))
|
|
20
|
-
.rename("Expiry")
|
|
21
|
-
.describe("The year and month the card is valid ([yy, mm]).");
|
|
22
11
|
function toDateTime(expiry) {
|
|
23
12
|
return isoly_1.isoly.DateTime.nextMonth("20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z");
|
|
24
13
|
}
|