@greensecurity/javascript-sdk 0.43.1-beta.126 → 0.43.1-beta.127

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 (72) hide show
  1. package/README.md +0 -3
  2. package/dist/commonjs/__tests__/paymentprofile.test.js +0 -13
  3. package/dist/commonjs/__tests__/paymentprofile.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/zones.test.js +28 -4
  5. package/dist/commonjs/__tests__/zones.test.js.map +1 -1
  6. package/dist/commonjs/lib/config.d.ts +2 -2
  7. package/dist/commonjs/lib/config.js +2 -2
  8. package/dist/commonjs/models/operations/index.d.ts +0 -1
  9. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  10. package/dist/commonjs/models/operations/index.js +0 -1
  11. package/dist/commonjs/models/operations/index.js.map +1 -1
  12. package/dist/commonjs/react-query/index.d.ts +0 -1
  13. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  14. package/dist/commonjs/react-query/index.js +0 -1
  15. package/dist/commonjs/react-query/index.js.map +1 -1
  16. package/dist/commonjs/sdk/paymentprofile.d.ts +0 -10
  17. package/dist/commonjs/sdk/paymentprofile.d.ts.map +1 -1
  18. package/dist/commonjs/sdk/paymentprofile.js +0 -12
  19. package/dist/commonjs/sdk/paymentprofile.js.map +1 -1
  20. package/dist/esm/__tests__/paymentprofile.test.js +0 -13
  21. package/dist/esm/__tests__/paymentprofile.test.js.map +1 -1
  22. package/dist/esm/__tests__/zones.test.js +28 -4
  23. package/dist/esm/__tests__/zones.test.js.map +1 -1
  24. package/dist/esm/lib/config.d.ts +2 -2
  25. package/dist/esm/lib/config.js +2 -2
  26. package/dist/esm/models/operations/index.d.ts +0 -1
  27. package/dist/esm/models/operations/index.d.ts.map +1 -1
  28. package/dist/esm/models/operations/index.js +0 -1
  29. package/dist/esm/models/operations/index.js.map +1 -1
  30. package/dist/esm/react-query/index.d.ts +0 -1
  31. package/dist/esm/react-query/index.d.ts.map +1 -1
  32. package/dist/esm/react-query/index.js +0 -1
  33. package/dist/esm/react-query/index.js.map +1 -1
  34. package/dist/esm/sdk/paymentprofile.d.ts +0 -10
  35. package/dist/esm/sdk/paymentprofile.d.ts.map +1 -1
  36. package/dist/esm/sdk/paymentprofile.js +0 -12
  37. package/dist/esm/sdk/paymentprofile.js.map +1 -1
  38. package/jsr.json +1 -1
  39. package/package.json +1 -1
  40. package/src/__tests__/paymentprofile.test.ts +0 -16
  41. package/src/__tests__/zones.test.ts +28 -4
  42. package/src/lib/config.ts +2 -2
  43. package/src/models/operations/index.ts +0 -1
  44. package/src/react-query/index.ts +0 -1
  45. package/src/sdk/paymentprofile.ts +0 -19
  46. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.d.ts +0 -22
  47. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.d.ts.map +0 -1
  48. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.js +0 -113
  49. package/dist/commonjs/funcs/paymentProfileDeletePaymentProfile.js.map +0 -1
  50. package/dist/commonjs/models/operations/deletepaymentprofile.d.ts +0 -11
  51. package/dist/commonjs/models/operations/deletepaymentprofile.d.ts.map +0 -1
  52. package/dist/commonjs/models/operations/deletepaymentprofile.js +0 -49
  53. package/dist/commonjs/models/operations/deletepaymentprofile.js.map +0 -1
  54. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.d.ts +0 -30
  55. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.d.ts.map +0 -1
  56. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.js +0 -54
  57. package/dist/commonjs/react-query/paymentProfileDeletePaymentProfile.js.map +0 -1
  58. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.d.ts +0 -22
  59. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.d.ts.map +0 -1
  60. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.js +0 -77
  61. package/dist/esm/funcs/paymentProfileDeletePaymentProfile.js.map +0 -1
  62. package/dist/esm/models/operations/deletepaymentprofile.d.ts +0 -11
  63. package/dist/esm/models/operations/deletepaymentprofile.d.ts.map +0 -1
  64. package/dist/esm/models/operations/deletepaymentprofile.js +0 -12
  65. package/dist/esm/models/operations/deletepaymentprofile.js.map +0 -1
  66. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.d.ts +0 -30
  67. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.d.ts.map +0 -1
  68. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.js +0 -49
  69. package/dist/esm/react-query/paymentProfileDeletePaymentProfile.js.map +0 -1
  70. package/src/funcs/paymentProfileDeletePaymentProfile.ts +0 -160
  71. package/src/models/operations/deletepaymentprofile.ts +0 -35
  72. package/src/react-query/paymentProfileDeletePaymentProfile.ts +0 -115
@@ -1,49 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: fdcb791aabc9
4
- */
5
- import { useMutation, } from "@tanstack/react-query";
6
- import { paymentProfileDeletePaymentProfile } from "../funcs/paymentProfileDeletePaymentProfile.js";
7
- import { combineSignals } from "../lib/primitives.js";
8
- import { unwrapAsync } from "../types/fp.js";
9
- import { useGreenSecurityContext } from "./_context.js";
10
- /**
11
- * Delete payment profile
12
- *
13
- * @remarks
14
- * Deletes the payment profile for the logged-in user (vendor or company manager).
15
- *
16
- * Only vendors and company managers can access this endpoint.
17
- */
18
- export function usePaymentProfileDeletePaymentProfileMutation(options) {
19
- const client = useGreenSecurityContext();
20
- return useMutation({
21
- ...buildPaymentProfileDeletePaymentProfileMutation(client, options),
22
- ...options,
23
- });
24
- }
25
- export function mutationKeyPaymentProfileDeletePaymentProfile() {
26
- return [
27
- "@greensecurity/javascript-sdk",
28
- "payment-profile",
29
- "deletePaymentProfile",
30
- ];
31
- }
32
- export function buildPaymentProfileDeletePaymentProfileMutation(client$, hookOptions) {
33
- return {
34
- mutationKey: mutationKeyPaymentProfileDeletePaymentProfile(),
35
- mutationFn: function paymentProfileDeletePaymentProfileMutationFn({ options, }) {
36
- const mergedOptions = {
37
- ...hookOptions,
38
- ...options,
39
- fetchOptions: {
40
- ...hookOptions?.fetchOptions,
41
- ...options?.fetchOptions,
42
- signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
43
- },
44
- };
45
- return unwrapAsync(paymentProfileDeletePaymentProfile(client$, mergedOptions));
46
- },
47
- };
48
- }
49
- //# sourceMappingURL=paymentProfileDeletePaymentProfile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paymentProfileDeletePaymentProfile.js","sourceRoot":"","sources":["../../../src/react-query/paymentProfileDeletePaymentProfile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AActD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAqBxD;;;;;;;GAOG;AACH,MAAM,UAAU,6CAA6C,CAC3D,OAIC;IAMD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,OAAO,WAAW,CAAC;QACjB,GAAG,+CAA+C,CAAC,MAAM,EAAE,OAAO,CAAC;QACnE,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,6CAA6C;IAC3D,OAAO;QACL,+BAA+B;QAC/B,iBAAiB;QACjB,sBAAsB;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+CAA+C,CAC7D,OAA0B,EAC1B,WAA4B;IAO5B,OAAO;QACL,WAAW,EAAE,6CAA6C,EAAE;QAC5D,UAAU,EAAE,SAAS,4CAA4C,CAAC,EAChE,OAAO,GACR;YACC,MAAM,aAAa,GAAG;gBACpB,GAAG,WAAW;gBACd,GAAG,OAAO;gBACV,YAAY,EAAE;oBACZ,GAAG,WAAW,EAAE,YAAY;oBAC5B,GAAG,OAAO,EAAE,YAAY;oBACxB,MAAM,EAAE,cAAc,CACpB,WAAW,EAAE,YAAY,EAAE,MAAM,EACjC,OAAO,EAAE,YAAY,EAAE,MAAM,CAC9B;iBACF;aACF,CAAC;YACF,OAAO,WAAW,CAAC,kCAAkC,CACnD,OAAO,EACP,aAAa,CACd,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,160 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 1e20a09b10f1
4
- */
5
-
6
- import { GreenSecurityCore } from "../core.js";
7
- import { matchStatusCode } from "../lib/http.js";
8
- import * as M from "../lib/matchers.js";
9
- import { compactMap } from "../lib/primitives.js";
10
- import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
- import { pathToFunc } from "../lib/url.js";
13
- import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
14
- import {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/httpclienterrors.js";
21
- import * as errors from "../models/errors/index.js";
22
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
- import * as operations from "../models/operations/index.js";
25
- import { APICall, APIPromise } from "../types/async.js";
26
- import { Result } from "../types/fp.js";
27
-
28
- /**
29
- * Delete payment profile
30
- *
31
- * @remarks
32
- * Deletes the payment profile for the logged-in user (vendor or company manager).
33
- *
34
- * Only vendors and company managers can access this endpoint.
35
- *
36
- * If set, this operation will use {@link Security.bearerJwt} from the global security.
37
- */
38
- export function paymentProfileDeletePaymentProfile(
39
- client: GreenSecurityCore,
40
- options?: RequestOptions,
41
- ): APIPromise<
42
- Result<
43
- operations.DeletePaymentProfileDeletePaymentProfileOk,
44
- | errors.ApiErrorResponse
45
- | GreenSecurityError
46
- | ResponseValidationError
47
- | ConnectionError
48
- | RequestAbortedError
49
- | RequestTimeoutError
50
- | InvalidRequestError
51
- | UnexpectedClientError
52
- | SDKValidationError
53
- >
54
- > {
55
- return new APIPromise($do(
56
- client,
57
- options,
58
- ));
59
- }
60
-
61
- async function $do(
62
- client: GreenSecurityCore,
63
- options?: RequestOptions,
64
- ): Promise<
65
- [
66
- Result<
67
- operations.DeletePaymentProfileDeletePaymentProfileOk,
68
- | errors.ApiErrorResponse
69
- | GreenSecurityError
70
- | ResponseValidationError
71
- | ConnectionError
72
- | RequestAbortedError
73
- | RequestTimeoutError
74
- | InvalidRequestError
75
- | UnexpectedClientError
76
- | SDKValidationError
77
- >,
78
- APICall,
79
- ]
80
- > {
81
- const path = pathToFunc("/payment-profile")();
82
-
83
- const headers = new Headers(compactMap({
84
- Accept: "application/json",
85
- }));
86
-
87
- const securityInput = await extractSecurity(client._options.security);
88
- const requestSecurity = resolveGlobalSecurity(securityInput, [1]);
89
-
90
- const context = {
91
- options: client._options,
92
- baseURL: options?.serverURL ?? client._baseURL ?? "",
93
- operationID: "deletePaymentProfile",
94
- oAuth2Scopes: null,
95
-
96
- resolvedSecurity: requestSecurity,
97
-
98
- securitySource: client._options.security,
99
- retryConfig: options?.retries
100
- || client._options.retryConfig
101
- || { strategy: "none" },
102
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
103
- };
104
-
105
- const requestRes = client._createRequest(context, {
106
- security: requestSecurity,
107
- method: "DELETE",
108
- baseURL: options?.serverURL,
109
- path: path,
110
- headers: headers,
111
- userAgent: client._options.userAgent,
112
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
113
- }, options);
114
- if (!requestRes.ok) {
115
- return [requestRes, { status: "invalid" }];
116
- }
117
- const req = requestRes.value;
118
-
119
- const doResult = await client._do(req, {
120
- context,
121
- isErrorStatusCode: (statusCode: number) =>
122
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
123
- retryConfig: context.retryConfig,
124
- retryCodes: context.retryCodes,
125
- });
126
- if (!doResult.ok) {
127
- return [doResult, { status: "request-error", request: req }];
128
- }
129
- const response = doResult.value;
130
-
131
- const responseFields = {
132
- HttpMeta: { Response: response, Request: req },
133
- };
134
-
135
- const [result] = await M.match<
136
- operations.DeletePaymentProfileDeletePaymentProfileOk,
137
- | errors.ApiErrorResponse
138
- | GreenSecurityError
139
- | ResponseValidationError
140
- | ConnectionError
141
- | RequestAbortedError
142
- | RequestTimeoutError
143
- | InvalidRequestError
144
- | UnexpectedClientError
145
- | SDKValidationError
146
- >(
147
- M.json(
148
- 200,
149
- operations.DeletePaymentProfileDeletePaymentProfileOk$inboundSchema,
150
- ),
151
- M.jsonErr([400, 401, 403, 404], errors.ApiErrorResponse$inboundSchema),
152
- M.fail("4XX"),
153
- M.fail([500, "5XX"]),
154
- )(response, req, { extraFields: responseFields });
155
- if (!result.ok) {
156
- return [result, { status: "complete", request: req, response }];
157
- }
158
-
159
- return [result, { status: "complete", request: req, response }];
160
- }
@@ -1,35 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 134674f5a536
4
- */
5
-
6
- import * as z from "zod/v3";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- /**
12
- * The request was successful and the payment profile has been deleted.
13
- */
14
- export type DeletePaymentProfileDeletePaymentProfileOk = {};
15
-
16
- /** @internal */
17
- export const DeletePaymentProfileDeletePaymentProfileOk$inboundSchema:
18
- z.ZodType<DeletePaymentProfileDeletePaymentProfileOk, z.ZodTypeDef, unknown> =
19
- z.object({});
20
-
21
- export function deletePaymentProfileDeletePaymentProfileOkFromJSON(
22
- jsonString: string,
23
- ): SafeParseResult<
24
- DeletePaymentProfileDeletePaymentProfileOk,
25
- SDKValidationError
26
- > {
27
- return safeParse(
28
- jsonString,
29
- (x) =>
30
- DeletePaymentProfileDeletePaymentProfileOk$inboundSchema.parse(
31
- JSON.parse(x),
32
- ),
33
- `Failed to parse 'DeletePaymentProfileDeletePaymentProfileOk' from JSON`,
34
- );
35
- }
@@ -1,115 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: fdcb791aabc9
4
- */
5
-
6
- import {
7
- MutationKey,
8
- useMutation,
9
- UseMutationResult,
10
- } from "@tanstack/react-query";
11
- import { GreenSecurityCore } from "../core.js";
12
- import { paymentProfileDeletePaymentProfile } from "../funcs/paymentProfileDeletePaymentProfile.js";
13
- import { combineSignals } from "../lib/primitives.js";
14
- import { RequestOptions } from "../lib/sdks.js";
15
- import { GreenSecurityError } from "../models/errors/greensecurityerror.js";
16
- import {
17
- ConnectionError,
18
- InvalidRequestError,
19
- RequestAbortedError,
20
- RequestTimeoutError,
21
- UnexpectedClientError,
22
- } from "../models/errors/httpclienterrors.js";
23
- import * as errors from "../models/errors/index.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import * as operations from "../models/operations/index.js";
27
- import { unwrapAsync } from "../types/fp.js";
28
- import { useGreenSecurityContext } from "./_context.js";
29
- import { MutationHookOptions } from "./_types.js";
30
-
31
- export type PaymentProfileDeletePaymentProfileMutationVariables = {
32
- options?: RequestOptions;
33
- };
34
-
35
- export type PaymentProfileDeletePaymentProfileMutationData =
36
- operations.DeletePaymentProfileDeletePaymentProfileOk;
37
-
38
- export type PaymentProfileDeletePaymentProfileMutationError =
39
- | errors.ApiErrorResponse
40
- | GreenSecurityError
41
- | ResponseValidationError
42
- | ConnectionError
43
- | RequestAbortedError
44
- | RequestTimeoutError
45
- | InvalidRequestError
46
- | UnexpectedClientError
47
- | SDKValidationError;
48
-
49
- /**
50
- * Delete payment profile
51
- *
52
- * @remarks
53
- * Deletes the payment profile for the logged-in user (vendor or company manager).
54
- *
55
- * Only vendors and company managers can access this endpoint.
56
- */
57
- export function usePaymentProfileDeletePaymentProfileMutation(
58
- options?: MutationHookOptions<
59
- PaymentProfileDeletePaymentProfileMutationData,
60
- PaymentProfileDeletePaymentProfileMutationError,
61
- PaymentProfileDeletePaymentProfileMutationVariables
62
- >,
63
- ): UseMutationResult<
64
- PaymentProfileDeletePaymentProfileMutationData,
65
- PaymentProfileDeletePaymentProfileMutationError,
66
- PaymentProfileDeletePaymentProfileMutationVariables
67
- > {
68
- const client = useGreenSecurityContext();
69
- return useMutation({
70
- ...buildPaymentProfileDeletePaymentProfileMutation(client, options),
71
- ...options,
72
- });
73
- }
74
-
75
- export function mutationKeyPaymentProfileDeletePaymentProfile(): MutationKey {
76
- return [
77
- "@greensecurity/javascript-sdk",
78
- "payment-profile",
79
- "deletePaymentProfile",
80
- ];
81
- }
82
-
83
- export function buildPaymentProfileDeletePaymentProfileMutation(
84
- client$: GreenSecurityCore,
85
- hookOptions?: RequestOptions,
86
- ): {
87
- mutationKey: MutationKey;
88
- mutationFn: (
89
- variables: PaymentProfileDeletePaymentProfileMutationVariables,
90
- ) => Promise<PaymentProfileDeletePaymentProfileMutationData>;
91
- } {
92
- return {
93
- mutationKey: mutationKeyPaymentProfileDeletePaymentProfile(),
94
- mutationFn: function paymentProfileDeletePaymentProfileMutationFn({
95
- options,
96
- }): Promise<PaymentProfileDeletePaymentProfileMutationData> {
97
- const mergedOptions = {
98
- ...hookOptions,
99
- ...options,
100
- fetchOptions: {
101
- ...hookOptions?.fetchOptions,
102
- ...options?.fetchOptions,
103
- signal: combineSignals(
104
- hookOptions?.fetchOptions?.signal,
105
- options?.fetchOptions?.signal,
106
- ),
107
- },
108
- };
109
- return unwrapAsync(paymentProfileDeletePaymentProfile(
110
- client$,
111
- mergedOptions,
112
- ));
113
- },
114
- };
115
- }