@kizlo/woocommerce 1.0.0-alpha.1 → 1.0.0-alpha.2
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/dist/client-BJuv_NtE.js +684 -0
- package/dist/client-BJuv_NtE.js.map +1 -0
- package/dist/client-CWtBT_hK.cjs +857 -0
- package/dist/{index-DbjII-g1.d.cts → index-D6PQxlBF.d.cts} +4699 -6794
- package/dist/index-D6PQxlBF.d.cts.map +1 -0
- package/dist/{index-B70N6Qy2.d.ts → index-DUK75443.d.ts} +4699 -6794
- package/dist/index-DUK75443.d.ts.map +1 -0
- package/dist/index.cjs +22 -20
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +4 -6
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/package.json +4 -3
- package/dist/client-ChYuRMN-.cjs +0 -684
- package/dist/client-g0rDKQEG.js +0 -511
- package/dist/client-g0rDKQEG.js.map +0 -1
- package/dist/index-B70N6Qy2.d.ts.map +0 -1
- package/dist/index-DbjII-g1.d.cts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-BJuv_NtE.js","names":["woocommerce","kizlo: Kizlo","kizlo: Kizlo","kizlo: Kizlo","kizlo: Kizlo","contract","best: PaymentAdapter | null","methods: PaymentMethod[]","selectedAdapters: PaymentAdapter[]","kizlo: Kizlo","kizlo: Kizlo"],"sources":["../src/client.extension.ts","../src/cart/client.ts","../src/customer/client.ts","../src/order/client.ts","../src/generated/contract.server.json","../src/server.client.ts","../src/server.extension.ts","../src/payment/client.ts","../src/product/client.ts","../src/client.ts"],"sourcesContent":["import type { ClientExtension } from \"kizlo\"\nimport { createClientExtension, type ProcedureContext, procedure } from \"kizlo/extensions\"\nimport { KizloWoocommerce, type WooCommerceRouter, woocommerceRouter } from \"./client\"\n\nexport interface WooCommerceProcedureContext extends ProcedureContext {\n\twoocommerce: KizloWoocommerce\n}\n\nexport const woocommerceProcedure = procedure.use(\n\tprocedure.middleware(({ context, next }) => {\n\t\tconst woocommerce = new KizloWoocommerce(context.kizlo)\n\t\treturn next({ context: { woocommerce } })\n\t}),\n)\n\nexport type WooCommerceClientExtension = ClientExtension<\"woocommerce\", WooCommerceRouter>\n\nexport function woocommerce(): WooCommerceClientExtension {\n\treturn createClientExtension({\n\t\ttype: \"router\",\n\t\tname: \"woocommerce\",\n\t\tinit() {\n\t\t\treturn woocommerceRouter\n\t\t},\n\t})\n}\n","import { ensureProcedureResult, type Kizlo, type } from \"kizlo\"\nimport { procedureErrors } from \"kizlo/extensions\"\nimport { woocommerceProcedure } from \"../client.extension\"\nimport type {\n\tAddCartItemErrorCode,\n\tAddCartItemInput,\n\tAddCartItemResult,\n\tApplyCouponErrorCode,\n\tApplyCouponInput,\n\tApplyCouponResult,\n\tCart,\n\tRemoveCartItemErrorCode,\n\tRemoveCartItemInput,\n\tRemoveCartItemResult,\n\tRemoveCouponErrorCode,\n\tRemoveCouponInput,\n\tRemoveCouponResult,\n\tRetrieveCartErrorCode,\n\tRetrieveCartResult,\n\tUpdateCartErrorCode,\n\tUpdateCartInput,\n\tUpdateCartItemErrorCode,\n\tUpdateCartItemInput,\n\tUpdateCartItemResult,\n\tUpdateCartResult,\n} from \"./types\"\n\nexport class KizloCartItem {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async add(input: AddCartItemInput): Promise<AddCartItemResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.post<Cart, AddCartItemErrorCode>(\"/cart/items\", {\n\t\t\t\tbody: input,\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async update(input: UpdateCartItemInput): Promise<UpdateCartItemResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.put<Cart, UpdateCartItemErrorCode>(`/cart/items/${input.key}`, {\n\t\t\t\tbody: input,\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async remove(input: RemoveCartItemInput): Promise<RemoveCartItemResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.delete<Cart, RemoveCartItemErrorCode>(`/cart/items/${input.key}`, {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport class KizloCoupon {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async apply(input: ApplyCouponInput): Promise<ApplyCouponResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.post<Cart, ApplyCouponErrorCode>(`/cart/coupons/${input.code}`, {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async remove(input: RemoveCouponInput): Promise<RemoveCouponResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.delete<Cart, RemoveCouponErrorCode>(`/cart/coupons/${input.code}`, {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport class KizloCart {\n\tpublic items: KizloCartItem\n\tpublic coupons: KizloCoupon\n\n\tconstructor(private readonly kizlo: Kizlo) {\n\t\tthis.items = new KizloCartItem(this.kizlo)\n\t\tthis.coupons = new KizloCoupon(this.kizlo)\n\t}\n\n\tpublic async retrieve(): Promise<RetrieveCartResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.get<Cart, RetrieveCartErrorCode>(\"/cart\", {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async update(input: UpdateCartInput): Promise<UpdateCartResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.put<Cart, UpdateCartErrorCode>(\"/cart\", {\n\t\t\t\tbody: input,\n\t\t\t\theaders,\n\t\t\t})\n\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport const cart = {\n\tretrieve: woocommerceProcedure\n\t\t.output(type<Cart>())\n\t\t.errors(procedureErrors<RetrieveCartErrorCode>())\n\t\t.handler(async ({ context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.retrieve())\n\t\t}),\n\n\tupdate: woocommerceProcedure\n\t\t.input(type<UpdateCartInput>())\n\t\t.output(type<Cart>())\n\t\t.errors(procedureErrors<UpdateCartErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.update(input))\n\t\t}),\n\n\titems: {\n\t\tadd: woocommerceProcedure\n\t\t\t.input(type<AddCartItemInput>())\n\t\t\t.output(type<Cart>())\n\t\t\t.errors(procedureErrors<AddCartItemErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.items.add(input))\n\t\t\t}),\n\n\t\tupdate: woocommerceProcedure\n\t\t\t.input(type<UpdateCartItemInput>())\n\t\t\t.output(type<Cart>())\n\t\t\t.errors(procedureErrors<UpdateCartItemErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.items.update(input))\n\t\t\t}),\n\n\t\tremove: woocommerceProcedure\n\t\t\t.input(type<RemoveCartItemInput>())\n\t\t\t.output(type<Cart>())\n\t\t\t.errors(procedureErrors<RemoveCartItemErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.items.remove(input))\n\t\t\t}),\n\t},\n\n\tcoupons: {\n\t\tapply: woocommerceProcedure\n\t\t\t.input(type<ApplyCouponInput>())\n\t\t\t.output(type<Cart>())\n\t\t\t.errors(procedureErrors<ApplyCouponErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.coupons.apply(input))\n\t\t\t}),\n\n\t\tremove: woocommerceProcedure\n\t\t\t.input(type<RemoveCouponInput>())\n\t\t\t.output(type<Cart>())\n\t\t\t.errors(procedureErrors<RemoveCouponErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.cart.coupons.remove(input))\n\t\t\t}),\n\t},\n}\n","import { ensureProcedureResult, type Kizlo, type } from \"kizlo\"\nimport { procedureErrors } from \"kizlo/extensions\"\nimport { woocommerceProcedure } from \"../client.extension\"\nimport type {\n\tCreateAddressErrorCode,\n\tCreateAddressInput,\n\tCreateAddressResult,\n\tCustomer,\n\tDeleteAddressErrorCode,\n\tDeleteAddressInput,\n\tDeleteAddressResult,\n\tRetrieveCustomerErrorCode,\n\tRetrieveCustomerResult,\n\tUpdateAddressErrorCode,\n\tUpdateAddressInput,\n\tUpdateAddressResult,\n} from \"./types\"\n\nexport class KizloAddress {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async create(input: CreateAddressInput): Promise<CreateAddressResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.post<Customer, CreateAddressErrorCode>(\"/customers/addresses\", {\n\t\t\t\theaders,\n\t\t\t\tbody: input,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async update(input: UpdateAddressInput): Promise<UpdateAddressResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.put<Customer, UpdateAddressErrorCode>(`/customers/addresses/${input.id}`, {\n\t\t\t\tbody: input,\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async delete(input: DeleteAddressInput): Promise<DeleteAddressResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.delete<Customer, DeleteAddressErrorCode>(`/customers/addresses/${input.id}`, {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport class KizloCustomer {\n\tpublic readonly address: KizloAddress\n\n\tconstructor(private readonly kizlo: Kizlo) {\n\t\tthis.address = new KizloAddress(this.kizlo)\n\t}\n\n\tpublic async retrieve(): Promise<RetrieveCustomerResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.get<Customer, RetrieveCustomerErrorCode>(\"/customers\", {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport const customer = {\n\tretrieve: woocommerceProcedure\n\t\t.output(type<Customer>())\n\t\t.errors(procedureErrors<RetrieveCustomerErrorCode>())\n\t\t.handler(async ({ context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.customer.retrieve())\n\t\t}),\n\n\taddress: {\n\t\tcreate: woocommerceProcedure\n\t\t\t.input(type<CreateAddressInput>())\n\t\t\t.output(type<Customer>())\n\t\t\t.errors(procedureErrors<CreateAddressErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.customer.address.create(input))\n\t\t\t}),\n\n\t\tupdate: woocommerceProcedure\n\t\t\t.input(type<UpdateAddressInput>())\n\t\t\t.output(type<Customer>())\n\t\t\t.errors(procedureErrors<UpdateAddressErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.customer.address.update(input))\n\t\t\t}),\n\n\t\tdelete: woocommerceProcedure\n\t\t\t.input(type<UpdateAddressInput>())\n\t\t\t.output(type<Customer>())\n\t\t\t.errors(procedureErrors<DeleteAddressErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.customer.address.delete(input))\n\t\t\t}),\n\t},\n}\n","import { ensureProcedureResult, type Kizlo, type } from \"kizlo\"\nimport { procedureErrors } from \"kizlo/extensions\"\nimport { woocommerceProcedure } from \"../client.extension\"\nimport type {\n\tListOrderErrorCode,\n\tListOrderInput,\n\tListOrderResult,\n\tOrder,\n\tOrderList,\n\tRetrieveOrderErrorCode,\n\tRetrieveOrderInput,\n\tRetrieveOrderResult,\n} from \"./types\"\n\nexport class KizloOrder {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async retrieve(input: RetrieveOrderInput): Promise<RetrieveOrderResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.get<Order, RetrieveOrderErrorCode>(`/orders/${input.id}`, {\n\t\t\t\theaders,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n\n\tpublic async list(input: ListOrderInput): Promise<ListOrderResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.get<OrderList, ListOrderErrorCode>(\"/orders\", {\n\t\t\t\theaders,\n\t\t\t\tquery: input,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport const orders = {\n\tretrieve: woocommerceProcedure\n\t\t.input(type<RetrieveOrderInput>())\n\t\t.output(type<Order>())\n\t\t.errors(procedureErrors<RetrieveOrderErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.orders.retrieve(input))\n\t\t}),\n\n\tlist: woocommerceProcedure\n\t\t.input(type<ListOrderInput>())\n\t\t.output(type<OrderList>())\n\t\t.errors(procedureErrors<ListOrderErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.orders.list(input))\n\t\t}),\n}\n","{\"cart\":{\"retrieve\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"update\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"items\":{\"add\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"update\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"remove\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}}},\"coupons\":{\"apply\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"remove\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}}}},\"orders\":{\"retrieve\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"list\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}}},\"customer\":{\"retrieve\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"address\":{\"create\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"update\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"delete\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}}}},\"products\":{\"retrieve\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"list\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"collection\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"categories\":{\"list\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}}},\"reviews\":{\"retrieve\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"list\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"create\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}}}},\"payment\":{\"confirm\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"update\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"methods\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{\"method\":\"GET\"}}},\"pay\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{}}},\"webhooks\":{\"~orpc\":{\"errorMap\":{},\"meta\":{},\"route\":{\"method\":\"POST\",\"path\":\"/payment/webhooks/{id}\",\"inputStructure\":\"detailed\"}}}}}","import { woocommerceRouter } from \"./client\"\nimport { createPaymentServerRouter } from \"./payment/client\"\nimport type { WooCommerceServerExtensionOptions } from \"./server.extension\"\n\nexport function createWoocommerceServerRouter(options?: WooCommerceServerExtensionOptions) {\n\treturn {\n\t\t...woocommerceRouter,\n\n\t\t/**\n\t\t * Omitting methods, pay and webhooks procedure to avoid calling it from rpc.\n\t\t */\n\t\tpayment: createPaymentServerRouter(options),\n\t}\n}\n\nexport type WooCommerceServerRouter = ReturnType<typeof createWoocommerceServerRouter>\n","import type { ServerExtension } from \"kizlo\"\nimport { createServerExtension, openApiProcedure, remoteProcedure } from \"kizlo/extensions\"\nimport { KizloWoocommerce } from \"./client\"\nimport type { PaymentAdapter } from \"./payment/types\"\nimport { createWoocommerceServerRouter, type WooCommerceServerRouter } from \"./server\"\n\nexport const woocommerceRemoteProcedure = remoteProcedure.use(\n\tremoteProcedure.middleware(({ context, next }) => {\n\t\tconst woocommerce = new KizloWoocommerce(context.kizlo)\n\t\treturn next({ context: { woocommerce } })\n\t}),\n)\n\nexport const woocommerceOpenApiProcedure = openApiProcedure.use(\n\topenApiProcedure.middleware(({ context, next }) => {\n\t\tconst woocommerce = new KizloWoocommerce(context.kizlo)\n\t\treturn next({ context: { woocommerce } })\n\t}),\n)\n\nexport type WooCommerceServerExtension = ServerExtension<\"woocommerce\", WooCommerceServerRouter>\n\nexport interface WooCommerceServerExtensionOptions {\n\tpaymentAdapters?: PaymentAdapter[]\n}\n\nexport function woocommerce(options?: WooCommerceServerExtensionOptions): WooCommerceServerExtension {\n\treturn createServerExtension({\n\t\tname: \"woocommerce\",\n\t\tinit() {\n\t\t\treturn createWoocommerceServerRouter(options)\n\t\t},\n\t})\n}\n","import {\n\tcreateRemoteFetchClient,\n\tcreateSafeClient,\n\tensureProcedureResult,\n\ttype Kizlo,\n\ttype RemoteClient,\n\ttype SafeClient,\n\ttype,\n} from \"kizlo\"\nimport { procedureErrors } from \"kizlo/extensions\"\nimport { woocommerceProcedure } from \"../client.extension\"\nimport contract from \"../generated/contract.server.json\"\nimport type { Order } from \"../order/types\"\nimport {\n\ttype WooCommerceServerExtensionOptions,\n\ttype WooCommerceServerRouter,\n\twoocommerceOpenApiProcedure,\n\twoocommerceRemoteProcedure,\n} from \"../server\"\nimport type {\n\tConfirmPaymentErrorCode,\n\tConfirmPaymentInput,\n\tConfirmPaymentResult,\n\tHandlePaymentWebhookInput,\n\tListPaymentMethodAdminInput,\n\tListPaymentMethodErrorCode,\n\tListPaymentMethodResult,\n\tPaymentAdapter,\n\tPaymentMethod,\n\tPayPaymentAdminInput,\n\tPayPaymentData,\n\tPayPaymentErrorCode,\n\tPayPaymentInput,\n\tPayPaymentResult,\n\tUpdatePaymentErrorCode,\n\tUpdatePaymentInput,\n\tUpdatePaymentResult,\n} from \"./types\"\n\nexport class KizloPayment {\n\tpublic readonly admin: KizloPaymentAdmin\n\tprivate readonly rpc: SafeClient<RemoteClient<WooCommerceServerRouter>>\n\n\tconstructor(private readonly kizlo: Kizlo) {\n\t\tthis.admin = new KizloPaymentAdmin(this.kizlo)\n\n\t\tthis.rpc = createSafeClient(\n\t\t\tcreateRemoteFetchClient<WooCommerceServerRouter>(contract as WooCommerceServerRouter, `${this.kizlo._.serverBaseUrl}/woocommerce`),\n\t\t)\n\t}\n\n\tpublic async methods(): Promise<ListPaymentMethodResult> {\n\t\tconst { error, data, isDefined } = await this.rpc.payment.methods()\n\t\tif (error) {\n\t\t\tif (isDefined) {\n\t\t\t\treturn this.kizlo._.http.error({\n\t\t\t\t\tcode: error.code,\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t\tstatus: error.status,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tthrow error\n\t\t}\n\t\treturn this.kizlo._.http.success(data)\n\t}\n\n\tpublic async pay(input: PayPaymentInput): Promise<PayPaymentResult> {\n\t\tconst { error, data, isDefined } = await this.rpc.payment.pay(input)\n\t\tif (error) {\n\t\t\tif (isDefined) {\n\t\t\t\treturn this.kizlo._.http.error({\n\t\t\t\t\tcode: error.code,\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t\tstatus: error.status,\n\t\t\t\t})\n\t\t\t}\n\t\t\tthrow error\n\t\t}\n\t\treturn this.kizlo._.http.success(data)\n\t}\n}\n\nexport class KizloPaymentAdmin {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async confirm(input: ConfirmPaymentInput): Promise<ConfirmPaymentResult> {\n\t\tconst response = await this.kizlo._.http.post<Order, ConfirmPaymentErrorCode>(\"/payment\", {\n\t\t\tbody: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n\n\tpublic async update(input: UpdatePaymentInput): Promise<UpdatePaymentResult> {\n\t\tconst response = await this.kizlo._.http.put<Order, UpdatePaymentErrorCode>(`/payment/${input.order_id}`, {\n\t\t\tbody: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n\n\tpublic async methods(input: ListPaymentMethodAdminInput): Promise<ListPaymentMethodResult> {\n\t\tconst groups = new Map<string, PaymentAdapter[]>()\n\n\t\tfor (const adapter of input.adapters) {\n\t\t\tconst config = adapter\n\n\t\t\tif (!groups.has(config.type)) groups.set(config.type, [])\n\n\t\t\tgroups.get(config.type)?.push(config)\n\t\t}\n\n\t\tconst getPrioritizedAdapter = (group: PaymentAdapter[]): PaymentAdapter | null => {\n\t\t\tlet best: PaymentAdapter | null = null\n\n\t\t\tfor (const adapter of group) {\n\t\t\t\tif (!best || adapter.priority > best.priority) best = adapter\n\t\t\t}\n\n\t\t\treturn best\n\t\t}\n\n\t\tconst methods: PaymentMethod[] = []\n\n\t\tfor (const [, group] of groups) {\n\t\t\tconst selectedAdapters: PaymentAdapter[] = []\n\n\t\t\tconst combinableAdapters = group.filter((adapter) => adapter.isCombinable)\n\n\t\t\tif (combinableAdapters.length > 1) {\n\t\t\t\tfor (const adapter of combinableAdapters) selectedAdapters.push(adapter)\n\t\t\t} else {\n\t\t\t\tconst bestAdapter = getPrioritizedAdapter(group)\n\n\t\t\t\tif (bestAdapter) selectedAdapters.push(bestAdapter)\n\t\t\t}\n\n\t\t\tfor (const adapter of selectedAdapters) {\n\t\t\t\tconst eligibility = await adapter.eligibility?.(input.context)\n\n\t\t\t\tif (eligibility?.is_hidden) continue\n\n\t\t\t\tmethods.push({\n\t\t\t\t\tid: adapter.id,\n\t\t\t\t\ttype: adapter.type,\n\t\t\t\t\tname: eligibility?.name ?? adapter.name,\n\t\t\t\t\tis_disabled: eligibility?.is_disabled ?? false,\n\t\t\t\t\tdescription: eligibility?.description ?? adapter.description,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\tconst uniqueIds = new Set(methods.map((method) => method.id))\n\t\tif (uniqueIds.size !== methods.length) return this.kizlo._.http.error(\"PAYMENT_DUPLICATE_ADAPTERS\")\n\n\t\treturn this.kizlo._.http.success(methods)\n\t}\n\n\tpublic async pay(input: PayPaymentAdminInput): Promise<PayPaymentResult> {\n\t\tconst adapter = input.adapters.find((adp) => adp.id === input.payment_method_id)\n\t\tif (!adapter) return this.kizlo._.http.error(\"PAYMENT_ADAPTER_NOT_FOUND\")\n\n\t\tconst session = await this.kizlo.auth.session.retrieve()\n\t\tif (!session) return this.kizlo._.http.error(\"AUTH_REQUIRED\")\n\n\t\tconst confirmResult = await this.confirm({\n\t\t\tuser_id: session.user.id,\n\t\t\tpayment_method_id: adapter.id,\n\t\t\tpayment_method_name: adapter.name,\n\t\t\tpayment_method_type: adapter.type,\n\t\t})\n\t\tif (confirmResult.isError) return this.kizlo._.http.error(confirmResult.error)\n\n\t\tif (adapter.type === \"online\") {\n\t\t\tconst intent = await adapter.create({ order: confirmResult.data }, input.context)\n\t\t\tif (!intent || !intent.url) return this.kizlo._.http.error(\"PAYMENT_ADAPTER_NOT_FOUND\")\n\n\t\t\tconst updateResult = await this.update({\n\t\t\t\torder_id: confirmResult.data.id,\n\t\t\t\tpayment_status: intent.status,\n\t\t\t\tpayment_session_id: intent.id,\n\t\t\t\ttransaction_id: intent.transaction_id,\n\t\t\t\tpayment_url: intent.url,\n\t\t\t})\n\t\t\tif (updateResult.isError) return this.kizlo._.http.error(updateResult.error)\n\n\t\t\treturn this.kizlo._.http.success({ redirect_url: intent.url })\n\t\t}\n\n\t\treturn this.kizlo._.http.success({ redirect_url: \"\" })\n\t}\n\n\tpublic async handleWebhook(input: HandlePaymentWebhookInput) {\n\t\tconst adapter = input.adapters.find((a) => a.id === input.payment_method_id)\n\t\tif (!adapter || adapter.type !== \"online\") return this.kizlo._.http.error(\"PAYMENT_ADAPTER_NOT_FOUND\")\n\n\t\tconst data = await adapter.verify(input.context)\n\t\tif (!data) return this.kizlo._.http.error(\"UNAUTHORIZED\")\n\n\t\tconst updateResult = await this.update({ order_id: data.order_id, payment_status: data.status, transaction_id: data.transaction_id })\n\t\tif (updateResult.error) return this.kizlo._.http.error(updateResult.error)\n\n\t\treturn this.kizlo._.http.success({ success: true })\n\t}\n}\n\nexport const paymentRouter = {\n\tmethods: woocommerceProcedure\n\t\t.output(type<PaymentMethod[]>())\n\t\t.errors(procedureErrors<ListPaymentMethodErrorCode>())\n\t\t.handler(async ({ context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.payment.methods())\n\t\t}),\n\n\tpay: woocommerceProcedure\n\t\t.input(type<PayPaymentInput>())\n\t\t.output(type<PayPaymentData>())\n\t\t.errors(procedureErrors<PayPaymentErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.payment.pay(input))\n\t\t}),\n}\n\nexport function createPaymentServerRouter(options?: WooCommerceServerExtensionOptions) {\n\treturn {\n\t\tconfirm: woocommerceProcedure\n\t\t\t.input(type<ConfirmPaymentInput>())\n\t\t\t.output(type<Order>())\n\t\t\t.errors(procedureErrors<ConfirmPaymentErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.payment.admin.confirm(input))\n\t\t\t}),\n\n\t\tupdate: woocommerceProcedure\n\t\t\t.input(type<UpdatePaymentInput>())\n\t\t\t.output(type<Order>())\n\t\t\t.errors(procedureErrors<UpdatePaymentErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.payment.admin.update(input))\n\t\t\t}),\n\n\t\tmethods: woocommerceRemoteProcedure\n\t\t\t.route({ method: \"GET\" })\n\t\t\t.output(type<PaymentMethod[]>())\n\t\t\t.errors(procedureErrors<ListPaymentMethodErrorCode>())\n\t\t\t.handler(async ({ context }) => {\n\t\t\t\treturn ensureProcedureResult(\n\t\t\t\t\tawait context.woocommerce.payment.admin.methods({\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tadapters: options?.paymentAdapters ?? [],\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t}),\n\n\t\tpay: woocommerceRemoteProcedure\n\t\t\t.input(type<PayPaymentInput>())\n\t\t\t.output(type<PayPaymentData>())\n\t\t\t.errors(procedureErrors<PayPaymentErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(\n\t\t\t\t\tawait context.woocommerce.payment.admin.pay({\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tadapters: options?.paymentAdapters ?? [],\n\t\t\t\t\t\tpayment_method_id: input.payment_method_id,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t}),\n\n\t\twebhooks: woocommerceOpenApiProcedure\n\t\t\t.route({ method: \"POST\", path: \"/payment/webhooks/{id}\", inputStructure: \"detailed\" })\n\t\t\t.input(type<{ params: { id: string } }>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(\n\t\t\t\t\tcontext.woocommerce.payment.admin.handleWebhook({\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tpayment_method_id: input.params.id,\n\t\t\t\t\t\tadapters: options?.paymentAdapters ?? [],\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t}),\n\t}\n}\n\nexport type PaymentClientRouter = typeof paymentRouter\n\nexport type PaymentServerRouter = ReturnType<typeof createPaymentServerRouter>\n","import type { Product } from \"@kizlo/contract\"\nimport { ensureProcedureResult, type Kizlo, type } from \"kizlo\"\nimport { procedureErrors } from \"kizlo/extensions\"\nimport { woocommerceProcedure } from \"../client.extension\"\nimport type {\n\tCategoryList,\n\tCollection,\n\tCreateReviewErrorCode,\n\tCreateReviewInput,\n\tCreateReviewResult,\n\tListCategoryErrorCode,\n\tListCategoryInput,\n\tListCategoryResult,\n\tListProductErrorCode,\n\tListProductInput,\n\tListProductResult,\n\tListReviewErrorCode,\n\tListReviewInput,\n\tListReviewResult,\n\tProductList,\n\tRetrieveCollectionErrorCode,\n\tRetrieveCollectionInput,\n\tRetrieveCollectionResult,\n\tRetrieveProductErrorCode,\n\tRetrieveProductInput,\n\tRetrieveProductResult,\n\tRetrieveReviewErrorCode,\n\tRetrieveReviewInput,\n\tRetrieveReviewResult,\n\tReview,\n\tReviewList,\n} from \"./types\"\n\nexport class KizloProductCategory {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async list(input?: ListCategoryInput): Promise<ListCategoryResult> {\n\t\tconst response = await this.kizlo._.http.get<CategoryList, ListCategoryErrorCode>(\"/products/categories\", {\n\t\t\tquery: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n}\n\nexport class KizloProductReview {\n\tconstructor(private readonly kizlo: Kizlo) {}\n\n\tpublic async retrieve(input: RetrieveReviewInput): Promise<RetrieveReviewResult> {\n\t\tconst response = await this.kizlo._.http.get<Review, RetrieveReviewErrorCode>(`/products/reviews/${input.id}`, {\n\t\t\tquery: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n\n\tpublic async list(input?: ListReviewInput): Promise<ListReviewResult> {\n\t\tconst response = await this.kizlo._.http.get<ReviewList, ListReviewErrorCode>(\"/products/reviews\", {\n\t\t\tquery: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n\n\tpublic async create(input: CreateReviewInput): Promise<CreateReviewResult> {\n\t\treturn this.kizlo.auth.session.ensure(async ({ headers }) => {\n\t\t\tconst response = await this.kizlo._.http.post<Review, CreateReviewErrorCode>(\"/products/reviews\", {\n\t\t\t\theaders,\n\t\t\t\tbody: input,\n\t\t\t})\n\t\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\t\treturn this.kizlo._.http.success(response.data)\n\t\t})\n\t}\n}\n\nexport class KizloProduct {\n\tpublic readonly reviews: KizloProductReview\n\tpublic readonly categories: KizloProductCategory\n\n\tconstructor(private readonly kizlo: Kizlo) {\n\t\tthis.reviews = new KizloProductReview(this.kizlo)\n\t\tthis.categories = new KizloProductCategory(this.kizlo)\n\t}\n\n\tpublic async retrieve(input: RetrieveProductInput): Promise<RetrieveProductResult> {\n\t\tconst response = await this.kizlo._.http.get<Product, RetrieveProductErrorCode>(`/products/${input.slug}`, {\n\t\t\tquery: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n\n\tpublic async list(input?: ListProductInput): Promise<ListProductResult> {\n\t\tconst response = await this.kizlo._.http.get<ProductList, ListProductErrorCode>(\"/products\", {\n\t\t\tquery: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n\n\tpublic async collection(input?: RetrieveCollectionInput): Promise<RetrieveCollectionResult> {\n\t\tconst response = await this.kizlo._.http.get<Collection, RetrieveCollectionErrorCode>(\"/products/collection\", {\n\t\t\tquery: input,\n\t\t})\n\t\tif (response.error) return this.kizlo._.http.error(response.error)\n\t\treturn this.kizlo._.http.success(response.data)\n\t}\n}\n\nexport const products = {\n\tretrieve: woocommerceProcedure\n\t\t.input(type<RetrieveProductInput>())\n\t\t.output(type<Product>())\n\t\t.errors(procedureErrors<RetrieveProductErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.products.retrieve(input))\n\t\t}),\n\n\tlist: woocommerceProcedure\n\t\t.input(type<ListProductInput | undefined>())\n\t\t.output(type<ProductList>())\n\t\t.errors(procedureErrors<ListProductErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.products.list(input))\n\t\t}),\n\n\tcollection: woocommerceProcedure\n\t\t.input(type<RetrieveCollectionInput | undefined>())\n\t\t.output(type<Collection>())\n\t\t.errors(procedureErrors<RetrieveCollectionErrorCode>())\n\t\t.handler(async ({ input, context }) => {\n\t\t\treturn ensureProcedureResult(await context.woocommerce.products.collection(input))\n\t\t}),\n\n\tcategories: {\n\t\tlist: woocommerceProcedure\n\t\t\t.input(type<ListCategoryInput | undefined>())\n\t\t\t.output(type<CategoryList>())\n\t\t\t.errors(procedureErrors<ListCategoryErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.products.categories.list(input))\n\t\t\t}),\n\t},\n\n\treviews: {\n\t\tretrieve: woocommerceProcedure\n\t\t\t.input(type<RetrieveReviewInput>())\n\t\t\t.output(type<Review>())\n\t\t\t.errors(procedureErrors<RetrieveReviewErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.products.reviews.retrieve(input))\n\t\t\t}),\n\n\t\tlist: woocommerceProcedure\n\t\t\t.input(type<ListReviewInput | undefined>())\n\t\t\t.output(type<ReviewList>())\n\t\t\t.errors(procedureErrors<ListReviewErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.products.reviews.list(input))\n\t\t\t}),\n\n\t\tcreate: woocommerceProcedure\n\t\t\t.input(type<CreateReviewInput>())\n\t\t\t.output(type<Review>())\n\t\t\t.errors(procedureErrors<CreateReviewErrorCode>())\n\t\t\t.handler(async ({ input, context }) => {\n\t\t\t\treturn ensureProcedureResult(await context.woocommerce.products.reviews.create(input))\n\t\t\t}),\n\t},\n}\n","import type { Kizlo } from \"kizlo\"\nimport { cart, KizloCart } from \"./cart/client\"\nimport { customer, KizloCustomer } from \"./customer/client\"\nimport { KizloOrder, orders } from \"./order/client\"\nimport { KizloPayment, paymentRouter } from \"./payment/client\"\nimport { KizloProduct, products } from \"./product/client\"\n\nexport class KizloWoocommerce {\n\tpublic readonly cart: KizloCart\n\tpublic readonly orders: KizloOrder\n\tpublic readonly customer: KizloCustomer\n\tpublic readonly products: KizloProduct\n\tpublic readonly payment: KizloPayment\n\n\tconstructor(private readonly kizlo: Kizlo) {\n\t\tthis.cart = new KizloCart(this.kizlo)\n\t\tthis.orders = new KizloOrder(this.kizlo)\n\t\tthis.customer = new KizloCustomer(this.kizlo)\n\t\tthis.products = new KizloProduct(this.kizlo)\n\t\tthis.payment = new KizloPayment(this.kizlo)\n\t}\n}\n\nexport const woocommerceRouter = {\n\tcart,\n\torders,\n\tcustomer,\n\tproducts,\n\tpayment: paymentRouter,\n}\nexport type WooCommerceRouter = typeof woocommerceRouter\n"],"mappings":";;;;AAQA,MAAa,uBAAuB,UAAU,IAC7C,UAAU,YAAY,EAAE,SAAS,WAAW;AAE3C,QAAO,KAAK,EAAE,SAAS,EAAE,aADL,IAAI,iBAAiB,QAAQ,MAAM,EACjB,EAAE,CAAC;EACxC,CACF;AAID,SAAgBA,gBAA0C;AACzD,QAAO,sBAAsB;EAC5B,MAAM;EACN,MAAM;EACN,OAAO;AACN,UAAO;;EAER,CAAC;;;;;ACGH,IAAa,gBAAb,MAA2B;CAC1B,YAAY,AAAiBC,OAAc;EAAd;;CAE7B,MAAa,IAAI,OAAqD;AACrE,SAAO,KAAK,MAAM,KAAK,QAAQ,OAAO,OAAO,EAAE,cAAc;GAC5D,MAAM,WAAW,MAAM,KAAK,MAAM,EAAE,KAAK,KAAiC,eAAe;IACxF,MAAM;IACN;IACA,CAAC;AACF,OAAI,SAAS,MAAO,QAAO,KAAK,MAAM,EAAE,KAAK,MAAM,SAAS,MAAM;AAClE,UAAO,KAAK,MAAM,EAAE,KAAK,QAAQ,SAAS,KAAK;IAC9C;;CAGH,MAAa,OAAO,OAA2D;AAC9E,SAAO,KAAK,MAAM,KAAK,QAAQ,OAAO,OAAO,EAAE,cAAc;G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