@wix/auto_sdk_payments_psp-callbacks 1.0.57 → 1.0.59
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/build/cjs/index.js +396 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +396 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js +396 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.mjs +396 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +396 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.mjs +396 -1
- package/build/es/meta.mjs.map +1 -1
- package/package.json +4 -11
- package/build/cjs/schemas.d.ts +0 -85
- package/build/cjs/schemas.js +0 -177
- package/build/cjs/schemas.js.map +0 -1
- package/build/es/schemas.d.mts +0 -85
- package/build/es/schemas.mjs +0 -139
- package/build/es/schemas.mjs.map +0 -1
- package/build/internal/cjs/index.js +0 -102
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.js +0 -89
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.js +0 -81
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/schemas.d.ts +0 -85
- package/build/internal/cjs/schemas.js +0 -177
- package/build/internal/cjs/schemas.js.map +0 -1
- package/build/internal/es/index.mjs +0 -75
- package/build/internal/es/index.mjs.map +0 -1
- package/build/internal/es/index.typings.mjs +0 -62
- package/build/internal/es/index.typings.mjs.map +0 -1
- package/build/internal/es/meta.mjs +0 -54
- package/build/internal/es/meta.mjs.map +0 -1
- package/build/internal/es/schemas.d.mts +0 -85
- package/build/internal/es/schemas.mjs +0 -139
- package/build/internal/es/schemas.mjs.map +0 -1
- package/schemas/package.json +0 -3
package/build/cjs/schemas.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// schemas.ts
|
|
31
|
-
var schemas_exports = {};
|
|
32
|
-
__export(schemas_exports, {
|
|
33
|
-
SubmitEventRequest: () => SubmitEventRequest,
|
|
34
|
-
SubmitEventResponse: () => SubmitEventResponse
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(schemas_exports);
|
|
37
|
-
|
|
38
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.schemas.ts
|
|
39
|
-
var z = __toESM(require("zod"));
|
|
40
|
-
var SubmitEventRequest = /* @__PURE__ */ z.object({
|
|
41
|
-
event: z.intersection(
|
|
42
|
-
z.object({
|
|
43
|
-
pluginId: z.string().describe("This field is deprecated.").optional(),
|
|
44
|
-
siteId: z.string().describe("Wix site ID.").regex(
|
|
45
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
46
|
-
"Must be a valid GUID"
|
|
47
|
-
).optional().nullable()
|
|
48
|
-
}),
|
|
49
|
-
z.xor([
|
|
50
|
-
z.object({
|
|
51
|
-
refund: z.never().optional(),
|
|
52
|
-
transaction: z.never().optional(),
|
|
53
|
-
capture: z.never().optional(),
|
|
54
|
-
void: z.never().optional()
|
|
55
|
-
}),
|
|
56
|
-
z.object({
|
|
57
|
-
transaction: z.never().optional(),
|
|
58
|
-
capture: z.never().optional(),
|
|
59
|
-
void: z.never().optional(),
|
|
60
|
-
refund: z.object({
|
|
61
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").optional(),
|
|
62
|
-
pluginRefundId: z.string().describe("PSP refund ID.").optional(),
|
|
63
|
-
reasonCode: z.number().int().describe(
|
|
64
|
-
"Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request."
|
|
65
|
-
).optional(),
|
|
66
|
-
amount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Refunded amount.").optional(),
|
|
67
|
-
wixRefundId: z.string().describe(
|
|
68
|
-
"Wix refund ID. This field is only required when a merchant initiates a refund from the Wix dashboard."
|
|
69
|
-
).optional().nullable(),
|
|
70
|
-
errorCode: z.string().describe("PSP-specific error code.").optional().nullable(),
|
|
71
|
-
errorMessage: z.string().describe("PSP-specific error message.").optional().nullable()
|
|
72
|
-
}).describe("Refund event data.")
|
|
73
|
-
}),
|
|
74
|
-
z.object({
|
|
75
|
-
refund: z.never().optional(),
|
|
76
|
-
capture: z.never().optional(),
|
|
77
|
-
void: z.never().optional(),
|
|
78
|
-
transaction: z.object({
|
|
79
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").optional(),
|
|
80
|
-
pluginTransactionId: z.string().describe("PSP transaction ID.").optional(),
|
|
81
|
-
reasonCode: z.number().int().describe(
|
|
82
|
-
"Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes) indicating a failed or pending request."
|
|
83
|
-
).optional(),
|
|
84
|
-
errorCode: z.string().describe("PSP-specific error code.").optional().nullable(),
|
|
85
|
-
errorMessage: z.string().describe("PSP-specific error message.").optional().nullable(),
|
|
86
|
-
credentialsOnFile: z.intersection(
|
|
87
|
-
z.object({
|
|
88
|
-
paymentMethod: z.string().describe(
|
|
89
|
-
"Payment method (for example `creditCard`) to use for future payments, when it differs from the current one."
|
|
90
|
-
).min(1).max(100).optional().nullable()
|
|
91
|
-
}),
|
|
92
|
-
z.xor([
|
|
93
|
-
z.object({
|
|
94
|
-
cardReference: z.never().optional(),
|
|
95
|
-
paymentMethodReference: z.never().optional()
|
|
96
|
-
}),
|
|
97
|
-
z.object({
|
|
98
|
-
paymentMethodReference: z.never().optional(),
|
|
99
|
-
cardReference: z.object({
|
|
100
|
-
networkTransactionId: z.string().describe("Network token.").optional(),
|
|
101
|
-
dsTransactionId: z.string().describe("Directory Server transaction ID").optional().nullable(),
|
|
102
|
-
transactionLinkId: z.string().describe(
|
|
103
|
-
"Transaction Link Identifier assigned by Mastercard."
|
|
104
|
-
).min(1).max(22).optional().nullable()
|
|
105
|
-
}).describe("Network token data.")
|
|
106
|
-
}),
|
|
107
|
-
z.object({
|
|
108
|
-
cardReference: z.never().optional(),
|
|
109
|
-
paymentMethodReference: z.object({
|
|
110
|
-
token: z.string().describe(
|
|
111
|
-
"Payment method token created by the PSP."
|
|
112
|
-
).optional()
|
|
113
|
-
}).describe("Provider generated token data.")
|
|
114
|
-
})
|
|
115
|
-
])
|
|
116
|
-
).describe("Token data for stored payment method.").optional(),
|
|
117
|
-
cardDetails: z.object({
|
|
118
|
-
bin: z.string().describe(
|
|
119
|
-
"Issuer (business) identification number. First 6 or 8 digits of the card's number."
|
|
120
|
-
).min(6).max(8).optional().nullable(),
|
|
121
|
-
lastFour: z.string().describe("Last 4 digits of the card's number.").min(4).max(4).optional().nullable()
|
|
122
|
-
}).describe(
|
|
123
|
-
"Details of actual customer's card, obtained from a Funding PAN as opposed to a Device PAN."
|
|
124
|
-
).optional(),
|
|
125
|
-
authorizedAmount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
126
|
-
"Total amount authorized in a currency's minor units. Required for partial authorization events.\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies)."
|
|
127
|
-
).optional().nullable()
|
|
128
|
-
}).describe("Transaction event data.")
|
|
129
|
-
}),
|
|
130
|
-
z.object({
|
|
131
|
-
refund: z.never().optional(),
|
|
132
|
-
transaction: z.never().optional(),
|
|
133
|
-
void: z.never().optional(),
|
|
134
|
-
capture: z.object({
|
|
135
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").regex(
|
|
136
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
137
|
-
"Must be a valid GUID"
|
|
138
|
-
).optional(),
|
|
139
|
-
reasonCode: z.number().int().describe(
|
|
140
|
-
"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status."
|
|
141
|
-
).optional(),
|
|
142
|
-
amount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
143
|
-
"Total amount captured in a currency\u2019s minor units.\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies)."
|
|
144
|
-
).optional(),
|
|
145
|
-
errorCode: z.string().describe("PSP-specific error code.").max(50).optional().nullable(),
|
|
146
|
-
errorMessage: z.string().describe("PSP-specific error message.").max(300).optional().nullable()
|
|
147
|
-
}).describe("Capture event data.")
|
|
148
|
-
}),
|
|
149
|
-
z.object({
|
|
150
|
-
refund: z.never().optional(),
|
|
151
|
-
transaction: z.never().optional(),
|
|
152
|
-
capture: z.never().optional(),
|
|
153
|
-
void: z.object({
|
|
154
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").regex(
|
|
155
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
156
|
-
"Must be a valid GUID"
|
|
157
|
-
).optional(),
|
|
158
|
-
reasonCode: z.number().int().describe(
|
|
159
|
-
"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status."
|
|
160
|
-
).optional(),
|
|
161
|
-
amount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
162
|
-
"Total amount voided in a currency\u2019s minor units.\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies)."
|
|
163
|
-
).optional(),
|
|
164
|
-
errorCode: z.string().describe("PSP-specific error code.").max(50).optional().nullable(),
|
|
165
|
-
errorMessage: z.string().describe("PSP-specific error message.").max(300).optional().nullable()
|
|
166
|
-
}).describe("Void event data.")
|
|
167
|
-
})
|
|
168
|
-
])
|
|
169
|
-
).describe("Event data.")
|
|
170
|
-
});
|
|
171
|
-
var SubmitEventResponse = /* @__PURE__ */ z.object({});
|
|
172
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
173
|
-
0 && (module.exports = {
|
|
174
|
-
SubmitEventRequest,
|
|
175
|
-
SubmitEventResponse
|
|
176
|
-
});
|
|
177
|
-
//# sourceMappingURL=schemas.js.map
|
package/build/cjs/schemas.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../schemas.ts","../../src/payments-psp-v1-provider-platform-event-psp-callbacks.schemas.ts"],"sourcesContent":["export * from './src/payments-psp-v1-provider-platform-event-psp-callbacks.schemas.js';\n","import * as z from 'zod';\n\nexport const SubmitEventRequest = /*#__PURE__*/ z.object({\n event: z\n .intersection(\n z.object({\n pluginId: z.string().describe('This field is deprecated.').optional(),\n siteId: z\n .string()\n .describe('Wix site ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n }),\n z.xor([\n z.object({\n refund: z.never().optional(),\n transaction: z.never().optional(),\n capture: z.never().optional(),\n void: z.never().optional(),\n }),\n z.object({\n transaction: z.never().optional(),\n capture: z.never().optional(),\n void: z.never().optional(),\n refund: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .optional(),\n pluginRefundId: z.string().describe('PSP refund ID.').optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n 'Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request.'\n )\n .optional(),\n amount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe('Refunded amount.')\n .optional(),\n wixRefundId: z\n .string()\n .describe(\n 'Wix refund ID. This field is only required when a merchant initiates a refund from the Wix dashboard.'\n )\n .optional()\n .nullable(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .optional()\n .nullable(),\n })\n .describe('Refund event data.'),\n }),\n z.object({\n refund: z.never().optional(),\n capture: z.never().optional(),\n void: z.never().optional(),\n transaction: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .optional(),\n pluginTransactionId: z\n .string()\n .describe('PSP transaction ID.')\n .optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n 'Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes) indicating a failed or pending request.'\n )\n .optional(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .optional()\n .nullable(),\n credentialsOnFile: z\n .intersection(\n z.object({\n paymentMethod: z\n .string()\n .describe(\n 'Payment method (for example `creditCard`) to use for future payments, when it differs from the current one.'\n )\n .min(1)\n .max(100)\n .optional()\n .nullable(),\n }),\n z.xor([\n z.object({\n cardReference: z.never().optional(),\n paymentMethodReference: z.never().optional(),\n }),\n z.object({\n paymentMethodReference: z.never().optional(),\n cardReference: z\n .object({\n networkTransactionId: z\n .string()\n .describe('Network token.')\n .optional(),\n dsTransactionId: z\n .string()\n .describe('Directory Server transaction ID')\n .optional()\n .nullable(),\n transactionLinkId: z\n .string()\n .describe(\n 'Transaction Link Identifier assigned by Mastercard.'\n )\n .min(1)\n .max(22)\n .optional()\n .nullable(),\n })\n .describe('Network token data.'),\n }),\n z.object({\n cardReference: z.never().optional(),\n paymentMethodReference: z\n .object({\n token: z\n .string()\n .describe(\n 'Payment method token created by the PSP.'\n )\n .optional(),\n })\n .describe('Provider generated token data.'),\n }),\n ])\n )\n .describe('Token data for stored payment method.')\n .optional(),\n cardDetails: z\n .object({\n bin: z\n .string()\n .describe(\n \"Issuer (business) identification number. First 6 or 8 digits of the card's number.\"\n )\n .min(6)\n .max(8)\n .optional()\n .nullable(),\n lastFour: z\n .string()\n .describe(\"Last 4 digits of the card's number.\")\n .min(4)\n .max(4)\n .optional()\n .nullable(),\n })\n .describe(\n \"Details of actual customer's card, obtained from a Funding PAN as opposed to a Device PAN.\"\n )\n .optional(),\n authorizedAmount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n \"Total amount authorized in a currency's minor units. Required for partial authorization events.\\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).\"\n )\n .optional()\n .nullable(),\n })\n .describe('Transaction event data.'),\n }),\n z.object({\n refund: z.never().optional(),\n transaction: z.never().optional(),\n void: z.never().optional(),\n capture: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n \"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status.\"\n )\n .optional(),\n amount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n 'Total amount captured in a currency’s minor units.\\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).'\n )\n .optional(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .max(50)\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .max(300)\n .optional()\n .nullable(),\n })\n .describe('Capture event data.'),\n }),\n z.object({\n refund: z.never().optional(),\n transaction: z.never().optional(),\n capture: z.never().optional(),\n void: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n \"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status.\"\n )\n .optional(),\n amount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n 'Total amount voided in a currency’s minor units.\\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).'\n )\n .optional(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .max(50)\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .max(300)\n .optional()\n .nullable(),\n })\n .describe('Void event data.'),\n }),\n ])\n )\n .describe('Event data.'),\n});\nexport const SubmitEventResponse = /*#__PURE__*/ z.object({});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,qBAAmC,gBAAE,SAAO;AAAA,EACvD,OACG;AAAA,IACG,SAAO;AAAA,MACP,UAAY,SAAO,EAAE,SAAS,2BAA2B,EAAE,SAAS;AAAA,MACpE,QACG,SAAO,EACP,SAAS,cAAc,EACvB;AAAA,QACC;AAAA,QACA;AAAA,MACF,EACC,SAAS,EACT,SAAS;AAAA,IACd,CAAC;AAAA,IACC,MAAI;AAAA,MACF,SAAO;AAAA,QACP,QAAU,QAAM,EAAE,SAAS;AAAA,QAC3B,aAAe,QAAM,EAAE,SAAS;AAAA,QAChC,SAAW,QAAM,EAAE,SAAS;AAAA,QAC5B,MAAQ,QAAM,EAAE,SAAS;AAAA,MAC3B,CAAC;AAAA,MACC,SAAO;AAAA,QACP,aAAe,QAAM,EAAE,SAAS;AAAA,QAChC,SAAW,QAAM,EAAE,SAAS;AAAA,QAC5B,MAAQ,QAAM,EAAE,SAAS;AAAA,QACzB,QACG,SAAO;AAAA,UACN,kBACG,SAAO,EACP,SAAS,qBAAqB,EAC9B,SAAS;AAAA,UACZ,gBAAkB,SAAO,EAAE,SAAS,gBAAgB,EAAE,SAAS;AAAA,UAC/D,YACG,SAAO,EACP,IAAI,EACJ;AAAA,YACC;AAAA,UACF,EACC,SAAS;AAAA,UACZ,QACG,SAA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O,EACP,MAAM,WAAW,8BAA8B,EAC/C;AAAA,YACC;AAAA,UACF,EACC,SAAS;AAAA,UACZ,WACG,SAAO,EACP,SAAS,0BAA0B,EACnC,IAAI,EAAE,EACN,SAAS,EACT,SAAS;AAAA,UACZ,cACG,SAAO,EACP,SAAS,6BAA6B,EACtC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA,SAAS,qBAAqB;AAAA,MACnC,CAAC;AAAA,MACC,SAAO;AAAA,QACP,QAAU,QAAM,EAAE,SAAS;AAAA,QAC3B,aAAe,QAAM,EAAE,SAAS;AAAA,QAChC,SAAW,QAAM,EAAE,SAAS;AAAA,QAC5B,MACG,SAAO;AAAA,UACN,kBACG,SAAO,EACP,SAAS,qBAAqB,EAC9B;AAAA,YACC;AAAA,YACA;AAAA,UACF,EACC,SAAS;AAAA,UACZ,YACG,SAAO,EACP,IAAI,EACJ;AAAA,YACC;AAAA,UACF,EACC,SAAS;AAAA,UACZ,QACG,SAAO,EACP,MAAM,WAAW,8BAA8B,EAC/C;AAAA,YACC;AAAA,UACF,EACC,SAAS;AAAA,UACZ,WACG,SAAO,EACP,SAAS,0BAA0B,EACnC,IAAI,EAAE,EACN,SAAS,EACT,SAAS;AAAA,UACZ,cACG,SAAO,EACP,SAAS,6BAA6B,EACtC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA,SAAS,kBAAkB;AAAA,MAChC,CAAC;AAAA,IACH,CAAC;AAAA,EACH,EACC,SAAS,aAAa;AAC3B,CAAC;AACM,IAAM,sBAAoC,gBAAE,SAAO,CAAC,CAAC;","names":[]}
|
package/build/es/schemas.d.mts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const SubmitEventRequest: z.ZodObject<{
|
|
4
|
-
event: z.ZodIntersection<z.ZodObject<{
|
|
5
|
-
pluginId: z.ZodOptional<z.ZodString>;
|
|
6
|
-
siteId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
|
-
}, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
|
|
8
|
-
refund: z.ZodOptional<z.ZodNever>;
|
|
9
|
-
transaction: z.ZodOptional<z.ZodNever>;
|
|
10
|
-
capture: z.ZodOptional<z.ZodNever>;
|
|
11
|
-
void: z.ZodOptional<z.ZodNever>;
|
|
12
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
-
transaction: z.ZodOptional<z.ZodNever>;
|
|
14
|
-
capture: z.ZodOptional<z.ZodNever>;
|
|
15
|
-
void: z.ZodOptional<z.ZodNever>;
|
|
16
|
-
refund: z.ZodObject<{
|
|
17
|
-
wixTransactionId: z.ZodOptional<z.ZodString>;
|
|
18
|
-
pluginRefundId: z.ZodOptional<z.ZodString>;
|
|
19
|
-
reasonCode: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
amount: z.ZodOptional<z.ZodString>;
|
|
21
|
-
wixRefundId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
-
errorCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
|
-
errorMessage: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
-
refund: z.ZodOptional<z.ZodNever>;
|
|
27
|
-
capture: z.ZodOptional<z.ZodNever>;
|
|
28
|
-
void: z.ZodOptional<z.ZodNever>;
|
|
29
|
-
transaction: z.ZodObject<{
|
|
30
|
-
wixTransactionId: z.ZodOptional<z.ZodString>;
|
|
31
|
-
pluginTransactionId: z.ZodOptional<z.ZodString>;
|
|
32
|
-
reasonCode: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
errorCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
34
|
-
errorMessage: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
35
|
-
credentialsOnFile: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
|
|
36
|
-
paymentMethod: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
37
|
-
}, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
|
|
38
|
-
cardReference: z.ZodOptional<z.ZodNever>;
|
|
39
|
-
paymentMethodReference: z.ZodOptional<z.ZodNever>;
|
|
40
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
-
paymentMethodReference: z.ZodOptional<z.ZodNever>;
|
|
42
|
-
cardReference: z.ZodObject<{
|
|
43
|
-
networkTransactionId: z.ZodOptional<z.ZodString>;
|
|
44
|
-
dsTransactionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
45
|
-
transactionLinkId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
-
cardReference: z.ZodOptional<z.ZodNever>;
|
|
49
|
-
paymentMethodReference: z.ZodObject<{
|
|
50
|
-
token: z.ZodOptional<z.ZodString>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
}, z.core.$strip>]>>>;
|
|
53
|
-
cardDetails: z.ZodOptional<z.ZodObject<{
|
|
54
|
-
bin: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
55
|
-
lastFour: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
56
|
-
}, z.core.$strip>>;
|
|
57
|
-
authorizedAmount: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
58
|
-
}, z.core.$strip>;
|
|
59
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
-
refund: z.ZodOptional<z.ZodNever>;
|
|
61
|
-
transaction: z.ZodOptional<z.ZodNever>;
|
|
62
|
-
void: z.ZodOptional<z.ZodNever>;
|
|
63
|
-
capture: z.ZodObject<{
|
|
64
|
-
wixTransactionId: z.ZodOptional<z.ZodString>;
|
|
65
|
-
reasonCode: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
amount: z.ZodOptional<z.ZodString>;
|
|
67
|
-
errorCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
68
|
-
errorMessage: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
69
|
-
}, z.core.$strip>;
|
|
70
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
-
refund: z.ZodOptional<z.ZodNever>;
|
|
72
|
-
transaction: z.ZodOptional<z.ZodNever>;
|
|
73
|
-
capture: z.ZodOptional<z.ZodNever>;
|
|
74
|
-
void: z.ZodObject<{
|
|
75
|
-
wixTransactionId: z.ZodOptional<z.ZodString>;
|
|
76
|
-
reasonCode: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
amount: z.ZodOptional<z.ZodString>;
|
|
78
|
-
errorCode: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
79
|
-
errorMessage: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
80
|
-
}, z.core.$strip>;
|
|
81
|
-
}, z.core.$strip>]>>;
|
|
82
|
-
}, z.core.$strip>;
|
|
83
|
-
declare const SubmitEventResponse: z.ZodObject<{}, z.core.$strip>;
|
|
84
|
-
|
|
85
|
-
export { SubmitEventRequest, SubmitEventResponse };
|
package/build/es/schemas.mjs
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.schemas.ts
|
|
2
|
-
import * as z from "zod";
|
|
3
|
-
var SubmitEventRequest = /* @__PURE__ */ z.object({
|
|
4
|
-
event: z.intersection(
|
|
5
|
-
z.object({
|
|
6
|
-
pluginId: z.string().describe("This field is deprecated.").optional(),
|
|
7
|
-
siteId: z.string().describe("Wix site ID.").regex(
|
|
8
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
9
|
-
"Must be a valid GUID"
|
|
10
|
-
).optional().nullable()
|
|
11
|
-
}),
|
|
12
|
-
z.xor([
|
|
13
|
-
z.object({
|
|
14
|
-
refund: z.never().optional(),
|
|
15
|
-
transaction: z.never().optional(),
|
|
16
|
-
capture: z.never().optional(),
|
|
17
|
-
void: z.never().optional()
|
|
18
|
-
}),
|
|
19
|
-
z.object({
|
|
20
|
-
transaction: z.never().optional(),
|
|
21
|
-
capture: z.never().optional(),
|
|
22
|
-
void: z.never().optional(),
|
|
23
|
-
refund: z.object({
|
|
24
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").optional(),
|
|
25
|
-
pluginRefundId: z.string().describe("PSP refund ID.").optional(),
|
|
26
|
-
reasonCode: z.number().int().describe(
|
|
27
|
-
"Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request."
|
|
28
|
-
).optional(),
|
|
29
|
-
amount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Refunded amount.").optional(),
|
|
30
|
-
wixRefundId: z.string().describe(
|
|
31
|
-
"Wix refund ID. This field is only required when a merchant initiates a refund from the Wix dashboard."
|
|
32
|
-
).optional().nullable(),
|
|
33
|
-
errorCode: z.string().describe("PSP-specific error code.").optional().nullable(),
|
|
34
|
-
errorMessage: z.string().describe("PSP-specific error message.").optional().nullable()
|
|
35
|
-
}).describe("Refund event data.")
|
|
36
|
-
}),
|
|
37
|
-
z.object({
|
|
38
|
-
refund: z.never().optional(),
|
|
39
|
-
capture: z.never().optional(),
|
|
40
|
-
void: z.never().optional(),
|
|
41
|
-
transaction: z.object({
|
|
42
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").optional(),
|
|
43
|
-
pluginTransactionId: z.string().describe("PSP transaction ID.").optional(),
|
|
44
|
-
reasonCode: z.number().int().describe(
|
|
45
|
-
"Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes) indicating a failed or pending request."
|
|
46
|
-
).optional(),
|
|
47
|
-
errorCode: z.string().describe("PSP-specific error code.").optional().nullable(),
|
|
48
|
-
errorMessage: z.string().describe("PSP-specific error message.").optional().nullable(),
|
|
49
|
-
credentialsOnFile: z.intersection(
|
|
50
|
-
z.object({
|
|
51
|
-
paymentMethod: z.string().describe(
|
|
52
|
-
"Payment method (for example `creditCard`) to use for future payments, when it differs from the current one."
|
|
53
|
-
).min(1).max(100).optional().nullable()
|
|
54
|
-
}),
|
|
55
|
-
z.xor([
|
|
56
|
-
z.object({
|
|
57
|
-
cardReference: z.never().optional(),
|
|
58
|
-
paymentMethodReference: z.never().optional()
|
|
59
|
-
}),
|
|
60
|
-
z.object({
|
|
61
|
-
paymentMethodReference: z.never().optional(),
|
|
62
|
-
cardReference: z.object({
|
|
63
|
-
networkTransactionId: z.string().describe("Network token.").optional(),
|
|
64
|
-
dsTransactionId: z.string().describe("Directory Server transaction ID").optional().nullable(),
|
|
65
|
-
transactionLinkId: z.string().describe(
|
|
66
|
-
"Transaction Link Identifier assigned by Mastercard."
|
|
67
|
-
).min(1).max(22).optional().nullable()
|
|
68
|
-
}).describe("Network token data.")
|
|
69
|
-
}),
|
|
70
|
-
z.object({
|
|
71
|
-
cardReference: z.never().optional(),
|
|
72
|
-
paymentMethodReference: z.object({
|
|
73
|
-
token: z.string().describe(
|
|
74
|
-
"Payment method token created by the PSP."
|
|
75
|
-
).optional()
|
|
76
|
-
}).describe("Provider generated token data.")
|
|
77
|
-
})
|
|
78
|
-
])
|
|
79
|
-
).describe("Token data for stored payment method.").optional(),
|
|
80
|
-
cardDetails: z.object({
|
|
81
|
-
bin: z.string().describe(
|
|
82
|
-
"Issuer (business) identification number. First 6 or 8 digits of the card's number."
|
|
83
|
-
).min(6).max(8).optional().nullable(),
|
|
84
|
-
lastFour: z.string().describe("Last 4 digits of the card's number.").min(4).max(4).optional().nullable()
|
|
85
|
-
}).describe(
|
|
86
|
-
"Details of actual customer's card, obtained from a Funding PAN as opposed to a Device PAN."
|
|
87
|
-
).optional(),
|
|
88
|
-
authorizedAmount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
89
|
-
"Total amount authorized in a currency's minor units. Required for partial authorization events.\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies)."
|
|
90
|
-
).optional().nullable()
|
|
91
|
-
}).describe("Transaction event data.")
|
|
92
|
-
}),
|
|
93
|
-
z.object({
|
|
94
|
-
refund: z.never().optional(),
|
|
95
|
-
transaction: z.never().optional(),
|
|
96
|
-
void: z.never().optional(),
|
|
97
|
-
capture: z.object({
|
|
98
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").regex(
|
|
99
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
100
|
-
"Must be a valid GUID"
|
|
101
|
-
).optional(),
|
|
102
|
-
reasonCode: z.number().int().describe(
|
|
103
|
-
"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status."
|
|
104
|
-
).optional(),
|
|
105
|
-
amount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
106
|
-
"Total amount captured in a currency\u2019s minor units.\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies)."
|
|
107
|
-
).optional(),
|
|
108
|
-
errorCode: z.string().describe("PSP-specific error code.").max(50).optional().nullable(),
|
|
109
|
-
errorMessage: z.string().describe("PSP-specific error message.").max(300).optional().nullable()
|
|
110
|
-
}).describe("Capture event data.")
|
|
111
|
-
}),
|
|
112
|
-
z.object({
|
|
113
|
-
refund: z.never().optional(),
|
|
114
|
-
transaction: z.never().optional(),
|
|
115
|
-
capture: z.never().optional(),
|
|
116
|
-
void: z.object({
|
|
117
|
-
wixTransactionId: z.string().describe("Wix transaction ID.").regex(
|
|
118
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
119
|
-
"Must be a valid GUID"
|
|
120
|
-
).optional(),
|
|
121
|
-
reasonCode: z.number().int().describe(
|
|
122
|
-
"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status."
|
|
123
|
-
).optional(),
|
|
124
|
-
amount: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
125
|
-
"Total amount voided in a currency\u2019s minor units.\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies)."
|
|
126
|
-
).optional(),
|
|
127
|
-
errorCode: z.string().describe("PSP-specific error code.").max(50).optional().nullable(),
|
|
128
|
-
errorMessage: z.string().describe("PSP-specific error message.").max(300).optional().nullable()
|
|
129
|
-
}).describe("Void event data.")
|
|
130
|
-
})
|
|
131
|
-
])
|
|
132
|
-
).describe("Event data.")
|
|
133
|
-
});
|
|
134
|
-
var SubmitEventResponse = /* @__PURE__ */ z.object({});
|
|
135
|
-
export {
|
|
136
|
-
SubmitEventRequest,
|
|
137
|
-
SubmitEventResponse
|
|
138
|
-
};
|
|
139
|
-
//# sourceMappingURL=schemas.mjs.map
|
package/build/es/schemas.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/payments-psp-v1-provider-platform-event-psp-callbacks.schemas.ts"],"sourcesContent":["import * as z from 'zod';\n\nexport const SubmitEventRequest = /*#__PURE__*/ z.object({\n event: z\n .intersection(\n z.object({\n pluginId: z.string().describe('This field is deprecated.').optional(),\n siteId: z\n .string()\n .describe('Wix site ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n }),\n z.xor([\n z.object({\n refund: z.never().optional(),\n transaction: z.never().optional(),\n capture: z.never().optional(),\n void: z.never().optional(),\n }),\n z.object({\n transaction: z.never().optional(),\n capture: z.never().optional(),\n void: z.never().optional(),\n refund: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .optional(),\n pluginRefundId: z.string().describe('PSP refund ID.').optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n 'Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request.'\n )\n .optional(),\n amount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe('Refunded amount.')\n .optional(),\n wixRefundId: z\n .string()\n .describe(\n 'Wix refund ID. This field is only required when a merchant initiates a refund from the Wix dashboard.'\n )\n .optional()\n .nullable(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .optional()\n .nullable(),\n })\n .describe('Refund event data.'),\n }),\n z.object({\n refund: z.never().optional(),\n capture: z.never().optional(),\n void: z.never().optional(),\n transaction: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .optional(),\n pluginTransactionId: z\n .string()\n .describe('PSP transaction ID.')\n .optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n 'Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes) indicating a failed or pending request.'\n )\n .optional(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .optional()\n .nullable(),\n credentialsOnFile: z\n .intersection(\n z.object({\n paymentMethod: z\n .string()\n .describe(\n 'Payment method (for example `creditCard`) to use for future payments, when it differs from the current one.'\n )\n .min(1)\n .max(100)\n .optional()\n .nullable(),\n }),\n z.xor([\n z.object({\n cardReference: z.never().optional(),\n paymentMethodReference: z.never().optional(),\n }),\n z.object({\n paymentMethodReference: z.never().optional(),\n cardReference: z\n .object({\n networkTransactionId: z\n .string()\n .describe('Network token.')\n .optional(),\n dsTransactionId: z\n .string()\n .describe('Directory Server transaction ID')\n .optional()\n .nullable(),\n transactionLinkId: z\n .string()\n .describe(\n 'Transaction Link Identifier assigned by Mastercard.'\n )\n .min(1)\n .max(22)\n .optional()\n .nullable(),\n })\n .describe('Network token data.'),\n }),\n z.object({\n cardReference: z.never().optional(),\n paymentMethodReference: z\n .object({\n token: z\n .string()\n .describe(\n 'Payment method token created by the PSP.'\n )\n .optional(),\n })\n .describe('Provider generated token data.'),\n }),\n ])\n )\n .describe('Token data for stored payment method.')\n .optional(),\n cardDetails: z\n .object({\n bin: z\n .string()\n .describe(\n \"Issuer (business) identification number. First 6 or 8 digits of the card's number.\"\n )\n .min(6)\n .max(8)\n .optional()\n .nullable(),\n lastFour: z\n .string()\n .describe(\"Last 4 digits of the card's number.\")\n .min(4)\n .max(4)\n .optional()\n .nullable(),\n })\n .describe(\n \"Details of actual customer's card, obtained from a Funding PAN as opposed to a Device PAN.\"\n )\n .optional(),\n authorizedAmount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n \"Total amount authorized in a currency's minor units. Required for partial authorization events.\\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).\"\n )\n .optional()\n .nullable(),\n })\n .describe('Transaction event data.'),\n }),\n z.object({\n refund: z.never().optional(),\n transaction: z.never().optional(),\n void: z.never().optional(),\n capture: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n \"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status.\"\n )\n .optional(),\n amount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n 'Total amount captured in a currency’s minor units.\\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).'\n )\n .optional(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .max(50)\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .max(300)\n .optional()\n .nullable(),\n })\n .describe('Capture event data.'),\n }),\n z.object({\n refund: z.never().optional(),\n transaction: z.never().optional(),\n capture: z.never().optional(),\n void: z\n .object({\n wixTransactionId: z\n .string()\n .describe('Wix transaction ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n reasonCode: z\n .number()\n .int()\n .describe(\n \"Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status.\"\n )\n .optional(),\n amount: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n 'Total amount voided in a currency’s minor units.\\nLearn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).'\n )\n .optional(),\n errorCode: z\n .string()\n .describe('PSP-specific error code.')\n .max(50)\n .optional()\n .nullable(),\n errorMessage: z\n .string()\n .describe('PSP-specific error message.')\n .max(300)\n .optional()\n .nullable(),\n })\n .describe('Void event data.'),\n }),\n ])\n )\n .describe('Event data.'),\n});\nexport const SubmitEventResponse = /*#__PURE__*/ z.object({});\n"],"mappings":";AAAA,YAAY,OAAO;AAEZ,IAAM,qBAAmC,gBAAE,SAAO;AAAA,EACvD,OACG;AAAA,IACG,SAAO;AAAA,MACP,UAAY,SAAO,EAAE,SAAS,2BAA2B,EAAE,SAAS;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I,EACJ;AAAA,YACC;AAAA,UACF,EACC,SAAS;AAAA,UACZ,QACG,SAAO,EACP,MAAM,WAAW,8BAA8B,EAC/C;AAAA,YACC;AAAA,UACF,EACC,SAAS;AAAA,UACZ,WACG,SAAO,EACP,SAAS,0BAA0B,EACnC,IAAI,EAAE,EACN,SAAS,EACT,SAAS;AAAA,UACZ,cACG,SAAO,EACP,SAAS,6BAA6B,EACtC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA,SAAS,kBAAkB;AAAA,MAChC,CAAC;AAAA,IACH,CAAC;AAAA,EACH,EACC,SAAS,aAAa;AAC3B,CAAC;AACM,IAAM,sBAAoC,gBAAE,SAAO,CAAC,CAAC;","names":[]}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
submitEvent: () => submitEvent4
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(index_exports);
|
|
26
|
-
|
|
27
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.universal.ts
|
|
28
|
-
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
29
|
-
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
-
|
|
31
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.http.ts
|
|
32
|
-
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
-
function resolveWixPaymentsV1ProviderPlatformEventsProviderPlatformEventsServiceUrl(opts) {
|
|
34
|
-
const domainToMappings = {};
|
|
35
|
-
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
36
|
-
}
|
|
37
|
-
var PACKAGE_NAME = "@wix/auto_sdk_payments_psp-callbacks";
|
|
38
|
-
function submitEvent(payload) {
|
|
39
|
-
function __submitEvent({ host }) {
|
|
40
|
-
const metadata = {
|
|
41
|
-
entityFqdn: "wix.payments.psp.v1.provider_platform_event",
|
|
42
|
-
method: "POST",
|
|
43
|
-
methodFqn: "wix.payments.v1.provider_platform_events.ProviderPlatformEventsService.SubmitEvent",
|
|
44
|
-
packageName: PACKAGE_NAME,
|
|
45
|
-
migrationOptions: {
|
|
46
|
-
optInTransformResponse: true
|
|
47
|
-
},
|
|
48
|
-
url: resolveWixPaymentsV1ProviderPlatformEventsProviderPlatformEventsServiceUrl(
|
|
49
|
-
{
|
|
50
|
-
protoPath: "/payments/v1/provider-platform-events",
|
|
51
|
-
data: payload,
|
|
52
|
-
host
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
data: payload
|
|
56
|
-
};
|
|
57
|
-
return metadata;
|
|
58
|
-
}
|
|
59
|
-
return __submitEvent;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.universal.ts
|
|
63
|
-
async function submitEvent2(event) {
|
|
64
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
65
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ event });
|
|
66
|
-
const reqOpts = submitEvent(payload);
|
|
67
|
-
sideEffects?.onSiteCall?.();
|
|
68
|
-
try {
|
|
69
|
-
const result = await httpClient.request(reqOpts);
|
|
70
|
-
sideEffects?.onSuccess?.(result);
|
|
71
|
-
} catch (err) {
|
|
72
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
73
|
-
err,
|
|
74
|
-
{
|
|
75
|
-
spreadPathsToArguments: {},
|
|
76
|
-
explicitPathsToArguments: { event: "$[0]" },
|
|
77
|
-
singleArgumentUnchanged: false
|
|
78
|
-
},
|
|
79
|
-
["event"]
|
|
80
|
-
);
|
|
81
|
-
sideEffects?.onError?.(err);
|
|
82
|
-
throw transformedError;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.public.ts
|
|
87
|
-
function submitEvent3(httpClient) {
|
|
88
|
-
return (event) => submitEvent2(
|
|
89
|
-
event,
|
|
90
|
-
// @ts-ignore
|
|
91
|
-
{ httpClient }
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// src/payments-psp-v1-provider-platform-event-psp-callbacks.context.ts
|
|
96
|
-
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
97
|
-
var submitEvent4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(submitEvent3);
|
|
98
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
-
0 && (module.exports = {
|
|
100
|
-
submitEvent
|
|
101
|
-
});
|
|
102
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../index.ts","../../../src/payments-psp-v1-provider-platform-event-psp-callbacks.universal.ts","../../../src/payments-psp-v1-provider-platform-event-psp-callbacks.http.ts","../../../src/payments-psp-v1-provider-platform-event-psp-callbacks.public.ts","../../../src/payments-psp-v1-provider-platform-event-psp-callbacks.context.ts"],"sourcesContent":["export * from './src/payments-psp-v1-provider-platform-event-psp-callbacks.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPspV1ProviderPlatformEvent from './payments-psp-v1-provider-platform-event-psp-callbacks.http.js';\n\n/** Provider platform event */\nexport interface ProviderPlatformEvent\n extends ProviderPlatformEventResourceOneOf {\n /** Refund event data. */\n refund?: RefundEvent;\n /** Transaction event data. */\n transaction?: TransactionEvent;\n /** Capture event data. */\n capture?: CaptureEvent;\n /** Void event data. */\n void?: VoidEvent;\n /**\n * This field is deprecated.\n * @deprecated\n */\n pluginId?: string;\n /**\n * Wix site ID.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @oneof */\nexport interface ProviderPlatformEventResourceOneOf {\n /** Refund event data. */\n refund?: RefundEvent;\n /** Transaction event data. */\n transaction?: TransactionEvent;\n /** Capture event data. */\n capture?: CaptureEvent;\n /** Void event data. */\n void?: VoidEvent;\n}\n\nexport interface RefundEvent {\n /** Wix transaction ID. */\n wixTransactionId?: string;\n /** PSP refund ID. */\n pluginRefundId?: string;\n /** Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes#all-apis_provider-platform_reason-codes_refund-declined) indicating a failed request. */\n reasonCode?: number;\n /** Refunded amount. */\n amount?: string;\n /** Wix refund ID. This field is only required when a merchant initiates a refund from the Wix dashboard. */\n wixRefundId?: string | null;\n /** PSP-specific error code. */\n errorCode?: string | null;\n /** PSP-specific error message. */\n errorMessage?: string | null;\n}\n\nexport interface TransactionEvent {\n /** Wix transaction ID. */\n wixTransactionId?: string;\n /** PSP transaction ID. */\n pluginTransactionId?: string;\n /** Wix [reason code](https://dev.wix.com/api/rest/all-apis/provider-platform/reason-codes) indicating a failed or pending request. */\n reasonCode?: number;\n /** PSP-specific error code. */\n errorCode?: string | null;\n /** PSP-specific error message. */\n errorMessage?: string | null;\n /** Token data for stored payment method. */\n credentialsOnFile?: CredentialsOnFile;\n /** Details of actual customer's card, obtained from a Funding PAN as opposed to a Device PAN. */\n cardDetails?: CardDetails;\n /**\n * Total amount authorized in a currency's minor units. Required for partial authorization events.\n * Learn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).\n */\n authorizedAmount?: string | null;\n}\n\nexport interface CredentialsOnFile extends CredentialsOnFileInfoOneOf {\n /** Network token data. */\n cardReference?: CardReference;\n /** Provider generated token data. */\n paymentMethodReference?: PaymentMethodReference;\n /**\n * Payment method (for example `creditCard`) to use for future payments, when it differs from the current one.\n * @minLength 1\n * @maxLength 100\n */\n paymentMethod?: string | null;\n}\n\n/** @oneof */\nexport interface CredentialsOnFileInfoOneOf {\n /** Network token data. */\n cardReference?: CardReference;\n /** Provider generated token data. */\n paymentMethodReference?: PaymentMethodReference;\n}\n\nexport interface CardReference {\n /** Network token. */\n networkTransactionId?: string;\n /** Directory Server transaction ID */\n dsTransactionId?: string | null;\n /**\n * Transaction Link Identifier assigned by Mastercard.\n * @minLength 1\n * @maxLength 22\n */\n transactionLinkId?: string | null;\n}\n\nexport interface PaymentMethodReference {\n /** Payment method token created by the PSP. */\n token?: string;\n}\n\nexport interface CardDetails {\n /**\n * Issuer (business) identification number. First 6 or 8 digits of the card's number.\n * @minLength 6\n * @maxLength 8\n */\n bin?: string | null;\n /**\n * Last 4 digits of the card's number.\n * @minLength 4\n * @maxLength 4\n */\n lastFour?: string | null;\n}\n\nexport interface CaptureEvent {\n /**\n * Wix transaction ID.\n * @format GUID\n */\n wixTransactionId?: string;\n /** Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status. */\n reasonCode?: number;\n /**\n * Total amount captured in a currency’s minor units.\n * Learn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).\n */\n amount?: string;\n /**\n * PSP-specific error code.\n * @maxLength 50\n */\n errorCode?: string | null;\n /**\n * PSP-specific error message.\n * @maxLength 300\n */\n errorMessage?: string | null;\n}\n\nexport interface VoidEvent {\n /**\n * Wix transaction ID.\n * @format GUID\n */\n wixTransactionId?: string;\n /** Wix [reason code](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/reason-codes) indicating request's status. */\n reasonCode?: number;\n /**\n * Total amount voided in a currency’s minor units.\n * Learn more about [currencies](https://dev.wix.com/docs/rest/business-management/payments/service-plugins/payment-service-provider-service-plugin/currencies).\n */\n amount?: string;\n /**\n * PSP-specific error code.\n * @maxLength 50\n */\n errorCode?: string | null;\n /**\n * PSP-specific error message.\n * @maxLength 300\n */\n errorMessage?: string | null;\n}\n\n/** Submit event request */\nexport interface SubmitEventRequest {\n /** Event data. */\n event: ProviderPlatformEvent;\n}\n\n/** Submit event response */\nexport interface SubmitEventResponse {}\n\n/**\n * This Wix API is used by a Payment Service Provider (PSP) to send webhooks about payment and refund states to Wix.\n *\n * Calls to this endpoint must include a `User-Agent` header with the name of the PSP and the integration version in this format: `{PSP}/{version}`.\n * PSP's create their own version numbers.\n *\n * > You cannot try out this endpoint because an `Authorization` header value has to be obtained\n * > with the OAuth 2.0 client credentials flow for a specific scope.\n * > So please ignore the **Authorization** section below as well as the **Try It Out** button.\n * @param event - Event data.\n * @public\n * @requiredField event\n * @permissionId CASHIER.GET_ACCESS\n * @returns Submit event response\n * @fqn wix.payments.v1.provider_platform_events.ProviderPlatformEventsService.SubmitEvent\n */\nexport async function submitEvent(event: ProviderPlatformEvent): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ event: event });\n\n const reqOpts =\n ambassadorWixPaymentsPspV1ProviderPlatformEvent.submitEvent(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { event: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['event']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsV1ProviderPlatformEventsProviderPlatformEventsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_psp-callbacks';\n\n/**\n * This Wix API is used by a Payment Service Provider (PSP) to send webhooks about payment and refund states to Wix.\n *\n * Calls to this endpoint must include a `User-Agent` header with the name of the PSP and the integration version in this format: `{PSP}/{version}`.\n * PSP's create their own version numbers.\n *\n * > You cannot try out this endpoint because an `Authorization` header value has to be obtained\n * > with the OAuth 2.0 client credentials flow for a specific scope.\n * > So please ignore the **Authorization** section below as well as the **Try It Out** button.\n */\nexport function submitEvent(payload: object): RequestOptionsFactory<any> {\n function __submitEvent({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.psp.v1.provider_platform_event',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.v1.provider_platform_events.ProviderPlatformEventsService.SubmitEvent',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsV1ProviderPlatformEventsProviderPlatformEventsServiceUrl(\n {\n protoPath: '/payments/v1/provider-platform-events',\n data: payload,\n host,\n }\n ),\n data: payload,\n };\n\n return metadata;\n }\n\n return __submitEvent;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n ProviderPlatformEvent,\n submitEvent as universalSubmitEvent,\n} from './payments-psp-v1-provider-platform-event-psp-callbacks.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function submitEvent(httpClient: HttpClient): SubmitEventSignature {\n return (event: ProviderPlatformEvent) =>\n universalSubmitEvent(\n event,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SubmitEventSignature {\n /**\n * This Wix API is used by a Payment Service Provider (PSP) to send webhooks about payment and refund states to Wix.\n *\n * Calls to this endpoint must include a `User-Agent` header with the name of the PSP and the integration version in this format: `{PSP}/{version}`.\n * PSP's create their own version numbers.\n *\n * > You cannot try out this endpoint because an `Authorization` header value has to be obtained\n * > with the OAuth 2.0 client credentials flow for a specific scope.\n * > So please ignore the **Authorization** section below as well as the **Try It Out** button.\n * @param - Event data.\n * @returns Submit event response\n */\n (event: ProviderPlatformEvent): Promise<void>;\n}\n\nexport {\n CaptureEvent,\n CardDetails,\n CardReference,\n CredentialsOnFile,\n CredentialsOnFileInfoOneOf,\n PaymentMethodReference,\n ProviderPlatformEvent,\n ProviderPlatformEventResourceOneOf,\n RefundEvent,\n SubmitEventRequest,\n SubmitEventResponse,\n TransactionEvent,\n VoidEvent,\n} from './payments-psp-v1-provider-platform-event-psp-callbacks.universal.js';\n","import { submitEvent as publicSubmitEvent } from './payments-psp-v1-provider-platform-event-psp-callbacks.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const submitEvent: MaybeContext<\n BuildRESTFunction<typeof publicSubmitEvent> & typeof publicSubmitEvent\n> = /*#__PURE__*/ createRESTModule(publicSubmitEvent);\n\nexport {\n ProviderPlatformEvent,\n ProviderPlatformEventResourceOneOf,\n RefundEvent,\n TransactionEvent,\n CredentialsOnFile,\n CredentialsOnFileInfoOneOf,\n CardReference,\n PaymentMethodReference,\n CardDetails,\n CaptureEvent,\n VoidEvent,\n SubmitEventRequest,\n SubmitEventResponse,\n} from './payments-psp-v1-provider-platform-event-psp-callbacks.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,qBAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAAsD;;;ACDtD,0BAA2B;AAI3B,SAAS,2EACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAYd,SAAS,YAAY,SAA6C;AACvE,WAAS,cAAc,EAAE,KAAK,GAAQ;AACpC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK;AAAA,QACH;AAAA,UACE,WAAW;AAAA,UACX,MAAM;AAAA,UACN;AAAA,QACF;AAAA,MACF;AAAA,MACA,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AD+JA,eAAsBC,aAAY,OAA6C;AAE7E,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,MAAa,CAAC;AAEtE,QAAM,UAC4C,YAAY,OAAO;AAErE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,OAAO;AAAA,QAC1C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,OAAO;AAAA,IACV;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA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