@paygentic/sdk 0.9.9 → 0.9.11

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 (49) hide show
  1. package/dist/commonjs/funcs/subscriptionsReconcileSubscriptionFeatures.js +2 -2
  2. package/dist/commonjs/funcs/subscriptionsReconcileSubscriptionFeatures.js.map +1 -1
  3. package/dist/commonjs/lib/config.d.ts +2 -2
  4. package/dist/commonjs/lib/config.js +2 -2
  5. package/dist/commonjs/lib/config.js.map +1 -1
  6. package/dist/commonjs/models/costreportresponse.d.ts +20 -0
  7. package/dist/commonjs/models/costreportresponse.d.ts.map +1 -1
  8. package/dist/commonjs/models/costreportresponse.js +12 -1
  9. package/dist/commonjs/models/costreportresponse.js.map +1 -1
  10. package/dist/commonjs/models/invoice.d.ts +3 -3
  11. package/dist/commonjs/models/invoice.js +1 -1
  12. package/dist/commonjs/models/lineitem.d.ts +1 -1
  13. package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +40 -0
  14. package/dist/commonjs/models/profitabilitysummaryresponse.d.ts.map +1 -1
  15. package/dist/commonjs/models/profitabilitysummaryresponse.js +21 -1
  16. package/dist/commonjs/models/profitabilitysummaryresponse.js.map +1 -1
  17. package/dist/commonjs/models/revenuesummaryresponse.d.ts +20 -0
  18. package/dist/commonjs/models/revenuesummaryresponse.d.ts.map +1 -1
  19. package/dist/commonjs/models/revenuesummaryresponse.js +11 -1
  20. package/dist/commonjs/models/revenuesummaryresponse.js.map +1 -1
  21. package/dist/esm/funcs/subscriptionsReconcileSubscriptionFeatures.js +2 -2
  22. package/dist/esm/funcs/subscriptionsReconcileSubscriptionFeatures.js.map +1 -1
  23. package/dist/esm/lib/config.d.ts +2 -2
  24. package/dist/esm/lib/config.js +2 -2
  25. package/dist/esm/lib/config.js.map +1 -1
  26. package/dist/esm/models/costreportresponse.d.ts +20 -0
  27. package/dist/esm/models/costreportresponse.d.ts.map +1 -1
  28. package/dist/esm/models/costreportresponse.js +10 -0
  29. package/dist/esm/models/costreportresponse.js.map +1 -1
  30. package/dist/esm/models/invoice.d.ts +3 -3
  31. package/dist/esm/models/invoice.js +1 -1
  32. package/dist/esm/models/lineitem.d.ts +1 -1
  33. package/dist/esm/models/profitabilitysummaryresponse.d.ts +40 -0
  34. package/dist/esm/models/profitabilitysummaryresponse.d.ts.map +1 -1
  35. package/dist/esm/models/profitabilitysummaryresponse.js +18 -0
  36. package/dist/esm/models/profitabilitysummaryresponse.js.map +1 -1
  37. package/dist/esm/models/revenuesummaryresponse.d.ts +20 -0
  38. package/dist/esm/models/revenuesummaryresponse.d.ts.map +1 -1
  39. package/dist/esm/models/revenuesummaryresponse.js +9 -0
  40. package/dist/esm/models/revenuesummaryresponse.js.map +1 -1
  41. package/jsr.json +1 -1
  42. package/package.json +1 -1
  43. package/src/funcs/subscriptionsReconcileSubscriptionFeatures.ts +2 -2
  44. package/src/lib/config.ts +2 -2
  45. package/src/models/costreportresponse.ts +40 -0
  46. package/src/models/invoice.ts +3 -3
  47. package/src/models/lineitem.ts +1 -1
  48. package/src/models/profitabilitysummaryresponse.ts +89 -0
  49. package/src/models/revenuesummaryresponse.ts +42 -0
@@ -27,6 +27,20 @@ import {
27
27
  RevenueTrendBucket$inboundSchema,
28
28
  } from "./revenuetrendbucket.js";
29
29
 
30
+ /**
31
+ * Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
32
+ */
33
+ export type RevenueSummaryResponseRevenueRange = {
34
+ /**
35
+ * Earliest invoice issue instant.
36
+ */
37
+ from: Date;
38
+ /**
39
+ * Latest invoice issue instant.
40
+ */
41
+ to: Date;
42
+ };
43
+
30
44
  export type RevenueSummaryResponse = {
31
45
  /**
32
46
  * Object type identifier
@@ -66,8 +80,33 @@ export type RevenueSummaryResponse = {
66
80
  * Per-currency revenue aggregates (only present when groupBy=currency is specified). Primary currency appears first, then alphabetical by ISO code. When present, top-level netRevenue, invoices, payments, and trend fields are omitted.
67
81
  */
68
82
  currencyBreakdown?: Array<CurrencyBreakdownEntry> | undefined;
83
+ /**
84
+ * Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
85
+ */
86
+ revenueRange?: RevenueSummaryResponseRevenueRange | null | undefined;
69
87
  };
70
88
 
89
+ /** @internal */
90
+ export const RevenueSummaryResponseRevenueRange$inboundSchema: z.ZodType<
91
+ RevenueSummaryResponseRevenueRange,
92
+ z.ZodTypeDef,
93
+ unknown
94
+ > = z.object({
95
+ from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
96
+ to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
97
+ });
98
+
99
+ export function revenueSummaryResponseRevenueRangeFromJSON(
100
+ jsonString: string,
101
+ ): SafeParseResult<RevenueSummaryResponseRevenueRange, SDKValidationError> {
102
+ return safeParse(
103
+ jsonString,
104
+ (x) =>
105
+ RevenueSummaryResponseRevenueRange$inboundSchema.parse(JSON.parse(x)),
106
+ `Failed to parse 'RevenueSummaryResponseRevenueRange' from JSON`,
107
+ );
108
+ }
109
+
71
110
  /** @internal */
72
111
  export const RevenueSummaryResponse$inboundSchema: z.ZodType<
73
112
  RevenueSummaryResponse,
@@ -85,6 +124,9 @@ export const RevenueSummaryResponse$inboundSchema: z.ZodType<
85
124
  trend: z.array(RevenueTrendBucket$inboundSchema).optional(),
86
125
  groupBreakdown: z.array(GroupInvoiceSummary$inboundSchema).optional(),
87
126
  currencyBreakdown: z.array(CurrencyBreakdownEntry$inboundSchema).optional(),
127
+ revenueRange: z.nullable(
128
+ z.lazy(() => RevenueSummaryResponseRevenueRange$inboundSchema),
129
+ ).optional(),
88
130
  });
89
131
 
90
132
  export function revenueSummaryResponseFromJSON(