@gr4vy/sdk 2.1.7 → 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.
- package/README.md +7 -0
- package/funcs/transactionsCapturesGet.d.ts +18 -0
- package/funcs/transactionsCapturesGet.d.ts.map +1 -0
- package/funcs/transactionsCapturesGet.js +145 -0
- package/funcs/transactionsCapturesGet.js.map +1 -0
- package/funcs/transactionsCapturesList.d.ts +18 -0
- package/funcs/transactionsCapturesList.d.ts.map +1 -0
- package/funcs/transactionsCapturesList.js +140 -0
- package/funcs/transactionsCapturesList.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +37 -12
- package/lib/sdks.js.map +1 -1
- package/models/components/capture.d.ts +84 -0
- package/models/components/capture.d.ts.map +1 -0
- package/models/components/capture.js +86 -0
- package/models/components/capture.js.map +1 -0
- package/models/components/capturecollection.d.ts +26 -0
- package/models/components/capturecollection.d.ts.map +1 -0
- package/models/components/capturecollection.js +60 -0
- package/models/components/capturecollection.js.map +1 -0
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/method.d.ts +1 -0
- package/models/components/method.d.ts.map +1 -1
- package/models/components/method.js +1 -0
- package/models/components/method.js.map +1 -1
- package/models/components/redirectpaymentmethodcreate.d.ts +1 -0
- package/models/components/redirectpaymentmethodcreate.d.ts.map +1 -1
- package/models/components/redirectpaymentmethodcreate.js +1 -0
- package/models/components/redirectpaymentmethodcreate.js.map +1 -1
- package/models/components/transactioncapturecreate.d.ts +10 -0
- package/models/components/transactioncapturecreate.d.ts.map +1 -1
- package/models/components/transactioncapturecreate.js +3 -0
- package/models/components/transactioncapturecreate.js.map +1 -1
- package/models/operations/gettransactioncapture.d.ts +28 -0
- package/models/operations/gettransactioncapture.d.ts.map +1 -0
- package/models/operations/gettransactioncapture.js +57 -0
- package/models/operations/gettransactioncapture.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listtransactioncaptures.d.ts +23 -0
- package/models/operations/listtransactioncaptures.d.ts.map +1 -0
- package/models/operations/listtransactioncaptures.js +55 -0
- package/models/operations/listtransactioncaptures.js.map +1 -0
- package/package.json +1 -1
- package/sdk/captures.d.ts +19 -0
- package/sdk/captures.d.ts.map +1 -0
- package/sdk/captures.js +32 -0
- package/sdk/captures.js.map +1 -0
- package/sdk/transactions.d.ts +3 -0
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +4 -0
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/transactionsCapturesGet.ts +255 -0
- package/src/funcs/transactionsCapturesList.ts +247 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +41 -13
- package/src/models/components/capture.ts +142 -0
- package/src/models/components/capturecollection.ts +56 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/method.ts +1 -0
- package/src/models/components/redirectpaymentmethodcreate.ts +1 -0
- package/src/models/components/transactioncapturecreate.ts +13 -0
- package/src/models/operations/gettransactioncapture.ts +58 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listtransactioncaptures.ts +51 -0
- package/src/sdk/captures.ts +51 -0
- package/src/sdk/transactions.ts +6 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type ListTransactionCapturesGlobals = {
|
|
9
|
+
merchantAccountId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ListTransactionCapturesRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The unique identifier of the transaction.
|
|
15
|
+
*/
|
|
16
|
+
transactionId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The ID of the merchant account to use for this request.
|
|
19
|
+
*/
|
|
20
|
+
merchantAccountId?: string | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type ListTransactionCapturesRequest$Outbound = {
|
|
25
|
+
transaction_id: string;
|
|
26
|
+
merchantAccountId?: string | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ListTransactionCapturesRequest$outboundSchema: z.ZodType<
|
|
31
|
+
ListTransactionCapturesRequest$Outbound,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
ListTransactionCapturesRequest
|
|
34
|
+
> = z.object({
|
|
35
|
+
transactionId: z.string(),
|
|
36
|
+
merchantAccountId: z.nullable(z.string()).optional(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
transactionId: "transaction_id",
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function listTransactionCapturesRequestToJSON(
|
|
44
|
+
listTransactionCapturesRequest: ListTransactionCapturesRequest,
|
|
45
|
+
): string {
|
|
46
|
+
return JSON.stringify(
|
|
47
|
+
ListTransactionCapturesRequest$outboundSchema.parse(
|
|
48
|
+
listTransactionCapturesRequest,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transactionsCapturesGet } from "../funcs/transactionsCapturesGet.js";
|
|
6
|
+
import { transactionsCapturesList } from "../funcs/transactionsCapturesList.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as components from "../models/components/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Captures extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* List transaction captures
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* List all captures for a specific transaction.
|
|
17
|
+
*/
|
|
18
|
+
async list(
|
|
19
|
+
transactionId: string,
|
|
20
|
+
merchantAccountId?: string | null | undefined,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<components.CaptureCollection> {
|
|
23
|
+
return unwrapAsync(transactionsCapturesList(
|
|
24
|
+
this,
|
|
25
|
+
transactionId,
|
|
26
|
+
merchantAccountId,
|
|
27
|
+
options,
|
|
28
|
+
));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get transaction capture
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Retrieve a specific capture for a transaction by its unique identifier.
|
|
36
|
+
*/
|
|
37
|
+
async get(
|
|
38
|
+
transactionId: string,
|
|
39
|
+
captureId: string,
|
|
40
|
+
merchantAccountId?: string | null | undefined,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): Promise<components.Capture> {
|
|
43
|
+
return unwrapAsync(transactionsCapturesGet(
|
|
44
|
+
this,
|
|
45
|
+
transactionId,
|
|
46
|
+
captureId,
|
|
47
|
+
merchantAccountId,
|
|
48
|
+
options,
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -16,6 +16,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
16
16
|
import { unwrapAsync } from "../types/fp.js";
|
|
17
17
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
18
18
|
import { Actions } from "./actions.js";
|
|
19
|
+
import { Captures } from "./captures.js";
|
|
19
20
|
import { Events } from "./events.js";
|
|
20
21
|
import { Gr4vyRefunds } from "./gr4vyrefunds.js";
|
|
21
22
|
import { Settlements } from "./settlements.js";
|
|
@@ -41,6 +42,11 @@ export class Transactions extends ClientSDK {
|
|
|
41
42
|
return (this._settlements ??= new Settlements(this._options));
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
private _captures?: Captures;
|
|
46
|
+
get captures(): Captures {
|
|
47
|
+
return (this._captures ??= new Captures(this._options));
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
/**
|
|
45
51
|
* List transactions
|
|
46
52
|
*
|