@flexprice/sdk 2.0.14 → 2.0.16

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 (59) hide show
  1. package/docs/sdk/models/get-invoice-pdf-request.md +5 -4
  2. package/docs/sdk/models/subscription-filter.md +23 -22
  3. package/docs/sdk/models/webhook-event-name.md +2 -2
  4. package/docs/sdks/entitlements/README.md +1 -1
  5. package/docs/sdks/integrations/README.md +1 -1
  6. package/docs/sdks/invoices/README.md +2 -1
  7. package/docs/sdks/webhookevents/README.md +0 -69
  8. package/esm/funcs/entitlements-get-plan-entitlements.d.ts +1 -1
  9. package/esm/funcs/entitlements-get-plan-entitlements.d.ts.map +1 -1
  10. package/esm/funcs/entitlements-get-plan-entitlements.js +1 -1
  11. package/esm/funcs/entitlements-get-plan-entitlements.js.map +1 -1
  12. package/esm/funcs/integrations-link-integration-mapping.js +1 -1
  13. package/esm/funcs/integrations-link-integration-mapping.js.map +1 -1
  14. package/esm/funcs/invoices-get-invoice-pdf.d.ts +2 -2
  15. package/esm/funcs/invoices-get-invoice-pdf.d.ts.map +1 -1
  16. package/esm/funcs/invoices-get-invoice-pdf.js +6 -4
  17. package/esm/funcs/invoices-get-invoice-pdf.js.map +1 -1
  18. package/esm/lib/config.d.ts +3 -3
  19. package/esm/lib/config.js +3 -3
  20. package/esm/sdk/entitlements.d.ts +1 -1
  21. package/esm/sdk/entitlements.d.ts.map +1 -1
  22. package/esm/sdk/entitlements.js.map +1 -1
  23. package/esm/sdk/invoices.d.ts +2 -2
  24. package/esm/sdk/invoices.d.ts.map +1 -1
  25. package/esm/sdk/invoices.js +3 -3
  26. package/esm/sdk/invoices.js.map +1 -1
  27. package/esm/sdk/models/get-invoice-pdf-op.d.ts +5 -0
  28. package/esm/sdk/models/get-invoice-pdf-op.d.ts.map +1 -1
  29. package/esm/sdk/models/get-invoice-pdf-op.js +8 -2
  30. package/esm/sdk/models/get-invoice-pdf-op.js.map +1 -1
  31. package/esm/sdk/models/subscription-filter.d.ts +9 -0
  32. package/esm/sdk/models/subscription-filter.d.ts.map +1 -1
  33. package/esm/sdk/models/subscription-filter.js +2 -0
  34. package/esm/sdk/models/subscription-filter.js.map +1 -1
  35. package/esm/sdk/models/webhook-event-name.d.ts +0 -1
  36. package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
  37. package/esm/sdk/models/webhook-event-name.js +0 -1
  38. package/esm/sdk/models/webhook-event-name.js.map +1 -1
  39. package/esm/sdk/webhook-events.d.ts +0 -7
  40. package/esm/sdk/webhook-events.d.ts.map +1 -1
  41. package/esm/sdk/webhook-events.js +0 -10
  42. package/esm/sdk/webhook-events.js.map +1 -1
  43. package/jsr.json +1 -1
  44. package/package.json +1 -1
  45. package/src/funcs/entitlements-get-plan-entitlements.ts +4 -4
  46. package/src/funcs/integrations-link-integration-mapping.ts +1 -1
  47. package/src/funcs/invoices-get-invoice-pdf.ts +6 -1
  48. package/src/lib/config.ts +3 -3
  49. package/src/sdk/entitlements.ts +1 -1
  50. package/src/sdk/invoices.ts +3 -1
  51. package/src/sdk/models/get-invoice-pdf-op.ts +18 -4
  52. package/src/sdk/models/subscription-filter.ts +11 -0
  53. package/src/sdk/models/webhook-event-name.ts +0 -1
  54. package/src/sdk/webhook-events.ts +0 -16
  55. package/esm/funcs/webhook-events-post-webhook-events-invoice-create-drafted.d.ts +0 -17
  56. package/esm/funcs/webhook-events-post-webhook-events-invoice-create-drafted.d.ts.map +0 -1
  57. package/esm/funcs/webhook-events-post-webhook-events-invoice-create-drafted.js +0 -68
  58. package/esm/funcs/webhook-events-post-webhook-events-invoice-create-drafted.js.map +0 -1
  59. package/src/funcs/webhook-events-post-webhook-events-invoice-create-drafted.ts +0 -142
@@ -1,142 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { FlexpriceCore } from "../core.js";
6
- import * as M from "../lib/matchers.js";
7
- import { compactMap } from "../lib/primitives.js";
8
- import { RequestOptions } from "../lib/sdks.js";
9
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
10
- import { pathToFunc } from "../lib/url.js";
11
- import { FlexPriceError } from "../sdk/models/flex-price-error.js";
12
- import {
13
- ConnectionError,
14
- InvalidRequestError,
15
- RequestAbortedError,
16
- RequestTimeoutError,
17
- UnexpectedClientError,
18
- } from "../sdk/models/http-client-errors.js";
19
- import * as models from "../sdk/models/index.js";
20
- import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
21
- import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
22
- import { APICall, APIPromise } from "../types/async.js";
23
- import { Result } from "../types/fp.js";
24
-
25
- /**
26
- * invoice.create.drafted
27
- *
28
- * @remarks
29
- * Fired when a new invoice is created in draft status. Doc-only for parsing.
30
- */
31
- export function webhookEventsPostWebhookEventsInvoiceCreateDrafted(
32
- client: FlexpriceCore,
33
- options?: RequestOptions,
34
- ): APIPromise<
35
- Result<
36
- models.WebhookDtoInvoiceWebhookPayload,
37
- | FlexPriceError
38
- | ResponseValidationError
39
- | ConnectionError
40
- | RequestAbortedError
41
- | RequestTimeoutError
42
- | InvalidRequestError
43
- | UnexpectedClientError
44
- | SDKValidationError
45
- >
46
- > {
47
- return new APIPromise($do(
48
- client,
49
- options,
50
- ));
51
- }
52
-
53
- async function $do(
54
- client: FlexpriceCore,
55
- options?: RequestOptions,
56
- ): Promise<
57
- [
58
- Result<
59
- models.WebhookDtoInvoiceWebhookPayload,
60
- | FlexPriceError
61
- | ResponseValidationError
62
- | ConnectionError
63
- | RequestAbortedError
64
- | RequestTimeoutError
65
- | InvalidRequestError
66
- | UnexpectedClientError
67
- | SDKValidationError
68
- >,
69
- APICall,
70
- ]
71
- > {
72
- const path = pathToFunc("/webhook-events/invoice.create.drafted")();
73
-
74
- const headers = new Headers(compactMap({
75
- Accept: "application/json",
76
- }));
77
-
78
- const secConfig = await extractSecurity(client._options.apiKeyAuth);
79
- const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
80
- const requestSecurity = resolveGlobalSecurity(securityInput);
81
-
82
- const context = {
83
- options: client._options,
84
- baseURL: options?.serverURL ?? client._baseURL ?? "",
85
- operationID: "post_/webhook-events/invoice.create.drafted",
86
- oAuth2Scopes: null,
87
-
88
- resolvedSecurity: requestSecurity,
89
-
90
- securitySource: client._options.apiKeyAuth,
91
- retryConfig: options?.retries
92
- || client._options.retryConfig
93
- || { strategy: "none" },
94
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
95
- };
96
-
97
- const requestRes = client._createRequest(context, {
98
- security: requestSecurity,
99
- method: "POST",
100
- baseURL: options?.serverURL,
101
- path: path,
102
- headers: headers,
103
- userAgent: client._options.userAgent,
104
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
105
- }, options);
106
- if (!requestRes.ok) {
107
- return [requestRes, { status: "invalid" }];
108
- }
109
- const req = requestRes.value;
110
-
111
- const doResult = await client._do(req, {
112
- context,
113
- errorCodes: ["4XX", "5XX"],
114
- retryConfig: context.retryConfig,
115
- retryCodes: context.retryCodes,
116
- });
117
- if (!doResult.ok) {
118
- return [doResult, { status: "request-error", request: req }];
119
- }
120
- const response = doResult.value;
121
-
122
- const [result] = await M.match<
123
- models.WebhookDtoInvoiceWebhookPayload,
124
- | FlexPriceError
125
- | ResponseValidationError
126
- | ConnectionError
127
- | RequestAbortedError
128
- | RequestTimeoutError
129
- | InvalidRequestError
130
- | UnexpectedClientError
131
- | SDKValidationError
132
- >(
133
- M.json(200, models.WebhookDtoInvoiceWebhookPayload$inboundSchema),
134
- M.fail("4XX"),
135
- M.fail("5XX"),
136
- )(response, req);
137
- if (!result.ok) {
138
- return [result, { status: "complete", request: req, response }];
139
- }
140
-
141
- return [result, { status: "complete", request: req, response }];
142
- }