@xyo-network/payment-payload-plugins 3.2.0 → 3.2.1

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.
Files changed (34) hide show
  1. package/dist/neutral/Amount/Payload.d.ts +12 -2
  2. package/dist/neutral/Amount/Payload.d.ts.map +1 -1
  3. package/dist/neutral/Billing/Address/Address.d.ts +196 -2
  4. package/dist/neutral/Billing/Address/Address.d.ts.map +1 -1
  5. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +13 -3
  6. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +1 -1
  7. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +12 -3
  8. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +1 -1
  9. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +13 -3
  10. package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +1 -1
  11. package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +15 -15
  12. package/dist/neutral/Discount/Payload/Discount.d.ts +26 -0
  13. package/dist/neutral/Discount/Payload/Discount.d.ts.map +1 -1
  14. package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +100 -2
  15. package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +1 -1
  16. package/dist/neutral/Payment/Status/Payload.d.ts +12 -2
  17. package/dist/neutral/Payment/Status/Payload.d.ts.map +1 -1
  18. package/dist/neutral/Purchase/Payload.d.ts +12 -2
  19. package/dist/neutral/Purchase/Payload.d.ts.map +1 -1
  20. package/dist/neutral/Receipt/Payload.d.ts +12 -2
  21. package/dist/neutral/Receipt/Payload.d.ts.map +1 -1
  22. package/dist/neutral/index.mjs +95 -20
  23. package/dist/neutral/index.mjs.map +1 -1
  24. package/package.json +15 -15
  25. package/src/Amount/Payload.ts +6 -1
  26. package/src/Billing/Address/Address.ts +6 -1
  27. package/src/Discount/Payload/Coupon/Coupons/FixedAmount.ts +6 -4
  28. package/src/Discount/Payload/Coupon/Coupons/FixedPercentage.ts +8 -4
  29. package/src/Discount/Payload/Coupon/Coupons/FixedPrice.ts +6 -4
  30. package/src/Discount/Payload/Discount.ts +6 -1
  31. package/src/Payment/Instrument/Card/Payload.ts +6 -1
  32. package/src/Payment/Status/Payload.ts +6 -1
  33. package/src/Purchase/Payload.ts +6 -1
  34. 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>(FixedPriceCouponSchema)
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 type { PayloadWithOptionalSources } from '@xyo-network/payload-model'
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)
@@ -1,4 +1,5 @@
1
- import type { Payload } from '@xyo-network/payload-model'
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 type { PayloadWithSources } from '@xyo-network/payload-model'
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)
@@ -1,5 +1,6 @@
1
1
  import type { Hash } from '@xylabs/hex'
2
- import type { PayloadWithSources } from '@xyo-network/payload-model'
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)
@@ -1,4 +1,5 @@
1
- import type { PayloadWithSources } from '@xyo-network/payload-model'
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)