@xyo-network/payment-payload-plugins 3.2.0 → 3.2.2
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/dist/neutral/Amount/Payload.d.ts +12 -2
- package/dist/neutral/Amount/Payload.d.ts.map +1 -1
- package/dist/neutral/Billing/Address/Address.d.ts +196 -2
- package/dist/neutral/Billing/Address/Address.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +13 -3
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +12 -3
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +13 -3
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +15 -15
- package/dist/neutral/Discount/Payload/Discount.d.ts +26 -0
- package/dist/neutral/Discount/Payload/Discount.d.ts.map +1 -1
- package/dist/neutral/Escrow/Outcome.d.ts +9 -2
- package/dist/neutral/Escrow/Outcome.d.ts.map +1 -1
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +100 -2
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +1 -1
- package/dist/neutral/Payment/Status/Payload.d.ts +12 -2
- package/dist/neutral/Payment/Status/Payload.d.ts.map +1 -1
- package/dist/neutral/Purchase/Payload.d.ts +12 -2
- package/dist/neutral/Purchase/Payload.d.ts.map +1 -1
- package/dist/neutral/Receipt/Payload.d.ts +12 -2
- package/dist/neutral/Receipt/Payload.d.ts.map +1 -1
- package/dist/neutral/index.mjs +104 -20
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/Amount/Payload.ts +6 -1
- package/src/Billing/Address/Address.ts +6 -1
- package/src/Discount/Payload/Coupon/Coupons/FixedAmount.ts +6 -4
- package/src/Discount/Payload/Coupon/Coupons/FixedPercentage.ts +8 -4
- package/src/Discount/Payload/Coupon/Coupons/FixedPrice.ts +6 -4
- package/src/Discount/Payload/Discount.ts +6 -1
- package/src/Escrow/Outcome.ts +6 -1
- package/src/Payment/Instrument/Card/Payload.ts +6 -1
- package/src/Payment/Status/Payload.ts +6 -1
- package/src/Purchase/Payload.ts +6 -1
- package/src/Receipt/Payload.ts +6 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
-
import type { PayloadWithOptionalSources } from '@xyo-network/payload-model'
|
|
2
|
+
import type { PayloadWithOptionalSources, WithSources } from '@xyo-network/payload-model'
|
|
3
3
|
import {
|
|
4
4
|
isPayloadOfSchemaType,
|
|
5
5
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -23,10 +23,12 @@ export type FixedPriceCoupon = PayloadWithOptionalSources<FixedPriceCouponFields
|
|
|
23
23
|
* Identity function for determining if an object is an FixedPriceCoupon
|
|
24
24
|
*/
|
|
25
25
|
export const isFixedPriceCoupon = isPayloadOfSchemaType<FixedPriceCoupon>(FixedPriceCouponSchema)
|
|
26
|
-
export const asFixedPriceCoupon = AsObjectFactory.create(isFixedPriceCoupon)
|
|
26
|
+
export const asFixedPriceCoupon = AsObjectFactory.create<FixedPriceCoupon>(isFixedPriceCoupon)
|
|
27
|
+
export const asOptionalFixedPriceCoupon = AsObjectFactory.createOptional<FixedPriceCoupon>(isFixedPriceCoupon)
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Identity function for determining if an object is an FixedPriceCoupon with sources
|
|
30
31
|
*/
|
|
31
|
-
export const isFixedPriceCouponWithSources = isPayloadOfSchemaTypeWithSources<FixedPriceCoupon
|
|
32
|
-
export const asFixedPriceCouponWithSources = AsObjectFactory.create(isFixedPriceCouponWithSources)
|
|
32
|
+
export const isFixedPriceCouponWithSources = isPayloadOfSchemaTypeWithSources<WithSources<FixedPriceCoupon>>(FixedPriceCouponSchema)
|
|
33
|
+
export const asFixedPriceCouponWithSources = AsObjectFactory.create<WithSources<FixedPriceCoupon>>(isFixedPriceCouponWithSources)
|
|
34
|
+
export const asOptionalFixedPriceCouponWithSources = AsObjectFactory.createOptional<WithSources<FixedPriceCoupon>>(isFixedPriceCouponWithSources)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
+
import type { PayloadWithOptionalSources, WithSources } from '@xyo-network/payload-model'
|
|
2
3
|
import {
|
|
3
4
|
isPayloadOfSchemaType,
|
|
4
5
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -20,8 +21,12 @@ export type Discount = PayloadWithOptionalSources<DiscountFields, DiscountSchema
|
|
|
20
21
|
* Identity function for determining if an object is an Discount
|
|
21
22
|
*/
|
|
22
23
|
export const isDiscount = isPayloadOfSchemaType<Discount>(DiscountSchema)
|
|
24
|
+
export const asDiscount = AsObjectFactory.create<Discount>(isDiscount)
|
|
25
|
+
export const asOptionalDiscount = AsObjectFactory.createOptional<Discount>(isDiscount)
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
* Identity function for determining if an object is an Discount with sources
|
|
26
29
|
*/
|
|
27
30
|
export const isDiscountWithSources = isPayloadOfSchemaTypeWithSources<Discount>(DiscountSchema)
|
|
31
|
+
export const asDiscountWithSources = AsObjectFactory.create<WithSources<Discount>>(isDiscountWithSources)
|
|
32
|
+
export const asOptionalDiscountWithSources = AsObjectFactory.createOptional<WithSources<Discount>>(isDiscountWithSources)
|
package/src/Escrow/Outcome.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import
|
|
2
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
3
|
+
import type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'
|
|
3
4
|
import {
|
|
4
5
|
isPayloadOfSchemaType,
|
|
5
6
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -29,8 +30,12 @@ export type EscrowOutcome = PayloadWithSources<EscrowOutcomeFields, EscrowOutcom
|
|
|
29
30
|
* Identity function for determining if an object is an EscrowOutcome
|
|
30
31
|
*/
|
|
31
32
|
export const isEscrowOutcome = isPayloadOfSchemaType<EscrowOutcome>(EscrowOutcomeSchema)
|
|
33
|
+
export const asEscrowOutcome = AsObjectFactory.create<EscrowOutcome>(isEscrowOutcome)
|
|
34
|
+
export const asOptionalEscrowOutcome = AsObjectFactory.createOptional<EscrowOutcome>(isEscrowOutcome)
|
|
32
35
|
|
|
33
36
|
/**
|
|
34
37
|
* Identity function for determining if an object is an EscrowOutcome with sources
|
|
35
38
|
*/
|
|
36
39
|
export const isEscrowOutcomeWithSources = isPayloadOfSchemaTypeWithSources<EscrowOutcome>(EscrowOutcomeSchema)
|
|
40
|
+
export const asEscrowOutcomeWithSources = AsObjectFactory.createOptional<WithSources<EscrowOutcome>>(isEscrowOutcomeWithSources)
|
|
41
|
+
export const asOptionalEscrowOutcomeWithSources = AsObjectFactory.createOptional<WithSources<EscrowOutcome>>(isEscrowOutcomeWithSources)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
+
import type { Payload, WithSources } from '@xyo-network/payload-model'
|
|
2
3
|
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
3
4
|
|
|
4
5
|
import { PaymentCardSchema } from './Schema.ts'
|
|
@@ -38,8 +39,12 @@ export type PaymentCard = Payload<PaymentCardFields, PaymentCardSchema>
|
|
|
38
39
|
* Identity function for determine if an object is a PaymentCard
|
|
39
40
|
*/
|
|
40
41
|
export const isPaymentCard = isPayloadOfSchemaType<PaymentCard>(PaymentCardSchema)
|
|
42
|
+
export const asPaymentCard = AsObjectFactory.create<PaymentCard>(isPaymentCard)
|
|
43
|
+
export const asOptionalPaymentCard = AsObjectFactory.createOptional<PaymentCard>(isPaymentCard)
|
|
41
44
|
|
|
42
45
|
/**
|
|
43
46
|
* Identity function for determine if an object is a PaymentCard with sources
|
|
44
47
|
*/
|
|
45
48
|
export const isPaymentCardWithSources = isPayloadOfSchemaTypeWithSources<PaymentCard>(PaymentCardSchema)
|
|
49
|
+
export const asPaymentCardWithSources = AsObjectFactory.create<WithSources<PaymentCard>>(isPaymentCardWithSources)
|
|
50
|
+
export const asOptionalPaymentCardWithSources = AsObjectFactory.createOptional<WithSources<PaymentCard>>(isPaymentCardWithSources)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
+
import type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'
|
|
2
3
|
import {
|
|
3
4
|
isPayloadOfSchemaType,
|
|
4
5
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -27,8 +28,12 @@ export type PaymentStatus = PayloadWithSources<PaymentStatusFields, PaymentStatu
|
|
|
27
28
|
* Identity function for determine if an object is a PaymentStatus
|
|
28
29
|
*/
|
|
29
30
|
export const isPaymentStatus = isPayloadOfSchemaType<PaymentStatus>(PaymentStatusSchema)
|
|
31
|
+
export const asPaymentStatus = AsObjectFactory.create<PaymentStatus>(isPaymentStatus)
|
|
32
|
+
export const asOptionalPaymentStatus = AsObjectFactory.createOptional<PaymentStatus>(isPaymentStatus)
|
|
30
33
|
|
|
31
34
|
/**
|
|
32
35
|
* Identity function for determine if an object is a PaymentStatus with sources
|
|
33
36
|
*/
|
|
34
37
|
export const isPaymentStatusWithSources = isPayloadOfSchemaTypeWithSources<PaymentStatus>(PaymentStatusSchema)
|
|
38
|
+
export const asPaymentStatusWithSources = AsObjectFactory.create<WithSources<PaymentStatus>>(isPaymentStatusWithSources)
|
|
39
|
+
export const asOptionalPaymentStatusWithSources = AsObjectFactory.createOptional<WithSources<PaymentStatus>>(isPaymentStatusWithSources)
|
package/src/Purchase/Payload.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import
|
|
2
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
3
|
+
import type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'
|
|
3
4
|
import {
|
|
4
5
|
isPayloadOfSchemaType,
|
|
5
6
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -28,8 +29,12 @@ export type Purchase = PayloadWithSources<PurchaseFields, PurchaseSchema>
|
|
|
28
29
|
* Identity function for determine if an object is a Purchase
|
|
29
30
|
*/
|
|
30
31
|
export const isPurchase = isPayloadOfSchemaType<Purchase>(PurchaseSchema)
|
|
32
|
+
export const asPurchase = AsObjectFactory.create<Purchase>(isPurchase)
|
|
33
|
+
export const asOptionalPurchase = AsObjectFactory.createOptional<Purchase>(isPurchase)
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* Identity function for determine if an object is a Purchase with sources
|
|
34
37
|
*/
|
|
35
38
|
export const isPurchaseWithSources = isPayloadOfSchemaTypeWithSources<Purchase>(PurchaseSchema)
|
|
39
|
+
export const asPurchaseWithSources = AsObjectFactory.create<WithSources<Purchase>>(isPurchaseWithSources)
|
|
40
|
+
export const asOptionalPurchaseWithSources = AsObjectFactory.createOptional<WithSources<Purchase>>(isPurchaseWithSources)
|
package/src/Receipt/Payload.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
+
import type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'
|
|
2
3
|
import {
|
|
3
4
|
isPayloadOfSchemaType,
|
|
4
5
|
isPayloadOfSchemaTypeWithSources,
|
|
@@ -27,8 +28,12 @@ export type Receipt = PayloadWithSources<ReceiptFields, ReceiptSchema>
|
|
|
27
28
|
* Identity function for determine if an object is a Receipt
|
|
28
29
|
*/
|
|
29
30
|
export const isReceipt = isPayloadOfSchemaType<Receipt>(ReceiptSchema)
|
|
31
|
+
export const asReceipt = AsObjectFactory.create<Receipt>(isReceipt)
|
|
32
|
+
export const asOptionalReceipt = AsObjectFactory.createOptional<Receipt>(isReceipt)
|
|
30
33
|
|
|
31
34
|
/**
|
|
32
35
|
* Identity function for determine if an object is a Receipt with sources
|
|
33
36
|
*/
|
|
34
37
|
export const isReceiptWithSources = isPayloadOfSchemaTypeWithSources<Receipt>(ReceiptSchema)
|
|
38
|
+
export const asReceiptWithSources = AsObjectFactory.create<WithSources<Receipt>>(isReceiptWithSources)
|
|
39
|
+
export const asOptionalReceiptWithSources = AsObjectFactory.createOptional<WithSources<Receipt>>(isReceiptWithSources)
|