@fantastic.dev/better-stripe 0.18.0 → 0.20.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 (53) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +8 -3
  3. package/dist/client/connect/transferReceipt.d.ts +48 -0
  4. package/dist/client/connect/transferReceipt.d.ts.map +1 -0
  5. package/dist/client/connect/transferReceipt.js +283 -0
  6. package/dist/client/connect/transferReceipt.js.map +1 -0
  7. package/dist/client/payoutPolicy.d.ts +3 -0
  8. package/dist/client/payoutPolicy.d.ts.map +1 -1
  9. package/dist/client/payoutPolicy.js +4 -0
  10. package/dist/client/payoutPolicy.js.map +1 -1
  11. package/dist/component/_generated/component.d.ts +297 -0
  12. package/dist/component/_generated/component.d.ts.map +1 -1
  13. package/dist/component/earnings/triggers.d.ts +134 -0
  14. package/dist/component/earnings/triggers.d.ts.map +1 -1
  15. package/dist/component/payoutRelease/allocation.d.ts +48 -0
  16. package/dist/component/payoutRelease/allocation.d.ts.map +1 -0
  17. package/dist/component/payoutRelease/allocation.js +98 -0
  18. package/dist/component/payoutRelease/allocation.js.map +1 -0
  19. package/dist/component/payoutRelease/helpers.d.ts +106 -0
  20. package/dist/component/payoutRelease/helpers.d.ts.map +1 -0
  21. package/dist/component/payoutRelease/helpers.js +119 -0
  22. package/dist/component/payoutRelease/helpers.js.map +1 -0
  23. package/dist/component/payoutRelease/mutations.d.ts +218 -0
  24. package/dist/component/payoutRelease/mutations.d.ts.map +1 -0
  25. package/dist/component/payoutRelease/mutations.js +254 -0
  26. package/dist/component/payoutRelease/mutations.js.map +1 -0
  27. package/dist/component/payoutRelease/queries.d.ts +84 -0
  28. package/dist/component/payoutRelease/queries.d.ts.map +1 -0
  29. package/dist/component/payoutRelease/queries.js +51 -0
  30. package/dist/component/payoutRelease/queries.js.map +1 -0
  31. package/dist/component/payoutRelease/schema.d.ts +289 -0
  32. package/dist/component/payoutRelease/schema.d.ts.map +1 -0
  33. package/dist/component/payoutRelease/schema.js +56 -0
  34. package/dist/component/payoutRelease/schema.js.map +1 -0
  35. package/dist/component/schema.d.ts +110 -0
  36. package/dist/component/schema.js +3 -0
  37. package/dist/component/schema.js.map +1 -1
  38. package/docs/settlement.md +81 -0
  39. package/package.json +1 -1
  40. package/src/client/connect/payoutAllocation.test.ts +292 -0
  41. package/src/client/connect/transferReceipt.pagination.test.ts +209 -0
  42. package/src/client/connect/transferReceipt.test.ts +520 -0
  43. package/src/client/connect/transferReceipt.ts +409 -0
  44. package/src/client/payoutPolicy.ts +13 -0
  45. package/src/component/_generated/api.ts +8 -0
  46. package/src/component/_generated/component.ts +372 -0
  47. package/src/component/payout-release.test.ts +588 -0
  48. package/src/component/payoutRelease/allocation.ts +147 -0
  49. package/src/component/payoutRelease/helpers.ts +168 -0
  50. package/src/component/payoutRelease/mutations.ts +309 -0
  51. package/src/component/payoutRelease/queries.ts +56 -0
  52. package/src/component/payoutRelease/schema.ts +69 -0
  53. package/src/component/schema.ts +6 -0
@@ -1925,6 +1925,303 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
1925
1925
  } | null, Name>;
1926
1926
  };
1927
1927
  };
1928
+ payoutRelease: {
1929
+ mutations: {
1930
+ beginAttempt: FunctionReference<"mutation", "internal", {
1931
+ accountId: string;
1932
+ operationKey: string;
1933
+ ownerKey: string;
1934
+ }, {
1935
+ _creationTime: number;
1936
+ _id: string;
1937
+ accountId: string;
1938
+ allocations: Array<{
1939
+ amount: number;
1940
+ role?: "store" | "affiliate" | "other";
1941
+ stripeTransferId: string;
1942
+ }>;
1943
+ amount: number;
1944
+ attemptedAt?: number;
1945
+ currency: string;
1946
+ expectedRevision: number;
1947
+ observations: Array<{
1948
+ currency: string;
1949
+ ledgerFingerprint: string;
1950
+ matureNet: number;
1951
+ observedAt: number;
1952
+ pendingCredits: number;
1953
+ stripeTransferId: string;
1954
+ transactionIds: Array<string>;
1955
+ }>;
1956
+ operationKey: string;
1957
+ ownerKey: string;
1958
+ rejection?: {
1959
+ code: "balance_insufficient" | "amount_too_small";
1960
+ requestId: string;
1961
+ };
1962
+ returnTransactionId?: string;
1963
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
1964
+ stripePayoutId?: string;
1965
+ }, Name>;
1966
+ cancelUnattempted: FunctionReference<"mutation", "internal", {
1967
+ accountId: string;
1968
+ operationKey: string;
1969
+ ownerKey: string;
1970
+ }, {
1971
+ _creationTime: number;
1972
+ _id: string;
1973
+ accountId: string;
1974
+ allocations: Array<{
1975
+ amount: number;
1976
+ role?: "store" | "affiliate" | "other";
1977
+ stripeTransferId: string;
1978
+ }>;
1979
+ amount: number;
1980
+ attemptedAt?: number;
1981
+ currency: string;
1982
+ expectedRevision: number;
1983
+ observations: Array<{
1984
+ currency: string;
1985
+ ledgerFingerprint: string;
1986
+ matureNet: number;
1987
+ observedAt: number;
1988
+ pendingCredits: number;
1989
+ stripeTransferId: string;
1990
+ transactionIds: Array<string>;
1991
+ }>;
1992
+ operationKey: string;
1993
+ ownerKey: string;
1994
+ rejection?: {
1995
+ code: "balance_insufficient" | "amount_too_small";
1996
+ requestId: string;
1997
+ };
1998
+ returnTransactionId?: string;
1999
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
2000
+ stripePayoutId?: string;
2001
+ }, Name>;
2002
+ claim: FunctionReference<"mutation", "internal", {
2003
+ accountId: string;
2004
+ currency: string;
2005
+ expectedRevision: number;
2006
+ independentLiabilities: number;
2007
+ observations: Array<{
2008
+ currency: string;
2009
+ ledgerFingerprint: string;
2010
+ matureNet: number;
2011
+ observedAt: number;
2012
+ pendingCredits: number;
2013
+ stripeTransferId: string;
2014
+ transactionIds: Array<string>;
2015
+ }>;
2016
+ operationKey: string;
2017
+ ownerKey: string;
2018
+ providerAvailable: number;
2019
+ }, {
2020
+ _creationTime: number;
2021
+ _id: string;
2022
+ accountId: string;
2023
+ allocations: Array<{
2024
+ amount: number;
2025
+ role?: "store" | "affiliate" | "other";
2026
+ stripeTransferId: string;
2027
+ }>;
2028
+ amount: number;
2029
+ attemptedAt?: number;
2030
+ currency: string;
2031
+ expectedRevision: number;
2032
+ observations: Array<{
2033
+ currency: string;
2034
+ ledgerFingerprint: string;
2035
+ matureNet: number;
2036
+ observedAt: number;
2037
+ pendingCredits: number;
2038
+ stripeTransferId: string;
2039
+ transactionIds: Array<string>;
2040
+ }>;
2041
+ operationKey: string;
2042
+ ownerKey: string;
2043
+ rejection?: {
2044
+ code: "balance_insufficient" | "amount_too_small";
2045
+ requestId: string;
2046
+ };
2047
+ returnTransactionId?: string;
2048
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
2049
+ stripePayoutId?: string;
2050
+ } | {
2051
+ amount: 0;
2052
+ currency: string;
2053
+ matureUnpaid?: number;
2054
+ pendingCredits?: number;
2055
+ providerMinimum: null;
2056
+ reason: "below_threshold" | "insufficient_available" | "pending_claim";
2057
+ status: "held";
2058
+ }, Name>;
2059
+ recordOutcome: FunctionReference<"mutation", "internal", {
2060
+ accountId: string;
2061
+ amount: number;
2062
+ currency: string;
2063
+ operationKey: string;
2064
+ ownerKey: string;
2065
+ providerStatus: "pending" | "in_transit" | "paid" | "failed" | "canceled";
2066
+ returnTransactionId?: string;
2067
+ stripePayoutId: string;
2068
+ }, {
2069
+ _creationTime: number;
2070
+ _id: string;
2071
+ accountId: string;
2072
+ allocations: Array<{
2073
+ amount: number;
2074
+ role?: "store" | "affiliate" | "other";
2075
+ stripeTransferId: string;
2076
+ }>;
2077
+ amount: number;
2078
+ attemptedAt?: number;
2079
+ currency: string;
2080
+ expectedRevision: number;
2081
+ observations: Array<{
2082
+ currency: string;
2083
+ ledgerFingerprint: string;
2084
+ matureNet: number;
2085
+ observedAt: number;
2086
+ pendingCredits: number;
2087
+ stripeTransferId: string;
2088
+ transactionIds: Array<string>;
2089
+ }>;
2090
+ operationKey: string;
2091
+ ownerKey: string;
2092
+ rejection?: {
2093
+ code: "balance_insufficient" | "amount_too_small";
2094
+ requestId: string;
2095
+ };
2096
+ returnTransactionId?: string;
2097
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
2098
+ stripePayoutId?: string;
2099
+ }, Name>;
2100
+ recordRejection: FunctionReference<"mutation", "internal", {
2101
+ accountId: string;
2102
+ code: "balance_insufficient" | "amount_too_small";
2103
+ operationKey: string;
2104
+ ownerKey: string;
2105
+ requestId: string;
2106
+ }, {
2107
+ _creationTime: number;
2108
+ _id: string;
2109
+ accountId: string;
2110
+ allocations: Array<{
2111
+ amount: number;
2112
+ role?: "store" | "affiliate" | "other";
2113
+ stripeTransferId: string;
2114
+ }>;
2115
+ amount: number;
2116
+ attemptedAt?: number;
2117
+ currency: string;
2118
+ expectedRevision: number;
2119
+ observations: Array<{
2120
+ currency: string;
2121
+ ledgerFingerprint: string;
2122
+ matureNet: number;
2123
+ observedAt: number;
2124
+ pendingCredits: number;
2125
+ stripeTransferId: string;
2126
+ transactionIds: Array<string>;
2127
+ }>;
2128
+ operationKey: string;
2129
+ ownerKey: string;
2130
+ rejection?: {
2131
+ code: "balance_insufficient" | "amount_too_small";
2132
+ requestId: string;
2133
+ };
2134
+ returnTransactionId?: string;
2135
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
2136
+ stripePayoutId?: string;
2137
+ }, Name>;
2138
+ };
2139
+ queries: {
2140
+ get: FunctionReference<"query", "internal", {
2141
+ accountId: string;
2142
+ operationKey: string;
2143
+ ownerKey: string;
2144
+ }, {
2145
+ _creationTime: number;
2146
+ _id: string;
2147
+ accountId: string;
2148
+ allocations: Array<{
2149
+ amount: number;
2150
+ role?: "store" | "affiliate" | "other";
2151
+ stripeTransferId: string;
2152
+ }>;
2153
+ amount: number;
2154
+ attemptedAt?: number;
2155
+ currency: string;
2156
+ expectedRevision: number;
2157
+ observations: Array<{
2158
+ currency: string;
2159
+ ledgerFingerprint: string;
2160
+ matureNet: number;
2161
+ observedAt: number;
2162
+ pendingCredits: number;
2163
+ stripeTransferId: string;
2164
+ transactionIds: Array<string>;
2165
+ }>;
2166
+ operationKey: string;
2167
+ ownerKey: string;
2168
+ rejection?: {
2169
+ code: "balance_insufficient" | "amount_too_small";
2170
+ requestId: string;
2171
+ };
2172
+ returnTransactionId?: string;
2173
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
2174
+ stripePayoutId?: string;
2175
+ } | null, Name>;
2176
+ pending: FunctionReference<"query", "internal", {
2177
+ accountId: string;
2178
+ ownerKey: string;
2179
+ paginationOpts: {
2180
+ cursor: string | null;
2181
+ endCursor?: string | null;
2182
+ id?: number;
2183
+ maximumBytesRead?: number;
2184
+ maximumRowsRead?: number;
2185
+ numItems: number;
2186
+ };
2187
+ }, {
2188
+ continueCursor: string;
2189
+ isDone: boolean;
2190
+ page: Array<{
2191
+ _creationTime: number;
2192
+ _id: string;
2193
+ accountId: string;
2194
+ allocations: Array<{
2195
+ amount: number;
2196
+ role?: "store" | "affiliate" | "other";
2197
+ stripeTransferId: string;
2198
+ }>;
2199
+ amount: number;
2200
+ attemptedAt?: number;
2201
+ currency: string;
2202
+ expectedRevision: number;
2203
+ observations: Array<{
2204
+ currency: string;
2205
+ ledgerFingerprint: string;
2206
+ matureNet: number;
2207
+ observedAt: number;
2208
+ pendingCredits: number;
2209
+ stripeTransferId: string;
2210
+ transactionIds: Array<string>;
2211
+ }>;
2212
+ operationKey: string;
2213
+ ownerKey: string;
2214
+ rejection?: {
2215
+ code: "balance_insufficient" | "amount_too_small";
2216
+ requestId: string;
2217
+ };
2218
+ returnTransactionId?: string;
2219
+ status: "reserved" | "submitted" | "paid" | "returned" | "canceled" | "rejected";
2220
+ stripePayoutId?: string;
2221
+ }>;
2222
+ }, Name>;
2223
+ };
2224
+ };
1928
2225
  products: {
1929
2226
  mutations: {
1930
2227
  upsertPrice: FunctionReference<"mutation", "internal", {