@wix/cli-app 1.1.2 → 1.1.4

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 (92) hide show
  1. package/build/CreateVersionCommand-GQGVJR2K.js +4 -0
  2. package/build/CreateVersionCommand-GQGVJR2K.js.map +1 -0
  3. package/build/DevCommand-YM45UVWH.js +4 -0
  4. package/build/DevCommand-YM45UVWH.js.map +1 -0
  5. package/build/PreviewCommand-YUT7MBJD.js +4 -0
  6. package/build/ServeCommand-6EQIDSKT.js +4 -0
  7. package/build/ServeCommand-6EQIDSKT.js.map +1 -0
  8. package/build/build-2Z6AK6IG.js +4 -0
  9. package/build/build-2Z6AK6IG.js.map +1 -0
  10. package/build/chunk-4G4S755D.js +4 -0
  11. package/build/chunk-4G4S755D.js.map +1 -0
  12. package/build/chunk-5575RXZG.js +4 -0
  13. package/build/chunk-5575RXZG.js.map +1 -0
  14. package/build/chunk-ACRXISY6.js +23 -0
  15. package/build/chunk-ACRXISY6.js.map +1 -0
  16. package/build/{chunk-XCS5TRON.js → chunk-DA3635LY.js} +2 -2
  17. package/build/{chunk-3CWGDMDQ.js → chunk-DF4D5JWF.js} +2 -2
  18. package/build/{chunk-LWF2UMZJ.js → chunk-EIA66VA3.js} +59 -38
  19. package/build/chunk-EIA66VA3.js.map +1 -0
  20. package/build/chunk-ETUINW6P.js +11 -0
  21. package/build/chunk-ETUINW6P.js.map +1 -0
  22. package/build/chunk-JZGJM7PY.js +108 -0
  23. package/build/chunk-JZGJM7PY.js.map +1 -0
  24. package/build/chunk-MWPJ22NN.js +4 -0
  25. package/build/chunk-MWPJ22NN.js.map +1 -0
  26. package/build/{chunk-KZZTM2KZ.js → chunk-NTAE6I4M.js} +2 -2
  27. package/build/{chunk-SI3YQ623.js → chunk-Q2OX64Q5.js} +2 -2
  28. package/build/{chunk-BTGENTTK.js → chunk-SHI7GZUR.js} +2 -2
  29. package/build/chunk-VMFKU4BM.js +75 -0
  30. package/build/chunk-VMFKU4BM.js.map +1 -0
  31. package/build/chunk-VMK5HC33.js +4 -0
  32. package/build/chunk-VMK5HC33.js.map +1 -0
  33. package/build/{chunk-EUINJR7Q.js → chunk-ZYZVQVJV.js} +2 -2
  34. package/build/devtools-SH22YG5Z.js +10 -0
  35. package/build/devtools-SH22YG5Z.js.map +1 -0
  36. package/build/index.js +1 -1
  37. package/build/index.js.map +1 -1
  38. package/build/preview-4C3FDYR4.js +4 -0
  39. package/build/preview-4C3FDYR4.js.map +1 -0
  40. package/build/render-command-EB3I47CB.js +4 -0
  41. package/build/render-command-EB3I47CB.js.map +1 -0
  42. package/internal/component-hmr-wrapper.tsx +63 -0
  43. package/package.json +9 -7
  44. package/build/CreateVersionCommand-ACZ3W4S4.js +0 -4
  45. package/build/CreateVersionCommand-ACZ3W4S4.js.map +0 -1
  46. package/build/DevCommand-26MBVEGM.js +0 -4
  47. package/build/DevCommand-26MBVEGM.js.map +0 -1
  48. package/build/PreviewCommand-MNP242P6.js +0 -4
  49. package/build/ServeCommand-LKGC43F2.js +0 -4
  50. package/build/ServeCommand-LKGC43F2.js.map +0 -1
  51. package/build/SiteIdProvider-KTD7B3MF.js +0 -4
  52. package/build/SiteIdProvider-KTD7B3MF.js.map +0 -1
  53. package/build/build-K7HCLEXF.js +0 -4
  54. package/build/build-K7HCLEXF.js.map +0 -1
  55. package/build/chunk-2DYAAR6J.js +0 -4
  56. package/build/chunk-2DYAAR6J.js.map +0 -1
  57. package/build/chunk-5CKAQAZK.js +0 -23
  58. package/build/chunk-5CKAQAZK.js.map +0 -1
  59. package/build/chunk-7L53MGM2.js +0 -4
  60. package/build/chunk-7L53MGM2.js.map +0 -1
  61. package/build/chunk-AWOTQVII.js +0 -4
  62. package/build/chunk-AWOTQVII.js.map +0 -1
  63. package/build/chunk-BOTVIAFU.js +0 -4
  64. package/build/chunk-BOTVIAFU.js.map +0 -1
  65. package/build/chunk-DLDSY2KE.js +0 -7
  66. package/build/chunk-DLDSY2KE.js.map +0 -1
  67. package/build/chunk-DWQSXNK2.js +0 -4
  68. package/build/chunk-DWQSXNK2.js.map +0 -1
  69. package/build/chunk-FBPBJN3V.js +0 -4
  70. package/build/chunk-FBPBJN3V.js.map +0 -1
  71. package/build/chunk-LWF2UMZJ.js.map +0 -1
  72. package/build/chunk-NBPYX6UX.js +0 -106
  73. package/build/chunk-NBPYX6UX.js.map +0 -1
  74. package/build/chunk-TUKI3OEQ.js +0 -4
  75. package/build/chunk-TUKI3OEQ.js.map +0 -1
  76. package/build/chunk-XTSD25NR.js +0 -4
  77. package/build/chunk-XTSD25NR.js.map +0 -1
  78. package/build/chunk-YT3VC22W.js +0 -75
  79. package/build/chunk-YT3VC22W.js.map +0 -1
  80. package/build/devtools-D522YHXH.js +0 -10
  81. package/build/devtools-D522YHXH.js.map +0 -1
  82. package/build/preview-MTYF5TV5.js +0 -4
  83. package/build/preview-MTYF5TV5.js.map +0 -1
  84. package/build/render-command-VR53CY3H.js +0 -4
  85. package/build/render-command-VR53CY3H.js.map +0 -1
  86. /package/build/{PreviewCommand-MNP242P6.js.map → PreviewCommand-YUT7MBJD.js.map} +0 -0
  87. /package/build/{chunk-XCS5TRON.js.map → chunk-DA3635LY.js.map} +0 -0
  88. /package/build/{chunk-3CWGDMDQ.js.map → chunk-DF4D5JWF.js.map} +0 -0
  89. /package/build/{chunk-KZZTM2KZ.js.map → chunk-NTAE6I4M.js.map} +0 -0
  90. /package/build/{chunk-SI3YQ623.js.map → chunk-Q2OX64Q5.js.map} +0 -0
  91. /package/build/{chunk-BTGENTTK.js.map → chunk-SHI7GZUR.js.map} +0 -0
  92. /package/build/{chunk-EUINJR7Q.js.map → chunk-ZYZVQVJV.js.map} +0 -0
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as k}from"./chunk-2DYAAR6J.js";import{c as b}from"./chunk-XTSD25NR.js";import{a as T,b as F}from"./chunk-5CKAQAZK.js";import{b as S}from"./chunk-FBPBJN3V.js";import{a as y}from"./chunk-TUKI3OEQ.js";import{B as C,C as m,F as x,G as P,K as A,w as f,y as v,z as w}from"./chunk-NBPYX6UX.js";import{a as g,ba as _}from"./chunk-YT3VC22W.js";import{e as d,h as o}from"./chunk-HFDLXX7R.js";o();import B from"react";o();import i from"react";var j=d(g(),1);o();var U=d(g(),1);import h from"react";var p=({status:s,loadingText:e,successText:n})=>(0,U.match)(s,{NotRequested:()=>null,Loading:()=>h.createElement(w,{text:e}),Error:()=>null,Success:()=>h.createElement(f,{type:"success"},n)});var E=({onPreviewCreated:s,siteId:e,baseUrl:n})=>{let{model:r}=_(),{t}=P(),M=S(),q=A(),H=y({type:"backoffice"}),u=m(()=>F(r.config.appId,r.projectFolder,q,H)),l=m((a,c)=>T({model:r,siteId:e,arm:M,serveUrl:c})),{status:K}=C(async()=>{await k(r.projectFolder);let a=n??await u.execute(),{dashboardPageUrl:c,tag:N}=await l.execute(a);return s?.(N),c},[]);return i.createElement(i.Fragment,null,i.createElement(p,{status:u.status,loadingText:t("preview_command.uploading_files"),successText:t("preview_command.uploading_files_success")}),i.createElement(p,{status:l.status,loadingText:t("preview_command.creating_preview"),successText:t("preview_command.creating_preview_success")}),(0,j.match)(K,{Loading:()=>null,Error:()=>null,Success:({result:a})=>i.createElement(x,{i18nKey:"general.dashboard_page_text",components:[i.createElement(v,{url:a})]})}))};var at=({baseUrl:s,siteIdOverride:e,onPreviewCreated:n})=>{let r=t=>B.createElement(E,{baseUrl:s,siteId:t,onPreviewCreated:n});return e?r(e):B.createElement(b,null,({id:t})=>r(t))};export{at as a};
4
- //# sourceMappingURL=chunk-7L53MGM2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/PreviewCommand/PreviewCommand.tsx","../src/components/PreviewCommand/Preview.tsx","../src/components/PreviewCommand/ActionStatus.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport React from 'react';\nimport { SiteIdProvider } from '../../site-id/SiteIdProvider.js';\nimport { Preview } from './Preview.js';\n\nexport const PreviewCommand: FC<{\n baseUrl?: string;\n siteIdOverride?: string;\n onPreviewCreated?: (tag: string) => void;\n}> = ({ baseUrl, siteIdOverride, onPreviewCreated }) => {\n const renderPreview = (siteId: string) => (\n <Preview\n baseUrl={baseUrl}\n siteId={siteId}\n onPreviewCreated={onPreviewCreated}\n />\n );\n\n if (siteIdOverride) {\n return renderPreview(siteIdOverride);\n }\n\n return <SiteIdProvider>{({ id }) => renderPreview(id)}</SiteIdProvider>;\n};\n","import { useARMClient } from '@wix/arm-client';\nimport { Link, useAsync, useAsyncCallback } from '@wix/cli-ui-kit';\nimport type { FC } from 'react';\nimport React from 'react';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { match } from 'variant';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport { useProjectModel } from '../../model.js';\nimport { createPreviewTag } from '../../preview/create-preview-tag.js';\nimport { uploadApplication } from '../../hosting/upload-application.js';\nimport { assertBuildOutputExists } from '../../files/assert-build-output-exists.js';\nimport { ActionStatus } from './ActionStatus.js';\n\nexport const Preview: FC<{\n onPreviewCreated?: (tag: string) => void;\n siteId: string;\n baseUrl?: string;\n}> = ({ onPreviewCreated, siteId, baseUrl }) => {\n const { model } = useProjectModel();\n const { t } = useTranslation();\n const arm = useARMClient();\n const biLogger = useBiLogger();\n const httpClient = useHttpClient({ type: 'backoffice' });\n\n const uploadApplicationAction = useAsyncCallback(() =>\n uploadApplication(\n model.config.appId,\n model.projectFolder,\n biLogger,\n httpClient\n )\n );\n\n const createPreviewTagAction = useAsyncCallback((_, serveUrl: string) =>\n createPreviewTag({\n model,\n siteId,\n arm,\n serveUrl,\n })\n );\n\n const { status: createPreviewStatus } = useAsync(async () => {\n await assertBuildOutputExists(model.projectFolder);\n\n const serveUrl = baseUrl ?? (await uploadApplicationAction.execute());\n\n const { dashboardPageUrl, tag } = await createPreviewTagAction.execute(\n serveUrl\n );\n\n onPreviewCreated?.(tag);\n\n return dashboardPageUrl;\n }, []);\n\n return (\n <>\n <ActionStatus\n status={uploadApplicationAction.status}\n loadingText={t('preview_command.uploading_files')}\n successText={t('preview_command.uploading_files_success')}\n />\n <ActionStatus\n status={createPreviewTagAction.status}\n loadingText={t('preview_command.creating_preview')}\n successText={t('preview_command.creating_preview_success')}\n />\n {match(createPreviewStatus, {\n Loading: () => null,\n Error: () => null,\n Success: ({ result: dashboardPageUrl }) => (\n <Trans\n i18nKey=\"general.dashboard_page_text\"\n components={[<Link url={dashboardPageUrl} />]}\n />\n ),\n })}\n </>\n );\n};\n","import type { AsyncCallbackStatus } from '@wix/cli-ui-kit';\nimport { Alert, Spinner } from '@wix/cli-ui-kit';\nimport type { FC } from 'react';\nimport React from 'react';\nimport { match } from 'variant';\n\nexport const ActionStatus: FC<{\n status: AsyncCallbackStatus<unknown>;\n loadingText: string;\n successText: string;\n}> = ({ status, loadingText, successText }) =>\n match(status, {\n NotRequested: () => null,\n Loading: () => <Spinner text={loadingText} />,\n Error: () => null,\n Success: () => <Alert type=\"success\">{successText}</Alert>,\n });\n"],"mappings":";;uYAAAA,IACA,OAAOC,MAAW,QCDlBC,IAGA,OAAOC,MAAW,QAGlB,IAAAC,EAAsB,SCNtBC,IAIA,IAAAC,EAAsB,SADtB,OAAOC,MAAW,QAGX,IAAMC,EAIR,CAAC,CAAE,OAAAC,EAAQ,YAAAC,EAAa,YAAAC,CAAY,OACvC,SAAMF,EAAQ,CACZ,aAAc,IAAM,KACpB,QAAS,IAAMF,EAAA,cAACK,EAAA,CAAQ,KAAMF,EAAa,EAC3C,MAAO,IAAM,KACb,QAAS,IAAMH,EAAA,cAACM,EAAA,CAAM,KAAK,WAAWF,CAAY,CACpD,CAAC,EDFI,IAAMG,EAIR,CAAC,CAAE,iBAAAC,EAAkB,OAAAC,EAAQ,QAAAC,CAAQ,IAAM,CAC9C,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAAgB,EAC5B,CAAE,CAAE,EAAIC,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,EAAA,cAACE,EAAA,KAAgB,CAAC,CAAE,GAAAC,CAAG,IAAML,EAAcK,CAAE,CAAE,CACxD","names":["init_esm_shims","React","init_esm_shims","React","import_variant","init_esm_shims","import_variant","React","ActionStatus","status","loadingText","successText","Spinner","Alert","Preview","onPreviewCreated","siteId","baseUrl","model","useProjectModel","useTranslation","arm","useARMClient","biLogger","useBiLogger","httpClient","useHttpClient","uploadApplicationAction","useAsyncCallback","uploadApplication","createPreviewTagAction","_","serveUrl","createPreviewTag","createPreviewStatus","useAsync","assertBuildOutputExists","dashboardPageUrl","tag","React","ActionStatus","Trans","Link","PreviewCommand","baseUrl","siteIdOverride","onPreviewCreated","renderPreview","siteId","React","Preview","SiteIdProvider","id"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{h as t}from"./chunk-HFDLXX7R.js";t();import{createContext as e}from"react";var r=e(null);export{r as a};
4
- //# sourceMappingURL=chunk-AWOTQVII.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/site-id/context.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { Site } from '@wix/site-list-client';\n\nexport type SiteIdState = {\n site: Site;\n setSite: (site: Site) => Promise<void>;\n};\n\nexport const SiteIdContext = createContext<SiteIdState | null>(null);\n"],"mappings":";;wCAAAA,IAAA,OAAS,iBAAAC,MAAqB,QAQvB,IAAMC,EAAgBD,EAAkC,IAAI","names":["init_esm_shims","createContext","SiteIdContext"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as o}from"./chunk-AWOTQVII.js";import{h as e}from"./chunk-HFDLXX7R.js";e();import{useContext as r}from"react";function S(){let t=r(o);if(t===null)throw new Error("useSiteId() cannot be used without an <SiteIdProvider>");return t}export{S as a};
4
- //# sourceMappingURL=chunk-BOTVIAFU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/site-id/useSiteId.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { SiteIdContext, type SiteIdState } from './context.js';\n\nexport function useSiteId(): SiteIdState {\n const context = useContext(SiteIdContext);\n if (context === null) {\n throw new Error('useSiteId() cannot be used without an <SiteIdProvider>');\n }\n return context;\n}\n"],"mappings":";;gFAAAA,IAAA,OAAS,cAAAC,MAAkB,QAGpB,SAASC,GAAyB,CACvC,IAAMC,EAAUC,EAAWC,CAAa,EACxC,GAAIF,IAAY,KACd,MAAM,IAAI,MAAM,wDAAwD,EAE1E,OAAOA,CACT","names":["init_esm_shims","useContext","useSiteId","context","useContext","SiteIdContext"]}
@@ -1,7 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- var i="1.1.2";var a={"create_version_command_def.option.version_type":"The type of version you would like to create","create_version_command_def.option.approve_preview":"Approve preview automatically","create_version_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","dev_command_def.option.https":"Start local dev server on https","app_preview_command_def.option.site":"The site id to use for Application Preview urls, defaults to the current selected development site","app_preview_command_def.option.base_url":"The base url for when static files have been uploaded to an external cdn","app_preview_command_def.option.no_input":"Disable command interactivity","general.loading":"Loading...","general.no_site_id_configured":"You don't have a Development Site currently configured","general.site_id_not_found":`Your currently configured Development Site was not found ({id})
4
- This may happen because the site was deleted or your access has been revoked.
5
-
6
- Please select another Development Site to continue`,"general.dashboard_page_text":"<0>Click here</0> to open your application in the Wix Dashboard","general.dashboard_page_click_here":"Click here","general.close_screen":"Press <0/> to close","general.write_dev_log_failure.message":"Can not write logs to <0>{path}</0>","general.write_dev_log_failure.hint":"Make sure the file has proper permissions and is accessible","preview_command.creating_preview":"Creating a preview...","preview_command.creating_preview_success":"Preview created successfully!","preview_command.uploading_files":"Uploading your application files...","preview_command.uploading_files_success":"Uploaded successfully!","dev_command.dev_environment.loading":"Starting dev environment...","dev_command.dev_environment.started":"Local development environment ready.","dev_command.dev_environment.url":"Application served on <0/>","dev_command.dev_environment.https_url.open_info":"Press <0/> to open & approve dev server","dev_command.dev_environment.https_url.failed_to_open":"Unable to open <0/> for approving selfsigned certificate. Please manually access the link.","dev_command.dev_site.current":"Current Development Site: {name}","dev_command.dev_site.change":"Press <0/> to change your current Development Site","dev_command.site_selector.error":"Failed to change Development Site!","dev_command.dashboard_pages.open_page_error":"Failed to open the browser for <0>{title}</0>, use the following URL to open it in your browser:","dev_command.dashboard_pages_screen.select_label":"Select a dashboard page to open","dev_command.dashboard_pages_viewer.title":"Press a number key to open a dashboard page:","dev_command.dashboard_pages_viewer.show_more":"View more...","dev_command.dev_env_logs.title":"Dev Environment Logs: <0>(full logs at {path})</0>","dev_command.dev_env_logs.empty":"No logs to show","dev_command.config_change":"Loading App Manifest changes...","dev_command.config_update":"App Manifest updated. Refresh existing browser tabs to view the latest changes.","dev_command.config_didnt_update":"No App Manifest update occurred","serve_command.starting_serve_environment":"Starting serve environment...","serve_command.starting_serve_environment_success":"Serve environment started! <0/>","create_version_command.creating_version":"Creating a version...","create_version_command.creating_version_success":"Successfully created v{version}","create_version_command.current_version":"Your current version is: v{version}","create_version_command.confirm_version_creation":"Continue with creating the new version?","create_version_command.confirm_version_creation_aborted":"Version creation aborted","create_version_command.version_type_question":"What type of version would you like to create?","create_version_command.version_type_question_minor":"Minor (v{version})","create_version_command.version_type_question_major":"Major (v{version})","create_version_command.check_preview_before_version_release":"Before creating a new version, let's create a preview of your app","create_version_command.checking_validation_status":"Checking if this version can be submitted\u2026","create_version_command.version_validation_ok":"This version can be submitted for review in the <0>Dev Center<0/>","create_version_command.version_validation_has_failures":"This version has blockers preventing it from being submitted for review. Please fix them and submit your app in the <0>Dev Center<0/>"};export{i as a,a as b};
7
- //# sourceMappingURL=chunk-DLDSY2KE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../package.json","../src/messages.json"],"sourcesContent":["{\n \"name\": \"@wix/cli-app\",\n \"description\": \"CLI tool for Wix apps\",\n \"version\": \"1.1.2\",\n \"author\": \"Amit Dahan\",\n \"dependencies\": {\n \"vite\": \"5.0.2\"\n },\n \"devDependencies\": {\n \"@commander-js/extra-typings\": \"^11.1.0\",\n \"@types/lodash\": \"^4.14.200\",\n \"@types/mustache\": \"^4.2.5\",\n \"@wix/ambassador-ctp-app-cloud-deployer-service-v1-app-cloud-deployer\": \"^1.0.17\",\n \"@wix/ambassador-ctp-gradual-rollout-v1-app-config\": \"^1.0.64\",\n \"@wix/ambassador-devcenter-components-v1-component\": \"^1.0.361\",\n \"@wix/arm-client\": \"workspace:*\",\n \"@wix/bi-logger-wix-cli\": \"^1.31.0\",\n \"@wix/cli-app-definitions\": \"workspace:*\",\n \"@wix/cli-app-manifest\": \"workspace:*\",\n \"@wix/cli-auth\": \"workspace:*\",\n \"@wix/cli-command-contract\": \"workspace:*\",\n \"@wix/cli-core-definitions\": \"workspace:*\",\n \"@wix/cli-debug-log\": \"workspace:*\",\n \"@wix/cli-error\": \"workspace:*\",\n \"@wix/cli-error-reporting\": \"workspace:*\",\n \"@wix/cli-fs\": \"workspace:*\",\n \"@wix/cli-http-client\": \"workspace:*\",\n \"@wix/cli-http-client-react\": \"workspace:*\",\n \"@wix/cli-i18n\": \"workspace:*\",\n \"@wix/cli-logger\": \"workspace:*\",\n \"@wix/cli-site-selector\": \"workspace:*\",\n \"@wix/cli-ssl\": \"workspace:*\",\n \"@wix/cli-telemetry\": \"workspace:*\",\n \"@wix/cli-telemetry-react\": \"workspace:*\",\n \"@wix/cli-test-overrides\": \"workspace:*\",\n \"@wix/cli-ui-kit\": \"workspace:*\",\n \"@wix/dev-center-client\": \"workspace:*\",\n \"@wix/site-list-client\": \"workspace:*\",\n \"@wix/tsup-configs\": \"workspace:*\",\n \"@wix/user-browser\": \"workspace:*\",\n \"chalk\": \"^5.3.0\",\n \"chokidar\": \"^3.5.3\",\n \"commander\": \"^11.1.0\",\n \"fast-equals\": \"^5.0.1\",\n \"form-data\": \"^4.0.0\",\n \"globby\": \"^13.2.2\",\n \"mustache\": \"^4.2.0\",\n \"p-retry\": \"^5.1.2\",\n \"p-wait-for\": \"^5.0.2\",\n \"prompts\": \"^2.4.2\",\n \"semver\": \"^7.5.4\",\n \"tempy\": \"^3.1.0\",\n \"typed-emitter\": \"^2.1.0\",\n \"validate-element-name\": \"^3.0.0\",\n \"variant\": \"^3.0.0-dev.26\",\n \"vite-plugin-externals\": \"^0.6.2\",\n \"zod\": \"^3.22.4\"\n },\n \"engines\": {\n \"node\": \">= 18.16\"\n },\n \"exports\": {\n \".\": \"./build/index.js\",\n \"./client\": {\n \"types\": \"./client.d.ts\"\n },\n \"./internal/component-hmr-wrapper\": \"./internal/component-hmr-wrapper.tsx\",\n \"./tsconfig.app.json\": \"./tsconfig.app.json\",\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"build\",\n \"tsconfig.app.json\",\n \"client.d.ts\",\n \"internal\"\n ],\n \"peerDependencies\": {\n \"react\": \"^16.14 || ^17 || ^18\",\n \"react-dom\": \"^16.14 || ^17 || ^18\"\n },\n \"peerDependenciesMeta\": {\n \"react-dom\": {\n \"optional\": true\n }\n },\n \"perfer\": {\n \"bundleSize\": {\n \"files\": [\n {\n \"glob\": \"./build/index.js\",\n \"maxSize\": \"460kb\"\n }\n ]\n }\n },\n \"publishConfig\": {\n \"registry\": \"https://registry.npmjs.org/\",\n \"access\": \"public\",\n \"versionBumpStrategy\": \"manual\",\n \"logLevel\": \"verbose\"\n },\n \"scripts\": {\n \"build\": \"run -T tsup\",\n \"build:watch\": \"run build --watch\",\n \"lint\": \"run -T lint-package\",\n \"test\": \"yarn workspace @wix/cli-app-spec run test\",\n \"test:watch\": \"yarn workspace @wix/cli-app-spec run test:watch\",\n \"typecheck\": \"run -T tsc --noEmit\"\n },\n \"sideEffects\": false,\n \"type\": \"module\",\n \"wix\": {\n \"artifact\": {\n \"groupId\": \"com.wixpress.npm\",\n \"artifactId\": \"wix-cli-app\"\n },\n \"validations\": {\n \"postBuild\": [\n \"typecheck\",\n \"lint\"\n ]\n }\n }\n}\n","{\n \"create_version_command_def.option.version_type\": \"The type of version you would like to create\",\n \"create_version_command_def.option.approve_preview\": \"Approve preview automatically\",\n \"create_version_command_def.option.base_url\": \"The base url for when static files have been uploaded to an external cdn\",\n \"dev_command_def.option.https\": \"Start local dev server on https\",\n \"app_preview_command_def.option.site\": \"The site id to use for Application Preview urls, defaults to the current selected development site\",\n \"app_preview_command_def.option.base_url\": \"The base url for when static files have been uploaded to an external cdn\",\n \"app_preview_command_def.option.no_input\": \"Disable command interactivity\",\n \"general.loading\": \"Loading...\",\n \"general.no_site_id_configured\": \"You don't have a Development Site currently configured\",\n \"general.site_id_not_found\": \"Your currently configured Development Site was not found ({id})\\nThis may happen because the site was deleted or your access has been revoked.\\n\\nPlease select another Development Site to continue\",\n \"general.dashboard_page_text\": \"<0>Click here</0> to open your application in the Wix Dashboard\",\n \"general.dashboard_page_click_here\": \"Click here\",\n \"general.close_screen\": \"Press <0/> to close\",\n \"general.write_dev_log_failure.message\": \"Can not write logs to <0>{path}</0>\",\n \"general.write_dev_log_failure.hint\": \"Make sure the file has proper permissions and is accessible\",\n \"preview_command.creating_preview\": \"Creating a preview...\",\n \"preview_command.creating_preview_success\": \"Preview created successfully!\",\n \"preview_command.uploading_files\": \"Uploading your application files...\",\n \"preview_command.uploading_files_success\": \"Uploaded successfully!\",\n \"dev_command.dev_environment.loading\": \"Starting dev environment...\",\n \"dev_command.dev_environment.started\": \"Local development environment ready.\",\n \"dev_command.dev_environment.url\": \"Application served on <0/>\",\n \"dev_command.dev_environment.https_url.open_info\": \"Press <0/> to open & approve dev server\",\n \"dev_command.dev_environment.https_url.failed_to_open\": \"Unable to open <0/> for approving selfsigned certificate. Please manually access the link.\",\n \"dev_command.dev_site.current\": \"Current Development Site: {name}\",\n \"dev_command.dev_site.change\": \"Press <0/> to change your current Development Site\",\n \"dev_command.site_selector.error\": \"Failed to change Development Site!\",\n \"dev_command.dashboard_pages.open_page_error\": \"Failed to open the browser for <0>{title}</0>, use the following URL to open it in your browser:\",\n \"dev_command.dashboard_pages_screen.select_label\": \"Select a dashboard page to open\",\n \"dev_command.dashboard_pages_viewer.title\": \"Press a number key to open a dashboard page:\",\n \"dev_command.dashboard_pages_viewer.show_more\": \"View more...\",\n \"dev_command.dev_env_logs.title\": \"Dev Environment Logs: <0>(full logs at {path})</0>\",\n \"dev_command.dev_env_logs.empty\": \"No logs to show\",\n \"dev_command.config_change\": \"Loading App Manifest changes...\",\n \"dev_command.config_update\": \"App Manifest updated. Refresh existing browser tabs to view the latest changes.\",\n \"dev_command.config_didnt_update\": \"No App Manifest update occurred\",\n \"serve_command.starting_serve_environment\": \"Starting serve environment...\",\n \"serve_command.starting_serve_environment_success\": \"Serve environment started! <0/>\",\n \"create_version_command.creating_version\": \"Creating a version...\",\n \"create_version_command.creating_version_success\": \"Successfully created v{version}\",\n \"create_version_command.current_version\": \"Your current version is: v{version}\",\n \"create_version_command.confirm_version_creation\": \"Continue with creating the new version?\",\n \"create_version_command.confirm_version_creation_aborted\": \"Version creation aborted\",\n \"create_version_command.version_type_question\": \"What type of version would you like to create?\",\n \"create_version_command.version_type_question_minor\": \"Minor (v{version})\",\n \"create_version_command.version_type_question_major\": \"Major (v{version})\",\n \"create_version_command.check_preview_before_version_release\": \"Before creating a new version, let's create a preview of your app\",\n \"create_version_command.checking_validation_status\": \"Checking if this version can be submitted…\",\n \"create_version_command.version_validation_ok\": \"This version can be submitted for review in the <0>Dev Center<0/>\",\n \"create_version_command.version_validation_has_failures\": \"This version has blockers preventing it from being submitted for review. Please fix them and submit your app in the <0>Dev Center<0/>\"\n}\n"],"mappings":";;AAGE,IAAAA,EAAW,QCHb,IAAAC,EAAA,CACE,iDAAkD,+CAClD,oDAAqD,gCACrD,6CAA8C,2EAC9C,+BAAgC,kCAChC,sCAAuC,qGACvC,0CAA2C,2EAC3C,0CAA2C,gCAC3C,kBAAmB,aACnB,gCAAiC,yDACjC,4BAA6B;AAAA;AAAA;AAAA,oDAC7B,8BAA+B,kEAC/B,oCAAqC,aACrC,uBAAwB,sBACxB,wCAAyC,sCACzC,qCAAsC,8DACtC,mCAAoC,wBACpC,2CAA4C,gCAC5C,kCAAmC,sCACnC,0CAA2C,yBAC3C,sCAAuC,8BACvC,sCAAuC,uCACvC,kCAAmC,6BACnC,kDAAmD,0CACnD,uDAAwD,6FACxD,+BAAgC,mCAChC,8BAA+B,qDAC/B,kCAAmC,qCACnC,8CAA+C,mGAC/C,kDAAmD,kCACnD,2CAA4C,+CAC5C,+CAAgD,eAChD,iCAAkC,qDAClC,iCAAkC,kBAClC,4BAA6B,kCAC7B,4BAA6B,kFAC7B,kCAAmC,kCACnC,2CAA4C,gCAC5C,mDAAoD,kCACpD,0CAA2C,wBAC3C,kDAAmD,kCACnD,yCAA0C,sCAC1C,kDAAmD,0CACnD,0DAA2D,2BAC3D,+CAAgD,iDAChD,qDAAsD,qBACtD,qDAAsD,qBACtD,8DAA+D,oEAC/D,oDAAqD,kDACrD,+CAAgD,oEAChD,yDAA0D,uIAC5D","names":["version","messages_default"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as O}from"./chunk-TUKI3OEQ.js";import{c as S,d as x,f as h}from"./chunk-NBPYX6UX.js";import{G as y,J as R,a as D,c as d,d as l,h as o,i as w,m as P,n as q,o as b}from"./chunk-YT3VC22W.js";import{e as F,h as i}from"./chunk-HFDLXX7R.js";i();import{useMemo as E}from"react";i();i();var A={},I={sites:"_site"},J={createdDate:"google.protobuf.Timestamp",updatedDate:"google.protobuf.Timestamp",trashedDate:"google.protobuf.Timestamp"};function j(s){var t={"www._base_domain_":[{srcPath:"/_api/sites-list",destPath:"/api"},{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"feedback._base_domain_":[{srcPath:"/_api/sites-list",destPath:"/api"}],"manage._base_domain_":[{srcPath:"/_api/sites-list",destPath:"/api"},{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"},{srcPath:"/_api/sites-list-data",destPath:"/api/sites-list-data"}],"www.wixapis.com":[{srcPath:"/site-list/v2/sites",destPath:"/v2/sites"}],"api._api_base_domain_":[{srcPath:"/sites-list",destPath:""}],"bo._base_domain_":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}],"dev._base_domain_":[{srcPath:"/_api/sites-list/v2/sites",destPath:"/v2/sites"}]};return x(Object.assign(s,{domainToMappings:t}))}function g(s){var t=h(A,{}),e=t.toJSON,r=t.fromJSON,a=h(I,{_site:J}).fromJSON;function m(T){var L=T.host,C=e(s),N={entityFqdn:"wix.site_list.v2.site",method:"POST",methodFqn:"com.wixpress.sitelist.api.SiteListServiceV2.QuerySites",url:j({protoPath:"/v2/sites/query",data:C,host:L}),data:C,transformResponse:a};return N}return m.fromReq=r,m}i();var z=o.object({id:o.string(),displayName:o.string(),viewUrl:o.union([o.string().url(),o.literal("")])}),v=o.object({sites:o.array(z)});var c=class{constructor(t){this.httpClient=t;let{minRetryTimeout:e}=w();this.retryOptions={retries:3,minTimeout:e,maxTimeout:3*1e3}}retryOptions;querySites=async(t={})=>{try{let{data:e}=await S(()=>this.httpClient.request(g(t)),this.retryOptions);return v.parse(e).sites}catch(e){throw new d({code:l.FailedToQuerySites(),cause:e,info:{...t}})}};getSite=async t=>{try{let{data:e}=await S(()=>this.httpClient.request(g({query:{filter:{id:{$in:[t]}}}})),this.retryOptions),{sites:r}=v.parse(e);return r.at(0)??null}catch(e){throw new d({code:l.FailedToGetSite(),cause:e,info:{id:t}})}}};function V(){let s=O({type:"backoffice"});return E(()=>new c(s),[s])}i();i();async function _(s,t){let e=y(s);if(!await b(e))return null;try{let a=await q(e),m=await R.safeParseAsync(a);return m.success?m.data:null}catch(a){return t?.(a),null}}async function ft(s,t){let r={...await _(s)??{},...t};await P(y(s),r)}i();var u=F(D(),1),f=(0,u.variant)({NotConfigured:{},NotFound:(0,u.fields)(),Resolved:(0,u.fields)()});i();async function vt({projectFolder:s,siteListClient:{getSite:t},writeDebugLog:e}){let r=await _(s,e);if(!r?.siteId)return f.NotConfigured();let a=await t(r.siteId);return a?f.Resolved({site:a}):f.NotFound({id:r.siteId})}export{c as a,V as b,_ as c,ft as d,f as e,vt as f};
4
- //# sourceMappingURL=chunk-DWQSXNK2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../site-list-client/src/useSiteListClient.ts","../../site-list-client/src/site-list-client.ts","../../../node_modules/@wix/ambassador-site-list-v2-site/http.impl.ts","../../site-list-client/src/schemas.ts","../../site-list-client/src/index.ts","../src/files/app.config.ts","../src/site-id/site-id-state.ts","../src/site-id/resolve-configured-site.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { SiteListClient } from './site-list-client.js';\n\nexport function useSiteListClient(): SiteListClient {\n const httpClient = useHttpClient({ type: 'backoffice' });\n return useMemo(() => new SiteListClient(httpClient), [httpClient]);\n}\n","import pRetry from 'p-retry';\nimport type { Options } from 'p-retry';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { QuerySitesRequest } from '@wix/ambassador-site-list-v2-site/types';\nimport { querySites } from '@wix/ambassador-site-list-v2-site/http';\nimport type { HttpClient } from '@wix/cli-http-client';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { querySitesSchema } from './schemas.js';\n\nexport class SiteListClient {\n private readonly retryOptions: Options;\n\n constructor(private readonly httpClient: HttpClient) {\n const { minRetryTimeout } = getTestOverrides();\n\n this.retryOptions = {\n retries: 3,\n minTimeout: minRetryTimeout,\n maxTimeout: 3 * 1000,\n };\n }\n\n querySites = async (opts: QuerySitesRequest = {}) => {\n try {\n const { data } = await pRetry(\n () => this.httpClient.request(querySites(opts)),\n this.retryOptions\n );\n\n return querySitesSchema.parse(data).sites;\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToQuerySites(),\n cause: e,\n info: { ...opts },\n });\n }\n };\n\n getSite = async (id: string) => {\n try {\n const { data } = await pRetry(\n () =>\n this.httpClient.request(\n querySites({ query: { filter: { id: { $in: [id] } } } })\n ),\n this.retryOptions\n );\n\n const { sites } = querySitesSchema.parse(data);\n return sites.at(0) ?? null;\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToGetSite(),\n cause: e,\n info: { id },\n });\n }\n };\n}\n",null,"import { z } from 'zod';\n\nexport const siteSchema = z.object({\n id: z.string(),\n displayName: z.string(),\n viewUrl: z.union([z.string().url(), z.literal('')]),\n});\n\nexport const querySitesSchema = z.object({\n sites: z.array(siteSchema),\n});\n\nexport type Site = z.TypeOf<typeof siteSchema>;\n","export { SiteListClient } from './site-list-client.js';\nexport type { Site } from './schemas.js';\nexport { useSiteListClient } from './useSiteListClient.js';\n","import type { WriteDebugLogFn } from '@wix/cli-debug-log';\nimport { pathExists, readJson, writeJson } from '@wix/cli-fs';\nimport {\n type AppConfig,\n getAppConfigPath,\n appConfigSchema,\n} from '@wix/cli-app-definitions';\n\nexport async function readAppConfig(\n projectFolder: string,\n writeDebugLog?: WriteDebugLogFn\n) {\n const configPath = getAppConfigPath(projectFolder);\n const isConfigExist = await pathExists(configPath);\n\n if (!isConfigExist) {\n return null;\n }\n\n try {\n const json = await readJson(configPath);\n const appConfig = await appConfigSchema.safeParseAsync(json);\n\n if (!appConfig.success) {\n return null;\n }\n\n return appConfig.data;\n } catch (e) {\n writeDebugLog?.(e);\n return null;\n }\n}\n\nexport async function saveAppConfig(projectFolder: string, config: AppConfig) {\n const currentConfig = (await readAppConfig(projectFolder)) ?? {};\n const newConfig = {\n ...currentConfig,\n ...config,\n };\n\n await writeJson(getAppConfigPath(projectFolder), newConfig);\n}\n","import { variant, fields, type VariantOf, type TypeNames } from 'variant';\nimport { type Site } from '@wix/site-list-client';\n\nexport const SiteIdState = variant({\n NotConfigured: {},\n NotFound: fields<{ id: string }>(),\n Resolved: fields<{ site: Site }>(),\n});\n\nexport type SiteIdState<T extends TypeNames<typeof SiteIdState> = undefined> =\n VariantOf<typeof SiteIdState, T>;\n","import type { SiteListClient } from '@wix/site-list-client';\nimport type { WriteDebugLogFn } from '@wix/cli-debug-log';\nimport { readAppConfig } from '../files/app.config.js';\nimport { SiteIdState } from './site-id-state.js';\n\nexport async function resolveConfiguredSite({\n projectFolder,\n siteListClient: { getSite },\n writeDebugLog,\n}: {\n projectFolder: string;\n siteListClient: SiteListClient;\n writeDebugLog?: WriteDebugLogFn;\n}) {\n const config = await readAppConfig(projectFolder, writeDebugLog);\n\n if (!config?.siteId) {\n return SiteIdState.NotConfigured();\n }\n\n const site = await getSite(config.siteId);\n\n if (!site) {\n return SiteIdState.NotFound({ id: config.siteId });\n }\n\n return SiteIdState.Resolved({ site });\n}\n"],"mappings":";;oPAAAA,IAAA,OAAS,WAAAC,MAAe,QCAxBC,ICOAC,IAMA,IAAMC,EAAqB,CAAA,EACrBC,EAAsB,CAAE,MAAO,OAAO,EACtCC,EAAQ,CACZ,YAAa,4BACb,YAAa,4BACb,YAAa,6BAGf,SAASC,EACPC,EAA8C,CAE9C,IAAMC,EAAmB,CACvB,oBAAqB,CACnB,CACE,QAAS,mBACT,SAAU,QAEZ,CACE,QAAS,4BACT,SAAU,cAGd,yBAA0B,CACxB,CACE,QAAS,mBACT,SAAU,SAGd,uBAAwB,CACtB,CACE,QAAS,mBACT,SAAU,QAEZ,CACE,QAAS,4BACT,SAAU,aAEZ,CACE,QAAS,wBACT,SAAU,yBAGd,kBAAmB,CACjB,CACE,QAAS,sBACT,SAAU,cAGd,wBAAyB,CACvB,CACE,QAAS,cACT,SAAU,KAGd,mBAAoB,CAClB,CACE,QAAS,4BACT,SAAU,cAGd,oBAAqB,CACnB,CACE,QAAS,4BACT,SAAU,eAKhB,OAAOC,EAAW,OAAO,OAAOF,EAAM,CAAE,iBAAgBC,CAAA,CAAE,CAAC,CAC7D,CAOM,SAAUE,EACdC,EAA0B,CAEpB,IAAAC,EAAuCC,EAC3CV,EACA,CAAA,CAAE,EAFYW,EAAKF,EAAA,OAAYG,EAAOH,EAAA,SAItBI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,EAAS,MAAMC,EAAcJ,EAAeE,CAAa,EAE/D,GAAI,CAACC,GAAQ,OACX,OAAOE,EAAY,cAAc,EAGnC,IAAMC,EAAO,MAAML,EAAQE,EAAO,MAAM,EAExC,OAAKG,EAIED,EAAY,SAAS,CAAE,KAAAC,CAAK,CAAC,EAH3BD,EAAY,SAAS,CAAE,GAAIF,EAAO,MAAO,CAAC,CAIrD","names":["init_esm_shims","useMemo","init_esm_shims","init_esm_shims","_querySitesRequest","_querySitesResponse","_site","resolveComWixpressSitelistApiSiteListServiceV2Url","opts","domainToMappings","resolveUrl","querySites","payload","_a","serializer","toReq","fromReq","fromRes","__querySites","host","serializedData","metadata","init_esm_shims","siteSchema","z","querySitesSchema","SiteListClient","httpClient","minRetryTimeout","getTestOverrides","opts","data","pRetry","querySites","querySitesSchema","CliError","CliErrorCode","id","sites","useSiteListClient","httpClient","useHttpClient","useMemo","SiteListClient","init_esm_shims","init_esm_shims","readAppConfig","projectFolder","writeDebugLog","configPath","getAppConfigPath","pathExists","json","readJson","appConfig","appConfigSchema","e","saveAppConfig","config","newConfig","writeJson","init_esm_shims","import_variant","SiteIdState","init_esm_shims","resolveConfiguredSite","projectFolder","getSite","writeDebugLog","config","readAppConfig","SiteIdState","site"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as y}from"./chunk-TUKI3OEQ.js";import{c as v,d as C,f as i,i as A}from"./chunk-NBPYX6UX.js";import{a as I,c as d,d as g,h as u,i as P}from"./chunk-YT3VC22W.js";import{e as M,h as s}from"./chunk-HFDLXX7R.js";s();s();var N={},F={};var J={},U={},z={},H={};function w(p){var e={"api._api_base_domain_":[{srcPath:"/apps-release-manager-service-web",destPath:""}],"bo._base_domain_":[{srcPath:"/apps-release-manager-service-web",destPath:""}],"www._base_domain_":[{srcPath:"/apps-release-manager-service-web/artifacts-release-manager/app-releases",destPath:"/artifacts-release-manager/app-releases"},{srcPath:"/_api/apps-release-manager-service-web/artifacts-release-manager/app-releases",destPath:"/artifacts-release-manager/app-releases"},{srcPath:"/apps-release-manager-service-web/apps/create",destPath:"/apps/create"},{srcPath:"/apps-release-manager-service-web/apps/promote",destPath:"/apps/promote"},{srcPath:"/apps-release-manager-service-web/apps/tags",destPath:"/apps/tags"}],"manage._base_domain_":[{srcPath:"/apps-release-manager-service-web/apps/promote",destPath:"/apps/promote"},{srcPath:"/apps-release-manager-service-web/apps/create",destPath:"/apps/create"},{srcPath:"/apps-release-manager-service-web/apps/tags",destPath:"/apps/tags"}]};return C(Object.assign(p,{domainToMappings:e}))}function b(p){var e=i(N,{}),a=e.toJSON,t=e.fromJSON,o=i(F,{}).fromJSON;function r(m){var c=m.host,n=a(p),l={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"POST",methodFqn:"com.wix.ctp.AppsReleaseManagerService.CreateAppRelease",url:w({protoPath:"/apps/create/{appId}",data:n,host:c}),data:n,transformResponse:o};return l}return r.fromReq=t,r.__isAmbassador=!0,r}function q(p){var e=i(z,{}),a=e.toJSON,t=e.fromJSON,o=i(H,{}).fromJSON;function r(m){var c=m.host,n=a(p),l={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"PUT",methodFqn:"com.wix.ctp.AppsReleaseManagerService.UpdateAppRelease",url:w({protoPath:"/apps/tags/{tag}",data:n,host:c}),data:n,transformResponse:o};return l}return r.fromReq=t,r.__isAmbassador=!0,r}function x(p){var e=i(J,{}),a=e.toJSON,t=e.fromJSON,o=i(U,{}).fromJSON;function r(m){var c=m.host,n=a(p),l={entityFqdn:"wix.ctp.gradual_rollout.v1.app_config",method:"POST",methodFqn:"com.wix.ctp.AppsReleaseManagerService.PromoteAppReleaseToDevCenter",url:w({protoPath:"/apps/promote/{appId}/{tag}",data:n,host:c}),data:n,transformResponse:o};return l}return r.fromReq=t,r.__isAmbassador=!0,r}var _=M(I(),1);s();var S=u.object({newVersion:u.string()}),T=u.object({tag:u.string()});var{AppPermissionDenied:O}=g,D=(0,_.variant)({TagUpdated:{},TagNotFound:(0,_.fields)()}),R=class{constructor(e){this.httpClient=e;let{minRetryTimeout:a}=P();this.retryOptions={retries:3,minTimeout:a,maxTimeout:3*1e3}}retryOptions;createAppRelease=async(e,a)=>{try{let{data:t}=await v(()=>this.httpClient.request(b({appId:e.appId,componentConfigs:e.components,projectId:a})),this.retryOptions);return T.parse(t).tag}catch(t){throw A(t)&&t.response?.status===403?new d({code:O({appId:e.appId}),cause:t}):new d({code:g.FailedToCreateAppRelease(),cause:t})}};updateAppRelease=async(e,a)=>{try{return await v(()=>this.httpClient.request(q({appId:e.appId,componentConfigs:e.components,tag:a})),this.retryOptions),D.TagUpdated()}catch(t){if(A(t)){if(t.response?.status===404)return D.TagNotFound({cause:t});if(t.response?.status===403)throw new d({code:O({appId:e.appId}),cause:t})}throw new d({code:g.FailedToUpdateAppRelease(),cause:t})}};promoteToDevCenter=async(e,a,t)=>{let{data:o}=await v(()=>this.httpClient.request(x({appId:e,tag:a,versionType:t})),this.retryOptions);return S.parse(o)}};s();import{useMemo as E}from"react";function j(){let p=y({type:"backoffice"});return E(()=>new R(p),[p])}s();s();function de(p){let{appId:e,siteId:a,tag:t,component:o}=p,r=new URL(`dashboard/${a}/app/${e}${o.route}`,"https://manage.wix.com/");return r.searchParams.append("apps-override",t),r.toString()}export{R as a,j as b,de as c};
4
- //# sourceMappingURL=chunk-FBPBJN3V.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../arm-client/src/client.ts","../../../node_modules/@wix/ambassador-ctp-gradual-rollout-v1-app-config/http.impl.ts","../../arm-client/src/schemas.ts","../../arm-client/src/useARMClient.ts","../../arm-client/src/index.ts","../src/dashboard-page-url.ts"],"sourcesContent":["import type { HttpClient, HttpError } from '@wix/cli-http-client';\nimport type { AppManifest } from '@wix/cli-app-manifest';\nimport type { Options } from 'p-retry';\nimport type { VersionType } from '@wix/ambassador-ctp-gradual-rollout-v1-app-config/types';\nimport {\n createAppRelease,\n promoteAppReleaseToDevCenter,\n updateAppRelease,\n} from '@wix/ambassador-ctp-gradual-rollout-v1-app-config/http';\nimport pRetry from 'p-retry';\nimport { fields, variant } from 'variant';\nimport { isHttpError } from '@wix/cli-http-client';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { createAppReleaseSchema, promoteAppReleaseSchema } from './schemas.js';\n\nconst { AppPermissionDenied } = CliErrorCode;\n\nexport const UpdateAppReleaseData = variant({\n TagUpdated: {},\n TagNotFound: fields<{ cause: HttpError }>(),\n});\n\nexport class ARMClient {\n private readonly retryOptions: Options;\n\n constructor(private readonly httpClient: HttpClient) {\n const { minRetryTimeout } = getTestOverrides();\n\n this.retryOptions = {\n retries: 3,\n minTimeout: minRetryTimeout,\n maxTimeout: 3 * 1000,\n };\n }\n\n createAppRelease = async (manifest: AppManifest, projectId?: string) => {\n try {\n const { data } = await pRetry(\n () =>\n this.httpClient.request(\n createAppRelease({\n appId: manifest.appId,\n componentConfigs: manifest.components,\n projectId,\n })\n ),\n this.retryOptions\n );\n\n return createAppReleaseSchema.parse(data).tag;\n } catch (e) {\n if (isHttpError(e) && e.response?.status === 403) {\n throw new CliError({\n code: AppPermissionDenied({ appId: manifest.appId }),\n cause: e,\n });\n }\n throw new CliError({\n code: CliErrorCode.FailedToCreateAppRelease(),\n cause: e,\n });\n }\n };\n\n updateAppRelease = async (manifest: AppManifest, tag: string) => {\n try {\n await pRetry(\n () =>\n this.httpClient.request(\n updateAppRelease({\n appId: manifest.appId,\n componentConfigs: manifest.components,\n tag,\n })\n ),\n this.retryOptions\n );\n\n return UpdateAppReleaseData.TagUpdated();\n } catch (e) {\n if (isHttpError(e)) {\n if (e.response?.status === 404) {\n return UpdateAppReleaseData.TagNotFound({ cause: e });\n }\n if (e.response?.status === 403) {\n throw new CliError({\n code: AppPermissionDenied({ appId: manifest.appId }),\n cause: e,\n });\n }\n }\n throw new CliError({\n code: CliErrorCode.FailedToUpdateAppRelease(),\n cause: e,\n });\n }\n };\n\n promoteToDevCenter = async (\n appId: string,\n tag: string,\n versionType: VersionType\n ) => {\n const { data } = await pRetry(\n () =>\n this.httpClient.request(\n promoteAppReleaseToDevCenter({ appId, tag, versionType })\n ),\n this.retryOptions\n );\n\n return promoteAppReleaseSchema.parse(data);\n };\n}\n",null,"import { z } from 'zod';\n\nexport const promoteAppReleaseSchema = z.object({\n newVersion: z.string(),\n});\n\nexport const createAppReleaseSchema = z.object({\n tag: z.string(),\n});\n","import { useMemo } from 'react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { ARMClient } from './client.js';\n\nexport function useARMClient(): ARMClient {\n const httpClient = useHttpClient({ type: 'backoffice' });\n return useMemo(() => new ARMClient(httpClient), [httpClient]);\n}\n","export { ARMClient } from './client.js';\nexport { useARMClient } from './useARMClient.js';\n","import type { DevCenterComponent } from './dev-center/components/dev-center-component.js';\n\nexport function createDashboardPageUrl(options: {\n appId: string;\n siteId: string;\n component: DevCenterComponent<'DashboardPage'>;\n tag: string;\n}) {\n const { appId, siteId, tag, component } = options;\n\n const url = new URL(\n `dashboard/${siteId}/app/${appId}${component.route}`,\n 'https://manage.wix.com/'\n );\n\n url.searchParams.append('apps-override', tag);\n\n return url.toString();\n}\n"],"mappings":";;wNAAAA,ICWAC,IAIA,IAAMC,EAA2B,CAAA,EAC3BC,EAA4B,CAAA,EAGlC,IAAMC,EAAuC,CAAA,EACvCC,EAAwC,CAAA,EACxCC,EAA2B,CAAA,EAC3BC,EAA4B,CAAA,EAElC,SAASC,EACPC,EAA8C,CAE9C,IAAMC,EAAmB,CACvB,wBAAyB,CACvB,CACE,QAAS,oCACT,SAAU,KAGd,mBAAoB,CAClB,CACE,QAAS,oCACT,SAAU,KAGd,oBAAqB,CACnB,CACE,QACE,2EACF,SAAU,2CAEZ,CACE,QACE,gFACF,SAAU,2CAEZ,CACE,QAAS,gDACT,SAAU,gBAEZ,CACE,QAAS,iDACT,SAAU,iBAEZ,CACE,QAAS,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AAI,IACd,aAAaH,CAAM,QAAQD,CAAK,GAAGG,EAAU,KAAK,GAClD,yBACF,EAEA,OAAAC,EAAI,aAAa,OAAO,gBAAiBF,CAAG,EAErCE,EAAI,SAAS,CACtB","names":["init_esm_shims","init_esm_shims","_createAppReleaseRequest","_createAppReleaseResponse","_promoteAppReleaseToDevCenterRequest","_promoteAppReleaseToDevCenterResponse","_updateAppReleaseRequest","_updateAppReleaseResponse","resolveComWixCtpAppsReleaseManagerServiceUrl","opts","domainToMappings","resolveUrl","createAppRelease","payload","_a","serializer","_createAppReleaseRequest","toReq","fromReq","fromRes","_createAppReleaseResponse","__createAppRelease","host","serializedData","metadata","updateAppRelease","__updateAppRelease","promoteAppReleaseToDevCenter","payload","_a","serializer","_promoteAppReleaseToDevCenterRequest","toReq","fromReq","fromRes","_promoteAppReleaseToDevCenterResponse","__promoteAppReleaseToDevCenter","host","serializedData","metadata","resolveComWixCtpAppsReleaseManagerServiceUrl","import_variant","init_esm_shims","promoteAppReleaseSchema","z","createAppReleaseSchema","AppPermissionDenied","CliErrorCode","UpdateAppReleaseData","ARMClient","httpClient","minRetryTimeout","getTestOverrides","manifest","projectId","data","pRetry","createAppRelease","createAppReleaseSchema","e","isHttpError","CliError","tag","updateAppRelease","appId","versionType","promoteAppReleaseToDevCenter","promoteAppReleaseSchema","init_esm_shims","useMemo","useARMClient","httpClient","useHttpClient","useMemo","ARMClient","init_esm_shims","init_esm_shims","createDashboardPageUrl","options","appId","siteId","tag","component","url"]}