ecomcoder-cli 1.3.0 ā 1.3.2
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/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/discount/create-basic.d.ts +6 -0
- package/dist/commands/discount/create-basic.d.ts.map +1 -0
- package/dist/commands/discount/create-basic.js +156 -0
- package/dist/commands/discount/create-basic.js.map +1 -0
- package/dist/commands/discount/create-bxgy.d.ts +17 -0
- package/dist/commands/discount/create-bxgy.d.ts.map +1 -0
- package/dist/commands/discount/create-bxgy.js +230 -0
- package/dist/commands/discount/create-bxgy.js.map +1 -0
- package/dist/commands/discount/create-shipping.d.ts +17 -0
- package/dist/commands/discount/create-shipping.d.ts.map +1 -0
- package/dist/commands/discount/create-shipping.js +170 -0
- package/dist/commands/discount/create-shipping.js.map +1 -0
- package/dist/commands/discount/delete.d.ts +6 -0
- package/dist/commands/discount/delete.d.ts.map +1 -0
- package/dist/commands/discount/delete.js +45 -0
- package/dist/commands/discount/delete.js.map +1 -0
- package/dist/commands/discount/index.d.ts +10 -0
- package/dist/commands/discount/index.d.ts.map +1 -0
- package/dist/commands/discount/index.js +98 -0
- package/dist/commands/discount/index.js.map +1 -0
- package/dist/commands/discount/list.d.ts +6 -0
- package/dist/commands/discount/list.d.ts.map +1 -0
- package/dist/commands/discount/list.js +84 -0
- package/dist/commands/discount/list.js.map +1 -0
- package/dist/commands/discount/queries.d.ts +14 -0
- package/dist/commands/discount/queries.d.ts.map +1 -0
- package/dist/commands/discount/queries.js +574 -0
- package/dist/commands/discount/queries.js.map +1 -0
- package/dist/commands/discount/service.d.ts +31 -0
- package/dist/commands/discount/service.d.ts.map +1 -0
- package/dist/commands/discount/service.js +684 -0
- package/dist/commands/discount/service.js.map +1 -0
- package/dist/commands/discount/types.d.ts +228 -0
- package/dist/commands/discount/types.d.ts.map +1 -0
- package/dist/commands/discount/types.js +5 -0
- package/dist/commands/discount/types.js.map +1 -0
- package/dist/commands/discount/utils.d.ts +51 -0
- package/dist/commands/discount/utils.d.ts.map +1 -0
- package/dist/commands/discount/utils.js +153 -0
- package/dist/commands/discount/utils.js.map +1 -0
- package/dist/commands/product/index.d.ts.map +1 -1
- package/dist/commands/product/index.js +10 -0
- package/dist/commands/product/index.js.map +1 -1
- package/dist/commands/product/service.d.ts +9 -1
- package/dist/commands/product/service.d.ts.map +1 -1
- package/dist/commands/product/service.js +36 -0
- package/dist/commands/product/service.js.map +1 -1
- package/dist/commands/product/types.d.ts +4 -0
- package/dist/commands/product/types.d.ts.map +1 -1
- package/dist/commands/product/update-title.d.ts +8 -0
- package/dist/commands/product/update-title.d.ts.map +1 -0
- package/dist/commands/product/update-title.js +94 -0
- package/dist/commands/product/update-title.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/discount/delete.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,wBAAsB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,iBA2B1C"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command: discount delete
|
|
3
|
+
* Delete a discount by ID
|
|
4
|
+
*/
|
|
5
|
+
import { parseArgs } from '../../lib/args-parser.js';
|
|
6
|
+
import { getCredentials } from '../../lib/api-client.js';
|
|
7
|
+
import { deleteDiscount } from './service.js';
|
|
8
|
+
const HELP_TEXT = `
|
|
9
|
+
Delete a discount by ID
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
ecomcoder discount delete [options]
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--id <id> Discount ID (DiscountCodeNode or DiscountAutomaticNode GID) (required)
|
|
16
|
+
|
|
17
|
+
Examples:
|
|
18
|
+
# Delete a code discount
|
|
19
|
+
ecomcoder discount delete --id="gid://shopify/DiscountCodeNode/123"
|
|
20
|
+
|
|
21
|
+
# Delete an automatic discount
|
|
22
|
+
ecomcoder discount delete --id="gid://shopify/DiscountAutomaticNode/456"
|
|
23
|
+
`;
|
|
24
|
+
export async function run(cliArgs) {
|
|
25
|
+
const args = parseArgs(cliArgs);
|
|
26
|
+
if (args.help === 'true') {
|
|
27
|
+
console.log(HELP_TEXT);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Validate required arguments
|
|
31
|
+
if (!args.id) {
|
|
32
|
+
console.log(JSON.stringify({
|
|
33
|
+
success: false,
|
|
34
|
+
error: 'Missing required argument: --id'
|
|
35
|
+
}));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
// Get credentials
|
|
39
|
+
const sessionId = process.env.SESSION_ID || 'default';
|
|
40
|
+
const credentials = await getCredentials(sessionId);
|
|
41
|
+
// Delete discount
|
|
42
|
+
const result = await deleteDiscount(args.id, credentials);
|
|
43
|
+
console.log(JSON.stringify(result, null, 2));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/discount/delete.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;CAejB,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,OAAiB;IACzC,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAEhC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO;IACT,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,SAAS,CAAC;YACb,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,iCAAiC;SACzC,CAAC,CACH,CAAC;QACF,OAAO;IACT,CAAC;IAED,kBAAkB;IAClB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,SAAS,CAAC;IACtD,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;IAEpD,kBAAkB;IAClB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAE1D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/discount/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CA4F/C"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discount Commands Registration
|
|
3
|
+
*
|
|
4
|
+
* Following Open/Closed Principle - commands register themselves
|
|
5
|
+
*/
|
|
6
|
+
import { registry } from '../../lib/command-registry.js';
|
|
7
|
+
/**
|
|
8
|
+
* Register all discount commands
|
|
9
|
+
*/
|
|
10
|
+
export function registerDiscountCommands() {
|
|
11
|
+
// Register command group
|
|
12
|
+
registry.registerGroup({
|
|
13
|
+
command: 'discount',
|
|
14
|
+
description: 'Create and manage Shopify discounts',
|
|
15
|
+
showHelp: () => {
|
|
16
|
+
console.log(`
|
|
17
|
+
Discount Commands - Create and manage Shopify discounts
|
|
18
|
+
|
|
19
|
+
USAGE:
|
|
20
|
+
ecomcoder discount <subcommand> [options]
|
|
21
|
+
|
|
22
|
+
SUBCOMMANDS:
|
|
23
|
+
create-basic Create basic discount (percentage or fixed amount off)
|
|
24
|
+
create-bxgy Create BXGY (Buy X Get Y) discount
|
|
25
|
+
create-shipping Create free shipping discount
|
|
26
|
+
list List all discounts with filtering
|
|
27
|
+
delete Delete a discount by ID
|
|
28
|
+
|
|
29
|
+
EXAMPLES:
|
|
30
|
+
# Create percentage discount with code
|
|
31
|
+
ecomcoder discount create-basic \\
|
|
32
|
+
--title="Summer Sale" \\
|
|
33
|
+
--code="SUMMER25" \\
|
|
34
|
+
--type=percentage \\
|
|
35
|
+
--value=0.25 \\
|
|
36
|
+
--starts-at="2026-06-01T00:00:00Z"
|
|
37
|
+
|
|
38
|
+
# Create fixed amount discount with minimum
|
|
39
|
+
ecomcoder discount create-basic \\
|
|
40
|
+
--title="$10 Off Orders Over $50" \\
|
|
41
|
+
--code="SAVE10" \\
|
|
42
|
+
--type=fixed_amount \\
|
|
43
|
+
--value=10.00 \\
|
|
44
|
+
--min-subtotal=50.00 \\
|
|
45
|
+
--starts-at="2026-06-01T00:00:00Z"
|
|
46
|
+
|
|
47
|
+
# Create automatic discount
|
|
48
|
+
ecomcoder discount create-basic \\
|
|
49
|
+
--title="VIP Discount" \\
|
|
50
|
+
--automatic \\
|
|
51
|
+
--type=percentage \\
|
|
52
|
+
--value=0.15 \\
|
|
53
|
+
--starts-at="2026-06-01T00:00:00Z"
|
|
54
|
+
|
|
55
|
+
# List active discounts
|
|
56
|
+
ecomcoder discount list --status=active
|
|
57
|
+
|
|
58
|
+
# Delete discount
|
|
59
|
+
ecomcoder discount delete --id="gid://shopify/DiscountCodeNode/123"
|
|
60
|
+
|
|
61
|
+
For detailed help on a specific subcommand:
|
|
62
|
+
ecomcoder discount <subcommand> --help
|
|
63
|
+
`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
// Register individual subcommands
|
|
67
|
+
registry.register({
|
|
68
|
+
command: 'discount',
|
|
69
|
+
subcommand: 'create-basic',
|
|
70
|
+
description: 'Create basic discount (percentage or fixed amount off)',
|
|
71
|
+
handler: async () => await import('./create-basic.js')
|
|
72
|
+
});
|
|
73
|
+
registry.register({
|
|
74
|
+
command: 'discount',
|
|
75
|
+
subcommand: 'create-bxgy',
|
|
76
|
+
description: 'Create BXGY (Buy X Get Y) discount',
|
|
77
|
+
handler: async () => await import('./create-bxgy.js')
|
|
78
|
+
});
|
|
79
|
+
registry.register({
|
|
80
|
+
command: 'discount',
|
|
81
|
+
subcommand: 'create-shipping',
|
|
82
|
+
description: 'Create free shipping discount',
|
|
83
|
+
handler: async () => await import('./create-shipping.js')
|
|
84
|
+
});
|
|
85
|
+
registry.register({
|
|
86
|
+
command: 'discount',
|
|
87
|
+
subcommand: 'list',
|
|
88
|
+
description: 'List all discounts with filtering',
|
|
89
|
+
handler: async () => await import('./list.js')
|
|
90
|
+
});
|
|
91
|
+
registry.register({
|
|
92
|
+
command: 'discount',
|
|
93
|
+
subcommand: 'delete',
|
|
94
|
+
description: 'Delete a discount by ID',
|
|
95
|
+
handler: async () => await import('./delete.js')
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/discount/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,yBAAyB;IACzB,QAAQ,CAAC,aAAa,CAAC;QACrB,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,qCAAqC;QAClD,QAAQ,EAAE,GAAG,EAAE;YACb,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CjB,CAAC,CAAC;QACC,CAAC;KACF,CAAC,CAAC;IAEH,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,CAAC;QAChB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,wDAAwD;QACrE,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,mBAAmB,CAAC;KACvD,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,CAAC;QAChB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,aAAa;QACzB,WAAW,EAAE,oCAAoC;QACjD,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC;KACtD,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,CAAC;QAChB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,iBAAiB;QAC7B,WAAW,EAAE,+BAA+B;QAC5C,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC;KAC1D,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,CAAC;QAChB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,WAAW,CAAC;KAC/C,CAAC,CAAC;IAEH,QAAQ,CAAC,QAAQ,CAAC;QAChB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC;KACjD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/discount/list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH,wBAAsB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,iBA+D1C"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command: discount list
|
|
3
|
+
* List discounts with filtering options
|
|
4
|
+
*/
|
|
5
|
+
import { parseArgs } from '../../lib/args-parser.js';
|
|
6
|
+
import { getCredentials } from '../../lib/api-client.js';
|
|
7
|
+
import { listDiscounts } from './service.js';
|
|
8
|
+
const HELP_TEXT = `
|
|
9
|
+
List discounts with filtering options
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
ecomcoder discount list [options]
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--type <type> Filter by type: code | automatic | all (default: all)
|
|
16
|
+
--status <status> Filter by status: active | expired | scheduled (optional)
|
|
17
|
+
--limit <number> Maximum number of results (default: 50)
|
|
18
|
+
--query <string> Search by title (optional)
|
|
19
|
+
--format <format> Output format: json | table (default: json)
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
# List all active discounts
|
|
23
|
+
ecomcoder discount list --status=active
|
|
24
|
+
|
|
25
|
+
# List code discounts only
|
|
26
|
+
ecomcoder discount list --type=code
|
|
27
|
+
|
|
28
|
+
# Search for discounts by title
|
|
29
|
+
ecomcoder discount list --query="SUMMER"
|
|
30
|
+
|
|
31
|
+
# List with custom limit
|
|
32
|
+
ecomcoder discount list --limit=100
|
|
33
|
+
|
|
34
|
+
# Table format
|
|
35
|
+
ecomcoder discount list --format=table
|
|
36
|
+
`;
|
|
37
|
+
export async function run(cliArgs) {
|
|
38
|
+
const args = parseArgs(cliArgs);
|
|
39
|
+
if (args.help === 'true') {
|
|
40
|
+
console.log(HELP_TEXT);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Build input
|
|
44
|
+
const input = {
|
|
45
|
+
type: args.type,
|
|
46
|
+
status: args.status,
|
|
47
|
+
limit: args.limit ? parseInt(args.limit) : undefined,
|
|
48
|
+
query: args.query
|
|
49
|
+
};
|
|
50
|
+
// Get credentials
|
|
51
|
+
const sessionId = process.env.SESSION_ID || 'default';
|
|
52
|
+
const credentials = await getCredentials(sessionId);
|
|
53
|
+
// List discounts
|
|
54
|
+
const result = await listDiscounts(input, credentials);
|
|
55
|
+
// Format output
|
|
56
|
+
const format = args.format || 'json';
|
|
57
|
+
if (format === 'table' && result.success && result.data) {
|
|
58
|
+
console.log('\nš Discounts\n');
|
|
59
|
+
console.log('ā'.repeat(120));
|
|
60
|
+
console.log('ID'.padEnd(50) +
|
|
61
|
+
'Title'.padEnd(30) +
|
|
62
|
+
'Type'.padEnd(12) +
|
|
63
|
+
'Status'.padEnd(10) +
|
|
64
|
+
'Value'.padEnd(18));
|
|
65
|
+
console.log('ā'.repeat(120));
|
|
66
|
+
result.data.discounts.forEach((discount) => {
|
|
67
|
+
const id = discount.id.split('/').pop() || discount.id;
|
|
68
|
+
const title = discount.title.substring(0, 28).padEnd(30);
|
|
69
|
+
const type = `${discount.type}/${discount.discountType}`.padEnd(12);
|
|
70
|
+
const status = discount.status.padEnd(10);
|
|
71
|
+
const value = discount.value.padEnd(18);
|
|
72
|
+
console.log(`${id.padEnd(50)}${title}${type}${status}${value}`);
|
|
73
|
+
if (discount.code) {
|
|
74
|
+
console.log(` Code: ${discount.code}`);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
console.log('ā'.repeat(120));
|
|
78
|
+
console.log(`\nTotal: ${result.data.count} discount(s)\n`);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
console.log(JSON.stringify(result, null, 2));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/discount/list.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BjB,CAAC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IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Queries and Mutations for Discount Commands
|
|
3
|
+
*/
|
|
4
|
+
export declare const DISCOUNT_CODE_BASIC_CREATE = "\n mutation discountCodeBasicCreate($basicCodeDiscount: DiscountCodeBasicInput!) {\n discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {\n codeDiscountNode {\n id\n codeDiscount {\n ... on DiscountCodeBasic {\n title\n summary\n status\n codes(first: 1) {\n edges {\n node {\n code\n }\n }\n }\n startsAt\n endsAt\n customerGets {\n value {\n ... on DiscountPercentage {\n percentage\n }\n ... on DiscountAmount {\n amount {\n amount\n }\n appliesOnEachItem\n }\n }\n items {\n ... on AllDiscountItems {\n allItems\n }\n }\n }\n minimumRequirement {\n ... on DiscountMinimumSubtotal {\n greaterThanOrEqualToSubtotal {\n amount\n }\n }\n ... on DiscountMinimumQuantity {\n greaterThanOrEqualToQuantity\n }\n }\n combinesWith {\n orderDiscounts\n productDiscounts\n shippingDiscounts\n }\n usageLimit\n appliesOncePerCustomer\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
5
|
+
export declare const DISCOUNT_AUTOMATIC_BASIC_CREATE = "\n mutation discountAutomaticBasicCreate($automaticBasicDiscount: DiscountAutomaticBasicInput!) {\n discountAutomaticBasicCreate(automaticBasicDiscount: $automaticBasicDiscount) {\n automaticDiscountNode {\n id\n automaticDiscount {\n ... on DiscountAutomaticBasic {\n title\n summary\n status\n startsAt\n endsAt\n customerGets {\n value {\n ... on DiscountPercentage {\n percentage\n }\n ... on DiscountAmount {\n amount {\n amount\n }\n appliesOnEachItem\n }\n }\n items {\n ... on AllDiscountItems {\n allItems\n }\n }\n }\n minimumRequirement {\n ... on DiscountMinimumSubtotal {\n greaterThanOrEqualToSubtotal {\n amount\n }\n }\n ... on DiscountMinimumQuantity {\n greaterThanOrEqualToQuantity\n }\n }\n combinesWith {\n orderDiscounts\n productDiscounts\n shippingDiscounts\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
6
|
+
export declare const CODE_DISCOUNT_NODES = "\n query codeDiscountNodes($first: Int!, $query: String, $after: String) {\n codeDiscountNodes(first: $first, query: $query, after: $after) {\n edges {\n cursor\n node {\n id\n codeDiscount {\n __typename\n ... on DiscountCodeBasic {\n title\n summary\n status\n codes(first: 5) {\n edges {\n node {\n code\n }\n }\n }\n startsAt\n endsAt\n customerGets {\n value {\n ... on DiscountPercentage {\n percentage\n }\n ... on DiscountAmount {\n amount {\n amount\n }\n appliesOnEachItem\n }\n }\n }\n }\n ... on DiscountCodeBxgy {\n title\n summary\n status\n codes(first: 5) {\n edges {\n node {\n code\n }\n }\n }\n startsAt\n endsAt\n }\n ... on DiscountCodeFreeShipping {\n title\n summary\n status\n codes(first: 5) {\n edges {\n node {\n code\n }\n }\n }\n startsAt\n endsAt\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
|
|
7
|
+
export declare const AUTOMATIC_DISCOUNT_NODES = "\n query automaticDiscountNodes($first: Int!, $query: String, $after: String) {\n automaticDiscountNodes(first: $first, query: $query, after: $after) {\n edges {\n cursor\n node {\n id\n automaticDiscount {\n __typename\n ... on DiscountAutomaticBasic {\n title\n summary\n status\n startsAt\n endsAt\n customerGets {\n value {\n ... on DiscountPercentage {\n percentage\n }\n ... on DiscountAmount {\n amount {\n amount\n }\n appliesOnEachItem\n }\n }\n }\n }\n ... on DiscountAutomaticBxgy {\n title\n summary\n status\n startsAt\n endsAt\n }\n ... on DiscountAutomaticFreeShipping {\n title\n summary\n status\n startsAt\n endsAt\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
|
|
8
|
+
export declare const DISCOUNT_CODE_DELETE = "\n mutation discountCodeDelete($id: ID!) {\n discountCodeDelete(id: $id) {\n deletedCodeDiscountId\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
9
|
+
export declare const DISCOUNT_AUTOMATIC_DELETE = "\n mutation discountAutomaticDelete($id: ID!) {\n discountAutomaticDelete(id: $id) {\n deletedAutomaticDiscountId\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
10
|
+
export declare const DISCOUNT_CODE_BXGY_CREATE = "\n mutation discountCodeBxgyCreate($bxgyCodeDiscount: DiscountCodeBxgyInput!) {\n discountCodeBxgyCreate(bxgyCodeDiscount: $bxgyCodeDiscount) {\n codeDiscountNode {\n id\n codeDiscount {\n ... on DiscountCodeBxgy {\n title\n summary\n status\n codes(first: 1) {\n edges {\n node {\n code\n }\n }\n }\n startsAt\n endsAt\n customerBuys {\n value {\n ... on DiscountQuantity {\n quantity\n }\n ... on DiscountPurchaseAmount {\n amount\n }\n }\n items {\n ... on AllDiscountItems {\n allItems\n }\n ... on DiscountProducts {\n products(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n ... on DiscountCollections {\n collections(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n }\n }\n customerGets {\n value {\n ... on DiscountOnQuantity {\n quantity {\n quantity\n }\n effect {\n ... on DiscountPercentage {\n percentage\n }\n }\n }\n }\n items {\n ... on DiscountProducts {\n products(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n ... on DiscountCollections {\n collections(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n }\n }\n combinesWith {\n orderDiscounts\n productDiscounts\n shippingDiscounts\n }\n usesPerOrderLimit\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
11
|
+
export declare const DISCOUNT_AUTOMATIC_BXGY_CREATE = "\n mutation discountAutomaticBxgyCreate($automaticBxgyDiscount: DiscountAutomaticBxgyInput!) {\n discountAutomaticBxgyCreate(automaticBxgyDiscount: $automaticBxgyDiscount) {\n automaticDiscountNode {\n id\n automaticDiscount {\n ... on DiscountAutomaticBxgy {\n title\n summary\n status\n startsAt\n endsAt\n customerBuys {\n value {\n ... on DiscountQuantity {\n quantity\n }\n ... on DiscountPurchaseAmount {\n amount\n }\n }\n items {\n ... on AllDiscountItems {\n allItems\n }\n ... on DiscountProducts {\n products(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n ... on DiscountCollections {\n collections(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n }\n }\n customerGets {\n value {\n ... on DiscountOnQuantity {\n quantity {\n quantity\n }\n effect {\n ... on DiscountPercentage {\n percentage\n }\n }\n }\n }\n items {\n ... on DiscountProducts {\n products(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n ... on DiscountCollections {\n collections(first: 10) {\n edges {\n node {\n id\n title\n }\n }\n }\n }\n }\n }\n combinesWith {\n orderDiscounts\n productDiscounts\n shippingDiscounts\n }\n usesPerOrderLimit\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
12
|
+
export declare const DISCOUNT_CODE_FREE_SHIPPING_CREATE = "\n mutation discountCodeFreeShippingCreate($freeShippingCodeDiscount: DiscountCodeFreeShippingInput!) {\n discountCodeFreeShippingCreate(freeShippingCodeDiscount: $freeShippingCodeDiscount) {\n codeDiscountNode {\n id\n codeDiscount {\n ... on DiscountCodeFreeShipping {\n title\n summary\n status\n codes(first: 1) {\n edges {\n node {\n code\n }\n }\n }\n startsAt\n endsAt\n minimumRequirement {\n ... on DiscountMinimumSubtotal {\n greaterThanOrEqualToSubtotal {\n amount\n }\n }\n ... on DiscountMinimumQuantity {\n greaterThanOrEqualToQuantity\n }\n }\n destinationSelection {\n ... on DiscountCountryAll {\n allCountries\n }\n ... on DiscountCountries {\n countries\n }\n }\n combinesWith {\n orderDiscounts\n productDiscounts\n shippingDiscounts\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
13
|
+
export declare const DISCOUNT_AUTOMATIC_FREE_SHIPPING_CREATE = "\n mutation discountAutomaticFreeShippingCreate($freeShippingAutomaticDiscount: DiscountAutomaticFreeShippingInput!) {\n discountAutomaticFreeShippingCreate(freeShippingAutomaticDiscount: $freeShippingAutomaticDiscount) {\n automaticDiscountNode {\n id\n automaticDiscount {\n ... on DiscountAutomaticFreeShipping {\n title\n summary\n status\n startsAt\n endsAt\n minimumRequirement {\n ... on DiscountMinimumSubtotal {\n greaterThanOrEqualToSubtotal {\n amount\n }\n }\n ... on DiscountMinimumQuantity {\n greaterThanOrEqualToQuantity\n }\n }\n destinationSelection {\n ... on DiscountCountryAll {\n allCountries\n }\n ... on DiscountCountries {\n countries\n }\n }\n combinesWith {\n orderDiscounts\n productDiscounts\n shippingDiscounts\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\n";
|
|
14
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/commands/discount/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,0BAA0B,klDA+DtC,CAAC;AAEF,eAAO,MAAM,+BAA+B,06CAsD3C,CAAC;AAEF,eAAO,MAAM,mBAAmB,guDAyE/B,CAAC;AAEF,eAAO,MAAM,wBAAwB,ywCAoDpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,2LAUhC,CAAC;AAEF,eAAO,MAAM,yBAAyB,0MAUrC,CAAC;AAEF,eAAO,MAAM,yBAAyB,utFAyGrC,CAAC;AAEF,eAAO,MAAM,8BAA8B,2mFAkG1C,CAAC;AAEF,eAAO,MAAM,kCAAkC,y0CAmD9C,CAAC;AAEF,eAAO,MAAM,uCAAuC,6tCA4CnD,CAAC"}
|