@arascreative/erp-client 3.2.0 → 3.4.0

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.
@@ -968,6 +968,167 @@ export type CreateBatch409 = {
968
968
  instance?: string;
969
969
  errors?: CreateBatch409Errors;
970
970
  };
971
+ export type CreateProductBodyCatalogVariantsItemAttributesItem = {
972
+ name: string;
973
+ value: string;
974
+ };
975
+ export type CreateProductBodyCatalogVariantsItemSourcesItem = {
976
+ warehouseId: string;
977
+ masterItemId: string;
978
+ quantityPerUnit: number;
979
+ };
980
+ export type CreateProductBodyCatalogVariantsItemWeightAnyOf = {
981
+ value: number;
982
+ unit: string;
983
+ };
984
+ export type CreateProductBodyCatalogVariantsItemWeight = CreateProductBodyCatalogVariantsItemWeightAnyOf | null;
985
+ export type CreateProductBodyCatalogVariantsItemPricingSaleAnyOf = {
986
+ amount: number;
987
+ currency: string;
988
+ startAt: string;
989
+ endAt: string;
990
+ };
991
+ export type CreateProductBodyCatalogVariantsItemPricingSale = CreateProductBodyCatalogVariantsItemPricingSaleAnyOf | null;
992
+ export type CreateProductBodyCatalogVariantsItemPricingWholesaleItem = {
993
+ minQty: number;
994
+ amount: number;
995
+ currency: string;
996
+ };
997
+ export type CreateProductBodyCatalogVariantsItemPricing = {
998
+ baseAmount: number;
999
+ baseCurrency: string;
1000
+ sale?: CreateProductBodyCatalogVariantsItemPricingSale;
1001
+ wholesale: CreateProductBodyCatalogVariantsItemPricingWholesaleItem[];
1002
+ };
1003
+ export type CreateProductBodyCatalogVariantsItem = {
1004
+ code: string;
1005
+ attributes: CreateProductBodyCatalogVariantsItemAttributesItem[];
1006
+ sources: CreateProductBodyCatalogVariantsItemSourcesItem[];
1007
+ weight?: CreateProductBodyCatalogVariantsItemWeight;
1008
+ pricing: CreateProductBodyCatalogVariantsItemPricing;
1009
+ };
1010
+ export type CreateProductBodyCatalogImagesItem = {
1011
+ fileId: string;
1012
+ sortOrder: number;
1013
+ };
1014
+ export type CreateProductBodyCatalog = {
1015
+ categoryId: string;
1016
+ name: string;
1017
+ slug: string;
1018
+ classification: string;
1019
+ variants: CreateProductBodyCatalogVariantsItem[];
1020
+ images: CreateProductBodyCatalogImagesItem[];
1021
+ };
1022
+ export type CreateProductBodyShippingServicesItem = {
1023
+ code: string;
1024
+ enabled: boolean;
1025
+ couriers: string[];
1026
+ };
1027
+ export type CreateProductBodyShippingDiscount = unknown | null;
1028
+ export type CreateProductBodyShippingDisplay = {
1029
+ mergeExtraFee: boolean;
1030
+ showOriginalPrice: boolean;
1031
+ hideCouriers: boolean;
1032
+ hideOrigin: boolean;
1033
+ };
1034
+ export type CreateProductBodyShippingCoverageCheck = {
1035
+ enabled: boolean;
1036
+ onUncovered: string;
1037
+ };
1038
+ export type CreateProductBodyShipping = {
1039
+ mode: string;
1040
+ flatAmount: number;
1041
+ useStoreDefaults: boolean;
1042
+ services: CreateProductBodyShippingServicesItem[];
1043
+ extraFee: number;
1044
+ discount?: CreateProductBodyShippingDiscount;
1045
+ display: CreateProductBodyShippingDisplay;
1046
+ coverageCheck: CreateProductBodyShippingCoverageCheck;
1047
+ };
1048
+ export type CreateProductBodyPaymentsTax = {
1049
+ enabled: boolean;
1050
+ ratePercent: number;
1051
+ priceIncludesTax: boolean;
1052
+ };
1053
+ export type CreateProductBodyPayments = {
1054
+ useStoreDefaults: boolean;
1055
+ methods: unknown[];
1056
+ tax: CreateProductBodyPaymentsTax;
1057
+ };
1058
+ export type CreateProductBodyAssignmentMembersItem = {
1059
+ userId: string;
1060
+ value: number;
1061
+ };
1062
+ export type CreateProductBodyAssignment = {
1063
+ distribution: string;
1064
+ members: CreateProductBodyAssignmentMembersItem[];
1065
+ };
1066
+ export type CreateProductBody = {
1067
+ requestedStatus: string;
1068
+ catalog: CreateProductBodyCatalog;
1069
+ shipping: CreateProductBodyShipping;
1070
+ payments: CreateProductBodyPayments;
1071
+ assignment: CreateProductBodyAssignment;
1072
+ };
1073
+ export type CreateProduct201 = {
1074
+ id: string;
1075
+ };
1076
+ export type CreateProduct400Errors = {
1077
+ [key: string]: string[];
1078
+ };
1079
+ export type CreateProduct400 = {
1080
+ type: string;
1081
+ title: string;
1082
+ status: number;
1083
+ detail?: string;
1084
+ instance?: string;
1085
+ errors?: CreateProduct400Errors;
1086
+ };
1087
+ export type CreateProduct501Errors = {
1088
+ [key: string]: string[];
1089
+ };
1090
+ export type CreateProduct501 = {
1091
+ type: string;
1092
+ title: string;
1093
+ status: number;
1094
+ detail?: string;
1095
+ instance?: string;
1096
+ errors?: CreateProduct501Errors;
1097
+ };
1098
+ export type ListProducts200ItemPrimaryImageUrl = string | null;
1099
+ export type ListProducts200Item = {
1100
+ id: string;
1101
+ name: string;
1102
+ primaryImageUrl: ListProducts200ItemPrimaryImageUrl;
1103
+ price: number;
1104
+ availableStock: number;
1105
+ totalOrders: number;
1106
+ totalClosedOrders: number;
1107
+ closedRatioPct: number;
1108
+ totalCompletedOrder: number;
1109
+ netRevenue: number;
1110
+ };
1111
+ export type ListProducts501Errors = {
1112
+ [key: string]: string[];
1113
+ };
1114
+ export type ListProducts501 = {
1115
+ type: string;
1116
+ title: string;
1117
+ status: number;
1118
+ detail?: string;
1119
+ instance?: string;
1120
+ errors?: ListProducts501Errors;
1121
+ };
1122
+ export type ListCouriers200Item = {
1123
+ code: string;
1124
+ name: string;
1125
+ services: string[];
1126
+ };
1127
+ export type ListBankCodes200ItemName = string | null;
1128
+ export type ListBankCodes200Item = {
1129
+ code: string;
1130
+ name: ListBankCodes200ItemName;
1131
+ };
971
1132
  export type GetHealth200 = {
972
1133
  status: string;
973
1134
  timestamp: string;
@@ -2278,6 +2439,221 @@ export declare const useCreateBatch: <TError = CreateBatch400 | CreateBatch404 |
2278
2439
  }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createBatch>>, TError, {
2279
2440
  data: CreateBatchBody;
2280
2441
  }, TContext>;
2442
+ /**
2443
+ * Product setup contract covering catalog, shipping, payments, and assignment. Valid requestedStatus values: Tes, Live, Archived. Valid catalog.classification values: Physical, Digital. Not implemented yet.
2444
+ * @summary Create a product
2445
+ */
2446
+ export type createProductResponse201 = {
2447
+ data: CreateProduct201;
2448
+ status: 201;
2449
+ };
2450
+ export type createProductResponse400 = {
2451
+ data: CreateProduct400;
2452
+ status: 400;
2453
+ };
2454
+ export type createProductResponse501 = {
2455
+ data: CreateProduct501;
2456
+ status: 501;
2457
+ };
2458
+ export type createProductResponseSuccess = (createProductResponse201) & {
2459
+ headers: Headers;
2460
+ };
2461
+ export type createProductResponseError = (createProductResponse400 | createProductResponse501) & {
2462
+ headers: Headers;
2463
+ };
2464
+ export type createProductResponse = (createProductResponseSuccess | createProductResponseError);
2465
+ export declare const getCreateProductUrl: () => string;
2466
+ export declare const createProduct: (createProductBody: CreateProductBody, options?: RequestInit) => Promise<createProductResponse>;
2467
+ export declare const getCreateProductMutationOptions: <TError = CreateProduct400 | CreateProduct501, TContext = unknown>(options?: {
2468
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createProduct>>, TError, {
2469
+ data: CreateProductBody;
2470
+ }, TContext>;
2471
+ fetch?: RequestInit;
2472
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createProduct>>, TError, {
2473
+ data: CreateProductBody;
2474
+ }, TContext>;
2475
+ export type CreateProductMutationResult = NonNullable<Awaited<ReturnType<typeof createProduct>>>;
2476
+ export type CreateProductMutationBody = CreateProductBody;
2477
+ export type CreateProductMutationError = CreateProduct400 | CreateProduct501;
2478
+ /**
2479
+ * @summary Create a product
2480
+ */
2481
+ export declare const useCreateProduct: <TError = CreateProduct400 | CreateProduct501, TContext = unknown>(options?: {
2482
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createProduct>>, TError, {
2483
+ data: CreateProductBody;
2484
+ }, TContext>;
2485
+ fetch?: RequestInit;
2486
+ }, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createProduct>>, TError, {
2487
+ data: CreateProductBody;
2488
+ }, TContext>;
2489
+ /**
2490
+ * Product list contract with stock, order, and revenue metrics. Not implemented yet.
2491
+ * @summary List products
2492
+ */
2493
+ export type listProductsResponse200 = {
2494
+ data: ListProducts200Item[];
2495
+ status: 200;
2496
+ };
2497
+ export type listProductsResponse501 = {
2498
+ data: ListProducts501;
2499
+ status: 501;
2500
+ };
2501
+ export type listProductsResponseSuccess = (listProductsResponse200) & {
2502
+ headers: Headers;
2503
+ };
2504
+ export type listProductsResponseError = (listProductsResponse501) & {
2505
+ headers: Headers;
2506
+ };
2507
+ export type listProductsResponse = (listProductsResponseSuccess | listProductsResponseError);
2508
+ export declare const getListProductsUrl: () => string;
2509
+ export declare const listProducts: (options?: RequestInit) => Promise<listProductsResponse>;
2510
+ export declare const getListProductsQueryKey: () => readonly ["/api/v1/products"];
2511
+ export declare const getListProductsQueryOptions: <TData = Awaited<ReturnType<typeof listProducts>>, TError = ListProducts501>(options?: {
2512
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listProducts>>, TError, TData>>;
2513
+ fetch?: RequestInit;
2514
+ }) => UseQueryOptions<Awaited<ReturnType<typeof listProducts>>, TError, TData> & {
2515
+ queryKey: DataTag<QueryKey, TData, TError>;
2516
+ };
2517
+ export type ListProductsQueryResult = NonNullable<Awaited<ReturnType<typeof listProducts>>>;
2518
+ export type ListProductsQueryError = ListProducts501;
2519
+ export declare function useListProducts<TData = Awaited<ReturnType<typeof listProducts>>, TError = ListProducts501>(options: {
2520
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listProducts>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listProducts>>, TError, Awaited<ReturnType<typeof listProducts>>>, 'initialData'>;
2521
+ fetch?: RequestInit;
2522
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
2523
+ queryKey: DataTag<QueryKey, TData, TError>;
2524
+ };
2525
+ export declare function useListProducts<TData = Awaited<ReturnType<typeof listProducts>>, TError = ListProducts501>(options?: {
2526
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listProducts>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listProducts>>, TError, Awaited<ReturnType<typeof listProducts>>>, 'initialData'>;
2527
+ fetch?: RequestInit;
2528
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2529
+ queryKey: DataTag<QueryKey, TData, TError>;
2530
+ };
2531
+ export declare function useListProducts<TData = Awaited<ReturnType<typeof listProducts>>, TError = ListProducts501>(options?: {
2532
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listProducts>>, TError, TData>>;
2533
+ fetch?: RequestInit;
2534
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2535
+ queryKey: DataTag<QueryKey, TData, TError>;
2536
+ };
2537
+ /**
2538
+ * @summary List supported couriers and their services
2539
+ */
2540
+ export type listCouriersResponse200 = {
2541
+ data: ListCouriers200Item[];
2542
+ status: 200;
2543
+ };
2544
+ export type listCouriersResponseSuccess = (listCouriersResponse200) & {
2545
+ headers: Headers;
2546
+ };
2547
+ export type listCouriersResponse = (listCouriersResponseSuccess);
2548
+ export declare const getListCouriersUrl: () => string;
2549
+ export declare const listCouriers: (options?: RequestInit) => Promise<listCouriersResponse>;
2550
+ export declare const getListCouriersQueryKey: () => readonly ["/api/v1/couriers"];
2551
+ export declare const getListCouriersQueryOptions: <TData = Awaited<ReturnType<typeof listCouriers>>, TError = unknown>(options?: {
2552
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listCouriers>>, TError, TData>>;
2553
+ fetch?: RequestInit;
2554
+ }) => UseQueryOptions<Awaited<ReturnType<typeof listCouriers>>, TError, TData> & {
2555
+ queryKey: DataTag<QueryKey, TData, TError>;
2556
+ };
2557
+ export type ListCouriersQueryResult = NonNullable<Awaited<ReturnType<typeof listCouriers>>>;
2558
+ export type ListCouriersQueryError = unknown;
2559
+ export declare function useListCouriers<TData = Awaited<ReturnType<typeof listCouriers>>, TError = unknown>(options: {
2560
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listCouriers>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listCouriers>>, TError, Awaited<ReturnType<typeof listCouriers>>>, 'initialData'>;
2561
+ fetch?: RequestInit;
2562
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
2563
+ queryKey: DataTag<QueryKey, TData, TError>;
2564
+ };
2565
+ export declare function useListCouriers<TData = Awaited<ReturnType<typeof listCouriers>>, TError = unknown>(options?: {
2566
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listCouriers>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listCouriers>>, TError, Awaited<ReturnType<typeof listCouriers>>>, 'initialData'>;
2567
+ fetch?: RequestInit;
2568
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2569
+ queryKey: DataTag<QueryKey, TData, TError>;
2570
+ };
2571
+ export declare function useListCouriers<TData = Awaited<ReturnType<typeof listCouriers>>, TError = unknown>(options?: {
2572
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listCouriers>>, TError, TData>>;
2573
+ fetch?: RequestInit;
2574
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2575
+ queryKey: DataTag<QueryKey, TData, TError>;
2576
+ };
2577
+ /**
2578
+ * @summary List supported bank codes and names
2579
+ */
2580
+ export type listBankCodesResponse200 = {
2581
+ data: ListBankCodes200Item[];
2582
+ status: 200;
2583
+ };
2584
+ export type listBankCodesResponseSuccess = (listBankCodesResponse200) & {
2585
+ headers: Headers;
2586
+ };
2587
+ export type listBankCodesResponse = (listBankCodesResponseSuccess);
2588
+ export declare const getListBankCodesUrl: () => string;
2589
+ export declare const listBankCodes: (options?: RequestInit) => Promise<listBankCodesResponse>;
2590
+ export declare const getListBankCodesQueryKey: () => readonly ["/api/v1/banks"];
2591
+ export declare const getListBankCodesQueryOptions: <TData = Awaited<ReturnType<typeof listBankCodes>>, TError = unknown>(options?: {
2592
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, TData>>;
2593
+ fetch?: RequestInit;
2594
+ }) => UseQueryOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, TData> & {
2595
+ queryKey: DataTag<QueryKey, TData, TError>;
2596
+ };
2597
+ export type ListBankCodesQueryResult = NonNullable<Awaited<ReturnType<typeof listBankCodes>>>;
2598
+ export type ListBankCodesQueryError = unknown;
2599
+ export declare function useListBankCodes<TData = Awaited<ReturnType<typeof listBankCodes>>, TError = unknown>(options: {
2600
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, Awaited<ReturnType<typeof listBankCodes>>>, 'initialData'>;
2601
+ fetch?: RequestInit;
2602
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
2603
+ queryKey: DataTag<QueryKey, TData, TError>;
2604
+ };
2605
+ export declare function useListBankCodes<TData = Awaited<ReturnType<typeof listBankCodes>>, TError = unknown>(options?: {
2606
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, Awaited<ReturnType<typeof listBankCodes>>>, 'initialData'>;
2607
+ fetch?: RequestInit;
2608
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2609
+ queryKey: DataTag<QueryKey, TData, TError>;
2610
+ };
2611
+ export declare function useListBankCodes<TData = Awaited<ReturnType<typeof listBankCodes>>, TError = unknown>(options?: {
2612
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listBankCodes>>, TError, TData>>;
2613
+ fetch?: RequestInit;
2614
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2615
+ queryKey: DataTag<QueryKey, TData, TError>;
2616
+ };
2617
+ /**
2618
+ * @summary List supported payment channel codes
2619
+ */
2620
+ export type listPaymentChannelsResponse200 = {
2621
+ data: string[];
2622
+ status: 200;
2623
+ };
2624
+ export type listPaymentChannelsResponseSuccess = (listPaymentChannelsResponse200) & {
2625
+ headers: Headers;
2626
+ };
2627
+ export type listPaymentChannelsResponse = (listPaymentChannelsResponseSuccess);
2628
+ export declare const getListPaymentChannelsUrl: () => string;
2629
+ export declare const listPaymentChannels: (options?: RequestInit) => Promise<listPaymentChannelsResponse>;
2630
+ export declare const getListPaymentChannelsQueryKey: () => readonly ["/api/v1/payment-channels"];
2631
+ export declare const getListPaymentChannelsQueryOptions: <TData = Awaited<ReturnType<typeof listPaymentChannels>>, TError = unknown>(options?: {
2632
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, TData>>;
2633
+ fetch?: RequestInit;
2634
+ }) => UseQueryOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, TData> & {
2635
+ queryKey: DataTag<QueryKey, TData, TError>;
2636
+ };
2637
+ export type ListPaymentChannelsQueryResult = NonNullable<Awaited<ReturnType<typeof listPaymentChannels>>>;
2638
+ export type ListPaymentChannelsQueryError = unknown;
2639
+ export declare function useListPaymentChannels<TData = Awaited<ReturnType<typeof listPaymentChannels>>, TError = unknown>(options: {
2640
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, Awaited<ReturnType<typeof listPaymentChannels>>>, 'initialData'>;
2641
+ fetch?: RequestInit;
2642
+ }, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
2643
+ queryKey: DataTag<QueryKey, TData, TError>;
2644
+ };
2645
+ export declare function useListPaymentChannels<TData = Awaited<ReturnType<typeof listPaymentChannels>>, TError = unknown>(options?: {
2646
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, Awaited<ReturnType<typeof listPaymentChannels>>>, 'initialData'>;
2647
+ fetch?: RequestInit;
2648
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2649
+ queryKey: DataTag<QueryKey, TData, TError>;
2650
+ };
2651
+ export declare function useListPaymentChannels<TData = Awaited<ReturnType<typeof listPaymentChannels>>, TError = unknown>(options?: {
2652
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof listPaymentChannels>>, TError, TData>>;
2653
+ fetch?: RequestInit;
2654
+ }, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
2655
+ queryKey: DataTag<QueryKey, TData, TError>;
2656
+ };
2281
2657
  /**
2282
2658
  * @summary Health check
2283
2659
  */