n8n-nodes-lemonsqueezy 0.2.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.
- package/LICENSE +21 -0
- package/README.md +216 -0
- package/dist/credentials/LemonSqueezyApi.credentials.d.ts +10 -0
- package/dist/credentials/LemonSqueezyApi.credentials.js +41 -0
- package/dist/nodes/LemonSqueezy/LemonSqueezy.node.d.ts +5 -0
- package/dist/nodes/LemonSqueezy/LemonSqueezy.node.js +358 -0
- package/dist/nodes/LemonSqueezy/LemonSqueezyTrigger.node.d.ts +12 -0
- package/dist/nodes/LemonSqueezy/LemonSqueezyTrigger.node.js +230 -0
- package/dist/nodes/LemonSqueezy/constants.d.ts +89 -0
- package/dist/nodes/LemonSqueezy/constants.js +207 -0
- package/dist/nodes/LemonSqueezy/helpers.d.ts +28 -0
- package/dist/nodes/LemonSqueezy/helpers.js +241 -0
- package/dist/nodes/LemonSqueezy/lemonSqueezy.svg +20 -0
- package/dist/nodes/LemonSqueezy/resources/checkout.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/checkout.js +272 -0
- package/dist/nodes/LemonSqueezy/resources/customer.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/customer.js +242 -0
- package/dist/nodes/LemonSqueezy/resources/discount.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/discount.js +210 -0
- package/dist/nodes/LemonSqueezy/resources/index.d.ts +15 -0
- package/dist/nodes/LemonSqueezy/resources/index.js +76 -0
- package/dist/nodes/LemonSqueezy/resources/licenseKey.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/licenseKey.js +209 -0
- package/dist/nodes/LemonSqueezy/resources/order.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/order.js +113 -0
- package/dist/nodes/LemonSqueezy/resources/product.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/product.js +93 -0
- package/dist/nodes/LemonSqueezy/resources/store.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/store.js +64 -0
- package/dist/nodes/LemonSqueezy/resources/subscription.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/subscription.js +196 -0
- package/dist/nodes/LemonSqueezy/resources/variant.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/variant.js +96 -0
- package/dist/nodes/LemonSqueezy/resources/webhook.d.ts +3 -0
- package/dist/nodes/LemonSqueezy/resources/webhook.js +206 -0
- package/dist/nodes/LemonSqueezy/types.d.ts +364 -0
- package/dist/nodes/LemonSqueezy/types.js +2 -0
- package/package.json +71 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.licenseKeyFields = exports.licenseKeyOperations = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
exports.licenseKeyOperations = {
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['licenseKey'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Activate',
|
|
16
|
+
value: 'activate',
|
|
17
|
+
action: 'Activate a license key',
|
|
18
|
+
description: 'Activate a license key instance',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Deactivate',
|
|
22
|
+
value: 'deactivate',
|
|
23
|
+
action: 'Deactivate a license key',
|
|
24
|
+
description: 'Deactivate a license key instance',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get',
|
|
28
|
+
value: 'get',
|
|
29
|
+
action: 'Get a license key',
|
|
30
|
+
description: 'Retrieve a single license key by ID',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Get Many',
|
|
34
|
+
value: 'getAll',
|
|
35
|
+
action: 'Get many license keys',
|
|
36
|
+
description: 'Retrieve multiple license keys',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Update',
|
|
40
|
+
value: 'update',
|
|
41
|
+
action: 'Update a license key',
|
|
42
|
+
description: 'Update a license key',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Validate',
|
|
46
|
+
value: 'validate',
|
|
47
|
+
action: 'Validate a license key',
|
|
48
|
+
description: 'Validate a license key',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
default: 'getAll',
|
|
52
|
+
};
|
|
53
|
+
exports.licenseKeyFields = [
|
|
54
|
+
// License Key ID for Get/Update operations
|
|
55
|
+
{
|
|
56
|
+
displayName: 'License Key ID',
|
|
57
|
+
name: 'licenseKeyId',
|
|
58
|
+
type: 'string',
|
|
59
|
+
required: true,
|
|
60
|
+
default: '',
|
|
61
|
+
description: 'The ID of the license key',
|
|
62
|
+
displayOptions: {
|
|
63
|
+
show: { resource: ['licenseKey'], operation: ['get', 'update'] },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
// License Key for Validate/Activate/Deactivate operations
|
|
67
|
+
{
|
|
68
|
+
displayName: 'License Key',
|
|
69
|
+
name: 'licenseKey',
|
|
70
|
+
type: 'string',
|
|
71
|
+
required: true,
|
|
72
|
+
default: '',
|
|
73
|
+
description: 'The actual license key string',
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: { resource: ['licenseKey'], operation: ['validate', 'activate', 'deactivate'] },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
// Instance ID for Deactivate operation
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Instance ID',
|
|
81
|
+
name: 'instanceId',
|
|
82
|
+
type: 'string',
|
|
83
|
+
required: true,
|
|
84
|
+
default: '',
|
|
85
|
+
description: 'The ID of the license key instance to deactivate',
|
|
86
|
+
displayOptions: {
|
|
87
|
+
show: { resource: ['licenseKey'], operation: ['deactivate'] },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
// Instance Name for Activate operation
|
|
91
|
+
{
|
|
92
|
+
displayName: 'Instance Name',
|
|
93
|
+
name: 'instanceName',
|
|
94
|
+
type: 'string',
|
|
95
|
+
required: true,
|
|
96
|
+
default: '',
|
|
97
|
+
description: 'A label for the new license key instance (e.g., user email or device name)',
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: { resource: ['licenseKey'], operation: ['activate'] },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
// Update Fields
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Update Fields',
|
|
105
|
+
name: 'updateFields',
|
|
106
|
+
type: 'collection',
|
|
107
|
+
placeholder: 'Add Field',
|
|
108
|
+
default: {},
|
|
109
|
+
displayOptions: {
|
|
110
|
+
show: { resource: ['licenseKey'], operation: ['update'] },
|
|
111
|
+
},
|
|
112
|
+
options: [
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Activation Limit',
|
|
115
|
+
name: 'activationLimit',
|
|
116
|
+
type: 'number',
|
|
117
|
+
default: 0,
|
|
118
|
+
description: 'The maximum number of instances this license key can be activated on (0 for unlimited)',
|
|
119
|
+
typeOptions: { minValue: 0 },
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
displayName: 'Disabled',
|
|
123
|
+
name: 'disabled',
|
|
124
|
+
type: 'boolean',
|
|
125
|
+
default: false,
|
|
126
|
+
description: 'Whether the license key is disabled',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Expires At',
|
|
130
|
+
name: 'expiresAt',
|
|
131
|
+
type: 'dateTime',
|
|
132
|
+
default: '',
|
|
133
|
+
description: 'When the license key expires (ISO 8601 format)',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
// Return All
|
|
138
|
+
{
|
|
139
|
+
displayName: 'Return All',
|
|
140
|
+
name: 'returnAll',
|
|
141
|
+
type: 'boolean',
|
|
142
|
+
default: false,
|
|
143
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
144
|
+
displayOptions: {
|
|
145
|
+
show: { resource: ['licenseKey'], operation: ['getAll'] },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
// Limit
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Limit',
|
|
151
|
+
name: 'limit',
|
|
152
|
+
type: 'number',
|
|
153
|
+
default: 50,
|
|
154
|
+
description: 'Max number of results to return',
|
|
155
|
+
typeOptions: { minValue: 1 },
|
|
156
|
+
displayOptions: {
|
|
157
|
+
show: { resource: ['licenseKey'], operation: ['getAll'], returnAll: [false] },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
// Filters
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Filters',
|
|
163
|
+
name: 'filters',
|
|
164
|
+
type: 'collection',
|
|
165
|
+
placeholder: 'Add Filter',
|
|
166
|
+
default: {},
|
|
167
|
+
displayOptions: {
|
|
168
|
+
show: { resource: ['licenseKey'], operation: ['getAll'] },
|
|
169
|
+
},
|
|
170
|
+
options: [
|
|
171
|
+
{
|
|
172
|
+
displayName: 'Store ID',
|
|
173
|
+
name: 'storeId',
|
|
174
|
+
type: 'string',
|
|
175
|
+
default: '',
|
|
176
|
+
description: 'Filter by store ID',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
displayName: 'Order ID',
|
|
180
|
+
name: 'orderId',
|
|
181
|
+
type: 'string',
|
|
182
|
+
default: '',
|
|
183
|
+
description: 'Filter by order ID',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
displayName: 'Product ID',
|
|
187
|
+
name: 'productId',
|
|
188
|
+
type: 'string',
|
|
189
|
+
default: '',
|
|
190
|
+
description: 'Filter by product ID',
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
displayName: 'Status',
|
|
194
|
+
name: 'status',
|
|
195
|
+
type: 'options',
|
|
196
|
+
options: constants_1.LICENSE_KEY_STATUSES,
|
|
197
|
+
default: '',
|
|
198
|
+
description: 'Filter by license key status',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
displayName: 'Disabled',
|
|
202
|
+
name: 'disabled',
|
|
203
|
+
type: 'boolean',
|
|
204
|
+
default: false,
|
|
205
|
+
description: 'Filter by disabled status',
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
];
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderFields = exports.orderOperations = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
exports.orderOperations = {
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['order'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Get',
|
|
16
|
+
value: 'get',
|
|
17
|
+
action: 'Get an order',
|
|
18
|
+
description: 'Retrieve a single order by ID',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Get Many',
|
|
22
|
+
value: 'getAll',
|
|
23
|
+
action: 'Get many orders',
|
|
24
|
+
description: 'Retrieve multiple orders',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Refund',
|
|
28
|
+
value: 'refund',
|
|
29
|
+
action: 'Refund an order',
|
|
30
|
+
description: 'Issue a refund for an order',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
default: 'getAll',
|
|
34
|
+
};
|
|
35
|
+
exports.orderFields = [
|
|
36
|
+
// Order ID for Get/Refund operations
|
|
37
|
+
{
|
|
38
|
+
displayName: 'Order ID',
|
|
39
|
+
name: 'orderId',
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: true,
|
|
42
|
+
default: '',
|
|
43
|
+
description: 'The ID of the order',
|
|
44
|
+
displayOptions: {
|
|
45
|
+
show: { resource: ['order'], operation: ['get', 'refund'] },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
// Return All
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Return All',
|
|
51
|
+
name: 'returnAll',
|
|
52
|
+
type: 'boolean',
|
|
53
|
+
default: false,
|
|
54
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
55
|
+
displayOptions: {
|
|
56
|
+
show: { resource: ['order'], operation: ['getAll'] },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
// Limit
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Limit',
|
|
62
|
+
name: 'limit',
|
|
63
|
+
type: 'number',
|
|
64
|
+
default: 50,
|
|
65
|
+
description: 'Max number of results to return',
|
|
66
|
+
typeOptions: { minValue: 1 },
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: { resource: ['order'], operation: ['getAll'], returnAll: [false] },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
// Filters
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Filters',
|
|
74
|
+
name: 'filters',
|
|
75
|
+
type: 'collection',
|
|
76
|
+
placeholder: 'Add Filter',
|
|
77
|
+
default: {},
|
|
78
|
+
displayOptions: {
|
|
79
|
+
show: { resource: ['order'], operation: ['getAll'] },
|
|
80
|
+
},
|
|
81
|
+
options: [
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Store ID',
|
|
84
|
+
name: 'storeId',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
description: 'Filter by store ID',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: 'User Email',
|
|
91
|
+
name: 'userEmail',
|
|
92
|
+
type: 'string',
|
|
93
|
+
default: '',
|
|
94
|
+
description: 'Filter by customer email',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
displayName: 'Status',
|
|
98
|
+
name: 'status',
|
|
99
|
+
type: 'options',
|
|
100
|
+
options: constants_1.ORDER_STATUSES,
|
|
101
|
+
default: '',
|
|
102
|
+
description: 'Filter by order status',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Refunded',
|
|
106
|
+
name: 'refunded',
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
default: false,
|
|
109
|
+
description: 'Filter by refunded status',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productFields = exports.productOperations = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
exports.productOperations = {
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['product'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Get',
|
|
16
|
+
value: 'get',
|
|
17
|
+
action: 'Get a product',
|
|
18
|
+
description: 'Retrieve a single product by ID',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Get Many',
|
|
22
|
+
value: 'getAll',
|
|
23
|
+
action: 'Get many products',
|
|
24
|
+
description: 'Retrieve multiple products',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
default: 'getAll',
|
|
28
|
+
};
|
|
29
|
+
exports.productFields = [
|
|
30
|
+
// Product ID for Get operation
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Product ID',
|
|
33
|
+
name: 'productId',
|
|
34
|
+
type: 'string',
|
|
35
|
+
required: true,
|
|
36
|
+
default: '',
|
|
37
|
+
description: 'The ID of the product to retrieve',
|
|
38
|
+
displayOptions: {
|
|
39
|
+
show: { resource: ['product'], operation: ['get'] },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
// Return All
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Return All',
|
|
45
|
+
name: 'returnAll',
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
default: false,
|
|
48
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: { resource: ['product'], operation: ['getAll'] },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
// Limit
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Limit',
|
|
56
|
+
name: 'limit',
|
|
57
|
+
type: 'number',
|
|
58
|
+
default: 50,
|
|
59
|
+
description: 'Max number of results to return',
|
|
60
|
+
typeOptions: { minValue: 1 },
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: { resource: ['product'], operation: ['getAll'], returnAll: [false] },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
// Filters
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Filters',
|
|
68
|
+
name: 'filters',
|
|
69
|
+
type: 'collection',
|
|
70
|
+
placeholder: 'Add Filter',
|
|
71
|
+
default: {},
|
|
72
|
+
displayOptions: {
|
|
73
|
+
show: { resource: ['product'], operation: ['getAll'] },
|
|
74
|
+
},
|
|
75
|
+
options: [
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Store ID',
|
|
78
|
+
name: 'storeId',
|
|
79
|
+
type: 'string',
|
|
80
|
+
default: '',
|
|
81
|
+
description: 'Filter by store ID',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
displayName: 'Status',
|
|
85
|
+
name: 'status',
|
|
86
|
+
type: 'options',
|
|
87
|
+
options: constants_1.PRODUCT_STATUSES,
|
|
88
|
+
default: '',
|
|
89
|
+
description: 'Filter by product status',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storeFields = exports.storeOperations = void 0;
|
|
4
|
+
exports.storeOperations = {
|
|
5
|
+
displayName: 'Operation',
|
|
6
|
+
name: 'operation',
|
|
7
|
+
type: 'options',
|
|
8
|
+
noDataExpression: true,
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: { resource: ['store'] },
|
|
11
|
+
},
|
|
12
|
+
options: [
|
|
13
|
+
{
|
|
14
|
+
name: 'Get',
|
|
15
|
+
value: 'get',
|
|
16
|
+
action: 'Get a store',
|
|
17
|
+
description: 'Retrieve a single store by ID',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Get Many',
|
|
21
|
+
value: 'getAll',
|
|
22
|
+
action: 'Get many stores',
|
|
23
|
+
description: 'Retrieve all stores',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
default: 'getAll',
|
|
27
|
+
};
|
|
28
|
+
exports.storeFields = [
|
|
29
|
+
// Store ID for Get operation
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Store ID',
|
|
32
|
+
name: 'storeId',
|
|
33
|
+
type: 'string',
|
|
34
|
+
required: true,
|
|
35
|
+
default: '',
|
|
36
|
+
description: 'The ID of the store to retrieve',
|
|
37
|
+
displayOptions: {
|
|
38
|
+
show: { resource: ['store'], operation: ['get'] },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
// Return All
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Return All',
|
|
44
|
+
name: 'returnAll',
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
default: false,
|
|
47
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
48
|
+
displayOptions: {
|
|
49
|
+
show: { resource: ['store'], operation: ['getAll'] },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// Limit
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Limit',
|
|
55
|
+
name: 'limit',
|
|
56
|
+
type: 'number',
|
|
57
|
+
default: 50,
|
|
58
|
+
description: 'Max number of results to return',
|
|
59
|
+
typeOptions: { minValue: 1 },
|
|
60
|
+
displayOptions: {
|
|
61
|
+
show: { resource: ['store'], operation: ['getAll'], returnAll: [false] },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
];
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscriptionFields = exports.subscriptionOperations = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
exports.subscriptionOperations = {
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: { resource: ['subscription'] },
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Cancel',
|
|
16
|
+
value: 'cancel',
|
|
17
|
+
action: 'Cancel a subscription',
|
|
18
|
+
description: 'Cancel a subscription',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Get',
|
|
22
|
+
value: 'get',
|
|
23
|
+
action: 'Get a subscription',
|
|
24
|
+
description: 'Retrieve a single subscription by ID',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Get Many',
|
|
28
|
+
value: 'getAll',
|
|
29
|
+
action: 'Get many subscriptions',
|
|
30
|
+
description: 'Retrieve multiple subscriptions',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Resume',
|
|
34
|
+
value: 'resume',
|
|
35
|
+
action: 'Resume a subscription',
|
|
36
|
+
description: 'Resume a paused subscription',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Update',
|
|
40
|
+
value: 'update',
|
|
41
|
+
action: 'Update a subscription',
|
|
42
|
+
description: 'Update a subscription',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
default: 'getAll',
|
|
46
|
+
};
|
|
47
|
+
exports.subscriptionFields = [
|
|
48
|
+
// Subscription ID
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Subscription ID',
|
|
51
|
+
name: 'subscriptionId',
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: true,
|
|
54
|
+
default: '',
|
|
55
|
+
description: 'The ID of the subscription',
|
|
56
|
+
displayOptions: {
|
|
57
|
+
show: { resource: ['subscription'], operation: ['get', 'update', 'cancel', 'resume'] },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
// Return All
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Return All',
|
|
63
|
+
name: 'returnAll',
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
default: false,
|
|
66
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: { resource: ['subscription'], operation: ['getAll'] },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
// Limit
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Limit',
|
|
74
|
+
name: 'limit',
|
|
75
|
+
type: 'number',
|
|
76
|
+
default: 50,
|
|
77
|
+
description: 'Max number of results to return',
|
|
78
|
+
typeOptions: { minValue: 1 },
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: { resource: ['subscription'], operation: ['getAll'], returnAll: [false] },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
// Filters
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Filters',
|
|
86
|
+
name: 'filters',
|
|
87
|
+
type: 'collection',
|
|
88
|
+
placeholder: 'Add Filter',
|
|
89
|
+
default: {},
|
|
90
|
+
displayOptions: {
|
|
91
|
+
show: { resource: ['subscription'], operation: ['getAll'] },
|
|
92
|
+
},
|
|
93
|
+
options: [
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Store ID',
|
|
96
|
+
name: 'storeId',
|
|
97
|
+
type: 'string',
|
|
98
|
+
default: '',
|
|
99
|
+
description: 'Filter by store ID',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
displayName: 'Order ID',
|
|
103
|
+
name: 'orderId',
|
|
104
|
+
type: 'string',
|
|
105
|
+
default: '',
|
|
106
|
+
description: 'Filter by order ID',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
displayName: 'Product ID',
|
|
110
|
+
name: 'productId',
|
|
111
|
+
type: 'string',
|
|
112
|
+
default: '',
|
|
113
|
+
description: 'Filter by product ID',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Variant ID',
|
|
117
|
+
name: 'variantId',
|
|
118
|
+
type: 'string',
|
|
119
|
+
default: '',
|
|
120
|
+
description: 'Filter by variant ID',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: 'User Email',
|
|
124
|
+
name: 'userEmail',
|
|
125
|
+
type: 'string',
|
|
126
|
+
default: '',
|
|
127
|
+
description: 'Filter by customer email',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
displayName: 'Status',
|
|
131
|
+
name: 'status',
|
|
132
|
+
type: 'options',
|
|
133
|
+
options: constants_1.SUBSCRIPTION_STATUSES,
|
|
134
|
+
default: '',
|
|
135
|
+
description: 'Filter by subscription status',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
// Update Fields
|
|
140
|
+
{
|
|
141
|
+
displayName: 'Update Fields',
|
|
142
|
+
name: 'updateFields',
|
|
143
|
+
type: 'collection',
|
|
144
|
+
placeholder: 'Add Field',
|
|
145
|
+
default: {},
|
|
146
|
+
displayOptions: {
|
|
147
|
+
show: { resource: ['subscription'], operation: ['update'] },
|
|
148
|
+
},
|
|
149
|
+
options: [
|
|
150
|
+
{
|
|
151
|
+
displayName: 'Variant ID',
|
|
152
|
+
name: 'variantId',
|
|
153
|
+
type: 'string',
|
|
154
|
+
default: '',
|
|
155
|
+
description: 'Change the subscription to a different variant (plan change)',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
displayName: 'Pause Mode',
|
|
159
|
+
name: 'pause',
|
|
160
|
+
type: 'options',
|
|
161
|
+
options: constants_1.PAUSE_MODES,
|
|
162
|
+
default: '',
|
|
163
|
+
description: 'Pause or unpause the subscription',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Cancelled',
|
|
167
|
+
name: 'cancelled',
|
|
168
|
+
type: 'boolean',
|
|
169
|
+
default: false,
|
|
170
|
+
description: 'Whether the subscription should be cancelled at the end of the billing period',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Billing Anchor',
|
|
174
|
+
name: 'billingAnchor',
|
|
175
|
+
type: 'number',
|
|
176
|
+
default: 0,
|
|
177
|
+
description: 'Day of the month for billing (1-31)',
|
|
178
|
+
typeOptions: { minValue: 1, maxValue: 31 },
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
displayName: 'Invoice Immediately',
|
|
182
|
+
name: 'invoiceImmediately',
|
|
183
|
+
type: 'boolean',
|
|
184
|
+
default: false,
|
|
185
|
+
description: 'Whether to invoice immediately when changing variants',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
displayName: 'Disable Prorations',
|
|
189
|
+
name: 'disableProrations',
|
|
190
|
+
type: 'boolean',
|
|
191
|
+
default: false,
|
|
192
|
+
description: 'Whether to disable prorations when changing variants',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
},
|
|
196
|
+
];
|