@emilgroup/discount-sdk 1.5.0 → 1.5.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 (149) hide show
  1. package/index.js +99 -0
  2. package/package.json +8 -21
  3. package/scripts/deploy.js +225 -0
  4. package/.openapi-generator/FILES +0 -54
  5. package/.openapi-generator/VERSION +0 -1
  6. package/.openapi-generator-ignore +0 -23
  7. package/api/campaigns-api.ts +0 -1433
  8. package/api/default-api.ts +0 -124
  9. package/api/policy-vouchers-api.ts +0 -999
  10. package/api/vouchers-api.ts +0 -691
  11. package/api.ts +0 -33
  12. package/base.ts +0 -331
  13. package/common.ts +0 -198
  14. package/configuration.ts +0 -110
  15. package/dist/api/campaigns-api.d.ts +0 -808
  16. package/dist/api/campaigns-api.js +0 -1251
  17. package/dist/api/default-api.d.ts +0 -70
  18. package/dist/api/default-api.js +0 -200
  19. package/dist/api/policy-vouchers-api.d.ts +0 -555
  20. package/dist/api/policy-vouchers-api.js +0 -915
  21. package/dist/api/vouchers-api.d.ts +0 -393
  22. package/dist/api/vouchers-api.js +0 -642
  23. package/dist/api.d.ts +0 -15
  24. package/dist/api.js +0 -33
  25. package/dist/base.d.ts +0 -86
  26. package/dist/base.js +0 -367
  27. package/dist/common.d.ts +0 -91
  28. package/dist/common.js +0 -276
  29. package/dist/configuration.d.ts +0 -89
  30. package/dist/configuration.js +0 -52
  31. package/dist/index.d.ts +0 -15
  32. package/dist/index.js +0 -36
  33. package/dist/models/campaign-class.d.ts +0 -105
  34. package/dist/models/campaign-class.js +0 -24
  35. package/dist/models/charge-policy-voucher-request-dto.d.ts +0 -48
  36. package/dist/models/charge-policy-voucher-request-dto.js +0 -15
  37. package/dist/models/charge-policy-voucher-response-class.d.ts +0 -96
  38. package/dist/models/charge-policy-voucher-response-class.js +0 -21
  39. package/dist/models/check-account-eligibility-request-dto.d.ts +0 -48
  40. package/dist/models/check-account-eligibility-request-dto.js +0 -15
  41. package/dist/models/check-account-eligibility-response-class.d.ts +0 -57
  42. package/dist/models/check-account-eligibility-response-class.js +0 -24
  43. package/dist/models/create-campaign-request-dto.d.ts +0 -42
  44. package/dist/models/create-campaign-request-dto.js +0 -15
  45. package/dist/models/create-campaign-response-class.d.ts +0 -25
  46. package/dist/models/create-campaign-response-class.js +0 -15
  47. package/dist/models/create-eligible-account-request-dto.d.ts +0 -30
  48. package/dist/models/create-eligible-account-request-dto.js +0 -15
  49. package/dist/models/create-eligible-account-response-class.d.ts +0 -25
  50. package/dist/models/create-eligible-account-response-class.js +0 -15
  51. package/dist/models/create-policy-voucher-request-dto.d.ts +0 -48
  52. package/dist/models/create-policy-voucher-request-dto.js +0 -15
  53. package/dist/models/create-policy-voucher-response-class.d.ts +0 -25
  54. package/dist/models/create-policy-voucher-response-class.js +0 -15
  55. package/dist/models/create-product-discount-dto.d.ts +0 -48
  56. package/dist/models/create-product-discount-dto.js +0 -15
  57. package/dist/models/create-voucher-request-dto.d.ts +0 -66
  58. package/dist/models/create-voucher-request-dto.js +0 -20
  59. package/dist/models/create-voucher-response-class.d.ts +0 -25
  60. package/dist/models/create-voucher-response-class.js +0 -15
  61. package/dist/models/eligible-account-class.d.ts +0 -78
  62. package/dist/models/eligible-account-class.js +0 -15
  63. package/dist/models/get-campaign-response-class.d.ts +0 -25
  64. package/dist/models/get-campaign-response-class.js +0 -15
  65. package/dist/models/get-policy-voucher-response-class.d.ts +0 -25
  66. package/dist/models/get-policy-voucher-response-class.js +0 -15
  67. package/dist/models/get-voucher-response-class.d.ts +0 -25
  68. package/dist/models/get-voucher-response-class.js +0 -15
  69. package/dist/models/index.d.ts +0 -37
  70. package/dist/models/index.js +0 -53
  71. package/dist/models/inline-response200.d.ts +0 -54
  72. package/dist/models/inline-response200.js +0 -15
  73. package/dist/models/inline-response503.d.ts +0 -54
  74. package/dist/models/inline-response503.js +0 -15
  75. package/dist/models/list-campaigns-response-class.d.ts +0 -43
  76. package/dist/models/list-campaigns-response-class.js +0 -15
  77. package/dist/models/list-eligible-accounts-response-class.d.ts +0 -43
  78. package/dist/models/list-eligible-accounts-response-class.js +0 -15
  79. package/dist/models/list-policy-vouchers-response-class.d.ts +0 -43
  80. package/dist/models/list-policy-vouchers-response-class.js +0 -15
  81. package/dist/models/list-vouchers-response-class.d.ts +0 -43
  82. package/dist/models/list-vouchers-response-class.js +0 -15
  83. package/dist/models/policy-voucher-class.d.ts +0 -165
  84. package/dist/models/policy-voucher-class.js +0 -21
  85. package/dist/models/policy-voucher-transaction-class.d.ts +0 -126
  86. package/dist/models/policy-voucher-transaction-class.js +0 -26
  87. package/dist/models/product-discount-class.d.ts +0 -90
  88. package/dist/models/product-discount-class.js +0 -15
  89. package/dist/models/redeem-policy-voucher-request-dto.d.ts +0 -48
  90. package/dist/models/redeem-policy-voucher-request-dto.js +0 -15
  91. package/dist/models/redeem-policy-voucher-response-class.d.ts +0 -84
  92. package/dist/models/redeem-policy-voucher-response-class.js +0 -21
  93. package/dist/models/update-campaign-request-dto.d.ts +0 -42
  94. package/dist/models/update-campaign-request-dto.js +0 -15
  95. package/dist/models/update-campaign-response-class.d.ts +0 -25
  96. package/dist/models/update-campaign-response-class.js +0 -15
  97. package/dist/models/update-campaign-status-request-dto.d.ts +0 -33
  98. package/dist/models/update-campaign-status-request-dto.js +0 -24
  99. package/dist/models/update-voucher-request-dto.d.ts +0 -60
  100. package/dist/models/update-voucher-request-dto.js +0 -20
  101. package/dist/models/update-voucher-response-class.d.ts +0 -25
  102. package/dist/models/update-voucher-response-class.js +0 -15
  103. package/dist/models/voucher-class.d.ts +0 -127
  104. package/dist/models/voucher-class.js +0 -20
  105. package/dist/models/withdraw-policy-voucher-request-dto.d.ts +0 -36
  106. package/dist/models/withdraw-policy-voucher-request-dto.js +0 -15
  107. package/dist/models/withdraw-policy-voucher-response-class.d.ts +0 -78
  108. package/dist/models/withdraw-policy-voucher-response-class.js +0 -21
  109. package/git_push.sh +0 -57
  110. package/index.ts +0 -19
  111. package/models/campaign-class.ts +0 -114
  112. package/models/charge-policy-voucher-request-dto.ts +0 -54
  113. package/models/charge-policy-voucher-response-class.ts +0 -105
  114. package/models/check-account-eligibility-request-dto.ts +0 -54
  115. package/models/check-account-eligibility-response-class.ts +0 -66
  116. package/models/create-campaign-request-dto.ts +0 -48
  117. package/models/create-campaign-response-class.ts +0 -31
  118. package/models/create-eligible-account-request-dto.ts +0 -36
  119. package/models/create-eligible-account-response-class.ts +0 -31
  120. package/models/create-policy-voucher-request-dto.ts +0 -54
  121. package/models/create-policy-voucher-response-class.ts +0 -31
  122. package/models/create-product-discount-dto.ts +0 -54
  123. package/models/create-voucher-request-dto.ts +0 -75
  124. package/models/create-voucher-response-class.ts +0 -31
  125. package/models/eligible-account-class.ts +0 -84
  126. package/models/get-campaign-response-class.ts +0 -31
  127. package/models/get-policy-voucher-response-class.ts +0 -31
  128. package/models/get-voucher-response-class.ts +0 -31
  129. package/models/index.ts +0 -37
  130. package/models/inline-response200.ts +0 -48
  131. package/models/inline-response503.ts +0 -48
  132. package/models/list-campaigns-response-class.ts +0 -49
  133. package/models/list-eligible-accounts-response-class.ts +0 -49
  134. package/models/list-policy-vouchers-response-class.ts +0 -49
  135. package/models/list-vouchers-response-class.ts +0 -49
  136. package/models/policy-voucher-class.ts +0 -174
  137. package/models/policy-voucher-transaction-class.ts +0 -136
  138. package/models/product-discount-class.ts +0 -96
  139. package/models/redeem-policy-voucher-request-dto.ts +0 -54
  140. package/models/redeem-policy-voucher-response-class.ts +0 -93
  141. package/models/update-campaign-request-dto.ts +0 -48
  142. package/models/update-campaign-response-class.ts +0 -31
  143. package/models/update-campaign-status-request-dto.ts +0 -42
  144. package/models/update-voucher-request-dto.ts +0 -69
  145. package/models/update-voucher-response-class.ts +0 -31
  146. package/models/voucher-class.ts +0 -136
  147. package/models/withdraw-policy-voucher-request-dto.ts +0 -42
  148. package/models/withdraw-policy-voucher-response-class.ts +0 -87
  149. package/tsconfig.json +0 -23
@@ -1,42 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
-
17
- /**
18
- *
19
- * @export
20
- * @interface UpdateCampaignStatusRequestDto
21
- */
22
- export interface UpdateCampaignStatusRequestDto {
23
- /**
24
- * The new status of the campaign. Changing the status affects whether the campaign can be updated or vouchers can be redeemed.
25
- * @type {string}
26
- * @memberof UpdateCampaignStatusRequestDto
27
- */
28
- 'status': UpdateCampaignStatusRequestDtoStatusEnum;
29
- }
30
-
31
- export const UpdateCampaignStatusRequestDtoStatusEnum = {
32
- Active: 'ACTIVE',
33
- Draft: 'DRAFT',
34
- Paused: 'PAUSED',
35
- Expired: 'EXPIRED',
36
- InProgress: 'IN_PROGRESS',
37
- Failed: 'FAILED'
38
- } as const;
39
-
40
- export type UpdateCampaignStatusRequestDtoStatusEnum = typeof UpdateCampaignStatusRequestDtoStatusEnum[keyof typeof UpdateCampaignStatusRequestDtoStatusEnum];
41
-
42
-
@@ -1,69 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import { CreateProductDiscountDto } from './create-product-discount-dto';
17
-
18
- /**
19
- *
20
- * @export
21
- * @interface UpdateVoucherRequestDto
22
- */
23
- export interface UpdateVoucherRequestDto {
24
- /**
25
- * The new unique code for this voucher. This code will be used for redemption.
26
- * @type {string}
27
- * @memberof UpdateVoucherRequestDto
28
- */
29
- 'voucherCode': string;
30
- /**
31
- * The new duration in months for which the discount will be applied. Must be at least 1 month.
32
- * @type {number}
33
- * @memberof UpdateVoucherRequestDto
34
- */
35
- 'discountPeriodMonths': number;
36
- /**
37
- * The new type of discount to be applied. Can be either absolute (fixed amount) or relative (percentage).
38
- * @type {string}
39
- * @memberof UpdateVoucherRequestDto
40
- */
41
- 'discountType': UpdateVoucherRequestDtoDiscountTypeEnum;
42
- /**
43
- * The value of the discount. For absolute discounts: fixed amount in cents (integer). For relative discounts: percentage with max 2 decimals (1-100).
44
- * @type {number}
45
- * @memberof UpdateVoucherRequestDto
46
- */
47
- 'discountValue': number;
48
- /**
49
- * If true, this voucher cannot be combined with other discounts. Defaults to false if not specified.
50
- * @type {boolean}
51
- * @memberof UpdateVoucherRequestDto
52
- */
53
- 'isExclusive'?: boolean;
54
- /**
55
- * A list of product-specific discount configurations.
56
- * @type {Array<CreateProductDiscountDto>}
57
- * @memberof UpdateVoucherRequestDto
58
- */
59
- 'productDiscounts': Array<CreateProductDiscountDto>;
60
- }
61
-
62
- export const UpdateVoucherRequestDtoDiscountTypeEnum = {
63
- Absolute: 'ABSOLUTE',
64
- Relative: 'RELATIVE'
65
- } as const;
66
-
67
- export type UpdateVoucherRequestDtoDiscountTypeEnum = typeof UpdateVoucherRequestDtoDiscountTypeEnum[keyof typeof UpdateVoucherRequestDtoDiscountTypeEnum];
68
-
69
-
@@ -1,31 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import { VoucherClass } from './voucher-class';
17
-
18
- /**
19
- *
20
- * @export
21
- * @interface UpdateVoucherResponseClass
22
- */
23
- export interface UpdateVoucherResponseClass {
24
- /**
25
- * The updated voucher.
26
- * @type {VoucherClass}
27
- * @memberof UpdateVoucherResponseClass
28
- */
29
- 'voucher': VoucherClass;
30
- }
31
-
@@ -1,136 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
- import { CampaignClass } from './campaign-class';
17
- import { ProductDiscountClass } from './product-discount-class';
18
-
19
- /**
20
- *
21
- * @export
22
- * @interface VoucherClass
23
- */
24
- export interface VoucherClass {
25
- /**
26
- * Internal unique identifier for the object. You should not have to use this, use code instead.
27
- * @type {number}
28
- * @memberof VoucherClass
29
- */
30
- 'id': number;
31
- /**
32
- * Unique identifier for the object.
33
- * @type {string}
34
- * @memberof VoucherClass
35
- */
36
- 'code': string;
37
- /**
38
- * The unique code for this voucher.
39
- * @type {string}
40
- * @memberof VoucherClass
41
- */
42
- 'voucherCode': string;
43
- /**
44
- * The unique identifier of the campaign this voucher belongs to.
45
- * @type {number}
46
- * @memberof VoucherClass
47
- */
48
- 'campaignId': number;
49
- /**
50
- * The duration in months for which the discount will be applied.
51
- * @type {number}
52
- * @memberof VoucherClass
53
- */
54
- 'discountPeriodMonths': number;
55
- /**
56
- * The type of discount to be applied. Can be either absolute (fixed amount) or relative (percentage).
57
- * @type {string}
58
- * @memberof VoucherClass
59
- */
60
- 'discountType': VoucherClassDiscountTypeEnum;
61
- /**
62
- * The value of the discount. For absolute discounts, this is the fixed amount. For relative discounts, this is the percentage.
63
- * @type {number}
64
- * @memberof VoucherClass
65
- */
66
- 'discountValue': number;
67
- /**
68
- * The monthly discount value.
69
- * @type {number}
70
- * @memberof VoucherClass
71
- */
72
- 'monthlyDiscountValue': number;
73
- /**
74
- * If true, this voucher cannot be combined with other discounts. Defaults to false if not specified.
75
- * @type {boolean}
76
- * @memberof VoucherClass
77
- */
78
- 'isExclusive': boolean;
79
- /**
80
- * A list of product-specific discount configurations.
81
- * @type {Array<ProductDiscountClass>}
82
- * @memberof VoucherClass
83
- */
84
- 'productDiscounts': Array<ProductDiscountClass>;
85
- /**
86
- * Time at which the object was created.
87
- * @type {string}
88
- * @memberof VoucherClass
89
- */
90
- 'createdAt': string;
91
- /**
92
- * Time at which the object was updated.
93
- * @type {string}
94
- * @memberof VoucherClass
95
- */
96
- 'updatedAt': string;
97
- /**
98
- * Identifier of the user who created the record.
99
- * @type {string}
100
- * @memberof VoucherClass
101
- */
102
- 'createdBy': string;
103
- /**
104
- * Identifier of the user who last updated the record.
105
- * @type {string}
106
- * @memberof VoucherClass
107
- */
108
- 'updatedBy': string;
109
- /**
110
- * Emil Resources Names (ERN) identifies the most specific owner of a resource.
111
- * @type {string}
112
- * @memberof VoucherClass
113
- */
114
- 'ern': string;
115
- /**
116
- * The version of the campaign.
117
- * @type {number}
118
- * @memberof VoucherClass
119
- */
120
- 'version': number;
121
- /**
122
- * The campaign this voucher belongs to.
123
- * @type {CampaignClass}
124
- * @memberof VoucherClass
125
- */
126
- 'campaign': CampaignClass;
127
- }
128
-
129
- export const VoucherClassDiscountTypeEnum = {
130
- Absolute: 'ABSOLUTE',
131
- Relative: 'RELATIVE'
132
- } as const;
133
-
134
- export type VoucherClassDiscountTypeEnum = typeof VoucherClassDiscountTypeEnum[keyof typeof VoucherClassDiscountTypeEnum];
135
-
136
-
@@ -1,42 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
-
17
- /**
18
- *
19
- * @export
20
- * @interface WithdrawPolicyVoucherRequestDto
21
- */
22
- export interface WithdrawPolicyVoucherRequestDto {
23
- /**
24
- * Customer-defined voucher code
25
- * @type {string}
26
- * @memberof WithdrawPolicyVoucherRequestDto
27
- */
28
- 'voucherCode': string;
29
- /**
30
- * Slug of the campaign the voucher is used for
31
- * @type {string}
32
- * @memberof WithdrawPolicyVoucherRequestDto
33
- */
34
- 'campaignSlug': string;
35
- /**
36
- * Number of the partner the voucher is used by
37
- * @type {string}
38
- * @memberof WithdrawPolicyVoucherRequestDto
39
- */
40
- 'partnerNumber': string;
41
- }
42
-
@@ -1,87 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * EMIL DiscountService
5
- * The EMIL DiscountService API description
6
- *
7
- * The version of the OpenAPI document: 1.0
8
- * Contact: kontakt@emil.de
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
-
15
-
16
-
17
- /**
18
- *
19
- * @export
20
- * @interface WithdrawPolicyVoucherResponseClass
21
- */
22
- export interface WithdrawPolicyVoucherResponseClass {
23
- /**
24
- * Unique identifier of the transaction that this object belongs to.
25
- * @type {string}
26
- * @memberof WithdrawPolicyVoucherResponseClass
27
- */
28
- 'transactionCode': string;
29
- /**
30
- * Transaction date
31
- * @type {string}
32
- * @memberof WithdrawPolicyVoucherResponseClass
33
- */
34
- 'transactionDate': string;
35
- /**
36
- * Unique identifier for the object.
37
- * @type {string}
38
- * @memberof WithdrawPolicyVoucherResponseClass
39
- */
40
- 'code': string;
41
- /**
42
- * Voucher status
43
- * @type {string}
44
- * @memberof WithdrawPolicyVoucherResponseClass
45
- */
46
- 'status': WithdrawPolicyVoucherResponseClassStatusEnum;
47
- /**
48
- * Customer-defined voucher code
49
- * @type {string}
50
- * @memberof WithdrawPolicyVoucherResponseClass
51
- */
52
- 'voucherCode': string;
53
- /**
54
- * Slug of the product the voucher is redeemed for
55
- * @type {string}
56
- * @memberof WithdrawPolicyVoucherResponseClass
57
- */
58
- 'productSlug': string;
59
- /**
60
- * Code of the customer the voucher is used by
61
- * @type {string}
62
- * @memberof WithdrawPolicyVoucherResponseClass
63
- */
64
- 'partnerNumber': string;
65
- /**
66
- * The remaining number of months left in the voucher to use
67
- * @type {number}
68
- * @memberof WithdrawPolicyVoucherResponseClass
69
- */
70
- 'remainingMonths': number;
71
- /**
72
- * The amount (in cents!) of remaining voucher credits
73
- * @type {number}
74
- * @memberof WithdrawPolicyVoucherResponseClass
75
- */
76
- 'remainingCredits': number;
77
- }
78
-
79
- export const WithdrawPolicyVoucherResponseClassStatusEnum = {
80
- Redeemable: 'REDEEMABLE',
81
- Active: 'ACTIVE',
82
- Used: 'USED'
83
- } as const;
84
-
85
- export type WithdrawPolicyVoucherResponseClassStatusEnum = typeof WithdrawPolicyVoucherResponseClassStatusEnum[keyof typeof WithdrawPolicyVoucherResponseClassStatusEnum];
86
-
87
-
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "declaration": true,
4
- "target": "ES5",
5
- "module": "CommonJS",
6
- "noImplicitAny": true,
7
- "esModuleInterop": true,
8
- "noImplicitOverride": true,
9
- "outDir": "dist",
10
- "rootDir": ".",
11
- "lib": [
12
- "es6",
13
- "dom"
14
- ],
15
- "typeRoots": [
16
- "node_modules/@types"
17
- ]
18
- },
19
- "exclude": [
20
- "dist",
21
- "node_modules"
22
- ]
23
- }