@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
66 lines • 3.59 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidateResponseSchema = exports.ValidateParamsSchema = exports.SurchargeResponseSchema = exports.SurchargeDataSchema = exports.SurchargeParamsSchema = exports.CardInfoResponseSchema = exports.CardInfoDataSchema = exports.CardInfoParamsSchema = exports.BillingUpdateResponseSchema = exports.BillingUpdateParamsSchema = exports.AccountQueryResponseSchema = exports.AccountQueryDataSchema = exports.AccountQueryParamsSchema = exports.TransactionSetupResponseSchema = exports.TransactionSetupDataSchema = exports.TransactionSetupParamsSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../../../core/schemas");
// Common parameter schemas
const ApiModeSchema = zod_1.z.enum(['dev', 'live']).optional();
// Transaction Setup Schemas
exports.TransactionSetupParamsSchema = schemas_1.BaseGetParamsSchema.extend({
customerId: zod_1.z.string(),
mode: ApiModeSchema,
});
/** Transaction setup data - key field only, passthrough for API flexibility */
exports.TransactionSetupDataSchema = zod_1.z
.object({ transactionSetupId: zod_1.z.string() })
.passthrough();
exports.TransactionSetupResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.TransactionSetupDataSchema);
// Account Query Schemas
exports.AccountQueryParamsSchema = schemas_1.BaseGetParamsSchema.extend({
customerId: zod_1.z.string(),
transactionSetupId: zod_1.z.string(),
mode: ApiModeSchema,
});
/** Account query data - key field only, passthrough for API flexibility */
exports.AccountQueryDataSchema = zod_1.z.object({ PaymentAccountID: zod_1.z.string() }).passthrough();
exports.AccountQueryResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.union([exports.AccountQueryDataSchema, zod_1.z.literal(false)]));
// Billing Update Schemas
exports.BillingUpdateParamsSchema = schemas_1.BaseGetParamsSchema.extend({
transactionSetupId: zod_1.z.string(),
address1: zod_1.z.string(),
address2: zod_1.z.string().optional(),
city: zod_1.z.string(),
state: zod_1.z.string(),
zip: zod_1.z.string(),
mode: ApiModeSchema,
});
exports.BillingUpdateResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.boolean());
// Card Info Schemas
exports.CardInfoParamsSchema = schemas_1.BaseGetParamsSchema.extend({
transactionSetupId: zod_1.z.string(),
mode: ApiModeSchema,
});
/** Card info data - passthrough for API flexibility */
exports.CardInfoDataSchema = zod_1.z.object({}).passthrough();
exports.CardInfoResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.union([exports.CardInfoDataSchema, zod_1.z.record(zod_1.z.never())]));
// Surcharge Schemas
exports.SurchargeParamsSchema = schemas_1.BaseGetParamsSchema.extend({
customerId: zod_1.z.string(),
paymentAccountId: zod_1.z.string(),
amount: zod_1.z.string(),
fromState: zod_1.z.string(),
toState: zod_1.z.string(),
country: zod_1.z.string(),
mode: ApiModeSchema,
});
/** Surcharge data - passthrough for API flexibility */
exports.SurchargeDataSchema = zod_1.z.object({}).passthrough();
exports.SurchargeResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.union([exports.SurchargeDataSchema, zod_1.z.record(zod_1.z.never())]));
// Transaction Validation Schemas
exports.ValidateParamsSchema = schemas_1.BaseGetParamsSchema.extend({
customerId: zod_1.z.string(),
transactionSetupId: zod_1.z.string(),
mode: ApiModeSchema,
});
exports.ValidateResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.boolean());
//# sourceMappingURL=unified.js.map