@gr4vy/sdk 2.3.26 → 2.3.28
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 +5 -0
- package/funcs/giftCardsActivationsCreate.d.ts +18 -0
- package/funcs/giftCardsActivationsCreate.d.ts.map +1 -0
- package/funcs/giftCardsActivationsCreate.js +129 -0
- package/funcs/giftCardsActivationsCreate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/buyer.d.ts +5 -1
- package/models/components/buyer.d.ts.map +1 -1
- package/models/components/buyer.js +3 -1
- package/models/components/buyer.js.map +1 -1
- package/models/components/giftcardactivationcreate.d.ts +38 -0
- package/models/components/giftcardactivationcreate.d.ts.map +1 -0
- package/models/components/giftcardactivationcreate.js +58 -0
- package/models/components/giftcardactivationcreate.js.map +1 -0
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/transactionbuyer.d.ts +4 -0
- package/models/components/transactionbuyer.d.ts.map +1 -1
- package/models/components/transactionbuyer.js +2 -0
- package/models/components/transactionbuyer.js.map +1 -1
- package/models/components/transactioncreate.d.ts +5 -0
- package/models/components/transactioncreate.d.ts.map +1 -1
- package/models/components/transactioncreate.js +1 -0
- package/models/components/transactioncreate.js.map +1 -1
- package/models/operations/activategiftcard.d.ts +26 -0
- package/models/operations/activategiftcard.d.ts.map +1 -0
- package/models/operations/activategiftcard.js +58 -0
- package/models/operations/activategiftcard.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/activations.d.ts +12 -0
- package/sdk/activations.d.ts.map +1 -0
- package/sdk/activations.js +22 -0
- package/sdk/activations.js.map +1 -0
- package/sdk/giftcards.d.ts +3 -0
- package/sdk/giftcards.d.ts.map +1 -1
- package/sdk/giftcards.js +4 -0
- package/sdk/giftcards.js.map +1 -1
- package/src/funcs/giftCardsActivationsCreate.ts +240 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/buyer.ts +8 -2
- package/src/models/components/giftcardactivationcreate.ts +66 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/transactionbuyer.ts +6 -0
- package/src/models/components/transactioncreate.ts +6 -0
- package/src/models/operations/activategiftcard.ts +54 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/activations.ts +31 -0
- package/src/sdk/giftcards.ts +6 -0
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
import * as components from "../components/index.js";
|
|
8
|
+
|
|
9
|
+
export type ActivateGiftCardGlobals = {
|
|
10
|
+
merchantAccountId?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ActivateGiftCardRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* A unique key that identifies this request. If supported by the gift card service, the value will be forwarded to make the activation idempotent. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
|
|
16
|
+
*/
|
|
17
|
+
idempotencyKey?: string | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the merchant account to use for this request.
|
|
20
|
+
*/
|
|
21
|
+
merchantAccountId?: string | null | undefined;
|
|
22
|
+
giftCardActivationCreate: components.GiftCardActivationCreate;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export type ActivateGiftCardRequest$Outbound = {
|
|
27
|
+
"idempotency-key"?: string | null | undefined;
|
|
28
|
+
merchantAccountId?: string | null | undefined;
|
|
29
|
+
GiftCardActivationCreate: components.GiftCardActivationCreate$Outbound;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const ActivateGiftCardRequest$outboundSchema: z.ZodType<
|
|
34
|
+
ActivateGiftCardRequest$Outbound,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
ActivateGiftCardRequest
|
|
37
|
+
> = z.object({
|
|
38
|
+
idempotencyKey: z.nullable(z.string()).optional(),
|
|
39
|
+
merchantAccountId: z.nullable(z.string()).optional(),
|
|
40
|
+
giftCardActivationCreate: components.GiftCardActivationCreate$outboundSchema,
|
|
41
|
+
}).transform((v) => {
|
|
42
|
+
return remap$(v, {
|
|
43
|
+
idempotencyKey: "idempotency-key",
|
|
44
|
+
giftCardActivationCreate: "GiftCardActivationCreate",
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export function activateGiftCardRequestToJSON(
|
|
49
|
+
activateGiftCardRequest: ActivateGiftCardRequest,
|
|
50
|
+
): string {
|
|
51
|
+
return JSON.stringify(
|
|
52
|
+
ActivateGiftCardRequest$outboundSchema.parse(activateGiftCardRequest),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { giftCardsActivationsCreate } from "../funcs/giftCardsActivationsCreate.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as components from "../models/components/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class Activations extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Activate a gift card
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Activate a physical gift card through the primary gift card service.
|
|
16
|
+
*/
|
|
17
|
+
async create(
|
|
18
|
+
giftCardActivationCreate: components.GiftCardActivationCreate,
|
|
19
|
+
idempotencyKey?: string | null | undefined,
|
|
20
|
+
merchantAccountId?: string | null | undefined,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<components.GiftCard> {
|
|
23
|
+
return unwrapAsync(giftCardsActivationsCreate(
|
|
24
|
+
this,
|
|
25
|
+
giftCardActivationCreate,
|
|
26
|
+
idempotencyKey,
|
|
27
|
+
merchantAccountId,
|
|
28
|
+
options,
|
|
29
|
+
));
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/sdk/giftcards.ts
CHANGED
|
@@ -11,6 +11,7 @@ import * as components from "../models/components/index.js";
|
|
|
11
11
|
import * as operations from "../models/operations/index.js";
|
|
12
12
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
13
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
14
|
+
import { Activations } from "./activations.js";
|
|
14
15
|
import { Balances } from "./balances.js";
|
|
15
16
|
|
|
16
17
|
export class GiftCards extends ClientSDK {
|
|
@@ -19,6 +20,11 @@ export class GiftCards extends ClientSDK {
|
|
|
19
20
|
return (this._balances ??= new Balances(this._options));
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
private _activations?: Activations;
|
|
24
|
+
get activations(): Activations {
|
|
25
|
+
return (this._activations ??= new Activations(this._options));
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
/**
|
|
23
29
|
* Get gift card
|
|
24
30
|
*
|