@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
369 lines • 13.4 kB
TypeScript
import type { CustomersClient } from '../client';
import type { CustomerCustomerIdContactsCreateParams, CustomerCustomerIdContactsListParams, CustomerCustomerIdAddressParams, CustomerCustomerIdShipToListParams, CustomerCustomerIdShipToCreateParams, CustomerCustomerIdOrdersParams, CustomerCustomerIdInvoicesParams, CustomerCustomerIdQuotesParams, CustomerCustomerIdPurchasedItemsParams } from '../schemas';
type ExecuteRequest = CustomersClient['executeRequest'];
/**
* Creates the customer resource methods
* OpenAPI Path: /customer/{customerId} → customer(customerId).*
* @description Customer-specific operations and nested resources
*/
export declare function createCustomerResource(executeRequest: ExecuteRequest): (customerId: number) => {
/**
* Direct customer endpoint - OpenAPI Path: /customer/{customerId} (GET)
* @fullPath api.customers.customer.get
* @description Returns the customer by ID
* @service customers
* @domain customer-management
* @dataMethod customerData.get
* @discoverable true
*/
get: () => Promise<{
params: Record<string, unknown> | unknown[];
data: {
customerId: number;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Customer document endpoint - OpenAPI Path: /customer/{customerId}/doc (GET)
* @fullPath api.customers.customer.doc
* @description Returns full customer document including addresses, contacts, and ship-to addresses
* @service customers
* @domain customer-management
* @dataMethod customerData.doc.get
* @discoverable true
*/
doc: {
get: () => Promise<{
params: Record<string, unknown> | unknown[];
data: {
customerId: number;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer address endpoint - OpenAPI Path: /customer/{customerId}/address (GET)
* @fullPath api.customers.customer.address
* @service customers
* @domain customer-management
* @dataMethod customerData.address.get
* @discoverable true
*/
address: {
get: (params: CustomerCustomerIdAddressParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
addressId: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer contacts endpoint - OpenAPI Path: /customer/{customerId}/contacts
* @fullPath api.customers.customer.contacts
* @service customers
* @domain contact-management
* @dataMethod customerData.contacts.list, customerData.contacts.create
* @discoverable true
*/
contacts: {
list: (params: CustomerCustomerIdContactsListParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
id: import("zod").ZodString;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
create: (data: CustomerCustomerIdContactsCreateParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: {
id: string;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer ship-to endpoint - OpenAPI Path: /customer/{customerId}/ship-to
* @fullPath api.customers.customer.shipTo
* @service customers
* @domain customer-management
* @dataMethod customerData.shipTo.list, customerData.shipTo.create
* @discoverable true
*/
shipTo: {
list: (params?: CustomerCustomerIdShipToListParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
shipToId: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
create: (data: CustomerCustomerIdShipToCreateParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: {
shipToId: number;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer orders endpoint - OpenAPI Path: /customer/{customerId}/orders
* @fullPath api.customers.customer.orders
* @service customers
* @domain order-management
* @dataMethod customerData.orders.get (factory), customerData.orders.list
* @discoverable true
*/
orders: ((orderNo: number) => {
get: () => Promise<{
params: Record<string, unknown> | unknown[];
data: {
orderNo: number;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
}) & {
list: (params?: CustomerCustomerIdOrdersParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
orderNo: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer invoices endpoint - OpenAPI Path: /customer/{customerId}/invoices
* @fullPath api.customers.customer.invoices
* @service customers
* @domain invoice-management
* @dataMethod customerData.invoices.get (factory), customerData.invoices.list
* @discoverable true
*/
invoices: ((invoiceNo: number) => {
get: () => Promise<{
params: Record<string, unknown> | unknown[];
data: {
invoiceNo: number;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
}) & {
list: (params: CustomerCustomerIdInvoicesParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
invoiceNo: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer quotes endpoint - OpenAPI Path: /customer/{customerId}/quotes
* @fullPath api.customers.customer.quotes
* @service customers
* @domain quote-management
* @dataMethod customerData.quotes.get (factory), customerData.quotes.list
* @discoverable true
*/
quotes: ((quoteNo: number) => {
get: () => Promise<{
params: Record<string, unknown> | unknown[];
data: {
quoteNo: number;
} & {
[k: string]: unknown;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
}) & {
list: (params?: CustomerCustomerIdQuotesParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
quoteNo: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Customer purchased items endpoint - OpenAPI Path: /customer/{customerId}/purchased-items
* @fullPath api.customers.customer.purchasedItems
* @service customers
* @domain purchase-history
* @dataMethod customerData.purchasedItems.list
* @discoverable true
*/
purchasedItems: {
list: (params?: CustomerCustomerIdPurchasedItemsParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: import("zod").objectInputType<{
itemNo: import("zod").ZodString;
}, import("zod").ZodTypeAny, "passthrough">[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
};
/**
* Creates the customerData resource methods (data-only versions)
*/
export declare function createCustomerDataResource(customer: ReturnType<typeof createCustomerResource>): (customerId: number) => {
get: () => Promise<{
customerId: number;
} & {
[k: string]: unknown;
}>;
doc: {
get: () => Promise<{
customerId: number;
} & {
[k: string]: unknown;
}>;
};
address: {
get: (params: CustomerCustomerIdAddressParams) => Promise<import("zod").objectInputType<{
addressId: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[]>;
};
contacts: {
list: (params: CustomerCustomerIdContactsListParams) => Promise<import("zod").objectInputType<{
id: import("zod").ZodString;
}, import("zod").ZodTypeAny, "passthrough">[]>;
create: (data: CustomerCustomerIdContactsCreateParams) => Promise<{
id: string;
} & {
[k: string]: unknown;
}>;
};
shipTo: {
list: (params?: CustomerCustomerIdShipToListParams) => Promise<import("zod").objectInputType<{
shipToId: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[]>;
create: (data: CustomerCustomerIdShipToCreateParams) => Promise<{
shipToId: number;
} & {
[k: string]: unknown;
}>;
};
orders: ((orderNo: number) => {
get: () => Promise<{
orderNo: number;
} & {
[k: string]: unknown;
}>;
}) & {
list: (params?: CustomerCustomerIdOrdersParams) => Promise<import("zod").objectInputType<{
orderNo: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[]>;
};
invoices: ((invoiceNo: number) => {
get: () => Promise<{
invoiceNo: number;
} & {
[k: string]: unknown;
}>;
}) & {
list: (params: CustomerCustomerIdInvoicesParams) => Promise<import("zod").objectInputType<{
invoiceNo: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[]>;
};
quotes: ((quoteNo: number) => {
get: () => Promise<{
quoteNo: number;
} & {
[k: string]: unknown;
}>;
}) & {
list: (params?: CustomerCustomerIdQuotesParams) => Promise<import("zod").objectInputType<{
quoteNo: import("zod").ZodNumber;
}, import("zod").ZodTypeAny, "passthrough">[]>;
};
purchasedItems: {
list: (params?: CustomerCustomerIdPurchasedItemsParams) => Promise<import("zod").objectInputType<{
itemNo: import("zod").ZodString;
}, import("zod").ZodTypeAny, "passthrough">[]>;
};
};
export type CustomerResource = ReturnType<typeof createCustomerResource>;
export type CustomerDataResource = ReturnType<typeof createCustomerDataResource>;
export {};
//# sourceMappingURL=customer.d.ts.map