@deliverart/sdk-js-payment 0.0.4 → 1.1.1

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 (48) hide show
  1. package/dist/index.cjs +4431 -496
  2. package/dist/index.d.cts +1482 -848
  3. package/dist/index.d.ts +1482 -848
  4. package/dist/index.js +4392 -451
  5. package/package.json +11 -26
  6. package/.changeset/config.json +0 -11
  7. package/.github/workflows/workflow.yml +0 -47
  8. package/.prettierrc +0 -7
  9. package/CHANGELOG.md +0 -55
  10. package/README.md +0 -3
  11. package/eslint.config.js +0 -41
  12. package/src/index.ts +0 -3
  13. package/src/models.ts +0 -168
  14. package/src/requests/index.ts +0 -2
  15. package/src/requests/payment-configs/DeletePaymentConfig.ts +0 -27
  16. package/src/requests/payment-configs/GetPaymentConfigDetails.ts +0 -33
  17. package/src/requests/payment-configs/GetPaymentConfigs.ts +0 -50
  18. package/src/requests/payment-configs/bank-transfer/CreatePaymentConfigBankTransfer.ts +0 -38
  19. package/src/requests/payment-configs/bank-transfer/DeletePaymentConfigBankTransfer.ts +0 -27
  20. package/src/requests/payment-configs/bank-transfer/GetPaymentConfigBankTransferDetails.ts +0 -37
  21. package/src/requests/payment-configs/bank-transfer/GetPaymentConfigBankTransferList.ts +0 -54
  22. package/src/requests/payment-configs/bank-transfer/UpdatePaymentConfigBankTransfer.ts +0 -45
  23. package/src/requests/payment-configs/bank-transfer/index.ts +0 -5
  24. package/src/requests/payment-configs/cash/CreatePaymentConfigCash.ts +0 -36
  25. package/src/requests/payment-configs/cash/DeletePaymentConfigCash.ts +0 -27
  26. package/src/requests/payment-configs/cash/GetPaymentConfigCashDetails.ts +0 -33
  27. package/src/requests/payment-configs/cash/GetPaymentConfigCashList.ts +0 -52
  28. package/src/requests/payment-configs/cash/index.ts +0 -4
  29. package/src/requests/payment-configs/credit-card/CreatePaymentConfigCreditCard.ts +0 -38
  30. package/src/requests/payment-configs/credit-card/DeletePaymentConfigCreditCard.ts +0 -27
  31. package/src/requests/payment-configs/credit-card/GetPaymentConfigCreditCardDetails.ts +0 -36
  32. package/src/requests/payment-configs/credit-card/GetPaymentConfigCreditCardList.ts +0 -54
  33. package/src/requests/payment-configs/credit-card/index.ts +0 -4
  34. package/src/requests/payment-configs/index.ts +0 -7
  35. package/src/requests/payment-configs/stripe/CreatePaymentConfigStripe.ts +0 -36
  36. package/src/requests/payment-configs/stripe/DeletePaymentConfigStripe.ts +0 -27
  37. package/src/requests/payment-configs/stripe/GetPaymentConfigStripeDetails.ts +0 -33
  38. package/src/requests/payment-configs/stripe/GetPaymentConfigStripeList.ts +0 -53
  39. package/src/requests/payment-configs/stripe/UpdatePaymentConfigStripe.ts +0 -43
  40. package/src/requests/payment-configs/stripe/index.ts +0 -5
  41. package/src/requests/payments/DeletePayment.ts +0 -27
  42. package/src/requests/payments/GetPaymentDetails.ts +0 -30
  43. package/src/requests/payments/GetPayments.ts +0 -45
  44. package/src/requests/payments/GetPaymentsForPaymentConfig.ts +0 -53
  45. package/src/requests/payments/UpdatePayment.ts +0 -32
  46. package/src/requests/payments/index.ts +0 -5
  47. package/src/types.ts +0 -194
  48. package/tsconfig.json +0 -15
package/package.json CHANGED
@@ -1,47 +1,32 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-payment",
3
3
  "description": "Deliverart JavaScript SDK for Payment Management",
4
- "version": "0.0.4",
4
+ "version": "1.1.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "tsup": {
9
+ "tsconfig": "./tsconfig.json"
10
+ },
8
11
  "exports": {
9
12
  ".": {
10
13
  "import": "./dist/index.js",
11
14
  "require": "./dist/index.cjs"
12
15
  }
13
16
  },
17
+ "files": [
18
+ "dist"
19
+ ],
14
20
  "dependencies": {
15
- "@deliverart/sdk-js-core": "0.1.4",
16
- "@deliverart/sdk-js-global-types": "0.0.16",
17
- "@deliverart/sdk-js-point-of-sale": "0.0.8",
18
- "axios": "1.9.0",
19
- "zod": "3.25.67"
20
- },
21
- "devDependencies": {
22
- "@changesets/cli": "^2.29.4",
23
- "@eslint/js": "9.28.0",
24
- "@types/node": "22.15.30",
25
- "@typescript-eslint/eslint-plugin": "8.33.1",
26
- "@typescript-eslint/parser": "8.33.1",
27
- "eslint": "9.28.0",
28
- "eslint-config-prettier": "10.1.5",
29
- "eslint-plugin-simple-import-sort": "12.1.1",
30
- "prettier": "3.5.3",
31
- "tsup": "8.5.0",
32
- "typescript": "5.8.3"
21
+ "@deliverart/sdk-js-core": "1.1.1",
22
+ "@deliverart/sdk-js-point-of-sale": "1.1.1",
23
+ "@deliverart/sdk-js-global-types": "1.1.1"
33
24
  },
34
25
  "publishConfig": {
35
26
  "access": "public"
36
27
  },
37
28
  "scripts": {
38
29
  "build": "tsup src/index.ts --dts --format esm,cjs",
39
- "dev": "tsup src/index.ts --dts --watch",
40
- "lint": "eslint .",
41
- "lint:fix": "eslint . --fix",
42
- "prettier": "prettier --check .",
43
- "prettier:fix": "prettier --write .",
44
- "version": "@changesets/cli version",
45
- "release": "@changesets/cli publish"
30
+ "dev": "tsup src/index.ts --dts --watch"
46
31
  }
47
32
  }
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,47 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: write
10
-
11
- jobs:
12
- release:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - uses: pnpm/action-setup@v2
18
- with:
19
- version: 8
20
-
21
- - uses: actions/setup-node@v4
22
- with:
23
- node-version: '20'
24
- registry-url: 'https://registry.npmjs.org'
25
- always-auth: true
26
- env:
27
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28
-
29
- - name: Install deps
30
- run: pnpm install
31
-
32
- - name: Build
33
- run: pnpm build
34
-
35
- - name: Create version and changelog
36
- run: pnpx @changesets/cli version
37
-
38
- - name: Publish to NPM
39
- run: pnpx @changesets/cli publish
40
- env:
41
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42
-
43
- - name: Push updated versions and changelogs
44
- uses: EndBug/add-and-commit@v9
45
- with:
46
- message: 'chore(release): version bump'
47
- add: '.'
package/.prettierrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "printWidth": 100,
5
- "trailingComma": "all",
6
- "arrowParens": "avoid"
7
- }
package/CHANGELOG.md DELETED
@@ -1,55 +0,0 @@
1
- # @deliverart/sdk-js-company
2
-
3
- ## 0.0.4
4
-
5
- ### Patch Changes
6
-
7
- - a62f38c: fix uuid version
8
-
9
- ## 0.0.3
10
-
11
- ### Patch Changes
12
-
13
- - 0178d07: Increase version pkg
14
-
15
- ## 0.0.2
16
-
17
- ### Patch Changes
18
-
19
- - 14e19e9: upgrade packages version
20
-
21
- ## 0.0.7
22
-
23
- ### Patch Changes
24
-
25
- - b8d802e: update dependencise
26
-
27
- ## 0.0.6
28
-
29
- ### Patch Changes
30
-
31
- - 65b64b5: Expose types
32
-
33
- ## 0.0.5
34
-
35
- ### Patch Changes
36
-
37
- - 83e0325: Expose company path types
38
-
39
- ## 0.0.4
40
-
41
- ### Patch Changes
42
-
43
- - 36a941d: Upgrade types version
44
-
45
- ## 0.0.3
46
-
47
- ### Patch Changes
48
-
49
- - b4fc2d4: Upgrade types version
50
-
51
- ## 0.0.2
52
-
53
- ### Patch Changes
54
-
55
- - a9d7757: Upgrade types version
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # sdk-js-payment
2
-
3
- Payment module for SDK
package/eslint.config.js DELETED
@@ -1,41 +0,0 @@
1
- /* eslint-disable */
2
- // eslint.config.js per @typescript-eslint v8
3
- import js from '@eslint/js'
4
- import prettier from 'eslint-config-prettier'
5
- import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
6
- import tsPlugin from '@typescript-eslint/eslint-plugin'
7
- import tsParser from '@typescript-eslint/parser'
8
-
9
- export default [
10
- js.configs.recommended,
11
- {
12
- files: ['**/*.ts'],
13
- languageOptions: {
14
- parser: tsParser,
15
- globals: {
16
- process: 'readonly',
17
- fetch: 'readonly',
18
- Request: 'readonly',
19
- Response: 'readonly',
20
- Headers: 'readonly',
21
- },
22
- parserOptions: {
23
- project: ['./tsconfig.json'],
24
- tsconfigRootDir: process.cwd(),
25
- sourceType: 'module',
26
- },
27
- },
28
- plugins: {
29
- '@typescript-eslint': tsPlugin,
30
- 'simple-import-sort': simpleImportSortPlugin,
31
- },
32
- rules: {
33
- 'simple-import-sort/imports': 'error',
34
- 'simple-import-sort/exports': 'error',
35
- '@typescript-eslint/no-unused-vars': 'warn',
36
- },
37
- },
38
- prettier,
39
- ]
40
-
41
- export const ignores = ['dist', 'node_modules']
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './models'
2
- export * from './requests'
3
- export * from './types'
package/src/models.ts DELETED
@@ -1,168 +0,0 @@
1
- import {
2
- datetimeSchema,
3
- sortDirSchema,
4
- timestampsFilterSchema,
5
- } from '@deliverart/sdk-js-global-types'
6
- import { pointOfSalePathSchema } from '@deliverart/sdk-js-point-of-sale'
7
- import { z } from 'zod'
8
-
9
- import { paymentConfigPathSchema, paymentMethodSchema, paymentStatusSchema } from './types'
10
-
11
- export const paymentSchema = z.object({
12
- id: z.string(),
13
- method: paymentMethodSchema,
14
- status: paymentStatusSchema,
15
- amount: z.string(),
16
- internalReference: z.string().nullable(),
17
- externalReference: z.string().nullable(),
18
- response: z.string().nullable(),
19
- validUntil: datetimeSchema.nullable(),
20
- createdAt: datetimeSchema,
21
- updatedAt: datetimeSchema,
22
- })
23
- export type Payment = z.infer<typeof paymentSchema>
24
-
25
- export const paymentDetailsSchema = paymentSchema.extend({
26
- config: paymentConfigPathSchema,
27
- })
28
- export type PaymentDetails = z.infer<typeof paymentDetailsSchema>
29
-
30
- export const writablePaymentSchema = paymentDetailsSchema.pick({
31
- status: true,
32
- response: true,
33
- })
34
-
35
- export const paymentConfigBaseSchema = z.object({
36
- id: z.string(),
37
- method: paymentMethodSchema,
38
- configurationCompleted: z.boolean(),
39
- createdAt: datetimeSchema,
40
- updatedAt: datetimeSchema,
41
- })
42
-
43
- export const paymentConfigDetailsFieldsSchema = z.object({
44
- pointOfSale: pointOfSalePathSchema,
45
- })
46
-
47
- export const paymentConfigBankTransferSchema = paymentConfigBaseSchema
48
- .omit({ method: true })
49
- .extend({
50
- method: paymentMethodSchema.extract(['bank_transfer']),
51
- iban: z.string(),
52
- bic: z.string(),
53
- accountHolder: z.string(),
54
- bankName: z.string(),
55
- bankAddress: z.string().nullable().optional(),
56
- currency: z.string(),
57
- })
58
- export type PaymentConfigBankTransfer = z.infer<typeof paymentConfigBankTransferSchema>
59
-
60
- export const paymentConfigBankTransferDetailsSchema = paymentConfigBankTransferSchema.extend(
61
- paymentConfigDetailsFieldsSchema.shape,
62
- )
63
- export type PaymentConfigBankTransferDetails = z.infer<
64
- typeof paymentConfigBankTransferDetailsSchema
65
- >
66
-
67
- export const writablePaymentConfigBankTransferSchema = paymentConfigBankTransferDetailsSchema.pick({
68
- pointOfSale: true,
69
- iban: true,
70
- bic: true,
71
- accountHolder: true,
72
- bankName: true,
73
- bankAddress: true,
74
- currency: true,
75
- })
76
-
77
- export const paymentConfigCashSchema = paymentConfigBaseSchema.omit({ method: true }).extend({
78
- method: paymentMethodSchema.extract(['cash']),
79
- })
80
- export type PaymentConfigCash = z.infer<typeof paymentConfigCashSchema>
81
-
82
- export const paymentConfigCashDetailsSchema = paymentConfigCashSchema.extend(
83
- paymentConfigDetailsFieldsSchema.shape,
84
- )
85
- export type PaymentConfigCashDetails = z.infer<typeof paymentConfigCashDetailsSchema>
86
-
87
- export const writablePaymentConfigCashSchema = paymentConfigCashDetailsSchema.pick({
88
- pointOfSale: true,
89
- })
90
-
91
- export const paymentConfigCreditCardSchema = paymentConfigBaseSchema.omit({ method: true }).extend({
92
- method: paymentMethodSchema.extract(['credit_card']),
93
- })
94
- export type PaymentConfigCreditCard = z.infer<typeof paymentConfigCreditCardSchema>
95
-
96
- export const paymentConfigCreditCardDetailsSchema = paymentConfigCreditCardSchema.extend(
97
- paymentConfigDetailsFieldsSchema.shape,
98
- )
99
- export type PaymentConfigCreditCardDetails = z.infer<typeof paymentConfigCreditCardDetailsSchema>
100
-
101
- export const writablePaymentConfigCreditCardSchema = paymentConfigCreditCardDetailsSchema.pick({
102
- pointOfSale: true,
103
- })
104
-
105
- export const paymentConfigStripeSchema = paymentConfigBaseSchema.omit({ method: true }).extend({
106
- method: paymentMethodSchema.extract(['stripe']),
107
- secretKey: z.string(),
108
- webhookSecret: z.string().nullable().optional(),
109
- webhookId: z.string().nullable().optional(),
110
- })
111
- export type PaymentConfigStripe = z.infer<typeof paymentConfigStripeSchema>
112
-
113
- export const paymentConfigStripeDetailsSchema = paymentConfigStripeSchema.extend(
114
- paymentConfigDetailsFieldsSchema.shape,
115
- )
116
- export type PaymentConfigStripeDetails = z.infer<typeof paymentConfigStripeDetailsSchema>
117
-
118
- export const writablePaymentConfigStripeSchema = paymentConfigStripeDetailsSchema.pick({
119
- pointOfSale: true,
120
- secretKey: true,
121
- })
122
-
123
- export const paymentConfigSchema = z.discriminatedUnion('method', [
124
- paymentConfigBankTransferSchema,
125
- paymentConfigCashSchema,
126
- paymentConfigCreditCardSchema,
127
- paymentConfigStripeSchema,
128
- ])
129
- export type PaymentConfig = z.infer<typeof paymentConfigSchema>
130
-
131
- export const paymentConfigDetailsSchema = z.discriminatedUnion('method', [
132
- paymentConfigBankTransferDetailsSchema,
133
- paymentConfigCashDetailsSchema,
134
- paymentConfigCreditCardDetailsSchema,
135
- paymentConfigStripeDetailsSchema,
136
- ])
137
- export type PaymentConfigDetails = z.infer<typeof paymentConfigDetailsSchema>
138
-
139
- export const paymentQuerySchema = z
140
- .object({
141
- internalReference: z.string().optional(),
142
- externalReference: z.string().optional(),
143
- method: paymentMethodSchema.optional(),
144
- 'method[]': z.array(paymentMethodSchema).optional(),
145
- status: paymentStatusSchema.optional(),
146
- 'status[]': z.array(paymentStatusSchema).optional(),
147
- 'amount[between]': z.coerce.number().optional(),
148
- 'amount[gt]': z.coerce.number().optional(),
149
- 'amount[gte]': z.coerce.number().optional(),
150
- 'amount[lt]': z.coerce.number().optional(),
151
- 'amount[lte]': z.coerce.number().optional(),
152
- 'order[createdAt]': sortDirSchema.optional(),
153
- 'order[updatedAt]': sortDirSchema.optional(),
154
- page: z.coerce.number().optional(),
155
- })
156
- .merge(timestampsFilterSchema)
157
- export type PaymentQueryParams = z.infer<typeof paymentQuerySchema>
158
-
159
- export const paymentConfigsQuerySchema = z
160
- .object({
161
- method: paymentMethodSchema.optional(),
162
- configurationCompleted: z.coerce.boolean().optional(),
163
- 'order[createdAt]': sortDirSchema.optional(),
164
- 'order[updatedAt]': sortDirSchema.optional(),
165
- page: z.coerce.number().optional(),
166
- })
167
- .merge(timestampsFilterSchema)
168
- export type PaymentConfigsQueryParams = z.infer<typeof paymentConfigsQuerySchema>
@@ -1,2 +0,0 @@
1
- export * from './payment-configs'
2
- export * from './payments'
@@ -1,27 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- export const deletePaymentConfigInputSchema = z.undefined()
5
- export const deletePaymentConfigResponseSchema = z.undefined()
6
-
7
- export class DeletePaymentConfig extends AbstractApiRequest<void, void> {
8
- readonly method = 'DELETE'
9
- readonly contentType = 'application/json'
10
- readonly accept = 'application/json'
11
-
12
- readonly inputSchema = deletePaymentConfigInputSchema
13
- readonly outputSchema = deletePaymentConfigResponseSchema
14
- readonly querySchema = undefined
15
- readonly headersSchema = undefined
16
-
17
- private readonly paymentConfigId: string
18
-
19
- constructor(paymentConfigId: string) {
20
- super()
21
- this.paymentConfigId = paymentConfigId
22
- }
23
-
24
- getPath(): string {
25
- return `/payment_configs/${this.paymentConfigId}`
26
- }
27
- }
@@ -1,33 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- import { PaymentConfigDetails, paymentConfigDetailsSchema } from '../../models'
5
-
6
- export const getPaymentConfigDetailsInputSchema = z.undefined()
7
-
8
- export const getPaymentConfigDetailsResponseSchema = paymentConfigDetailsSchema
9
- export type GetPaymentConfigDetailsResponse = PaymentConfigDetails
10
-
11
- export class GetPaymentConfigDetails extends AbstractApiRequest<
12
- void,
13
- GetPaymentConfigDetailsResponse
14
- > {
15
- readonly method = 'GET'
16
- readonly contentType = 'application/json'
17
- readonly accept = 'application/json'
18
- readonly inputSchema = getPaymentConfigDetailsInputSchema
19
- readonly outputSchema = getPaymentConfigDetailsResponseSchema
20
- readonly querySchema = undefined
21
- readonly headersSchema = undefined
22
-
23
- private readonly paymentConfigId: string
24
-
25
- constructor(paymentConfigId: string) {
26
- super()
27
- this.paymentConfigId = paymentConfigId
28
- }
29
-
30
- getPath(): string {
31
- return `/payment_configs/${this.paymentConfigId}`
32
- }
33
- }
@@ -1,50 +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 {
11
- PaymentConfig,
12
- paymentConfigSchema,
13
- PaymentConfigsQueryParams,
14
- paymentConfigsQuerySchema,
15
- } from '../../models'
16
-
17
- export type GetPaymentConfigsQueryParams = PaymentConfigsQueryParams
18
-
19
- export const getPaymentConfigsResponseSchema = createPaginatedSchema(paymentConfigSchema)
20
- export type GetPaymentConfigsResponse = z.infer<typeof getPaymentConfigsResponseSchema>
21
-
22
- export const getPaymentConfigsInputSchema = z.undefined()
23
-
24
- export class GetPaymentConfigs extends AbstractApiRequest<
25
- void,
26
- GetPaymentConfigsResponse,
27
- GetPaymentConfigsQueryParams
28
- > {
29
- readonly method = 'GET'
30
- readonly contentType = 'application/json'
31
- readonly accept = 'application/json'
32
-
33
- readonly inputSchema = getPaymentConfigsInputSchema
34
- readonly outputSchema = getPaymentConfigsResponseSchema
35
- readonly querySchema = paymentConfigsQuerySchema
36
- readonly headersSchema = undefined
37
-
38
- constructor(options?: { query?: GetPaymentConfigsQueryParams }) {
39
- super(undefined, options)
40
- }
41
-
42
- getPath(): string {
43
- return '/payment_configs'
44
- }
45
-
46
- parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfig> {
47
- const payments = z.array(paymentConfigSchema).parse(data)
48
- return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
49
- }
50
- }
@@ -1,38 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- import {
5
- PaymentConfigBankTransferDetails,
6
- paymentConfigBankTransferDetailsSchema,
7
- writablePaymentConfigBankTransferSchema,
8
- } from '../../../models'
9
-
10
- export const createPaymentConfigBankTransferInputSchema = writablePaymentConfigBankTransferSchema
11
- export type CreatePaymentConfigBankTransferInput = z.infer<
12
- typeof createPaymentConfigBankTransferInputSchema
13
- >
14
-
15
- export const createPaymentConfigBankTransferResponseSchema = paymentConfigBankTransferDetailsSchema
16
- export type CreatePaymentConfigBankTransferResponse = PaymentConfigBankTransferDetails
17
-
18
- export class CreatePaymentConfigBankTransfer extends AbstractApiRequest<
19
- CreatePaymentConfigBankTransferInput,
20
- CreatePaymentConfigBankTransferResponse
21
- > {
22
- readonly method = 'POST'
23
- readonly contentType = 'application/json'
24
- readonly accept = 'application/json'
25
-
26
- readonly inputSchema = createPaymentConfigBankTransferInputSchema
27
- readonly outputSchema = createPaymentConfigBankTransferResponseSchema
28
- readonly querySchema = undefined
29
- readonly headersSchema = undefined
30
-
31
- constructor(input: CreatePaymentConfigBankTransferInput) {
32
- super(input)
33
- }
34
-
35
- getPath(): string {
36
- return '/payment_configs/bank_transfer'
37
- }
38
- }
@@ -1,27 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- export const deletePaymentConfigBankTransferInputSchema = z.undefined()
5
- export const deletePaymentConfigBankTransferResponseSchema = z.undefined()
6
-
7
- export class DeletePaymentConfigBankTransfer extends AbstractApiRequest<void, void> {
8
- readonly method = 'DELETE'
9
- readonly contentType = 'application/json'
10
- readonly accept = 'application/json'
11
-
12
- readonly inputSchema = deletePaymentConfigBankTransferInputSchema
13
- readonly outputSchema = deletePaymentConfigBankTransferResponseSchema
14
- readonly querySchema = undefined
15
- readonly headersSchema = undefined
16
-
17
- private readonly paymentConfigId: string
18
-
19
- constructor(paymentConfigId: string) {
20
- super()
21
- this.paymentConfigId = paymentConfigId
22
- }
23
-
24
- getPath(): string {
25
- return `/payment_configs/bank_transfer/${this.paymentConfigId}`
26
- }
27
- }
@@ -1,37 +0,0 @@
1
- import { AbstractApiRequest } from '@deliverart/sdk-js-core'
2
- import { z } from 'zod'
3
-
4
- import {
5
- PaymentConfigBankTransferDetails,
6
- paymentConfigBankTransferDetailsSchema,
7
- } from '../../../models'
8
-
9
- export const getPaymentConfigBankTransferDetailsInputSchema = z.undefined()
10
-
11
- export const getPaymentConfigBankTransferDetailsResponseSchema =
12
- paymentConfigBankTransferDetailsSchema
13
- export type GetPaymentConfigBankTransferDetailsResponse = PaymentConfigBankTransferDetails
14
-
15
- export class GetPaymentConfigBankTransferDetails extends AbstractApiRequest<
16
- void,
17
- GetPaymentConfigBankTransferDetailsResponse
18
- > {
19
- readonly method = 'GET'
20
- readonly contentType = 'application/json'
21
- readonly accept = 'application/json'
22
- readonly inputSchema = getPaymentConfigBankTransferDetailsInputSchema
23
- readonly outputSchema = getPaymentConfigBankTransferDetailsResponseSchema
24
- readonly querySchema = undefined
25
- readonly headersSchema = undefined
26
-
27
- private readonly paymentConfigId: string
28
-
29
- constructor(paymentConfigId: string) {
30
- super()
31
- this.paymentConfigId = paymentConfigId
32
- }
33
-
34
- getPath(): string {
35
- return `/payment_configs/bank_transfer/${this.paymentConfigId}`
36
- }
37
- }
@@ -1,54 +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 {
11
- PaymentConfigBankTransfer,
12
- paymentConfigBankTransferSchema,
13
- PaymentConfigsQueryParams,
14
- paymentConfigsQuerySchema,
15
- } from '../../../models'
16
-
17
- export type GetPaymentConfigBankTransferListQueryParams = PaymentConfigsQueryParams
18
-
19
- export const getPaymentConfigBankTransferListResponseSchema = createPaginatedSchema(
20
- paymentConfigBankTransferSchema,
21
- )
22
- export type GetPaymentConfigBankTransferListResponse = z.infer<
23
- typeof getPaymentConfigBankTransferListResponseSchema
24
- >
25
-
26
- export const getPaymentConfigBankTransferListInputSchema = z.undefined()
27
-
28
- export class GetPaymentConfigBankTransferList extends AbstractApiRequest<
29
- void,
30
- GetPaymentConfigBankTransferListResponse,
31
- GetPaymentConfigBankTransferListQueryParams
32
- > {
33
- readonly method = 'GET'
34
- readonly contentType = 'application/json'
35
- readonly accept = 'application/json'
36
-
37
- readonly inputSchema = getPaymentConfigBankTransferListInputSchema
38
- readonly outputSchema = getPaymentConfigBankTransferListResponseSchema
39
- readonly querySchema = paymentConfigsQuerySchema
40
- readonly headersSchema = undefined
41
-
42
- constructor(options?: { query?: GetPaymentConfigBankTransferListQueryParams }) {
43
- super(undefined, options)
44
- }
45
-
46
- getPath(): string {
47
- return '/payment_configs/bank_transfer'
48
- }
49
-
50
- parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfigBankTransfer> {
51
- const payments = z.array(paymentConfigBankTransferSchema).parse(data)
52
- return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
53
- }
54
- }