@shopify/shop-minis-cli 0.0.39 → 0.0.41
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/build/commands/cancel-submission/cancel-submission.d.ts +1 -0
- package/build/commands/cancel-submission/cancel-submission.js +56 -0
- package/build/commands/cancel-submission/cancel-submission.js.map +1 -0
- package/build/commands/cancel-submission/index.js +2 -6
- package/build/commands/cancel-submission/index.js.map +1 -1
- package/build/commands/create-mini/index.js +36 -27
- package/build/commands/create-mini/index.js.map +1 -1
- package/build/commands/create-mini/utils/template-app.js +1 -14
- package/build/commands/create-mini/utils/template-app.js.map +1 -1
- package/build/commands/dev/utils/deeplink.js +35 -2
- package/build/commands/dev/utils/deeplink.js.map +1 -1
- package/build/commands/submit/errors.d.ts +1 -1
- package/build/commands/submit/errors.js +1 -1
- package/build/commands/submit/errors.js.map +1 -1
- package/build/commands/submit/tasks.js +1 -1
- package/build/commands/submit/tasks.js.map +1 -1
- package/build/commands/types/autogenerated/shop-minis-admin-api/gql.d.ts +7 -0
- package/build/commands/types/autogenerated/shop-minis-admin-api/gql.js +1 -0
- package/build/commands/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -1
- package/build/commands/types/autogenerated/shop-minis-admin-api/graphql.d.ts +130 -0
- package/build/commands/types/autogenerated/shop-minis-admin-api/graphql.js +100 -0
- package/build/commands/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -1
- package/build/commands/upgrade/index.d.ts +5 -0
- package/build/commands/upgrade/index.js +66 -0
- package/build/commands/upgrade/index.js.map +1 -0
- package/build/commands/upgrade/utils/package-manager.d.ts +2 -0
- package/build/commands/upgrade/utils/package-manager.js +18 -0
- package/build/commands/upgrade/utils/package-manager.js.map +1 -0
- package/build/commands/upgrade/utils/reset-files.d.ts +7 -0
- package/build/commands/upgrade/utils/reset-files.js +82 -0
- package/build/commands/upgrade/utils/reset-files.js.map +1 -0
- package/build/commands/{submit → utils}/graphql.d.ts +19 -0
- package/build/commands/{submit → utils}/graphql.js +23 -0
- package/build/commands/utils/graphql.js.map +1 -0
- package/build/commands/utils/replace-strings-in-template.d.ts +1 -0
- package/build/commands/utils/replace-strings-in-template.js +15 -0
- package/build/commands/utils/replace-strings-in-template.js.map +1 -0
- package/build/commands/utils/wrap-with-loading-indicator.d.ts +1 -1
- package/build/commands/utils/wrap-with-loading-indicator.js.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/package.json +4 -3
- package/scripts/test-template.ts +63 -0
- package/templates/__template_blank/src/index.tsx +5 -4
- package/templates/__template_common/gitignore +1 -0
- package/templates/__template_common/index.tsx +2 -3
- package/templates/__template_common/metro.config.js +0 -4
- package/templates/__template_common/package.json +6 -3
- package/templates/__template_hello_world/src/components/FeaturedComponents.tsx +2 -2
- package/templates/__template_hello_world/src/components/quiz/types.ts +2 -2
- package/templates/__template_hello_world/src/index.tsx +5 -4
- package/templates/__template_snowboardz/src/index.tsx +5 -4
- package/build/commands/submit/graphql.js.map +0 -1
- /package/templates/{__template_blank/src/custom.d.ts → __template_common/assets.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cancelSubmission: () => Promise<void>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { renderSuccess, renderInfo, renderConfirmationPrompt, } from '@shopify/cli-kit/node/ui';
|
|
2
|
+
import { AbortError, handler as handleError } from '@shopify/cli-kit/node/error';
|
|
3
|
+
import { getPendingSubmission as graphqlGetPendingSubmission, cancelSubmission as graphqlCancelSubmission, } from '../utils/graphql.js';
|
|
4
|
+
import { assertNetworkAndAuth } from '../submit/tasks.js';
|
|
5
|
+
export const cancelSubmission = async () => {
|
|
6
|
+
try {
|
|
7
|
+
await assertNetworkAndAuth();
|
|
8
|
+
const pendingSubmission = await graphqlGetPendingSubmission();
|
|
9
|
+
if (pendingSubmission) {
|
|
10
|
+
const shouldContinue = await renderConfirmationPrompt({
|
|
11
|
+
message: [
|
|
12
|
+
'Are you sure you want to cancel submission',
|
|
13
|
+
{ bold: pendingSubmission.reference },
|
|
14
|
+
`created ${pendingSubmission.submittedAt}?`,
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
if (!shouldContinue)
|
|
18
|
+
return;
|
|
19
|
+
const { submission: cancelledSubmission } = await graphqlCancelSubmission({
|
|
20
|
+
reference: pendingSubmission.reference,
|
|
21
|
+
});
|
|
22
|
+
if (cancelledSubmission) {
|
|
23
|
+
renderSuccess({
|
|
24
|
+
headline: 'Submission cancelled',
|
|
25
|
+
body: [
|
|
26
|
+
'Your submission with reference',
|
|
27
|
+
{
|
|
28
|
+
bold: cancelledSubmission.reference,
|
|
29
|
+
},
|
|
30
|
+
'was cancelled.',
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new AbortError('Failed to cancel submission.', 'Try again and if the issue continues, contact us.', [
|
|
36
|
+
'Try to run `cancel-submission` again',
|
|
37
|
+
"Contact Shop if you're having issues",
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
renderInfo({
|
|
43
|
+
headline: 'No pending submission',
|
|
44
|
+
body: [
|
|
45
|
+
'If you previously had a pending submission, it may have been reviewed or already cancelled.',
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
// Always output the error first
|
|
52
|
+
handleError(error);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=cancel-submission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-submission.js","sourceRoot":"","sources":["../../../src/commands/cancel-submission/cancel-submission.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,wBAAwB,GACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,UAAU,EAAE,O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AChC,WAAW,CAAC,KAAK,CAAC,CAAA;QAElB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;AACH,CAAC,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { outputDebug } from '@shopify/cli-kit/node/output';
|
|
3
|
-
import { AbortError, handler as handleError } from '@shopify/cli-kit/node/error';
|
|
4
3
|
import { getMiniManifest } from '../utils/minis-manifest.js';
|
|
5
|
-
import {
|
|
4
|
+
import { cancelSubmission } from './cancel-submission.js';
|
|
6
5
|
export function loadCommand(parentProgram) {
|
|
7
6
|
const command = new Command()
|
|
8
7
|
.name('cancel-submission')
|
|
@@ -12,10 +11,7 @@ export function loadCommand(parentProgram) {
|
|
|
12
11
|
const miniHandle = getMiniManifest().handle;
|
|
13
12
|
outputDebug(`Cancel submission args ${JSON.stringify(args)}`);
|
|
14
13
|
outputDebug(`Cancelling submission for mini "${miniHandle}" at ${process.cwd()}`);
|
|
15
|
-
|
|
16
|
-
`Contact us in Slack, or email ${EMAILS.CONTACT_US} to cancel the submission.`,
|
|
17
|
-
]));
|
|
18
|
-
process.exit(1);
|
|
14
|
+
await cancelSubmission();
|
|
19
15
|
});
|
|
20
16
|
parentProgram.addCommand(command);
|
|
21
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/cancel-submission/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/cancel-submission/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAA;AAG1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAA;AAEvD,MAAM,UAAU,WAAW,CAAC,aAAsB;IAChD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;SAC1B,IAAI,CAAC,mBAAmB,CAAC;SACzB,WAAW,CAAC,6BAA6B,CAAC;SAC1C,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC,CAAC,0BAA0B;SAC1E,MAAM,CAAC,KAAK,EAAE,IAAiC,EAAE,EAAE;QAClD,MAAM,UAAU,GAAG,eAAe,EAAE,CAAC,MAAM,CAAA;QAE3C,WAAW,CAAC,0BAA0B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC7D,WAAW,CACT,mCAAmC,UAAU,QAAQ,OAAO,CAAC,GAAG,EAAE,EAAE,CACrE,CAAA;QAED,MAAM,gBAAgB,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -8,6 +8,24 @@ import _ from 'lodash';
|
|
|
8
8
|
import { execAsync } from '../utils/exec-async-child-process.js';
|
|
9
9
|
import { wrapWithLoadingIndicator } from '../utils/wrap-with-loading-indicator.js';
|
|
10
10
|
import { generateMiniFromTemplate } from './utils/template-app.js';
|
|
11
|
+
const TEMPLATES = [
|
|
12
|
+
{
|
|
13
|
+
title: 'Snowdevil',
|
|
14
|
+
description: 'Example of a Shop Mini using prebuilt components',
|
|
15
|
+
value: 'snowboardz',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: 'Hello World',
|
|
19
|
+
description: 'Prebuilt components you can play around with',
|
|
20
|
+
value: 'hello_world',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'Blank',
|
|
24
|
+
value: 'blank',
|
|
25
|
+
description: 'A blank canvas so you can create from scratch',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
const TEMPLATE_VALUES = TEMPLATES.map(template => template.value);
|
|
11
29
|
function logSuccess(handle, outputDir, useYarn) {
|
|
12
30
|
console.log(`\n \nShop Mini`, chalk.green.bold(`${handle}`), 'created. Next steps:\n');
|
|
13
31
|
const currentPath = `${process.cwd()}/`;
|
|
@@ -23,38 +41,28 @@ function logSuccess(handle, outputDir, useYarn) {
|
|
|
23
41
|
chalk.cyan.underline.bold('https://shop.app/minis/docs/'));
|
|
24
42
|
console.log(chalk.dim(' Shop Minis documentation.\n \n'));
|
|
25
43
|
}
|
|
26
|
-
async function promptUser(miniNameArg) {
|
|
44
|
+
async function promptUser(miniNameArg, templateNameArg) {
|
|
27
45
|
const questions = [];
|
|
28
|
-
if (miniNameArg
|
|
46
|
+
if (!miniNameArg) {
|
|
29
47
|
questions.push({
|
|
30
48
|
type: 'text',
|
|
31
49
|
name: 'miniName',
|
|
32
50
|
message: `Give your Shop Mini a name. ${chalk.dim('You can change it later.\n')}`,
|
|
33
51
|
});
|
|
34
52
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
value: 'hello_world',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
title: 'Blank',
|
|
52
|
-
value: 'blank',
|
|
53
|
-
description: 'A blank canvas so you can create from scratch',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
initial: 0,
|
|
57
|
-
});
|
|
53
|
+
if (!templateNameArg || !TEMPLATE_VALUES.includes(templateNameArg)) {
|
|
54
|
+
// TODO: add some logs if the template name was wrong and explain why we are still prompting for selection
|
|
55
|
+
questions.push({
|
|
56
|
+
type: 'select',
|
|
57
|
+
name: 'templateName',
|
|
58
|
+
message: 'Select a template',
|
|
59
|
+
choices: TEMPLATES,
|
|
60
|
+
initial: 0,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (!questions.length) {
|
|
64
|
+
return { miniName: miniNameArg, templateName: templateNameArg };
|
|
65
|
+
}
|
|
58
66
|
const onCancel = () => {
|
|
59
67
|
console.log('\nShop Mini creation stopped at your request. Name not saved.\n');
|
|
60
68
|
process.exit(0);
|
|
@@ -71,7 +79,8 @@ export function loadCommand(parentProgram) {
|
|
|
71
79
|
.description('Create a new Shop Mini')
|
|
72
80
|
.argument('[mini name]', 'the name of your mini')
|
|
73
81
|
// TODO: Remove `--useYarn` https://github.com/Shopify/shop-minis-cli/issues/190
|
|
74
|
-
.option('--useYarn', 'Use yarn as package manager instead of npm')
|
|
82
|
+
.option('--useYarn', '(deprecated) Use yarn as package manager instead of npm')
|
|
83
|
+
.option('--template [template name]', 'Name of the template to use (blank, hello_world, snowboardz)')
|
|
75
84
|
.option('--output-dir [path]', 'Specify an output directory for the mini')
|
|
76
85
|
.action(async (miniNameArg, options = {}) => {
|
|
77
86
|
const currentDirectoryName = path.basename(process.cwd());
|
|
@@ -84,7 +93,7 @@ export function loadCommand(parentProgram) {
|
|
|
84
93
|
process.exit(1);
|
|
85
94
|
}
|
|
86
95
|
try {
|
|
87
|
-
const { miniName, templateName } = await promptUser(miniNameArg);
|
|
96
|
+
const { miniName, templateName } = await promptUser(miniNameArg, options.template);
|
|
88
97
|
const handle = _.kebabCase(miniName);
|
|
89
98
|
await wrapWithLoadingIndicator(generateMiniFromTemplate(miniName, handle, templateName, outputDir), {
|
|
90
99
|
loadingMessage: 'Fetching template...',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/create-mini/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAC,6BAA6B,EAAC,MAAM,4CAA4C,CAAA;AACxF,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAA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ACxD,cAAc,EAAE,wBAAwB;aACzC,CAAC,CAAA;YACF,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;SACvC;QAAC,OAAO,GAAQ,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,IAAI,GAAG,CAAC,CAAA;YAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SAChB;IACH,CAAC,CACF,CAAA;IAEH,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -2,23 +2,10 @@ import url from 'node:url';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
4
|
import fs from 'fs-extra';
|
|
5
|
-
import replaceInFile from 'replace-in-file';
|
|
6
5
|
import _ from 'lodash';
|
|
7
6
|
import { CLI_VERSION } from '../../config.js';
|
|
7
|
+
import { replaceStringsInTemplate } from '../../utils/replace-strings-in-template.js';
|
|
8
8
|
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
9
|
-
async function replaceStringsInTemplate(dir, stringsToReplace) {
|
|
10
|
-
for (const [replaceKey, replaceValue] of Object.entries(stringsToReplace)) {
|
|
11
|
-
const replaceOptions = {
|
|
12
|
-
files: [`${dir}/**/*.*`],
|
|
13
|
-
from: new RegExp(replaceKey, 'g'),
|
|
14
|
-
to: replaceValue,
|
|
15
|
-
optionsForFiles: {
|
|
16
|
-
ignore: ['**/node_modules/**'],
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
await replaceInFile.replaceInFile(replaceOptions);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
9
|
export async function generateMiniFromTemplate(name, handle, templateName, outputDir = '.') {
|
|
23
10
|
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), `${handle}-`));
|
|
24
11
|
const miniTemplateDir = await path.join(__dirname, '../../../../templates', `__template_${templateName}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-app.js","sourceRoot":"","sources":["../../../../src/commands/create-mini/utils/template-app.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"template-app.js","sourceRoot":"","sources":["../../../../src/commands/create-mini/utils/template-app.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,CAAC,MAAM,QAAQ,CAAA;AAEtB,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAC,wBAAwB,EAAC,MAAM,4CAA4C,CAAA;AAEnF,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAElE,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAAY,EACZ,MAAc,EACd,YAAoB,EACpB,SAAS,GAAG,GAAG;IAEf,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,GAAG,CAAC,CAAC,CAAA;IACrE,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,IAAI,CACrC,SAAS,EACT,uBAAuB,EACvB,cAAc,YAAY,EAAE,CAC7B,CAAA;IACD,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IAEzE,MAAM,gBAAgB,GAAG;QACvB,iBAAiB,EAAE,IAAI;QACvB,+BAA+B,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACtE,8BAA8B,EAAE,MAAM;QACtC,0BAA0B,EAAE,WAAW;KACxC,CAAA;IAED,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,IAAI,CAC5C,SAAS,EACT,uBAAuB,EACvB,mBAAmB,CACpB,CAAA;IAED,MAAM,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAA;IAC7C,MAAM,EAAE,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;IACtC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAA;IAC9E,MAAM,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACxD,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;AAC3C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
export async function getBundleUrl({ host }) {
|
|
2
3
|
return `http://${host}:8082/index.bundle`;
|
|
3
4
|
}
|
|
@@ -13,13 +14,45 @@ async function getDeeplinkParams(miniHandle, options) {
|
|
|
13
14
|
const stringifiedParams = JSON.stringify(params);
|
|
14
15
|
return Buffer.from(stringifiedParams).toString('base64');
|
|
15
16
|
}
|
|
17
|
+
const ALLOWED_ENTRY_POINT_PARAMS = [
|
|
18
|
+
'product_id',
|
|
19
|
+
'shop_id',
|
|
20
|
+
'product_variant_id',
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Reads the content of the file entry-point-params.json in the rootpath of a Mini folder, which should be of the shape Record<string, string>.
|
|
24
|
+
* Then, formats the object as an URL query string and returns it.
|
|
25
|
+
*
|
|
26
|
+
* Returns empty string if the file does not exist or if the format of its content is incorrect.
|
|
27
|
+
*/
|
|
28
|
+
function getDevelopmentEntryPointParams() {
|
|
29
|
+
try {
|
|
30
|
+
const localRequire = createRequire(import.meta.url);
|
|
31
|
+
const developmentParamsFilePath = `${process.cwd()}/entry-point-params.json`;
|
|
32
|
+
delete localRequire.cache[localRequire.resolve(developmentParamsFilePath)];
|
|
33
|
+
const persistedParams = localRequire(developmentParamsFilePath);
|
|
34
|
+
const paramsAsEntries = Object.entries(persistedParams).filter(([key, value]) => ALLOWED_ENTRY_POINT_PARAMS.includes(key) && Boolean(value));
|
|
35
|
+
const paramsQueryString = new URLSearchParams(paramsAsEntries).toString();
|
|
36
|
+
return paramsQueryString ? `?${paramsQueryString}` : '';
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
if (err?.code !== 'MODULE_NOT_FOUND' && err?.code !== 'ENOENT') {
|
|
40
|
+
console.log('\n ⚠️ Development entrypoints params ignored due to errors:\n');
|
|
41
|
+
console.log(err);
|
|
42
|
+
console.log('\n');
|
|
43
|
+
}
|
|
44
|
+
// do nothing, the development entrypoint params file is optional and might not exist.
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
16
48
|
export async function getDeeplink(miniHandle, options, universalLink = false) {
|
|
17
49
|
const deeplinkParams = await getDeeplinkParams(miniHandle, options);
|
|
50
|
+
const developmentParams = getDevelopmentEntryPointParams();
|
|
18
51
|
if (universalLink) {
|
|
19
|
-
return `https://shop.app/mini/remote/${deeplinkParams}`;
|
|
52
|
+
return `https://shop.app/mini/remote/${deeplinkParams}${developmentParams}`;
|
|
20
53
|
}
|
|
21
54
|
else {
|
|
22
|
-
return `arrive://mini/remote/${deeplinkParams}`;
|
|
55
|
+
return `arrive://mini/remote/${deeplinkParams}${developmentParams}`;
|
|
23
56
|
}
|
|
24
57
|
}
|
|
25
58
|
//# sourceMappingURL=deeplink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deeplink.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/deeplink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deeplink.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/deeplink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AAIzC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAC,IAAI,EAAoB;IAC1D,OAAO,UAAU,IAAI,oBAAoB,CAAA;AAC3C,CAAC;AAED,KAAK,UAAU,iBAAiB,CAC9B,UAAkB,EAClB,OAA0B;IAE1B,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAA;IAE7C,MAAM,MAAM,GAAG;QACb,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,kBAAkB,CAAC,SAAS,CAAC;QACxC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,qCAAqC;QAC5D,QAAQ,EAAE,EAAE;QACZ,iBAAiB,EAAE,IAAI;KACxB,CAAA;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAEhD,OAAO,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAC1D,CAAC;AAED,MAAM,0BAA0B,GAAG;IACjC,YAAY;IACZ,SAAS;IACT,oBAAoB;CACrB,CAAA;AACD;;;;;GAKG;AACH,SAAS,8BAA8B;IACrC,IAAI;QACF,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACnD,MAAM,yBAAyB,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,0BAA0B,CAAA;QAC5E,OAAO,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAA;QAE1E,MAAM,eAAe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|
|
3
3
|
import { CreateSubmissionMutation, CreateUploadMutation, SubmissionsQuery } from '../types/autogenerated/shop-minis-admin-api/graphql.js';
|
|
4
|
-
import { CreateUploadParameters } from '
|
|
4
|
+
import { CreateUploadParameters } from '../utils/graphql.js';
|
|
5
5
|
interface UserErrorShape {
|
|
6
6
|
code: string;
|
|
7
7
|
message: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbortError } from '@shopify/cli-kit/node/error';
|
|
2
2
|
import { formatPackageManagerCommand, outputDebug, } from '@shopify/cli-kit/node/output';
|
|
3
3
|
import { getPackageManager } from '../config.js';
|
|
4
|
-
import { getPendingSubmission } from '
|
|
4
|
+
import { getPendingSubmission } from '../utils/graphql.js';
|
|
5
5
|
const wrapErrorDefaultOptions = {
|
|
6
6
|
separator: ': ',
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/commands/submit/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACtD,OAAO,EACL,2BAA2B,EAC3B,WAAW,GACZ,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/commands/submit/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACtD,OAAO,EACL,2BAA2B,EAC3B,WAAW,GACZ,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAA;AAO9C,OAAO,EAAyB,oBAAoB,EAAC,MAAM,qBAAqB,CAAA;AAYhF,MAAM,uBAAuB,GAAqB;IAChD,SAAS,EAAE,IAAI;CAChB,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,KAAU,EACV,OAAe,EACf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,CAAA;YACnD,KAAK,kBAAkB;gBACrB,OAAO,gCAAgC,CAAA;YACzC;gBACE,OAAO,uBAAuB,CAAC,SAAS,CAAC,CAAA;SAC5C;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,IAAI,UAAU,CAClB,8CAA8C,EAC9C,aAAa,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAU,EAAE,EAAE;IACnD,MAAM,SAAS,CAAC,KAAK,EAAE,0CAA0C,EAAE;QACjE,SAAS,EAAE,EAAE;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -9,7 +9,7 @@ import { CLI_VERSION, getPackageManager, SHOP_MINIS_ADMIN_API_KEY, } from '../co
|
|
|
9
9
|
import { getFileChecksum } from '../utils/file.js';
|
|
10
10
|
import { execAsync } from '../utils/exec-async-child-process.js';
|
|
11
11
|
import { validateManifest } from '../utils/minis-manifest.js';
|
|
12
|
-
import { createSubmission as graphqlCreateSubmission, createUpload as graphqlCreateUpload, getPendingSubmission as graphqlGetPendingSubmission, getSubmissions as graphqlGetSubmissions, } from '
|
|
12
|
+
import { createSubmission as graphqlCreateSubmission, createUpload as graphqlCreateUpload, getPendingSubmission as graphqlGetPendingSubmission, getSubmissions as graphqlGetSubmissions, } from '../utils/graphql.js';
|
|
13
13
|
import { uploadFile } from './gcs.js';
|
|
14
14
|
import { wrapError, handleCreateUploadErrors, handleUploadFileErrors, handleCreateSubmissionErrors, generateExistingPendingSubmissionError, } from './errors.js';
|
|
15
15
|
import { SUBMISSION_PATHS, SUBMISSION_VALIDATION } from './config.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/commands/submit/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAA;AAEjC,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,UAAU,EAAC,MA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A;KAC9B;AACH,CAAC,CAAA;AAOD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,WAAW,EACX,cAAc,GACS,EAAE,EAAE;IAC3B,MAAM,EAAC,UAAU,EAAE,UAAU,EAAC,GAAG,MAAM,uBAAuB,CAAC;QAC7D,WAAW;QACX,QAAQ,EAAE,cAAc;KACzB,CAAC,CAAA;IAEF,MAAM,4BAA4B,CAAC,UAAU,CAAC,CAAA;IAE9C,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
|
|
@@ -21,6 +21,9 @@ declare const documents: {
|
|
|
21
21
|
description: string;
|
|
22
22
|
uploadId: string;
|
|
23
23
|
}>>;
|
|
24
|
+
'\n mutation CancelSubmission($reference: String!) {\n submissionCancel(reference: $reference) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': DocumentNode<types.CancelSubmissionMutation, types.Exact<{
|
|
25
|
+
reference: string;
|
|
26
|
+
}>>;
|
|
24
27
|
'\n query Submissions($first: Int) {\n submissions(first: $first) {\n nodes {\n reference\n description\n status\n submittedAt\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n': DocumentNode<types.SubmissionsQuery, types.Exact<{
|
|
25
28
|
first?: types.InputMaybe<number> | undefined;
|
|
26
29
|
}>>;
|
|
@@ -46,6 +49,10 @@ export declare function graphql(source: '\n mutation CreateUpload(\n $filena
|
|
|
46
49
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
47
50
|
*/
|
|
48
51
|
export declare function graphql(source: '\n mutation CreateSubmission($description: String!, $uploadId: ID!) {\n submissionCreate(description: $description, uploadId: $uploadId) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'): (typeof documents)['\n mutation CreateSubmission($description: String!, $uploadId: ID!) {\n submissionCreate(description: $description, uploadId: $uploadId) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'];
|
|
52
|
+
/**
|
|
53
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
54
|
+
*/
|
|
55
|
+
export declare function graphql(source: '\n mutation CancelSubmission($reference: String!) {\n submissionCancel(reference: $reference) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'): (typeof documents)['\n mutation CancelSubmission($reference: String!) {\n submissionCancel(reference: $reference) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n'];
|
|
49
56
|
/**
|
|
50
57
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
51
58
|
*/
|
|
@@ -13,6 +13,7 @@ import * as types from './graphql.js';
|
|
|
13
13
|
const documents = {
|
|
14
14
|
'\n mutation CreateUpload(\n $filename: String!\n $fileSize: Int!\n $checksum: String!\n $mimeType: String!\n ) {\n submissionUploadCreate(\n input: {\n filename: $filename\n fileSize: $fileSize\n checksum: $checksum\n mimeType: $mimeType\n }\n ) {\n upload {\n url\n headers\n id\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.CreateUploadDocument,
|
|
15
15
|
'\n mutation CreateSubmission($description: String!, $uploadId: ID!) {\n submissionCreate(description: $description, uploadId: $uploadId) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.CreateSubmissionDocument,
|
|
16
|
+
'\n mutation CancelSubmission($reference: String!) {\n submissionCancel(reference: $reference) {\n submission {\n reference\n description\n status\n submittedAt\n }\n userErrors {\n code\n message\n field\n }\n }\n }\n': types.CancelSubmissionDocument,
|
|
16
17
|
'\n query Submissions($first: Int) {\n submissions(first: $first) {\n nodes {\n reference\n description\n status\n submittedAt\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n': types.SubmissionsDocument,
|
|
17
18
|
};
|
|
18
19
|
export function graphql(source) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.js","sourceRoot":"","sources":["../../../../../src/commands/types/autogenerated/shop-minis-admin-api/gql.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC;;;;;;;;;GASG;AACH,MAAM,SAAS,GAAG;IAChB,+cAA+c,EAC7c,KAAK,CAAC,oBAAoB;IAC5B,mVAAmV,EACjV,KAAK,CAAC,wBAAwB;IAChC,4SAA4S,EAC1S,KAAK,CAAC,mBAAmB;CAC5B,CAAA;
|
|
1
|
+
{"version":3,"file":"gql.js","sourceRoot":"","sources":["../../../../../src/commands/types/autogenerated/shop-minis-admin-api/gql.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC;;;;;;;;;GASG;AACH,MAAM,SAAS,GAAG;IAChB,+cAA+c,EAC7c,KAAK,CAAC,oBAAoB;IAC5B,mVAAmV,EACjV,KAAK,CAAC,wBAAwB;IAChC,wSAAwS,EACtS,KAAK,CAAC,wBAAwB;IAChC,4SAA4S,EAC1S,KAAK,CAAC,mBAAmB;CAC5B,CAAA;AAyCD,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,OAAQ,SAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AACzC,CAAC"}
|
|
@@ -72,11 +72,30 @@ export type AttributionField = {
|
|
|
72
72
|
/** The value of the field. */
|
|
73
73
|
value: Scalars['String'];
|
|
74
74
|
};
|
|
75
|
+
/** A Call To Action entry point to a Shop Mini. */
|
|
76
|
+
export type CallToActionEntryPoint = EntryPoint & {
|
|
77
|
+
__typename?: 'CallToActionEntryPoint';
|
|
78
|
+
/** The ID of the entry point. */
|
|
79
|
+
id?: Maybe<Scalars['ID']>;
|
|
80
|
+
/** The text of the call to action. */
|
|
81
|
+
text: Scalars['String'];
|
|
82
|
+
};
|
|
75
83
|
/** The information needed to create a new call to action entry point. */
|
|
76
84
|
export type CallToActionEntryPointSetInput = {
|
|
77
85
|
/** The text of the call to action. */
|
|
78
86
|
text: Scalars['String'];
|
|
79
87
|
};
|
|
88
|
+
/** Content creator that may appear next to a Mini entry point. */
|
|
89
|
+
export type ContentCreatorInput = {
|
|
90
|
+
/** The avatar of the content creator. */
|
|
91
|
+
avatar: ImageInput;
|
|
92
|
+
/** The name of the content creator. */
|
|
93
|
+
name: Scalars['String'];
|
|
94
|
+
};
|
|
95
|
+
export type EntryPoint = {
|
|
96
|
+
/** The ID of the entry point. */
|
|
97
|
+
id?: Maybe<Scalars['ID']>;
|
|
98
|
+
};
|
|
80
99
|
/** Represents the entry points debug object. */
|
|
81
100
|
export type EntryPointDebug = {
|
|
82
101
|
__typename?: 'EntryPointDebug';
|
|
@@ -140,10 +159,18 @@ export type EntryPointSetInput = {
|
|
|
140
159
|
callToActionSetInput?: InputMaybe<CallToActionEntryPointSetInput>;
|
|
141
160
|
/** The image content card entry point set input. */
|
|
142
161
|
imageContentCardSetInput?: InputMaybe<ImageContentCardEntryPointSetInput>;
|
|
162
|
+
/** The live event entry point set input. */
|
|
163
|
+
liveEventSetInput?: InputMaybe<LiveEventEntryPointSetInput>;
|
|
164
|
+
/** The product image collection entry point set input. */
|
|
165
|
+
productImageCollectionSetInput?: InputMaybe<ProductImageCollectionEntryPointSetInput>;
|
|
166
|
+
/** The product video collection entry point set input. */
|
|
167
|
+
productVideoCollectionSetInput?: InputMaybe<ProductVideoCollectionEntryPointSetInput>;
|
|
143
168
|
};
|
|
144
169
|
/** Return type for the `entryPointSet` mutation. */
|
|
145
170
|
export type EntryPointSetPayload = {
|
|
146
171
|
__typename?: 'EntryPointSetPayload';
|
|
172
|
+
/** The entry point that was created or updated. */
|
|
173
|
+
entryPoint?: Maybe<EntryPoint>;
|
|
147
174
|
/** List of errors that occured while executing the mutation. */
|
|
148
175
|
userErrors: Array<EntryPointSetUserError>;
|
|
149
176
|
};
|
|
@@ -161,6 +188,10 @@ export type EntryPointSetUserError = {
|
|
|
161
188
|
export declare enum EntryPointSetUserErrorCode {
|
|
162
189
|
/** Error code when the entry point definition is not found from the manifest. */
|
|
163
190
|
DefinitionNotFound = "DEFINITION_NOT_FOUND",
|
|
191
|
+
/** Error code when the product ID is not provided when setting a Product Details Page entry point. */
|
|
192
|
+
MissingProductId = "MISSING_PRODUCT_ID",
|
|
193
|
+
/** Error code when the product is not eligible for Shop Minis. */
|
|
194
|
+
ProductNotEligible = "PRODUCT_NOT_ELIGIBLE",
|
|
164
195
|
/** Error code when the shop is not eligible for Shop Minis. */
|
|
165
196
|
ShopNotEligible = "SHOP_NOT_ELIGIBLE",
|
|
166
197
|
/** Error code when the shop is not found. */
|
|
@@ -204,6 +235,15 @@ export type EntryPointVisibilityRuleValidityUserError = {
|
|
|
204
235
|
/** The message describing the error. */
|
|
205
236
|
message: Scalars['String'];
|
|
206
237
|
};
|
|
238
|
+
/** Represents a video hosted outside of Shopify. */
|
|
239
|
+
export type ExternalVideoInput = {
|
|
240
|
+
/** A word or phrase to share the nature or contents of a media. */
|
|
241
|
+
alt?: InputMaybe<Scalars['String']>;
|
|
242
|
+
/** The embed URL of the video for the respective host. */
|
|
243
|
+
embedUrl: Scalars['URL'];
|
|
244
|
+
/** The preview image for the media. */
|
|
245
|
+
previewImage?: InputMaybe<ImageInput>;
|
|
246
|
+
};
|
|
207
247
|
/** The information needed to create a new image content card entry point. */
|
|
208
248
|
export type ImageContentCardEntryPointSetInput = {
|
|
209
249
|
/** The images of the image content card. */
|
|
@@ -218,6 +258,59 @@ export type ImageInput = {
|
|
|
218
258
|
/** The URL of the image. */
|
|
219
259
|
url: Scalars['URL'];
|
|
220
260
|
};
|
|
261
|
+
/** The event status of the Mini live event entry point. */
|
|
262
|
+
export declare enum LiveEventEntryPointEventStatusEnum {
|
|
263
|
+
/** The active status for Mini entry point event type. */
|
|
264
|
+
Active = "ACTIVE",
|
|
265
|
+
/** The post active status for Mini entry point event type. */
|
|
266
|
+
PostActive = "POST_ACTIVE",
|
|
267
|
+
/** The pre active status for Mini entry point event type. */
|
|
268
|
+
PreActive = "PRE_ACTIVE"
|
|
269
|
+
}
|
|
270
|
+
/** The information needed to create a new live event entry point. */
|
|
271
|
+
export type LiveEventEntryPointSetInput = {
|
|
272
|
+
/** The event start date for the live event entry point. */
|
|
273
|
+
eventStartDate: Scalars['ISO8601DateTime'];
|
|
274
|
+
/** The event status for the live event entry point. */
|
|
275
|
+
eventStatus: LiveEventEntryPointEventStatusEnum;
|
|
276
|
+
/** The image for the live event entry point. */
|
|
277
|
+
image?: InputMaybe<ImageInput>;
|
|
278
|
+
/** The notification topic for the live event entry point. */
|
|
279
|
+
notificationTopic: Scalars['String'];
|
|
280
|
+
/** The primary text for the live event entry point. */
|
|
281
|
+
primaryText: Scalars['String'];
|
|
282
|
+
/** The secondary text for the live event entry point. */
|
|
283
|
+
secondaryText?: InputMaybe<Scalars['String']>;
|
|
284
|
+
/** The video for the live event entry point. */
|
|
285
|
+
video?: InputMaybe<ExternalVideoInput>;
|
|
286
|
+
};
|
|
287
|
+
/** This is a Mini Product Image Collection entry point item. */
|
|
288
|
+
export type MiniProductImageCollectionEntryPointItemInput = {
|
|
289
|
+
/** The external ID for the item. Provided by the partner and opaque to the Shop app. */
|
|
290
|
+
externalId?: InputMaybe<Scalars['String']>;
|
|
291
|
+
/** The image for the item. */
|
|
292
|
+
image: ImageInput;
|
|
293
|
+
};
|
|
294
|
+
/** The layout of the Mini Product Image Collection entry point. */
|
|
295
|
+
export declare enum MiniProductImageCollectionEntryPointLayoutEnum {
|
|
296
|
+
/** The layout is a carousel. */
|
|
297
|
+
Carousel = "CAROUSEL",
|
|
298
|
+
/** The layout is a grid. */
|
|
299
|
+
Grid = "GRID"
|
|
300
|
+
}
|
|
301
|
+
/** This is a Mini Product Image Collection entry point item. */
|
|
302
|
+
export type MiniProductVideoCollectionEntryPointItemInput = {
|
|
303
|
+
/** The content creator for the entry point. */
|
|
304
|
+
contentCreator?: InputMaybe<ContentCreatorInput>;
|
|
305
|
+
/** The external ID for the item. Provided by the partner and opaque to the Shop app. */
|
|
306
|
+
externalId?: InputMaybe<Scalars['String']>;
|
|
307
|
+
/** The product ID for the entry point. */
|
|
308
|
+
productId?: InputMaybe<Scalars['ID']>;
|
|
309
|
+
/** The product variant ID for the entry point. */
|
|
310
|
+
productVariantId?: InputMaybe<Scalars['ID']>;
|
|
311
|
+
/** The video for the entry point. */
|
|
312
|
+
video: ExternalVideoInput;
|
|
313
|
+
};
|
|
221
314
|
export type Mutation = {
|
|
222
315
|
__typename?: 'Mutation';
|
|
223
316
|
/** Updates the status of an event entry point. */
|
|
@@ -317,6 +410,18 @@ export declare enum ProductEligibilityStatus {
|
|
|
317
410
|
/** The product is ineligible to appear in Shop. */
|
|
318
411
|
Ineligible = "INELIGIBLE"
|
|
319
412
|
}
|
|
413
|
+
/** The information needed to create a new product image collection entry point. */
|
|
414
|
+
export type ProductImageCollectionEntryPointSetInput = {
|
|
415
|
+
/** The items for the entry point. */
|
|
416
|
+
items: Array<MiniProductImageCollectionEntryPointItemInput>;
|
|
417
|
+
/** The layout for the entry point. */
|
|
418
|
+
layout: MiniProductImageCollectionEntryPointLayoutEnum;
|
|
419
|
+
};
|
|
420
|
+
/** The information needed to create or update a product video collection entry point. */
|
|
421
|
+
export type ProductVideoCollectionEntryPointSetInput = {
|
|
422
|
+
/** The items for the entry point. */
|
|
423
|
+
items: Array<MiniProductVideoCollectionEntryPointItemInput>;
|
|
424
|
+
};
|
|
320
425
|
export type Query = {
|
|
321
426
|
__typename?: 'Query';
|
|
322
427
|
/** Returns attributions for orders made through a Mini within Shop. */
|
|
@@ -575,6 +680,28 @@ export type CreateSubmissionMutation = {
|
|
|
575
680
|
}>;
|
|
576
681
|
};
|
|
577
682
|
};
|
|
683
|
+
export type CancelSubmissionMutationVariables = Exact<{
|
|
684
|
+
reference: Scalars['String'];
|
|
685
|
+
}>;
|
|
686
|
+
export type CancelSubmissionMutation = {
|
|
687
|
+
__typename?: 'Mutation';
|
|
688
|
+
submissionCancel: {
|
|
689
|
+
__typename?: 'SubmissionCancelPayload';
|
|
690
|
+
submission?: {
|
|
691
|
+
__typename?: 'Submission';
|
|
692
|
+
reference: string;
|
|
693
|
+
description: string;
|
|
694
|
+
status: SubmissionStatus;
|
|
695
|
+
submittedAt: any;
|
|
696
|
+
} | null;
|
|
697
|
+
userErrors: Array<{
|
|
698
|
+
__typename?: 'SubmissionCancelUserError';
|
|
699
|
+
code: SubmissionCancelUserErrorCode;
|
|
700
|
+
message: string;
|
|
701
|
+
field?: Array<string> | null;
|
|
702
|
+
}>;
|
|
703
|
+
};
|
|
704
|
+
};
|
|
578
705
|
export type SubmissionsQueryVariables = Exact<{
|
|
579
706
|
first?: InputMaybe<Scalars['Int']>;
|
|
580
707
|
}>;
|
|
@@ -608,6 +735,9 @@ export declare const CreateSubmissionDocument: DocumentNode<CreateSubmissionMuta
|
|
|
608
735
|
description: Scalars['String'];
|
|
609
736
|
uploadId: Scalars['ID'];
|
|
610
737
|
}>>;
|
|
738
|
+
export declare const CancelSubmissionDocument: DocumentNode<CancelSubmissionMutation, Exact<{
|
|
739
|
+
reference: Scalars['String'];
|
|
740
|
+
}>>;
|
|
611
741
|
export declare const SubmissionsDocument: DocumentNode<SubmissionsQuery, Exact<{
|
|
612
742
|
first?: InputMaybe<number> | undefined;
|
|
613
743
|
}>>;
|