shipthis 0.1.9 → 0.1.11
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/assets/markdown/create-or-import-keystore.md +7 -0
- package/dist/AppleBundleIdDetails-CjP5y0cj.js +74 -0
- package/dist/AppleBundleIdDetails-CztWY_mT.js +73 -0
- package/dist/AppleBundleIdDetails-DKeSAte9.js +73 -0
- package/dist/AppleBundleIdDetails-DymjrhOZ.js +73 -0
- package/dist/Command-BiB9MqbJ.js +204 -0
- package/dist/Command-D6rWEZRM.js +204 -0
- package/dist/Command-Dn0P_KOV.js +205 -0
- package/dist/Command-YJJp90ru.js +204 -0
- package/dist/CommandGame-C1oTlfdb.js +8 -0
- package/dist/CommandGame-cPaTk1wh.js +8 -0
- package/dist/CommandGame-k04mHiDl.js +8 -0
- package/dist/CommandGame-pI9VXKxi.js +8 -0
- package/dist/Create-DIaSKUpl.js +56 -0
- package/dist/CreateKeystore-BnNdeDUa.js +57 -0
- package/dist/CreateKeystore-Cf-nsK_M.js +56 -0
- package/dist/CreateKeystore-g1z6DsU5.js +56 -0
- package/dist/Import-BIOsf8AA.js +107 -0
- package/dist/JobProgress-CPkWVSlH.js +108 -0
- package/dist/JobProgress-W0QQR49T.js +108 -0
- package/dist/JobProgress-biiLhigg.js +109 -0
- package/dist/JobProgress-jmGAzvxS.js +108 -0
- package/dist/JobStatusTable-BA_q-kgE.js +75 -0
- package/dist/JobStatusTable-ByW0bN6c.js +75 -0
- package/dist/JobStatusTable-CgaTS7jS.js +75 -0
- package/dist/JobStatusTable-DqoppRro.js +75 -0
- package/dist/ProjectCredentialsTable-8kXt7sTS.js +37 -0
- package/dist/ProjectCredentialsTable-DRMK_SNw.js +37 -0
- package/dist/ProjectCredentialsTable-DfkpvTf8.js +37 -0
- package/dist/UserCredentialsTable-DMh8Wpy7.js +82 -0
- package/dist/UserCredentialsTable-DgHZJSHG.js +82 -0
- package/dist/UserCredentialsTable-TflQvTEP.js +82 -0
- package/dist/baseAppleCommand-1isaFxCQ.js +10 -0
- package/dist/baseAppleCommand-B9wyIqdL.js +10 -0
- package/dist/baseAppleCommand-DpasCbje.js +10 -0
- package/dist/baseGameAndroidCommand-6vsMpE7a.js +43 -0
- package/dist/baseGameAndroidCommand-B3LRG701.js +43 -0
- package/dist/baseGameAndroidCommand-C9BuS2Sr.js +43 -0
- package/dist/commands/apple/apiKey/create.js +10 -10
- package/dist/commands/apple/apiKey/export.js +8 -8
- package/dist/commands/apple/apiKey/import.js +8 -8
- package/dist/commands/apple/apiKey/status.js +7 -7
- package/dist/commands/apple/certificate/create.js +10 -10
- package/dist/commands/apple/certificate/export.js +8 -8
- package/dist/commands/apple/certificate/import.js +8 -8
- package/dist/commands/apple/certificate/status.js +7 -7
- package/dist/commands/apple/login.js +2 -2
- package/dist/commands/apple/status.js +6 -6
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/game/android/apiKey/connect.js +11 -11
- package/dist/commands/game/android/apiKey/create.js +13 -13
- package/dist/commands/game/android/apiKey/export.js +9 -9
- package/dist/commands/game/android/apiKey/import.js +9 -9
- package/dist/commands/game/android/apiKey/invite.js +4 -4
- package/dist/commands/game/android/apiKey/status.js +9 -9
- package/dist/commands/game/android/keyStore/create.js +12 -12
- package/dist/commands/game/android/keyStore/export.js +8 -8
- package/dist/commands/game/android/keyStore/import.js +49 -29
- package/dist/commands/game/android/keyStore/status.js +8 -8
- package/dist/commands/game/android/status.js +7 -7
- package/dist/commands/game/build/download.js +7 -7
- package/dist/commands/game/build/list.js +7 -7
- package/dist/commands/game/create.js +2 -2
- package/dist/commands/game/details.js +22 -8
- package/dist/commands/game/export.js +1 -1
- package/dist/commands/game/ios/app/addTester.js +6 -6
- package/dist/commands/game/ios/app/create.js +5 -5
- package/dist/commands/game/ios/app/status.js +9 -9
- package/dist/commands/game/ios/app/sync.js +7 -7
- package/dist/commands/game/ios/profile/create.js +10 -10
- package/dist/commands/game/ios/profile/export.js +8 -8
- package/dist/commands/game/ios/profile/import.js +8 -8
- package/dist/commands/game/ios/profile/status.js +8 -8
- package/dist/commands/game/ios/status.js +10 -10
- package/dist/commands/game/ios/wizard.js +2 -2
- package/dist/commands/game/job/list.js +7 -7
- package/dist/commands/game/job/status.js +11 -11
- package/dist/commands/game/list.js +7 -7
- package/dist/commands/game/ship.js +11 -11
- package/dist/commands/game/status.js +7 -7
- package/dist/commands/game/wizard.js +590 -35
- package/dist/commands/internal/fastlane.js +1 -1
- package/dist/commands/internal/readme.js +255 -770
- package/dist/commands/login.js +2 -2
- package/dist/commands/status.js +6 -6
- package/dist/export-B_F6vXIK.js +36 -0
- package/dist/export-C_lu1FD9.js +36 -0
- package/dist/export-rS9o87LD.js +36 -0
- package/dist/import-7T3J63j2.js +38 -0
- package/dist/import-Brg3zYmT.js +38 -0
- package/dist/import-DPbg8WvS.js +38 -0
- package/dist/import-v54PM_Qg.js +47 -0
- package/dist/index-BB7X1Pqp.js +695 -0
- package/dist/index-BQnkBr1Q.js +136 -0
- package/dist/index-BX9h2vPV.js +123 -0
- package/dist/index-BjGSEqP5.js +135 -0
- package/dist/index-Bv3x8c78.js +693 -0
- package/dist/index-ByOvCs4O.js +122 -0
- package/dist/index-BzffuqPa.js +24 -0
- package/dist/index-C9734Cj2.js +693 -0
- package/dist/index-CKYExssR.js +136 -0
- package/dist/index-Cz_KLwWf.js +136 -0
- package/dist/index-D6BH5UAM.js +135 -0
- package/dist/index-DOgF4dFK.js +24 -0
- package/dist/index-DgbQBx6x.js +122 -0
- package/dist/index-DxHPjZav.js +136 -0
- package/dist/index-m4HTrJ5J.js +135 -0
- package/dist/index-o9Y-84Rj.js +122 -0
- package/dist/upload-2naN75Zu.js +60 -0
- package/dist/upload-Cx71802W.js +60 -0
- package/dist/upload-DvAE1vDq.js +60 -0
- package/dist/useAndroidServiceAccountTestResult-BDc7XpKE.js +52 -0
- package/dist/useAndroidServiceAccountTestResult-B_ekRewZ.js +52 -0
- package/dist/useAndroidServiceAccountTestResult-Ce1x0Eh8.js +52 -0
- package/dist/useAppleApp-BEtLQa7n.js +32 -0
- package/dist/useAppleApp-CApC0-4Q.js +32 -0
- package/dist/useAppleApp-CETIcsJS.js +32 -0
- package/dist/useAppleBundleId-DXbMDRLd.js +64 -0
- package/dist/useAppleBundleId-SmzY6rkm.js +64 -0
- package/dist/useAppleBundleId-gPBzJwQg.js +64 -0
- package/dist/useJobWatching-BIG6fnTN.js +45 -0
- package/dist/useJobWatching-Cp-CYd90.js +45 -0
- package/dist/useJobWatching-D-YzSlK8.js +45 -0
- package/dist/useJobWatching-I_A3b36f.js +45 -0
- package/dist/useProjectCredentials-CKngz2rd.js +54 -0
- package/dist/useProjectCredentials-EapDge1I.js +54 -0
- package/dist/useProjectCredentials-vjedBbKl.js +54 -0
- package/dist/useWebSocket-Bep1zAVG.js +36 -0
- package/dist/useWebSocket-CBqsjHbt.js +36 -0
- package/dist/useWebSocket-rBLiZsKb.js +36 -0
- package/dist/wizard-ChPegnMW.js +133 -0
- package/npm-shrinkwrap.json +251 -223
- package/oclif.manifest.json +282 -223
- package/package.json +2 -4
package/dist/commands/login.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { Flags } from '@oclif/core';
|
|
3
|
-
import { X as WEB_URL, T as BaseCommand, q as API_URL, Y as setAuthToken, Z as acceptTerms } from '../index-
|
|
4
|
-
import { a as getInput } from '../index-
|
|
3
|
+
import { X as WEB_URL, T as BaseCommand, q as API_URL, Y as setAuthToken, Z as acceptTerms } from '../index-BB7X1Pqp.js';
|
|
4
|
+
import { a as getInput } from '../index-Cz_KLwWf.js';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'fs';
|
|
7
7
|
import '@expo/apple-utils/build/index.js';
|
package/dist/commands/status.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { render } from 'ink';
|
|
3
|
-
import { T as BaseCommand, j as isCWDGodotGame } from '../index-
|
|
3
|
+
import { T as BaseCommand, j as isCWDGodotGame } from '../index-BB7X1Pqp.js';
|
|
4
4
|
import 'react';
|
|
5
|
-
import { C as Command } from '../Command-
|
|
5
|
+
import { C as Command } from '../Command-BiB9MqbJ.js';
|
|
6
6
|
import 'ink-spinner';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import 'crypto-js';
|
|
@@ -11,17 +11,17 @@ import 'luxon';
|
|
|
11
11
|
import 'fs';
|
|
12
12
|
import '@inkjs/ui';
|
|
13
13
|
import '@tanstack/react-query';
|
|
14
|
-
import '
|
|
14
|
+
import 'yazl';
|
|
15
15
|
import 'crypto';
|
|
16
16
|
import 'readline-sync';
|
|
17
17
|
import 'node:readline';
|
|
18
18
|
import 'node:path';
|
|
19
19
|
import 'node:url';
|
|
20
20
|
import 'fast-glob';
|
|
21
|
-
import 'yazl';
|
|
22
21
|
import 'socket.io-client';
|
|
23
22
|
import { i as isCWDGitRepo } from '../git-DREGq-jc.js';
|
|
24
23
|
import '@oclif/core';
|
|
24
|
+
import 'open';
|
|
25
25
|
import { N as NextSteps } from '../NextSteps-CK9zHOCt.js';
|
|
26
26
|
import 'qrcode';
|
|
27
27
|
import { S as StatusTable } from '../StatusTable-Dm5St4g-.js';
|
|
@@ -32,8 +32,8 @@ import '@expo/apple-utils/build/index.js';
|
|
|
32
32
|
import 'ini';
|
|
33
33
|
import 'deepmerge';
|
|
34
34
|
import 'isomorphic-git';
|
|
35
|
-
import '../index-
|
|
36
|
-
import '../useAndroidServiceAccountTestResult-
|
|
35
|
+
import '../index-Cz_KLwWf.js';
|
|
36
|
+
import '../useAndroidServiceAccountTestResult-Ce1x0Eh8.js';
|
|
37
37
|
import 'marked';
|
|
38
38
|
import 'marked-terminal';
|
|
39
39
|
import '../Title-BCQtayg6.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { o as getAuthedHeaders, p as API_URL } from './index-C9734Cj2.js';
|
|
4
|
+
|
|
5
|
+
async function exportCredential({ zipPath, credentialId, projectId }) {
|
|
6
|
+
const headers = getAuthedHeaders();
|
|
7
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/${credentialId}/export` : `${API_URL}/credentials/${credentialId}/export`;
|
|
8
|
+
const { data } = await axios.post(
|
|
9
|
+
url,
|
|
10
|
+
{},
|
|
11
|
+
// no-body
|
|
12
|
+
{ headers }
|
|
13
|
+
);
|
|
14
|
+
const downloadUrl = data.url;
|
|
15
|
+
return await downloadFile(downloadUrl, zipPath);
|
|
16
|
+
}
|
|
17
|
+
async function downloadFile(url, destination) {
|
|
18
|
+
const response = await axios({
|
|
19
|
+
url,
|
|
20
|
+
method: "GET",
|
|
21
|
+
responseType: "stream"
|
|
22
|
+
});
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const file = fs.createWriteStream(destination);
|
|
25
|
+
response.data.pipe(file);
|
|
26
|
+
file.on("finish", () => {
|
|
27
|
+
file.close();
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
file.on("error", (err) => {
|
|
31
|
+
fs.unlink(destination, () => reject(err));
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { exportCredential as e };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { p as getAuthedHeaders, q as API_URL } from './index-Bv3x8c78.js';
|
|
4
|
+
|
|
5
|
+
async function exportCredential({ zipPath, credentialId, projectId }) {
|
|
6
|
+
const headers = getAuthedHeaders();
|
|
7
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/${credentialId}/export` : `${API_URL}/credentials/${credentialId}/export`;
|
|
8
|
+
const { data } = await axios.post(
|
|
9
|
+
url,
|
|
10
|
+
{},
|
|
11
|
+
// no-body
|
|
12
|
+
{ headers }
|
|
13
|
+
);
|
|
14
|
+
const downloadUrl = data.url;
|
|
15
|
+
return await downloadFile(downloadUrl, zipPath);
|
|
16
|
+
}
|
|
17
|
+
async function downloadFile(url, destination) {
|
|
18
|
+
const response = await axios({
|
|
19
|
+
url,
|
|
20
|
+
method: "GET",
|
|
21
|
+
responseType: "stream"
|
|
22
|
+
});
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const file = fs.createWriteStream(destination);
|
|
25
|
+
response.data.pipe(file);
|
|
26
|
+
file.on("finish", () => {
|
|
27
|
+
file.close();
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
file.on("error", (err) => {
|
|
31
|
+
fs.unlink(destination, () => reject(err));
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { exportCredential as e };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { p as getAuthedHeaders, q as API_URL } from './index-BB7X1Pqp.js';
|
|
4
|
+
|
|
5
|
+
async function exportCredential({ zipPath, credentialId, projectId }) {
|
|
6
|
+
const headers = getAuthedHeaders();
|
|
7
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/${credentialId}/export` : `${API_URL}/credentials/${credentialId}/export`;
|
|
8
|
+
const { data } = await axios.post(
|
|
9
|
+
url,
|
|
10
|
+
{},
|
|
11
|
+
// no-body
|
|
12
|
+
{ headers }
|
|
13
|
+
);
|
|
14
|
+
const downloadUrl = data.url;
|
|
15
|
+
return await downloadFile(downloadUrl, zipPath);
|
|
16
|
+
}
|
|
17
|
+
async function downloadFile(url, destination) {
|
|
18
|
+
const response = await axios({
|
|
19
|
+
url,
|
|
20
|
+
method: "GET",
|
|
21
|
+
responseType: "stream"
|
|
22
|
+
});
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const file = fs.createWriteStream(destination);
|
|
25
|
+
response.data.pipe(file);
|
|
26
|
+
file.on("finish", () => {
|
|
27
|
+
file.close();
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
file.on("error", (err) => {
|
|
31
|
+
fs.unlink(destination, () => reject(err));
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { exportCredential as e };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { promises } from 'fs';
|
|
3
|
+
import { p as getAuthedHeaders, q as API_URL } from './index-BB7X1Pqp.js';
|
|
4
|
+
|
|
5
|
+
async function getNewImportTicket(projectId) {
|
|
6
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
|
|
7
|
+
const headers = getAuthedHeaders();
|
|
8
|
+
const { data: importInfo } = await axios({
|
|
9
|
+
method: "post",
|
|
10
|
+
url,
|
|
11
|
+
headers
|
|
12
|
+
});
|
|
13
|
+
return importInfo;
|
|
14
|
+
}
|
|
15
|
+
async function importCredential({ projectId, zipPath, type, platform }) {
|
|
16
|
+
const importTicket = await getNewImportTicket(projectId);
|
|
17
|
+
const zipBuffer = await promises.readFile(zipPath);
|
|
18
|
+
await axios.put(importTicket.url, zipBuffer, {
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-length": zipBuffer.length,
|
|
21
|
+
"Content-Type": "application/zip"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const headers = getAuthedHeaders();
|
|
25
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import` : `${API_URL}/credentials/import`;
|
|
26
|
+
return await axios({
|
|
27
|
+
method: "post",
|
|
28
|
+
url,
|
|
29
|
+
headers,
|
|
30
|
+
data: {
|
|
31
|
+
uuid: importTicket.uuid,
|
|
32
|
+
type,
|
|
33
|
+
platform
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { importCredential as i };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { promises } from 'fs';
|
|
3
|
+
import { o as getAuthedHeaders, p as API_URL } from './index-C9734Cj2.js';
|
|
4
|
+
|
|
5
|
+
async function getNewImportTicket(projectId) {
|
|
6
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
|
|
7
|
+
const headers = getAuthedHeaders();
|
|
8
|
+
const { data: importInfo } = await axios({
|
|
9
|
+
method: "post",
|
|
10
|
+
url,
|
|
11
|
+
headers
|
|
12
|
+
});
|
|
13
|
+
return importInfo;
|
|
14
|
+
}
|
|
15
|
+
async function importCredential({ projectId, zipPath, type, platform }) {
|
|
16
|
+
const importTicket = await getNewImportTicket(projectId);
|
|
17
|
+
const zipBuffer = await promises.readFile(zipPath);
|
|
18
|
+
await axios.put(importTicket.url, zipBuffer, {
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-length": zipBuffer.length,
|
|
21
|
+
"Content-Type": "application/zip"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const headers = getAuthedHeaders();
|
|
25
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import` : `${API_URL}/credentials/import`;
|
|
26
|
+
return await axios({
|
|
27
|
+
method: "post",
|
|
28
|
+
url,
|
|
29
|
+
headers,
|
|
30
|
+
data: {
|
|
31
|
+
uuid: importTicket.uuid,
|
|
32
|
+
type,
|
|
33
|
+
platform
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { importCredential as i };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { promises } from 'fs';
|
|
3
|
+
import { p as getAuthedHeaders, q as API_URL } from './index-Bv3x8c78.js';
|
|
4
|
+
|
|
5
|
+
async function getNewImportTicket(projectId) {
|
|
6
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
|
|
7
|
+
const headers = getAuthedHeaders();
|
|
8
|
+
const { data: importInfo } = await axios({
|
|
9
|
+
method: "post",
|
|
10
|
+
url,
|
|
11
|
+
headers
|
|
12
|
+
});
|
|
13
|
+
return importInfo;
|
|
14
|
+
}
|
|
15
|
+
async function importCredential({ projectId, zipPath, type, platform }) {
|
|
16
|
+
const importTicket = await getNewImportTicket(projectId);
|
|
17
|
+
const zipBuffer = await promises.readFile(zipPath);
|
|
18
|
+
await axios.put(importTicket.url, zipBuffer, {
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-length": zipBuffer.length,
|
|
21
|
+
"Content-Type": "application/zip"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const headers = getAuthedHeaders();
|
|
25
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import` : `${API_URL}/credentials/import`;
|
|
26
|
+
return await axios({
|
|
27
|
+
method: "post",
|
|
28
|
+
url,
|
|
29
|
+
headers,
|
|
30
|
+
data: {
|
|
31
|
+
uuid: importTicket.uuid,
|
|
32
|
+
type,
|
|
33
|
+
platform
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { importCredential as i };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { promises } from 'fs';
|
|
3
|
+
import { p as getAuthedHeaders, q as API_URL } from './index-BB7X1Pqp.js';
|
|
4
|
+
|
|
5
|
+
async function getNewImportTicket(projectId) {
|
|
6
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import/url` : `${API_URL}/credentials/import/url`;
|
|
7
|
+
const headers = getAuthedHeaders();
|
|
8
|
+
const { data: importInfo } = await axios({
|
|
9
|
+
method: "post",
|
|
10
|
+
url,
|
|
11
|
+
headers
|
|
12
|
+
});
|
|
13
|
+
return importInfo;
|
|
14
|
+
}
|
|
15
|
+
async function importCredential({
|
|
16
|
+
projectId,
|
|
17
|
+
zipPath,
|
|
18
|
+
type,
|
|
19
|
+
platform
|
|
20
|
+
}) {
|
|
21
|
+
const importTicket = await getNewImportTicket(projectId);
|
|
22
|
+
const zipBuffer = await promises.readFile(zipPath);
|
|
23
|
+
await axios.put(importTicket.url, zipBuffer, {
|
|
24
|
+
headers: {
|
|
25
|
+
"Content-length": zipBuffer.length,
|
|
26
|
+
"Content-Type": "application/zip"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const headers = getAuthedHeaders();
|
|
30
|
+
const url = projectId ? `${API_URL}/projects/${projectId}/credentials/import` : `${API_URL}/credentials/import`;
|
|
31
|
+
const { data: publicCredential } = await axios({
|
|
32
|
+
method: "post",
|
|
33
|
+
url,
|
|
34
|
+
headers,
|
|
35
|
+
data: {
|
|
36
|
+
uuid: importTicket.uuid,
|
|
37
|
+
type,
|
|
38
|
+
platform
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (projectId) {
|
|
42
|
+
return publicCredential;
|
|
43
|
+
}
|
|
44
|
+
return publicCredential;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { importCredential as i };
|