@deliverart/sdk-js-customer 0.1.0 → 1.1.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.
Files changed (36) hide show
  1. package/package.json +12 -26
  2. package/.changeset/config.json +0 -11
  3. package/.github/workflows/workflow.yml +0 -47
  4. package/.prettierrc +0 -7
  5. package/CHANGELOG.md +0 -67
  6. package/README.md +0 -3
  7. package/dist/index.cjs +0 -722
  8. package/dist/index.d.cts +0 -4587
  9. package/dist/index.d.ts +0 -4587
  10. package/dist/index.js +0 -641
  11. package/eslint.config.js +0 -41
  12. package/src/index.ts +0 -3
  13. package/src/models.ts +0 -131
  14. package/src/requests/customer-addresses/CreateCustomerAddress.ts +0 -32
  15. package/src/requests/customer-addresses/DeleteCustomerAddress.ts +0 -30
  16. package/src/requests/customer-addresses/GetCustomerAddressDetails.ts +0 -36
  17. package/src/requests/customer-addresses/GetCustomerAddresses.ts +0 -58
  18. package/src/requests/customer-addresses/GetCustomerAddressesForCustomer.ts +0 -58
  19. package/src/requests/customer-addresses/UpdateCustomerAddress.ts +0 -35
  20. package/src/requests/customer-addresses/index.ts +0 -6
  21. package/src/requests/customer-business-profiles/CreateCustomerBusinessProfile.ts +0 -40
  22. package/src/requests/customer-business-profiles/DeleteCustomerBusinessProfile.ts +0 -30
  23. package/src/requests/customer-business-profiles/GetCustomerBusinessProfileDetails.ts +0 -38
  24. package/src/requests/customer-business-profiles/GetCustomerBusinessProfiles.ts +0 -70
  25. package/src/requests/customer-business-profiles/GetCustomerBusinessProfilesForCustomer.ts +0 -64
  26. package/src/requests/customer-business-profiles/UpdateCustomerBusinessProfile.ts +0 -43
  27. package/src/requests/customer-business-profiles/index.ts +0 -6
  28. package/src/requests/customers/CreateCustomer.ts +0 -32
  29. package/src/requests/customers/DeleteCustomer.ts +0 -30
  30. package/src/requests/customers/GetCustomerDetails.ts +0 -34
  31. package/src/requests/customers/GetCustomers.ts +0 -47
  32. package/src/requests/customers/UpdateCustomer.ts +0 -35
  33. package/src/requests/customers/index.ts +0 -5
  34. package/src/requests/index.ts +0 -3
  35. package/src/types.ts +0 -24
  36. package/tsconfig.json +0 -15
@@ -1,6 +0,0 @@
1
- export * from './CreateCustomerBusinessProfile'
2
- export * from './DeleteCustomerBusinessProfile'
3
- export * from './GetCustomerBusinessProfileDetails'
4
- export * from './GetCustomerBusinessProfiles'
5
- export * from './GetCustomerBusinessProfilesForCustomer'
6
- export * from './UpdateCustomerBusinessProfile'
@@ -1,32 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- import { customerDetailsSchema, writableCreateCustomerSchema } from '../../models'
5
-
6
- export const createCustomerInputSchema = writableCreateCustomerSchema.required()
7
- export type CreateCustomerInput = z.input<typeof createCustomerInputSchema>
8
-
9
- export const createCustomerResponseSchema = customerDetailsSchema
10
- export type CreateCustomerResponse = z.output<typeof createCustomerResponseSchema>
11
-
12
- export class CreateCustomer extends AbstractApiRequest<
13
- typeof createCustomerInputSchema,
14
- typeof createCustomerResponseSchema
15
- > {
16
- readonly method = 'POST'
17
- readonly contentType = 'application/json'
18
- readonly accept = 'application/json'
19
-
20
- readonly inputSchema = createCustomerInputSchema
21
- readonly outputSchema = createCustomerResponseSchema
22
- readonly querySchema = undefined
23
- readonly headersSchema = undefined
24
-
25
- constructor(input: CreateCustomerInput) {
26
- super(input)
27
- }
28
-
29
- getPath(): string {
30
- return '/customers'
31
- }
32
- }
@@ -1,30 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- export const deleteCustomerInputSchema = z.undefined()
5
- export const deleteCustomerResponseSchema = z.undefined()
6
-
7
- export class DeleteCustomer extends AbstractApiRequest<
8
- typeof deleteCustomerInputSchema,
9
- typeof deleteCustomerResponseSchema
10
- > {
11
- readonly method = 'DELETE'
12
- readonly contentType = 'application/json'
13
- readonly accept = 'application/json'
14
-
15
- readonly inputSchema = deleteCustomerInputSchema
16
- readonly outputSchema = deleteCustomerResponseSchema
17
- readonly querySchema = undefined
18
- readonly headersSchema = undefined
19
-
20
- private readonly customerId: string
21
-
22
- constructor(customerId: string) {
23
- super(undefined)
24
- this.customerId = customerId
25
- }
26
-
27
- getPath(): string {
28
- return `/customers/${this.customerId}`
29
- }
30
- }
@@ -1,34 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- import { customerDetailsSchema } from '../../models'
5
-
6
- export const getCustomerDetailsInputSchema = z.undefined()
7
- export type GetCustomerDetailsInput = z.infer<typeof getCustomerDetailsInputSchema>
8
-
9
- export const getCustomerDetailsResponseSchema = customerDetailsSchema
10
- export type GetCustomerDetailsResponse = z.infer<typeof getCustomerDetailsResponseSchema>
11
-
12
- export class GetCustomerDetails extends AbstractApiRequest<
13
- typeof getCustomerDetailsInputSchema,
14
- typeof getCustomerDetailsResponseSchema
15
- > {
16
- readonly method = 'GET'
17
- readonly contentType = 'application/json'
18
- readonly accept = 'application/json'
19
- readonly inputSchema = getCustomerDetailsInputSchema
20
- readonly outputSchema = getCustomerDetailsResponseSchema
21
- readonly querySchema = undefined
22
- readonly headersSchema = undefined
23
-
24
- private readonly customerId: string
25
-
26
- constructor(customerId: string) {
27
- super(undefined)
28
- this.customerId = customerId
29
- }
30
-
31
- getPath(): string {
32
- return `/customers/${this.customerId}`
33
- }
34
- }
@@ -1,47 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import {
3
- createPaginatedSchema,
4
- Paginated,
5
- responseToPagination,
6
- } from '@deliverart/sdk-js-global-types'
7
- import { AxiosResponse } from 'axios'
8
- import { z } from 'zod'
9
-
10
- import { Customer, customerSchema, customersQuerySchema } from '../../models'
11
-
12
- export const getCustomersQuerySchema = customersQuerySchema
13
- export type GetCustomersQueryParams = z.infer<typeof getCustomersQuerySchema>
14
-
15
- export const getCustomersInputSchema = z.undefined()
16
- export type GetCustomersInput = z.input<typeof getCustomersInputSchema>
17
-
18
- export const getCustomersResponseSchema = createPaginatedSchema(customerSchema)
19
- export type GetCustomersResponse = z.infer<typeof getCustomersResponseSchema>
20
-
21
- export class GetCustomers extends AbstractApiRequest<
22
- typeof getCustomersInputSchema,
23
- typeof getCustomersResponseSchema,
24
- GetCustomersQueryParams
25
- > {
26
- readonly method = 'GET'
27
- readonly contentType = 'application/json'
28
- readonly accept = 'application/json'
29
-
30
- readonly inputSchema = getCustomersInputSchema
31
- readonly outputSchema = getCustomersResponseSchema
32
- readonly querySchema = getCustomersQuerySchema
33
- readonly headersSchema = undefined
34
-
35
- constructor(options?: { query?: GetCustomersQueryParams }) {
36
- super(undefined, options)
37
- }
38
-
39
- getPath(): string {
40
- return '/customers'
41
- }
42
-
43
- parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<Customer> {
44
- const customers = z.array(customerSchema).parse(data)
45
- return this.validateOutput({ data: customers, pagination: responseToPagination(rawResponse) })
46
- }
47
- }
@@ -1,35 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- import { customerDetailsSchema, writableCustomerSchema } from '../../models'
5
-
6
- export const updateCustomerInputSchema = writableCustomerSchema.partial()
7
- export type UpdateCustomerInput = z.input<typeof updateCustomerInputSchema>
8
-
9
- export const updateCustomerResponseSchema = customerDetailsSchema
10
- export type UpdateCustomerResponse = z.infer<typeof updateCustomerResponseSchema>
11
-
12
- export class UpdateCustomer extends AbstractApiRequest<
13
- typeof updateCustomerInputSchema,
14
- typeof updateCustomerResponseSchema
15
- > {
16
- readonly method = 'PATCH'
17
- readonly contentType = 'application/merge-patch+json'
18
- readonly accept = 'application/json'
19
-
20
- readonly inputSchema = updateCustomerInputSchema
21
- readonly outputSchema = updateCustomerResponseSchema
22
- readonly querySchema = undefined
23
- readonly headersSchema = undefined
24
-
25
- private readonly customerId: string
26
-
27
- constructor(customerId: string, input: UpdateCustomerInput) {
28
- super(input)
29
- this.customerId = customerId
30
- }
31
-
32
- getPath(): string {
33
- return `/customers/${this.customerId}`
34
- }
35
- }
@@ -1,5 +0,0 @@
1
- export * from './CreateCustomer'
2
- export * from './DeleteCustomer'
3
- export * from './GetCustomerDetails'
4
- export * from './GetCustomers'
5
- export * from './UpdateCustomer'
@@ -1,3 +0,0 @@
1
- export * from './customer-addresses'
2
- export * from './customer-business-profiles'
3
- export * from './customers'
package/src/types.ts DELETED
@@ -1,24 +0,0 @@
1
- import { iriNullableSchema, iriSchema } from '@deliverart/sdk-js-global-types'
2
- import { z } from 'zod'
3
-
4
- export const customerIriSchema = iriSchema('/customers/:id')
5
- export type CustomerIri = z.infer<typeof customerIriSchema>
6
-
7
- export const customerNullableIriSchema = iriNullableSchema('/customers/:id')
8
- export type CustomerNullableIri = z.infer<typeof customerNullableIriSchema>
9
-
10
- export const customerAddressIriSchema = iriSchema('/customers/address/:id')
11
- export type CustomerAddressIri = z.infer<typeof customerAddressIriSchema>
12
-
13
- export const customerAddressNullableIriSchema = iriNullableSchema('/customers/address/:id')
14
- export type CustomerAddressNullableIri = z.infer<typeof customerAddressNullableIriSchema>
15
-
16
- export const customerBusinessProfileIriSchema = iriSchema('/customers/business_profiles/:id')
17
- export type CustomerBusinessProfileIri = z.infer<typeof customerBusinessProfileIriSchema>
18
-
19
- export const customerBusinessProfileNullableIriSchema = iriNullableSchema(
20
- '/customers/business_profiles/:id',
21
- )
22
- export type CustomerBusinessProfileNullableIri = z.infer<
23
- typeof customerBusinessProfileNullableIriSchema
24
- >
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "Node",
6
- "esModuleInterop": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "strict": true,
9
- "skipLibCheck": true,
10
- "outDir": "dist",
11
- "declaration": true,
12
- "declarationMap": true
13
- },
14
- "include": ["src"]
15
- }