@xyo-network/payment-payload-plugins 6.1.0 → 7.0.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.
- package/dist/neutral/Amount/Iso4217Currency.d.ts.map +1 -1
- package/dist/neutral/Amount/Payload.d.ts +56 -15
- package/dist/neutral/Amount/Payload.d.ts.map +1 -1
- package/dist/neutral/Billing/Address/Address.d.ts +102 -32
- package/dist/neutral/Billing/Address/Address.d.ts.map +1 -1
- package/dist/neutral/Currency.d.ts +5 -1
- package/dist/neutral/Currency.d.ts.map +1 -1
- package/dist/neutral/Discount/Config.d.ts +1 -1
- package/dist/neutral/Discount/Config.d.ts.map +1 -1
- package/dist/neutral/Discount/Params.d.ts +1 -1
- package/dist/neutral/Discount/Params.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/BuyerCondition.d.ts +2 -2
- package/dist/neutral/Discount/Payload/Coupon/Conditions/BuyerCondition.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +81 -15
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +74 -15
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +81 -15
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +186 -9
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts +92 -8
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts +8 -12
- package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Discount.d.ts +53 -14
- package/dist/neutral/Discount/Payload/Discount.d.ts.map +1 -1
- package/dist/neutral/Escrow/Outcome.d.ts +64 -17
- package/dist/neutral/Escrow/Outcome.d.ts.map +1 -1
- package/dist/neutral/Escrow/Terms/Terms.d.ts +303 -62
- package/dist/neutral/Escrow/Terms/Terms.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts +2 -2
- package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts +2 -2
- package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts +18 -10
- package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/findEscrowPartySecretSignatures.d.ts +2 -2
- package/dist/neutral/Escrow/util/secret/findEscrowPartySecretSignatures.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/getEscrowSecret.d.ts +1 -1
- package/dist/neutral/Escrow/util/secret/getEscrowSecret.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts +18 -10
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.d.ts +1 -1
- package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts +2 -2
- package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/agent.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/agent.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts +2 -2
- package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/appraisalAuthorities.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/appraisalAuthorities.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/assets.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/assets.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/buyer.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/buyer.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/buyerSecret.d.ts +2 -2
- package/dist/neutral/Escrow/validators/escrow/buyerSecret.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/nbfExp.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/nbfExp.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/paymentAuthorities.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/paymentAuthorities.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/seller.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/seller.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/sellerSecret.d.ts +2 -2
- package/dist/neutral/Escrow/validators/escrow/sellerSecret.d.ts.map +1 -1
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +74 -34
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +1 -1
- package/dist/neutral/Payment/Payload.d.ts +57 -23
- package/dist/neutral/Payment/Payload.d.ts.map +1 -1
- package/dist/neutral/Payment/Status/Payload.d.ts +53 -22
- package/dist/neutral/Payment/Status/Payload.d.ts.map +1 -1
- package/dist/neutral/Purchase/Payload.d.ts +53 -24
- package/dist/neutral/Purchase/Payload.d.ts.map +1 -1
- package/dist/neutral/Receipt/Payload.d.ts +57 -23
- package/dist/neutral/Receipt/Payload.d.ts.map +1 -1
- package/dist/neutral/Subtotal/Diviner/Config.d.ts +1 -1
- package/dist/neutral/Subtotal/Diviner/Config.d.ts.map +1 -1
- package/dist/neutral/Subtotal/Diviner/Params.d.ts +1 -1
- package/dist/neutral/Subtotal/Diviner/Params.d.ts.map +1 -1
- package/dist/neutral/Subtotal/Diviner/Payload.d.ts +53 -14
- package/dist/neutral/Subtotal/Diviner/Payload.d.ts.map +1 -1
- package/dist/neutral/Total/Diviner/Config.d.ts +1 -1
- package/dist/neutral/Total/Diviner/Config.d.ts.map +1 -1
- package/dist/neutral/Total/Diviner/Params.d.ts +1 -1
- package/dist/neutral/Total/Diviner/Params.d.ts.map +1 -1
- package/dist/neutral/Total/Diviner/Payload.d.ts +53 -14
- package/dist/neutral/Total/Diviner/Payload.d.ts.map +1 -1
- package/dist/neutral/index.mjs +505 -305
- package/dist/neutral/index.mjs.map +4 -4
- package/package.json +25 -30
|
@@ -1,26 +1,92 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { AmountFields } from '../../../../Amount/index.ts';
|
|
3
|
-
import type { CouponFields } from '../types/index.ts';
|
|
1
|
+
import * as z from 'zod/mini';
|
|
4
2
|
export declare const FixedPriceCouponSchema: string & {
|
|
5
3
|
readonly __schema: true;
|
|
6
4
|
};
|
|
7
5
|
export type FixedPriceCouponSchema = typeof FixedPriceCouponSchema;
|
|
8
|
-
export
|
|
9
|
-
|
|
6
|
+
export declare const FixedPriceCouponFieldsZod: z.ZodMiniObject<{
|
|
7
|
+
amount: z.ZodMiniNumber<number>;
|
|
8
|
+
currency: z.ZodMiniCustom<import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode, import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode>;
|
|
9
|
+
conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk").BrandedHash, string>>>>;
|
|
10
|
+
exp: z.ZodMiniNumber<number>;
|
|
11
|
+
nbf: z.ZodMiniNumber<number>;
|
|
12
|
+
stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type FixedPriceCouponFields = z.infer<typeof FixedPriceCouponFieldsZod>;
|
|
10
15
|
/**
|
|
11
16
|
* A coupon that provides a fixed total price
|
|
12
17
|
*/
|
|
13
|
-
export
|
|
18
|
+
export declare const FixedPriceCouponZod: z.ZodMiniObject<{
|
|
19
|
+
schema: z.ZodMiniLiteral<string & {
|
|
20
|
+
readonly __schema: true;
|
|
21
|
+
}>;
|
|
22
|
+
amount: z.ZodMiniNumber<number>;
|
|
23
|
+
currency: z.ZodMiniCustom<import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode, import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode>;
|
|
24
|
+
conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk").BrandedHash, string>>>>;
|
|
25
|
+
exp: z.ZodMiniNumber<number>;
|
|
26
|
+
nbf: z.ZodMiniNumber<number>;
|
|
27
|
+
stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type FixedPriceCoupon = z.infer<typeof FixedPriceCouponZod>;
|
|
14
30
|
/**
|
|
15
31
|
* Identity function for determining if an object is an FixedPriceCoupon
|
|
16
32
|
*/
|
|
17
|
-
export declare const isFixedPriceCoupon: (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
export declare const isFixedPriceCoupon: <T>(value: T) => value is T & {
|
|
34
|
+
schema: string & {
|
|
35
|
+
readonly __schema: true;
|
|
36
|
+
};
|
|
37
|
+
amount: number;
|
|
38
|
+
currency: import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
39
|
+
exp: number;
|
|
40
|
+
nbf: number;
|
|
41
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
42
|
+
stackable?: boolean | undefined;
|
|
43
|
+
};
|
|
44
|
+
export declare const asFixedPriceCoupon: {
|
|
45
|
+
<T>(value: T): (T & {
|
|
46
|
+
schema: string & {
|
|
47
|
+
readonly __schema: true;
|
|
48
|
+
};
|
|
49
|
+
amount: number;
|
|
50
|
+
currency: import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
51
|
+
exp: number;
|
|
52
|
+
nbf: number;
|
|
53
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
54
|
+
stackable?: boolean | undefined;
|
|
55
|
+
}) | undefined;
|
|
56
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
57
|
+
schema: string & {
|
|
58
|
+
readonly __schema: true;
|
|
59
|
+
};
|
|
60
|
+
amount: number;
|
|
61
|
+
currency: import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
62
|
+
exp: number;
|
|
63
|
+
nbf: number;
|
|
64
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
65
|
+
stackable?: boolean | undefined;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export declare const toFixedPriceCoupon: {
|
|
69
|
+
<T>(value: T): (T & {
|
|
70
|
+
schema: string & {
|
|
71
|
+
readonly __schema: true;
|
|
72
|
+
};
|
|
73
|
+
amount: number;
|
|
74
|
+
currency: import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
75
|
+
exp: number;
|
|
76
|
+
nbf: number;
|
|
77
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
78
|
+
stackable?: boolean | undefined;
|
|
79
|
+
}) | undefined;
|
|
80
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
81
|
+
schema: string & {
|
|
82
|
+
readonly __schema: true;
|
|
83
|
+
};
|
|
84
|
+
amount: number;
|
|
85
|
+
currency: import("../../../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
86
|
+
exp: number;
|
|
87
|
+
nbf: number;
|
|
88
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
89
|
+
stackable?: boolean | undefined;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
26
92
|
//# sourceMappingURL=FixedPrice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FixedPrice.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/Coupons/FixedPrice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FixedPrice.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/Coupons/FixedPrice.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAM7B,eAAO,MAAM,sBAAsB;;CAAgD,CAAA;AACnF,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAA;AAElE,eAAO,MAAM,yBAAyB;;;;;;;iBAGpC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE9E;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAA+F,CAAA;AAE/H,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAElE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;CAAoC,CAAA;AACnE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;CAA0D,CAAA;AACzF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;CAA0D,CAAA"}
|
|
@@ -1,16 +1,193 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
2
|
/**
|
|
3
3
|
* The type of coupons
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export declare const CouponZod: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
6
|
+
schema: z.ZodMiniLiteral<string & {
|
|
7
|
+
readonly __schema: true;
|
|
8
|
+
}>;
|
|
9
|
+
amount: z.ZodMiniNumber<number>;
|
|
10
|
+
currency: z.ZodMiniCustom<import("../../../index.ts").Iso4217AlphabeticalCode, import("../../../index.ts").Iso4217AlphabeticalCode>;
|
|
11
|
+
conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk").BrandedHash, string>>>>;
|
|
12
|
+
exp: z.ZodMiniNumber<number>;
|
|
13
|
+
nbf: z.ZodMiniNumber<number>;
|
|
14
|
+
stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
15
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
16
|
+
schema: z.ZodMiniLiteral<string & {
|
|
17
|
+
readonly __schema: true;
|
|
18
|
+
}>;
|
|
19
|
+
percentage: z.ZodMiniNumber<number>;
|
|
20
|
+
conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk").BrandedHash, string>>>>;
|
|
21
|
+
exp: z.ZodMiniNumber<number>;
|
|
22
|
+
nbf: z.ZodMiniNumber<number>;
|
|
23
|
+
stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
24
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
25
|
+
schema: z.ZodMiniLiteral<string & {
|
|
26
|
+
readonly __schema: true;
|
|
27
|
+
}>;
|
|
28
|
+
amount: z.ZodMiniNumber<number>;
|
|
29
|
+
currency: z.ZodMiniCustom<import("../../../index.ts").Iso4217AlphabeticalCode, import("../../../index.ts").Iso4217AlphabeticalCode>;
|
|
30
|
+
conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk").BrandedHash, string>>>>;
|
|
31
|
+
exp: z.ZodMiniNumber<number>;
|
|
32
|
+
nbf: z.ZodMiniNumber<number>;
|
|
33
|
+
stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
34
|
+
}, z.core.$strip>]>;
|
|
35
|
+
export type Coupon = z.infer<typeof CouponZod>;
|
|
6
36
|
/**
|
|
7
37
|
* Identity function for determining if an object is an Coupon
|
|
8
38
|
*/
|
|
9
|
-
export declare const isCoupon: (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
39
|
+
export declare const isCoupon: <T>(value: T) => value is T & ({
|
|
40
|
+
schema: string & {
|
|
41
|
+
readonly __schema: true;
|
|
42
|
+
};
|
|
43
|
+
amount: number;
|
|
44
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
45
|
+
exp: number;
|
|
46
|
+
nbf: number;
|
|
47
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
48
|
+
stackable?: boolean | undefined;
|
|
49
|
+
} | {
|
|
50
|
+
schema: string & {
|
|
51
|
+
readonly __schema: true;
|
|
52
|
+
};
|
|
53
|
+
percentage: number;
|
|
54
|
+
exp: number;
|
|
55
|
+
nbf: number;
|
|
56
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
57
|
+
stackable?: boolean | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
schema: string & {
|
|
60
|
+
readonly __schema: true;
|
|
61
|
+
};
|
|
62
|
+
amount: number;
|
|
63
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
64
|
+
exp: number;
|
|
65
|
+
nbf: number;
|
|
66
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
67
|
+
stackable?: boolean | undefined;
|
|
68
|
+
});
|
|
69
|
+
export declare const asCoupon: {
|
|
70
|
+
<T>(value: T): (T & ({
|
|
71
|
+
schema: string & {
|
|
72
|
+
readonly __schema: true;
|
|
73
|
+
};
|
|
74
|
+
amount: number;
|
|
75
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
76
|
+
exp: number;
|
|
77
|
+
nbf: number;
|
|
78
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
79
|
+
stackable?: boolean | undefined;
|
|
80
|
+
} | {
|
|
81
|
+
schema: string & {
|
|
82
|
+
readonly __schema: true;
|
|
83
|
+
};
|
|
84
|
+
percentage: number;
|
|
85
|
+
exp: number;
|
|
86
|
+
nbf: number;
|
|
87
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
88
|
+
stackable?: boolean | undefined;
|
|
89
|
+
} | {
|
|
90
|
+
schema: string & {
|
|
91
|
+
readonly __schema: true;
|
|
92
|
+
};
|
|
93
|
+
amount: number;
|
|
94
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
95
|
+
exp: number;
|
|
96
|
+
nbf: number;
|
|
97
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
98
|
+
stackable?: boolean | undefined;
|
|
99
|
+
})) | undefined;
|
|
100
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & ({
|
|
101
|
+
schema: string & {
|
|
102
|
+
readonly __schema: true;
|
|
103
|
+
};
|
|
104
|
+
amount: number;
|
|
105
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
106
|
+
exp: number;
|
|
107
|
+
nbf: number;
|
|
108
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
109
|
+
stackable?: boolean | undefined;
|
|
110
|
+
} | {
|
|
111
|
+
schema: string & {
|
|
112
|
+
readonly __schema: true;
|
|
113
|
+
};
|
|
114
|
+
percentage: number;
|
|
115
|
+
exp: number;
|
|
116
|
+
nbf: number;
|
|
117
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
118
|
+
stackable?: boolean | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
schema: string & {
|
|
121
|
+
readonly __schema: true;
|
|
122
|
+
};
|
|
123
|
+
amount: number;
|
|
124
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
125
|
+
exp: number;
|
|
126
|
+
nbf: number;
|
|
127
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
128
|
+
stackable?: boolean | undefined;
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
export declare const toCoupon: {
|
|
132
|
+
<T>(value: T): (T & ({
|
|
133
|
+
schema: string & {
|
|
134
|
+
readonly __schema: true;
|
|
135
|
+
};
|
|
136
|
+
amount: number;
|
|
137
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
138
|
+
exp: number;
|
|
139
|
+
nbf: number;
|
|
140
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
141
|
+
stackable?: boolean | undefined;
|
|
142
|
+
} | {
|
|
143
|
+
schema: string & {
|
|
144
|
+
readonly __schema: true;
|
|
145
|
+
};
|
|
146
|
+
percentage: number;
|
|
147
|
+
exp: number;
|
|
148
|
+
nbf: number;
|
|
149
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
150
|
+
stackable?: boolean | undefined;
|
|
151
|
+
} | {
|
|
152
|
+
schema: string & {
|
|
153
|
+
readonly __schema: true;
|
|
154
|
+
};
|
|
155
|
+
amount: number;
|
|
156
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
157
|
+
exp: number;
|
|
158
|
+
nbf: number;
|
|
159
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
160
|
+
stackable?: boolean | undefined;
|
|
161
|
+
})) | undefined;
|
|
162
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & ({
|
|
163
|
+
schema: string & {
|
|
164
|
+
readonly __schema: true;
|
|
165
|
+
};
|
|
166
|
+
amount: number;
|
|
167
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
168
|
+
exp: number;
|
|
169
|
+
nbf: number;
|
|
170
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
171
|
+
stackable?: boolean | undefined;
|
|
172
|
+
} | {
|
|
173
|
+
schema: string & {
|
|
174
|
+
readonly __schema: true;
|
|
175
|
+
};
|
|
176
|
+
percentage: number;
|
|
177
|
+
exp: number;
|
|
178
|
+
nbf: number;
|
|
179
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
180
|
+
stackable?: boolean | undefined;
|
|
181
|
+
} | {
|
|
182
|
+
schema: string & {
|
|
183
|
+
readonly __schema: true;
|
|
184
|
+
};
|
|
185
|
+
amount: number;
|
|
186
|
+
currency: import("../../../index.ts").Iso4217AlphabeticalCode;
|
|
187
|
+
exp: number;
|
|
188
|
+
nbf: number;
|
|
189
|
+
conditions?: import("@xylabs/sdk").BrandedHash[] | undefined;
|
|
190
|
+
stackable?: boolean | undefined;
|
|
191
|
+
});
|
|
192
|
+
};
|
|
16
193
|
//# sourceMappingURL=Payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/Discount/Payload/Coupon/Payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../../../../src/Discount/Payload/Coupon/Payload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAM7B;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAIpB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAE9C;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0B,CAAA;AAC/C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAA;AAC3D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsC,CAAA"}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import type { SchemaPayload } from '@xyo-network/sdk
|
|
1
|
+
import type { SchemaPayload } from '@xyo-network/sdk';
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
|
+
/**
|
|
4
|
+
* The payloads that can be used as conditions for a coupon
|
|
5
|
+
*/
|
|
6
|
+
export declare const ConditionZod: z.ZodMiniCustom<{
|
|
7
|
+
schema: "network.xyo.schema" & {
|
|
8
|
+
readonly __schema: true;
|
|
9
|
+
};
|
|
10
|
+
definition: {
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
$id?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
extends?: string | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
version?: number | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
schema: "network.xyo.schema" & {
|
|
19
|
+
readonly __schema: true;
|
|
20
|
+
};
|
|
21
|
+
definition: {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
$id?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
extends?: string | undefined;
|
|
26
|
+
name?: string | undefined;
|
|
27
|
+
version?: number | undefined;
|
|
28
|
+
}>;
|
|
2
29
|
/**
|
|
3
30
|
* The payloads that can be used as conditions for a coupon
|
|
4
31
|
*/
|
|
@@ -6,11 +33,68 @@ export type Condition = SchemaPayload;
|
|
|
6
33
|
/**
|
|
7
34
|
* Identity function for determining if an object is a Condition payload
|
|
8
35
|
*/
|
|
9
|
-
export declare const isCondition: (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
36
|
+
export declare const isCondition: <T>(value: T) => value is T & {
|
|
37
|
+
schema: "network.xyo.schema" & {
|
|
38
|
+
readonly __schema: true;
|
|
39
|
+
};
|
|
40
|
+
definition: {
|
|
41
|
+
[x: string]: unknown;
|
|
42
|
+
$id?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
extends?: string | undefined;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
version?: number | undefined;
|
|
47
|
+
};
|
|
48
|
+
export declare const asCondition: {
|
|
49
|
+
<T>(value: T): (T & {
|
|
50
|
+
schema: "network.xyo.schema" & {
|
|
51
|
+
readonly __schema: true;
|
|
52
|
+
};
|
|
53
|
+
definition: {
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
$id?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
extends?: string | undefined;
|
|
58
|
+
name?: string | undefined;
|
|
59
|
+
version?: number | undefined;
|
|
60
|
+
}) | undefined;
|
|
61
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
62
|
+
schema: "network.xyo.schema" & {
|
|
63
|
+
readonly __schema: true;
|
|
64
|
+
};
|
|
65
|
+
definition: {
|
|
66
|
+
[x: string]: unknown;
|
|
67
|
+
$id?: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
extends?: string | undefined;
|
|
70
|
+
name?: string | undefined;
|
|
71
|
+
version?: number | undefined;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export declare const toCondition: {
|
|
75
|
+
<T>(value: T): (T & {
|
|
76
|
+
schema: "network.xyo.schema" & {
|
|
77
|
+
readonly __schema: true;
|
|
78
|
+
};
|
|
79
|
+
definition: {
|
|
80
|
+
[x: string]: unknown;
|
|
81
|
+
$id?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
extends?: string | undefined;
|
|
84
|
+
name?: string | undefined;
|
|
85
|
+
version?: number | undefined;
|
|
86
|
+
}) | undefined;
|
|
87
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
88
|
+
schema: "network.xyo.schema" & {
|
|
89
|
+
readonly __schema: true;
|
|
90
|
+
};
|
|
91
|
+
definition: {
|
|
92
|
+
[x: string]: unknown;
|
|
93
|
+
$id?: string | undefined;
|
|
94
|
+
};
|
|
95
|
+
extends?: string | undefined;
|
|
96
|
+
name?: string | undefined;
|
|
97
|
+
version?: number | undefined;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
16
100
|
//# sourceMappingURL=Condition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/Condition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/Condition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;EACiF,CAAA;AAE1G;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;CAA6B,CAAA;AACrD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAA4C,CAAA;AACpE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;CAA4C,CAAA"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { DurationFields } from '@xyo-network/xns-record-payload-plugins';
|
|
1
|
+
import * as z from 'zod/mini';
|
|
3
2
|
/**
|
|
4
3
|
* The fields that are common across all coupons
|
|
5
4
|
*/
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
stackable?: boolean;
|
|
15
|
-
}
|
|
5
|
+
export declare const CouponFieldsZod: z.ZodMiniObject<{
|
|
6
|
+
conditions: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk").BrandedHash, string>>>>;
|
|
7
|
+
exp: z.ZodMiniNumber<number>;
|
|
8
|
+
nbf: z.ZodMiniNumber<number>;
|
|
9
|
+
stackable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type CouponFields = z.infer<typeof CouponFieldsZod>;
|
|
16
12
|
//# sourceMappingURL=CouponFields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CouponFields.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/CouponFields.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CouponFields.d.ts","sourceRoot":"","sources":["../../../../../../src/Discount/Payload/Coupon/types/CouponFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;iBAiB1B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
|
@@ -1,25 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { AmountFields } from '../../Amount/index.ts';
|
|
1
|
+
import * as z from 'zod/mini';
|
|
3
2
|
export declare const DiscountSchema: "network.xyo.payments.discount" & {
|
|
4
3
|
readonly __schema: true;
|
|
5
4
|
};
|
|
6
5
|
export type DiscountSchema = typeof DiscountSchema;
|
|
7
|
-
export
|
|
8
|
-
|
|
6
|
+
export declare const DiscountFieldsZod: z.ZodMiniObject<{
|
|
7
|
+
amount: z.ZodMiniNumber<number>;
|
|
8
|
+
currency: z.ZodMiniCustom<import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode, import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type DiscountFields = z.infer<typeof DiscountFieldsZod>;
|
|
9
11
|
/**
|
|
10
12
|
* The result of a discount
|
|
11
13
|
*/
|
|
12
|
-
export
|
|
14
|
+
export declare const DiscountZod: z.ZodMiniObject<{
|
|
15
|
+
schema: z.ZodMiniLiteral<"network.xyo.payments.discount" & {
|
|
16
|
+
readonly __schema: true;
|
|
17
|
+
}>;
|
|
18
|
+
amount: z.ZodMiniNumber<number>;
|
|
19
|
+
currency: z.ZodMiniCustom<import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode, import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type Discount = z.infer<typeof DiscountZod>;
|
|
13
22
|
/**
|
|
14
23
|
* Identity function for determining if an object is an Discount
|
|
15
24
|
*/
|
|
16
|
-
export declare const isDiscount: (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export declare const
|
|
24
|
-
|
|
25
|
+
export declare const isDiscount: <T>(value: T) => value is T & {
|
|
26
|
+
schema: "network.xyo.payments.discount" & {
|
|
27
|
+
readonly __schema: true;
|
|
28
|
+
};
|
|
29
|
+
amount: number;
|
|
30
|
+
currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
31
|
+
};
|
|
32
|
+
export declare const asDiscount: {
|
|
33
|
+
<T>(value: T): (T & {
|
|
34
|
+
schema: "network.xyo.payments.discount" & {
|
|
35
|
+
readonly __schema: true;
|
|
36
|
+
};
|
|
37
|
+
amount: number;
|
|
38
|
+
currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
39
|
+
}) | undefined;
|
|
40
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
41
|
+
schema: "network.xyo.payments.discount" & {
|
|
42
|
+
readonly __schema: true;
|
|
43
|
+
};
|
|
44
|
+
amount: number;
|
|
45
|
+
currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const toDiscount: {
|
|
49
|
+
<T>(value: T): (T & {
|
|
50
|
+
schema: "network.xyo.payments.discount" & {
|
|
51
|
+
readonly __schema: true;
|
|
52
|
+
};
|
|
53
|
+
amount: number;
|
|
54
|
+
currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
55
|
+
}) | undefined;
|
|
56
|
+
<T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
|
|
57
|
+
schema: "network.xyo.payments.discount" & {
|
|
58
|
+
readonly __schema: true;
|
|
59
|
+
};
|
|
60
|
+
amount: number;
|
|
61
|
+
currency: import("../../Amount/Iso4217Currency.ts").Iso4217AlphabeticalCode;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
25
64
|
//# sourceMappingURL=Discount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Discount.d.ts","sourceRoot":"","sources":["../../../../src/Discount/Payload/Discount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Discount.d.ts","sourceRoot":"","sources":["../../../../src/Discount/Payload/Discount.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B,eAAO,MAAM,cAAc;;CAAkD,CAAA;AAC7E,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA;AAElD,eAAO,MAAM,iBAAiB;;;iBAAyC,CAAA;AAEvE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;iBAA+E,CAAA;AAEvG,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;CAA4B,CAAA;AACnD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAA0C,CAAA;AACjE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAA0C,CAAA"}
|