@paygentic/sdk 0.6.16 → 0.6.17

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 (116) hide show
  1. package/README.md +7 -3
  2. package/dist/commonjs/funcs/invoicesV2CreateLineItem.d.ts +18 -0
  3. package/dist/commonjs/funcs/invoicesV2CreateLineItem.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/invoicesV2CreateLineItem.js +118 -0
  5. package/dist/commonjs/funcs/invoicesV2CreateLineItem.js.map +1 -0
  6. package/dist/commonjs/funcs/invoicesV2ListLineItems.d.ts +19 -0
  7. package/dist/commonjs/funcs/invoicesV2ListLineItems.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/invoicesV2ListLineItems.js +126 -0
  9. package/dist/commonjs/funcs/invoicesV2ListLineItems.js.map +1 -0
  10. package/dist/commonjs/lib/config.d.ts +3 -3
  11. package/dist/commonjs/lib/config.js +3 -3
  12. package/dist/commonjs/models/createmanuallineitemrequest.d.ts +65 -0
  13. package/dist/commonjs/models/createmanuallineitemrequest.d.ts.map +1 -0
  14. package/dist/commonjs/models/createmanuallineitemrequest.js +59 -0
  15. package/dist/commonjs/models/createmanuallineitemrequest.js.map +1 -0
  16. package/dist/commonjs/models/index.d.ts +4 -0
  17. package/dist/commonjs/models/index.d.ts.map +1 -1
  18. package/dist/commonjs/models/index.js +4 -0
  19. package/dist/commonjs/models/index.js.map +1 -1
  20. package/dist/commonjs/models/invoicelineitem.d.ts +4 -4
  21. package/dist/commonjs/models/invoicelineitem.d.ts.map +1 -1
  22. package/dist/commonjs/models/invoicelineitem.js +4 -4
  23. package/dist/commonjs/models/invoicelineitem.js.map +1 -1
  24. package/dist/commonjs/models/lineitem.d.ts +146 -0
  25. package/dist/commonjs/models/lineitem.d.ts.map +1 -0
  26. package/dist/commonjs/models/lineitem.js +101 -0
  27. package/dist/commonjs/models/lineitem.js.map +1 -0
  28. package/dist/commonjs/models/lineitemsresponse.d.ts +37 -0
  29. package/dist/commonjs/models/lineitemsresponse.d.ts.map +1 -0
  30. package/dist/commonjs/models/lineitemsresponse.js +63 -0
  31. package/dist/commonjs/models/lineitemsresponse.js.map +1 -0
  32. package/dist/commonjs/models/lineitemssummary.d.ts +21 -0
  33. package/dist/commonjs/models/lineitemssummary.d.ts.map +1 -0
  34. package/dist/commonjs/models/lineitemssummary.js +52 -0
  35. package/dist/commonjs/models/lineitemssummary.js.map +1 -0
  36. package/dist/commonjs/models/operations/index.d.ts +1 -0
  37. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  38. package/dist/commonjs/models/operations/index.js +1 -0
  39. package/dist/commonjs/models/operations/index.js.map +1 -1
  40. package/dist/commonjs/models/operations/listlineitems.d.ts +49 -0
  41. package/dist/commonjs/models/operations/listlineitems.d.ts.map +1 -0
  42. package/dist/commonjs/models/operations/listlineitems.js +62 -0
  43. package/dist/commonjs/models/operations/listlineitems.js.map +1 -0
  44. package/dist/commonjs/models/payment.d.ts +4 -4
  45. package/dist/commonjs/models/payment.d.ts.map +1 -1
  46. package/dist/commonjs/models/payment.js +6 -6
  47. package/dist/commonjs/models/payment.js.map +1 -1
  48. package/dist/commonjs/sdk/invoicesv2.d.ts +14 -0
  49. package/dist/commonjs/sdk/invoicesv2.d.ts.map +1 -1
  50. package/dist/commonjs/sdk/invoicesv2.js +20 -0
  51. package/dist/commonjs/sdk/invoicesv2.js.map +1 -1
  52. package/dist/esm/funcs/invoicesV2CreateLineItem.d.ts +18 -0
  53. package/dist/esm/funcs/invoicesV2CreateLineItem.d.ts.map +1 -0
  54. package/dist/esm/funcs/invoicesV2CreateLineItem.js +82 -0
  55. package/dist/esm/funcs/invoicesV2CreateLineItem.js.map +1 -0
  56. package/dist/esm/funcs/invoicesV2ListLineItems.d.ts +19 -0
  57. package/dist/esm/funcs/invoicesV2ListLineItems.d.ts.map +1 -0
  58. package/dist/esm/funcs/invoicesV2ListLineItems.js +90 -0
  59. package/dist/esm/funcs/invoicesV2ListLineItems.js.map +1 -0
  60. package/dist/esm/lib/config.d.ts +3 -3
  61. package/dist/esm/lib/config.js +3 -3
  62. package/dist/esm/models/createmanuallineitemrequest.d.ts +65 -0
  63. package/dist/esm/models/createmanuallineitemrequest.d.ts.map +1 -0
  64. package/dist/esm/models/createmanuallineitemrequest.js +22 -0
  65. package/dist/esm/models/createmanuallineitemrequest.js.map +1 -0
  66. package/dist/esm/models/index.d.ts +4 -0
  67. package/dist/esm/models/index.d.ts.map +1 -1
  68. package/dist/esm/models/index.js +4 -0
  69. package/dist/esm/models/index.js.map +1 -1
  70. package/dist/esm/models/invoicelineitem.d.ts +4 -4
  71. package/dist/esm/models/invoicelineitem.d.ts.map +1 -1
  72. package/dist/esm/models/invoicelineitem.js +3 -3
  73. package/dist/esm/models/invoicelineitem.js.map +1 -1
  74. package/dist/esm/models/lineitem.d.ts +146 -0
  75. package/dist/esm/models/lineitem.d.ts.map +1 -0
  76. package/dist/esm/models/lineitem.js +64 -0
  77. package/dist/esm/models/lineitem.js.map +1 -0
  78. package/dist/esm/models/lineitemsresponse.d.ts +37 -0
  79. package/dist/esm/models/lineitemsresponse.d.ts.map +1 -0
  80. package/dist/esm/models/lineitemsresponse.js +26 -0
  81. package/dist/esm/models/lineitemsresponse.js.map +1 -0
  82. package/dist/esm/models/lineitemssummary.d.ts +21 -0
  83. package/dist/esm/models/lineitemssummary.d.ts.map +1 -0
  84. package/dist/esm/models/lineitemssummary.js +15 -0
  85. package/dist/esm/models/lineitemssummary.js.map +1 -0
  86. package/dist/esm/models/operations/index.d.ts +1 -0
  87. package/dist/esm/models/operations/index.d.ts.map +1 -1
  88. package/dist/esm/models/operations/index.js +1 -0
  89. package/dist/esm/models/operations/index.js.map +1 -1
  90. package/dist/esm/models/operations/listlineitems.d.ts +49 -0
  91. package/dist/esm/models/operations/listlineitems.d.ts.map +1 -0
  92. package/dist/esm/models/operations/listlineitems.js +25 -0
  93. package/dist/esm/models/operations/listlineitems.js.map +1 -0
  94. package/dist/esm/models/payment.d.ts +4 -4
  95. package/dist/esm/models/payment.d.ts.map +1 -1
  96. package/dist/esm/models/payment.js +4 -4
  97. package/dist/esm/models/payment.js.map +1 -1
  98. package/dist/esm/sdk/invoicesv2.d.ts +14 -0
  99. package/dist/esm/sdk/invoicesv2.d.ts.map +1 -1
  100. package/dist/esm/sdk/invoicesv2.js +20 -0
  101. package/dist/esm/sdk/invoicesv2.js.map +1 -1
  102. package/jsr.json +1 -1
  103. package/package.json +1 -1
  104. package/src/funcs/invoicesV2CreateLineItem.ts +174 -0
  105. package/src/funcs/invoicesV2ListLineItems.ts +184 -0
  106. package/src/lib/config.ts +3 -3
  107. package/src/models/createmanuallineitemrequest.ts +96 -0
  108. package/src/models/index.ts +4 -0
  109. package/src/models/invoicelineitem.ts +9 -6
  110. package/src/models/lineitem.ts +205 -0
  111. package/src/models/lineitemsresponse.ts +70 -0
  112. package/src/models/lineitemssummary.ts +44 -0
  113. package/src/models/operations/index.ts +1 -0
  114. package/src/models/operations/listlineitems.ts +76 -0
  115. package/src/models/payment.ts +9 -9
  116. package/src/sdk/invoicesv2.ts +36 -0
@@ -1 +1 @@
1
- {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/models/payment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,aAAa;;CAEhB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAA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,EAAE,kBAAkB,CAAC,CAM9C"}
@@ -19,13 +19,13 @@ export const PaymentStatus = {
19
19
  /** @internal */
20
20
  export const PaymentObject$inboundSchema = z.nativeEnum(PaymentObject);
21
21
  /** @internal */
22
- export const LineItem$inboundSchema = z.object({
22
+ export const PaymentLineItem$inboundSchema = z.object({
23
23
  description: z.string().optional(),
24
24
  amount: z.string().optional(),
25
25
  quantity: z.number().int().optional(),
26
26
  });
27
- export function lineItemFromJSON(jsonString) {
28
- return safeParse(jsonString, (x) => LineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LineItem' from JSON`);
27
+ export function paymentLineItemFromJSON(jsonString) {
28
+ return safeParse(jsonString, (x) => PaymentLineItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentLineItem' from JSON`);
29
29
  }
30
30
  /** @internal */
31
31
  export const PaymentStatus$inboundSchema = z.nativeEnum(PaymentStatus);
@@ -40,7 +40,7 @@ export const Payment$inboundSchema = z.object({
40
40
  idempotencyKey: z.string().optional(),
41
41
  reference: z.string().optional(),
42
42
  metadata: z.record(z.string()).optional(),
43
- lineItems: z.array(z.lazy(() => LineItem$inboundSchema)).optional(),
43
+ lineItems: z.array(z.lazy(() => PaymentLineItem$inboundSchema)).optional(),
44
44
  status: PaymentStatus$inboundSchema,
45
45
  expiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
46
46
  .optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/models/payment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,SAAS;CACV,CAAC;AASX;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,SA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,EAAE;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1E,MAAM,EAAE,2BAA2B;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;SACzE,QAAQ,EAAE;IACb,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC7D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;CACF,CAAC,CAAC;AAEL,MAAM,UAAU,eAAe,CAC7B,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjD,qCAAqC,CACtC,CAAC;AACJ,CAAC"}
@@ -9,6 +9,20 @@ export declare class InvoicesV2 extends ClientSDK {
9
9
  * List invoices with optional filters. Platform users can use nextActionAt=ready to get invoices ready for processing.
10
10
  */
11
11
  list(request?: operations.ListInvoicesRequest | undefined, options?: RequestOptions): Promise<operations.ListInvoicesResponse>;
12
+ /**
13
+ * List Line Items
14
+ *
15
+ * @remarks
16
+ * List pending and invoiced line items for a subscription from the billing database. Returns exact fee amounts and estimated metered charges.
17
+ */
18
+ listLineItems(request?: operations.ListLineItemsRequest | undefined, options?: RequestOptions): Promise<models.LineItemsResponse>;
19
+ /**
20
+ * Create Manual Line Item
21
+ *
22
+ * @remarks
23
+ * Create a manual line item for a billing v1 subscription. Manual line items are ad-hoc charges or credits that flow through the same collection pipeline as auto-generated items. Exactly one of subscriptionId or invoiceId must be provided.
24
+ */
25
+ createLineItem(request: models.CreateManualLineItemRequest, options?: RequestOptions): Promise<models.LineItem>;
12
26
  /**
13
27
  * Get
14
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invoicesv2.d.ts","sourceRoot":"","sources":["../../../src/sdk/invoicesv2.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,UAAW,SAAQ,SAAS;IACvC;;;;;OAKG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,UAAU,CAAC,mBAAmB,GAAG,SAAS,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAQ3C;;;;;OAKG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IAQ1B;;;;;OAKG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC;CAO5C"}
1
+ {"version":3,"file":"invoicesv2.d.ts","sourceRoot":"","sources":["../../../src/sdk/invoicesv2.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,UAAW,SAAQ,SAAS;IACvC;;;;;OAKG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,UAAU,CAAC,mBAAmB,GAAG,SAAS,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAQ3C;;;;;OAKG;IACG,aAAa,CACjB,OAAO,CAAC,EAAE,UAAU,CAAC,oBAAoB,GAAG,SAAS,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;IAQpC;;;;;OAKG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,CAAC,2BAA2B,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;IAQ3B;;;;;OAKG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IAQ1B;;;;;OAKG;IACG,YAAY,CAChB,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC;CAO5C"}
@@ -1,9 +1,11 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
+ import { invoicesV2CreateLineItem } from "../funcs/invoicesV2CreateLineItem.js";
4
5
  import { invoicesV2Get } from "../funcs/invoicesV2Get.js";
5
6
  import { invoicesV2GetLineItems } from "../funcs/invoicesV2GetLineItems.js";
6
7
  import { invoicesV2List } from "../funcs/invoicesV2List.js";
8
+ import { invoicesV2ListLineItems } from "../funcs/invoicesV2ListLineItems.js";
7
9
  import { ClientSDK } from "../lib/sdks.js";
8
10
  import { unwrapAsync } from "../types/fp.js";
9
11
  export class InvoicesV2 extends ClientSDK {
@@ -16,6 +18,24 @@ export class InvoicesV2 extends ClientSDK {
16
18
  async list(request, options) {
17
19
  return unwrapAsync(invoicesV2List(this, request, options));
18
20
  }
21
+ /**
22
+ * List Line Items
23
+ *
24
+ * @remarks
25
+ * List pending and invoiced line items for a subscription from the billing database. Returns exact fee amounts and estimated metered charges.
26
+ */
27
+ async listLineItems(request, options) {
28
+ return unwrapAsync(invoicesV2ListLineItems(this, request, options));
29
+ }
30
+ /**
31
+ * Create Manual Line Item
32
+ *
33
+ * @remarks
34
+ * Create a manual line item for a billing v1 subscription. Manual line items are ad-hoc charges or credits that flow through the same collection pipeline as auto-generated items. Exactly one of subscriptionId or invoiceId must be provided.
35
+ */
36
+ async createLineItem(request, options) {
37
+ return unwrapAsync(invoicesV2CreateLineItem(this, request, options));
38
+ }
19
39
  /**
20
40
  * Get
21
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invoicesv2.js","sourceRoot":"","sources":["../../../src/sdk/invoicesv2.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,UAAW,SAAQ,SAAS;IACvC;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,OAAoD,EACpD,OAAwB;QAExB,OAAO,WAAW,CAAC,cAAc,CAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CACP,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,aAAa,CAC9B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAA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,CAAC,aAAa,CAC9B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAChB,OAA8C,EAC9C,OAAwB;QAExB,OAAO,WAAW,CAAC,sBAAsB,CACvC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
package/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paygentic/sdk",
3
- "version": "0.6.16",
3
+ "version": "0.6.17",
4
4
  "exports": {
5
5
  ".": "./src/index.ts",
6
6
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paygentic/sdk",
3
- "version": "0.6.16",
3
+ "version": "0.6.17",
4
4
  "author": "Speakeasy",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,174 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PaygenticCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { PaygenticError } from "../models/errors/paygenticerror.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as models from "../models/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Create Manual Line Item
30
+ *
31
+ * @remarks
32
+ * Create a manual line item for a billing v1 subscription. Manual line items are ad-hoc charges or credits that flow through the same collection pipeline as auto-generated items. Exactly one of subscriptionId or invoiceId must be provided.
33
+ */
34
+ export function invoicesV2CreateLineItem(
35
+ client: PaygenticCore,
36
+ request: models.CreateManualLineItemRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ models.LineItem,
41
+ | errors.BadRequest
42
+ | errors.ErrorT
43
+ | PaygenticError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: PaygenticCore,
62
+ request: models.CreateManualLineItemRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ models.LineItem,
68
+ | errors.BadRequest
69
+ | errors.ErrorT
70
+ | PaygenticError
71
+ | ResponseValidationError
72
+ | ConnectionError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | InvalidRequestError
76
+ | UnexpectedClientError
77
+ | SDKValidationError
78
+ >,
79
+ APICall,
80
+ ]
81
+ > {
82
+ const parsed = safeParse(
83
+ request,
84
+ (value) => models.CreateManualLineItemRequest$outboundSchema.parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload, { explode: true });
92
+
93
+ const path = pathToFunc("/v2/invoices/lineItems")();
94
+
95
+ const headers = new Headers(compactMap({
96
+ "Content-Type": "application/json",
97
+ Accept: "application/json",
98
+ }));
99
+
100
+ const secConfig = await extractSecurity(client._options.bearerAuth);
101
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
103
+
104
+ const context = {
105
+ options: client._options,
106
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
107
+ operationID: "createLineItem",
108
+ oAuth2Scopes: null,
109
+
110
+ resolvedSecurity: requestSecurity,
111
+
112
+ securitySource: client._options.bearerAuth,
113
+ retryConfig: options?.retries
114
+ || client._options.retryConfig
115
+ || { strategy: "none" },
116
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
117
+ };
118
+
119
+ const requestRes = client._createRequest(context, {
120
+ security: requestSecurity,
121
+ method: "POST",
122
+ baseURL: options?.serverURL,
123
+ path: path,
124
+ headers: headers,
125
+ body: body,
126
+ userAgent: client._options.userAgent,
127
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
128
+ }, options);
129
+ if (!requestRes.ok) {
130
+ return [requestRes, { status: "invalid" }];
131
+ }
132
+ const req = requestRes.value;
133
+
134
+ const doResult = await client._do(req, {
135
+ context,
136
+ errorCodes: ["400", "401", "403", "404", "409", "422", "4XX", "500", "5XX"],
137
+ retryConfig: context.retryConfig,
138
+ retryCodes: context.retryCodes,
139
+ });
140
+ if (!doResult.ok) {
141
+ return [doResult, { status: "request-error", request: req }];
142
+ }
143
+ const response = doResult.value;
144
+
145
+ const responseFields = {
146
+ HttpMeta: { Response: response, Request: req },
147
+ };
148
+
149
+ const [result] = await M.match<
150
+ models.LineItem,
151
+ | errors.BadRequest
152
+ | errors.ErrorT
153
+ | PaygenticError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json([200, 201], models.LineItem$inboundSchema),
163
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
164
+ M.jsonErr([401, 403, 404, 409, 422], errors.ErrorT$inboundSchema),
165
+ M.jsonErr(500, errors.ErrorT$inboundSchema),
166
+ M.fail("4XX"),
167
+ M.fail("5XX"),
168
+ )(response, req, { extraFields: responseFields });
169
+ if (!result.ok) {
170
+ return [result, { status: "complete", request: req, response }];
171
+ }
172
+
173
+ return [result, { status: "complete", request: req, response }];
174
+ }
@@ -0,0 +1,184 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PaygenticCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { PaygenticError } from "../models/errors/paygenticerror.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as models from "../models/index.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List Line Items
31
+ *
32
+ * @remarks
33
+ * List pending and invoiced line items for a subscription from the billing database. Returns exact fee amounts and estimated metered charges.
34
+ */
35
+ export function invoicesV2ListLineItems(
36
+ client: PaygenticCore,
37
+ request?: operations.ListLineItemsRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ models.LineItemsResponse,
42
+ | errors.BadRequest
43
+ | errors.ErrorT
44
+ | PaygenticError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: PaygenticCore,
63
+ request?: operations.ListLineItemsRequest | undefined,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ models.LineItemsResponse,
69
+ | errors.BadRequest
70
+ | errors.ErrorT
71
+ | PaygenticError
72
+ | ResponseValidationError
73
+ | ConnectionError
74
+ | RequestAbortedError
75
+ | RequestTimeoutError
76
+ | InvalidRequestError
77
+ | UnexpectedClientError
78
+ | SDKValidationError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) =>
86
+ operations.ListLineItemsRequest$outboundSchema.optional().parse(value),
87
+ "Input validation failed",
88
+ );
89
+ if (!parsed.ok) {
90
+ return [parsed, { status: "invalid" }];
91
+ }
92
+ const payload = parsed.value;
93
+ const body = null;
94
+
95
+ const path = pathToFunc("/v2/invoices/lineItems")();
96
+
97
+ const query = encodeFormQuery({
98
+ "invoiceId": payload?.invoiceId,
99
+ "limit": payload?.limit,
100
+ "offset": payload?.offset,
101
+ "status": payload?.status,
102
+ "subscriptionId": payload?.subscriptionId,
103
+ });
104
+
105
+ const headers = new Headers(compactMap({
106
+ Accept: "application/json",
107
+ }));
108
+
109
+ const secConfig = await extractSecurity(client._options.bearerAuth);
110
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
111
+ const requestSecurity = resolveGlobalSecurity(securityInput);
112
+
113
+ const context = {
114
+ options: client._options,
115
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
116
+ operationID: "listLineItems",
117
+ oAuth2Scopes: null,
118
+
119
+ resolvedSecurity: requestSecurity,
120
+
121
+ securitySource: client._options.bearerAuth,
122
+ retryConfig: options?.retries
123
+ || client._options.retryConfig
124
+ || { strategy: "none" },
125
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
126
+ };
127
+
128
+ const requestRes = client._createRequest(context, {
129
+ security: requestSecurity,
130
+ method: "GET",
131
+ baseURL: options?.serverURL,
132
+ path: path,
133
+ headers: headers,
134
+ query: query,
135
+ body: body,
136
+ userAgent: client._options.userAgent,
137
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
+ }, options);
139
+ if (!requestRes.ok) {
140
+ return [requestRes, { status: "invalid" }];
141
+ }
142
+ const req = requestRes.value;
143
+
144
+ const doResult = await client._do(req, {
145
+ context,
146
+ errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
147
+ retryConfig: context.retryConfig,
148
+ retryCodes: context.retryCodes,
149
+ });
150
+ if (!doResult.ok) {
151
+ return [doResult, { status: "request-error", request: req }];
152
+ }
153
+ const response = doResult.value;
154
+
155
+ const responseFields = {
156
+ HttpMeta: { Response: response, Request: req },
157
+ };
158
+
159
+ const [result] = await M.match<
160
+ models.LineItemsResponse,
161
+ | errors.BadRequest
162
+ | errors.ErrorT
163
+ | PaygenticError
164
+ | ResponseValidationError
165
+ | ConnectionError
166
+ | RequestAbortedError
167
+ | RequestTimeoutError
168
+ | InvalidRequestError
169
+ | UnexpectedClientError
170
+ | SDKValidationError
171
+ >(
172
+ M.json(200, models.LineItemsResponse$inboundSchema),
173
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
174
+ M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema),
175
+ M.jsonErr(500, errors.ErrorT$inboundSchema),
176
+ M.fail("4XX"),
177
+ M.fail("5XX"),
178
+ )(response, req, { extraFields: responseFields });
179
+ if (!result.ok) {
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
182
+
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
package/src/lib/config.ts CHANGED
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
  export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.1.0",
64
- sdkVersion: "0.6.14",
65
- genVersion: "2.850.7",
66
- userAgent: "speakeasy-sdk/typescript 0.6.14 2.850.7 0.1.0 @paygentic/sdk",
64
+ sdkVersion: "0.6.16",
65
+ genVersion: "2.856.1",
66
+ userAgent: "speakeasy-sdk/typescript 0.6.16 2.856.1 0.1.0 @paygentic/sdk",
67
67
  } as const;
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ export type CreateManualLineItemRequest = {
8
+ /**
9
+ * The subscription ID. Exactly one of subscriptionId or invoiceId must be provided.
10
+ */
11
+ subscriptionId?: string | undefined;
12
+ /**
13
+ * The invoice ID to attach this item directly to. Exactly one of subscriptionId or invoiceId must be provided. The invoice must not have reached ISSUED status (accepted states: CLOSING, CLOSED, CALCULATING, DRAFT, APPROVED).
14
+ */
15
+ invoiceId?: string | undefined;
16
+ /**
17
+ * Human-readable label shown on the invoice.
18
+ */
19
+ displayName: string;
20
+ /**
21
+ * Optional longer description shown on the invoice.
22
+ */
23
+ description?: string | null | undefined;
24
+ /**
25
+ * ISO 4217 currency code (e.g., USD). Must match the subscription or invoice currency.
26
+ */
27
+ currency: string;
28
+ /**
29
+ * Number of units.
30
+ */
31
+ quantity: number;
32
+ /**
33
+ * Price per unit as a decimal amount (e.g., 29.99 for $29.99). Can be negative for credits or adjustments. Must be between -99,999,999 and 99,999,999.
34
+ */
35
+ unitPrice: number;
36
+ /**
37
+ * When to collect this item into an invoice. Defaults to now. Ignored when invoiceId is provided.
38
+ */
39
+ invoiceAt?: Date | null | undefined;
40
+ /**
41
+ * Start of the billing period for display purposes. Defaults to now.
42
+ */
43
+ periodStart?: Date | null | undefined;
44
+ /**
45
+ * End of the billing period for display purposes. Defaults to now.
46
+ */
47
+ periodEnd?: Date | null | undefined;
48
+ /**
49
+ * Optional caller-provided idempotency key. Auto-generated if not provided.
50
+ */
51
+ idempotencyKey?: string | null | undefined;
52
+ };
53
+
54
+ /** @internal */
55
+ export type CreateManualLineItemRequest$Outbound = {
56
+ subscriptionId?: string | undefined;
57
+ invoiceId?: string | undefined;
58
+ displayName: string;
59
+ description?: string | null | undefined;
60
+ currency: string;
61
+ quantity: number;
62
+ unitPrice: number;
63
+ invoiceAt?: string | null | undefined;
64
+ periodStart?: string | null | undefined;
65
+ periodEnd?: string | null | undefined;
66
+ idempotencyKey?: string | null | undefined;
67
+ };
68
+
69
+ /** @internal */
70
+ export const CreateManualLineItemRequest$outboundSchema: z.ZodType<
71
+ CreateManualLineItemRequest$Outbound,
72
+ z.ZodTypeDef,
73
+ CreateManualLineItemRequest
74
+ > = z.object({
75
+ subscriptionId: z.string().optional(),
76
+ invoiceId: z.string().optional(),
77
+ displayName: z.string(),
78
+ description: z.nullable(z.string()).optional(),
79
+ currency: z.string(),
80
+ quantity: z.number(),
81
+ unitPrice: z.number(),
82
+ invoiceAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
83
+ periodStart: z.nullable(z.date().transform(v => v.toISOString())).optional(),
84
+ periodEnd: z.nullable(z.date().transform(v => v.toISOString())).optional(),
85
+ idempotencyKey: z.nullable(z.string()).optional(),
86
+ });
87
+
88
+ export function createManualLineItemRequestToJSON(
89
+ createManualLineItemRequest: CreateManualLineItemRequest,
90
+ ): string {
91
+ return JSON.stringify(
92
+ CreateManualLineItemRequest$outboundSchema.parse(
93
+ createManualLineItemRequest,
94
+ ),
95
+ );
96
+ }
@@ -9,6 +9,7 @@ export * from "./billablemetric.js";
9
9
  export * from "./booleanentitlementdetail.js";
10
10
  export * from "./createdisputerequest.js";
11
11
  export * from "./createentitlementrequest.js";
12
+ export * from "./createmanuallineitemrequest.js";
12
13
  export * from "./createrulerequest.js";
13
14
  export * from "./createusageeventrequest.js";
14
15
  export * from "./customer.js";
@@ -26,6 +27,9 @@ export * from "./invoice.js";
26
27
  export * from "./invoicelineitem.js";
27
28
  export * from "./invoicelineitemsresponse.js";
28
29
  export * from "./issueentitlementrequest.js";
30
+ export * from "./lineitem.js";
31
+ export * from "./lineitemsresponse.js";
32
+ export * from "./lineitemssummary.js";
29
33
  export * from "./meteredentitlementdetail.js";
30
34
  export * from "./offsetpagination.js";
31
35
  export * from "./payment.js";
@@ -23,14 +23,16 @@ export type EventType = ClosedEnum<typeof EventType>;
23
23
  /**
24
24
  * Type of line item: 'charge' for regular billing, 'refund' for refunded items (amounts are negated)
25
25
  */
26
- export const LineItemType = {
26
+ export const InvoiceLineItemLineItemType = {
27
27
  Charge: "charge",
28
28
  Refund: "refund",
29
29
  } as const;
30
30
  /**
31
31
  * Type of line item: 'charge' for regular billing, 'refund' for refunded items (amounts are negated)
32
32
  */
33
- export type LineItemType = ClosedEnum<typeof LineItemType>;
33
+ export type InvoiceLineItemLineItemType = ClosedEnum<
34
+ typeof InvoiceLineItemLineItemType
35
+ >;
34
36
 
35
37
  export type InvoiceLineItem = {
36
38
  /**
@@ -56,7 +58,7 @@ export type InvoiceLineItem = {
56
58
  /**
57
59
  * Type of line item: 'charge' for regular billing, 'refund' for refunded items (amounts are negated)
58
60
  */
59
- lineItemType: LineItemType;
61
+ lineItemType: InvoiceLineItemLineItemType;
60
62
  /**
61
63
  * The meter event ID (usage events only)
62
64
  */
@@ -104,8 +106,9 @@ export const EventType$inboundSchema: z.ZodNativeEnum<typeof EventType> = z
104
106
  .nativeEnum(EventType);
105
107
 
106
108
  /** @internal */
107
- export const LineItemType$inboundSchema: z.ZodNativeEnum<typeof LineItemType> =
108
- z.nativeEnum(LineItemType);
109
+ export const InvoiceLineItemLineItemType$inboundSchema: z.ZodNativeEnum<
110
+ typeof InvoiceLineItemLineItemType
111
+ > = z.nativeEnum(InvoiceLineItemLineItemType);
109
112
 
110
113
  /** @internal */
111
114
  export const InvoiceLineItem$inboundSchema: z.ZodType<
@@ -118,7 +121,7 @@ export const InvoiceLineItem$inboundSchema: z.ZodType<
118
121
  eventSourceId: z.string(),
119
122
  billableMetricId: z.string(),
120
123
  invoiceDisplayName: z.string(),
121
- lineItemType: LineItemType$inboundSchema,
124
+ lineItemType: InvoiceLineItemLineItemType$inboundSchema,
122
125
  meterEventId: z.string(),
123
126
  metricDescription: z.string(),
124
127
  metricName: z.string(),