@gr4vy/sdk 2.0.47 → 2.0.49

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 (51) hide show
  1. package/README.md +2 -0
  2. package/funcs/digitalWalletsSessionsPaze.d.ts +19 -0
  3. package/funcs/digitalWalletsSessionsPaze.d.ts.map +1 -0
  4. package/funcs/digitalWalletsSessionsPaze.js +127 -0
  5. package/funcs/digitalWalletsSessionsPaze.js.map +1 -0
  6. package/jsr.json +1 -1
  7. package/lib/config.d.ts +3 -3
  8. package/lib/config.js +3 -3
  9. package/models/components/index.d.ts +3 -0
  10. package/models/components/index.d.ts.map +1 -1
  11. package/models/components/index.js +3 -0
  12. package/models/components/index.js.map +1 -1
  13. package/models/components/paymentmethodupdate.d.ts +5 -0
  14. package/models/components/paymentmethodupdate.d.ts.map +1 -1
  15. package/models/components/paymentmethodupdate.js +2 -0
  16. package/models/components/paymentmethodupdate.js.map +1 -1
  17. package/models/components/pazemobilesession.d.ts +29 -0
  18. package/models/components/pazemobilesession.d.ts.map +1 -0
  19. package/models/components/pazemobilesession.js +54 -0
  20. package/models/components/pazemobilesession.js.map +1 -0
  21. package/models/components/pazesessionrequest.d.ts +34 -0
  22. package/models/components/pazesessionrequest.d.ts.map +1 -0
  23. package/models/components/pazesessionrequest.js +65 -0
  24. package/models/components/pazesessionrequest.js.map +1 -0
  25. package/models/components/pazewebsession.d.ts +21 -0
  26. package/models/components/pazewebsession.d.ts.map +1 -0
  27. package/models/components/pazewebsession.js +52 -0
  28. package/models/components/pazewebsession.js.map +1 -0
  29. package/models/operations/createpazedigitalwalletsession.d.ts +30 -0
  30. package/models/operations/createpazedigitalwalletsession.d.ts.map +1 -0
  31. package/models/operations/createpazedigitalwalletsession.js +67 -0
  32. package/models/operations/createpazedigitalwalletsession.js.map +1 -0
  33. package/models/operations/index.d.ts +1 -0
  34. package/models/operations/index.d.ts.map +1 -1
  35. package/models/operations/index.js +1 -0
  36. package/models/operations/index.js.map +1 -1
  37. package/package.json +1 -1
  38. package/sdk/sessions.d.ts +8 -0
  39. package/sdk/sessions.d.ts.map +1 -1
  40. package/sdk/sessions.js +10 -0
  41. package/sdk/sessions.js.map +1 -1
  42. package/src/funcs/digitalWalletsSessionsPaze.ts +238 -0
  43. package/src/lib/config.ts +3 -3
  44. package/src/models/components/index.ts +3 -0
  45. package/src/models/components/paymentmethodupdate.ts +7 -0
  46. package/src/models/components/pazemobilesession.ts +54 -0
  47. package/src/models/components/pazesessionrequest.ts +63 -0
  48. package/src/models/components/pazewebsession.ts +44 -0
  49. package/src/models/operations/createpazedigitalwalletsession.ts +85 -0
  50. package/src/models/operations/index.ts +1 -0
  51. package/src/sdk/sessions.ts +23 -0
@@ -0,0 +1,63 @@
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 openEnums from "../../types/enums.js";
8
+ import { OpenEnum } from "../../types/enums.js";
9
+
10
+ /**
11
+ * The platform that the Paze session is being created for. Defaults to `web`.
12
+ */
13
+ export const Source = {
14
+ Web: "web",
15
+ Mobile: "mobile",
16
+ } as const;
17
+ /**
18
+ * The platform that the Paze session is being created for. Defaults to `web`.
19
+ */
20
+ export type Source = OpenEnum<typeof Source>;
21
+
22
+ export type PazeSessionRequest = {
23
+ /**
24
+ * The platform that the Paze session is being created for. Defaults to `web`.
25
+ */
26
+ source?: Source | undefined;
27
+ /**
28
+ * The domain on which Paze is being loaded. Required when `source` is `web`.
29
+ */
30
+ domainName?: string | null | undefined;
31
+ };
32
+
33
+ /** @internal */
34
+ export const Source$outboundSchema: z.ZodType<string, z.ZodTypeDef, Source> =
35
+ openEnums.outboundSchema(Source);
36
+
37
+ /** @internal */
38
+ export type PazeSessionRequest$Outbound = {
39
+ source: string;
40
+ domain_name?: string | null | undefined;
41
+ };
42
+
43
+ /** @internal */
44
+ export const PazeSessionRequest$outboundSchema: z.ZodType<
45
+ PazeSessionRequest$Outbound,
46
+ z.ZodTypeDef,
47
+ PazeSessionRequest
48
+ > = z.object({
49
+ source: Source$outboundSchema.default("web"),
50
+ domainName: z.nullable(z.string()).optional(),
51
+ }).transform((v) => {
52
+ return remap$(v, {
53
+ domainName: "domain_name",
54
+ });
55
+ });
56
+
57
+ export function pazeSessionRequestToJSON(
58
+ pazeSessionRequest: PazeSessionRequest,
59
+ ): string {
60
+ return JSON.stringify(
61
+ PazeSessionRequest$outboundSchema.parse(pazeSessionRequest),
62
+ );
63
+ }
@@ -0,0 +1,44 @@
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 { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type PazeWebSession = {
11
+ /**
12
+ * The Paze merchant data ID.
13
+ */
14
+ id: string;
15
+ /**
16
+ * The merchant display name.
17
+ */
18
+ name: string;
19
+ /**
20
+ * The Paze profile ID for the given domain.
21
+ */
22
+ profileId: string;
23
+ };
24
+
25
+ /** @internal */
26
+ export const PazeWebSession$inboundSchema: z.ZodType<
27
+ PazeWebSession,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ id: z.string(),
32
+ name: z.string(),
33
+ profileId: z.string(),
34
+ });
35
+
36
+ export function pazeWebSessionFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<PazeWebSession, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => PazeWebSession$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'PazeWebSession' from JSON`,
43
+ );
44
+ }
@@ -0,0 +1,85 @@
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 { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type CreatePazeDigitalWalletSessionGlobals = {
13
+ merchantAccountId?: string | undefined;
14
+ };
15
+
16
+ export type CreatePazeDigitalWalletSessionRequest = {
17
+ /**
18
+ * The ID of the merchant account to use for this request.
19
+ */
20
+ merchantAccountId?: string | null | undefined;
21
+ pazeSessionRequest: components.PazeSessionRequest;
22
+ };
23
+
24
+ /**
25
+ * Successful Response
26
+ */
27
+ export type CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession =
28
+ | components.PazeMobileSession
29
+ | components.PazeWebSession;
30
+
31
+ /** @internal */
32
+ export type CreatePazeDigitalWalletSessionRequest$Outbound = {
33
+ merchantAccountId?: string | null | undefined;
34
+ PazeSessionRequest: components.PazeSessionRequest$Outbound;
35
+ };
36
+
37
+ /** @internal */
38
+ export const CreatePazeDigitalWalletSessionRequest$outboundSchema: z.ZodType<
39
+ CreatePazeDigitalWalletSessionRequest$Outbound,
40
+ z.ZodTypeDef,
41
+ CreatePazeDigitalWalletSessionRequest
42
+ > = z.object({
43
+ merchantAccountId: z.nullable(z.string()).optional(),
44
+ pazeSessionRequest: components.PazeSessionRequest$outboundSchema,
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ pazeSessionRequest: "PazeSessionRequest",
48
+ });
49
+ });
50
+
51
+ export function createPazeDigitalWalletSessionRequestToJSON(
52
+ createPazeDigitalWalletSessionRequest: CreatePazeDigitalWalletSessionRequest,
53
+ ): string {
54
+ return JSON.stringify(
55
+ CreatePazeDigitalWalletSessionRequest$outboundSchema.parse(
56
+ createPazeDigitalWalletSessionRequest,
57
+ ),
58
+ );
59
+ }
60
+
61
+ /** @internal */
62
+ export const CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession$inboundSchema:
63
+ z.ZodType<
64
+ CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession,
65
+ z.ZodTypeDef,
66
+ unknown
67
+ > = z.union([
68
+ components.PazeMobileSession$inboundSchema,
69
+ components.PazeWebSession$inboundSchema,
70
+ ]);
71
+
72
+ export function createPazeDigitalWalletSessionResponseCreatePazeDigitalWalletSessionFromJSON(
73
+ jsonString: string,
74
+ ): SafeParseResult<
75
+ CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession,
76
+ SDKValidationError
77
+ > {
78
+ return safeParse(
79
+ jsonString,
80
+ (x) =>
81
+ CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession$inboundSchema
82
+ .parse(JSON.parse(x)),
83
+ `Failed to parse 'CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession' from JSON`,
84
+ );
85
+ }
@@ -23,6 +23,7 @@ export * from "./createpaymentservice.js";
23
23
  export * from "./createpaymentservicedefinitionsession.js";
24
24
  export * from "./createpaymentservicesession.js";
25
25
  export * from "./createpayout.js";
26
+ export * from "./createpazedigitalwalletsession.js";
26
27
  export * from "./createreportexecutionurl.js";
27
28
  export * from "./createthreedsconfiguration.js";
28
29
  export * from "./createthreedsscenario.js";
@@ -5,8 +5,10 @@
5
5
  import { digitalWalletsSessionsApplePay } from "../funcs/digitalWalletsSessionsApplePay.js";
6
6
  import { digitalWalletsSessionsClickToPay } from "../funcs/digitalWalletsSessionsClickToPay.js";
7
7
  import { digitalWalletsSessionsGooglePay } from "../funcs/digitalWalletsSessionsGooglePay.js";
8
+ import { digitalWalletsSessionsPaze } from "../funcs/digitalWalletsSessionsPaze.js";
8
9
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
9
10
  import * as components from "../models/components/index.js";
11
+ import * as operations from "../models/operations/index.js";
10
12
  import { unwrapAsync } from "../types/fp.js";
11
13
 
12
14
  export class Sessions extends ClientSDK {
@@ -48,6 +50,27 @@ export class Sessions extends ClientSDK {
48
50
  ));
49
51
  }
50
52
 
53
+ /**
54
+ * Create a Paze session
55
+ *
56
+ * @remarks
57
+ * Create a session for use with Paze.
58
+ */
59
+ async paze(
60
+ pazeSessionRequest: components.PazeSessionRequest,
61
+ merchantAccountId?: string | null | undefined,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ operations.CreatePazeDigitalWalletSessionResponseCreatePazeDigitalWalletSession
65
+ > {
66
+ return unwrapAsync(digitalWalletsSessionsPaze(
67
+ this,
68
+ pazeSessionRequest,
69
+ merchantAccountId,
70
+ options,
71
+ ));
72
+ }
73
+
51
74
  /**
52
75
  * Create a Click to Pay session
53
76
  *