@classytic/revenue 2.0.0 → 2.1.0

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 (41) hide show
  1. package/dist/bank-feed-DJtLvz_7.mjs +133 -0
  2. package/dist/bank-feed.enums-BadqNJTC.d.mts +118 -0
  3. package/dist/bank-feed.enums-kYTLTTbe.mjs +165 -0
  4. package/dist/bridges/index.d.mts +1 -1
  5. package/dist/core/state-machines.d.mts +45 -4
  6. package/dist/core/state-machines.mjs +71 -12
  7. package/dist/{engine-types-CcjIb4Fy.d.mts → engine-types-txFXOiQS.d.mts} +451 -14
  8. package/dist/enums/index.d.mts +4 -3
  9. package/dist/enums/index.mjs +4 -3
  10. package/dist/{errors-DHa8JVQ-.mjs → errors-Dt46UZL_.mjs} +23 -1
  11. package/dist/{escrow.schema-CC8XuD46.d.mts → escrow.schema-9yh4Q-aQ.d.mts} +9 -9
  12. package/dist/{event-constants-CEMitnIV.mjs → event-constants-CTiDNWzc.mjs} +6 -0
  13. package/dist/events/index.d.mts +2 -2
  14. package/dist/events/index.mjs +3 -3
  15. package/dist/index.d.mts +21 -11
  16. package/dist/index.mjs +120 -19
  17. package/dist/providers/index.d.mts +2 -2
  18. package/dist/providers/index.mjs +2 -2
  19. package/dist/registry-h8sasoLh.d.mts +145 -0
  20. package/dist/repositories/create-repositories.d.mts +1 -1
  21. package/dist/repositories/create-repositories.mjs +1 -1
  22. package/dist/{revenue-bridges-sdlrR85c.d.mts → revenue-bridges-BtkWFsJu.d.mts} +107 -1
  23. package/dist/{revenue-event-catalog-LqxPnsU_.mjs → revenue-event-catalog-CgZ57M-f.mjs} +77 -3
  24. package/dist/{revenue-event-catalog-BX3g7RUi.d.mts → revenue-event-catalog-JpJcyK1E.d.mts} +198 -2
  25. package/dist/{settlement.repository-Cy3mMWGH.mjs → settlement.repository-Ba2U17zY.mjs} +559 -17
  26. package/dist/shared/index.d.mts +1 -1
  27. package/dist/shared/index.mjs +2 -2
  28. package/dist/{split.enums-CQE3ekH1.mjs → subscription.enums-DoIr56O6.mjs} +28 -67
  29. package/dist/{split.enums-Dw4zCrcZ.d.mts → subscription.enums-k24kLpF7.d.mts} +48 -83
  30. package/dist/validators/index.d.mts +158 -2
  31. package/dist/validators/index.mjs +95 -2
  32. package/package.json +11 -8
  33. package/dist/registry-DhFMsSn5.mjs +0 -150
  34. package/dist/registry-SvIGPAx_.d.mts +0 -143
  35. /package/dist/{audit-B39B0Sdq.mjs → audit-Ba2XB2C4.mjs} +0 -0
  36. /package/dist/{audit-DZ0eTr9g.d.mts → audit-DRKuLBFO.d.mts} +0 -0
  37. /package/dist/{context-DRqSeTPM.d.mts → context-pjP1QeE3.d.mts} +0 -0
  38. /package/dist/{escrow.schema-BBv9oVEW.mjs → escrow.schema-C-b41z_G.mjs} +0 -0
  39. /package/dist/{monetization.enums-BtiU3t8o.mjs → monetization.enums-B9HBOecd.mjs} +0 -0
  40. /package/dist/{monetization.enums-D2xbxXJM.d.mts → monetization.enums-DzAI4sT7.d.mts} +0 -0
  41. /package/dist/{splits-BAfY-a9P.mjs → splits-D8XkNWgX.mjs} +0 -0
@@ -1,42 +1,3 @@
1
- //#region src/enums/transaction.enums.ts
2
- const TRANSACTION_FLOW = {
3
- INFLOW: "inflow",
4
- OUTFLOW: "outflow"
5
- };
6
- const TRANSACTION_FLOW_VALUES = Object.values(TRANSACTION_FLOW);
7
- const TRANSACTION_STATUS = {
8
- PENDING: "pending",
9
- PAYMENT_INITIATED: "payment_initiated",
10
- PROCESSING: "processing",
11
- REQUIRES_ACTION: "requires_action",
12
- VERIFIED: "verified",
13
- COMPLETED: "completed",
14
- FAILED: "failed",
15
- CANCELLED: "cancelled",
16
- EXPIRED: "expired",
17
- REFUNDED: "refunded",
18
- PARTIALLY_REFUNDED: "partially_refunded"
19
- };
20
- const TRANSACTION_STATUS_VALUES = Object.values(TRANSACTION_STATUS);
21
- const LIBRARY_CATEGORIES = {
22
- SUBSCRIPTION: "subscription",
23
- PURCHASE: "purchase"
24
- };
25
- const LIBRARY_CATEGORY_VALUES = Object.values(LIBRARY_CATEGORIES);
26
- const transactionFlowSet = new Set(TRANSACTION_FLOW_VALUES);
27
- const transactionStatusSet = new Set(TRANSACTION_STATUS_VALUES);
28
- const libraryCategorySet = new Set(LIBRARY_CATEGORY_VALUES);
29
- function isLibraryCategory(value) {
30
- return typeof value === "string" && libraryCategorySet.has(value);
31
- }
32
- function isTransactionFlow(value) {
33
- return typeof value === "string" && transactionFlowSet.has(value);
34
- }
35
- function isTransactionStatus(value) {
36
- return typeof value === "string" && transactionStatusSet.has(value);
37
- }
38
-
39
- //#endregion
40
1
  //#region src/enums/escrow.enums.ts
41
2
  const HOLD_STATUS = {
42
3
  PENDING: "pending",
@@ -75,33 +36,6 @@ function isHoldReason(value) {
75
36
  return typeof value === "string" && holdReasonSet.has(value);
76
37
  }
77
38
 
78
- //#endregion
79
- //#region src/enums/subscription.enums.ts
80
- const SUBSCRIPTION_STATUS = {
81
- ACTIVE: "active",
82
- PAUSED: "paused",
83
- CANCELLED: "cancelled",
84
- EXPIRED: "expired",
85
- PENDING: "pending",
86
- PENDING_RENEWAL: "pending_renewal",
87
- INACTIVE: "inactive"
88
- };
89
- const SUBSCRIPTION_STATUS_VALUES = Object.values(SUBSCRIPTION_STATUS);
90
- const PLAN_KEYS = {
91
- MONTHLY: "monthly",
92
- QUARTERLY: "quarterly",
93
- YEARLY: "yearly"
94
- };
95
- const PLAN_KEY_VALUES = Object.values(PLAN_KEYS);
96
- const subscriptionStatusSet = new Set(SUBSCRIPTION_STATUS_VALUES);
97
- const planKeySet = new Set(PLAN_KEY_VALUES);
98
- function isSubscriptionStatus(value) {
99
- return typeof value === "string" && subscriptionStatusSet.has(value);
100
- }
101
- function isPlanKey(value) {
102
- return typeof value === "string" && planKeySet.has(value);
103
- }
104
-
105
39
  //#endregion
106
40
  //#region src/enums/settlement.enums.ts
107
41
  const SETTLEMENT_STATUS = {
@@ -169,4 +103,31 @@ function isPayoutMethod(value) {
169
103
  }
170
104
 
171
105
  //#endregion
172
- export { isReleaseReason as A, HOLD_REASON_VALUES as C, RELEASE_REASON_VALUES as D, RELEASE_REASON as E, TRANSACTION_STATUS as F, TRANSACTION_STATUS_VALUES as I, isLibraryCategory as L, LIBRARY_CATEGORY_VALUES as M, TRANSACTION_FLOW as N, isHoldReason as O, TRANSACTION_FLOW_VALUES as P, isTransactionFlow as R, HOLD_REASON as S, HOLD_STATUS_VALUES as T, PLAN_KEY_VALUES as _, SPLIT_TYPE as a, isPlanKey as b, isSplitStatus as c, SETTLEMENT_STATUS_VALUES as d, SETTLEMENT_TYPE as f, PLAN_KEYS as g, isSettlementType as h, SPLIT_STATUS_VALUES as i, LIBRARY_CATEGORIES as j, isHoldStatus as k, isSplitType as l, isSettlementStatus as m, PAYOUT_METHOD_VALUES as n, SPLIT_TYPE_VALUES as o, SETTLEMENT_TYPE_VALUES as p, SPLIT_STATUS as r, isPayoutMethod as s, PAYOUT_METHOD as t, SETTLEMENT_STATUS as u, SUBSCRIPTION_STATUS as v, HOLD_STATUS as w, isSubscriptionStatus as x, SUBSCRIPTION_STATUS_VALUES as y, isTransactionStatus as z };
106
+ //#region src/enums/subscription.enums.ts
107
+ const SUBSCRIPTION_STATUS = {
108
+ ACTIVE: "active",
109
+ PAUSED: "paused",
110
+ CANCELLED: "cancelled",
111
+ EXPIRED: "expired",
112
+ PENDING: "pending",
113
+ PENDING_RENEWAL: "pending_renewal",
114
+ INACTIVE: "inactive"
115
+ };
116
+ const SUBSCRIPTION_STATUS_VALUES = Object.values(SUBSCRIPTION_STATUS);
117
+ const PLAN_KEYS = {
118
+ MONTHLY: "monthly",
119
+ QUARTERLY: "quarterly",
120
+ YEARLY: "yearly"
121
+ };
122
+ const PLAN_KEY_VALUES = Object.values(PLAN_KEYS);
123
+ const subscriptionStatusSet = new Set(SUBSCRIPTION_STATUS_VALUES);
124
+ const planKeySet = new Set(PLAN_KEY_VALUES);
125
+ function isSubscriptionStatus(value) {
126
+ return typeof value === "string" && subscriptionStatusSet.has(value);
127
+ }
128
+ function isPlanKey(value) {
129
+ return typeof value === "string" && planKeySet.has(value);
130
+ }
131
+
132
+ //#endregion
133
+ export { isReleaseReason as A, HOLD_REASON_VALUES as C, RELEASE_REASON_VALUES as D, RELEASE_REASON as E, isHoldReason as O, HOLD_REASON as S, HOLD_STATUS_VALUES as T, SETTLEMENT_STATUS_VALUES as _, isPlanKey as a, isSettlementStatus as b, PAYOUT_METHOD_VALUES as c, SPLIT_TYPE as d, SPLIT_TYPE_VALUES as f, SETTLEMENT_STATUS as g, isSplitType as h, SUBSCRIPTION_STATUS_VALUES as i, isHoldStatus as k, SPLIT_STATUS as l, isSplitStatus as m, PLAN_KEY_VALUES as n, isSubscriptionStatus as o, isPayoutMethod as p, SUBSCRIPTION_STATUS as r, PAYOUT_METHOD as s, PLAN_KEYS as t, SPLIT_STATUS_VALUES as u, SETTLEMENT_TYPE as v, HOLD_STATUS as w, isSettlementType as x, SETTLEMENT_TYPE_VALUES as y };
@@ -1,85 +1,3 @@
1
- //#region src/enums/transaction.enums.d.ts
2
- declare const TRANSACTION_FLOW: {
3
- readonly INFLOW: "inflow";
4
- readonly OUTFLOW: "outflow";
5
- };
6
- type TransactionFlow = typeof TRANSACTION_FLOW;
7
- type TransactionFlowValue = TransactionFlow[keyof TransactionFlow];
8
- declare const TRANSACTION_FLOW_VALUES: TransactionFlowValue[];
9
- declare const TRANSACTION_STATUS: {
10
- readonly PENDING: "pending";
11
- readonly PAYMENT_INITIATED: "payment_initiated";
12
- readonly PROCESSING: "processing";
13
- readonly REQUIRES_ACTION: "requires_action";
14
- readonly VERIFIED: "verified";
15
- readonly COMPLETED: "completed";
16
- readonly FAILED: "failed";
17
- readonly CANCELLED: "cancelled";
18
- readonly EXPIRED: "expired";
19
- readonly REFUNDED: "refunded";
20
- readonly PARTIALLY_REFUNDED: "partially_refunded";
21
- };
22
- type TransactionStatus = typeof TRANSACTION_STATUS;
23
- type TransactionStatusValue = TransactionStatus[keyof TransactionStatus];
24
- declare const TRANSACTION_STATUS_VALUES: TransactionStatusValue[];
25
- declare const LIBRARY_CATEGORIES: {
26
- readonly SUBSCRIPTION: "subscription";
27
- readonly PURCHASE: "purchase";
28
- };
29
- type LibraryCategories = typeof LIBRARY_CATEGORIES;
30
- type LibraryCategoryValue = LibraryCategories[keyof LibraryCategories];
31
- declare const LIBRARY_CATEGORY_VALUES: LibraryCategoryValue[];
32
- declare function isLibraryCategory(value: unknown): value is LibraryCategoryValue;
33
- declare function isTransactionFlow(value: unknown): value is TransactionFlowValue;
34
- declare function isTransactionStatus(value: unknown): value is TransactionStatusValue;
35
- //#endregion
36
- //#region src/enums/subscription.enums.d.ts
37
- declare const SUBSCRIPTION_STATUS: {
38
- readonly ACTIVE: "active";
39
- readonly PAUSED: "paused";
40
- readonly CANCELLED: "cancelled";
41
- readonly EXPIRED: "expired";
42
- readonly PENDING: "pending";
43
- readonly PENDING_RENEWAL: "pending_renewal";
44
- readonly INACTIVE: "inactive";
45
- };
46
- type SubscriptionStatus = typeof SUBSCRIPTION_STATUS;
47
- type SubscriptionStatusValue = SubscriptionStatus[keyof SubscriptionStatus];
48
- declare const SUBSCRIPTION_STATUS_VALUES: SubscriptionStatusValue[];
49
- declare const PLAN_KEYS: {
50
- readonly MONTHLY: "monthly";
51
- readonly QUARTERLY: "quarterly";
52
- readonly YEARLY: "yearly";
53
- };
54
- type PlanKeys = typeof PLAN_KEYS;
55
- type PlanKeyValue = PlanKeys[keyof PlanKeys];
56
- declare const PLAN_KEY_VALUES: PlanKeyValue[];
57
- declare function isSubscriptionStatus(value: unknown): value is SubscriptionStatusValue;
58
- declare function isPlanKey(value: unknown): value is PlanKeyValue;
59
- //#endregion
60
- //#region src/enums/settlement.enums.d.ts
61
- declare const SETTLEMENT_STATUS: {
62
- readonly PENDING: "pending";
63
- readonly PROCESSING: "processing";
64
- readonly COMPLETED: "completed";
65
- readonly FAILED: "failed";
66
- readonly CANCELLED: "cancelled";
67
- };
68
- type SettlementStatus = typeof SETTLEMENT_STATUS;
69
- type SettlementStatusValue = SettlementStatus[keyof SettlementStatus];
70
- declare const SETTLEMENT_STATUS_VALUES: SettlementStatusValue[];
71
- declare const SETTLEMENT_TYPE: {
72
- readonly SPLIT_PAYOUT: "split_payout";
73
- readonly PLATFORM_WITHDRAWAL: "platform_withdrawal";
74
- readonly MANUAL_PAYOUT: "manual_payout";
75
- readonly ESCROW_RELEASE: "escrow_release";
76
- };
77
- type SettlementType = typeof SETTLEMENT_TYPE;
78
- type SettlementTypeValue = SettlementType[keyof SettlementType];
79
- declare const SETTLEMENT_TYPE_VALUES: SettlementTypeValue[];
80
- declare function isSettlementStatus(value: unknown): value is SettlementStatusValue;
81
- declare function isSettlementType(value: unknown): value is SettlementTypeValue;
82
- //#endregion
83
1
  //#region src/enums/escrow.enums.d.ts
84
2
  declare const HOLD_STATUS: {
85
3
  readonly PENDING: "pending";
@@ -115,6 +33,29 @@ declare function isHoldStatus(value: unknown): value is HoldStatusValue;
115
33
  declare function isReleaseReason(value: unknown): value is ReleaseReasonValue;
116
34
  declare function isHoldReason(value: unknown): value is HoldReasonValue;
117
35
  //#endregion
36
+ //#region src/enums/settlement.enums.d.ts
37
+ declare const SETTLEMENT_STATUS: {
38
+ readonly PENDING: "pending";
39
+ readonly PROCESSING: "processing";
40
+ readonly COMPLETED: "completed";
41
+ readonly FAILED: "failed";
42
+ readonly CANCELLED: "cancelled";
43
+ };
44
+ type SettlementStatus = typeof SETTLEMENT_STATUS;
45
+ type SettlementStatusValue = SettlementStatus[keyof SettlementStatus];
46
+ declare const SETTLEMENT_STATUS_VALUES: SettlementStatusValue[];
47
+ declare const SETTLEMENT_TYPE: {
48
+ readonly SPLIT_PAYOUT: "split_payout";
49
+ readonly PLATFORM_WITHDRAWAL: "platform_withdrawal";
50
+ readonly MANUAL_PAYOUT: "manual_payout";
51
+ readonly ESCROW_RELEASE: "escrow_release";
52
+ };
53
+ type SettlementType = typeof SETTLEMENT_TYPE;
54
+ type SettlementTypeValue = SettlementType[keyof SettlementType];
55
+ declare const SETTLEMENT_TYPE_VALUES: SettlementTypeValue[];
56
+ declare function isSettlementStatus(value: unknown): value is SettlementStatusValue;
57
+ declare function isSettlementType(value: unknown): value is SettlementTypeValue;
58
+ //#endregion
118
59
  //#region src/enums/split.enums.d.ts
119
60
  declare const SPLIT_TYPE: {
120
61
  readonly PLATFORM_COMMISSION: "platform_commission";
@@ -151,4 +92,28 @@ declare function isSplitType(value: unknown): value is SplitTypeValue;
151
92
  declare function isSplitStatus(value: unknown): value is SplitStatusValue;
152
93
  declare function isPayoutMethod(value: unknown): value is PayoutMethodValue;
153
94
  //#endregion
154
- export { LibraryCategories as $, isReleaseReason as A, isSettlementType as B, HoldStatusValue as C, ReleaseReasonValue as D, ReleaseReason as E, SettlementStatus as F, SUBSCRIPTION_STATUS as G, PLAN_KEY_VALUES as H, SettlementStatusValue as I, SubscriptionStatusValue as J, SUBSCRIPTION_STATUS_VALUES as K, SettlementType as L, SETTLEMENT_STATUS_VALUES as M, SETTLEMENT_TYPE as N, isHoldReason as O, SETTLEMENT_TYPE_VALUES as P, LIBRARY_CATEGORY_VALUES as Q, SettlementTypeValue as R, HoldStatus as S, RELEASE_REASON_VALUES as T, PlanKeyValue as U, PLAN_KEYS as V, PlanKeys as W, isSubscriptionStatus as X, isPlanKey as Y, LIBRARY_CATEGORIES as Z, HOLD_REASON_VALUES as _, SPLIT_STATUS as a, TransactionFlow as at, HoldReason as b, SPLIT_TYPE_VALUES as c, TransactionStatusValue as ct, SplitType as d, isTransactionStatus as dt, LibraryCategoryValue as et, SplitTypeValue as f, HOLD_REASON as g, isSplitType as h, PayoutMethodValue as i, TRANSACTION_STATUS_VALUES as it, SETTLEMENT_STATUS as j, isHoldStatus as k, SplitStatus as l, isLibraryCategory as lt, isSplitStatus as m, PAYOUT_METHOD_VALUES as n, TRANSACTION_FLOW_VALUES as nt, SPLIT_STATUS_VALUES as o, TransactionFlowValue as ot, isPayoutMethod as p, SubscriptionStatus as q, PayoutMethod as r, TRANSACTION_STATUS as rt, SPLIT_TYPE as s, TransactionStatus as st, PAYOUT_METHOD as t, TRANSACTION_FLOW as tt, SplitStatusValue as u, isTransactionFlow as ut, HOLD_STATUS as v, RELEASE_REASON as w, HoldReasonValue as x, HOLD_STATUS_VALUES as y, isSettlementStatus as z };
95
+ //#region src/enums/subscription.enums.d.ts
96
+ declare const SUBSCRIPTION_STATUS: {
97
+ readonly ACTIVE: "active";
98
+ readonly PAUSED: "paused";
99
+ readonly CANCELLED: "cancelled";
100
+ readonly EXPIRED: "expired";
101
+ readonly PENDING: "pending";
102
+ readonly PENDING_RENEWAL: "pending_renewal";
103
+ readonly INACTIVE: "inactive";
104
+ };
105
+ type SubscriptionStatus = typeof SUBSCRIPTION_STATUS;
106
+ type SubscriptionStatusValue = SubscriptionStatus[keyof SubscriptionStatus];
107
+ declare const SUBSCRIPTION_STATUS_VALUES: SubscriptionStatusValue[];
108
+ declare const PLAN_KEYS: {
109
+ readonly MONTHLY: "monthly";
110
+ readonly QUARTERLY: "quarterly";
111
+ readonly YEARLY: "yearly";
112
+ };
113
+ type PlanKeys = typeof PLAN_KEYS;
114
+ type PlanKeyValue = PlanKeys[keyof PlanKeys];
115
+ declare const PLAN_KEY_VALUES: PlanKeyValue[];
116
+ declare function isSubscriptionStatus(value: unknown): value is SubscriptionStatusValue;
117
+ declare function isPlanKey(value: unknown): value is PlanKeyValue;
118
+ //#endregion
119
+ export { SettlementStatus as A, HoldReason as B, isPayoutMethod as C, SETTLEMENT_STATUS_VALUES as D, SETTLEMENT_STATUS as E, isSettlementType as F, RELEASE_REASON_VALUES as G, HoldStatus as H, HOLD_REASON as I, isHoldReason as J, ReleaseReason as K, HOLD_REASON_VALUES as L, SettlementType as M, SettlementTypeValue as N, SETTLEMENT_TYPE as O, isSettlementStatus as P, HOLD_STATUS as R, SplitTypeValue as S, isSplitType as T, HoldStatusValue as U, HoldReasonValue as V, RELEASE_REASON as W, isReleaseReason as X, isHoldStatus as Y, SPLIT_TYPE as _, SUBSCRIPTION_STATUS as a, SplitStatusValue as b, SubscriptionStatusValue as c, PAYOUT_METHOD as d, PAYOUT_METHOD_VALUES as f, SPLIT_STATUS_VALUES as g, SPLIT_STATUS as h, PlanKeys as i, SettlementStatusValue as j, SETTLEMENT_TYPE_VALUES as k, isPlanKey as l, PayoutMethodValue as m, PLAN_KEY_VALUES as n, SUBSCRIPTION_STATUS_VALUES as o, PayoutMethod as p, ReleaseReasonValue as q, PlanKeyValue as r, SubscriptionStatus as s, PLAN_KEYS as t, isSubscriptionStatus as u, SPLIT_TYPE_VALUES as v, isSplitStatus as w, SplitType as x, SplitStatus as y, HOLD_STATUS_VALUES as z };
@@ -1,2 +1,158 @@
1
- import { A as transactionBaseSchema, C as subscriptionBaseSchema, D as TransactionCreateInput, E as subscriptionUpdateSchema, M as transactionListFilterSchema, N as transactionUpdateSchema, O as TransactionListFilter, S as SubscriptionUpdateInput, T as subscriptionListFilterSchema, _ as settlementCreateSchema, a as escrowReleaseSchema, b as SubscriptionCreateInput, c as PaymentVerifyInput, d as paymentVerifySchema, f as refundSchema, g as settlementBaseSchema, h as SettlementUpdateInput, i as escrowHoldSchema, j as transactionCreateSchema, k as TransactionUpdateInput, l as RefundInput, m as SettlementListFilter, n as EscrowReleaseInput, o as splitRuleSchema, p as SettlementCreateInput, r as SplitRuleInput, s as PaymentIntentInput, t as EscrowHoldInput, u as paymentIntentSchema, v as settlementListFilterSchema, w as subscriptionCreateSchema, x as SubscriptionListFilter, y as settlementUpdateSchema } from "../escrow.schema-CC8XuD46.mjs";
2
- export { EscrowHoldInput, EscrowReleaseInput, PaymentIntentInput, PaymentVerifyInput, RefundInput, SettlementCreateInput, SettlementListFilter, SettlementUpdateInput, SplitRuleInput, SubscriptionCreateInput, SubscriptionListFilter, SubscriptionUpdateInput, TransactionCreateInput, TransactionListFilter, TransactionUpdateInput, escrowHoldSchema, escrowReleaseSchema, paymentIntentSchema, paymentVerifySchema, refundSchema, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, splitRuleSchema, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema };
1
+ import { A as transactionBaseSchema, C as subscriptionBaseSchema, D as TransactionCreateInput, E as subscriptionUpdateSchema, M as transactionListFilterSchema, N as transactionUpdateSchema, O as TransactionListFilter, S as SubscriptionUpdateInput, T as subscriptionListFilterSchema, _ as settlementCreateSchema, a as escrowReleaseSchema, b as SubscriptionCreateInput, c as PaymentVerifyInput, d as paymentVerifySchema, f as refundSchema, g as settlementBaseSchema, h as SettlementUpdateInput, i as escrowHoldSchema, j as transactionCreateSchema, k as TransactionUpdateInput, l as RefundInput, m as SettlementListFilter, n as EscrowReleaseInput, o as splitRuleSchema, p as SettlementCreateInput, r as SplitRuleInput, s as PaymentIntentInput, t as EscrowHoldInput, u as paymentIntentSchema, v as settlementListFilterSchema, w as subscriptionCreateSchema, x as SubscriptionListFilter, y as settlementUpdateSchema } from "../escrow.schema-9yh4Q-aQ.mjs";
2
+ import { z } from "zod";
3
+
4
+ //#region src/validators/bank-feed.schema.d.ts
5
+ declare const moneySchema: z.ZodObject<{
6
+ amount: z.ZodNumber;
7
+ currency: z.ZodString;
8
+ }, z.core.$strip>;
9
+ declare const counterpartySchema: z.ZodObject<{
10
+ name: z.ZodOptional<z.ZodString>;
11
+ identifier: z.ZodOptional<z.ZodString>;
12
+ iban: z.ZodOptional<z.ZodString>;
13
+ accountNumber: z.ZodOptional<z.ZodString>;
14
+ bic: z.ZodOptional<z.ZodString>;
15
+ routingNumber: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ declare const bankTransactionSchema: z.ZodObject<{
18
+ externalId: z.ZodString;
19
+ postedDate: z.ZodCoercedDate<unknown>;
20
+ valueDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
21
+ amount: z.ZodObject<{
22
+ amount: z.ZodNumber;
23
+ currency: z.ZodString;
24
+ }, z.core.$strip>;
25
+ description: z.ZodString;
26
+ counterparty: z.ZodOptional<z.ZodObject<{
27
+ name: z.ZodOptional<z.ZodString>;
28
+ identifier: z.ZodOptional<z.ZodString>;
29
+ iban: z.ZodOptional<z.ZodString>;
30
+ accountNumber: z.ZodOptional<z.ZodString>;
31
+ bic: z.ZodOptional<z.ZodString>;
32
+ routingNumber: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>;
34
+ reference: z.ZodOptional<z.ZodString>;
35
+ category: z.ZodOptional<z.ZodString>;
36
+ balanceAfter: z.ZodOptional<z.ZodObject<{
37
+ amount: z.ZodNumber;
38
+ currency: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ type: z.ZodOptional<z.ZodString>;
41
+ raw: z.ZodOptional<z.ZodUnknown>;
42
+ }, z.core.$strip>;
43
+ declare const journalEntryRefSchema: z.ZodObject<{
44
+ type: z.ZodString;
45
+ id: z.ZodString;
46
+ }, z.core.$strip>;
47
+ declare const matchingMappingSchema: z.ZodObject<{
48
+ debitAccount: z.ZodOptional<z.ZodString>;
49
+ creditAccount: z.ZodOptional<z.ZodString>;
50
+ notes: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>;
52
+ declare const importBodySchema: z.ZodObject<{
53
+ bankAccountId: z.ZodString;
54
+ source: z.ZodEnum<{
55
+ [x: string]: string;
56
+ }>;
57
+ rows: z.ZodArray<z.ZodObject<{
58
+ externalId: z.ZodString;
59
+ postedDate: z.ZodCoercedDate<unknown>;
60
+ valueDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
61
+ amount: z.ZodObject<{
62
+ amount: z.ZodNumber;
63
+ currency: z.ZodString;
64
+ }, z.core.$strip>;
65
+ description: z.ZodString;
66
+ counterparty: z.ZodOptional<z.ZodObject<{
67
+ name: z.ZodOptional<z.ZodString>;
68
+ identifier: z.ZodOptional<z.ZodString>;
69
+ iban: z.ZodOptional<z.ZodString>;
70
+ accountNumber: z.ZodOptional<z.ZodString>;
71
+ bic: z.ZodOptional<z.ZodString>;
72
+ routingNumber: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strip>>;
74
+ reference: z.ZodOptional<z.ZodString>;
75
+ category: z.ZodOptional<z.ZodString>;
76
+ balanceAfter: z.ZodOptional<z.ZodObject<{
77
+ amount: z.ZodNumber;
78
+ currency: z.ZodString;
79
+ }, z.core.$strip>>;
80
+ type: z.ZodOptional<z.ZodString>;
81
+ raw: z.ZodOptional<z.ZodUnknown>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ declare const matchBodySchema: z.ZodObject<{
85
+ mapping: z.ZodObject<{
86
+ debitAccount: z.ZodOptional<z.ZodString>;
87
+ creditAccount: z.ZodOptional<z.ZodString>;
88
+ notes: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>;
90
+ relatedTransactionId: z.ZodOptional<z.ZodString>;
91
+ matchedBy: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>;
93
+ declare const journalizeBodySchema: z.ZodObject<{
94
+ journalEntryRef: z.ZodObject<{
95
+ type: z.ZodString;
96
+ id: z.ZodString;
97
+ }, z.core.$strip>;
98
+ journalizedBy: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>;
100
+ declare const rejectBodySchema: z.ZodObject<{
101
+ reason: z.ZodString;
102
+ rejectedBy: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>;
104
+ declare const unmatchBodySchema: z.ZodObject<{
105
+ unmatchedBy: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>;
107
+ declare const manualEntrySchema: z.ZodObject<{
108
+ kind: z.ZodDefault<z.ZodLiteral<"manual">>;
109
+ amount: z.ZodNumber;
110
+ currency: z.ZodString;
111
+ flow: z.ZodEnum<{
112
+ inflow: "inflow";
113
+ outflow: "outflow";
114
+ }>;
115
+ type: z.ZodString;
116
+ description: z.ZodOptional<z.ZodString>;
117
+ counterparty: z.ZodOptional<z.ZodObject<{
118
+ name: z.ZodOptional<z.ZodString>;
119
+ identifier: z.ZodOptional<z.ZodString>;
120
+ iban: z.ZodOptional<z.ZodString>;
121
+ accountNumber: z.ZodOptional<z.ZodString>;
122
+ bic: z.ZodOptional<z.ZodString>;
123
+ routingNumber: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>>;
125
+ reference: z.ZodOptional<z.ZodString>;
126
+ postedDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
127
+ valueDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
128
+ bankAccountId: z.ZodOptional<z.ZodString>;
129
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
130
+ }, z.core.$strip>;
131
+ declare const findMatchCandidatesQuerySchema: z.ZodObject<{
132
+ amount: z.ZodCoercedNumber<unknown>;
133
+ currency: z.ZodOptional<z.ZodString>;
134
+ postedDate: z.ZodCoercedDate<unknown>;
135
+ toleranceDays: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
136
+ amountTolerancePct: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
137
+ counterpartyName: z.ZodOptional<z.ZodString>;
138
+ }, z.core.$strip>;
139
+ declare const transactionListQuerySchema: z.ZodObject<{
140
+ kind: z.ZodOptional<z.ZodEnum<{
141
+ [x: string]: string;
142
+ }>>;
143
+ status: z.ZodOptional<z.ZodString>;
144
+ bankAccountId: z.ZodOptional<z.ZodString>;
145
+ source: z.ZodOptional<z.ZodEnum<{
146
+ [x: string]: string;
147
+ }>>;
148
+ }, z.core.$strip>;
149
+ type ImportBody = z.infer<typeof importBodySchema>;
150
+ type MatchBody = z.infer<typeof matchBodySchema>;
151
+ type JournalizeBody = z.infer<typeof journalizeBodySchema>;
152
+ type RejectBody = z.infer<typeof rejectBodySchema>;
153
+ type UnmatchBody = z.infer<typeof unmatchBodySchema>;
154
+ type ManualEntryBody = z.infer<typeof manualEntrySchema>;
155
+ type FindMatchCandidatesQuery = z.infer<typeof findMatchCandidatesQuerySchema>;
156
+ type TransactionListQuery = z.infer<typeof transactionListQuerySchema>;
157
+ //#endregion
158
+ export { EscrowHoldInput, EscrowReleaseInput, FindMatchCandidatesQuery, ImportBody, JournalizeBody, ManualEntryBody, MatchBody, PaymentIntentInput, PaymentVerifyInput, RefundInput, RejectBody, SettlementCreateInput, SettlementListFilter, SettlementUpdateInput, SplitRuleInput, SubscriptionCreateInput, SubscriptionListFilter, SubscriptionUpdateInput, TransactionCreateInput, TransactionListFilter, TransactionListQuery, TransactionUpdateInput, UnmatchBody, bankTransactionSchema, counterpartySchema, escrowHoldSchema, escrowReleaseSchema, findMatchCandidatesQuerySchema, importBodySchema, journalEntryRefSchema, journalizeBodySchema, manualEntrySchema, matchBodySchema, matchingMappingSchema, moneySchema, paymentIntentSchema, paymentVerifySchema, refundSchema, rejectBodySchema, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, splitRuleSchema, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionListQuerySchema, transactionUpdateSchema, unmatchBodySchema };
@@ -1,3 +1,96 @@
1
- import { _ as transactionListFilterSchema, a as paymentVerifySchema, c as settlementCreateSchema, d as subscriptionBaseSchema, f as subscriptionCreateSchema, g as transactionCreateSchema, h as transactionBaseSchema, i as paymentIntentSchema, l as settlementListFilterSchema, m as subscriptionUpdateSchema, n as escrowReleaseSchema, o as refundSchema, p as subscriptionListFilterSchema, r as splitRuleSchema, s as settlementBaseSchema, t as escrowHoldSchema, u as settlementUpdateSchema, v as transactionUpdateSchema } from "../escrow.schema-BBv9oVEW.mjs";
1
+ import { n as BANK_FEED_SOURCE_VALUES, o as TRANSACTION_KIND_VALUES } from "../bank-feed.enums-kYTLTTbe.mjs";
2
+ import { _ as transactionListFilterSchema, a as paymentVerifySchema, c as settlementCreateSchema, d as subscriptionBaseSchema, f as subscriptionCreateSchema, g as transactionCreateSchema, h as transactionBaseSchema, i as paymentIntentSchema, l as settlementListFilterSchema, m as subscriptionUpdateSchema, n as escrowReleaseSchema, o as refundSchema, p as subscriptionListFilterSchema, r as splitRuleSchema, s as settlementBaseSchema, t as escrowHoldSchema, u as settlementUpdateSchema, v as transactionUpdateSchema } from "../escrow.schema-C-b41z_G.mjs";
3
+ import { z } from "zod";
2
4
 
3
- export { escrowHoldSchema, escrowReleaseSchema, paymentIntentSchema, paymentVerifySchema, refundSchema, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, splitRuleSchema, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionUpdateSchema };
5
+ //#region src/validators/bank-feed.schema.ts
6
+ /**
7
+ * Zod 4 validators for bank-feed HTTP / RPC payloads.
8
+ *
9
+ * In-process schemas use `z.coerce.date()` (PACKAGE_RULES §25). Shapes
10
+ * that travel over the wire (Plaid webhooks, queued jobs) use
11
+ * `z.iso.datetime()` — see the catalog file for those.
12
+ */
13
+ const moneySchema = z.object({
14
+ amount: z.number().int(),
15
+ currency: z.string().length(3)
16
+ });
17
+ const counterpartySchema = z.object({
18
+ name: z.string().optional(),
19
+ identifier: z.string().optional(),
20
+ iban: z.string().optional(),
21
+ accountNumber: z.string().optional(),
22
+ bic: z.string().optional(),
23
+ routingNumber: z.string().optional()
24
+ });
25
+ const bankTransactionSchema = z.object({
26
+ externalId: z.string().min(1),
27
+ postedDate: z.coerce.date(),
28
+ valueDate: z.coerce.date().optional(),
29
+ amount: moneySchema,
30
+ description: z.string(),
31
+ counterparty: counterpartySchema.optional(),
32
+ reference: z.string().optional(),
33
+ category: z.string().optional(),
34
+ balanceAfter: moneySchema.optional(),
35
+ type: z.string().optional(),
36
+ raw: z.unknown().optional()
37
+ });
38
+ const journalEntryRefSchema = z.object({
39
+ type: z.string().min(1),
40
+ id: z.string().min(1)
41
+ });
42
+ const matchingMappingSchema = z.object({
43
+ debitAccount: z.string().optional(),
44
+ creditAccount: z.string().optional(),
45
+ notes: z.string().optional()
46
+ });
47
+ const importBodySchema = z.object({
48
+ bankAccountId: z.string().min(1),
49
+ source: z.enum(BANK_FEED_SOURCE_VALUES),
50
+ rows: z.array(bankTransactionSchema).min(1)
51
+ });
52
+ const matchBodySchema = z.object({
53
+ mapping: matchingMappingSchema,
54
+ relatedTransactionId: z.string().optional(),
55
+ matchedBy: z.string().optional()
56
+ });
57
+ const journalizeBodySchema = z.object({
58
+ journalEntryRef: journalEntryRefSchema,
59
+ journalizedBy: z.string().optional()
60
+ });
61
+ const rejectBodySchema = z.object({
62
+ reason: z.string().min(1).max(500),
63
+ rejectedBy: z.string().optional()
64
+ });
65
+ const unmatchBodySchema = z.object({ unmatchedBy: z.string().optional() });
66
+ const manualEntrySchema = z.object({
67
+ kind: z.literal("manual").default("manual"),
68
+ amount: z.number().nonnegative(),
69
+ currency: z.string().length(3),
70
+ flow: z.enum(["inflow", "outflow"]),
71
+ type: z.string().min(1),
72
+ description: z.string().optional(),
73
+ counterparty: counterpartySchema.optional(),
74
+ reference: z.string().optional(),
75
+ postedDate: z.coerce.date().optional(),
76
+ valueDate: z.coerce.date().optional(),
77
+ bankAccountId: z.string().optional(),
78
+ metadata: z.record(z.string(), z.unknown()).optional()
79
+ });
80
+ const findMatchCandidatesQuerySchema = z.object({
81
+ amount: z.coerce.number().nonnegative(),
82
+ currency: z.string().length(3).optional(),
83
+ postedDate: z.coerce.date(),
84
+ toleranceDays: z.coerce.number().int().min(0).max(30).optional(),
85
+ amountTolerancePct: z.coerce.number().min(0).max(.5).optional(),
86
+ counterpartyName: z.string().optional()
87
+ });
88
+ const transactionListQuerySchema = z.object({
89
+ kind: z.enum(TRANSACTION_KIND_VALUES).optional(),
90
+ status: z.string().optional(),
91
+ bankAccountId: z.string().optional(),
92
+ source: z.enum(BANK_FEED_SOURCE_VALUES).optional()
93
+ });
94
+
95
+ //#endregion
96
+ export { bankTransactionSchema, counterpartySchema, escrowHoldSchema, escrowReleaseSchema, findMatchCandidatesQuerySchema, importBodySchema, journalEntryRefSchema, journalizeBodySchema, manualEntrySchema, matchBodySchema, matchingMappingSchema, moneySchema, paymentIntentSchema, paymentVerifySchema, refundSchema, rejectBodySchema, settlementBaseSchema, settlementCreateSchema, settlementListFilterSchema, settlementUpdateSchema, splitRuleSchema, subscriptionBaseSchema, subscriptionCreateSchema, subscriptionListFilterSchema, subscriptionUpdateSchema, transactionBaseSchema, transactionCreateSchema, transactionListFilterSchema, transactionListQuerySchema, transactionUpdateSchema, unmatchBodySchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/revenue",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Payment lifecycle engine — transactions, subscriptions, escrow, settlements, commissions. MongoKit-powered, Arc-compatible, framework-agnostic.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -50,7 +50,10 @@
50
50
  "dev": "tsdown --watch",
51
51
  "typecheck": "tsc --noEmit",
52
52
  "prepublishOnly": "tsdown",
53
- "test": "cd .. && vitest run"
53
+ "test": "cd .. && vitest run",
54
+ "release:push": "node -e \"require('child_process').execSync('npm run push -- main',{cwd:require('node:path').resolve('..'),stdio:'inherit'})\"",
55
+ "release:tag": "node -e \"const v=require('./package.json').version,p=require('node:path').resolve('..'),{execSync:e}=require('child_process'),r=c=>e(c,{cwd:p,stdio:'inherit'});r('git tag -a revenue-v'+v+' -m revenue-v'+v);r('npm run push -- revenue-v'+v)\"",
56
+ "release": "npm run release:push && npm run release:tag && npm publish"
54
57
  },
55
58
  "exports": {
56
59
  ".": {
@@ -97,9 +100,9 @@
97
100
  "LICENSE"
98
101
  ],
99
102
  "peerDependencies": {
100
- "@classytic/mongokit": ">=3.11.0",
101
- "@classytic/repo-core": ">=0.2.0",
102
- "@classytic/primitives": ">=0.1.0",
103
+ "@classytic/mongokit": ">=3.13.0",
104
+ "@classytic/repo-core": ">=0.4.0",
105
+ "@classytic/primitives": ">=0.5.0",
103
106
  "mongoose": ">=9.4.1",
104
107
  "zod": ">=4.0.0"
105
108
  },
@@ -107,9 +110,9 @@
107
110
  "node": ">=18.0.0"
108
111
  },
109
112
  "devDependencies": {
110
- "@classytic/mongokit": ">=3.11.0",
111
- "@classytic/repo-core": ">=0.2.0",
112
- "@classytic/primitives": ">=0.1.0",
113
+ "@classytic/mongokit": ">=3.13.0",
114
+ "@classytic/repo-core": ">=0.4.0",
115
+ "@classytic/primitives": ">=0.5.0",
113
116
  "@types/node": "^22.8.7",
114
117
  "mongoose": "^9.4.1",
115
118
  "tsdown": "^0.20.3",