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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { f as App } from './index-Bv3x8c78.js';
|
|
3
|
+
|
|
4
|
+
const queryAppleApp = async ({ ctx, iosBundleId }) => {
|
|
5
|
+
if (!iosBundleId) {
|
|
6
|
+
return { app: null, summary: null };
|
|
7
|
+
}
|
|
8
|
+
const app = await App.findAsync(ctx, {
|
|
9
|
+
bundleId: iosBundleId
|
|
10
|
+
});
|
|
11
|
+
if (!app) {
|
|
12
|
+
return { app: null, summary: null };
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
app,
|
|
16
|
+
summary: {
|
|
17
|
+
id: app.id,
|
|
18
|
+
name: app.attributes.name,
|
|
19
|
+
bundleId: app.attributes.bundleId,
|
|
20
|
+
primaryLocale: app.attributes.primaryLocale
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const useAppleApp = (props) => {
|
|
25
|
+
const queryResult = useQuery({
|
|
26
|
+
queryKey: ["appleApp", props.iosBundleId],
|
|
27
|
+
queryFn: () => queryAppleApp(props)
|
|
28
|
+
});
|
|
29
|
+
return queryResult;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { queryAppleApp as q, useAppleApp as u };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { e as BundleId, r as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, s as CapabilityType } from './index-BB7X1Pqp.js';
|
|
3
|
+
|
|
4
|
+
async function getBundleIdCapabilities(bundleId) {
|
|
5
|
+
const current = await bundleId.getBundleIdCapabilitiesAsync();
|
|
6
|
+
let existing = [];
|
|
7
|
+
for (const capability of current) {
|
|
8
|
+
const capabilityType = Object.values(CapabilityType).find((c) => capability.isType(c));
|
|
9
|
+
if (capabilityType) {
|
|
10
|
+
existing.push(capabilityType);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return existing;
|
|
14
|
+
}
|
|
15
|
+
const fetchBundleId = async ({ ctx, iosBundleId }) => {
|
|
16
|
+
const empty = {
|
|
17
|
+
bundleId: null,
|
|
18
|
+
bundleIdSummary: null,
|
|
19
|
+
capabilities: null,
|
|
20
|
+
capabilitiesTable: null,
|
|
21
|
+
projectCapabilities: null,
|
|
22
|
+
shouldSyncCapabilities: null
|
|
23
|
+
};
|
|
24
|
+
if (!iosBundleId) return empty;
|
|
25
|
+
const bundleId = await BundleId.findAsync(ctx, {
|
|
26
|
+
identifier: iosBundleId
|
|
27
|
+
});
|
|
28
|
+
if (!bundleId) return empty;
|
|
29
|
+
const bundleIdCapabilities = await getBundleIdCapabilities(bundleId);
|
|
30
|
+
const projectCapabilities = getGodotProjectCapabilities(Platform.IOS);
|
|
31
|
+
const capabilitiesTable = GODOT_CAPABILITIES.map((gc) => {
|
|
32
|
+
const isEnabledInBundle = bundleIdCapabilities.includes(gc.type);
|
|
33
|
+
const isEnabledInProject = projectCapabilities.includes(gc.type);
|
|
34
|
+
const isCorrectlyConfigured = isEnabledInBundle === isEnabledInProject;
|
|
35
|
+
return {
|
|
36
|
+
name: gc.name,
|
|
37
|
+
isEnabledInBundle,
|
|
38
|
+
isEnabledInProject,
|
|
39
|
+
isCorrectlyConfigured
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
bundleId,
|
|
44
|
+
bundleIdSummary: {
|
|
45
|
+
id: bundleId.id,
|
|
46
|
+
identifier: bundleId.attributes.identifier,
|
|
47
|
+
name: bundleId.attributes.name,
|
|
48
|
+
platform: bundleId.attributes.platform
|
|
49
|
+
},
|
|
50
|
+
capabilities: bundleIdCapabilities,
|
|
51
|
+
capabilitiesTable,
|
|
52
|
+
projectCapabilities,
|
|
53
|
+
shouldSyncCapabilities: !capabilitiesTable.every((c) => c.isCorrectlyConfigured)
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const useAppleBundleId = (props) => {
|
|
57
|
+
const queryResult = useQuery({
|
|
58
|
+
queryKey: ["appleBundleId", props.iosBundleId],
|
|
59
|
+
queryFn: () => fetchBundleId(props)
|
|
60
|
+
});
|
|
61
|
+
return queryResult;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { fetchBundleId as f, useAppleBundleId as u };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { e as BundleId, r as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, s as CapabilityType } from './index-Bv3x8c78.js';
|
|
3
|
+
|
|
4
|
+
async function getBundleIdCapabilities(bundleId) {
|
|
5
|
+
const current = await bundleId.getBundleIdCapabilitiesAsync();
|
|
6
|
+
let existing = [];
|
|
7
|
+
for (const capability of current) {
|
|
8
|
+
const capabilityType = Object.values(CapabilityType).find((c) => capability.isType(c));
|
|
9
|
+
if (capabilityType) {
|
|
10
|
+
existing.push(capabilityType);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return existing;
|
|
14
|
+
}
|
|
15
|
+
const fetchBundleId = async ({ ctx, iosBundleId }) => {
|
|
16
|
+
const empty = {
|
|
17
|
+
bundleId: null,
|
|
18
|
+
bundleIdSummary: null,
|
|
19
|
+
capabilities: null,
|
|
20
|
+
capabilitiesTable: null,
|
|
21
|
+
projectCapabilities: null,
|
|
22
|
+
shouldSyncCapabilities: null
|
|
23
|
+
};
|
|
24
|
+
if (!iosBundleId) return empty;
|
|
25
|
+
const bundleId = await BundleId.findAsync(ctx, {
|
|
26
|
+
identifier: iosBundleId
|
|
27
|
+
});
|
|
28
|
+
if (!bundleId) return empty;
|
|
29
|
+
const bundleIdCapabilities = await getBundleIdCapabilities(bundleId);
|
|
30
|
+
const projectCapabilities = getGodotProjectCapabilities(Platform.IOS);
|
|
31
|
+
const capabilitiesTable = GODOT_CAPABILITIES.map((gc) => {
|
|
32
|
+
const isEnabledInBundle = bundleIdCapabilities.includes(gc.type);
|
|
33
|
+
const isEnabledInProject = projectCapabilities.includes(gc.type);
|
|
34
|
+
const isCorrectlyConfigured = isEnabledInBundle === isEnabledInProject;
|
|
35
|
+
return {
|
|
36
|
+
name: gc.name,
|
|
37
|
+
isEnabledInBundle,
|
|
38
|
+
isEnabledInProject,
|
|
39
|
+
isCorrectlyConfigured
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
bundleId,
|
|
44
|
+
bundleIdSummary: {
|
|
45
|
+
id: bundleId.id,
|
|
46
|
+
identifier: bundleId.attributes.identifier,
|
|
47
|
+
name: bundleId.attributes.name,
|
|
48
|
+
platform: bundleId.attributes.platform
|
|
49
|
+
},
|
|
50
|
+
capabilities: bundleIdCapabilities,
|
|
51
|
+
capabilitiesTable,
|
|
52
|
+
projectCapabilities,
|
|
53
|
+
shouldSyncCapabilities: !capabilitiesTable.every((c) => c.isCorrectlyConfigured)
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const useAppleBundleId = (props) => {
|
|
57
|
+
const queryResult = useQuery({
|
|
58
|
+
queryKey: ["appleBundleId", props.iosBundleId],
|
|
59
|
+
queryFn: () => fetchBundleId(props)
|
|
60
|
+
});
|
|
61
|
+
return queryResult;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { fetchBundleId as f, useAppleBundleId as u };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { e as BundleId, q as getGodotProjectCapabilities, P as Platform, G as GODOT_CAPABILITIES, r as CapabilityType } from './index-C9734Cj2.js';
|
|
3
|
+
|
|
4
|
+
async function getBundleIdCapabilities(bundleId) {
|
|
5
|
+
const current = await bundleId.getBundleIdCapabilitiesAsync();
|
|
6
|
+
let existing = [];
|
|
7
|
+
for (const capability of current) {
|
|
8
|
+
const capabilityType = Object.values(CapabilityType).find((c) => capability.isType(c));
|
|
9
|
+
if (capabilityType) {
|
|
10
|
+
existing.push(capabilityType);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return existing;
|
|
14
|
+
}
|
|
15
|
+
const fetchBundleId = async ({ ctx, iosBundleId }) => {
|
|
16
|
+
const empty = {
|
|
17
|
+
bundleId: null,
|
|
18
|
+
bundleIdSummary: null,
|
|
19
|
+
capabilities: null,
|
|
20
|
+
capabilitiesTable: null,
|
|
21
|
+
projectCapabilities: null,
|
|
22
|
+
shouldSyncCapabilities: null
|
|
23
|
+
};
|
|
24
|
+
if (!iosBundleId) return empty;
|
|
25
|
+
const bundleId = await BundleId.findAsync(ctx, {
|
|
26
|
+
identifier: iosBundleId
|
|
27
|
+
});
|
|
28
|
+
if (!bundleId) return empty;
|
|
29
|
+
const bundleIdCapabilities = await getBundleIdCapabilities(bundleId);
|
|
30
|
+
const projectCapabilities = getGodotProjectCapabilities(Platform.IOS);
|
|
31
|
+
const capabilitiesTable = GODOT_CAPABILITIES.map((gc) => {
|
|
32
|
+
const isEnabledInBundle = bundleIdCapabilities.includes(gc.type);
|
|
33
|
+
const isEnabledInProject = projectCapabilities.includes(gc.type);
|
|
34
|
+
const isCorrectlyConfigured = isEnabledInBundle === isEnabledInProject;
|
|
35
|
+
return {
|
|
36
|
+
name: gc.name,
|
|
37
|
+
isEnabledInBundle,
|
|
38
|
+
isEnabledInProject,
|
|
39
|
+
isCorrectlyConfigured
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
bundleId,
|
|
44
|
+
bundleIdSummary: {
|
|
45
|
+
id: bundleId.id,
|
|
46
|
+
identifier: bundleId.attributes.identifier,
|
|
47
|
+
name: bundleId.attributes.name,
|
|
48
|
+
platform: bundleId.attributes.platform
|
|
49
|
+
},
|
|
50
|
+
capabilities: bundleIdCapabilities,
|
|
51
|
+
capabilitiesTable,
|
|
52
|
+
projectCapabilities,
|
|
53
|
+
shouldSyncCapabilities: !capabilitiesTable.every((c) => c.isCorrectlyConfigured)
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const useAppleBundleId = (props) => {
|
|
57
|
+
const queryResult = useQuery({
|
|
58
|
+
queryKey: ["appleBundleId", props.iosBundleId],
|
|
59
|
+
queryFn: () => fetchBundleId(props)
|
|
60
|
+
});
|
|
61
|
+
return queryResult;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { fetchBundleId as f, useAppleBundleId as u };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { u as useJob } from './Command-Dn0P_KOV.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { u as useWebSocket } from './useWebSocket-Bep1zAVG.js';
|
|
4
|
+
import { E as castJobDates, F as castObjectDates } from './index-C9734Cj2.js';
|
|
5
|
+
|
|
6
|
+
function useJobWatching({ projectId, jobId, isWatching, onJobUpdate }) {
|
|
7
|
+
const [websocketJob, setWebsocketJob] = useState(null);
|
|
8
|
+
const [mostRecentLog, setMostRecentLog] = useState(null);
|
|
9
|
+
const jobStatusListener = {
|
|
10
|
+
getPattern: () => [`project.${projectId}:job:created`, `project.${projectId}:job:updated`],
|
|
11
|
+
eventHandler: async (pattern, rawJob) => {
|
|
12
|
+
if (rawJob.id !== jobId) return;
|
|
13
|
+
const job2 = castJobDates(rawJob);
|
|
14
|
+
setWebsocketJob(job2);
|
|
15
|
+
if (onJobUpdate) onJobUpdate(job2);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const jobProgressListener = {
|
|
19
|
+
getPattern: () => `project.${projectId}:job.${jobId}:log`,
|
|
20
|
+
eventHandler: async (pattern, rawLogEntry) => {
|
|
21
|
+
const logEntry = castObjectDates(rawLogEntry, ["sentAt", "createdAt"]);
|
|
22
|
+
setMostRecentLog(logEntry);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useWebSocket(isWatching ? [jobStatusListener, jobProgressListener] : []);
|
|
26
|
+
const { isLoading, data: job } = useJob({
|
|
27
|
+
projectId,
|
|
28
|
+
jobId
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setWebsocketJob(null);
|
|
32
|
+
}, [jobId, projectId, isWatching, job]);
|
|
33
|
+
const fetchedJob = job ? job : null;
|
|
34
|
+
const data = websocketJob ? websocketJob : fetchedJob;
|
|
35
|
+
const progress = mostRecentLog?.progress || null;
|
|
36
|
+
const stage = mostRecentLog?.stage || null;
|
|
37
|
+
return {
|
|
38
|
+
isLoading,
|
|
39
|
+
data,
|
|
40
|
+
progress,
|
|
41
|
+
stage
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useJobWatching as u };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { u as useJob } from './Command-YJJp90ru.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { u as useWebSocket } from './useWebSocket-rBLiZsKb.js';
|
|
4
|
+
import { E as castJobDates, F as castObjectDates } from './index-Bv3x8c78.js';
|
|
5
|
+
|
|
6
|
+
function useJobWatching({ projectId, jobId, isWatching, onJobUpdate }) {
|
|
7
|
+
const [websocketJob, setWebsocketJob] = useState(null);
|
|
8
|
+
const [mostRecentLog, setMostRecentLog] = useState(null);
|
|
9
|
+
const jobStatusListener = {
|
|
10
|
+
getPattern: () => [`project.${projectId}:job:created`, `project.${projectId}:job:updated`],
|
|
11
|
+
eventHandler: async (pattern, rawJob) => {
|
|
12
|
+
if (rawJob.id !== jobId) return;
|
|
13
|
+
const job2 = castJobDates(rawJob);
|
|
14
|
+
setWebsocketJob(job2);
|
|
15
|
+
if (onJobUpdate) onJobUpdate(job2);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const jobProgressListener = {
|
|
19
|
+
getPattern: () => `project.${projectId}:job.${jobId}:log`,
|
|
20
|
+
eventHandler: async (pattern, rawLogEntry) => {
|
|
21
|
+
const logEntry = castObjectDates(rawLogEntry, ["sentAt", "createdAt"]);
|
|
22
|
+
setMostRecentLog(logEntry);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useWebSocket(isWatching ? [jobStatusListener, jobProgressListener] : []);
|
|
26
|
+
const { isLoading, data: job } = useJob({
|
|
27
|
+
projectId,
|
|
28
|
+
jobId
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setWebsocketJob(null);
|
|
32
|
+
}, [jobId, projectId, isWatching, job]);
|
|
33
|
+
const fetchedJob = job ? job : null;
|
|
34
|
+
const data = websocketJob ? websocketJob : fetchedJob;
|
|
35
|
+
const progress = mostRecentLog?.progress || null;
|
|
36
|
+
const stage = mostRecentLog?.stage || null;
|
|
37
|
+
return {
|
|
38
|
+
isLoading,
|
|
39
|
+
data,
|
|
40
|
+
progress,
|
|
41
|
+
stage
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useJobWatching as u };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { u as useJob } from './Command-D6rWEZRM.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { u as useWebSocket } from './useWebSocket-CBqsjHbt.js';
|
|
4
|
+
import { E as castJobDates, F as castObjectDates } from './index-BB7X1Pqp.js';
|
|
5
|
+
|
|
6
|
+
function useJobWatching({ projectId, jobId, isWatching, onJobUpdate }) {
|
|
7
|
+
const [websocketJob, setWebsocketJob] = useState(null);
|
|
8
|
+
const [mostRecentLog, setMostRecentLog] = useState(null);
|
|
9
|
+
const jobStatusListener = {
|
|
10
|
+
getPattern: () => [`project.${projectId}:job:created`, `project.${projectId}:job:updated`],
|
|
11
|
+
eventHandler: async (pattern, rawJob) => {
|
|
12
|
+
if (rawJob.id !== jobId) return;
|
|
13
|
+
const job2 = castJobDates(rawJob);
|
|
14
|
+
setWebsocketJob(job2);
|
|
15
|
+
if (onJobUpdate) onJobUpdate(job2);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const jobProgressListener = {
|
|
19
|
+
getPattern: () => `project.${projectId}:job.${jobId}:log`,
|
|
20
|
+
eventHandler: async (pattern, rawLogEntry) => {
|
|
21
|
+
const logEntry = castObjectDates(rawLogEntry, ["sentAt", "createdAt"]);
|
|
22
|
+
setMostRecentLog(logEntry);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useWebSocket(isWatching ? [jobStatusListener, jobProgressListener] : []);
|
|
26
|
+
const { isLoading, data: job } = useJob({
|
|
27
|
+
projectId,
|
|
28
|
+
jobId
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setWebsocketJob(null);
|
|
32
|
+
}, [jobId, projectId, isWatching, job]);
|
|
33
|
+
const fetchedJob = job ? job : null;
|
|
34
|
+
const data = websocketJob ? websocketJob : fetchedJob;
|
|
35
|
+
const progress = mostRecentLog?.progress || null;
|
|
36
|
+
const stage = mostRecentLog?.stage || null;
|
|
37
|
+
return {
|
|
38
|
+
isLoading,
|
|
39
|
+
data,
|
|
40
|
+
progress,
|
|
41
|
+
stage
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useJobWatching as u };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { u as useJob } from './Command-BiB9MqbJ.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { u as useWebSocket } from './useWebSocket-CBqsjHbt.js';
|
|
4
|
+
import { E as castJobDates, F as castObjectDates } from './index-BB7X1Pqp.js';
|
|
5
|
+
|
|
6
|
+
function useJobWatching({ projectId, jobId, isWatching, onJobUpdate }) {
|
|
7
|
+
const [websocketJob, setWebsocketJob] = useState(null);
|
|
8
|
+
const [mostRecentLog, setMostRecentLog] = useState(null);
|
|
9
|
+
const jobStatusListener = {
|
|
10
|
+
getPattern: () => [`project.${projectId}:job:created`, `project.${projectId}:job:updated`],
|
|
11
|
+
eventHandler: async (pattern, rawJob) => {
|
|
12
|
+
if (rawJob.id !== jobId) return;
|
|
13
|
+
const job2 = castJobDates(rawJob);
|
|
14
|
+
setWebsocketJob(job2);
|
|
15
|
+
if (onJobUpdate) onJobUpdate(job2);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const jobProgressListener = {
|
|
19
|
+
getPattern: () => `project.${projectId}:job.${jobId}:log`,
|
|
20
|
+
eventHandler: async (pattern, rawLogEntry) => {
|
|
21
|
+
const logEntry = castObjectDates(rawLogEntry, ["sentAt", "createdAt"]);
|
|
22
|
+
setMostRecentLog(logEntry);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useWebSocket(isWatching ? [jobStatusListener, jobProgressListener] : []);
|
|
26
|
+
const { isLoading, data: job } = useJob({
|
|
27
|
+
projectId,
|
|
28
|
+
jobId
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setWebsocketJob(null);
|
|
32
|
+
}, [jobId, projectId, isWatching, job]);
|
|
33
|
+
const fetchedJob = job ? job : null;
|
|
34
|
+
const data = websocketJob ? websocketJob : fetchedJob;
|
|
35
|
+
const progress = mostRecentLog?.progress || null;
|
|
36
|
+
const stage = mostRecentLog?.stage || null;
|
|
37
|
+
return {
|
|
38
|
+
isLoading,
|
|
39
|
+
data,
|
|
40
|
+
progress,
|
|
41
|
+
stage
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useJobWatching as u };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-BDc7XpKE.js';
|
|
4
|
+
import { b as getShortDate, p as getAuthedHeaders, q as API_URL, K as castArrayObjectDates } from './index-Bv3x8c78.js';
|
|
5
|
+
import { g as getShortUUID } from './index-BQnkBr1Q.js';
|
|
6
|
+
|
|
7
|
+
async function queryProjectCredentials({
|
|
8
|
+
projectId,
|
|
9
|
+
...pageAndSortParams
|
|
10
|
+
}) {
|
|
11
|
+
try {
|
|
12
|
+
const headers = getAuthedHeaders();
|
|
13
|
+
const url = `${API_URL}/projects/${projectId}/credentials`;
|
|
14
|
+
const response = await axios.get(url, { headers, params: pageAndSortParams });
|
|
15
|
+
return {
|
|
16
|
+
...response.data,
|
|
17
|
+
data: castArrayObjectDates(response.data.data)
|
|
18
|
+
};
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("queryProjectCredentials Error", error);
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function getProjectCredentialSummary(credential) {
|
|
25
|
+
return {
|
|
26
|
+
id: getShortUUID(credential.id),
|
|
27
|
+
type: credential.type,
|
|
28
|
+
serial: credential.serialNumber.substring(0, 30) + (credential.serialNumber.length > 30 ? "\u2026" : ""),
|
|
29
|
+
isActive: credential.isActive,
|
|
30
|
+
createdAt: getShortDate(credential.createdAt)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const useProjectCredentials = ({
|
|
34
|
+
platform,
|
|
35
|
+
type,
|
|
36
|
+
...fetchProps
|
|
37
|
+
}) => {
|
|
38
|
+
const queryResult = useQuery({
|
|
39
|
+
queryKey: cacheKeys.projectCredentials(fetchProps),
|
|
40
|
+
queryFn: async () => queryProjectCredentials(fetchProps),
|
|
41
|
+
select: (data) => {
|
|
42
|
+
if (!(platform || type)) return data;
|
|
43
|
+
return {
|
|
44
|
+
...data,
|
|
45
|
+
data: data.data.filter((credential) => {
|
|
46
|
+
return (!platform || credential.platform === platform) && (!type || credential.type === type);
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return queryResult;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { getProjectCredentialSummary as g, useProjectCredentials as u };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-B_ekRewZ.js';
|
|
4
|
+
import { b as getShortDate, o as getAuthedHeaders, p as API_URL, M as castArrayObjectDates } from './index-C9734Cj2.js';
|
|
5
|
+
import { g as getShortUUID } from './index-DxHPjZav.js';
|
|
6
|
+
|
|
7
|
+
async function queryProjectCredentials({
|
|
8
|
+
projectId,
|
|
9
|
+
...pageAndSortParams
|
|
10
|
+
}) {
|
|
11
|
+
try {
|
|
12
|
+
const headers = getAuthedHeaders();
|
|
13
|
+
const url = `${API_URL}/projects/${projectId}/credentials`;
|
|
14
|
+
const response = await axios.get(url, { headers, params: pageAndSortParams });
|
|
15
|
+
return {
|
|
16
|
+
...response.data,
|
|
17
|
+
data: castArrayObjectDates(response.data.data)
|
|
18
|
+
};
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("queryProjectCredentials Error", error);
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function getProjectCredentialSummary(credential) {
|
|
25
|
+
return {
|
|
26
|
+
id: getShortUUID(credential.id),
|
|
27
|
+
type: credential.type,
|
|
28
|
+
serial: credential.serialNumber.substring(0, 30) + (credential.serialNumber.length > 30 ? "\u2026" : ""),
|
|
29
|
+
isActive: credential.isActive,
|
|
30
|
+
createdAt: getShortDate(credential.createdAt)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const useProjectCredentials = ({
|
|
34
|
+
platform,
|
|
35
|
+
type,
|
|
36
|
+
...fetchProps
|
|
37
|
+
}) => {
|
|
38
|
+
const queryResult = useQuery({
|
|
39
|
+
queryKey: cacheKeys.projectCredentials(fetchProps),
|
|
40
|
+
queryFn: async () => queryProjectCredentials(fetchProps),
|
|
41
|
+
select: (data) => {
|
|
42
|
+
if (!(platform || type)) return data;
|
|
43
|
+
return {
|
|
44
|
+
...data,
|
|
45
|
+
data: data.data.filter((credential) => {
|
|
46
|
+
return (!platform || credential.platform === platform) && (!type || credential.type === type);
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return queryResult;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { getProjectCredentialSummary as g, useProjectCredentials as u };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { c as cacheKeys } from './useAndroidServiceAccountTestResult-Ce1x0Eh8.js';
|
|
4
|
+
import { b as getShortDate, p as getAuthedHeaders, q as API_URL, K as castArrayObjectDates } from './index-BB7X1Pqp.js';
|
|
5
|
+
import { g as getShortUUID } from './index-Cz_KLwWf.js';
|
|
6
|
+
|
|
7
|
+
async function queryProjectCredentials({
|
|
8
|
+
projectId,
|
|
9
|
+
...pageAndSortParams
|
|
10
|
+
}) {
|
|
11
|
+
try {
|
|
12
|
+
const headers = getAuthedHeaders();
|
|
13
|
+
const url = `${API_URL}/projects/${projectId}/credentials`;
|
|
14
|
+
const response = await axios.get(url, { headers, params: pageAndSortParams });
|
|
15
|
+
return {
|
|
16
|
+
...response.data,
|
|
17
|
+
data: castArrayObjectDates(response.data.data)
|
|
18
|
+
};
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("queryProjectCredentials Error", error);
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function getProjectCredentialSummary(credential) {
|
|
25
|
+
return {
|
|
26
|
+
id: getShortUUID(credential.id),
|
|
27
|
+
type: credential.type,
|
|
28
|
+
serial: credential.serialNumber.substring(0, 30) + (credential.serialNumber.length > 30 ? "\u2026" : ""),
|
|
29
|
+
isActive: credential.isActive,
|
|
30
|
+
createdAt: getShortDate(credential.createdAt)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const useProjectCredentials = ({
|
|
34
|
+
platform,
|
|
35
|
+
type,
|
|
36
|
+
...fetchProps
|
|
37
|
+
}) => {
|
|
38
|
+
const queryResult = useQuery({
|
|
39
|
+
queryKey: cacheKeys.projectCredentials(fetchProps),
|
|
40
|
+
queryFn: async () => queryProjectCredentials(fetchProps),
|
|
41
|
+
select: (data) => {
|
|
42
|
+
if (!(platform || type)) return data;
|
|
43
|
+
return {
|
|
44
|
+
...data,
|
|
45
|
+
data: data.data.filter((credential) => {
|
|
46
|
+
return (!platform || credential.platform === platform) && (!type || credential.type === type);
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return queryResult;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { getProjectCredentialSummary as g, useProjectCredentials as u };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { io } from 'socket.io-client';
|
|
3
|
+
import { N as getAuthToken, W as WS_URL } from './index-C9734Cj2.js';
|
|
4
|
+
|
|
5
|
+
function useWebSocket(listeners = []) {
|
|
6
|
+
const log = () => {
|
|
7
|
+
};
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (listeners.length === 0) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const token = getAuthToken();
|
|
13
|
+
const socket = io(WS_URL, {
|
|
14
|
+
auth: { token },
|
|
15
|
+
forceNew: true
|
|
16
|
+
});
|
|
17
|
+
socket.on("connect", () => log());
|
|
18
|
+
for (const listener of listeners) {
|
|
19
|
+
const pattern = listener.getPattern();
|
|
20
|
+
const bindSocket = (pattern2) => {
|
|
21
|
+
const boundListener = listener.eventHandler.bind(listener, pattern2);
|
|
22
|
+
socket.on(pattern2, boundListener);
|
|
23
|
+
};
|
|
24
|
+
if (Array.isArray(pattern)) {
|
|
25
|
+
pattern.forEach(bindSocket);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
bindSocket(pattern);
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
socket.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { useWebSocket as u };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { io } from 'socket.io-client';
|
|
3
|
+
import { N as getAuthToken, W as WS_URL } from './index-BB7X1Pqp.js';
|
|
4
|
+
|
|
5
|
+
function useWebSocket(listeners = []) {
|
|
6
|
+
const log = () => {
|
|
7
|
+
};
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (listeners.length === 0) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const token = getAuthToken();
|
|
13
|
+
const socket = io(WS_URL, {
|
|
14
|
+
auth: { token },
|
|
15
|
+
forceNew: true
|
|
16
|
+
});
|
|
17
|
+
socket.on("connect", () => log());
|
|
18
|
+
for (const listener of listeners) {
|
|
19
|
+
const pattern = listener.getPattern();
|
|
20
|
+
const bindSocket = (pattern2) => {
|
|
21
|
+
const boundListener = listener.eventHandler.bind(listener, pattern2);
|
|
22
|
+
socket.on(pattern2, boundListener);
|
|
23
|
+
};
|
|
24
|
+
if (Array.isArray(pattern)) {
|
|
25
|
+
pattern.forEach(bindSocket);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
bindSocket(pattern);
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
socket.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { useWebSocket as u };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { io } from 'socket.io-client';
|
|
3
|
+
import { N as getAuthToken, W as WS_URL } from './index-Bv3x8c78.js';
|
|
4
|
+
|
|
5
|
+
function useWebSocket(listeners = []) {
|
|
6
|
+
const log = () => {
|
|
7
|
+
};
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (listeners.length === 0) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const token = getAuthToken();
|
|
13
|
+
const socket = io(WS_URL, {
|
|
14
|
+
auth: { token },
|
|
15
|
+
forceNew: true
|
|
16
|
+
});
|
|
17
|
+
socket.on("connect", () => log());
|
|
18
|
+
for (const listener of listeners) {
|
|
19
|
+
const pattern = listener.getPattern();
|
|
20
|
+
const bindSocket = (pattern2) => {
|
|
21
|
+
const boundListener = listener.eventHandler.bind(listener, pattern2);
|
|
22
|
+
socket.on(pattern2, boundListener);
|
|
23
|
+
};
|
|
24
|
+
if (Array.isArray(pattern)) {
|
|
25
|
+
pattern.forEach(bindSocket);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
bindSocket(pattern);
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
socket.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { useWebSocket as u };
|