shopify 3.93.1 → 3.94.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.
Files changed (94) hide show
  1. package/dist/assets/dev-console/extensions/dev-console/assets/index-Bm_GpKQW.js +51 -0
  2. package/dist/assets/dev-console/index.html +1 -1
  3. package/dist/chunk-52KHWFYF.js +1 -0
  4. package/dist/chunk-7F3HZJH4.js +3 -0
  5. package/dist/{chunk-TCRHJ3ZH.js → chunk-7JFIBCHH.js} +66 -66
  6. package/dist/{chunk-PB3UDYWH.js → chunk-AQOYGO3U.js} +16 -16
  7. package/dist/{chunk-T57REQVZ.js → chunk-DBDY2YEY.js} +1 -1
  8. package/dist/chunk-DEW5QFGH.js +415 -0
  9. package/dist/chunk-FU2Y2M3M.js +5 -0
  10. package/dist/chunk-JBSYWYIP.js +2 -0
  11. package/dist/chunk-QYR5VPQA.js +4 -0
  12. package/dist/{chunk-SVYSLNQH.js → chunk-R6N4NGU6.js} +178 -182
  13. package/dist/{chunk-P3ASN7B5.js → chunk-SVA22NZQ.js} +209 -211
  14. package/dist/cli/commands/config/autoupgrade/constants.d.ts +5 -0
  15. package/dist/cli/commands/config/autoupgrade/constants.js +6 -0
  16. package/dist/cli/commands/config/autoupgrade/off.d.ts +7 -0
  17. package/dist/cli/commands/config/autoupgrade/off.js +22 -0
  18. package/dist/cli/commands/config/autoupgrade/on.d.ts +7 -0
  19. package/dist/cli/commands/config/autoupgrade/on.js +22 -0
  20. package/dist/cli/commands/config/autoupgrade/status.d.ts +7 -0
  21. package/dist/cli/commands/config/autoupgrade/status.js +30 -0
  22. package/dist/cli/commands/docs/generate.d.ts +1 -1
  23. package/dist/cli/commands/docs/generate.js +6 -3
  24. package/dist/cli/commands/upgrade.js +3 -1
  25. package/dist/cli/services/kitchen-sink/static.js +1 -1
  26. package/dist/configs/all.yml +3 -0
  27. package/dist/configs/recommended.yml +3 -0
  28. package/dist/data/filters.json +30 -0
  29. package/dist/data/objects.json +17 -1
  30. package/dist/data/setting.json +25 -0
  31. package/dist/data/shopify_system_translations.json +29 -6
  32. package/dist/error-handler-JHFQZGYG.js +1 -0
  33. package/dist/hooks/postrun.js +1 -1
  34. package/dist/hooks/prerun.js +1 -1
  35. package/dist/{http-proxy-node16-KBILO6A6.js → http-proxy-node16-TTURN6MD.js} +1 -1
  36. package/dist/index.js +1117 -1121
  37. package/dist/lib-3WHF5XD3.js +1 -0
  38. package/dist/{local-JCUIPKND.js → local-4PW2CHVR.js} +1 -1
  39. package/dist/{morph-6DCXNO2H.js → morph-DQREIZD2.js} +1 -1
  40. package/dist/node-package-manager-NTQEYCSE.js +1 -0
  41. package/dist/path-HUAU3YBW.js +1 -0
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/dist/{ui-XTVYPIVY.js → ui-7Z2HOOEO.js} +1 -1
  44. package/dist/{workerd-3GJRSBJN.js → workerd-VL54JTEU.js} +1 -1
  45. package/oclif.manifest.json +63 -3
  46. package/package.json +7 -6
  47. package/dist/assets/dev-console/extensions/dev-console/assets/index-BnXVL6nA.js +0 -78
  48. package/dist/chunk-NOSKVZWJ.js +0 -2
  49. package/dist/chunk-QJEBL3WX.js +0 -4
  50. package/dist/chunk-VLDSGLBP.js +0 -1
  51. package/dist/chunk-WOERFYNW.js +0 -415
  52. package/dist/chunk-XV44IQDO.js +0 -5
  53. package/dist/cli/commands/store/auth.d.ts +0 -15
  54. package/dist/cli/commands/store/auth.js +0 -46
  55. package/dist/cli/commands/store/execute.d.ts +0 -21
  56. package/dist/cli/commands/store/execute.js +0 -89
  57. package/dist/cli/services/store/auth/callback.d.ts +0 -8
  58. package/dist/cli/services/store/auth/callback.js +0 -140
  59. package/dist/cli/services/store/auth/config.d.ts +0 -6
  60. package/dist/cli/services/store/auth/config.js +0 -15
  61. package/dist/cli/services/store/auth/existing-scopes.d.ts +0 -5
  62. package/dist/cli/services/store/auth/existing-scopes.js +0 -40
  63. package/dist/cli/services/store/auth/index.d.ts +0 -18
  64. package/dist/cli/services/store/auth/index.js +0 -88
  65. package/dist/cli/services/store/auth/pkce.d.ts +0 -36
  66. package/dist/cli/services/store/auth/pkce.js +0 -49
  67. package/dist/cli/services/store/auth/recovery.d.ts +0 -4
  68. package/dist/cli/services/store/auth/recovery.js +0 -17
  69. package/dist/cli/services/store/auth/result.d.ts +0 -24
  70. package/dist/cli/services/store/auth/result.js +0 -39
  71. package/dist/cli/services/store/auth/scopes.d.ts +0 -4
  72. package/dist/cli/services/store/auth/scopes.js +0 -53
  73. package/dist/cli/services/store/auth/session-lifecycle.d.ts +0 -3
  74. package/dist/cli/services/store/auth/session-lifecycle.js +0 -69
  75. package/dist/cli/services/store/auth/session-store.d.ts +0 -32
  76. package/dist/cli/services/store/auth/session-store.js +0 -127
  77. package/dist/cli/services/store/auth/token-client.d.ts +0 -40
  78. package/dist/cli/services/store/auth/token-client.js +0 -95
  79. package/dist/cli/services/store/execute/admin-context.d.ts +0 -11
  80. package/dist/cli/services/store/execute/admin-context.js +0 -41
  81. package/dist/cli/services/store/execute/admin-transport.d.ts +0 -6
  82. package/dist/cli/services/store/execute/admin-transport.js +0 -42
  83. package/dist/cli/services/store/execute/index.d.ts +0 -13
  84. package/dist/cli/services/store/execute/index.js +0 -22
  85. package/dist/cli/services/store/execute/request.d.ts +0 -21
  86. package/dist/cli/services/store/execute/request.js +0 -88
  87. package/dist/cli/services/store/execute/result.d.ts +0 -3
  88. package/dist/cli/services/store/execute/result.js +0 -29
  89. package/dist/cli/services/store/execute/targets.d.ts +0 -18
  90. package/dist/cli/services/store/execute/targets.js +0 -21
  91. package/dist/error-handler-54XVSWV5.js +0 -1
  92. package/dist/lib-EN3PX6IK.js +0 -1
  93. package/dist/node-package-manager-P7JQBCHZ.js +0 -1
  94. package/dist/path-IT7KPARG.js +0 -1
@@ -1,5 +0,0 @@
1
- import{a as R,c as y,g as C}from"./chunk-VPRTJUIN.js";var q=y((Re,D)=>{C();var w=1e3,v=w*60,x=v*60,b=x*24,re=b*7,te=b*365.25;D.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ne(e);if(r==="number"&&isFinite(e))return t.long?oe(e):se(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ne(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*te;case"weeks":case"week":case"w":return r*re;case"days":case"day":case"d":return r*b;case"hours":case"hour":case"hrs":case"hr":case"h":return r*x;case"minutes":case"minute":case"mins":case"min":case"m":return r*v;case"seconds":case"second":case"secs":case"sec":case"s":return r*w;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function se(e){var t=Math.abs(e);return t>=b?Math.round(e/b)+"d":t>=x?Math.round(e/x)+"h":t>=v?Math.round(e/v)+"m":t>=w?Math.round(e/w)+"s":e+"ms"}function oe(e){var t=Math.abs(e);return t>=b?T(e,t,b,"day"):t>=x?T(e,t,x,"hour"):t>=v?T(e,t,v,"minute"):t>=w?T(e,t,w,"second"):e+" ms"}function T(e,t,r,n){var a=t>=r*1.5;return Math.round(e/r)+" "+n+(a?"s":"")}});var k=y((Ae,G)=>{C();function ie(e){r.debug=r,r.default=r,r.coerce=H,r.disable=F,r.enable=a,r.enabled=Z,r.humanize=q(),r.destroy=K,Object.keys(e).forEach(s=>{r[s]=e[s]}),r.names=[],r.skips=[],r.formatters={};function t(s){let o=0;for(let i=0;i<s.length;i++)o=(o<<5)-o+s.charCodeAt(i),o|=0;return r.colors[Math.abs(o)%r.colors.length]}r.selectColor=t;function r(s){let o,i=null,l,O;function f(...p){if(!f.enabled)return;let g=f,E=Number(new Date),Q=E-(o||E);g.diff=Q,g.prev=o,g.curr=E,o=E,p[0]=r.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let I=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(N,X)=>{if(N==="%%")return"%";I++;let j=r.formatters[X];if(typeof j=="function"){let ee=p[I];N=j.call(g,ee),p.splice(I,1),I--}return N}),r.formatArgs.call(g,p),(g.log||r.log).apply(g,p)}return f.namespace=s,f.useColors=r.useColors(),f.color=r.selectColor(s),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(l!==r.namespaces&&(l=r.namespaces,O=r.enabled(s)),O),set:p=>{i=p}}),typeof r.init=="function"&&r.init(f),f}function n(s,o){let i=r(this.namespace+(typeof o>"u"?":":o)+s);return i.log=this.log,i}function a(s){r.save(s),r.namespaces=s,r.names=[],r.skips=[];let o=(typeof s=="string"?s:"").trim().replace(" ",",").split(",").filter(Boolean);for(let i of o)i[0]==="-"?r.skips.push(i.slice(1)):r.names.push(i)}function m(s,o){let i=0,l=0,O=-1,f=0;for(;i<s.length;)if(l<o.length&&(o[l]===s[i]||o[l]==="*"))o[l]==="*"?(O=l,f=i,l++):(i++,l++);else if(O!==-1)l=O+1,f++,i=f;else return!1;for(;l<o.length&&o[l]==="*";)l++;return l===o.length}function F(){let s=[...r.names,...r.skips.map(o=>"-"+o)].join(",");return r.enable(""),s}function Z(s){for(let o of r.skips)if(m(s,o))return!1;for(let o of r.names)if(m(s,o))return!0;return!1}function H(s){return s instanceof Error?s.stack||s.message:s}function K(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}G.exports=ie});var P=y((d,A)=>{C();d.formatArgs=ue;d.save=ae;d.load=le;d.useColors=ce;d.storage=fe();d.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ce(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ue(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+A.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(r++,a==="%c"&&(n=r))}),e.splice(n,0,t)}d.log=console.debug||console.log||(()=>{});function ae(e){try{e?d.storage.setItem("debug",e):d.storage.removeItem("debug")}catch{}}function le(){let e;try{e=d.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function fe(){try{return localStorage}catch{}}A.exports=k()(d);var{formatters:Ce}=A.exports;Ce.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Y=y((Le,U)=>{"use strict";C();U.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),a=t.indexOf("--");return n!==-1&&(a===-1||n<a)}});var V=y((ke,$)=>{"use strict";C();var de=R("os"),z=R("tty"),h=Y(),{env:c}=process,M;h("no-color")||h("no-colors")||h("color=false")||h("color=never")?M=0:(h("color")||h("colors")||h("color=true")||h("color=always"))&&(M=1);function pe(){if("FORCE_COLOR"in c)return c.FORCE_COLOR==="true"?1:c.FORCE_COLOR==="false"?0:c.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(c.FORCE_COLOR,10),3)}function he(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function me(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=pe();n!==void 0&&(M=n);let a=r?M:n;if(a===0)return 0;if(r){if(h("color=16m")||h("color=full")||h("color=truecolor"))return 3;if(h("color=256"))return 2}if(e&&!t&&a===void 0)return 0;let m=a||0;if(c.TERM==="dumb")return m;if(process.platform==="win32"){let F=de.release().split(".");return Number(F[0])>=10&&Number(F[2])>=10586?Number(F[2])>=14931?3:2:1}if("CI"in c)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(F=>F in c)||c.CI_NAME==="codeship"?1:m;if("TEAMCITY_VERSION"in c)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0;if(c.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in c){let F=Number.parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return F>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(c.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)||"COLORTERM"in c?1:m}function S(e,t={}){let r=me(e,{streamIsTTY:e&&e.isTTY,...t});return he(r)}$.exports={supportsColor:S,stdout:S({isTTY:z.isatty(1)}),stderr:S({isTTY:z.isatty(2)})}});var W=y((u,L)=>{C();var Fe=R("tty"),_=R("util");u.init=xe;u.log=Oe;u.formatArgs=ye;u.save=we;u.load=ve;u.useColors=ge;u.destroy=_.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");u.colors=[6,2,3,4,5,1];try{let e=V();e&&(e.stderr||e).level>=2&&(u.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}u.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(a,m)=>m.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function ge(){return"colors"in u.inspectOpts?!!u.inspectOpts.colors:Fe.isatty(process.stderr.fd)}function ye(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,a="\x1B[3"+(n<8?n:"8;5;"+n),m=` ${a};1m${t} \x1B[0m`;e[0]=m+e[0].split(`
2
- `).join(`
3
- `+m),e.push(a+"m+"+L.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=be()+t+" "+e[0]}function be(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Oe(...e){return process.stderr.write(_.formatWithOptions(u.inspectOpts,...e)+`
4
- `)}function we(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function ve(){return process.env.DEBUG}function xe(e){e.inspectOpts={};let t=Object.keys(u.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=u.inspectOpts[t[r]]}L.exports=k()(u);var{formatters:J}=L.exports;J.o=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts).split(`
5
- `).map(t=>t.trim()).join(" ")};J.O=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts)}});var Ee=y((je,B)=>{C();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?B.exports=P():B.exports=W()});export{q as a,Y as b,V as c,Ee as d};
@@ -1,15 +0,0 @@
1
- import Command from '@shopify/cli-kit/node/base-command';
2
- export default class StoreAuth extends Command {
3
- static summary: string;
4
- static descriptionWithMarkdown: string;
5
- static description: string | undefined;
6
- static examples: string[];
7
- static flags: {
8
- store: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
- scopes: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
- 'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- };
14
- run(): Promise<void>;
15
- }
@@ -1,46 +0,0 @@
1
- var _a;
2
- import Command from '@shopify/cli-kit/node/base-command';
3
- import { globalFlags, jsonFlag } from '@shopify/cli-kit/node/cli';
4
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
5
- import { Flags } from '@oclif/core';
6
- import { authenticateStoreWithApp } from '../../services/store/auth/index.js';
7
- import { createStoreAuthPresenter } from '../../services/store/auth/result.js';
8
- class StoreAuth extends Command {
9
- async run() {
10
- const { flags } = await this.parse(_a);
11
- await authenticateStoreWithApp({
12
- store: flags.store,
13
- scopes: flags.scopes,
14
- }, {
15
- presenter: createStoreAuthPresenter(flags.json ? 'json' : 'text'),
16
- });
17
- }
18
- }
19
- _a = StoreAuth;
20
- StoreAuth.summary = 'Authenticate an app against a store for store commands.';
21
- StoreAuth.descriptionWithMarkdown = `Authenticates the app against the specified store for store commands and stores an online access token for later reuse.
22
-
23
- Re-run this command if the stored token is missing, expires, or no longer has the scopes you need.`;
24
- StoreAuth.description = _a.descriptionWithoutMarkdown();
25
- StoreAuth.examples = [
26
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products',
27
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --scopes read_products,write_products --json',
28
- ];
29
- StoreAuth.flags = {
30
- ...globalFlags,
31
- ...jsonFlag,
32
- store: Flags.string({
33
- char: 's',
34
- description: 'The myshopify.com domain of the store to authenticate against.',
35
- env: 'SHOPIFY_FLAG_STORE',
36
- parse: async (input) => normalizeStoreFqdn(input),
37
- required: true,
38
- }),
39
- scopes: Flags.string({
40
- description: 'Comma-separated Admin API scopes to request for the app.',
41
- env: 'SHOPIFY_FLAG_SCOPES',
42
- required: true,
43
- }),
44
- };
45
- export default StoreAuth;
46
- //# sourceMappingURL=auth.js.map
@@ -1,21 +0,0 @@
1
- import Command from '@shopify/cli-kit/node/base-command';
2
- export default class StoreExecute extends Command {
3
- static summary: string;
4
- static descriptionWithMarkdown: string;
5
- static description: string | undefined;
6
- static examples: string[];
7
- static flags: {
8
- query: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- 'query-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- variables: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- 'variable-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- store: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
- version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
- 'output-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
- 'allow-mutations': import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
- 'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
- };
20
- run(): Promise<void>;
21
- }
@@ -1,89 +0,0 @@
1
- var _a;
2
- import Command from '@shopify/cli-kit/node/base-command';
3
- import { globalFlags, jsonFlag } from '@shopify/cli-kit/node/cli';
4
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
5
- import { resolvePath } from '@shopify/cli-kit/node/path';
6
- import { Flags } from '@oclif/core';
7
- import { executeStoreOperation } from '../../services/store/execute/index.js';
8
- import { writeOrOutputStoreExecuteResult } from '../../services/store/execute/result.js';
9
- class StoreExecute extends Command {
10
- async run() {
11
- const { flags } = await this.parse(_a);
12
- const result = await executeStoreOperation({
13
- store: flags.store,
14
- query: flags.query,
15
- queryFile: flags['query-file'],
16
- variables: flags.variables,
17
- variableFile: flags['variable-file'],
18
- version: flags.version,
19
- allowMutations: flags['allow-mutations'],
20
- });
21
- await writeOrOutputStoreExecuteResult(result, flags['output-file'], flags.json ? 'json' : 'text');
22
- }
23
- }
24
- _a = StoreExecute;
25
- StoreExecute.summary = 'Execute GraphQL queries and mutations on a store.';
26
- StoreExecute.descriptionWithMarkdown = `Executes an Admin API GraphQL query or mutation on the specified store using previously stored app authentication.
27
-
28
- Run \`shopify store auth\` first to create stored auth for the store.
29
-
30
- Mutations are disabled by default. Re-run with \`--allow-mutations\` if you intend to modify store data.`;
31
- StoreExecute.description = _a.descriptionWithoutMarkdown();
32
- StoreExecute.examples = [
33
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }"',
34
- `<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query-file ./operation.graphql --variables '{"id":"gid://shopify/Product/1"}'`,
35
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "mutation { shop { id } }" --allow-mutations',
36
- '<%= config.bin %> <%= command.id %> --store shop.myshopify.com --query "query { shop { name } }" --json',
37
- ];
38
- StoreExecute.flags = {
39
- ...globalFlags,
40
- ...jsonFlag,
41
- query: Flags.string({
42
- char: 'q',
43
- description: 'The GraphQL query or mutation, as a string.',
44
- env: 'SHOPIFY_FLAG_QUERY',
45
- required: false,
46
- exactlyOne: ['query', 'query-file'],
47
- }),
48
- 'query-file': Flags.string({
49
- description: "Path to a file containing the GraphQL query or mutation. Can't be used with --query.",
50
- env: 'SHOPIFY_FLAG_QUERY_FILE',
51
- parse: async (input) => resolvePath(input),
52
- exactlyOne: ['query', 'query-file'],
53
- }),
54
- variables: Flags.string({
55
- char: 'v',
56
- description: 'The values for any GraphQL variables in your query or mutation, in JSON format.',
57
- env: 'SHOPIFY_FLAG_VARIABLES',
58
- exclusive: ['variable-file'],
59
- }),
60
- 'variable-file': Flags.string({
61
- description: "Path to a file containing GraphQL variables in JSON format. Can't be used with --variables.",
62
- env: 'SHOPIFY_FLAG_VARIABLE_FILE',
63
- parse: async (input) => resolvePath(input),
64
- exclusive: ['variables'],
65
- }),
66
- store: Flags.string({
67
- char: 's',
68
- description: 'The myshopify.com domain of the store to execute against.',
69
- env: 'SHOPIFY_FLAG_STORE',
70
- parse: async (input) => normalizeStoreFqdn(input),
71
- required: true,
72
- }),
73
- version: Flags.string({
74
- description: 'The API version to use for the query or mutation. Defaults to the latest stable version.',
75
- env: 'SHOPIFY_FLAG_VERSION',
76
- }),
77
- 'output-file': Flags.string({
78
- description: 'The file name where results should be written, instead of STDOUT.',
79
- env: 'SHOPIFY_FLAG_OUTPUT_FILE',
80
- parse: async (input) => resolvePath(input),
81
- }),
82
- 'allow-mutations': Flags.boolean({
83
- description: 'Allow GraphQL mutations to run against the target store.',
84
- env: 'SHOPIFY_FLAG_ALLOW_MUTATIONS',
85
- default: false,
86
- }),
87
- };
88
- export default StoreExecute;
89
- //# sourceMappingURL=execute.js.map
@@ -1,8 +0,0 @@
1
- export interface WaitForAuthCodeOptions {
2
- store: string;
3
- state: string;
4
- port: number;
5
- timeoutMs?: number;
6
- onListening?: () => void | Promise<void>;
7
- }
8
- export declare function waitForStoreAuthCode({ store, state, port, timeoutMs, onListening, }: WaitForAuthCodeOptions): Promise<string>;
@@ -1,140 +0,0 @@
1
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
2
- import { AbortError } from '@shopify/cli-kit/node/error';
3
- import { outputContent, outputDebug, outputToken } from '@shopify/cli-kit/node/output';
4
- import { timingSafeEqual } from 'crypto';
5
- import { createServer } from 'http';
6
- import { STORE_AUTH_CALLBACK_PATH, maskToken } from './config.js';
7
- import { retryStoreAuthWithPermanentDomainError } from './recovery.js';
8
- function renderAuthCallbackPage(title, message) {
9
- const safeTitle = title
10
- .replace(/&/g, '&amp;')
11
- .replace(/</g, '&lt;')
12
- .replace(/>/g, '&gt;')
13
- .replace(/"/g, '&quot;');
14
- const safeMessage = message
15
- .replace(/&/g, '&amp;')
16
- .replace(/</g, '&lt;')
17
- .replace(/>/g, '&gt;')
18
- .replace(/"/g, '&quot;');
19
- return `<!doctype html>
20
- <html lang="en">
21
- <head>
22
- <meta charset="utf-8" />
23
- <meta name="viewport" content="width=device-width, initial-scale=1" />
24
- <title>${safeTitle}</title>
25
- </head>
26
- <body style="margin:0;background:#f6f6f7;color:#202223;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;">
27
- <main style="max-width:32rem;margin:12vh auto;padding:0 1rem;">
28
- <section style="background:#fff;border:1px solid #e1e3e5;border-radius:12px;padding:1.5rem 1.25rem;box-shadow:0 1px 3px rgba(0,0,0,0.06);">
29
- <h1 style="margin:0 0 0.75rem 0;font-size:1.375rem;line-height:1.2;">${safeTitle}</h1>
30
- <p style="margin:0;font-size:1rem;line-height:1.5;">${safeMessage}</p>
31
- </section>
32
- </main>
33
- </body>
34
- </html>`;
35
- }
36
- export async function waitForStoreAuthCode({ store, state, port, timeoutMs = 5 * 60 * 1000, onListening, }) {
37
- const normalizedStore = normalizeStoreFqdn(store);
38
- return new Promise((resolve, reject) => {
39
- let settled = false;
40
- let isListening = false;
41
- const timeout = setTimeout(() => {
42
- settleWithError(new AbortError('Timed out waiting for OAuth callback.'));
43
- }, timeoutMs);
44
- const server = createServer((req, res) => {
45
- const requestUrl = new URL(req.url ?? '/', `http://127.0.0.1:${port}`);
46
- if (requestUrl.pathname !== STORE_AUTH_CALLBACK_PATH) {
47
- res.statusCode = 404;
48
- res.end('Not found');
49
- return;
50
- }
51
- const { searchParams } = requestUrl;
52
- const fail = (error, tryMessage) => {
53
- const abortError = typeof error === 'string' ? new AbortError(error, tryMessage) : error;
54
- res.statusCode = 400;
55
- res.setHeader('Content-Type', 'text/html');
56
- res.setHeader('Connection', 'close');
57
- res.once('finish', () => settleWithError(abortError));
58
- res.end(renderAuthCallbackPage('Authentication failed', abortError.message));
59
- };
60
- const returnedStore = searchParams.get('shop');
61
- outputDebug(outputContent `Received OAuth callback for shop ${outputToken.raw(returnedStore ?? 'unknown')}`);
62
- if (!returnedStore) {
63
- fail('OAuth callback store does not match the requested store.');
64
- return;
65
- }
66
- const normalizedReturnedStore = normalizeStoreFqdn(returnedStore);
67
- if (normalizedReturnedStore !== normalizedStore) {
68
- fail(retryStoreAuthWithPermanentDomainError(normalizedReturnedStore));
69
- return;
70
- }
71
- const returnedState = searchParams.get('state');
72
- if (!returnedState || !constantTimeEqual(returnedState, state)) {
73
- fail('OAuth callback state does not match the original request.');
74
- return;
75
- }
76
- const error = searchParams.get('error');
77
- if (error) {
78
- fail(`Shopify returned an OAuth error: ${error}`);
79
- return;
80
- }
81
- const code = searchParams.get('code');
82
- if (!code) {
83
- fail('OAuth callback did not include an authorization code.');
84
- return;
85
- }
86
- outputDebug(outputContent `Received authorization code ${outputToken.raw(maskToken(code))}`);
87
- res.statusCode = 200;
88
- res.setHeader('Content-Type', 'text/html');
89
- res.setHeader('Connection', 'close');
90
- res.once('finish', () => settle(() => resolve(code)));
91
- res.end(renderAuthCallbackPage('Authentication succeeded', 'You can close this window and return to the terminal.'));
92
- });
93
- const settle = (callback) => {
94
- if (settled)
95
- return;
96
- settled = true;
97
- clearTimeout(timeout);
98
- const finalize = () => {
99
- callback();
100
- };
101
- if (!isListening) {
102
- finalize();
103
- return;
104
- }
105
- server.close(() => {
106
- isListening = false;
107
- finalize();
108
- });
109
- server.closeIdleConnections?.();
110
- };
111
- const settleWithError = (error) => {
112
- settle(() => reject(error));
113
- };
114
- server.on('error', (error) => {
115
- if (error.code === 'EADDRINUSE') {
116
- settleWithError(new AbortError(`Port ${port} is already in use.`, `Free port ${port} and re-run ${outputToken.genericShellCommand(`shopify store auth --store ${store} --scopes <comma-separated-scopes>`).value}. Ensure that redirect URI is allowed in the app configuration.`));
117
- return;
118
- }
119
- settleWithError(error);
120
- });
121
- server.listen(port, '127.0.0.1', async () => {
122
- isListening = true;
123
- outputDebug(outputContent `PKCE callback server listening on http://127.0.0.1:${outputToken.raw(String(port))}${outputToken.raw(STORE_AUTH_CALLBACK_PATH)}`);
124
- if (!onListening)
125
- return;
126
- try {
127
- await onListening();
128
- }
129
- catch (error) {
130
- settleWithError(error instanceof Error ? error : new Error(String(error)));
131
- }
132
- });
133
- });
134
- }
135
- function constantTimeEqual(a, b) {
136
- if (a.length !== b.length)
137
- return false;
138
- return timingSafeEqual(Buffer.from(a, 'utf8'), Buffer.from(b, 'utf8'));
139
- }
140
- //# sourceMappingURL=callback.js.map
@@ -1,6 +0,0 @@
1
- export declare const STORE_AUTH_APP_CLIENT_ID = "7e9cb568cfd431c538f36d1ad3f2b4f6";
2
- export declare const DEFAULT_STORE_AUTH_PORT = 13387;
3
- export declare const STORE_AUTH_CALLBACK_PATH = "/auth/callback";
4
- export declare function storeAuthRedirectUri(port: number): string;
5
- export declare function storeAuthSessionKey(store: string): string;
6
- export declare function maskToken(token: string): string;
@@ -1,15 +0,0 @@
1
- export const STORE_AUTH_APP_CLIENT_ID = '7e9cb568cfd431c538f36d1ad3f2b4f6';
2
- export const DEFAULT_STORE_AUTH_PORT = 13387;
3
- export const STORE_AUTH_CALLBACK_PATH = '/auth/callback';
4
- export function storeAuthRedirectUri(port) {
5
- return `http://127.0.0.1:${port}${STORE_AUTH_CALLBACK_PATH}`;
6
- }
7
- export function storeAuthSessionKey(store) {
8
- return `${STORE_AUTH_APP_CLIENT_ID}::${store}`;
9
- }
10
- export function maskToken(token) {
11
- if (token.length <= 10)
12
- return '***';
13
- return `${token.slice(0, 10)}***`;
14
- }
15
- //# sourceMappingURL=config.js.map
@@ -1,5 +0,0 @@
1
- export interface ResolvedStoreAuthScopes {
2
- scopes: string[];
3
- authoritative: boolean;
4
- }
5
- export declare function resolveExistingStoreAuthScopes(store: string): Promise<ResolvedStoreAuthScopes>;
@@ -1,40 +0,0 @@
1
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
2
- import { outputContent, outputDebug, outputToken } from '@shopify/cli-kit/node/output';
3
- import { getCurrentStoredStoreAppSession } from './session-store.js';
4
- import { loadStoredStoreSession } from './session-lifecycle.js';
5
- import { fetchCurrentStoreAuthScopes } from './token-client.js';
6
- function truncateDebugMessage(message, length = 300) {
7
- return message.slice(0, length);
8
- }
9
- function formatStoreScopeLookupError(error) {
10
- if (error && typeof error === 'object' && 'response' in error) {
11
- const response = error.response;
12
- const status = response?.status;
13
- const details = response?.errors;
14
- if (typeof status === 'number') {
15
- const summary = typeof details === 'string' ? details : JSON.stringify(details);
16
- return truncateDebugMessage(summary ? `HTTP ${status}: ${summary}` : `HTTP ${status}`);
17
- }
18
- }
19
- return truncateDebugMessage(error instanceof Error ? error.message : String(error));
20
- }
21
- export async function resolveExistingStoreAuthScopes(store) {
22
- const normalizedStore = normalizeStoreFqdn(store);
23
- const storedSession = getCurrentStoredStoreAppSession(normalizedStore);
24
- if (!storedSession)
25
- return { scopes: [], authoritative: true };
26
- try {
27
- const usableSession = await loadStoredStoreSession(normalizedStore);
28
- const remoteScopes = await fetchCurrentStoreAuthScopes({
29
- store: usableSession.store,
30
- accessToken: usableSession.accessToken,
31
- });
32
- outputDebug(outputContent `Resolved current remote scopes for ${outputToken.raw(normalizedStore)}: ${outputToken.raw(remoteScopes.join(',') || 'none')}`);
33
- return { scopes: remoteScopes, authoritative: true };
34
- }
35
- catch (error) {
36
- outputDebug(outputContent `Falling back to locally stored scopes for ${outputToken.raw(normalizedStore)} after remote scope lookup failed: ${outputToken.raw(formatStoreScopeLookupError(error))}`);
37
- return { scopes: storedSession.scopes, authoritative: false };
38
- }
39
- }
40
- //# sourceMappingURL=existing-scopes.js.map
@@ -1,18 +0,0 @@
1
- import { openURL } from '@shopify/cli-kit/node/system';
2
- import { exchangeStoreAuthCodeForToken } from './token-client.js';
3
- import { waitForStoreAuthCode } from './callback.js';
4
- import { type ResolvedStoreAuthScopes } from './existing-scopes.js';
5
- import { type StoreAuthPresenter, type StoreAuthResult } from './result.js';
6
- interface StoreAuthInput {
7
- store: string;
8
- scopes: string;
9
- }
10
- interface StoreAuthDependencies {
11
- openURL: typeof openURL;
12
- waitForStoreAuthCode: typeof waitForStoreAuthCode;
13
- exchangeStoreAuthCodeForToken: typeof exchangeStoreAuthCodeForToken;
14
- resolveExistingScopes: (store: string) => Promise<ResolvedStoreAuthScopes>;
15
- presenter: StoreAuthPresenter;
16
- }
17
- export declare function authenticateStoreWithApp(input: StoreAuthInput, dependencies?: Partial<StoreAuthDependencies>): Promise<StoreAuthResult>;
18
- export {};
@@ -1,88 +0,0 @@
1
- import { normalizeStoreFqdn } from '@shopify/cli-kit/node/context/fqdn';
2
- import { AbortError } from '@shopify/cli-kit/node/error';
3
- import { outputContent, outputDebug, outputToken } from '@shopify/cli-kit/node/output';
4
- import { openURL } from '@shopify/cli-kit/node/system';
5
- import { STORE_AUTH_APP_CLIENT_ID } from './config.js';
6
- import { setStoredStoreAppSession } from './session-store.js';
7
- import { exchangeStoreAuthCodeForToken } from './token-client.js';
8
- import { waitForStoreAuthCode } from './callback.js';
9
- import { createPkceBootstrap } from './pkce.js';
10
- import { mergeRequestedAndStoredScopes, parseStoreAuthScopes, resolveGrantedScopes } from './scopes.js';
11
- import { resolveExistingStoreAuthScopes } from './existing-scopes.js';
12
- import { createStoreAuthPresenter } from './result.js';
13
- const defaultStoreAuthDependencies = {
14
- openURL,
15
- waitForStoreAuthCode,
16
- exchangeStoreAuthCodeForToken,
17
- resolveExistingScopes: resolveExistingStoreAuthScopes,
18
- presenter: createStoreAuthPresenter('text'),
19
- };
20
- export async function authenticateStoreWithApp(input, dependencies = {}) {
21
- const resolvedDependencies = { ...defaultStoreAuthDependencies, ...dependencies };
22
- const store = normalizeStoreFqdn(input.store);
23
- const requestedScopes = parseStoreAuthScopes(input.scopes);
24
- const existingScopeResolution = await resolvedDependencies.resolveExistingScopes(store);
25
- const scopes = mergeRequestedAndStoredScopes(requestedScopes, existingScopeResolution.scopes);
26
- const validationScopes = existingScopeResolution.authoritative ? scopes : requestedScopes;
27
- if (existingScopeResolution.scopes.length > 0) {
28
- outputDebug(outputContent `Merged requested scopes ${outputToken.raw(requestedScopes.join(','))} with existing scopes ${outputToken.raw(existingScopeResolution.scopes.join(','))} for ${outputToken.raw(store)}`);
29
- }
30
- const bootstrap = createPkceBootstrap({
31
- store,
32
- scopes,
33
- exchangeCodeForToken: resolvedDependencies.exchangeStoreAuthCodeForToken,
34
- });
35
- const { authorization: { authorizationUrl }, } = bootstrap;
36
- resolvedDependencies.presenter.openingBrowser();
37
- const code = await resolvedDependencies.waitForStoreAuthCode({
38
- ...bootstrap.waitForAuthCodeOptions,
39
- onListening: async () => {
40
- const opened = await resolvedDependencies.openURL(authorizationUrl);
41
- if (!opened)
42
- resolvedDependencies.presenter.manualAuthUrl(authorizationUrl);
43
- },
44
- });
45
- const tokenResponse = await bootstrap.exchangeCodeForToken(code);
46
- const userId = tokenResponse.associated_user?.id?.toString();
47
- if (!userId) {
48
- throw new AbortError('Shopify did not return associated user information for the online access token.');
49
- }
50
- const now = Date.now();
51
- const expiresAt = tokenResponse.expires_in ? new Date(now + tokenResponse.expires_in * 1000).toISOString() : undefined;
52
- const result = {
53
- store,
54
- userId,
55
- scopes: resolveGrantedScopes(tokenResponse, validationScopes),
56
- acquiredAt: new Date(now).toISOString(),
57
- expiresAt,
58
- refreshTokenExpiresAt: tokenResponse.refresh_token_expires_in
59
- ? new Date(now + tokenResponse.refresh_token_expires_in * 1000).toISOString()
60
- : undefined,
61
- hasRefreshToken: !!tokenResponse.refresh_token,
62
- associatedUser: tokenResponse.associated_user
63
- ? {
64
- id: tokenResponse.associated_user.id,
65
- email: tokenResponse.associated_user.email,
66
- firstName: tokenResponse.associated_user.first_name,
67
- lastName: tokenResponse.associated_user.last_name,
68
- accountOwner: tokenResponse.associated_user.account_owner,
69
- }
70
- : undefined,
71
- };
72
- setStoredStoreAppSession({
73
- store,
74
- clientId: STORE_AUTH_APP_CLIENT_ID,
75
- userId,
76
- accessToken: tokenResponse.access_token,
77
- refreshToken: tokenResponse.refresh_token,
78
- scopes: result.scopes,
79
- acquiredAt: result.acquiredAt,
80
- expiresAt,
81
- refreshTokenExpiresAt: result.refreshTokenExpiresAt,
82
- associatedUser: result.associatedUser,
83
- });
84
- outputDebug(outputContent `Session persisted for ${outputToken.raw(store)} (user ${outputToken.raw(userId)}, expires ${outputToken.raw(expiresAt ?? 'unknown')})`);
85
- resolvedDependencies.presenter.success(result);
86
- return result;
87
- }
88
- //# sourceMappingURL=index.js.map
@@ -1,36 +0,0 @@
1
- import type { StoreTokenResponse } from './token-client.js';
2
- import type { WaitForAuthCodeOptions } from './callback.js';
3
- interface StoreAuthorizationContext {
4
- store: string;
5
- scopes: string[];
6
- state: string;
7
- port: number;
8
- redirectUri: string;
9
- authorizationUrl: string;
10
- codeVerifier: string;
11
- }
12
- interface StoreAuthBootstrap {
13
- authorization: StoreAuthorizationContext;
14
- waitForAuthCodeOptions: WaitForAuthCodeOptions;
15
- exchangeCodeForToken: (code: string) => Promise<StoreTokenResponse>;
16
- }
17
- export declare function generateCodeVerifier(): string;
18
- export declare function computeCodeChallenge(verifier: string): string;
19
- export declare function buildStoreAuthUrl(options: {
20
- store: string;
21
- scopes: string[];
22
- state: string;
23
- redirectUri: string;
24
- codeChallenge: string;
25
- }): string;
26
- export declare function createPkceBootstrap(options: {
27
- store: string;
28
- scopes: string[];
29
- exchangeCodeForToken: (options: {
30
- store: string;
31
- code: string;
32
- codeVerifier: string;
33
- redirectUri: string;
34
- }) => Promise<StoreTokenResponse>;
35
- }): StoreAuthBootstrap;
36
- export {};
@@ -1,49 +0,0 @@
1
- import { randomUUID } from '@shopify/cli-kit/node/crypto';
2
- import { outputContent, outputDebug, outputToken } from '@shopify/cli-kit/node/output';
3
- import { createHash, randomBytes } from 'crypto';
4
- import { DEFAULT_STORE_AUTH_PORT, STORE_AUTH_APP_CLIENT_ID, storeAuthRedirectUri } from './config.js';
5
- export function generateCodeVerifier() {
6
- return randomBytes(32).toString('base64url');
7
- }
8
- export function computeCodeChallenge(verifier) {
9
- return createHash('sha256').update(verifier).digest('base64url');
10
- }
11
- export function buildStoreAuthUrl(options) {
12
- const params = new URLSearchParams();
13
- params.set('client_id', STORE_AUTH_APP_CLIENT_ID);
14
- params.set('scope', options.scopes.join(','));
15
- params.set('redirect_uri', options.redirectUri);
16
- params.set('state', options.state);
17
- params.set('response_type', 'code');
18
- params.set('code_challenge', options.codeChallenge);
19
- params.set('code_challenge_method', 'S256');
20
- return `https://${options.store}/admin/oauth/authorize?${params.toString()}`;
21
- }
22
- export function createPkceBootstrap(options) {
23
- const { store, scopes, exchangeCodeForToken } = options;
24
- const port = DEFAULT_STORE_AUTH_PORT;
25
- const state = randomUUID();
26
- const redirectUri = storeAuthRedirectUri(port);
27
- const codeVerifier = generateCodeVerifier();
28
- const codeChallenge = computeCodeChallenge(codeVerifier);
29
- const authorizationUrl = buildStoreAuthUrl({ store, scopes, state, redirectUri, codeChallenge });
30
- outputDebug(outputContent `Starting PKCE auth for ${outputToken.raw(store)} with scopes ${outputToken.raw(scopes.join(','))} (redirect_uri=${outputToken.raw(redirectUri)})`);
31
- return {
32
- authorization: {
33
- store,
34
- scopes,
35
- state,
36
- port,
37
- redirectUri,
38
- authorizationUrl,
39
- codeVerifier,
40
- },
41
- waitForAuthCodeOptions: {
42
- store,
43
- state,
44
- port,
45
- },
46
- exchangeCodeForToken: (code) => exchangeCodeForToken({ store, code, codeVerifier, redirectUri }),
47
- };
48
- }
49
- //# sourceMappingURL=pkce.js.map
@@ -1,4 +0,0 @@
1
- import { AbortError } from '@shopify/cli-kit/node/error';
2
- export declare function createStoredStoreAuthError(store: string): AbortError;
3
- export declare function reauthenticateStoreAuthError(message: string, store: string, scopes: string): AbortError;
4
- export declare function retryStoreAuthWithPermanentDomainError(returnedStore: string): AbortError;
@@ -1,17 +0,0 @@
1
- import { AbortError } from '@shopify/cli-kit/node/error';
2
- function storeAuthCommand(store, scopes) {
3
- return { command: `shopify store auth --store ${store} --scopes ${scopes}` };
4
- }
5
- function storeAuthCommandNextSteps(store, scopes) {
6
- return [[storeAuthCommand(store, scopes)]];
7
- }
8
- export function createStoredStoreAuthError(store) {
9
- return new AbortError(`No stored app authentication found for ${store}.`, 'To create stored auth for this store, run:', storeAuthCommandNextSteps(store, '<comma-separated-scopes>'));
10
- }
11
- export function reauthenticateStoreAuthError(message, store, scopes) {
12
- return new AbortError(message, 'To re-authenticate, run:', storeAuthCommandNextSteps(store, scopes));
13
- }
14
- export function retryStoreAuthWithPermanentDomainError(returnedStore) {
15
- return new AbortError('OAuth callback store does not match the requested store.', `Shopify returned ${returnedStore} during authentication. Re-run using the permanent store domain:`, storeAuthCommandNextSteps(returnedStore, '<comma-separated-scopes>'));
16
- }
17
- //# sourceMappingURL=recovery.js.map