@wix/cli-app 1.1.156 → 1.1.158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{AddPermissionCommand-HKUZPFD3.js → AddPermissionCommand-YO5M4B34.js} +2 -2
- package/build/{DevCommand-UULSO67M.js → DevCommand-P7CJ34BE.js} +10 -10
- package/build/{GenerateCommand-DXOPUMSH.js → GenerateCommand-CC72GG3E.js} +7 -7
- package/build/{LogsCommand-2FKNOZJ2.js → LogsCommand-35J2P7BQ.js} +3 -3
- package/build/PreviewCommand-A2SI3Q37.js +19 -0
- package/build/ReleaseCommand-WI4EN6FV.js +23 -0
- package/build/{ServeCommand-RTD5JNSM.js → ServeCommand-A36YAPEH.js} +3 -3
- package/build/{build-MX6EKV4S.js → build-LAB44XK5.js} +6 -6
- package/build/{chunk-LIYKHXED.js → chunk-2RZBJYV7.js} +6 -6
- package/build/{chunk-I37BDAFK.js → chunk-4KFDO7KL.js} +2 -2
- package/build/{chunk-LDFRHBRK.js → chunk-4KTJYCQP.js} +3 -3
- package/build/{chunk-WYGBVHUC.js → chunk-6BZEQC6M.js} +2 -2
- package/build/{chunk-GV3CONI4.js → chunk-BQJYCTI6.js} +90 -7
- package/build/chunk-BQJYCTI6.js.map +1 -0
- package/build/{chunk-WAMJNE27.js → chunk-C6NIYFFI.js} +2 -2
- package/build/{chunk-PMY6R3H4.js → chunk-EPCG3T5I.js} +2 -2
- package/build/{chunk-EABSTIC7.js → chunk-GRJOEMKT.js} +2 -2
- package/build/{chunk-T3AOL64K.js → chunk-K3VAVLDP.js} +3 -3
- package/build/{chunk-T3AOL64K.js.map → chunk-K3VAVLDP.js.map} +1 -1
- package/build/{chunk-SWKG77EZ.js → chunk-K6LMJQM6.js} +2 -2
- package/build/{chunk-XAE7EEK2.js → chunk-MMRNB5M2.js} +3 -3
- package/build/{chunk-DULYN22P.js → chunk-N5BEMLNL.js} +2 -2
- package/build/{chunk-VQRCCWTV.js → chunk-NFEXBEAR.js} +4 -4
- package/build/{chunk-G5DIMMP6.js → chunk-P4QQM3AX.js} +596 -276
- package/build/{chunk-G5DIMMP6.js.map → chunk-P4QQM3AX.js.map} +1 -1
- package/build/{chunk-NXIJG27Q.js → chunk-USH4HQ3A.js} +6 -6
- package/build/{chunk-HRDUIA3U.js → chunk-VW54PGPY.js} +2 -2
- package/build/chunk-VW54PGPY.js.map +1 -0
- package/build/{chunk-RXL6Q7VY.js → chunk-YA7HNVAC.js} +4 -4
- package/build/cloudflare-runtime/entry.js +309 -28
- package/build/cloudflare-runtime/getRegisteredExtensions.js +307 -26
- package/build/index.js +23 -23
- package/build/platform-sdk/chunk-QSTEFEOT.js +2 -0
- package/build/platform-sdk/chunk-QSTEFEOT.js.map +1 -0
- package/build/platform-sdk/chunk-RSZB4TBC.js +2 -0
- package/build/platform-sdk/chunk-RSZB4TBC.js.map +1 -0
- package/build/platform-sdk/chunk-UTEFPCPF.js +2 -0
- package/build/platform-sdk/chunk-UTEFPCPF.js.map +1 -0
- package/build/platform-sdk/dashboard.js +1 -1
- package/build/platform-sdk/editor.js +1 -1
- package/build/platform-sdk/sdk-context.js +1 -1
- package/build/platform-sdk/sdk-context.js.map +1 -1
- package/build/platform-sdk/site.js +1 -1
- package/build/platform-sdk/web-methods.js +1 -1
- package/build/{preview-P63X7ZP3.js → preview-MI7OZ3F2.js} +12 -12
- package/build/{release-5VHUAF3U.js → release-ARZIKXWP.js} +14 -14
- package/build/{render-command-UJOK5XJY.js → render-command-X3L65SLM.js} +5 -5
- package/package.json +3 -3
- package/build/PreviewCommand-S65WG22P.js +0 -19
- package/build/ReleaseCommand-ITEKL4OA.js +0 -23
- package/build/chunk-GV3CONI4.js.map +0 -1
- package/build/chunk-HRDUIA3U.js.map +0 -1
- package/build/platform-sdk/chunk-7EYXEF6M.js +0 -2
- package/build/platform-sdk/chunk-7EYXEF6M.js.map +0 -1
- package/build/platform-sdk/chunk-RJD2G2AE.js +0 -2
- package/build/platform-sdk/chunk-RJD2G2AE.js.map +0 -1
- package/build/platform-sdk/chunk-Y4HYNW3N.js +0 -2
- package/build/platform-sdk/chunk-Y4HYNW3N.js.map +0 -1
- /package/build/{AddPermissionCommand-HKUZPFD3.js.map → AddPermissionCommand-YO5M4B34.js.map} +0 -0
- /package/build/{DevCommand-UULSO67M.js.map → DevCommand-P7CJ34BE.js.map} +0 -0
- /package/build/{GenerateCommand-DXOPUMSH.js.map → GenerateCommand-CC72GG3E.js.map} +0 -0
- /package/build/{LogsCommand-2FKNOZJ2.js.map → LogsCommand-35J2P7BQ.js.map} +0 -0
- /package/build/{PreviewCommand-S65WG22P.js.map → PreviewCommand-A2SI3Q37.js.map} +0 -0
- /package/build/{ReleaseCommand-ITEKL4OA.js.map → ReleaseCommand-WI4EN6FV.js.map} +0 -0
- /package/build/{ServeCommand-RTD5JNSM.js.map → ServeCommand-A36YAPEH.js.map} +0 -0
- /package/build/{build-MX6EKV4S.js.map → build-LAB44XK5.js.map} +0 -0
- /package/build/{chunk-LIYKHXED.js.map → chunk-2RZBJYV7.js.map} +0 -0
- /package/build/{chunk-I37BDAFK.js.map → chunk-4KFDO7KL.js.map} +0 -0
- /package/build/{chunk-LDFRHBRK.js.map → chunk-4KTJYCQP.js.map} +0 -0
- /package/build/{chunk-WYGBVHUC.js.map → chunk-6BZEQC6M.js.map} +0 -0
- /package/build/{chunk-WAMJNE27.js.map → chunk-C6NIYFFI.js.map} +0 -0
- /package/build/{chunk-PMY6R3H4.js.map → chunk-EPCG3T5I.js.map} +0 -0
- /package/build/{chunk-EABSTIC7.js.map → chunk-GRJOEMKT.js.map} +0 -0
- /package/build/{chunk-SWKG77EZ.js.map → chunk-K6LMJQM6.js.map} +0 -0
- /package/build/{chunk-XAE7EEK2.js.map → chunk-MMRNB5M2.js.map} +0 -0
- /package/build/{chunk-DULYN22P.js.map → chunk-N5BEMLNL.js.map} +0 -0
- /package/build/{chunk-VQRCCWTV.js.map → chunk-NFEXBEAR.js.map} +0 -0
- /package/build/{chunk-NXIJG27Q.js.map → chunk-USH4HQ3A.js.map} +0 -0
- /package/build/{chunk-RXL6Q7VY.js.map → chunk-YA7HNVAC.js.map} +0 -0
- /package/build/{preview-P63X7ZP3.js.map → preview-MI7OZ3F2.js.map} +0 -0
- /package/build/{release-5VHUAF3U.js.map → release-ARZIKXWP.js.map} +0 -0
- /package/build/{render-command-UJOK5XJY.js.map → render-command-X3L65SLM.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as _createRequire } from 'node:module';
|
|
|
2
2
|
const require = _createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
readAppManifestFile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MMRNB5M2.js";
|
|
6
6
|
import {
|
|
7
7
|
ArmTagProvider,
|
|
8
8
|
ExtensionDataProvider,
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
useResolvePlatformUrl,
|
|
17
17
|
useSite,
|
|
18
18
|
useSiteOverrideClient
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BQJYCTI6.js";
|
|
20
20
|
import {
|
|
21
21
|
useBackendComponents
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-K3VAVLDP.js";
|
|
23
23
|
import {
|
|
24
24
|
getMonitoringProvider,
|
|
25
25
|
updateAppManifestComponents,
|
|
26
26
|
updateMonitoring,
|
|
27
27
|
updateTopology
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4KTJYCQP.js";
|
|
29
29
|
import {
|
|
30
30
|
Alert,
|
|
31
31
|
Box_default,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
useHttpClient,
|
|
55
55
|
useProjectModel,
|
|
56
56
|
useTranslation
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-P4QQM3AX.js";
|
|
58
58
|
import {
|
|
59
59
|
__toESM,
|
|
60
60
|
init_esm_shims
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
assertBuildOutputExists,
|
|
283
283
|
PreviewCommand
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-USH4HQ3A.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
readJson,
|
|
12
12
|
require_lib,
|
|
13
13
|
writeJson
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-P4QQM3AX.js";
|
|
15
15
|
import {
|
|
16
16
|
__toESM,
|
|
17
17
|
init_esm_shims
|
|
@@ -351,4 +351,4 @@ export {
|
|
|
351
351
|
getRepoType,
|
|
352
352
|
createPackageManager
|
|
353
353
|
};
|
|
354
|
-
//# sourceMappingURL=chunk-
|
|
354
|
+
//# sourceMappingURL=chunk-VW54PGPY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../package-manager/src/repo-type.ts","../../package-manager/src/git-service.ts","../../package-manager/src/shell/index.ts","../../package-manager/src/shell/shell-client.ts","../../package-manager/src/package-manager.ts","../../package-manager/src/adapters/npm.ts","../../package-manager/src/adapters/yarn.ts","../../package-manager/src/index.ts"],"sourcesContent":["import { readJson } from '@wix/cli-fs';\nimport { join } from 'node:path';\nimport { variant, fields } from 'variant';\nimport type { VariantOf } from 'variant';\nimport type { PackageJson } from 'type-fest';\nimport { getGitRoot, isInsideGitRepo } from './git-service.js';\n\nexport const RepoType = variant({\n None: {},\n Polyrepo: fields<{ rootDir: string }>(),\n Monorepo: fields<{ rootDir: string }>(),\n});\n\nexport type RepoType = VariantOf<typeof RepoType>;\n\nexport async function getRepoType(\n targetParentFolder: string\n): Promise<RepoType> {\n if (!(await isInsideGitRepo(targetParentFolder))) {\n return RepoType.None();\n }\n\n const rootDir = await getGitRoot(targetParentFolder);\n\n if (await isUsingWorkspaces(rootDir)) {\n return RepoType.Monorepo({\n rootDir,\n });\n }\n\n return RepoType.Polyrepo({\n rootDir,\n });\n}\n\nasync function isUsingWorkspaces(rootDir: string) {\n return readJson(join(rootDir, 'package.json'))\n .then((pkgJson) => Boolean((pkgJson as PackageJson).workspaces))\n .catch(() => false);\n}\n","import { runCommand } from './shell/index.js';\n\nexport function isInsideGitRepo(cwd: string) {\n return runCommand('git rev-parse --is-inside-work-tree', { cwd })\n .then(() => true)\n .catch(() => false);\n}\n\nexport async function getGitRoot(cwd: string) {\n return runCommand('git rev-parse --show-toplevel', { cwd });\n}\n\nexport async function getGitLatestCommitHash(cwd: string) {\n try {\n return await runCommand('git rev-parse --verify HEAD', { cwd });\n } catch {\n // This command can fail if there are no commits, so we can just return undefined\n }\n}\n\nexport async function gitInit(cwd: string, branch = 'main') {\n await runCommand(`git init -b ${branch.trim()}`, { cwd });\n}\n\nexport async function gitCommit(cwd: string) {\n await runCommand('git add -A', { cwd });\n await runCommand(\n `git commit -m Initial\\\\ commit\\\\ from\\\\ Create\\\\ Wix\\\\ App --no-verify`,\n { cwd }\n );\n}\n\nexport async function gitClone(url: string, path: string, branch?: string) {\n await runCommand(\n `git clone --depth 1 ${branch ? `-b ${branch}` : ''} ${url} ${path}`,\n {\n env: {\n /*\n * This is to prevent git from prompting for credentials.\n * `git clone` uses a subprocess for the authentication, so we can't attach the main process to its stdio.\n * This leads to:\n * - the spinners \"swallow\" its output.\n * - after answering with the username and pressing \"Enter\", the first line of the output is being duplicated.\n * That's why we're disabling the prompt, so user should be pre-authenticated.\n */\n GIT_TERMINAL_PROMPT: '0',\n },\n }\n );\n}\n\nexport async function gitGetCurrentBranch(cwd: string) {\n return runCommand('git rev-parse --abbrev-ref HEAD', { cwd });\n}\n\nasync function gitHasRemote(cwd: string, remoteName: string) {\n try {\n await runCommand(`git remote get-url ${remoteName}`, { cwd });\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function gitSetRemoteUrl(\n cwd: string,\n remoteName = 'origin',\n remoteUrl: string\n) {\n const hasRemote = await gitHasRemote(cwd, remoteName);\n if (hasRemote) {\n await runCommand(`git remote set-url ${remoteName} ${remoteUrl}`, { cwd });\n } else {\n await runCommand(`git remote add ${remoteName} ${remoteUrl}`, { cwd });\n }\n}\n\nexport async function gitPush(\n cwd: string,\n remoteName = 'origin',\n options: { force?: boolean } = {}\n) {\n const branch = await gitGetCurrentBranch(cwd);\n const forceFlag = options.force ? '--force' : '';\n await runCommand(`git push -u ${forceFlag} ${remoteName} ${branch}`, {\n cwd,\n env: {\n // Prevent git from prompting for credentials\n GIT_TERMINAL_PROMPT: '0',\n },\n });\n}\n\nexport async function gitGetUserInfo(cwd: string) {\n const [name, email] = await Promise.all([\n runCommand('git config user.name', { cwd }),\n runCommand('git config user.email', { cwd }),\n ]);\n\n return { name, email };\n}\n","export { runCommand } from './shell-client.js';\n","import { execaCommand } from 'execa';\nimport type { Options } from './types.js';\n\nexport async function runCommand(command: string, opts?: Options) {\n const commandProcess = execaCommand(command, {\n /**\n * DO NOT USE `shell: true`!\n * It's a security risk that leads to injections and should be avoided.\n * ref: https://github.com/sindresorhus/execa/tree/main#shell\n */\n shell: false,\n cwd: opts?.cwd,\n env: opts?.env,\n });\n\n if (opts?.output) {\n commandProcess.stdout?.pipe(opts.output);\n }\n\n const { stdout } = await commandProcess;\n\n return stdout;\n}\n","import { env } from 'node:process';\nimport { pathExists } from '@wix/cli-fs';\nimport { join } from 'node:path';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { matcher } from 'variant';\nimport { NPM } from './adapters/npm.js';\nimport { Yarn, resolveYarnVersion } from './adapters/yarn.js';\nimport type { IPackageManager, PackageManagerName } from './types.js';\nimport { RepoType } from './repo-type.js';\n\nexport async function createPackageManager(\n repoType: RepoType\n): Promise<IPackageManager> {\n const packageManagerName = await getPackageManagerName(repoType);\n\n switch (packageManagerName) {\n case 'yarn-berry':\n return new Yarn(repoType, 'yarn-berry');\n case 'yarn':\n return new Yarn(repoType, 'yarn');\n case 'npm':\n return new NPM(repoType);\n }\n}\n\nasync function getPackageManagerName(\n repoType: RepoType\n): Promise<PackageManagerName> {\n // In case of an existing repo we first check for relevant package manager files.\n // this is an extra layer of identification that should prevent errors when the\n // user runs create-app using a package manager other than the one used in the project\n\n const getByEnv = (): PackageManagerName => {\n if (env.npm_config_user_agent?.startsWith('yarn/1')) {\n return 'yarn';\n }\n\n // yarn v2+\n if (env.npm_config_user_agent?.startsWith('yarn')) {\n return 'yarn-berry';\n }\n\n if (env.npm_config_user_agent?.startsWith('npm')) {\n return 'npm';\n }\n\n throw new CliError({\n code: CliErrorCode.UnsupportedPackageManager({\n packageManagerName: env.npm_config_user_agent,\n }),\n cause: null,\n });\n };\n\n return matcher(repoType)\n .when(RepoType.None, getByEnv)\n .when(\n [RepoType.Polyrepo, RepoType.Monorepo],\n async ({ rootDir }): Promise<PackageManagerName> => {\n const [hasYarnRc, hasYarnLock, hasPackageLock] = await Promise.all([\n pathExists(join(rootDir, '.yarnrc.yml')),\n pathExists(join(rootDir, 'yarn.lock')),\n pathExists(join(rootDir, 'package-lock.json')),\n ]);\n\n if (hasYarnRc || hasYarnLock) {\n const yarnVersion = await resolveYarnVersion(rootDir);\n return yarnVersion.startsWith('1') ? 'yarn' : 'yarn-berry';\n }\n\n if (hasPackageLock) {\n return 'npm';\n }\n\n return getByEnv();\n }\n )\n .complete();\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport { isType } from 'variant';\nimport { runCommand } from '../shell/index.js';\nimport type { IPackageManager } from '../types.js';\nimport { RepoType } from '../repo-type.js';\n\nexport class NPM implements IPackageManager {\n readonly name = 'npm';\n\n constructor(private readonly repoType: RepoType) {}\n\n getUsage(name: string): string {\n return `npm init ${name.replace('create-', '')}`;\n }\n\n getInstallCmd(): string {\n return 'npm install';\n }\n\n getRunCmd(): string {\n return 'npm run';\n }\n\n getRunBinaryCmd(args: string[]): { file: string; args: string[] } {\n return {\n file: 'npx',\n args: ['--no-install'].concat(args),\n };\n }\n\n async setup(_cwd: string): Promise<void> {\n if (isType(this.repoType, RepoType.Monorepo)) {\n throw new CliError({\n code: CliErrorCode.UnsupportedPackageManagerWorkspaces({\n packageManagerName: this.name,\n }),\n cause: null,\n });\n }\n }\n\n async runInstall(cwd: string): Promise<void> {\n try {\n await runCommand(this.getInstallCmd(), { cwd });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToInstallPackages(),\n info: { packageManager: this.name },\n cause: e,\n });\n }\n }\n\n async runInstallPackage(cwd: string, packageName: string): Promise<void> {\n try {\n await runCommand(`npm install ${packageName}`, { cwd });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToInstallPackage({ packageName }),\n info: { packageManager: this.name },\n cause: e,\n });\n }\n }\n\n async runUninstallPackage(cwd: string, packageName: string): Promise<void> {\n try {\n await runCommand(`npm uninstall ${packageName}`, { cwd });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToUninstallPackage({ packageName }),\n info: { packageManager: this.name },\n cause: e,\n });\n }\n }\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport { readJson, writeJson } from '@wix/cli-fs';\nimport { join, relative } from 'node:path';\nimport { matcher } from 'variant';\nimport { EOL } from 'node:os';\nimport { z } from 'zod';\nimport { writeFile } from 'node:fs/promises';\nimport type { PackageJson } from 'type-fest';\nimport { runCommand } from '../shell/index.js';\nimport type { IPackageManager } from '../types.js';\nimport type { RepoType } from '../repo-type.js';\n\ntype YarnVersion = 'yarn' | 'yarn-berry';\n\nexport async function resolveYarnVersion(cwd: string) {\n const stdout = await runCommand('yarn --version', { cwd });\n return stdout.trim();\n}\n\nexport class Yarn implements IPackageManager {\n constructor(\n private readonly repoType: RepoType,\n readonly name: YarnVersion\n ) {}\n\n getUsage(name: string): string {\n return `yarn create ${name.replace('create-', '')}`;\n }\n\n getInstallCmd(): string {\n return 'yarn install';\n }\n\n getRunCmd(): string {\n return 'yarn';\n }\n\n getRunBinaryCmd(args: string[]): { file: string; args: string[] } {\n return {\n file: 'yarn',\n args: ['run'].concat(args),\n };\n }\n\n async setup(packageFolder: string): Promise<void> {\n return matcher(this.repoType)\n .when(['None', 'Polyrepo'], async () => {\n if (this.name === 'yarn-berry') {\n // if yarn berry encounters a package.json in a parent folder, it\n // complains that our project needs to be part of that parent project.\n // An official way to tell yarn that this is a standalone project is\n // to create an empty lockfile.\n // A similar thing was done in create-astro: https://github.com/withastro/astro/pull/8028\n await writeFile(join(packageFolder, 'yarn.lock'), '');\n }\n })\n .when('Monorepo', async ({ rootDir }) => {\n try {\n await addPackageToWorkspaces({\n rootDir,\n packageFolder,\n yarnVersion: this.name,\n });\n } catch (error) {\n throw new CliError({\n code: CliErrorCode.FailedAddingPackageToWorkspace(),\n cause: error,\n });\n }\n })\n .complete();\n }\n\n async runInstall(cwd: string): Promise<void> {\n try {\n await runCommand(this.getInstallCmd(), { cwd });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToInstallPackages(),\n info: { packageManager: this.name },\n cause: e,\n });\n }\n }\n\n async runInstallPackage(cwd: string, packageName: string): Promise<void> {\n try {\n await runCommand(`yarn add ${packageName}`, { cwd });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToInstallPackage({ packageName }),\n info: { packageManager: this.name },\n cause: e,\n });\n }\n }\n\n async runUninstallPackage(cwd: string, packageName: string): Promise<void> {\n try {\n await runCommand(`yarn remove ${packageName}`, { cwd });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToUninstallPackage({ packageName }),\n info: { packageManager: this.name },\n cause: e,\n });\n }\n }\n}\n\nasync function getPackagesRelativePaths(\n rootDir: string,\n yarnVersion: YarnVersion\n): Promise<string[]> {\n const workspacesSchema = z.array(\n z.object({\n location: z.string(),\n })\n );\n\n if (yarnVersion === 'yarn-berry') {\n const packages = await runCommand('yarn workspaces list --json', {\n cwd: rootDir,\n });\n\n const parsedPackages = workspacesSchema.parse(\n packages\n .split(EOL)\n .filter(Boolean)\n .map((pkg) => JSON.parse(pkg))\n );\n\n return parsedPackages.map((pkg) => pkg.location);\n }\n\n const packages = await runCommand('yarn --json workspaces info', {\n cwd: rootDir,\n });\n\n const parsedPackages = workspacesSchema.parse(\n Object.values(JSON.parse(JSON.parse(packages).data))\n );\n return parsedPackages.map((pkg) => pkg.location);\n}\n\nasync function addPackageToWorkspaces({\n rootDir,\n packageFolder,\n yarnVersion,\n}: {\n rootDir: string;\n packageFolder: string;\n yarnVersion: YarnVersion;\n}) {\n const relativePackagePath = relative(rootDir, packageFolder);\n const packages = await getPackagesRelativePaths(rootDir, yarnVersion);\n\n if (packages.includes(relativePackagePath)) {\n return;\n }\n\n const packageJson = (await readJson(\n join(rootDir, 'package.json')\n )) as PackageJson;\n\n if (Array.isArray(packageJson.workspaces)) {\n packageJson.workspaces.push(relativePackagePath);\n } else if (typeof packageJson.workspaces === 'object') {\n packageJson.workspaces = {\n ...packageJson.workspaces,\n packages: [\n ...(packageJson.workspaces.packages ?? []),\n relativePackagePath,\n ],\n };\n } else {\n throw new Error(\n `Failed to read workspaces structure. Expected an array or object but got ${JSON.stringify(\n packageJson.workspaces\n )}`\n );\n }\n\n await writeJson(join(rootDir, 'package.json'), packageJson, { spaces: 2 });\n}\n","export { createPackageManager } from './package-manager.js';\nexport { NPM } from './adapters/npm.js';\nexport { Yarn } from './adapters/yarn.js';\nexport type { IPackageManager } from './types.js';\nexport { getRepoType, RepoType } from './repo-type.js';\nexport {\n gitClone,\n gitCommit,\n gitInit,\n gitSetRemoteUrl,\n gitPush,\n gitGetCurrentBranch,\n getGitLatestCommitHash,\n isInsideGitRepo,\n gitGetUserInfo,\n} from './git-service.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAEA,qBAAgC;AADhC,SAAS,YAAY;;;ACDrB;;;ACAA;;;ACAA;AAGA,eAAsB,WAAW,SAAiB,MAAgB;AAChE,QAAM,iBAAiB,aAAa,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM3C,OAAO;AAAA,IACP,KAAK,MAAM;AAAA,IACX,KAAK,MAAM;AAAA,EACb,CAAC;AAED,MAAI,MAAM,QAAQ;AAChB,mBAAe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AACH,aAAO,IAAI,IAAI,QAAQ;AAAA,EAC3B;AACF;AAEA,eAAe,sBACb,UAC6B;AAK7B,QAAM,WAAW,MAA0B;AACzC,QAAI,IAAI,uBAAuB,WAAW,QAAQ,GAAG;AACnD,aAAO;AAAA,IACT;AAGA,QAAI,IAAI,uBAAuB,WAAW,MAAM,GAAG;AACjD,aAAO;AAAA,IACT;AAEA,QAAI,IAAI,uBAAuB,WAAW,KAAK,GAAG;AAChD,aAAO;AAAA,IACT;AAEA,UAAM,IAAI,SAAS;AAAA,MACjB,MAAM,aAAa,0BAA0B;AAAA,QAC3C,oBAAoB,IAAI;AAAA,MAC1B,CAAC;AAAA,MACD,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,aAAO,yBAAQ,QAAQ,EACpB,KAAK,SAAS,MAAM,QAAQ,EAC5B;AAAA,IACC,CAAC,SAAS,UAAU,SAAS,QAAQ;AAAA,IACrC,OAAO,EAAE,QAAQ,MAAmC;AAClD,YAAM,CAAC,WAAW,aAAa,cAAc,IAAI,MAAM,QAAQ,IAAI;AAAA,QACjE,WAAWG,MAAK,SAAS,aAAa,CAAC;AAAA,QACvC,WAAWA,MAAK,SAAS,WAAW,CAAC;AAAA,QACrC,WAAWA,MAAK,SAAS,mBAAmB,CAAC;AAAA,MAC/C,CAAC;AAED,UAAI,aAAa,aAAa;AAC5B,cAAM,cAAc,MAAM,mBAAmB,OAAO;AACpD,eAAO,YAAY,WAAW,GAAG,IAAI,SAAS;AAAA,MAChD;AAEA,UAAI,gBAAgB;AAClB,eAAO;AAAA,MACT;AAEA,aAAO,SAAS;AAAA,IAClB;AAAA,EACF,EACC,SAAS;AACd;;;AG9EA;","names":["join","import_variant","import_variant","import_variant","join","join","packages","parsedPackages","join"]}
|
|
@@ -2,13 +2,13 @@ import { createRequire as _createRequire } from 'node:module';
|
|
|
2
2
|
const require = _createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
addUserFields
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EPCG3T5I.js";
|
|
6
6
|
import {
|
|
7
7
|
messages_default
|
|
8
8
|
} from "./chunk-VJQHGLIW.js";
|
|
9
9
|
import {
|
|
10
10
|
DebugLogProvider
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GRJOEMKT.js";
|
|
12
12
|
import {
|
|
13
13
|
AccountAuthProvider,
|
|
14
14
|
BiProvider,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
getDebugLogFilePath,
|
|
23
23
|
isLoggedInToAccount,
|
|
24
24
|
require_react
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-P4QQM3AX.js";
|
|
26
26
|
import {
|
|
27
27
|
__toESM,
|
|
28
28
|
init_esm_shims
|
|
@@ -64,4 +64,4 @@ export {
|
|
|
64
64
|
log,
|
|
65
65
|
executeCommand
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
67
|
+
//# sourceMappingURL=chunk-YA7HNVAC.js.map
|
|
@@ -3635,11 +3635,11 @@ async function importWithAlgCache(cache, jwk, alg) {
|
|
|
3635
3635
|
return cached[alg];
|
|
3636
3636
|
}
|
|
3637
3637
|
function createLocalJWKSet(jwks) {
|
|
3638
|
-
const
|
|
3639
|
-
const localJWKSet = async (protectedHeader, token) =>
|
|
3638
|
+
const set3 = new LocalJWKSet(jwks);
|
|
3639
|
+
const localJWKSet = async (protectedHeader, token) => set3.getKey(protectedHeader, token);
|
|
3640
3640
|
Object.defineProperties(localJWKSet, {
|
|
3641
3641
|
jwks: {
|
|
3642
|
-
value: () => clone(
|
|
3642
|
+
value: () => clone(set3._jwks),
|
|
3643
3643
|
enumerable: true,
|
|
3644
3644
|
configurable: false,
|
|
3645
3645
|
writable: false
|
|
@@ -3784,32 +3784,32 @@ function isFreshJwksCache(input, cacheMaxAge) {
|
|
|
3784
3784
|
return true;
|
|
3785
3785
|
}
|
|
3786
3786
|
function createRemoteJWKSet(url, options) {
|
|
3787
|
-
const
|
|
3788
|
-
const remoteJWKSet = async (protectedHeader, token) =>
|
|
3787
|
+
const set3 = new RemoteJWKSet(url, options);
|
|
3788
|
+
const remoteJWKSet = async (protectedHeader, token) => set3.getKey(protectedHeader, token);
|
|
3789
3789
|
Object.defineProperties(remoteJWKSet, {
|
|
3790
3790
|
coolingDown: {
|
|
3791
|
-
get: () =>
|
|
3791
|
+
get: () => set3.coolingDown(),
|
|
3792
3792
|
enumerable: true,
|
|
3793
3793
|
configurable: false
|
|
3794
3794
|
},
|
|
3795
3795
|
fresh: {
|
|
3796
|
-
get: () =>
|
|
3796
|
+
get: () => set3.fresh(),
|
|
3797
3797
|
enumerable: true,
|
|
3798
3798
|
configurable: false
|
|
3799
3799
|
},
|
|
3800
3800
|
reload: {
|
|
3801
|
-
value: () =>
|
|
3801
|
+
value: () => set3.reload(),
|
|
3802
3802
|
enumerable: true,
|
|
3803
3803
|
configurable: false,
|
|
3804
3804
|
writable: false
|
|
3805
3805
|
},
|
|
3806
3806
|
reloading: {
|
|
3807
|
-
get: () => !!
|
|
3807
|
+
get: () => !!set3._pendingFetch,
|
|
3808
3808
|
enumerable: true,
|
|
3809
3809
|
configurable: false
|
|
3810
3810
|
},
|
|
3811
3811
|
jwks: {
|
|
3812
|
-
value: () =>
|
|
3812
|
+
value: () => set3._local?.jwks(),
|
|
3813
3813
|
enumerable: true,
|
|
3814
3814
|
configurable: false,
|
|
3815
3815
|
writable: false
|
|
@@ -4445,6 +4445,15 @@ function EventDefinition(type, isDomainEvent = false, transformations = (x) => x
|
|
|
4445
4445
|
});
|
|
4446
4446
|
}
|
|
4447
4447
|
var SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
4448
|
+
var SORT_DIRECTIONS = {
|
|
4449
|
+
ASC: "ASC",
|
|
4450
|
+
DESC: "DESC"
|
|
4451
|
+
};
|
|
4452
|
+
var SORT_CAPABILITIES = {
|
|
4453
|
+
...SORT_DIRECTIONS,
|
|
4454
|
+
BOTH: "BOTH",
|
|
4455
|
+
NONE: "NONE"
|
|
4456
|
+
};
|
|
4448
4457
|
|
|
4449
4458
|
// ../../node_modules/@wix/sdk/build/ambassador-modules.js
|
|
4450
4459
|
var parseMethod = (method) => {
|
|
@@ -4627,6 +4636,13 @@ function runWithoutContext(fn) {
|
|
|
4627
4636
|
}
|
|
4628
4637
|
}
|
|
4629
4638
|
|
|
4639
|
+
// ../../node_modules/@wix/sdk-runtime/build/constants.js
|
|
4640
|
+
var RESTResponseToSDKResponseRenameMap = {
|
|
4641
|
+
id: "_id",
|
|
4642
|
+
createdDate: "_createdDate",
|
|
4643
|
+
updatedDate: "_updatedDate"
|
|
4644
|
+
};
|
|
4645
|
+
|
|
4630
4646
|
// ../../node_modules/@wix/sdk-runtime/build/utils.js
|
|
4631
4647
|
function constantCase(input) {
|
|
4632
4648
|
return split(input).map((part) => part.toLocaleUpperCase()).join("_");
|
|
@@ -4913,6 +4929,239 @@ var errorBuilder2 = (code, description, details, data) => {
|
|
|
4913
4929
|
});
|
|
4914
4930
|
};
|
|
4915
4931
|
|
|
4932
|
+
// ../../node_modules/@wix/sdk-runtime/build/rest-modules.js
|
|
4933
|
+
var DOMAINS = ["wix.com", "editorx.com"];
|
|
4934
|
+
var REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
4935
|
+
var WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
|
|
4936
|
+
var DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
4937
|
+
var REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
4938
|
+
var REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
4939
|
+
|
|
4940
|
+
// ../../node_modules/@wix/sdk/build/object-utils.js
|
|
4941
|
+
var DELIMITER = ".";
|
|
4942
|
+
function set(obj, path, value) {
|
|
4943
|
+
if (obj == null) {
|
|
4944
|
+
throw new Error("Cannot set value on null or undefined");
|
|
4945
|
+
}
|
|
4946
|
+
const keys = toPathObject(path);
|
|
4947
|
+
let current = obj;
|
|
4948
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4949
|
+
const key = keys[i];
|
|
4950
|
+
if (i === keys.length - 1) {
|
|
4951
|
+
current[key] = value;
|
|
4952
|
+
break;
|
|
4953
|
+
}
|
|
4954
|
+
const nextKey = keys[i + 1];
|
|
4955
|
+
if (!(key in current) || current[key] == null) {
|
|
4956
|
+
current[key] = typeof nextKey === "number" ? [] : {};
|
|
4957
|
+
} else if (typeof current[key] !== "object" || current[key] === null) {
|
|
4958
|
+
current[key] = typeof nextKey === "number" ? [] : {};
|
|
4959
|
+
}
|
|
4960
|
+
current = current[key];
|
|
4961
|
+
}
|
|
4962
|
+
return obj;
|
|
4963
|
+
}
|
|
4964
|
+
function toPathObject(path) {
|
|
4965
|
+
if (Array.isArray(path)) {
|
|
4966
|
+
return path;
|
|
4967
|
+
}
|
|
4968
|
+
return path.split(DELIMITER).map((segment) => isNumericSegment(segment) ? Number(segment) : segment);
|
|
4969
|
+
}
|
|
4970
|
+
function isNumericSegment(segment) {
|
|
4971
|
+
return /^\d+$/.test(segment);
|
|
4972
|
+
}
|
|
4973
|
+
|
|
4974
|
+
// ../../node_modules/@wix/sdk/build/flat-utils.js
|
|
4975
|
+
function unflatten(flatObject) {
|
|
4976
|
+
const result = {};
|
|
4977
|
+
for (const [flatKey, value] of Object.entries(flatObject)) {
|
|
4978
|
+
if (isPrototypePollutionKey(flatKey)) {
|
|
4979
|
+
continue;
|
|
4980
|
+
}
|
|
4981
|
+
const path = toPathObject(flatKey);
|
|
4982
|
+
set(result, path, value);
|
|
4983
|
+
}
|
|
4984
|
+
return result;
|
|
4985
|
+
}
|
|
4986
|
+
function isPrototypePollutionKey(key) {
|
|
4987
|
+
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
4988
|
+
}
|
|
4989
|
+
|
|
4990
|
+
// ../../node_modules/@wix/sdk/build/modified-fields-manipulator.js
|
|
4991
|
+
var ModifiedFieldsManipulator = class {
|
|
4992
|
+
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
4993
|
+
NUMERIC_PATTERN = /^\d+$/;
|
|
4994
|
+
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
4995
|
+
ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
|
|
4996
|
+
ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
|
|
4997
|
+
SPLIT_PATTERN = /\.|\[(\d+)\]/g;
|
|
4998
|
+
DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
|
|
4999
|
+
ESCAPED_DOT_PLACEHOLDER = "__DOT__";
|
|
5000
|
+
ESCAPED_RIGHT_BRACKET_PLACEHOLDER = "__RB__";
|
|
5001
|
+
ESCAPED_LEFT_BRACKET_PLACEHOLDER = "__LB__";
|
|
5002
|
+
modifiedFields;
|
|
5003
|
+
cleanedModifiedFields;
|
|
5004
|
+
constructor(modifiedFields) {
|
|
5005
|
+
this.modifiedFields = modifiedFields;
|
|
5006
|
+
}
|
|
5007
|
+
replaceEscapedCharacters(key) {
|
|
5008
|
+
return key.replace(this.ESCAPED_DOT_PATTERN, this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN, this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN, this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER);
|
|
5009
|
+
}
|
|
5010
|
+
restoreEscapedCharacters(key) {
|
|
5011
|
+
return key.replace(this.ESCAPED_DOT_PLACEHOLDER, "\\.").replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, "\\]").replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, "\\[");
|
|
5012
|
+
}
|
|
5013
|
+
unflatten() {
|
|
5014
|
+
this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([key, value]) => [
|
|
5015
|
+
this.replaceEscapedCharacters(this.bracketToDotNotation(key)),
|
|
5016
|
+
value
|
|
5017
|
+
]));
|
|
5018
|
+
return unflatten(this.cleanedModifiedFields);
|
|
5019
|
+
}
|
|
5020
|
+
flatten(transformedModifiedFields) {
|
|
5021
|
+
let result = {};
|
|
5022
|
+
for (const originalKey of Object.keys(this.cleanedModifiedFields)) {
|
|
5023
|
+
const pathParts = this.splitPath(originalKey);
|
|
5024
|
+
const value = this.navigatePath(transformedModifiedFields, pathParts);
|
|
5025
|
+
result = { ...result, ...value };
|
|
5026
|
+
}
|
|
5027
|
+
return Object.fromEntries(Object.entries(result).map(([key, value]) => [
|
|
5028
|
+
this.restoreEscapedCharacters(key),
|
|
5029
|
+
value
|
|
5030
|
+
]));
|
|
5031
|
+
}
|
|
5032
|
+
splitPath(path) {
|
|
5033
|
+
const parts = [];
|
|
5034
|
+
let lastIndex = 0;
|
|
5035
|
+
const matches = Array.from(path.matchAll(this.SPLIT_PATTERN));
|
|
5036
|
+
for (const match of matches) {
|
|
5037
|
+
if (match.index > lastIndex) {
|
|
5038
|
+
parts.push(path.substring(lastIndex, match.index));
|
|
5039
|
+
}
|
|
5040
|
+
if (match[1]) {
|
|
5041
|
+
parts.push(match[1]);
|
|
5042
|
+
}
|
|
5043
|
+
lastIndex = match.index + match[0].length;
|
|
5044
|
+
}
|
|
5045
|
+
if (lastIndex < path.length) {
|
|
5046
|
+
parts.push(path.substring(lastIndex));
|
|
5047
|
+
}
|
|
5048
|
+
return parts;
|
|
5049
|
+
}
|
|
5050
|
+
navigatePath(obj, pathParts) {
|
|
5051
|
+
let current = obj;
|
|
5052
|
+
const transformedPath = [];
|
|
5053
|
+
const handleArray = (part) => {
|
|
5054
|
+
if (!Array.isArray(current)) {
|
|
5055
|
+
throw new Error(`Expected array at path ${this.buildPathString(transformedPath)}, but got ${typeof current}`);
|
|
5056
|
+
}
|
|
5057
|
+
transformedPath.push(`[${part}]`);
|
|
5058
|
+
current = current[parseInt(part, 10)];
|
|
5059
|
+
};
|
|
5060
|
+
const handleTransformedKeyName = (part, currentObj) => {
|
|
5061
|
+
const transformedKey = part in RESTResponseToSDKResponseRenameMap ? RESTResponseToSDKResponseRenameMap[part] : void 0;
|
|
5062
|
+
if (transformedKey && transformedKey in currentObj) {
|
|
5063
|
+
transformedPath.push(transformedKey);
|
|
5064
|
+
current = currentObj[transformedKey];
|
|
5065
|
+
return;
|
|
5066
|
+
}
|
|
5067
|
+
const camelCaseKey = camelCase(part);
|
|
5068
|
+
if (camelCaseKey && camelCaseKey in currentObj) {
|
|
5069
|
+
transformedPath.push(camelCaseKey);
|
|
5070
|
+
current = currentObj[camelCaseKey];
|
|
5071
|
+
return;
|
|
5072
|
+
}
|
|
5073
|
+
throw new Error(`Cannot find key '${part}' or its transformations at path ${this.buildPathString(transformedPath)}`);
|
|
5074
|
+
};
|
|
5075
|
+
const handleObject = (part, currentObj) => {
|
|
5076
|
+
transformedPath.push(part);
|
|
5077
|
+
current = currentObj[part];
|
|
5078
|
+
return;
|
|
5079
|
+
};
|
|
5080
|
+
for (const part of pathParts) {
|
|
5081
|
+
if (this.NUMERIC_PATTERN.test(part)) {
|
|
5082
|
+
handleArray(part);
|
|
5083
|
+
continue;
|
|
5084
|
+
}
|
|
5085
|
+
if (current === null || typeof current !== "object") {
|
|
5086
|
+
throw new Error(`Cannot access property '${part}' on ${typeof current} at path ${this.buildPathString(transformedPath)}`);
|
|
5087
|
+
}
|
|
5088
|
+
const currentObj = current;
|
|
5089
|
+
if (part in current) {
|
|
5090
|
+
handleObject(part, currentObj);
|
|
5091
|
+
continue;
|
|
5092
|
+
}
|
|
5093
|
+
handleTransformedKeyName(part, currentObj);
|
|
5094
|
+
}
|
|
5095
|
+
return { [this.buildPathString(transformedPath)]: current };
|
|
5096
|
+
}
|
|
5097
|
+
buildPathString(pathParts) {
|
|
5098
|
+
return pathParts.join(".").replace(this.DOT_BEFORE_BRACKET_PATTERN, "[");
|
|
5099
|
+
}
|
|
5100
|
+
bracketToDotNotation(key) {
|
|
5101
|
+
return key.replace(this.BRACKET_PATTERN, (match, number, offset) => {
|
|
5102
|
+
if (offset > 0 && key[offset - 1] === "\\") {
|
|
5103
|
+
return match;
|
|
5104
|
+
}
|
|
5105
|
+
return "." + number;
|
|
5106
|
+
});
|
|
5107
|
+
}
|
|
5108
|
+
};
|
|
5109
|
+
function attemptTransformationWithModifiedFields(envelope, transformFromRESTFn) {
|
|
5110
|
+
const modifiedFields = envelope?.modifiedFields;
|
|
5111
|
+
if (!modifiedFields) {
|
|
5112
|
+
return null;
|
|
5113
|
+
}
|
|
5114
|
+
const unflattenedResult = attemptUnflatten(modifiedFields);
|
|
5115
|
+
if (!unflattenedResult) {
|
|
5116
|
+
return null;
|
|
5117
|
+
}
|
|
5118
|
+
const { unflattenedModifiedFields, modifiedFieldsManipulator } = unflattenedResult;
|
|
5119
|
+
envelope = {
|
|
5120
|
+
...envelope,
|
|
5121
|
+
modifiedFields: unflattenedModifiedFields
|
|
5122
|
+
};
|
|
5123
|
+
const transformedEnvelope = transformFromRESTFn(envelope);
|
|
5124
|
+
const transformedModifiedFields = transformedEnvelope?.modifiedFields;
|
|
5125
|
+
if (!transformedModifiedFields) {
|
|
5126
|
+
return null;
|
|
5127
|
+
}
|
|
5128
|
+
const flattened = attemptFlatten(transformedModifiedFields, modifiedFieldsManipulator);
|
|
5129
|
+
if (flattened !== null) {
|
|
5130
|
+
transformedEnvelope.modifiedFields = flattened;
|
|
5131
|
+
return transformedEnvelope;
|
|
5132
|
+
}
|
|
5133
|
+
return null;
|
|
5134
|
+
}
|
|
5135
|
+
function attemptUnflatten(modifiedFields) {
|
|
5136
|
+
if (typeof modifiedFields === "object" && modifiedFields !== null && !Array.isArray(modifiedFields)) {
|
|
5137
|
+
try {
|
|
5138
|
+
const modifiedFieldsManipulator = new ModifiedFieldsManipulator(modifiedFields);
|
|
5139
|
+
const unflattened = modifiedFieldsManipulator.unflatten();
|
|
5140
|
+
return {
|
|
5141
|
+
unflattenedModifiedFields: unflattened,
|
|
5142
|
+
modifiedFieldsManipulator
|
|
5143
|
+
};
|
|
5144
|
+
} catch (error) {
|
|
5145
|
+
return null;
|
|
5146
|
+
}
|
|
5147
|
+
}
|
|
5148
|
+
return null;
|
|
5149
|
+
}
|
|
5150
|
+
function attemptFlatten(transformedModifiedFields, modifiedFieldsManipulator) {
|
|
5151
|
+
if (typeof transformedModifiedFields === "object" && transformedModifiedFields !== null && !Array.isArray(transformedModifiedFields)) {
|
|
5152
|
+
try {
|
|
5153
|
+
const flattened = modifiedFieldsManipulator.flatten(transformedModifiedFields);
|
|
5154
|
+
return flattened;
|
|
5155
|
+
} catch (error) {
|
|
5156
|
+
return null;
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5159
|
+
return null;
|
|
5160
|
+
}
|
|
5161
|
+
function camelCase(str) {
|
|
5162
|
+
return str.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : "").replace(/^./, (c) => c.toLowerCase());
|
|
5163
|
+
}
|
|
5164
|
+
|
|
4916
5165
|
// ../../node_modules/@wix/sdk/build/nanoevents.js
|
|
4917
5166
|
function createNanoEvents() {
|
|
4918
5167
|
return {
|
|
@@ -4956,9 +5205,15 @@ function runHandler(eventDefinition, handler, payload, baseEventMetadata) {
|
|
|
4956
5205
|
data: actionEvent.body,
|
|
4957
5206
|
metadata
|
|
4958
5207
|
};
|
|
5208
|
+
} else if (updatedEvent) {
|
|
5209
|
+
envelope = {
|
|
5210
|
+
entity: updatedEvent.currentEntity,
|
|
5211
|
+
metadata,
|
|
5212
|
+
...updatedEvent.modifiedFields ? { modifiedFields: updatedEvent.modifiedFields } : {}
|
|
5213
|
+
};
|
|
4959
5214
|
} else {
|
|
4960
5215
|
envelope = {
|
|
4961
|
-
entity: createdEvent?.entity
|
|
5216
|
+
entity: createdEvent?.entity,
|
|
4962
5217
|
metadata
|
|
4963
5218
|
};
|
|
4964
5219
|
}
|
|
@@ -4969,9 +5224,21 @@ function runHandler(eventDefinition, handler, payload, baseEventMetadata) {
|
|
|
4969
5224
|
};
|
|
4970
5225
|
}
|
|
4971
5226
|
const transformFromRESTFn = eventDefinition.transformations ?? ((x) => x);
|
|
4972
|
-
|
|
5227
|
+
let originalEnvelope = envelope;
|
|
5228
|
+
const envelopeAny = envelope;
|
|
5229
|
+
if (envelopeAny.modifiedFields) {
|
|
5230
|
+
const modifiedFieldsValue = envelopeAny.modifiedFields;
|
|
5231
|
+
if (typeof modifiedFieldsValue === "object" && modifiedFieldsValue !== null && !Array.isArray(modifiedFieldsValue)) {
|
|
5232
|
+
originalEnvelope = structuredClone(envelope);
|
|
5233
|
+
const transformedEnvelope = attemptTransformationWithModifiedFields(envelopeAny, transformFromRESTFn);
|
|
5234
|
+
if (transformedEnvelope) {
|
|
5235
|
+
return handler(transformedEnvelope);
|
|
5236
|
+
}
|
|
5237
|
+
}
|
|
5238
|
+
}
|
|
5239
|
+
return handler(transformFromRESTFn(originalEnvelope));
|
|
4973
5240
|
}
|
|
4974
|
-
function eventHandlersModules(
|
|
5241
|
+
function eventHandlersModules(getAuthStrategy) {
|
|
4975
5242
|
const eventHandlers = /* @__PURE__ */ new Map();
|
|
4976
5243
|
const webhooksEmitter = createNanoEvents();
|
|
4977
5244
|
const client = {
|
|
@@ -4980,7 +5247,7 @@ function eventHandlersModules(authStrategy) {
|
|
|
4980
5247
|
async process(jwt, opts = {
|
|
4981
5248
|
expectedEvents: []
|
|
4982
5249
|
}) {
|
|
4983
|
-
const { eventType, identity, instanceId, payload } = await this.parseJWT(jwt);
|
|
5250
|
+
const { eventType, identity, instanceId, payload, accountInfo } = await this.parseJWT(jwt);
|
|
4984
5251
|
const allExpectedEvents = [
|
|
4985
5252
|
...opts.expectedEvents,
|
|
4986
5253
|
...Array.from(eventHandlers.keys()).map((type) => ({ type }))
|
|
@@ -4991,13 +5258,15 @@ function eventHandlersModules(authStrategy) {
|
|
|
4991
5258
|
const handlers2 = eventHandlers.get(eventType) ?? [];
|
|
4992
5259
|
await Promise.all(handlers2.map(({ eventDefinition, handler }) => runHandler(eventDefinition, handler, payload, {
|
|
4993
5260
|
instanceId,
|
|
4994
|
-
identity
|
|
5261
|
+
identity,
|
|
5262
|
+
accountInfo
|
|
4995
5263
|
})));
|
|
4996
5264
|
return {
|
|
4997
5265
|
instanceId,
|
|
4998
5266
|
eventType,
|
|
4999
5267
|
payload,
|
|
5000
|
-
identity
|
|
5268
|
+
identity,
|
|
5269
|
+
accountInfo
|
|
5001
5270
|
};
|
|
5002
5271
|
},
|
|
5003
5272
|
async processRequest(request, opts) {
|
|
@@ -5005,6 +5274,7 @@ function eventHandlersModules(authStrategy) {
|
|
|
5005
5274
|
return this.process(body, opts);
|
|
5006
5275
|
},
|
|
5007
5276
|
async parseJWT(jwt) {
|
|
5277
|
+
const authStrategy = getAuthStrategy();
|
|
5008
5278
|
if (!authStrategy.decodeJWT) {
|
|
5009
5279
|
throw new Error("decodeJWT is not supported by the authentication strategy");
|
|
5010
5280
|
}
|
|
@@ -5017,6 +5287,7 @@ function eventHandlersModules(authStrategy) {
|
|
|
5017
5287
|
}
|
|
5018
5288
|
const parsedDecoded = JSON.parse(decoded.data);
|
|
5019
5289
|
const eventType = parsedDecoded.eventType;
|
|
5290
|
+
const accountInfo = parsedDecoded.accountInfo;
|
|
5020
5291
|
const instanceId = parsedDecoded.instanceId;
|
|
5021
5292
|
const identity = parsedDecoded.identity ? JSON.parse(parsedDecoded.identity) : void 0;
|
|
5022
5293
|
const payload = JSON.parse(parsedDecoded.data);
|
|
@@ -5024,7 +5295,8 @@ function eventHandlersModules(authStrategy) {
|
|
|
5024
5295
|
instanceId,
|
|
5025
5296
|
eventType,
|
|
5026
5297
|
payload,
|
|
5027
|
-
identity
|
|
5298
|
+
identity,
|
|
5299
|
+
accountInfo
|
|
5028
5300
|
};
|
|
5029
5301
|
},
|
|
5030
5302
|
async parseRequest(request) {
|
|
@@ -5062,13 +5334,14 @@ function eventHandlersModules(authStrategy) {
|
|
|
5062
5334
|
|
|
5063
5335
|
// ../../node_modules/@wix/sdk/build/service-plugin-modules.js
|
|
5064
5336
|
var isServicePluginModule = (val) => val.__type === "service-plugin-definition";
|
|
5065
|
-
function servicePluginsModules(
|
|
5337
|
+
function servicePluginsModules(getAuthStrategy) {
|
|
5066
5338
|
const servicePluginsImplementations = /* @__PURE__ */ new Map();
|
|
5067
5339
|
const servicePluginsEmitter = createNanoEvents();
|
|
5068
5340
|
const client = {
|
|
5069
5341
|
...servicePluginsEmitter,
|
|
5070
5342
|
getRegisteredServicePlugins: () => servicePluginsImplementations,
|
|
5071
5343
|
async parseJWT(jwt) {
|
|
5344
|
+
const authStrategy = getAuthStrategy();
|
|
5072
5345
|
if (!authStrategy.decodeJWT) {
|
|
5073
5346
|
throw new Error("decodeJWT is not supported by the authentication strategy");
|
|
5074
5347
|
}
|
|
@@ -5139,11 +5412,14 @@ function servicePluginsModules(authStrategy) {
|
|
|
5139
5412
|
var X_WIX_CONSISTENT_HEADER = "X-Wix-Consistent";
|
|
5140
5413
|
function createClient(config) {
|
|
5141
5414
|
const _headers = config.headers || { Authorization: "" };
|
|
5142
|
-
const
|
|
5415
|
+
const defaultStrategy = {
|
|
5143
5416
|
getAuthHeaders: (_) => Promise.resolve({ headers: {} })
|
|
5144
5417
|
};
|
|
5145
|
-
const
|
|
5146
|
-
|
|
5418
|
+
const auth = config.auth;
|
|
5419
|
+
const getAuthStrategy = typeof auth === "function" ? auth : () => auth ?? defaultStrategy;
|
|
5420
|
+
const boundGetAuthHeaders = () => {
|
|
5421
|
+
return getAuthStrategy().getAuthHeaders(config.host);
|
|
5422
|
+
};
|
|
5147
5423
|
const fetchWithAuth = async (urlOrRequest, requestInit) => {
|
|
5148
5424
|
const authHeaders = await boundGetAuthHeaders();
|
|
5149
5425
|
const headers = {
|
|
@@ -5199,8 +5475,8 @@ function createClient(config) {
|
|
|
5199
5475
|
throw e;
|
|
5200
5476
|
}
|
|
5201
5477
|
};
|
|
5202
|
-
const { client: servicePluginsClient, initModule: initServicePluginModule } = servicePluginsModules(
|
|
5203
|
-
const { client: eventHandlersClient, initModule: initEventHandlerModule } = eventHandlersModules(
|
|
5478
|
+
const { client: servicePluginsClient, initModule: initServicePluginModule } = servicePluginsModules(getAuthStrategy);
|
|
5479
|
+
const { client: eventHandlersClient, initModule: initEventHandlerModule } = eventHandlersModules(getAuthStrategy);
|
|
5204
5480
|
const boundFetch = async (url, options) => {
|
|
5205
5481
|
const authHeaders = await boundGetAuthHeaders();
|
|
5206
5482
|
const defaultContentTypeHeader = getDefaultContentHeader(options);
|
|
@@ -5234,13 +5510,13 @@ function createClient(config) {
|
|
|
5234
5510
|
return modules;
|
|
5235
5511
|
}
|
|
5236
5512
|
const apiBaseUrl = config.host?.apiBaseUrl ?? DEFAULT_API_URL;
|
|
5237
|
-
const shouldUseCDN = config.useCDN === void 0 ?
|
|
5513
|
+
const shouldUseCDN = config.useCDN === void 0 ? getAuthStrategy().shouldUseCDN : config.useCDN;
|
|
5238
5514
|
return buildRESTDescriptor(runWithoutContext(() => isAmbassadorModule(modules)) ? toHTTPModule(modules) : modules, metadata ?? {}, boundFetch, config.host?.getErrorHandler?.(), (relativeUrl, fetchOptions) => {
|
|
5239
5515
|
const finalUrl = new URL(relativeUrl, `https://${apiBaseUrl}`);
|
|
5240
5516
|
finalUrl.host = apiBaseUrl;
|
|
5241
5517
|
finalUrl.protocol = "https";
|
|
5242
5518
|
return boundFetch(finalUrl.toString(), fetchOptions);
|
|
5243
|
-
},
|
|
5519
|
+
}, getAuthStrategy().getActiveToken, { HTTPHost: apiBaseUrl }, config.host?.name, shouldUseCDN);
|
|
5244
5520
|
} else if (isObject(modules)) {
|
|
5245
5521
|
return Object.fromEntries(Object.entries(modules).map(([key, value]) => {
|
|
5246
5522
|
return [key, use(value, modules[PUBLIC_METADATA_KEY])];
|
|
@@ -5257,7 +5533,12 @@ function createClient(config) {
|
|
|
5257
5533
|
const wrappedModules = config.modules ? use(config.modules) : {};
|
|
5258
5534
|
return {
|
|
5259
5535
|
...wrappedModules,
|
|
5260
|
-
auth
|
|
5536
|
+
get auth() {
|
|
5537
|
+
const authStrategy = getAuthStrategy();
|
|
5538
|
+
const originalGetAuthHeaders = authStrategy.getAuthHeaders;
|
|
5539
|
+
authStrategy.getAuthHeaders = originalGetAuthHeaders.bind(void 0, config.host);
|
|
5540
|
+
return authStrategy;
|
|
5541
|
+
},
|
|
5261
5542
|
setHeaders,
|
|
5262
5543
|
use,
|
|
5263
5544
|
enableContext(contextType, opts = { elevated: false }) {
|
|
@@ -12647,7 +12928,7 @@ function timing(aggregator, name, value, unit = "second", data) {
|
|
|
12647
12928
|
}
|
|
12648
12929
|
distribution(aggregator, name, value, { ...data, unit });
|
|
12649
12930
|
}
|
|
12650
|
-
function
|
|
12931
|
+
function set2(aggregator, name, value, data) {
|
|
12651
12932
|
addToMetricsAggregator(aggregator, SET_METRIC_TYPE, name, value, data);
|
|
12652
12933
|
}
|
|
12653
12934
|
function gauge(aggregator, name, value, data) {
|
|
@@ -12656,7 +12937,7 @@ function gauge(aggregator, name, value, data) {
|
|
|
12656
12937
|
var metrics = {
|
|
12657
12938
|
increment,
|
|
12658
12939
|
distribution,
|
|
12659
|
-
set,
|
|
12940
|
+
set: set2,
|
|
12660
12941
|
gauge,
|
|
12661
12942
|
timing,
|
|
12662
12943
|
/**
|