@paygentic/sdk 0.10.2 → 0.10.4

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 (129) hide show
  1. package/README.md +19 -62
  2. package/dist/commonjs/funcs/meGetMe.d.ts +18 -0
  3. package/dist/commonjs/funcs/meGetMe.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/meGetMe.js +108 -0
  5. package/dist/commonjs/funcs/meGetMe.js.map +1 -0
  6. package/dist/commonjs/lib/config.d.ts +2 -2
  7. package/dist/commonjs/lib/config.js +2 -2
  8. package/dist/commonjs/models/costreportresponse.d.ts +14 -2
  9. package/dist/commonjs/models/costreportresponse.d.ts.map +1 -1
  10. package/dist/commonjs/models/costreportresponse.js.map +1 -1
  11. package/dist/commonjs/models/errors/error.d.ts +6 -0
  12. package/dist/commonjs/models/errors/error.d.ts.map +1 -1
  13. package/dist/commonjs/models/errors/error.js +3 -0
  14. package/dist/commonjs/models/errors/error.js.map +1 -1
  15. package/dist/commonjs/models/index.d.ts +3 -0
  16. package/dist/commonjs/models/index.d.ts.map +1 -1
  17. package/dist/commonjs/models/index.js +3 -0
  18. package/dist/commonjs/models/index.js.map +1 -1
  19. package/dist/commonjs/models/me.d.ts +34 -0
  20. package/dist/commonjs/models/me.d.ts.map +1 -0
  21. package/dist/commonjs/models/me.js +63 -0
  22. package/dist/commonjs/models/me.js.map +1 -0
  23. package/dist/commonjs/models/mecredential.d.ts +31 -0
  24. package/dist/commonjs/models/mecredential.d.ts.map +1 -0
  25. package/dist/commonjs/models/mecredential.js +60 -0
  26. package/dist/commonjs/models/mecredential.js.map +1 -0
  27. package/dist/commonjs/models/operations/getcostreport.d.ts +2 -2
  28. package/dist/commonjs/models/operations/getcostsummary.d.ts +2 -2
  29. package/dist/commonjs/models/operations/getprofitability.d.ts +2 -2
  30. package/dist/commonjs/models/operations/getrevenue.d.ts +2 -2
  31. package/dist/commonjs/models/operations/listentitlements.d.ts +16 -0
  32. package/dist/commonjs/models/operations/listentitlements.d.ts.map +1 -1
  33. package/dist/commonjs/models/operations/listentitlements.js +11 -1
  34. package/dist/commonjs/models/operations/listentitlements.js.map +1 -1
  35. package/dist/commonjs/models/outstandingblock.d.ts +5 -1
  36. package/dist/commonjs/models/outstandingblock.d.ts.map +1 -1
  37. package/dist/commonjs/models/outstandingblock.js +1 -0
  38. package/dist/commonjs/models/outstandingblock.js.map +1 -1
  39. package/dist/commonjs/models/permission.d.ts +113 -0
  40. package/dist/commonjs/models/permission.d.ts.map +1 -0
  41. package/dist/commonjs/models/permission.js +148 -0
  42. package/dist/commonjs/models/permission.js.map +1 -0
  43. package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +4 -4
  44. package/dist/commonjs/models/revenueaccountrow.d.ts +1 -1
  45. package/dist/commonjs/models/revenueaccounttotal.d.ts +1 -1
  46. package/dist/commonjs/models/revenuesummaryresponse.d.ts +2 -2
  47. package/dist/commonjs/sdk/me.d.ts +12 -0
  48. package/dist/commonjs/sdk/me.d.ts.map +1 -0
  49. package/dist/commonjs/sdk/me.js +22 -0
  50. package/dist/commonjs/sdk/me.js.map +1 -0
  51. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  52. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  53. package/dist/commonjs/sdk/sdk.js +4 -0
  54. package/dist/commonjs/sdk/sdk.js.map +1 -1
  55. package/dist/esm/funcs/meGetMe.d.ts +18 -0
  56. package/dist/esm/funcs/meGetMe.d.ts.map +1 -0
  57. package/dist/esm/funcs/meGetMe.js +72 -0
  58. package/dist/esm/funcs/meGetMe.js.map +1 -0
  59. package/dist/esm/lib/config.d.ts +2 -2
  60. package/dist/esm/lib/config.js +2 -2
  61. package/dist/esm/models/costreportresponse.d.ts +14 -2
  62. package/dist/esm/models/costreportresponse.d.ts.map +1 -1
  63. package/dist/esm/models/costreportresponse.js.map +1 -1
  64. package/dist/esm/models/errors/error.d.ts +6 -0
  65. package/dist/esm/models/errors/error.d.ts.map +1 -1
  66. package/dist/esm/models/errors/error.js +3 -0
  67. package/dist/esm/models/errors/error.js.map +1 -1
  68. package/dist/esm/models/index.d.ts +3 -0
  69. package/dist/esm/models/index.d.ts.map +1 -1
  70. package/dist/esm/models/index.js +3 -0
  71. package/dist/esm/models/index.js.map +1 -1
  72. package/dist/esm/models/me.d.ts +34 -0
  73. package/dist/esm/models/me.d.ts.map +1 -0
  74. package/dist/esm/models/me.js +26 -0
  75. package/dist/esm/models/me.js.map +1 -0
  76. package/dist/esm/models/mecredential.d.ts +31 -0
  77. package/dist/esm/models/mecredential.d.ts.map +1 -0
  78. package/dist/esm/models/mecredential.js +23 -0
  79. package/dist/esm/models/mecredential.js.map +1 -0
  80. package/dist/esm/models/operations/getcostreport.d.ts +2 -2
  81. package/dist/esm/models/operations/getcostsummary.d.ts +2 -2
  82. package/dist/esm/models/operations/getprofitability.d.ts +2 -2
  83. package/dist/esm/models/operations/getrevenue.d.ts +2 -2
  84. package/dist/esm/models/operations/listentitlements.d.ts +16 -0
  85. package/dist/esm/models/operations/listentitlements.d.ts.map +1 -1
  86. package/dist/esm/models/operations/listentitlements.js +9 -0
  87. package/dist/esm/models/operations/listentitlements.js.map +1 -1
  88. package/dist/esm/models/outstandingblock.d.ts +5 -1
  89. package/dist/esm/models/outstandingblock.d.ts.map +1 -1
  90. package/dist/esm/models/outstandingblock.js +1 -0
  91. package/dist/esm/models/outstandingblock.js.map +1 -1
  92. package/dist/esm/models/permission.d.ts +113 -0
  93. package/dist/esm/models/permission.d.ts.map +1 -0
  94. package/dist/esm/models/permission.js +112 -0
  95. package/dist/esm/models/permission.js.map +1 -0
  96. package/dist/esm/models/profitabilitysummaryresponse.d.ts +4 -4
  97. package/dist/esm/models/revenueaccountrow.d.ts +1 -1
  98. package/dist/esm/models/revenueaccounttotal.d.ts +1 -1
  99. package/dist/esm/models/revenuesummaryresponse.d.ts +2 -2
  100. package/dist/esm/sdk/me.d.ts +12 -0
  101. package/dist/esm/sdk/me.d.ts.map +1 -0
  102. package/dist/esm/sdk/me.js +18 -0
  103. package/dist/esm/sdk/me.js.map +1 -0
  104. package/dist/esm/sdk/sdk.d.ts +3 -0
  105. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  106. package/dist/esm/sdk/sdk.js +4 -0
  107. package/dist/esm/sdk/sdk.js.map +1 -1
  108. package/jsr.json +1 -1
  109. package/package.json +1 -1
  110. package/src/funcs/meGetMe.ts +151 -0
  111. package/src/lib/config.ts +2 -2
  112. package/src/models/costreportresponse.ts +14 -2
  113. package/src/models/errors/error.ts +6 -0
  114. package/src/models/index.ts +3 -0
  115. package/src/models/me.ts +60 -0
  116. package/src/models/mecredential.ts +58 -0
  117. package/src/models/operations/getcostreport.ts +2 -2
  118. package/src/models/operations/getcostsummary.ts +2 -2
  119. package/src/models/operations/getprofitability.ts +2 -2
  120. package/src/models/operations/getrevenue.ts +2 -2
  121. package/src/models/operations/listentitlements.ts +33 -0
  122. package/src/models/outstandingblock.ts +6 -1
  123. package/src/models/permission.ts +119 -0
  124. package/src/models/profitabilitysummaryresponse.ts +4 -4
  125. package/src/models/revenueaccountrow.ts +1 -1
  126. package/src/models/revenueaccounttotal.ts +1 -1
  127. package/src/models/revenuesummaryresponse.ts +2 -2
  128. package/src/sdk/me.ts +25 -0
  129. package/src/sdk/sdk.ts +6 -0
@@ -14,6 +14,7 @@ import { Features } from "./features.js";
14
14
  import { Fees } from "./fees.js";
15
15
  import { InvoicesV2 } from "./invoicesv2.js";
16
16
  import { Items } from "./items.js";
17
+ import { Me } from "./me.js";
17
18
  import { MerchantIntegrations } from "./merchantintegrations.js";
18
19
  import { Merchants } from "./merchants.js";
19
20
  import { Orders } from "./orders.js";
@@ -31,6 +32,9 @@ import { TestClocks } from "./testclocks.js";
31
32
  import { Users } from "./users.js";
32
33
  import { Webhooks } from "./webhooks.js";
33
34
  export class Paygentic extends ClientSDK {
35
+ get me() {
36
+ return (this._me ?? (this._me = new Me(this._options)));
37
+ }
34
38
  get billableMetrics() {
35
39
  return (this._billableMetrics ?? (this._billableMetrics = new BillableMetrics(this._options)));
36
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aA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AAC;IACpD,CAAC;IAGD,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;IAGD,IAAI,gBAAgB;QAClB,OAAO,CAAC,IAAI,CAAC,iBAAiB,KAAtB,IAAI,CAAC,iBAAiB,GAAK,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1E,CAAC;IAGD,IAAI,UAAU;QACZ,OAAO,CAAC,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC9D,CAAC;IAGD,IAAI,oBAAoB;QACtB,OAAO,CAAC,IAAI,CAAC,qBAAqB,KAA1B,IAAI,CAAC,qBAAqB,GAAK,IAAI,oBAAoB,CAC7D,IAAI,CAAC,QAAQ,CACd,EAAC,CAAC;IACL,CAAC;IAGD,IAAI,SAAS;QACX,OAAO,CAAC,IAAI,CAAC,UAAU,KAAf,IAAI,CAAC,UAAU,GAAK,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC5D,CAAC;IAGD,IAAI,QAAQ;QACV,OAAO,CAAC,IAAI,CAAC,SAAS,KAAd,IAAI,CAAC,SAAS,GAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;CACF"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@paygentic/sdk",
5
- "version": "0.10.2",
5
+ "version": "0.10.4",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./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.10.2",
3
+ "version": "0.10.4",
4
4
  "author": "Speakeasy",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,151 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PaygenticCore } 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 {
12
+ ConnectionError,
13
+ InvalidRequestError,
14
+ RequestAbortedError,
15
+ RequestTimeoutError,
16
+ UnexpectedClientError,
17
+ } from "../models/errors/httpclienterrors.js";
18
+ import * as errors from "../models/errors/index.js";
19
+ import { PaygenticError } from "../models/errors/paygenticerror.js";
20
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
21
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import * as models from "../models/index.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * Get the caller
28
+ *
29
+ * @remarks
30
+ * Returns the caller's identity in its active organization, its roles, and the permissions that its credential holds there. The permissions are the effective set for the credential of the call: for a session or an API key, those of the principal; for an OAuth token, those of the principal narrowed to the scopes of the token.
31
+ */
32
+ export function meGetMe(
33
+ client: PaygenticCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ models.Me,
38
+ | errors.ErrorT
39
+ | PaygenticError
40
+ | ResponseValidationError
41
+ | ConnectionError
42
+ | RequestAbortedError
43
+ | RequestTimeoutError
44
+ | InvalidRequestError
45
+ | UnexpectedClientError
46
+ | SDKValidationError
47
+ >
48
+ > {
49
+ return new APIPromise($do(
50
+ client,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ async function $do(
56
+ client: PaygenticCore,
57
+ options?: RequestOptions,
58
+ ): Promise<
59
+ [
60
+ Result<
61
+ models.Me,
62
+ | errors.ErrorT
63
+ | PaygenticError
64
+ | ResponseValidationError
65
+ | ConnectionError
66
+ | RequestAbortedError
67
+ | RequestTimeoutError
68
+ | InvalidRequestError
69
+ | UnexpectedClientError
70
+ | SDKValidationError
71
+ >,
72
+ APICall,
73
+ ]
74
+ > {
75
+ const path = pathToFunc("/v0/me")();
76
+
77
+ const headers = new Headers(compactMap({
78
+ Accept: "application/json",
79
+ }));
80
+
81
+ const secConfig = await extractSecurity(client._options.bearerAuth);
82
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
83
+ const requestSecurity = resolveGlobalSecurity(securityInput);
84
+
85
+ const context = {
86
+ options: client._options,
87
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
88
+ operationID: "getMe",
89
+ oAuth2Scopes: null,
90
+
91
+ resolvedSecurity: requestSecurity,
92
+
93
+ securitySource: client._options.bearerAuth,
94
+ retryConfig: options?.retries
95
+ || client._options.retryConfig
96
+ || { strategy: "none" },
97
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
98
+ };
99
+
100
+ const requestRes = client._createRequest(context, {
101
+ security: requestSecurity,
102
+ method: "GET",
103
+ baseURL: options?.serverURL,
104
+ path: path,
105
+ headers: headers,
106
+ userAgent: client._options.userAgent,
107
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
108
+ }, options);
109
+ if (!requestRes.ok) {
110
+ return [requestRes, { status: "invalid" }];
111
+ }
112
+ const req = requestRes.value;
113
+
114
+ const doResult = await client._do(req, {
115
+ context,
116
+ errorCodes: ["401", "403", "4XX", "5XX"],
117
+ retryConfig: context.retryConfig,
118
+ retryCodes: context.retryCodes,
119
+ });
120
+ if (!doResult.ok) {
121
+ return [doResult, { status: "request-error", request: req }];
122
+ }
123
+ const response = doResult.value;
124
+
125
+ const responseFields = {
126
+ HttpMeta: { Response: response, Request: req },
127
+ };
128
+
129
+ const [result] = await M.match<
130
+ models.Me,
131
+ | errors.ErrorT
132
+ | PaygenticError
133
+ | ResponseValidationError
134
+ | ConnectionError
135
+ | RequestAbortedError
136
+ | RequestTimeoutError
137
+ | InvalidRequestError
138
+ | UnexpectedClientError
139
+ | SDKValidationError
140
+ >(
141
+ M.json(200, models.Me$inboundSchema),
142
+ M.jsonErr([401, 403], errors.ErrorT$inboundSchema),
143
+ M.fail("4XX"),
144
+ M.fail("5XX"),
145
+ )(response, req, { extraFields: responseFields });
146
+ if (!result.ok) {
147
+ return [result, { status: "complete", request: req, response }];
148
+ }
149
+
150
+ return [result, { status: "complete", request: req, response }];
151
+ }
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "0.1.0",
68
- sdkVersion: "0.10.2",
68
+ sdkVersion: "0.10.4",
69
69
  genVersion: "2.879.13",
70
- userAgent: "speakeasy-sdk/typescript 0.10.2 2.879.13 0.1.0 @paygentic/sdk",
70
+ userAgent: "speakeasy-sdk/typescript 0.10.4 2.879.13 0.1.0 @paygentic/sdk",
71
71
  } as const;
@@ -23,8 +23,17 @@ export type CostReportResponseObject = ClosedEnum<
23
23
  typeof CostReportResponseObject
24
24
  >;
25
25
 
26
+ /**
27
+ * The read window, as requested: the report counts from <= t < to. Unlike `costRange`, `to` is not an instant the report covers, so a chart axis ends before it.
28
+ */
26
29
  export type Period = {
30
+ /**
31
+ * Start of the read window, included.
32
+ */
27
33
  from: Date;
34
+ /**
35
+ * End of the read window, excluded.
36
+ */
28
37
  to: Date;
29
38
  };
30
39
 
@@ -35,7 +44,7 @@ export type Pagination = {
35
44
  };
36
45
 
37
46
  /**
38
- * Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
47
+ * Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence. The bounds are instants that exist and both are included, so a window that holds `to` ends after it.
39
48
  */
40
49
  export type CostReportResponseCostRange = {
41
50
  /**
@@ -54,6 +63,9 @@ export type CostReportResponse = {
54
63
  * ISO 4217 currency code for all monetary values in this response.
55
64
  */
56
65
  currency: string;
66
+ /**
67
+ * The read window, as requested: the report counts from <= t < to. Unlike `costRange`, `to` is not an instant the report covers, so a chart axis ends before it.
68
+ */
57
69
  period: Period;
58
70
  /**
59
71
  * The active grouping dimension (e.g. 'cost', 'customer', or a dynamic dimension key).
@@ -93,7 +105,7 @@ export type CostReportResponse = {
93
105
  */
94
106
  emptyGroupCount?: number | null | undefined;
95
107
  /**
96
- * Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
108
+ * Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence. The bounds are instants that exist and both are included, so a window that holds `to` ends after it.
97
109
  */
98
110
  costRange?: CostReportResponseCostRange | null | undefined;
99
111
  };
@@ -6,6 +6,9 @@ import * as z from "zod/v3";
6
6
  import * as models from "../index.js";
7
7
  import { PaygenticError } from "./paygenticerror.js";
8
8
 
9
+ /**
10
+ * Unauthorized - Authentication failed or user does not have permissions
11
+ */
9
12
  export type ErrorTData = {
10
13
  /**
11
14
  * Coarse HTTP error category (e.g. 'bad_request', 'forbidden'). Maps to the HTTP status code.
@@ -33,6 +36,9 @@ export type ErrorTData = {
33
36
  requiredPermissions?: Array<string> | undefined;
34
37
  };
35
38
 
39
+ /**
40
+ * Unauthorized - Authentication failed or user does not have permissions
41
+ */
36
42
  export class ErrorT extends PaygenticError {
37
43
  /**
38
44
  * Coarse HTTP error category (e.g. 'bad_request', 'forbidden'). Maps to the HTTP status code.
@@ -80,6 +80,8 @@ export * from "./lineitemsresponse.js";
80
80
  export * from "./lineitemssummary.js";
81
81
  export * from "./lineprovenance.js";
82
82
  export * from "./mappingcapabilities.js";
83
+ export * from "./me.js";
84
+ export * from "./mecredential.js";
83
85
  export * from "./merchantintegration.js";
84
86
  export * from "./merchantintegrationprovider.js";
85
87
  export * from "./merchantintegrationstatus.js";
@@ -105,6 +107,7 @@ export * from "./payment.js";
105
107
  export * from "./paymentmethod.js";
106
108
  export * from "./paymentsession.js";
107
109
  export * from "./paymentsummary.js";
110
+ export * from "./permission.js";
108
111
  export * from "./plan.js";
109
112
  export * from "./plancreditallocation.js";
110
113
  export * from "./planlineinput.js";
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+ import { MeCredential, MeCredential$inboundSchema } from "./mecredential.js";
11
+ import { Permission, Permission$inboundSchema } from "./permission.js";
12
+
13
+ export const OrganizationType = {
14
+ Merchant: "merchant",
15
+ Consumer: "consumer",
16
+ } as const;
17
+ export type OrganizationType = ClosedEnum<typeof OrganizationType>;
18
+
19
+ export type Me = {
20
+ userId: string;
21
+ organizationId: string;
22
+ organizationType: OrganizationType;
23
+ /**
24
+ * The role names of the caller in the active organization.
25
+ */
26
+ roles: Array<string>;
27
+ /**
28
+ * The permissions that the credential of the call holds in the active organization.
29
+ */
30
+ permissions: Array<Permission>;
31
+ /**
32
+ * The credential of the call. clientId is set for an OAuth token and apiKeyId for an API key.
33
+ */
34
+ credential: MeCredential;
35
+ };
36
+
37
+ /** @internal */
38
+ export const OrganizationType$inboundSchema: z.ZodNativeEnum<
39
+ typeof OrganizationType
40
+ > = z.nativeEnum(OrganizationType);
41
+
42
+ /** @internal */
43
+ export const Me$inboundSchema: z.ZodType<Me, z.ZodTypeDef, unknown> = z.object({
44
+ userId: z.string(),
45
+ organizationId: z.string(),
46
+ organizationType: OrganizationType$inboundSchema,
47
+ roles: z.array(z.string()),
48
+ permissions: z.array(Permission$inboundSchema),
49
+ credential: MeCredential$inboundSchema,
50
+ });
51
+
52
+ export function meFromJSON(
53
+ jsonString: string,
54
+ ): SafeParseResult<Me, SDKValidationError> {
55
+ return safeParse(
56
+ jsonString,
57
+ (x) => Me$inboundSchema.parse(JSON.parse(x)),
58
+ `Failed to parse 'Me' from JSON`,
59
+ );
60
+ }
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+
11
+ export const MeCredentialType = {
12
+ Session: "session",
13
+ ApiKey: "apiKey",
14
+ Oauth: "oauth",
15
+ System: "system",
16
+ } as const;
17
+ export type MeCredentialType = ClosedEnum<typeof MeCredentialType>;
18
+
19
+ /**
20
+ * The credential of the call. clientId is set for an OAuth token and apiKeyId for an API key.
21
+ */
22
+ export type MeCredential = {
23
+ type: MeCredentialType;
24
+ /**
25
+ * The OAuth client of the token.
26
+ */
27
+ clientId?: string | undefined;
28
+ /**
29
+ * The API key of the call.
30
+ */
31
+ apiKeyId?: string | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const MeCredentialType$inboundSchema: z.ZodNativeEnum<
36
+ typeof MeCredentialType
37
+ > = z.nativeEnum(MeCredentialType);
38
+
39
+ /** @internal */
40
+ export const MeCredential$inboundSchema: z.ZodType<
41
+ MeCredential,
42
+ z.ZodTypeDef,
43
+ unknown
44
+ > = z.object({
45
+ type: MeCredentialType$inboundSchema,
46
+ clientId: z.string().optional(),
47
+ apiKeyId: z.string().optional(),
48
+ });
49
+
50
+ export function meCredentialFromJSON(
51
+ jsonString: string,
52
+ ): SafeParseResult<MeCredential, SDKValidationError> {
53
+ return safeParse(
54
+ jsonString,
55
+ (x) => MeCredential$inboundSchema.parse(JSON.parse(x)),
56
+ `Failed to parse 'MeCredential' from JSON`,
57
+ );
58
+ }
@@ -50,11 +50,11 @@ export type GetCostReportRequest = {
50
50
  */
51
51
  merchantId?: string | undefined;
52
52
  /**
53
- * Start of the query window (ISO 8601).
53
+ * Start of the query window, included (ISO 8601).
54
54
  */
55
55
  from: Date;
56
56
  /**
57
- * End of the query window (ISO 8601).
57
+ * End of the query window, excluded: the read counts from <= t < to (ISO 8601).
58
58
  */
59
59
  to: Date;
60
60
  /**
@@ -28,11 +28,11 @@ export type GetCostSummaryRequest = {
28
28
  */
29
29
  subject?: string | undefined;
30
30
  /**
31
- * Start of the query window (ISO 8601). Required together with 'to'.
31
+ * Start of the query window, included (ISO 8601). Required together with 'to'.
32
32
  */
33
33
  from: Date;
34
34
  /**
35
- * End of the query window (ISO 8601). Required together with 'from'.
35
+ * End of the query window, excluded: the read counts from <= t < to (ISO 8601). Required together with 'from'.
36
36
  */
37
37
  to: Date;
38
38
  /**
@@ -10,11 +10,11 @@ export type GetProfitabilityRequest = {
10
10
  */
11
11
  merchantId: string;
12
12
  /**
13
- * Start of the time range (ISO 8601 format)
13
+ * Start of the read window, included (ISO 8601 format)
14
14
  */
15
15
  from: Date;
16
16
  /**
17
- * End of the time range (ISO 8601 format)
17
+ * End of the read window, excluded: the read counts from <= t < to, so a month ends at the first instant of the next month (ISO 8601 format)
18
18
  */
19
19
  to: Date;
20
20
  /**
@@ -45,11 +45,11 @@ export type PeriodBasis = ClosedEnum<typeof PeriodBasis>;
45
45
 
46
46
  export type GetRevenueRequest = {
47
47
  /**
48
- * Start of the time range (ISO 8601 format)
48
+ * Start of the read window, included (ISO 8601 format)
49
49
  */
50
50
  startTime: Date;
51
51
  /**
52
- * End of the time range (ISO 8601 format)
52
+ * End of the read window, excluded: the read counts startTime <= t < endTime, so a month ends at the first instant of the next month (ISO 8601 format)
53
53
  */
54
54
  endTime: Date;
55
55
  /**
@@ -53,6 +53,16 @@ export const ListEntitlementsObject = {
53
53
  } as const;
54
54
  export type ListEntitlementsObject = ClosedEnum<typeof ListEntitlementsObject>;
55
55
 
56
+ /**
57
+ * Present only when the database can't be reached, or the list takes more than a second to compute. The response is then the last result for this same request in the past hour, computed at `computedAt`.
58
+ */
59
+ export type Stale = {
60
+ /**
61
+ * When this result was computed.
62
+ */
63
+ computedAt: Date;
64
+ };
65
+
56
66
  /**
57
67
  * Successfully retrieved the list of entitlements for the customer.
58
68
  */
@@ -66,6 +76,10 @@ export type ListEntitlementsResponse = {
66
76
  * Offset-based pagination response.
67
77
  */
68
78
  pagination: models.OffsetPagination;
79
+ /**
80
+ * Present only when the database can't be reached, or the list takes more than a second to compute. The response is then the last result for this same request in the past hour, computed at `computedAt`.
81
+ */
82
+ stale?: Stale | undefined;
69
83
  };
70
84
 
71
85
  /** @internal */
@@ -111,6 +125,24 @@ export const ListEntitlementsObject$inboundSchema: z.ZodNativeEnum<
111
125
  typeof ListEntitlementsObject
112
126
  > = z.nativeEnum(ListEntitlementsObject);
113
127
 
128
+ /** @internal */
129
+ export const Stale$inboundSchema: z.ZodType<Stale, z.ZodTypeDef, unknown> = z
130
+ .object({
131
+ computedAt: z.string().datetime({ offset: true }).transform(v =>
132
+ new Date(v)
133
+ ),
134
+ });
135
+
136
+ export function staleFromJSON(
137
+ jsonString: string,
138
+ ): SafeParseResult<Stale, SDKValidationError> {
139
+ return safeParse(
140
+ jsonString,
141
+ (x) => Stale$inboundSchema.parse(JSON.parse(x)),
142
+ `Failed to parse 'Stale' from JSON`,
143
+ );
144
+ }
145
+
114
146
  /** @internal */
115
147
  export const ListEntitlementsResponse$inboundSchema: z.ZodType<
116
148
  ListEntitlementsResponse,
@@ -120,6 +152,7 @@ export const ListEntitlementsResponse$inboundSchema: z.ZodType<
120
152
  object: ListEntitlementsObject$inboundSchema.default("list"),
121
153
  data: z.array(models.EntitlementListItem$inboundSchema),
122
154
  pagination: models.OffsetPagination$inboundSchema,
155
+ stale: z.lazy(() => Stale$inboundSchema).optional(),
123
156
  });
124
157
 
125
158
  export function listEntitlementsResponseFromJSON(
@@ -9,7 +9,7 @@ import { AccountFigure, AccountFigure$inboundSchema } from "./accountfigure.js";
9
9
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
10
 
11
11
  /**
12
- * What is owed, gross of tax, from any date. `awaitingPayment` and `paymentFailed` add up to it, in count and amount.
12
+ * What is owed, gross of tax, from any date. `awaitingPayment` and `paymentFailed` add up to it, in count and amount. `overdue` is a part of `awaitingPayment`.
13
13
  */
14
14
  export type OutstandingBlock = {
15
15
  /**
@@ -28,6 +28,10 @@ export type OutstandingBlock = {
28
28
  * The part with status `PAYMENT_FAILED`: collection has ended
29
29
  */
30
30
  paymentFailed: AccountFigure;
31
+ /**
32
+ * The invoices of `awaitingPayment` past their due date: status `ISSUED`, no card retry scheduled, and a due date before the start of today, UTC. Today is the subscription's test clock when test clocks are enabled. A subset of `awaitingPayment` by count. A credit invoice is never overdue, so the amount can exceed `awaitingPayment.amount`.
33
+ */
34
+ overdue: AccountFigure;
31
35
  };
32
36
 
33
37
  /** @internal */
@@ -40,6 +44,7 @@ export const OutstandingBlock$inboundSchema: z.ZodType<
40
44
  amount: z.string(),
41
45
  awaitingPayment: AccountFigure$inboundSchema,
42
46
  paymentFailed: AccountFigure$inboundSchema,
47
+ overdue: AccountFigure$inboundSchema,
43
48
  });
44
49
 
45
50
  export function outstandingBlockFromJSON(