@gr4vy/sdk 2.2.0 → 2.2.1

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 (61) hide show
  1. package/README.md +7 -0
  2. package/funcs/transactionsCapturesGet.d.ts +18 -0
  3. package/funcs/transactionsCapturesGet.d.ts.map +1 -0
  4. package/funcs/transactionsCapturesGet.js +145 -0
  5. package/funcs/transactionsCapturesGet.js.map +1 -0
  6. package/funcs/transactionsCapturesList.d.ts +18 -0
  7. package/funcs/transactionsCapturesList.d.ts.map +1 -0
  8. package/funcs/transactionsCapturesList.js +140 -0
  9. package/funcs/transactionsCapturesList.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +2 -2
  12. package/lib/config.js +2 -2
  13. package/models/components/capture.d.ts +84 -0
  14. package/models/components/capture.d.ts.map +1 -0
  15. package/models/components/capture.js +86 -0
  16. package/models/components/capture.js.map +1 -0
  17. package/models/components/capturecollection.d.ts +26 -0
  18. package/models/components/capturecollection.d.ts.map +1 -0
  19. package/models/components/capturecollection.js +60 -0
  20. package/models/components/capturecollection.js.map +1 -0
  21. package/models/components/index.d.ts +2 -0
  22. package/models/components/index.d.ts.map +1 -1
  23. package/models/components/index.js +2 -0
  24. package/models/components/index.js.map +1 -1
  25. package/models/components/transactioncapturecreate.d.ts +10 -0
  26. package/models/components/transactioncapturecreate.d.ts.map +1 -1
  27. package/models/components/transactioncapturecreate.js +3 -0
  28. package/models/components/transactioncapturecreate.js.map +1 -1
  29. package/models/operations/gettransactioncapture.d.ts +28 -0
  30. package/models/operations/gettransactioncapture.d.ts.map +1 -0
  31. package/models/operations/gettransactioncapture.js +57 -0
  32. package/models/operations/gettransactioncapture.js.map +1 -0
  33. package/models/operations/index.d.ts +2 -0
  34. package/models/operations/index.d.ts.map +1 -1
  35. package/models/operations/index.js +2 -0
  36. package/models/operations/index.js.map +1 -1
  37. package/models/operations/listtransactioncaptures.d.ts +23 -0
  38. package/models/operations/listtransactioncaptures.d.ts.map +1 -0
  39. package/models/operations/listtransactioncaptures.js +55 -0
  40. package/models/operations/listtransactioncaptures.js.map +1 -0
  41. package/package.json +1 -1
  42. package/sdk/captures.d.ts +19 -0
  43. package/sdk/captures.d.ts.map +1 -0
  44. package/sdk/captures.js +32 -0
  45. package/sdk/captures.js.map +1 -0
  46. package/sdk/transactions.d.ts +3 -0
  47. package/sdk/transactions.d.ts.map +1 -1
  48. package/sdk/transactions.js +4 -0
  49. package/sdk/transactions.js.map +1 -1
  50. package/src/funcs/transactionsCapturesGet.ts +255 -0
  51. package/src/funcs/transactionsCapturesList.ts +247 -0
  52. package/src/lib/config.ts +2 -2
  53. package/src/models/components/capture.ts +142 -0
  54. package/src/models/components/capturecollection.ts +56 -0
  55. package/src/models/components/index.ts +2 -0
  56. package/src/models/components/transactioncapturecreate.ts +13 -0
  57. package/src/models/operations/gettransactioncapture.ts +58 -0
  58. package/src/models/operations/index.ts +2 -0
  59. package/src/models/operations/listtransactioncaptures.ts +51 -0
  60. package/src/sdk/captures.ts +51 -0
  61. package/src/sdk/transactions.ts +6 -0
package/README.md CHANGED
@@ -429,6 +429,11 @@ try {
429
429
 
430
430
  * [list](docs/sdks/actions/README.md#list) - List transaction Flow rules
431
431
 
432
+ #### [Transactions.Captures](docs/sdks/captures/README.md)
433
+
434
+ * [list](docs/sdks/captures/README.md#list) - List transaction captures
435
+ * [get](docs/sdks/captures/README.md#get) - Get transaction capture
436
+
432
437
  #### [Transactions.Events](docs/sdks/events/README.md)
433
438
 
434
439
  * [list](docs/sdks/events/README.md#list) - List transaction events
@@ -1048,6 +1053,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
1048
1053
  - [`transactionsActionsList`](docs/sdks/actions/README.md#list) - List transaction Flow rules
1049
1054
  - [`transactionsCancel`](docs/sdks/transactions/README.md#cancel) - Cancel transaction
1050
1055
  - [`transactionsCapture`](docs/sdks/transactions/README.md#capture) - Capture transaction
1056
+ - [`transactionsCapturesGet`](docs/sdks/captures/README.md#get) - Get transaction capture
1057
+ - [`transactionsCapturesList`](docs/sdks/captures/README.md#list) - List transaction captures
1051
1058
  - [`transactionsCreate`](docs/sdks/transactions/README.md#create) - Create transaction
1052
1059
  - [`transactionsEventsList`](docs/sdks/events/README.md#list) - List transaction events
1053
1060
  - [`transactionsGet`](docs/sdks/transactions/README.md#get) - Get transaction
@@ -0,0 +1,18 @@
1
+ import { Gr4vyCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import * as components from "../models/components/index.js";
4
+ import { Gr4vyError } from "../models/errors/gr4vyerror.js";
5
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
6
+ import * as errors from "../models/errors/index.js";
7
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
8
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ /**
12
+ * Get transaction capture
13
+ *
14
+ * @remarks
15
+ * Retrieve a specific capture for a transaction by its unique identifier.
16
+ */
17
+ export declare function transactionsCapturesGet(client: Gr4vyCore, transactionId: string, captureId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions): APIPromise<Result<components.Capture, errors.Error400 | errors.Error401 | errors.Error403 | errors.Error404 | errors.Error405 | errors.Error409 | errors.HTTPValidationError | errors.Error425 | errors.Error429 | errors.Error500 | errors.Error502 | errors.Error504 | Gr4vyError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
+ //# sourceMappingURL=transactionsCapturesGet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionsCapturesGet.d.ts","sourceRoot":"","sources":["../src/funcs/transactionsCapturesGet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMvC,O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easy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.transactionsCapturesGet = transactionsCapturesGet;
40
+ const encodings_js_1 = require("../lib/encodings.js");
41
+ const http_js_1 = require("../lib/http.js");
42
+ const M = __importStar(require("../lib/matchers.js"));
43
+ const primitives_js_1 = require("../lib/primitives.js");
44
+ const schemas_js_1 = require("../lib/schemas.js");
45
+ const security_js_1 = require("../lib/security.js");
46
+ const url_js_1 = require("../lib/url.js");
47
+ const components = __importStar(require("../models/components/index.js"));
48
+ const errors = __importStar(require("../models/errors/index.js"));
49
+ const operations = __importStar(require("../models/operations/index.js"));
50
+ const async_js_1 = require("../types/async.js");
51
+ /**
52
+ * Get transaction capture
53
+ *
54
+ * @remarks
55
+ * Retrieve a specific capture for a transaction by its unique identifier.
56
+ */
57
+ function transactionsCapturesGet(client, transactionId, captureId, merchantAccountId, options) {
58
+ return new async_js_1.APIPromise($do(client, transactionId, captureId, merchantAccountId, options));
59
+ }
60
+ async function $do(client, transactionId, captureId, merchantAccountId, options) {
61
+ const input = {
62
+ transactionId: transactionId,
63
+ captureId: captureId,
64
+ merchantAccountId: merchantAccountId,
65
+ };
66
+ const parsed = (0, schemas_js_1.safeParse)(input, (value) => operations.GetTransactionCaptureRequest$outboundSchema.parse(value), "Input validation failed");
67
+ if (!parsed.ok) {
68
+ return [parsed, { status: "invalid" }];
69
+ }
70
+ const payload = parsed.value;
71
+ const body = null;
72
+ const pathParams = {
73
+ capture_id: (0, encodings_js_1.encodeSimple)("capture_id", payload.capture_id, {
74
+ explode: false,
75
+ charEncoding: "percent",
76
+ }),
77
+ transaction_id: (0, encodings_js_1.encodeSimple)("transaction_id", payload.transaction_id, {
78
+ explode: false,
79
+ charEncoding: "percent",
80
+ }),
81
+ };
82
+ const path = (0, url_js_1.pathToFunc)("/transactions/{transaction_id}/captures/{capture_id}")(pathParams);
83
+ const headers = new Headers((0, primitives_js_1.compactMap)({
84
+ Accept: "application/json",
85
+ "x-gr4vy-merchant-account-id": (0, encodings_js_1.encodeSimple)("x-gr4vy-merchant-account-id", payload.merchantAccountId ?? client._options.merchantAccountId, { explode: false, charEncoding: "none" }),
86
+ }));
87
+ const secConfig = await (0, security_js_1.extractSecurity)(client._options.bearerAuth);
88
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
89
+ const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
90
+ const context = {
91
+ options: client._options,
92
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
93
+ operationID: "get_transaction_capture",
94
+ oAuth2Scopes: null,
95
+ resolvedSecurity: requestSecurity,
96
+ securitySource: client._options.bearerAuth,
97
+ retryConfig: options?.retries
98
+ || client._options.retryConfig
99
+ || {
100
+ strategy: "backoff",
101
+ backoff: {
102
+ initialInterval: 200,
103
+ maxInterval: 200,
104
+ exponent: 1,
105
+ maxElapsedTime: 1000,
106
+ },
107
+ retryConnectionErrors: true,
108
+ }
109
+ || { strategy: "none" },
110
+ retryCodes: options?.retryCodes || ["5XX"],
111
+ };
112
+ const requestRes = client._createRequest(context, {
113
+ security: requestSecurity,
114
+ method: "GET",
115
+ baseURL: options?.serverURL,
116
+ path: path,
117
+ headers: headers,
118
+ body: body,
119
+ userAgent: client._options.userAgent,
120
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
121
+ }, options);
122
+ if (!requestRes.ok) {
123
+ return [requestRes, { status: "invalid" }];
124
+ }
125
+ const req = requestRes.value;
126
+ const doResult = await client._do(req, {
127
+ context,
128
+ isErrorStatusCode: (statusCode) => (0, http_js_1.matchStatusCode)({ status: statusCode }, ["4XX", "5XX"]),
129
+ retryConfig: context.retryConfig,
130
+ retryCodes: context.retryCodes,
131
+ });
132
+ if (!doResult.ok) {
133
+ return [doResult, { status: "request-error", request: req }];
134
+ }
135
+ const response = doResult.value;
136
+ const responseFields = {
137
+ HttpMeta: { Response: response, Request: req },
138
+ };
139
+ const [result] = await M.match(M.json(200, components.Capture$inboundSchema), M.jsonErr(400, errors.Error400$inboundSchema), M.jsonErr(401, errors.Error401$inboundSchema), M.jsonErr(403, errors.Error403$inboundSchema), M.jsonErr(404, errors.Error404$inboundSchema), M.jsonErr(405, errors.Error405$inboundSchema), M.jsonErr(409, errors.Error409$inboundSchema), M.jsonErr(422, errors.HTTPValidationError$inboundSchema), M.jsonErr(425, errors.Error425$inboundSchema), M.jsonErr(429, errors.Error429$inboundSchema), M.jsonErr(500, errors.Error500$inboundSchema), M.jsonErr(502, errors.Error502$inboundSchema), M.jsonErr(504, errors.Error504$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
140
+ if (!result.ok) {
141
+ return [result, { status: "complete", request: req, response }];
142
+ }
143
+ return [result, { status: "complete", request: req, response }];
144
+ }
145
+ //# sourceMappingURL=transactionsCapturesGet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionsCapturesGet.js","sourceRoot":"","sources":["../src/funcs/transactionsCapturesGet.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCH,0DAsCC;AApED,sDAAmD;AACnD,4CAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAS5D,kEAAoD;AAGpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,uBAAuB,CACrC,MAAiB,EACjB,aAAqB,EACrB,SAAiB,EACjB,iBAA6C,EAC7C,OAAwB;IA0BxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAiB,EACjB,aAAqB,EACrB,SAAiB,EACjB,iBAA6C,EAC7C,OAAwB;IA6BxB,MAAM,KAAK,GAA4C;QACrD,aAAa,EAAE,aAAa;QAC5B,SAAS,EAAE,SAAS;QACpB,iBAAiB,EAAE,iBAAiB;KACrC,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,KAAK,EACL,CAAC,KAAK,EAAE,EAAE,CACR,UAAU,CAAC,2CAA2C,CAAC,KAAK,CAAC,KAAK,CAAC,EACrE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAA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AG,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAC7C,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAC7C,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Gr4vyCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import * as components from "../models/components/index.js";
4
+ import { Gr4vyError } from "../models/errors/gr4vyerror.js";
5
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
6
+ import * as errors from "../models/errors/index.js";
7
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
8
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ /**
12
+ * List transaction captures
13
+ *
14
+ * @remarks
15
+ * List all captures for a specific transaction.
16
+ */
17
+ export declare function transactionsCapturesList(client: Gr4vyCore, transactionId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions): APIPromise<Result<components.CaptureCollection, errors.Error400 | errors.Error401 | errors.Error403 | errors.Error404 | errors.Error405 | errors.Error409 | errors.HTTPValidationError | errors.Error425 | errors.Error429 | errors.Error500 | errors.Error502 | errors.Error504 | Gr4vyError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
+ //# sourceMappingURL=transactionsCapturesList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionsCapturesList.d.ts","sourceRoot":"","sources":["../src/funcs/transactionsCapturesList.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,MAAM,EACrB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,iBAAiB,EAC1B,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,mBAAmB,GAC1B,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,MAAM,CAAC,QAAQ,GACf,UAAU,GACV,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAOA"}
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.transactionsCapturesList = transactionsCapturesList;
40
+ const encodings_js_1 = require("../lib/encodings.js");
41
+ const http_js_1 = require("../lib/http.js");
42
+ const M = __importStar(require("../lib/matchers.js"));
43
+ const primitives_js_1 = require("../lib/primitives.js");
44
+ const schemas_js_1 = require("../lib/schemas.js");
45
+ const security_js_1 = require("../lib/security.js");
46
+ const url_js_1 = require("../lib/url.js");
47
+ const components = __importStar(require("../models/components/index.js"));
48
+ const errors = __importStar(require("../models/errors/index.js"));
49
+ const operations = __importStar(require("../models/operations/index.js"));
50
+ const async_js_1 = require("../types/async.js");
51
+ /**
52
+ * List transaction captures
53
+ *
54
+ * @remarks
55
+ * List all captures for a specific transaction.
56
+ */
57
+ function transactionsCapturesList(client, transactionId, merchantAccountId, options) {
58
+ return new async_js_1.APIPromise($do(client, transactionId, merchantAccountId, options));
59
+ }
60
+ async function $do(client, transactionId, merchantAccountId, options) {
61
+ const input = {
62
+ transactionId: transactionId,
63
+ merchantAccountId: merchantAccountId,
64
+ };
65
+ const parsed = (0, schemas_js_1.safeParse)(input, (value) => operations.ListTransactionCapturesRequest$outboundSchema.parse(value), "Input validation failed");
66
+ if (!parsed.ok) {
67
+ return [parsed, { status: "invalid" }];
68
+ }
69
+ const payload = parsed.value;
70
+ const body = null;
71
+ const pathParams = {
72
+ transaction_id: (0, encodings_js_1.encodeSimple)("transaction_id", payload.transaction_id, {
73
+ explode: false,
74
+ charEncoding: "percent",
75
+ }),
76
+ };
77
+ const path = (0, url_js_1.pathToFunc)("/transactions/{transaction_id}/captures")(pathParams);
78
+ const headers = new Headers((0, primitives_js_1.compactMap)({
79
+ Accept: "application/json",
80
+ "x-gr4vy-merchant-account-id": (0, encodings_js_1.encodeSimple)("x-gr4vy-merchant-account-id", payload.merchantAccountId ?? client._options.merchantAccountId, { explode: false, charEncoding: "none" }),
81
+ }));
82
+ const secConfig = await (0, security_js_1.extractSecurity)(client._options.bearerAuth);
83
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
84
+ const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
85
+ const context = {
86
+ options: client._options,
87
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
88
+ operationID: "list_transaction_captures",
89
+ oAuth2Scopes: null,
90
+ resolvedSecurity: requestSecurity,
91
+ securitySource: client._options.bearerAuth,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || {
95
+ strategy: "backoff",
96
+ backoff: {
97
+ initialInterval: 200,
98
+ maxInterval: 200,
99
+ exponent: 1,
100
+ maxElapsedTime: 1000,
101
+ },
102
+ retryConnectionErrors: true,
103
+ }
104
+ || { strategy: "none" },
105
+ retryCodes: options?.retryCodes || ["5XX"],
106
+ };
107
+ const requestRes = client._createRequest(context, {
108
+ security: requestSecurity,
109
+ method: "GET",
110
+ baseURL: options?.serverURL,
111
+ path: path,
112
+ headers: headers,
113
+ body: body,
114
+ userAgent: client._options.userAgent,
115
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
116
+ }, options);
117
+ if (!requestRes.ok) {
118
+ return [requestRes, { status: "invalid" }];
119
+ }
120
+ const req = requestRes.value;
121
+ const doResult = await client._do(req, {
122
+ context,
123
+ isErrorStatusCode: (statusCode) => (0, http_js_1.matchStatusCode)({ status: statusCode }, ["4XX", "5XX"]),
124
+ retryConfig: context.retryConfig,
125
+ retryCodes: context.retryCodes,
126
+ });
127
+ if (!doResult.ok) {
128
+ return [doResult, { status: "request-error", request: req }];
129
+ }
130
+ const response = doResult.value;
131
+ const responseFields = {
132
+ HttpMeta: { Response: response, Request: req },
133
+ };
134
+ const [result] = await M.match(M.json(200, components.CaptureCollection$inboundSchema), M.jsonErr(400, errors.Error400$inboundSchema), M.jsonErr(401, errors.Error401$inboundSchema), M.jsonErr(403, errors.Error403$inboundSchema), M.jsonErr(404, errors.Error404$inboundSchema), M.jsonErr(405, errors.Error405$inboundSchema), M.jsonErr(409, errors.Error409$inboundSchema), M.jsonErr(422, errors.HTTPValidationError$inboundSchema), M.jsonErr(425, errors.Error425$inboundSchema), M.jsonErr(429, errors.Error429$inboundSchema), M.jsonErr(500, errors.Error500$inboundSchema), M.jsonErr(502, errors.Error502$inboundSchema), M.jsonErr(504, errors.Error504$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
135
+ if (!result.ok) {
136
+ return [result, { status: "complete", request: req, response }];
137
+ }
138
+ return [result, { status: "complete", request: req, response }];
139
+ }
140
+ //# sourceMappingURL=transactionsCapturesList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionsCapturesList.js","sourceRoot":"","sources":["../src/funcs/transactionsCapturesList.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCH,4DAoCC;AAlED,sDAAmD;AACnD,4CAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAS5D,kEAAoD;AAGpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,wBAAwB,CACtC,MAAiB,EACjB,aAAqB,EACrB,iBAA6C,EAC7C,OAAwB;IA0BxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAiB,EACjB,aAAqB,EACrB,iBAA6C,EAC7C,OAAwB;IA6BxB,MAAM,KAAK,GAA8C;QACvD,aAAa,EAAE,aAAa;QAC5B,iBAAiB,EAAE,iBAAiB;KACrC,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,KAAK,EACL,CAAC,KAAK,EAAE,EAAE,CACR,UAAU,CAAC,6CAA6C,CAAC,KAAK,CAAC,KAAK,CAAC,EACvE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,C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,GAAG,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAC7C,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@gr4vy/sdk",
5
- "version": "2.2.0",
5
+ "version": "2.2.1",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/lib/config.d.ts CHANGED
@@ -44,8 +44,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
44
44
  export declare const SDK_METADATA: {
45
45
  readonly language: "typescript";
46
46
  readonly openapiDocVersion: "1.0.0";
47
- readonly sdkVersion: "2.2.0";
47
+ readonly sdkVersion: "2.2.1";
48
48
  readonly genVersion: "2.900.1";
49
- readonly userAgent: "speakeasy-sdk/typescript 2.2.0 2.900.1 1.0.0 @gr4vy/sdk";
49
+ readonly userAgent: "speakeasy-sdk/typescript 2.2.1 2.900.1 1.0.0 @gr4vy/sdk";
50
50
  };
51
51
  //# sourceMappingURL=config.d.ts.map
package/lib/config.js CHANGED
@@ -37,8 +37,8 @@ function serverURLFromOptions(options) {
37
37
  exports.SDK_METADATA = {
38
38
  language: "typescript",
39
39
  openapiDocVersion: "1.0.0",
40
- sdkVersion: "2.2.0",
40
+ sdkVersion: "2.2.1",
41
41
  genVersion: "2.900.1",
42
- userAgent: "speakeasy-sdk/typescript 2.2.0 2.900.1 1.0.0 @gr4vy/sdk",
42
+ userAgent: "speakeasy-sdk/typescript 2.2.1 2.900.1 1.0.0 @gr4vy/sdk",
43
43
  };
44
44
  //# sourceMappingURL=config.js.map
@@ -0,0 +1,84 @@
1
+ import * as z from "zod/v3";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ import { CaptureStatus } from "./capturestatus.js";
5
+ import { CartItem } from "./cartitem.js";
6
+ export type Capture = {
7
+ /**
8
+ * Always `capture`.
9
+ */
10
+ type: "capture";
11
+ /**
12
+ * The unique identifier for the capture.
13
+ */
14
+ id: string;
15
+ /**
16
+ * The merchant account this capture belongs to.
17
+ */
18
+ merchantAccountId: string;
19
+ /**
20
+ * The ID of the transaction associated with this capture.
21
+ */
22
+ transactionId: string;
23
+ /**
24
+ * The payment service's unique ID for the capture.
25
+ */
26
+ xid?: string | null | undefined;
27
+ /**
28
+ * The ISO 4217 currency code for this capture.
29
+ */
30
+ currency: string;
31
+ /**
32
+ * The capture amount in the smallest currency unit.
33
+ */
34
+ amount: number;
35
+ status: CaptureStatus;
36
+ /**
37
+ * Whether this is marked as the final capture for the associated transaction.
38
+ */
39
+ final: boolean;
40
+ /**
41
+ * The date and time this capture was created.
42
+ */
43
+ createdAt: Date;
44
+ /**
45
+ * The date and time this capture was last updated.
46
+ */
47
+ updatedAt: Date;
48
+ /**
49
+ * The date and time the capture was completed.
50
+ */
51
+ capturedAt?: Date | null | undefined;
52
+ /**
53
+ * An external identifier that can be used to match the capture against your own records.
54
+ */
55
+ externalIdentifier?: string | null | undefined;
56
+ /**
57
+ * The standardized error code set by Gr4vy.
58
+ */
59
+ errorCode?: string | null | undefined;
60
+ /**
61
+ * The ISO response code.
62
+ */
63
+ isoResponseCode?: string | null | undefined;
64
+ /**
65
+ * This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services.
66
+ */
67
+ rawResponseCode?: string | null | undefined;
68
+ /**
69
+ * This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services.
70
+ */
71
+ rawResponseDescription?: string | null | undefined;
72
+ /**
73
+ * The external identifier of the associated transaction.
74
+ */
75
+ transactionExternalIdentifier?: string | null | undefined;
76
+ /**
77
+ * An array of cart items that represents the line items of this capture.
78
+ */
79
+ cartItems?: Array<CartItem> | null | undefined;
80
+ };
81
+ /** @internal */
82
+ export declare const Capture$inboundSchema: z.ZodType<Capture, z.ZodTypeDef, unknown>;
83
+ export declare function captureFromJSON(jsonString: string): SafeParseResult<Capture, SDKValidationError>;
84
+ //# sourceMappingURL=capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/models/components/capture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,aAAa,EAA+B,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAA0B,MAAM,eAAe,CAAC;AAEjE,MAAM,MAAM,OAAO,GAAG;IACpB;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5C;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CA0CxE,CAAC;AAEL,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAM9C"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Capture$inboundSchema = void 0;
40
+ exports.captureFromJSON = captureFromJSON;
41
+ const z = __importStar(require("zod/v3"));
42
+ const primitives_js_1 = require("../../lib/primitives.js");
43
+ const schemas_js_1 = require("../../lib/schemas.js");
44
+ const capturestatus_js_1 = require("./capturestatus.js");
45
+ const cartitem_js_1 = require("./cartitem.js");
46
+ /** @internal */
47
+ exports.Capture$inboundSchema = z.object({
48
+ type: z.literal("capture").default("capture"),
49
+ id: z.string(),
50
+ merchant_account_id: z.string(),
51
+ transaction_id: z.string(),
52
+ xid: z.nullable(z.string()).optional(),
53
+ currency: z.string(),
54
+ amount: z.number().int(),
55
+ status: capturestatus_js_1.CaptureStatus$inboundSchema,
56
+ final: z.boolean(),
57
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
58
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
59
+ captured_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
60
+ external_identifier: z.nullable(z.string()).optional(),
61
+ error_code: z.nullable(z.string()).optional(),
62
+ iso_response_code: z.nullable(z.string()).optional(),
63
+ raw_response_code: z.nullable(z.string()).optional(),
64
+ raw_response_description: z.nullable(z.string()).optional(),
65
+ transaction_external_identifier: z.nullable(z.string()).optional(),
66
+ cart_items: z.nullable(z.array(cartitem_js_1.CartItem$inboundSchema)).optional(),
67
+ }).transform((v) => {
68
+ return (0, primitives_js_1.remap)(v, {
69
+ "merchant_account_id": "merchantAccountId",
70
+ "transaction_id": "transactionId",
71
+ "created_at": "createdAt",
72
+ "updated_at": "updatedAt",
73
+ "captured_at": "capturedAt",
74
+ "external_identifier": "externalIdentifier",
75
+ "error_code": "errorCode",
76
+ "iso_response_code": "isoResponseCode",
77
+ "raw_response_code": "rawResponseCode",
78
+ "raw_response_description": "rawResponseDescription",
79
+ "transaction_external_identifier": "transactionExternalIdentifier",
80
+ "cart_items": "cartItems",
81
+ });
82
+ });
83
+ function captureFromJSON(jsonString) {
84
+ return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Capture$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Capture' from JSON`);
85
+ }
86
+ //# sourceMappingURL=capture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/models/components/capture.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIH,0CAQC;AAzID,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAGjD,yDAAgF;AAChF,+CAAiE;AA8EjE,gBAAgB;AACH,QAAA,qBAAqB,GAChC,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC7C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,cA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AAC,CAAC,QAAQ,EAAE;IACpD,wBAAwB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3D,+BAA+B,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClE,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,oCAAsB,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,qBAAqB,EAAE,mBAAmB;QAC1C,gBAAgB,EAAE,eAAe;QACjC,YAAY,EAAE,WAAW;QACzB,YAAY,EAAE,WAAW;QACzB,aAAa,EAAE,YAAY;QAC3B,qBAAqB,EAAE,oBAAoB;QAC3C,YAAY,EAAE,WAAW;QACzB,mBAAmB,EAAE,iBAAiB;QACtC,mBAAmB,EAAE,iBAAiB;QACtC,0BAA0B,EAAE,wBAAwB;QACpD,iCAAiC,EAAE,+BAA+B;QAClE,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,SAAgB,eAAe,CAC7B,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,6BAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjD,qCAAqC,CACtC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import * as z from "zod/v3";
2
+ import { Result as SafeParseResult } from "../../types/fp.js";
3
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
+ import { Capture } from "./capture.js";
5
+ export type CaptureCollection = {
6
+ /**
7
+ * A list of items returned for this request.
8
+ */
9
+ items: Array<Capture>;
10
+ /**
11
+ * The number of items for this page.
12
+ */
13
+ limit: number;
14
+ /**
15
+ * The cursor pointing at the next page of items.
16
+ */
17
+ nextCursor?: string | null | undefined;
18
+ /**
19
+ * The cursor pointing at the previous page of items.
20
+ */
21
+ previousCursor?: string | null | undefined;
22
+ };
23
+ /** @internal */
24
+ export declare const CaptureCollection$inboundSchema: z.ZodType<CaptureCollection, z.ZodTypeDef, unknown>;
25
+ export declare function captureCollectionFromJSON(jsonString: string): SafeParseResult<CaptureCollection, SDKValidationError>;
26
+ //# sourceMappingURL=capturecollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capturecollection.d.ts","sourceRoot":"","sources":["../../src/models/components/capturecollection.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAyB,MAAM,cAAc,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CACrD,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,OAAO,CAWP,CAAC;AAEH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAMxD"}