@pronto-tools-and-more/pronto 3.16.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/pronto",
3
- "version": "3.16.0",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -13,10 +13,10 @@
13
13
  "author": "",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@pronto-tools-and-more/file-watcher": "3.16.0",
17
- "@pronto-tools-and-more/files": "3.16.0",
18
- "@pronto-tools-and-more/network-process": "3.16.0",
19
- "@pronto-tools-and-more/sass-compiler": "3.16.0",
16
+ "@pronto-tools-and-more/file-watcher": "4.0.0",
17
+ "@pronto-tools-and-more/files": "4.0.0",
18
+ "@pronto-tools-and-more/network-process": "4.0.0",
19
+ "@pronto-tools-and-more/sass-compiler": "4.0.0",
20
20
  "@lvce-editor/assert": "^1.2.0",
21
21
  "@lvce-editor/ipc": "^9.3.0",
22
22
  "@lvce-editor/json-rpc": "^1.3.0",
@@ -31,7 +31,8 @@ export const platform = config.platform || defaultPlatform;
31
31
 
32
32
  // TODO use direct backend url
33
33
  export const loginUrl =
34
- config.loginUrl || `https://builder.purplemanager.com/api/user/login`;
34
+ config.loginUrl ||
35
+ `https://identity.purplemanager.com/realms/purple/protocol/openid-connect/token`;
35
36
 
36
37
  export const listVersionsUrl =
37
38
  config.listVersionsUrl || "https://builder.purplemanager.com/api/versions";
@@ -0,0 +1,16 @@
1
+ import * as Login from "../Login/Login.js";
2
+
3
+ export const getSessionId = async ({ loginUrl, userEmail, userPassword }) => {
4
+ const result = await Login.login({
5
+ loginUrl,
6
+ userEmail,
7
+ userPassword,
8
+ });
9
+ if (result.access_token) {
10
+ return result.access_token;
11
+ }
12
+ if (result.sessionID) {
13
+ return result.sessionID;
14
+ }
15
+ throw new Error("failed to get session id");
16
+ };
@@ -5,8 +5,8 @@ import * as Config from "../Config/Config.js";
5
5
  import * as Cwd from "../Cwd/Cwd.js";
6
6
  import * as DownloadZipFile from "../DownloadZipFile/DownloadZipFile.js";
7
7
  import * as ExtractZip from "../ExtractZip/ExtractZip.js";
8
+ import * as GetSessionId from "../GetSessionId/GetSessionId.js";
8
9
  import * as ListContentZipFiles from "../ListContentZipFiles/ListContentZipFiles.js";
9
- import * as Login from "../Login/Login.js";
10
10
  import * as NetworkProcess from "../NetworkProcess/NetworkProcess.js";
11
11
 
12
12
  export const pullCode = async () => {
@@ -23,12 +23,11 @@ export const pullCode = async () => {
23
23
  const outDir = join(Cwd.cwd, ".tmp", "update");
24
24
  const src = join(Cwd.cwd, "src");
25
25
  const oldSrc = join(Cwd.cwd, ".tmp", "old-src");
26
- const sessionInfo = await Login.login({
26
+ const sessionId = await GetSessionId.getSessionId({
27
27
  loginUrl,
28
28
  userEmail,
29
29
  userPassword,
30
30
  });
31
- const sessionId = sessionInfo.sessionID;
32
31
  const zipFile = await ListContentZipFiles.listContentZipFiles({
33
32
  listResourcesUrl,
34
33
  sessionId,
@@ -3,8 +3,8 @@ import { join } from "node:path";
3
3
  import * as Config from "../Config/Config.js";
4
4
  import * as CreateZip from "../CreateZip/CreateZip.js";
5
5
  import * as Cwd from "../Cwd/Cwd.js";
6
+ import * as GetSessionId from "../GetSessionId/GetSessionId.js";
6
7
  import * as GetZipUploadMessage from "../GetZipUploadMessage/GetZipUploadMessage.js";
7
- import * as Login from "../Login/Login.js";
8
8
  import * as NetworkProcess from "../NetworkProcess/NetworkProcess.js";
9
9
  import * as UploadZip from "../UploadZip/UploadZip.js";
10
10
 
@@ -27,12 +27,11 @@ export const pushCode = async () => {
27
27
  }
28
28
  const outFile = join(Cwd.cwd, ".tmp", "upload.zip");
29
29
  const src = join(Cwd.cwd, "src");
30
- const sessionInfo = await Login.login({
30
+ const sessionId = await GetSessionId.getSessionId({
31
31
  loginUrl,
32
32
  userEmail,
33
33
  userPassword,
34
34
  });
35
- const sessionId = sessionInfo.sessionID;
36
35
  const message = await GetZipUploadMessage.getZipUploadMessage();
37
36
 
38
37
  await CreateZip.createZip({
@@ -5,8 +5,8 @@ import * as Cwd from "../Cwd/Cwd.js";
5
5
  import * as DiffSimple from "../DiffSimple/DiffSimple.js";
6
6
  import * as DownloadDiffFiles from "../DownloadDiffFiles/DownloadDiffFiles.js";
7
7
  import * as GetLatestStableVersion from "../GetLatestStableVersion/GetLatestStableVersion.js";
8
+ import * as GetSessionId from "../GetSessionId/GetSessionId.js";
8
9
  import * as ListExperienceVersions from "../ListExperienceVersions/ListExperienceVersions.js";
9
- import * as Login from "../Login/Login.js";
10
10
  import * as MakeUpgradeRequest from "../MakeUpgradeRequest/MakeUpgradeRequest.js";
11
11
  import * as NetworkProcess from "../NetworkProcess/NetworkProcess.js";
12
12
  import * as PullWorkingCopy from "../PullWorkingCopy/PullWorkingCopy.js";
@@ -25,7 +25,7 @@ export const upgrade = async () => {
25
25
  pullWorkingCopyUrl,
26
26
  } = Config;
27
27
  const src = join(Cwd.cwd, "src");
28
- const sessionInfo = await Login.login({
28
+ const sessionInfo = await GetSessionId.getSessionId({
29
29
  loginUrl,
30
30
  userEmail,
31
31
  userPassword,